From 2be18856976036db90fc13c90b1d364b00e1807d Mon Sep 17 00:00:00 2001 From: neozaru Date: Fri, 6 Aug 2021 14:56:36 +0200 Subject: [PATCH 1/8] fix: VEN-54 nonce/signature/symbols and timestamps --- src/spec/swagger-overlay.json | 28 ++++++------ src/spec/swagger-v11--submitted.json | 68 ++++++++++++++-------------- trading/js/SubmitOrder.js | 2 +- trading/python/SubmitOrder.py | 2 +- 4 files changed, 50 insertions(+), 50 deletions(-) diff --git a/src/spec/swagger-overlay.json b/src/spec/swagger-overlay.json index ac2e4aa..6b417d2 100644 --- a/src/spec/swagger-overlay.json +++ b/src/spec/swagger-overlay.json @@ -196,7 +196,7 @@ "type":"string", "required":false, "description":"The end date and time (Unix timestamp in milliseconds) for which the trade volumes are requested. If startDate and endDate are not provided, it returns the volume ranking if all time.", - "x-example":1577923200000 + "x-example":1747384800000 } ], "tags":[ @@ -262,7 +262,7 @@ "type":"string", "required":false, "description":"The end date and time (Unix timestamp in milliseconds) for which events are requested.If startDate and endDate are not provided, it returns the volume ranking if all time.", - "x-example":1577923200000 + "x-example":1747384800000 } ], "tags":[ @@ -316,7 +316,7 @@ "name": "nonce", "in": "query", "required": true, - "x-example": "1579901055.575" + "x-example": "v2-1704114061.000" }, { "type": "string", @@ -324,7 +324,7 @@ "name": "signature", "in": "query", "required": true, - "x-example": "0x494a2c166f95518dcf5a9484fcb702a454382f281f96ba41639fe3a2af279fdc1e3b4e5aa2f585a9a40fb5aaabf10b5390ed5592d502c7799a261f81219491f001" + "x-example": "0x2b48d53f2e3a696630ebdcd1ff057556bbc9de9c294adfaa5b1f13df91b67b347fdd88c29594c377ba0024dec40cd9808829e7f4447772482f50a7a8e9a903561c" }, { "type": "string", @@ -362,7 +362,7 @@ "name": "nonce", "in": "query", "required": true, - "x-example": "1579901055.575" + "x-example": "v2-1704114061.000" }, { "type": "string", @@ -370,7 +370,7 @@ "name": "signature", "in": "query", "required": true, - "x-example": "0x494a2c166f95518dcf5a9484fcb702a454382f281f96ba41639fe3a2af279fdc1e3b4e5aa2f585a9a40fb5aaabf10b5390ed5592d502c7799a261f81219491f001" + "x-example": "0x2b48d53f2e3a696630ebdcd1ff057556bbc9de9c294adfaa5b1f13df91b67b347fdd88c29594c377ba0024dec40cd9808829e7f4447772482f50a7a8e9a903561c" } ], "tags":[ @@ -440,7 +440,7 @@ "name": "nonce", "in": "query", "required": true, - "x-example": "1579901055.575" + "x-example": "v2-1704114061.000" }, { "type": "string", @@ -448,7 +448,7 @@ "name": "signature", "in": "query", "required": true, - "x-example": "0x494a2c166f95518dcf5a9484fcb702a454382f281f96ba41639fe3a2af279fdc1e3b4e5aa2f585a9a40fb5aaabf10b5390ed5592d502c7799a261f81219491f001" + "x-example": "0x2b48d53f2e3a696630ebdcd1ff057556bbc9de9c294adfaa5b1f13df91b67b347fdd88c29594c377ba0024dec40cd9808829e7f4447772482f50a7a8e9a903561c" } ], "tags":[ @@ -1239,7 +1239,7 @@ "price":183.5, "base_volume":1.8, "quote_volume":381.28, - "timestamp": 1577923200000, + "timestamp": 1747384800000, "type": "buy" } ] @@ -1266,7 +1266,7 @@ "name":"StartDate", "type":"number", "description":"Date of the last trade returned.", - "x-example":1547384800 + "x-example":1747384800000 }, { "in":"path", @@ -1530,7 +1530,7 @@ "nonce": { "type": "string", "description": "This nonce which used to provide the time until which this nonce is valid. It is presented as seconds since epoch.", - "example": "1776156902.058" + "example": "v2-1704114061.000" }, "signature": { "type": "string", @@ -1980,7 +1980,7 @@ "examples":{ "application/json":[ [ - "BTC:USD", + "BTC:USDT", 8719.7, 34.58126956, 8722.2, @@ -1993,7 +1993,7 @@ 8449.3 ], [ - "LTC:USD", + "LTC:USDT", 57.875, 1297.95111409, 57.931, @@ -2139,7 +2139,7 @@ "type":"string", "required":false, "description":"Filter end (time since epoch in ms). Only when section is 'hist' Defaults to now.", - "x-example":"1577923200000" + "x-example":"1747384800000" }, { "in":"query", diff --git a/src/spec/swagger-v11--submitted.json b/src/spec/swagger-v11--submitted.json index d5bcb74..18ea003 100644 --- a/src/spec/swagger-v11--submitted.json +++ b/src/spec/swagger-v11--submitted.json @@ -62,14 +62,14 @@ "name":"nonce", "in":"query", "required":true, - "example": "1579901055.575" + "example": "v2-1704114061.000" }, { "type":"string", "name":"signature", "in":"query", "required":true, - "example": "0x0277b6e85ffdfb8cdc34c89b8b60c42a1a96a57e1b528ca3ff203b2dac8c9a200dbedd5ab8d2ed7ef19e915daf00327db91c1f5a1988666089e6b8420881699501" + "example": "0x2b48d53f2e3a696630ebdcd1ff057556bbc9de9c294adfaa5b1f13df91b67b347fdd88c29594c377ba0024dec40cd9808829e7f4447772482f50a7a8e9a903561c" } ], "tags":[ @@ -95,7 +95,7 @@ "name":"nonce", "in":"query", "required":true, - "example": "1579901055.575" + "example": "v2-1704114061.000" }, { "type":"string", @@ -177,7 +177,7 @@ "description": "This nonce which used to provide the time until which this nonce is valid. It is presented as seconds since epoch.", "in":"query", "required":true, - "example": "1579901055.575" + "example": "v2-1704114061.000" }, { "type":"string", @@ -322,7 +322,7 @@ "description":"Date of the last deposit returned.", "name":"startDate", "in":"query", - "x-example":1595337548241 + "x-example":1747384800000 }, { "type":"number", @@ -504,7 +504,7 @@ "description":"Date of the last order returned.", "name":"startDate", "in":"query", - "x-example":1595337548241 + "x-example":1747384800000 }, { "type":"number", @@ -540,7 +540,7 @@ "description":"Date of the last withdraw returned.", "name":"startDate", "in":"query", - "x-example":1595337548241 + "x-example":1747384800000 }, { "type":"number", @@ -940,7 +940,7 @@ "name":"StartDate", "type":"number", "description":"The Unix timestamp in milliseconds for the start period for the query.", - "x-example":1547384800 + "x-example":1747384800000 }, { "in":"path", @@ -1115,12 +1115,12 @@ "nonce": { "type": "string", "description": "This nonce which used to provide the time until which this nonce is valid. It is presented as seconds since epoch.", - "example": "1776156902.058" + "example": "v2-1704114061.000" }, "signature": { "type": "string", "description": "The signature obtained by signing the nonce with your private ethereum key.", - "example": "0x0277b6e85ffdfb8cdc34c89b8b60c42a1a96a57e1b528ca3ff203b2dac8c9a200dbedd5ab8d2ed7ef19e915daf00327db91c1f5a1988666089e6b8420881699501" + "example": "0x2b48d53f2e3a696630ebdcd1ff057556bbc9de9c294adfaa5b1f13df91b67b347fdd88c29594c377ba0024dec40cd9808829e7f4447772482f50a7a8e9a903561c" } } } @@ -1408,12 +1408,12 @@ "nonce": { "type": "string", "description": "This nonce which used to provide the time until which this nonce is valid. It is presented as seconds since epoch.", - "example": "1776156902.058" + "example": "v2-1704114061.000" }, "signature": { "type": "string", "description": "The signature obtained by signing the nonce with your private ethereum key.", - "example": "0x0277b6e85ffdfb8cdc34c89b8b60c42a1a96a57e1b528ca3ff203b2dac8c9a200dbedd5ab8d2ed7ef19e915daf00327db91c1f5a1988666089e6b8420881699501" + "example": "0x2b48d53f2e3a696630ebdcd1ff057556bbc9de9c294adfaa5b1f13df91b67b347fdd88c29594c377ba0024dec40cd9808829e7f4447772482f50a7a8e9a903561c" }, "token": { "type": "string", @@ -1596,12 +1596,12 @@ "nonce":{ "type":"string", "description":"This nonce is used to provide the time until which this nonce is valid. It is presented as seconds since epoch.", - "example":"1579901055.575" + "example":"v2-1704114061.000" }, "signature":{ "type":"string", "description":"The signature obtained by signing the nonce with your private ethereum key.", - "example":"0x494a2c166f95518dcf5a9484fcb702a454382f281f96ba41639fe3a2af279fdc1e3b4e5aa2f585a9a40fb5aaabf10b5390ed5592d502c7799a261f81219491f001" + "example":"0x2b48d53f2e3a696630ebdcd1ff057556bbc9de9c294adfaa5b1f13df91b67b347fdd88c29594c377ba0024dec40cd9808829e7f4447772482f50a7a8e9a903561c" }, "token":{ "type":"string", @@ -1782,7 +1782,7 @@ "nonce": { "type": "string", "description": "This nonce is used to provide the time until which this nonce is valid. It is presented as seconds since epoch.", - "example": "1579901055.575" + "example": "v2-1704114061.000" }, "signature": { "type": "string", @@ -1833,12 +1833,12 @@ "nonce": { "type": "string", "description": "This nonce is used to provide the time until which this nonce is valid. It is presented as seconds since epoch.", - "example": "1579901055.575" + "example": "v2-1704114061.000" }, "signature": { "type": "string", "description": "The signature obtained by signing the nonce with your private ethereum key.", - "example": "0x494a2c166f95518dcf5a9484fcb702a454382f281f96ba41639fe3a2af279fdc1e3b4e5aa2f585a9a40fb5aaabf10b5390ed5592d502c7799a261f81219491f001" + "example": "0x2b48d53f2e3a696630ebdcd1ff057556bbc9de9c294adfaa5b1f13df91b67b347fdd88c29594c377ba0024dec40cd9808829e7f4447772482f50a7a8e9a903561c" }, "token":{ "type":"string", @@ -1857,12 +1857,12 @@ "nonce":{ "type":"string", "description":"A user generated nonce.", - "example": "1579901055.575" + "example": "v2-1704114061.000" }, "signature":{ "type":"string", "description":"The signed hash (signature) received during the pre-registration process.", - "example":"0x494a2c166f95518dcf5a9484fcb702a454382f281f96ba41639fe3a2af279fdc1e3b4e5aa2f585a9a40fb5aaabf10b5390ed5592d502c7799a261f81219491f001" + "example":"0x2b48d53f2e3a696630ebdcd1ff057556bbc9de9c294adfaa5b1f13df91b67b347fdd88c29594c377ba0024dec40cd9808829e7f4447772482f50a7a8e9a903561c" } }, "required":[ @@ -1928,17 +1928,17 @@ "withdrawalId":{ "type":"string", "description":"Used to identify a specific withdrawal.", - "example":"1a2b3c" + "example":"i6JjTE2PDL" }, "nonce":{ "type":"string", "description":"This nonce is used to provide the time until which this nonce is valid. It is presented as seconds since epoch.", - "example": "1579901055.575" + "example": "v2-1704114061.000" }, "signature":{ "type":"string", "description":"The signature obtained by signing the nonce with your private ethereum key.", - "example":"0x494a2c166f95518dcf5a9484fcb702a454382f281f96ba41639fe3a2af279fdc1e3b4e5aa2f585a9a40fb5aaabf10b5390ed5592d502c7799a261f81219491f001" + "example":"0x2b48d53f2e3a696630ebdcd1ff057556bbc9de9c294adfaa5b1f13df91b67b347fdd88c29594c377ba0024dec40cd9808829e7f4447772482f50a7a8e9a903561c" } }, "required":[ @@ -1987,17 +1987,17 @@ "nonce": { "type": "string", "description": "This nonce is used to provide the time until which this nonce is valid. It is presented as seconds since epoch.", - "example": "1579901055.575" + "example": "v2-1704114061.000" }, "signature": { "type": "string", "description": "The signature obtained by signing the nonce with your private ethereum key.", - "example": "0x494a2c166f95518dcf5a9484fcb702a454382f281f96ba41639fe3a2af279fdc1e3b4e5aa2f585a9a40fb5aaabf10b5390ed5592d502c7799a261f81219491f001" + "example": "0x2b48d53f2e3a696630ebdcd1ff057556bbc9de9c294adfaa5b1f13df91b67b347fdd88c29594c377ba0024dec40cd9808829e7f4447772482f50a7a8e9a903561c" }, "symbol": { "type": "string", "description": "Specifies the trading pair.", - "example": "ETH:USD" + "example": "ETH:USDT" } }, "required": ["nonce", "signature"] @@ -2123,17 +2123,17 @@ "nonce": { "type": "string", "description": "This nonce is used to provide the time until which this nonce is valid. It is presented as seconds since epoch.", - "example": "1579901055.575" + "example": "v2-1704114061.000" }, "signature": { "type": "string", "description": "The signature obtained by signing the nonce with your private ethereum key.", - "example": "0x494a2c166f95518dcf5a9484fcb702a454382f281f96ba41639fe3a2af279fdc1e3b4e5aa2f585a9a40fb5aaabf10b5390ed5592d502c7799a261f81219491f001" + "example": "0x2b48d53f2e3a696630ebdcd1ff057556bbc9de9c294adfaa5b1f13df91b67b347fdd88c29594c377ba0024dec40cd9808829e7f4447772482f50a7a8e9a903561c" }, "symbol": { "type": "string", "description": "Specifies the trading pair.", - "example": "ETH:USD" + "example": "ETH:USDT" } }, "required": ["nonce", "signature"] @@ -2258,7 +2258,7 @@ "nonce": { "type": "string", "description": "This nonce is used to provide the time until which this nonce is valid. It is presented as seconds since epoch.", - "example": "1579901055.575" + "example": "v2-1704114061.000" }, "signature":{ "type":"string", @@ -2298,7 +2298,7 @@ "nonce": { "type": "string", "description": "This nonce is used to provide the time until which this nonce is valid. It is presented as seconds since epoch.", - "example": "1579901055.575" + "example": "v2-1704114061.000" }, "signature":{ "type":"string", @@ -2392,7 +2392,7 @@ "nonce": { "type": "string", "description": "This nonce is used to provide the time until which this nonce is valid. It is presented as seconds since epoch.", - "example": "1579901055.575", + "example": 162543006, "required":true }, "token":{ @@ -2852,7 +2852,7 @@ "nonce":{ "type":"number", "description": "This nonce which used to provide the time until which this nonce is valid. It is presented as seconds since epoch.", - "example": 1579901055.575 + "example": "v2-1704114061.000" }, "starkPublicKey":{ "type":"object", @@ -3108,12 +3108,12 @@ "nonce": { "type": "string", "description": "This nonce which used to provide the time until which this nonce is valid. It is presented as seconds since epoch.", - "example": "1776156902.058" + "example": "v2-1704114061.000" }, "signature": { "type": "string", "description": "The signature obtained by signing the nonce with your private ethereum key.", - "example": "0x0277b6e85ffdfb8cdc34c89b8b60c42a1a96a57e1b528ca3ff203b2dac8c9a200dbedd5ab8d2ed7ef19e915daf00327db91c1f5a1988666089e6b8420881699501" + "example": "0x2b48d53f2e3a696630ebdcd1ff057556bbc9de9c294adfaa5b1f13df91b67b347fdd88c29594c377ba0024dec40cd9808829e7f4447772482f50a7a8e9a903561c" }, "key": { "type": "string", diff --git a/trading/js/SubmitOrder.js b/trading/js/SubmitOrder.js index 1944883..ea74c95 100644 --- a/trading/js/SubmitOrder.js +++ b/trading/js/SubmitOrder.js @@ -44,7 +44,7 @@ const payload = { "cid": "", "gid": "", "type": "EXCHANGE LIMIT", - "symbol": "ETH:USD", + "symbol": "ETH:USDT", "amount": "1", "price": 140, "meta": { diff --git a/trading/python/SubmitOrder.py b/trading/python/SubmitOrder.py index 48e6d09..dbd9d75 100644 --- a/trading/python/SubmitOrder.py +++ b/trading/python/SubmitOrder.py @@ -49,7 +49,7 @@ "cid": "", "gid": "", "type": "EXCHANGE LIMIT", - "symbol": "ETH:USD", + "symbol": "ETH:USDT", "amount": "1", "price": 140, "meta": { From a7adcef1eb1214bfcdf023c793dceace00dd5a48 Mon Sep 17 00:00:00 2001 From: neozaru Date: Fri, 13 Aug 2021 12:54:49 +0200 Subject: [PATCH 2/8] doc: VEN-54 add new endpoints and manage examples --- package.json | 1 + src/spec/forEachEndpoint.js | 6 +- src/spec/getEndpoints.js | 60 +- src/spec/getExtraHeaders.js | 15 + src/spec/getHeadersWithExtras.js | 9 + src/spec/getParamExample.js | 15 + src/spec/getSidebar.js | 4 +- src/spec/index.js | 16 +- src/spec/makeCurlCode.js | 13 +- src/spec/makeJsCode.js | 11 +- src/spec/makePythonCode.js | 13 +- src/spec/mapeCppCode.js | 11 +- src/spec/swagger-overlay.json | 275 +- src/spec/swagger-v11--submitted.json | 3273 ----------- src/spec/swagger-v12--submitted.json | 7482 ++++++++++++++++++++++++++ src/spec/tryEndpoint.js | 15 +- src/ui/Docs/TryEndpoint.jsx | 5 +- yarn.lock | 5 + 18 files changed, 7700 insertions(+), 3529 deletions(-) create mode 100644 src/spec/getExtraHeaders.js create mode 100644 src/spec/getHeadersWithExtras.js create mode 100644 src/spec/getParamExample.js delete mode 100644 src/spec/swagger-v11--submitted.json create mode 100644 src/spec/swagger-v12--submitted.json diff --git a/package.json b/package.json index 95256bc..4f17e20 100644 --- a/package.json +++ b/package.json @@ -12,6 +12,7 @@ "dependencies": { "@babel/polyfill": "^7.8.3", "highlight-words-core": "^1.2.2", + "lodash.mapvalues": "^4.6.0", "lodash.merge": "^4.6.2", "prismjs": "^1.23.0", "react": "^16.12.0", diff --git a/src/spec/forEachEndpoint.js b/src/spec/forEachEndpoint.js index 3488dd0..7a0ab5b 100644 --- a/src/spec/forEachEndpoint.js +++ b/src/spec/forEachEndpoint.js @@ -1,6 +1,10 @@ export function forEachEndpoint(spec, cb) { for (const path in spec.paths) { - for (const method in spec.paths[path]) { + const methods = Object.keys(spec.paths[path]) + // TODO: Multiple methods per path was flaky + // hence the choice of taking the first vs. all + if (methods.length > 0) { + const method = methods[0] cb(spec.paths[path][method], path, method); } } diff --git a/src/spec/getEndpoints.js b/src/spec/getEndpoints.js index ba3e788..3aded3c 100644 --- a/src/spec/getEndpoints.js +++ b/src/spec/getEndpoints.js @@ -1,3 +1,4 @@ +import mapValues from 'lodash.mapvalues' import {forEachEndpoint} from './forEachEndpoint'; import {getBodyExample} from './getBodyExample'; import {makeJsCode, makeWsJsCode} from './makeJsCode'; @@ -5,6 +6,7 @@ import {makePythonCode, makeWsPythonCode} from './makePythonCode'; import {makeCppCode, makeWsCppCode} from './mapeCppCode'; import {makeCurlCode} from './makeCurlCode'; import {makeWscatCode} from './makeWscatCode'; +import { getParamExample } from './getParamExample'; export function getEndpoints(spec) { const endpoints = []; @@ -15,15 +17,15 @@ export function getEndpoints(spec) { const responses = getResponses(entry); const calls = getCalls(spec, entry, path, method); const parameters = getParameters(entry); + const headers = getHeaders(entry); const body = getBodyExample(entry); const responsesDetails = getResponsesDetails(entry); const protocol = method === 'ws' ? 'wss' : 'https'; - const requestDetails = getRequestDetails(entry) const endpoint = { method: method.toUpperCase(), - title: entry.title, + title: entry.title || path, name: entry.operationId, link: '#' + entry.operationId, path: `${protocol}://${spec.host}${path}`, @@ -31,6 +33,7 @@ export function getEndpoints(spec) { calls, responses, parameters, + headers, body: body ? JSON.stringify(body, null, 4) : undefined, responsesDetails, requestDetails @@ -51,7 +54,12 @@ export function getEndpoints(spec) { function getParameters(entry) { if (!entry.parameters) return; - return entry.parameters.filter(parameter => parameter.in !== 'body'); + return entry.parameters.filter(parameter => parameter.in !== 'body' && parameter.in !== 'header'); +} + +function getHeaders(entry) { + if (!entry.parameters) return; + return entry.parameters.filter(parameter => parameter.in === 'header'); } function getCalls(spec, entry, path, method) { @@ -80,13 +88,48 @@ function getCalls(spec, entry, path, method) { ]; } +function buildExample(schema) { + const schemaWideExample = getParamExample(schema) + if (schemaWideExample !== undefined) { + return schemaWideExample + } + if (schema.properties) { + return mapValues(schema.properties, prop => { + const propExample = getParamExample(prop) || buildExample(prop) + if (propExample === undefined) { + console.warn('Missing example in one of object properties', schema, prop) + throw new Error('Missing example in one of object properties', {schema, prop}) + } + return propExample + }) + } else if (schema.items) { + return [ buildExample(schema.items) ] + } + +} + function getResponses(entry) { const responses = []; - const hasDefault = Object.keys(entry.responses).includes('default'); + + if (!entry.responses) { + console.warn('No responses for entry', entry) + } + + const hasDefault = entry.responses.default && + entry.responses.default.schema for (const key in entry.responses) { const response = entry.responses[key]; + // Overlay let example = response.examples && response.examples['application/json']; + + // Examples directly from Joi + if (!example && response.schema) { + try { + example = buildExample(response.schema) + } catch (e) {} + } + example = example && JSON.stringify(example, null, 2); if (hasDefault && key === '200') { @@ -105,10 +148,11 @@ function getResponses(entry) { } function getResponsesDetails(entry) { - // TODO: currently docs don't support model $ref, - // all default responses are defined manually in overlay - - const hasDefault = Object.keys(entry.responses).includes('default'); + if (!entry.responses) { + console.warn('No responses for entry', entry) + } + const hasDefault = entry.responses.default && + entry.responses.default.schema; if (!hasDefault) { entry.responses.default = entry.responses['200']; diff --git a/src/spec/getExtraHeaders.js b/src/spec/getExtraHeaders.js new file mode 100644 index 0000000..8208142 --- /dev/null +++ b/src/spec/getExtraHeaders.js @@ -0,0 +1,15 @@ + + +// Extracts headers to be added in examples and code snippets +// In this case, we want to add authorization headers so example queries + +import { getParamExample } from './getParamExample' + +export function getExtraHeaders(headerParams = []) { + const extraHeaders = {} + headerParams.forEach(header => { + ['authorization'].includes(header.name) + extraHeaders[header.name] = getParamExample(header) + }) + return extraHeaders +} diff --git a/src/spec/getHeadersWithExtras.js b/src/spec/getHeadersWithExtras.js new file mode 100644 index 0000000..414186d --- /dev/null +++ b/src/spec/getHeadersWithExtras.js @@ -0,0 +1,9 @@ +import { getExtraHeaders } from './getExtraHeaders'; + +export function getHeadersWithExtras(extraHeaderParams) { + return { + 'Accept': 'application/json', + 'Content-Type': 'application/json', + ...getExtraHeaders(extraHeaderParams) + } +} diff --git a/src/spec/getParamExample.js b/src/spec/getParamExample.js new file mode 100644 index 0000000..9b53828 --- /dev/null +++ b/src/spec/getParamExample.js @@ -0,0 +1,15 @@ + +export function getParamExample(queryParam = {}) { + if (queryParam.hasOwnProperty('example')) { + return queryParam['example'] + } + if (queryParam.hasOwnProperty('x-example')) { + return queryParam['x-example'] + } + if (queryParam.hasOwnProperty('default')) { + return queryParam.default + } + if (queryParam.enum && queryParam.enum.length > 0) { + return queryParam.enum[0] + } +} \ No newline at end of file diff --git a/src/spec/getSidebar.js b/src/spec/getSidebar.js index 6fbf9a4..6cb0f2e 100644 --- a/src/spec/getSidebar.js +++ b/src/spec/getSidebar.js @@ -2,11 +2,11 @@ import {forEachEndpoint} from './forEachEndpoint'; export function getSidebar(spec) { const categories = new Map(); - forEachEndpoint(spec, (entry) => { + forEachEndpoint(spec, (entry, orgPath) => { const categoryName = entry.tags && entry.tags[0]; const category = categories.get(categoryName) || {name: categoryName, items: []}; category.items.push({ - title: entry.title, + title: entry.title || orgPath, name: entry.operationId, link: '#' + entry.operationId, }); diff --git a/src/spec/index.js b/src/spec/index.js index 6697450..f9017b8 100644 --- a/src/spec/index.js +++ b/src/spec/index.js @@ -1,5 +1,5 @@ -import swaggerData from './swagger-v11--submitted.json'; +import swaggerData from './swagger-v12--submitted.json'; import swaggerMarketData from './swagger-market-data.json'; import swaggerOverlay from './swagger-overlay.json'; import {preprocess} from './preprocess'; @@ -10,17 +10,21 @@ const parseRefs = (properties, definitions) => { // if sub param is object check its subtree if (properties[propKey].type === 'object' && properties[propKey].properties) { parseRefs(properties[propKey].properties, definitions) + } else if (properties[propKey].type === 'array') { + parseRefs(properties[propKey], definitions) // if has $ref, replace with definition } else if (properties[propKey].$ref) { - properties[propKey] = definitions[properties[propKey].$ref.replace('#/definitions/', '')] + const definitionKey = properties[propKey].$ref.replace('#/definitions/', '') + properties[propKey] = definitions[definitionKey] // also parse definition if it has subtrees - parseRefs(properties[propKey]) + parseRefs(properties[propKey], definitions) } }) } const conciliation = data => { const {paths, definitions} = data; + parseRefs(definitions, definitions) Object.keys(paths).forEach(pathKey => { Object.keys(paths[pathKey]).forEach(methodKey => { const item = paths[pathKey][methodKey] || {}; @@ -31,12 +35,16 @@ const conciliation = data => { parameters.forEach(param => { if (param.schema && param.schema.$ref) { param.schema = definitions[param.schema.$ref.replace('#/definitions/', '')]; - parseRefs(param.schema.properties, definitions) } }); Object.keys(responses).forEach(responseKey => { + const response = responses[responseKey] + if (!response) { + console.warn(`Ignoring key ${responseKey} for responses because it is empty`) + return + } const {schema} = responses[responseKey]; if (schema && schema.$ref) { responses[responseKey].schema = definitions[schema.$ref.replace('#/definitions/', '')]; diff --git a/src/spec/makeCurlCode.js b/src/spec/makeCurlCode.js index 3a7da19..7ff1085 100644 --- a/src/spec/makeCurlCode.js +++ b/src/spec/makeCurlCode.js @@ -1,13 +1,19 @@ import {getBodyExample} from './getBodyExample'; +import { getExtraHeaders } from './getExtraHeaders'; +import { getHeadersWithExtras } from './getHeadersWithExtras'; export function makeCurlCode(spec, entry, path, method) { let url = `https://${spec.host}${path}`; - for (const variable of (entry.parameters || [])) { + + const parameters = entry.parameters || [] + for (const variable of parameters) { if (variable.in === 'path') { const value = variable['x-example'] ? variable['x-example'] : '???'; url = url.replace(`{${variable.name}}`, value); } } + + const headers = getHeadersWithExtras(parameters.filter(variable => variable.in === 'header')) const queryParams = (entry.parameters || []) .filter(x => x.in === 'query' && x['x-example']) .map(x => `${x.name}=${x['x-example']}`) @@ -17,12 +23,11 @@ export function makeCurlCode(spec, entry, path, method) { } let code = `curl \\ -X ${method.toUpperCase()} \\ - -H "Accept: application/json" \\ - -H "Content-Type: application/json" \\\n`; + ${Object.entries(headers).map(([key, value]) => `-H "${key}: ${value}"`).join(` \\\n `)} \\\n`; const body = getBodyExample(entry); if (body) { code += ` -d '${JSON.stringify(body).replace(/'/g, '\\\'')}' \\\n`; } - code += ` ${url}`; + code += ` "${url}"`; return code; } diff --git a/src/spec/makeJsCode.js b/src/spec/makeJsCode.js index d4e659a..9d9df87 100644 --- a/src/spec/makeJsCode.js +++ b/src/spec/makeJsCode.js @@ -1,4 +1,5 @@ import {getExampleFromSchema} from './getBodyExample'; +import { getHeadersWithExtras } from './getHeadersWithExtras'; export function makeJsCode(spec, entry, path, method) { const queryLine = getQueryLine(entry.parameters); @@ -10,7 +11,7 @@ export function makeJsCode(spec, entry, path, method) { ' const response = await fetch(url, {\n' + getMethod(method) + getBody(entry.parameters) + - getHeaders() + + getHeaders(entry.parameters) + ' });\n' + ' return response.json();\n' + '}' @@ -119,11 +120,13 @@ export function getWsSubscribeParams(parameters, operationId) { return subParams; } -function getHeaders() { +function getHeaders(parameters = []) { return ( ' headers: {\n' + - ' "Accept": "application/json",\n' + - ' "Content-Type": "application/json",\n' + + Object.entries( + getHeadersWithExtras(parameters.filter(parameter => parameter.in === 'header')) + ).map(([key, value]) => ` "${key}": "${value}"`) + .join(',\n') + '\n' + ' },\n' ); } diff --git a/src/spec/makePythonCode.js b/src/spec/makePythonCode.js index b467ceb..d786e8e 100644 --- a/src/spec/makePythonCode.js +++ b/src/spec/makePythonCode.js @@ -1,4 +1,5 @@ import {getExampleFromSchema} from './getBodyExample'; +import { getHeadersWithExtras } from './getHeadersWithExtras'; import {getWsSubscribeParams} from './makeJsCode'; export function makePythonCode(spec, entry, path, method) { @@ -7,7 +8,7 @@ export function makePythonCode(spec, entry, path, method) { 'import requests\n' + 'import json\n' + '\n' + - getHeaders() + + getHeaders(entry.parameters) + getParams(entry.parameters) + getUrlLine(spec.host, path) + queryLine + @@ -80,11 +81,15 @@ function getBody(parameters) { : ''; } -function getHeaders() { +function getHeaders(parameters = []) { return ( 'headers = {\n' + - ' "Accept": "application/json",\n' + - ' "Content-Type": "application/json",\n' + + Object.entries( + getHeadersWithExtras(parameters.filter(parameter => parameter.in === 'header')) + ).map(([key, value]) => ` "${key}": "${value}"`) + .join(',\n') + '\n' + + // ' "Accept": "application/json",\n' + + // ' "Content-Type": "application/json",\n' + '}\n\n' ); } diff --git a/src/spec/mapeCppCode.js b/src/spec/mapeCppCode.js index f3fe782..225404e 100644 --- a/src/spec/mapeCppCode.js +++ b/src/spec/mapeCppCode.js @@ -1,8 +1,10 @@ import {getExampleFromSchema} from './getBodyExample'; +import { getHeadersWithExtras } from './getHeadersWithExtras'; import {getWsSubscribeParams} from './makeJsCode'; export function makeCppCode(spec, entry, path, method) { - const variableInit = (entry.parameters || []) + const parameters = (entry.parameters || []) + const variableInit = parameters .filter(variable => variable.in === 'path' || variable.in === 'query') .map(variable => `std::string param_${variable.name} = ${JSON.stringify(variable['x-example'])};`); @@ -15,6 +17,9 @@ export function makeCppCode(spec, entry, path, method) { ?.join('&'); const queryStringCode = queryString ? `url += "?${queryString}";\n` : ''; + const headersCode = Object.entries(getHeadersWithExtras(parameters)) + .map(([key, value]) => `headers.push_back("${key}: ${value}");`) + .join('\n') const bodyParam = entry.parameters?.find(x => x.in === 'body'); const bodyParamCode = bodyParam ? `std::string body = "${escapeString(JSON.stringify(getExampleFromSchema(bodyParam.schema)))}";` : ''; const bodyOpts = bodyParam ? ` @@ -30,7 +35,11 @@ ${queryStringCode} curlpp::Easy request; std::ostringstream response; +std::list headers; +${headersCode} + // set the request options +request.setOpt(new curlpp::options::HttpHeader(headers)); request.setOpt(new curlpp::options::Url(url)); request.setOpt(new curlpp::options::WriteStream(&response)); ${bodyOpts} diff --git a/src/spec/swagger-overlay.json b/src/spec/swagger-overlay.json index 6b417d2..af6e5f4 100644 --- a/src/spec/swagger-overlay.json +++ b/src/spec/swagger-overlay.json @@ -304,52 +304,7 @@ } } }, - "/v1/trading/r/feeRate": { - "get": { - "title":"Get Fee Rate", - "summary": "Return current fee rate for a given address. This rate is dependent on the trading volume of the user.", - "operationId": "getV1TradingRFeerate", - "parameters": [ - { - "type": "string", - "description": "This nonce which used to provide the time until which this nonce is valid. It is presented as seconds since epoch.", - "name": "nonce", - "in": "query", - "required": true, - "x-example": "v2-1704114061.000" - }, - { - "type": "string", - "description": "The signature obtained by signing the nonce with your private ethereum key.", - "name": "signature", - "in": "query", - "required": true, - "x-example": "0x2b48d53f2e3a696630ebdcd1ff057556bbc9de9c294adfaa5b1f13df91b67b347fdd88c29594c377ba0024dec40cd9808829e7f4447772482f50a7a8e9a903561c" - }, - { - "type": "string", - "name": "token", - "in": "query", - "x-example": "ETH" - } - ], - "tags": ["Trading"], - "responses": { - "default": { - "examples": { - "application/json": { - "address": "0x116f494a2ce567067f319fea1c9f294f23d2fe68", - "timestamp": 1590263332427, - "fees": { - "maker": 15, - "taker": 20 - } - } - } - } - } - } - }, + "/v1/trading/r/30DaysVolume": { "get":{ "title":"User 30-day volume", @@ -561,62 +516,6 @@ } } }, - "/v1/trading/r/getConf":{ - "post":{ - "title":"Get Config", - "responses":{ - "default":{ - "examples":{ - "application/json":{ - "DVF": { - "defaultFeeRate": 0.002, - "deversifiAddress": "0x9ab450355b4ab504cbc0e4de484781dac08e6a26", - "starkExContractAddress": "0x94E84779D79E34b9166C850c3123d42C273F8843", - "exchangeSymbols": [ - "tETHUSD", - "tZRXUSD", - "tZRXETH", - "tBTCUSD" - ], - "tempStarkVaultId": 1 - }, - "tokenRegistry": { - "ETH": { - "decimals": 18, - "quantization": 10000000000, - "minOrderSize": 0.05, - "starkTokenId": "0xb333e3142fe16b78628f19bb15afddaef437e72d6d7f5c6c20c6801a27fba6" - }, - "USDT": { - "decimals": 6, - "quantization": 1, - "minOrderSize": 10, - "settleSpread": 0, - "starkTokenId": "0x180bef8ae3462e919489763b84dc1dc700c45a249dec4d1136814a639f2dd7b", - "tokenAddress": "0x4c5f66596197a86fb30a2435e2ef4ddcb39342c9" - }, - "ZRX": { - "decimals": 18, - "quantization": 10000000000, - "minOrderSize": 20, - "starkTokenId": "0x3901ee6a6c5ac0f6e284f4273b961b7e9f29d25367d31d90b75820473a202f7", - "tokenAddress": "0xcd077abedd831a3443ffbe24fb76661bbb17eb69" - }, - "BTC": { - "decimals": 18, - "quantization": 10000000000, - "minOrderSize": 0.0004, - "starkTokenId": "0x21ef21d6b234cd669edd702dd3d1d017be888337010b950ae3679eb4194b4bc", - "tokenAddress": "0x40d8978500bf68324a51533cd6a21e3e59be324a" - } - } - } - - } - } - } - } - }, "/v1/trading/r/getDeposits":{ "post":{ "title":"Deposit History", @@ -1186,126 +1085,6 @@ } } }, - "/v1/trading/r/getGasPrice": { - "get": { - "title": "Get Gas Price", - "responses": { - "default": { - "examples": { - "application/json": { - "fast": 70000000000, - "fastWait": 0.5, - "average": 67000000000, - "averageWait": 1.4, - "cheap": 66000000000, - "cheapWait": 10.5 - } - } - } - } - } - }, - "/v1/trading/r/trades/{Symbol}": { - "get": { - "title": "Trades History", - "operationId":"getV1TradingRTrades", - "parameters":[ - { - "in":"path", - "name":"Symbol", - "type":"string", - "required":true, - "description":"The market trading pair in deversifi format i.e BASE:QUOTE", - "x-example":"ETH:USDT" - } - ], - "tags":[ - "Market" - ], - "responses":{ - "default":{ - "examples":{ - "application/json":[ - { - "trade_id":1, - "price":275.23, - "base_volume":1.5, - "quote_volume":347.81, - "timestamp": 1527836800000, - "type": "buy" - }, - { - "trade_id":2, - "price":183.5, - "base_volume":1.8, - "quote_volume":381.28, - "timestamp": 1747384800000, - "type": "buy" - } - ] - } - } - } - } - }, - "/v1/trading/r/tradesSince/{Symbol}/{StartDate}/{Limit}": { - "get": { - "title": "Trades Since Date History", - "operationId":"getV1TradingRTradessince", - "parameters":[ - { - "in":"path", - "name":"Symbol", - "type":"string", - "required":true, - "description":"The market trading pair in deversifi format i.e BASE:QUOTE", - "x-example":"ETH:USDT" - }, - { - "in":"path", - "name":"StartDate", - "type":"number", - "description":"Date of the last trade returned.", - "x-example":1747384800000 - }, - { - "in":"path", - "name":"Limit", - "type":"number", - "required":false, - "description":"Limit of trades that will be returned. With a maximum limit of 1000.", - "x-example":60 - } - ], - "tags":[ - "Market" - ], - "responses":{ - "default":{ - "examples":{ - "application/json":[ - { - "trade_id":1, - "price":275.23, - "base_volume":1.5, - "quote_volume":347.81, - "timestamp": 1548028800, - "type": "buy" - }, - { - "trade_id":2, - "price":183.5, - "base_volume":1.8, - "quote_volume":381.28, - "timestamp": 1558396800, - "type": "buy" - } - ] - } - } - } - } - }, "/v1/trading/r/getBalanceForUser/{userEthAddress}": { "post": { "title": "Get User Balances", @@ -2539,6 +2318,56 @@ } } } - } + }, + "/v1/trading/allowances": { "get": { "title": "Allowance" } }, + "/v1/trading/balanceHistory": { "get": { "title": "Balance History" } }, + "/v1/trading/depositsAndWithdrawals": { "get": { "title": "Deposit/Withdraw History" } }, + "/v1/trading/entityAccounts": { "get": { "title": "Entity Accounts" } }, + "/v1/trading/r/airdropEligibility": { "get": { "title": "Airdrop Eligibility" } }, + "/v1/trading/r/fastWithdrawalFee": { "get": { "title": "Fast Withdrawal Fee" } }, + "/v1/trading/r/fastWithdrawalMaxAmount": { "get": { "title": "Fast Withdrawal Limits" } }, + "/v1/trading/r/feeRate": { "get": { "title": "Fees" } }, + "/v1/trading/r/gasSavings": { "get": { "title": "Gas Savings" } }, + "/v1/trading/r/getBalanceUsd": { "get": { "title": "USD Balance" } }, + "/v1/trading/r/getConf": { "get": { "title": "Get Configuration" }, "post": { "title": "Get Configuration" } }, + "/v1/trading/r/getGasPrice": { "get": { "title": "Get Gas Price" }, "post": { "title": "Get Gas Price" } }, + "/v1/trading/r/getTokenCirculatingSupply": { "get": { "title": "Token Supply" } }, + "/v1/trading/r/getTokenHolders": { "get": { "title": "Token Holders" } }, + "/v1/trading/r/getTokenLiquidityLeft": { "get": { "title": "Token Liquidity" } }, + "/v1/trading/r/getTokenSaleStartEnd": { "get": { "title": "Sale start/end" } }, + "/v1/trading/r/totalValueLocked": { "get": { "title": "Allowance" } }, + "/v1/trading/r/tradeHistory": { "get": { "title": "Trade History" } }, + "/v1/trading/r/vaultIdAndStarkKey": { "get": { "title": "VaultId + StarkKey" } }, + "/v1/trading/r/votingPower": { "get": { "title": "Voting Power" } }, + "/v1/trading/registrations/{targetEthAddress}": { "get": { "title": "Registration Status" } }, + "/v1/trading/bridgedDeposits": { "post": { "title": "Bridged Deposit" } }, + "/v1/trading/bridgedWithdrawals": { "post": { "title": "Bridged Withdrawal" } }, + "/v1/trading/deposits": { "post": { "title": "Deposit" } }, + "/v1/trading/deposits-validate": { "post": { "title": "Dry Run Deposit" } }, + "/v1/trading/withdrawals": { "post": { "title": "Withdraw" } }, + "/v1/trading/amm/fundingOrderData": { "get": { "title": "AMM Funding Order Data" } }, + "/v1/trading/amm/fundingOrders": { "post": { "title": "AMM Funding Order" } }, + "/v1/trading/r/addAirdrops": { "post": { "title": "Add Airdrops" } }, + "/v1/trading/r/hasReceivedCompensation": { "post": { "title": "Check Received Bonus" } }, + "/v1/trading/r/recoverTradingKey": { "post": { "title": "Recover DTK" } }, + "/v1/trading/r/userOrderCount": { "post": { "title": "User Order Count" } }, + "/v1/trading/w/cancelOpenOrders": { "post": { "title": "Cancel All Orders" } }, + "/v1/trading/w/claimAirdrop": { "post": { "title": "Claim Airdrop" } }, + "/v1/trading/w/fastWithdrawal": { "post": { "title": "Fast-Withdraw" } }, + "/v1/trading/w/feedback": { "post": { "title": "Feedback Subscribe" } }, + "/v1/trading/w/storeStarkTradingKey": { "post": { "title": "Store DTK" } }, + "/v1/trading/w/transfer": { "post": { "title": "Transfer" } }, + "/v1/trading/collateralBalances": { "get": { "title": "Collateral Balances" } }, + "/v1/trading/r/beehiveStats": { "get": { "title": "Beehive Stats" } }, + "/v1/trading/r/swapVolume": { "get": { "title": "Swap Volume" } }, + "/v1/trading/r/transferVolume": { "get": { "title": "Transfer Volume" } }, + "/v1/trading/r/tradeCountSince": { "get": { "title": "Trade Count Since" } }, + "/v1/trading/r/trades/{symbol}": { "get": { "title": "Trades For Pair" } }, + "/v1/trading/r/24HoursVolume/{year}/{month}/{day}": { "get": { "title": "24H Volume" } }, + "/v1/trading/r/tradesSince/{symbol}/{startDate}/{limit}": { "get": { "title": "Trades For Pair Since" } }, + "/v1/trading/r/getPublicPermissions": { "get": { "title": "Public Permissions" } }, + "/v1/trading/w/notifications": { "post": { "title": "Add Notification" } }, + "/v1/trading/w/notifications/{id}": { "delete": { "title": "Remove Notification" } } + } } diff --git a/src/spec/swagger-v11--submitted.json b/src/spec/swagger-v11--submitted.json deleted file mode 100644 index 18ea003..0000000 --- a/src/spec/swagger-v11--submitted.json +++ /dev/null @@ -1,3273 +0,0 @@ -{ - "swagger":"2.0", - "host":"api.stg.deversifi.com", - "basePath":"/", - "schemes":[ - "https" - ], - "info":{ - "title":"Deversifi API documentation", - "version":"1.0.0", - "description":"dvf-pub-api" - }, - "tags":[], - "paths":{ - "/v1/trading/r/24HoursVolume/{Year}/{Month}/{Day}":{ - "get":{ - "summary":"Request information regarding the trading volume for a specific date. The request returns the overall trading volume details for all tokens in USD as well as the trading volume per token.", - "operationId":"getV1TradingR24hoursvolume", - "parameters":[ - { - "type":"string", - "description":"The year of the specific trading volume request date - in this case 2020.", - "name":"year", - "in":"query", - "required":true - }, - { - "type":"string", - "description":"The month of the specific trading volume request date - in this case 01 (January).", - "name":"month", - "in":"query", - "required":true - }, - { - "type":"number", - "description":"The day of the specific trading volume request date - in this case 01 (1st of a month).", - "name":"day", - "in":"query", - "required":true - } - ], - "tags":[ - "Market" - ], - "responses":{ - "default":{ - "schema":{ - "$ref":"#/definitions/24HoursVolumeResponse" - }, - "description":"Returns the overall trading volume details for all tokens in USD as well as the trading volume per trading pair." - } - } - } - }, - "/v1/trading/r/30DaysVolume":{ - "get":{ - "summary":"Request information regarding the trading volume of a specific address for the last 30 days. The request returns the overall trading volume details for all tokens in USD as well as the trading volume per token. Results are cached for 60 minutes.", - "operationId":"getV1TradingR30daysvolume", - "parameters":[ - { - "type":"string", - "name":"nonce", - "in":"query", - "required":true, - "example": "v2-1704114061.000" - }, - { - "type":"string", - "name":"signature", - "in":"query", - "required":true, - "example": "0x2b48d53f2e3a696630ebdcd1ff057556bbc9de9c294adfaa5b1f13df91b67b347fdd88c29594c377ba0024dec40cd9808829e7f4447772482f50a7a8e9a903561c" - } - ], - "tags":[ - "Market" - ], - "responses":{ - "default":{ - "schema":{ - "$ref":"#/definitions/30DaysVolumeResponse" - }, - "description":"Returns the trading volume of the last 30 days for a specific address. The request returns the overall trading volume details for all tokens in USD as well as the trading volume per trading pair. Results are cached for 60 minutes." - } - } - } - }, - "/v1/trading/r/User24HoursVolume":{ - "get":{ - "summary": "Request information regarding the trading volume of a specific address for the last 24 hours. The request returns the overall trading volume details for all tokens in USD as well as the trading volume per token. Results are cached for 2 minutes.", - "operationId":"getV1Pub24HoursVolumeSpecificAddress", - "parameters":[ - { - "type":"string", - "name":"nonce", - "in":"query", - "required":true, - "example": "v2-1704114061.000" - }, - { - "type":"string", - "name":"signature", - "in":"query", - "required":true, - "example": "0x0277b6e85ffdfb8cdc34c89b8b60c42a1a96a57e1b528ca3ff203b2dac8c9a200dbedd5ab8d2ed7ef19e915daf00327db91c1f5a1988666089e6b8420881699501" - } - ], - "tags":[ - "Market" - ], - "responses":{ - "default":{ - "schema":{ - "$ref":"#/definitions/User24HoursVolumeResponse" - }, - "description": "Returns the overall trading volume details of a specific address for all tokens in USD as well as the trading volume per trading pair fot the last 24 hours." - } - } - } - }, - "/v1/trading/r/USDRanking":{ - "get":{ - "summary":"This returns a user ranking by overall trading volume quoted in USD. If the parameters startDate and endDate are provided, the ranking includes only trading volume within that window of time.", - "operationId":"getV1TradingRUsdranking", - "parameters":[ - { - "type":"number", - "description":"The start date and time (Unix timestamp in milliseconds) for which the trade volumes are requested. If startDate and endDate are not provided, it returns the volume ranking if all time.", - "name":"startDate", - "in":"query" - }, - { - "type":"number", - "description":"The end date and time (Unix timestamp in milliseconds) for which events are requested.If startDate and endDate are not provided, it returns the volume ranking if all time.", - "name":"endDate", - "in":"query" - } - ], - "tags":[ - "Market" - ], - "responses":{ - "default":{ - "schema":{ - "$ref":"#/definitions/USDRankingResponse" - }, - "description":"Ranked output of all trading volumes for all the tokens." - } - } - } - }, - "/v1/trading/r/estimatedNextBatchTime":{ - "get":{ - "summary":"Returns a countdown until the expected next batch proof is submitted onto the blockchain and the average time of previous batches. The next batch will include all pending withdrawals.", - "operationId":"getV1TradingREstimatednextbatchtime", - "tags":[ - "Market" - ], - "responses":{ - "default":{ - "schema":{ - "$ref":"#/definitions/estimatedNextBatchResponse" - }, - "description":"Returns the amount of time remaining until the batch is posted to Ethereum." - } - } - } - }, - "/v1/trading/r/feeRate":{ - "get":{ - "summary":"Return current fee rate for a given address. This rate is dependent on user trading volume.", - "operationId":"getV1TradingRFeerate", - "parameters":[ - { - "type":"string", - "name":"nonce", - "description": "This nonce which used to provide the time until which this nonce is valid. It is presented as seconds since epoch.", - "in":"query", - "required":true, - "example": "v2-1704114061.000" - }, - { - "type":"string", - "name":"signature", - "in":"query", - "required":true, - "description": "The signature obtained by signing the nonce with your private ethereum key.", - "example": "0x0277b6e85ffdfb8cdc34c89b8b60c42a1a96a57e1b528ca3ff203b2dac8c9a200dbedd5ab8d2ed7ef19e915daf00327db91c1f5a1988666089e6b8420881699501" - }, - { - "type":"string", - "name":"token", - "in":"query", - "example": "ETH" - } - ], - "tags":[ - "Trading" - ], - "responses":{ - "default": { - "schema": { - "$ref": "#/definitions/feeRateResponse" - }, - "description": "Returns the fee rate for the user based on past trading volume." - } - } - } - }, - "/v1/trading/r/last24HoursVolume":{ - "get":{ - "summary":"Request information regarding the trading volume for the last 24 hours. The request returns the overall trading volume details in USD as well as the trading volume per token in USD and the native token.", - "operationId":"getV1TradingRLast24hoursvolume", - "tags":[ - "Market" - ], - "responses":{ - "default":{ - "schema":{ - "$ref":"#/definitions/last24HoursVolumeResponse" - }, - "description":"Returns the trading volume of the last 24 hours." - } - } - } - }, - "/v1/trading/r/tokenRanking":{ - "get":{ - "summary":"This returns a user ranking by trading volume for a chosen token. If the parameters startDate and endDate are provided, the ranking includes only trading volume within that window of time. All volumes are quoted in ETH.", - "operationId":"getV1TradingRTokenranking", - "parameters":[ - { - "type":"string", - "description":"The currency relating to the requested trading volume information.", - "name":"currency", - "in":"query", - "required":true - }, - { - "type":"number", - "description":"The start date and time (Unix timestamp in milliseconds) for which the trade volumes are requested. If startDate and endDate are not provided, it returns the volume ranking if all time.", - "name":"startDate", - "in":"query" - }, - { - "type":"number", - "description":"The end date and time (Unix timestamp in milliseconds) for which the trade volumes are requested. If startDate and endDate are not provided, it returns the volume ranking if all time.", - "name":"endDate", - "in":"query" - } - ], - "tags":[ - "Market" - ], - "responses":{ - "default":{ - "schema":{ - "$ref":"#/definitions/tokenRankingResponse" - }, - "description":"Returns a ranked output of all the trading volumes for a given crypto currency. All the Volumes are quoted in ETH." - } - } - } - }, - "/v1/trading/r/getBalance":{ - "post":{ - "summary":"This is used to retrieve the total and active balances of a user per token. Active balance is the balance that is currently available. Total balance (specified as balance) is the sum of all the balances including those locked for trading.", - "operationId":"postV1TradingRGetbalance", - "parameters":[ - { - "in":"body", - "name":"body", - "schema":{ - "$ref":"#/definitions/getBalancePayload" - } - } - ], - "tags":[ - "Trading" - ], - "responses":{ - "default":{ - "schema":{ - "$ref":"#/definitions/getBalanceResponse" - }, - "description":"Returns the total and active balances of a user per token." - } - } - } - }, - "/v1/trading/r/getConf":{ - "post":{ - "summary":"Returns the DeversiFi application configuration details.", - "operationId":"postV1TradingRGetconf", - "tags":[ - "Trading" - ], - "responses":{ - "default":{ - "schema":{ - "$ref":"#/definitions/getConfResponse" - }, - "description":"Returns the overall trading volume details for all tokens in USD as well as the trading volume per trading pair." - } - } - } - }, - "/v1/trading/r/getDeposits":{ - "post":{ - "summary":"This is an authenticated endpoint used to retrieve deposits. A token can be specified to get deposits for a specific token. The limit of deposits returned is 1000.", - "operationId":"postV1TradingRGetdeposits", - "parameters":[ - { - "in":"body", - "name":"body", - "schema":{ - "$ref":"#/definitions/getBalancePayload" - } - }, - { - "type":"number", - "description":"Date of the last deposit returned.", - "name":"startDate", - "in":"query", - "x-example":1747384800000 - }, - { - "type":"number", - "description":"Limit of deposits that will be returned. With a maximum limit of 1000.", - "name":"limit", - "in":"query", - "x-example":60 - } - ], - "tags":[ - "Trading" - ], - "responses":{ - "default":{ - "schema":{ - "$ref":"#/definitions/getDepositsResponse" - }, - "description":"Returns the list of deposits. A token can be specified to get deposits for a specific token." - } - } - } - }, - "/v1/trading/r/getOrder": { - "post": { - "summary": "This is endpoint is used to retrieve the details for a specific order using the order ID.", - "operationId": "postV1TradingRGetorder", - "parameters": [ - { - "in": "body", - "name": "body", - "schema": { "$ref": "#/definitions/getOrderPayload" } - } - ], - "tags": ["Trading"], - "responses": { - "default": { - "schema": { "$ref": "#/definitions/getOrderResponse" }, - "description": "Returns details relating to a particular order." - } - } - } - }, - "/v1/trading/r/getPendingWithdrawals":{ - "post":{ - "summary":"This endpoint is used to retrieve all pending withdrawals. If a token is specified, withdrawals pertaining to only that particular token are provided.", - "operationId":"postV1TradingRGetpendingwithdrawals", - "parameters":[ - { - "in":"body", - "name":"body", - "schema":{ - "$ref":"#/definitions/getPendingWithdrawalsPayload" - } - } - ], - "tags":[ - "Trading" - ], - "responses":{ - "default":{ - "schema":{ - "type":"string" - }, - "description":"Successful" - } - } - } - }, - "/v1/trading/r/getUserConf":{ - "post":{ - "summary":"Returns the DeversiFi application and user configuration details.", - "operationId":"postV1TradingRGetuserconf", - "parameters":[ - { - "in":"body", - "name":"body", - "schema":{ - "$ref":"#/definitions/getUserConfPayload" - } - } - ], - "tags":[ - "Trading" - ], - "responses":{ - "default":{ - "schema":{ - "$ref":"#/definitions/getUserConfResponse" - }, - "description":"Returns the overall trading volume details for all tokens in USD as well as the trading volume per trading pair." - } - } - } - }, - "/v1/trading/r/getVaultId":{ - "post":{ - "summary":"An authenticated endpoint used to retrieve a vaultId for given token.", - "operationId":"postV1TradingRGetvaultid", - "parameters":[ - { - "in": "body", - "name": "body", - "schema": { - "$ref": "#/definitions/getVaultIdPayload" - } - } - ], - "tags":[ - "Trading" - ], - "responses":{ - "default": { - "schema": { - "$ref": "#/definitions/getVaultIdResponse" - }, - "description": "Returns a the vault id allocated for the requested token." - } - } - } - }, - "/v1/trading/r/getWithdrawal":{ - "post":{ - "summary":"This endpoint is used to retrieve details relating to a particular withdrawal.", - "operationId":"postV1TradingRGetwithdrawal", - "parameters":[ - { - "in":"body", - "name":"body", - "schema":{ - "$ref":"#/definitions/getWithdrawalPayload" - } - } - ], - "tags":[ - "Trading" - ], - "responses":{ - "default":{ - "schema":{ - "$ref":"#/definitions/getWithdrawalResponse" - }, - "description":"Returns details relating to a particular withdrawal." - } - } - } - }, - "/v1/trading/r/openOrders": { - "post": { - "summary": "This endpoints allows to retrieve details on all open orders.", - "operationId": "postV1TradingROpenorders", - "parameters": [ - { - "in": "body", - "name": "body", - "schema": { "$ref": "#/definitions/openOrdersPayload" } - } - ], - "tags": ["Trading"], - "responses": { - "default": { - "schema": { "$ref": "#/definitions/openOrdersResponse" }, - "description": "Returns all open orders." - } - } - } - }, - "/v1/trading/r/orderHistory": { - "post": { - "summary": "This method is used to retrieve a list of all past orders for a user. This includes executed trades, as well as expired and cancelled orders. The limit of orders returned is 1000.", - "operationId": "postV1TradingROrderhistory", - "parameters": [ - { - "in": "body", - "name": "body", - "schema": { "$ref": "#/definitions/orderHistoryPayload" } - }, - { - "type":"number", - "description":"Date of the last order returned.", - "name":"startDate", - "in":"query", - "x-example":1747384800000 - }, - { - "type":"number", - "description":"Limit of orders that will be returned. With a maximum limit of 1000.", - "name":"limit", - "in":"query", - "x-example":60 - } - ], - "tags": ["Trading"], - "responses": { - "default": { - "schema": { "$ref": "#/definitions/orderHistoryResponse" }, - "description": "Returns a list of all a user's past orders." - } - } - } - }, - "/v1/trading/r/withdrawHistory":{ - "post":{ - "summary":"An authenticated endpoint used to retrieve a list of user's past withdrawals. This includes ready, completed, as well as cancelled withdrawals. The limit of withdrawals returned is 1000.", - "operationId":"postV1TradingRWithdrawhistory", - "parameters":[ - { - "in":"body", - "name":"body", - "schema":{ - "$ref":"#/definitions/getPendingWithdrawalsPayload" - } - }, - { - "type":"number", - "description":"Date of the last withdraw returned.", - "name":"startDate", - "in":"query", - "x-example":1747384800000 - }, - { - "type":"number", - "description":"Limit of withdraws that will be returned. With a maximum limit of 1000.", - "name":"limit", - "in":"query", - "x-example":60 - } - ], - "tags":[ - "Trading" - ], - "responses":{ - "default":{ - "schema":{ - "$ref":"#/definitions/withdrawHistoryResponse" - }, - "description":"Returns a list of user's past withdrawals." - } - } - } - }, - "/v1/trading/w/cancelOrder":{ - "post":{ - "summary":"This endpoint allows to cancel a specific order.", - "operationId":"postV1TradingWCancelorder", - "parameters":[ - { - "in":"body", - "name":"body", - "schema":{ - "$ref":"#/definitions/cancelOrderPayload" - } - } - ], - "tags":[ - "Trading" - ], - "responses":{ - "default":{ - "schema":{ - "$ref":"#/definitions/cancelOrderResponse" - }, - "description":"Queues cancellation request and returns the order ID of the cancelled order." - } - } - } - }, - "/v1/trading/w/cancelWithdrawal":{ - "post":{ - "summary":"This endpoint allows to cancel a specific withdrawal with a given id.", - "operationId":"postV1TradingWCancelwithdrawal", - "parameters":[ - { - "in":"body", - "name":"body", - "schema":{ - "$ref":"#/definitions/cancelWithdrawalPayload" - } - } - ], - "tags":[ - "Trading" - ], - "responses":{ - "default":{ - "schema":{ - "$ref":"#/definitions/cancelWithdrawalResponse" - }, - "description":"Returns the cancelled withdrawal." - }, - "withdrawal not found": { - "schema": { - "type":"object", - "properties":{ - "statusCode":{ - "type":"number", - "description":"The request code status.", - "example":422 - }, - "error":{ - "type":"string", - "description":"What was the error.", - "example":"WITHDRAWAL_NOT_FOUND" - }, - "message":{ - "type":"string", - "description":"Message returned.", - "example":"WITHDRAWAL_NOT_FOUND" - }, - "type":{ - "type":"string", - "description":"The error type.", - "example":"DVFError" - } - } - } - } - } - } - }, - "/v1/trading/w/deposit":{ - "post":{ - "summary":"Submit a signed notification of a new deposit made.", - "operationId":"postV1TradingWDeposit", - "parameters":[ - { - "in":"body", - "name":"body", - "schema":{ - "$ref":"#/definitions/depositPayload" - } - } - ], - "tags":[ - "Trading" - ], - "responses":{ - "default":{ - "schema":{ - "$ref":"#/definitions/depositResponse" - }, - "description":"Returns the deposit notifcation." - } - } - } - }, - "/v1/trading/w/register":{ - "post":{ - "summary":"This method is used to register a Stark key that corresponds to an Ethereum public address. This will return deversifi Signature or DeversiFi application and user configuration details.", - "operationId":"postV1TradingWRegister", - "parameters":[ - { - "in":"body", - "name":"body", - "schema":{ - "$ref":"#/definitions/registerPayload" - } - } - ], - "tags":[ - "Trading" - ], - "responses":{ - "default":{ - "schema":{ - "$ref":"#/definitions/registerResponse" - }, - "description":"Returns a Deversifi Signature (defiSignature) which is required to register on StarkEx Smart Contract. Returns the DeversiFi application as well as the user configuration details if use is already registered." - } - } - } - }, - "/v1/trading/w/submitOrder": { - "post": { - "summary": "This authenticated endpoint is used to submit an order.", - "operationId": "postV1TradingWSubmitorder", - "parameters": [ - { - "in": "body", - "name": "body", - "schema": { "$ref": "#/definitions/submitOrderPayload" } - } - ], - "tags": [ - "Trading" - ], - "responses": { - "default": { - "schema": { - "$ref": "#/definitions/submitOrderResponse" - }, - "description": "Queues order for market submission and returns the order ID of the submitted order." - } - } - } - }, - "/v1/trading/w/transfer": { - "post": { - "title": "Transfer", - "summary": "Submit a request for internal transfer.", - "operationId": "postV1TradingWTransfer", - "parameters": [ - { - "in": "body", - "name": "body", - "schema": { - "$ref": "#/definitions/transferPayload" - } - } - ], - "tags": ["Trading"], - "responses": { - "default": { - "schema": { - "type": "object", - "properties": { - "_id": { - "type": "string", - "description": "Transfer ID.", - "example": "LCafcGC6tBH" - }, - "token": { - "type": "string", - "description": "The token that was transferred.", - "example": "USDT" - }, - "amount": { - "type": "string", - "description": "The amount that was transferred (in quantised units).", - "example": "100", - "pattern": "^[0-9]*$" - }, - "recipient": { - "type": "string", - "description": "Deversifi user id of recipient of the transfer.", - "example": "0x948cd3ad67c5f21412bfcd07a7981322f9fa01f0" - }, - "createdAt": { - "type": "string", - "format": "date", - "description": "The date and time transfer request was received.", - "example": "2020-01-29T14:13:05.898Z" - }, - "updatedAt": { - "type": "string", - "format": "date", - "description": "The date and time transfer request was received.", - "example": "2020-01-29T14:13:05.898Z" - }, - "tx": { - "type": "object", - "properties": { - "type": { - "type": "string", - "enum": [ - "TransferRequest" - ] - }, - "amount": { - "type": "string", - "pattern": "^[0-9]*$" - }, - "expirationTimestamp": { - "type": "integer", - "minimum": 0 - }, - "nonce": { - "type": "integer", - "minimum": 0 - }, - "receiverPublicKey": { - "type": "string", - "pattern": "^0x[a-f0-9]+$" - }, - "receiverVaultId": { - "type": "integer" - }, - "senderPublicKey": { - "type": "string", - "pattern": "^0x[a-f0-9]+$" - }, - "senderVaultId": { - "type": "integer" - }, - "signature": { - "$ref": "#/definitions/signature" - }, - "token": { - "type": "string", - "pattern": "^0x[a-f0-9]+$" - } - } - } - }, - "required": [ - "_id", - "token", - "createdAt", - "updatedAt" - ] - }, - "examples": { - "application/json": { - "_id": "LCafcGC6tBH", - "token": "USDT", - "amount": "100", - "recipient":"0x948cd3ad67c5f21412bfcd07a7981322f9fa01f0", - "createdAt": "2020-01-29T14:13:05.898Z", - "updatedAt": "2020-01-29T14:13:05.898Z", - "tx": { - "type": "TransferRequest", - "amount": "100", - "expirationTimestamp": 456890, - "nonce": 120, - "receiverPublicKey": "0x341E46a49F15785373edE443Df0220DEa6a41Bbc", - "receiverVaultId": 15678, - "senderPublicKey": "0x341E46a49F15785373edE443Df0220DEa6a41Bbc", - "senderVaultId": 1234, - "signature": { - "r": "5d14357fcf8f489218de0855267c6f64bc463135debf62680ad796e63cd6d3b", - "s": "786ab874d91e3a5871134955fcb768914754760a0ada326af67f758f32819cf" - }, - "token": "0x341E46a49F15785373edE443Df0220DEa6a41Bbc" - } - } - } - } - } - } - }, - "/v1/trading/w/withdraw":{ - "post":{ - "summary":"Submit a request for a new withdrawal.", - "operationId":"postV1TradingWWithdraw", - "parameters":[ - { - "in":"body", - "name":"body", - "schema":{ - "$ref":"#/definitions/withdrawalPayload" - } - } - ], - "tags":[ - "Trading" - ], - "responses":{ - "default":{ - "schema":{ - "type":"string" - }, - "description":"Successful" - } - } - } - }, - "/v1/trading/r/getGasPrice":{ - "get":{ - "summary":"Returns a range of gas prices in Wei to use with on chain transactions.", - "operationId":"getV1TradingRGetGasPrice", - "tags":[ - "Trading" - ], - "responses":{ - "default":{ - "schema":{ - "$ref":"#/definitions/getGasPriceResponse" - }, - "description":"Range of gas prices for on chain confirmation speed." - } - } - } - }, - "/v1/trading/r/trades/{Symbol}":{ - "get":{ - "summary":"Request information regarding all recently completed trades for a given market pair.", - "operationId":"getV1TradingRTrades", - "parameters":[ - { - "in":"path", - "name":"Symbol", - "type":"string", - "required":true, - "description":"The market trading pair in deversifi format i.e BASE:QUOTE", - "x-example":"ETH:USDT" - } - ], - "tags":[ - "Market" - ], - "responses":{ - "default":{ - "schema":{ - "$ref":"#/definitions/tradesResponse" - }, - "description":"The trades endpoint returns data on all recently completed trades for a given market pair for the past 24 hours." - } - } - } - }, - "/v1/trading/r/tradesSince/{Symbol}/{StartDate}/{Limit}": { - "get": { - "summary": "Request information regarding all completed trades in a time range for a given market pair", - "operationId":"getV1TradingRTradessince", - "parameters":[ - { - "in":"path", - "name":"Symbol", - "type":"string", - "required":true, - "description":"The market trading pair in deversifi format i.e BASE:QUOTE", - "x-example":"ETH:USDT" - }, - { - "in":"path", - "name":"StartDate", - "type":"number", - "description":"The Unix timestamp in milliseconds for the start period for the query.", - "x-example":1747384800000 - }, - { - "in":"path", - "name":"Limit", - "type":"number", - "required":false, - "description":"Limit of trades that will be returned. With a maximum limit of 1000.", - "x-example":60 - } - ], - "tags":[ - "Market" - ], - "responses":{ - "default":{ - "schema":{ - "$ref":"#/definitions/tradesResponse" - }, - "description":"Returns data on all recently completed trades for a given market pair during a time range." - } - } - } - }, - "/v1/trading/r/getBalanceForUser/{userEthAddress}": { - "post": { - "summary": "This is used to retrieve the total and active balances of a user per token. Active balance is the balance that is currently available. Total balance (specified as balance) is the sum of all the balances including those locked for trading.", - "operationId": "postV1TradingRGetbalanceforuserUserethaddress", - "parameters": [ - { - "type": "string", - "description": "The ETH address of a potential user", - "name": "userEthAddress", - "in": "path", - "required": true - }, - { - "in": "body", - "name": "body", - "schema": { - "type": "array", - "items": { - "type": "object", - "properties": { - "token": { - "type": "string", - "description": "The token for which the balances are provided.", - "example": "ETH" - }, - "balance": { - "type": "number", - "description": "It is the total balance for the user corresponding to the specified token.", - "example": 42 - }, - "available": { - "type": "number", - "description": "It is the part of the balance available for use.", - "example": 23 - }, - "locked": { - "type": "number", - "description": "It is the part of the balance currently in open orders or pending withdrawal.", - "example": 19 - } - } - } - } - } - ], - "tags": [ - "Trading", - "public" - ], - "responses": { - "200": { - "schema": { - "$ref": "#/definitions/getBalanceResponse" - }, - "description": "Successful" - } - } - } - }, - "/v1/trading/r/publicTradeHistory/{user}": { - "get": { - "summary": "This method is used to retrieve a list of all past executed trades for a user. This includes the different trades that have been settled for each fully executed or partially executed order.", - "operationId": "getV1TradingRPublictradehistoryUser", - "parameters": [ - { - "type": "string", - "description": "The ETH address of a potential user", - "name": "user", - "in": "path", - "required": true - } - ], - "tags": [ - "Trading", - "public" - ], - "responses": { - "200": { - "schema": { - "type": "object", - "properties": { - "items": { - "type": "array", - "items": { - "type": "object", - "properties": { - "fillAmount": { - "type": "number", - "description": "amount filled" - }, - "user": { - "type": "string", - "description": "User ETH address" - }, - "date": { - "type": "string", - "format": "date", - "description": "Date of the settlement" - }, - "tokenBuy": { - "type": "string", - "description": "Buy token" - }, - "tokenSell": { - "type": "string", - "description": "Sell token" - }, - "amountBuy": { - "type": "string", - "description": "Amount of buy order" - }, - "amountSell": { - "type": "string", - "description": "Amount of sell order" - }, - "orderId": { - "type": "string", - "description": "Id of the order" - }, - "feeCurrency": { - "type": "string", - "description": "Currency of the fee" - }, - "feeAmount": { - "type": "string", - "description": "Amount of fee" - } - } - } - } - } - }, - "description": "Successful" - } - } - } - }, - "/v1/trading/r/getPublicUserPermissions": { - "post": { - "summary": "Used to get all configured permissions for the authenticated user", - "operationId": "postV1TradingRGetpublicuserpermissions", - "parameters": [ - { - "in": "body", - "name": "body", - "schema": { - "type": "object", - "properties": { - "nonce": { - "type": "string", - "description": "This nonce which used to provide the time until which this nonce is valid. It is presented as seconds since epoch.", - "example": "v2-1704114061.000" - }, - "signature": { - "type": "string", - "description": "The signature obtained by signing the nonce with your private ethereum key.", - "example": "0x2b48d53f2e3a696630ebdcd1ff057556bbc9de9c294adfaa5b1f13df91b67b347fdd88c29594c377ba0024dec40cd9808829e7f4447772482f50a7a8e9a903561c" - } - } - } - } - ], - "tags": [ - "Trading", "public" - ], - "responses": { - "200": { - "schema": { - "$ref": "#/definitions/permissionsResponse" - }, - "description": "Successful" - } - } - } - }, - "/v1/trading/r/setPublicUserPermissions": { - "post": { - "summary": "Used to set a specific permission for a given user", - "operationId": "postV1TradingRSetpublicuserpermissions", - "parameters": [ - { - "in": "body", - "name": "body", - "schema": { - "$ref": "#/definitions/permissionsPayload" - } - } - ], - "tags": [ - "Trading" - ], - "responses": { - "200": { - "schema": { - "$ref": "#/definitions/permissionsResponse" - }, - "description": "Successful" - } - } - } - } - }, - "/v1/trading/transfers": { - "get": { - "summary": "This method is used to get the history of transfers for the authenticated user", - "operationId": "getV1TradingTransfers", - "parameters": [ - { - "type": "string", - "x-convert": { - "case": "upper" - }, - "name": "token", - "in": "query" - }, - { - "type": "string", - "format": "date", - "name": "startDate", - "in": "query" - }, - { - "type": "string", - "format": "date", - "name": "endDate", - "in": "query" - }, - { - "type": "string", - "default": "date", - "enum": [ - "date" - ], - "name": "sortBy", - "in": "query" - }, - { - "type": "string", - "default": "DESC", - "enum": [ - "ASC", - "DESC" - ], - "name": "sortDirection", - "in": "query" - }, - { - "type": "integer", - "default": 0, - "minimum": 0, - "name": "skip", - "in": "query" - }, - { - "type": "integer", - "default": 20, - "minimum": 1, - "maximum": 100, - "name": "limit", - "in": "query" - } - ], - "tags": [ - "Trading" - ], - "responses": { - "200": { - "schema": { - "x-alternatives": [ - { - "type": "object", - "properties": { - "pagination": { - "type": "object", - "properties": { - "totalItems": { - "type": "number", - "description": "Total number of items matching the query", - "example": 1559, - "minimum": 0 - }, - "limit": { - "type": "number", - "description": "Limit applied on returned items", - "example": 5 - }, - "skip": { - "type": "number", - "description": "Skip applied on returned items", - "example": 2 - } - } - }, - "items": { - "type": "array", - "items": { - "type": "object", - "properties": { - "type": { - "type": "string", - "enum": [ - "TransferRequest" - ] - }, - "amount": { - "type": "string", - "pattern": "^[0-9]*$" - }, - "expirationTimestamp": { - "type": "integer", - "minimum": 0 - }, - "nonce": { - "type": "integer", - "minimum": 0 - }, - "receiverPublicKey": { - "type": "string", - "pattern": "^0x[a-f0-9]+$" - }, - "receiverVaultId": { - "type": "integer" - }, - "senderPublicKey": { - "type": "string", - "pattern": "^0x[a-f0-9]+$" - }, - "senderVaultId": { - "type": "integer" - }, - "signature": { - "$ref": "#/definitions/signature" - }, - "token": { - "type": "string", - "pattern": "^0x[a-f0-9]+$" - } - } - } - } - } - }, - { - "type": "string", - "description": "List of past transfers in CSV format", - "example": "id,token,amount,feeAmount,source,recipient,date9oWC74UdzWJ,ZRX,0.05,0.001,0x08152c1265dBc218ccc8Ab5C574e6bD52279b3B7,0xeb3ea3ea9239577951523cafa9fd3072bc88e50a,1990-04-14T00:00:00.000ZJtCAHChHhmU,ZRX,0.05,0.001,0x08152c1265dBc218ccc8Ab5C574e6bD52279b3B7,0xeb3ea3ea9239577951523cafa9fd3072bc88e50a,1990-04-14T00:02:00.000ZA1vFQzqYMXu,ZRX,0.05,0.001,0x08152c1265dBc218ccc8Ab5C574e6bD52279b3B7,0xeb3ea3ea9239577951523cafa9fd3072bc88e50a,1990-04-14T00:04:00.000Z8xFu925f72r,ZRX,0.05,0.001,0x08152c1265dBc218ccc8Ab5C574e6bD52279b3B7,0xeb3ea3ea9239577951523cafa9fd3072bc88e50a,1990-04-14T00:06:00.000Z" - } - ] - }, - "description": "Successful" - } - } - } - }, - "/v1/trading/fills": { - "get": { - "summary": "This method is used to get the history of fills (executed trades) for the authenticated user", - "operationId": "getV1TradingFills", - "parameters": [ - { - "type": "string", - "x-convert": { - "case": "upper" - }, - "name": "symbol", - "in": "query" - }, - { - "type": "string", - "format": "date", - "name": "startDate", - "in": "query" - }, - { - "type": "string", - "format": "date", - "name": "endDate", - "in": "query" - }, - { - "type": "string", - "default": "date", - "enum": [ - "date" - ], - "name": "sortBy", - "in": "query" - }, - { - "type": "string", - "default": "DESC", - "enum": [ - "ASC", - "DESC" - ], - "name": "sortDirection", - "in": "query" - }, - { - "type": "integer", - "default": 0, - "minimum": 0, - "name": "skip", - "in": "query" - }, - { - "type": "integer", - "default": 20, - "minimum": 1, - "maximum": 100, - "name": "limit", - "in": "query" - } - ], - "tags": [ - "Trading" - ], - "responses": { - "200": { - "schema": { - "$ref": "#/definitions/getFillsResponse", - "x-alternatives": [ - { - "$ref": "#/definitions/getFillsResponse" - }, - { - "type": "string", - "description": "Response in CSV format", - "example": "fillId,orderId,symbol,fillAmount,orderAmount,price,date,orderCreationDate,orderType,orderActive,orderCanceled606f4123baed6ee2d25f1f1f,79qiFBVDfbz,ZRX:USDT,-0.125622,-1,209.9,1990-04-14T00:00:00.000Z,2020-11-11T16:37:05.262Z,EXCHANGE LIMIT,false,false606f4123baed6ee2d25f1f32,7vVPHzETRQY,ZRX:USDT,-0.125622,-1,209.9,1990-04-14T00:02:00.000Z,2020-11-11T16:37:05.262Z,EXCHANGE LIMIT,false,false606f4123baed6ee2d25f1f2d,GuKPHMafYU1,ZRX:USDT,-0.125622,-1,209.9,1990-04-14T00:04:00.000Z,2020-11-11T16:37:05.262Z,EXCHANGE LIMIT,false,false606f4123baed6ee2d25f1f25,6h1i8x5apLe,ZRX:USDT,-0.125622,-1,209.9,1990-04-14T00:06:00.000Z,2020-11-11T16:37:05.262Z,EXCHANGE LIMIT,false,false606f4123baed6ee2d25f1f27,MwEnHW1MF5y,ZRX:USDT,-0.125622,-1,209.9,1990-04-14T00:08:00.000Z,2020-11-11T16:37:05.262Z,EXCHANGE LIMIT,false,false" - } - ] - }, - "description": "Successful" - } - } - } - }, - "definitions":{ - "getVaultIdPayload": { - "type": "object", - "properties": { - "nonce": { - "type": "string", - "description": "This nonce which used to provide the time until which this nonce is valid. It is presented as seconds since epoch.", - "example": "v2-1704114061.000" - }, - "signature": { - "type": "string", - "description": "The signature obtained by signing the nonce with your private ethereum key.", - "example": "0x2b48d53f2e3a696630ebdcd1ff057556bbc9de9c294adfaa5b1f13df91b67b347fdd88c29594c377ba0024dec40cd9808829e7f4447772482f50a7a8e9a903561c" - }, - "token": { - "type": "string", - "description": "The new token for which a new vault Id needs to be allocated.", - "example": "DAI" - } - }, - "required": ["nonce", "signature"] - }, - "getVaultIdResponse": { - "type":"object", - "properties":{ - "":{ - "type": "number", - "description": "The vault id for the requested vault.", - "example": 1851736 - } - } - }, - "24HoursVolumeResponse":{ - "type":"object", - "properties":{ - "totalUSDVolume":{ - "type":"number", - "description":"The total trade volume in terms of USD.", - "example":3320.75 - }, - "tokens":{ - "$ref":"#/definitions/tokens" - }, - "startDate":{ - "type":"string", - "description":"The start date and time for the volume presented.", - "example":"2020-01-01T00:00:00.714Z" - }, - "endDate":{ - "type":"string", - "description":"The end date and time for the volume presented.", - "example":"2020-01-01T00:00:00.714Z" - } - } - }, - "feeRateResponse": { - "type": "object", - "properties": { - "address": { - "type": "string", - "description": "The Ethereum address of the user verified by nonce and signature.", - "example": "0x116f494a2ce567067f319fea1c9f294f23d2fe68" - }, - "timestamp": { - "type": "number", - "description": "Timestamp in milliseconds since epoch.", - "example": 1590263332427 - }, - "fees": { - "type": "object", - "properties": { - "maker": { - "type": "number", - "description": "The fee basis points for maker orders (adding bids or offers to the order book).", - "example": 15 - }, - "taker": { - "type": "number", - "description": "The fee basis points for taker orders (removing liquidity from the order book).", - "example": 20 - } - } - } - } - }, - "30DaysVolumeResponse":{ - "type":"object", - "properties":{ - "totalUSDVolume":{ - "type":"number", - "description":"The total trade volume in terms of USD.", - "example":73364.1749445 - }, - "tokens":{ - "$ref":"#/definitions/tokens" - }, - "startDate":{ - "type":"string", - "description":"The start date and time for the volume presented.", - "example":"2020-01-01T00:00:00.714Z" - }, - "endDate":{ - "type":"string", - "description":"The end date and time for the volume presented.", - "example":"2020-01-01T00:00:00.714Z" - } - } - }, - "User24HoursVolumeResponse": { - "type":"object", - "properties":{ - "totalUSDVolume":{ - "type":"number", - "description":"The total trade volume in terms of USD.", - "example":73364.1749445 - }, - "tokens":{ - "$ref":"#/definitions/tokens" - } - } - }, - "USDRankingResponse":{ - "type":"object", - "properties":{ - "address":{ - "type":"string", - "description":"The address of the trader.", - "example":"0xfc898b18a70ce49579f8d79a32e29928c15b4bc8" - }, - "USDValue":{ - "type":"number", - "description":"The trading volume for the address quoted in USD.", - "example":119128.566703 - } - } - }, - "estimatedNextBatchResponse":{ - "type":"object", - "properties":{ - "estimatedTime": { - "type": "number", - "description": "The number of seconds until the batch is sent to be processed and broadcast to the blockchain.", - "example": 608 - }, - "averageTime": { - "type": "number", - "description": "The configured number of seconds between batches.", - "example": 608 - }, - "finalisedBatchPendingConfirmation": { - "type": "bool", - "description": "True if the previous batch has been created but still pending confirmation on the blockchain.'", - "example": true - } - } - }, - "last24HoursVolumeResponse":{ - "type":"object", - "properties":{ - "totalUSDVolume":{ - "type":"number", - "description":"The total trade volume in terms of USD.", - "example":3320.75 - }, - "tokens":{ - "$ref":"#/definitions/tokens" - }, - "startDate":{ - "type":"string", - "description":"The start date and time for the volume presented.", - "example":"2020-01-01T00:00:00.714Z" - } - } - }, - "tokenRankingResponse":{ - "type":"object", - "properties":{ - "address":{ - "type":"string", - "description":"The address of the trader.", - "example":"0xfc898b18a70ce49579f8d79a32e29928c15b4bc8" - }, - "amount":{ - "type":"number", - "description":"The trading volume for the address", - "example":852.9290936325145 - } - } - }, - "getBalancePayload":{ - "type":"object", - "properties":{ - "nonce":{ - "type":"string", - "description":"This nonce is used to provide the time until which this nonce is valid. It is presented as seconds since epoch.", - "example":"v2-1704114061.000" - }, - "signature":{ - "type":"string", - "description":"The signature obtained by signing the nonce with your private ethereum key.", - "example":"0x2b48d53f2e3a696630ebdcd1ff057556bbc9de9c294adfaa5b1f13df91b67b347fdd88c29594c377ba0024dec40cd9808829e7f4447772482f50a7a8e9a903561c" - }, - "token":{ - "type":"string", - "description":"The token which the balance is specifically requested for.", - "example":"ETH" - } - }, - "required":[ - "nonce", - "signature" - ] - }, - "getBalanceResponse":{ - "type":"object", - "properties":{ - "balance":{ - "type":"number", - "description":"It is the total balance available for the user corresponding to the specified token.", - "example":1 - }, - "activeBalance":{ - "type":"number", - "description":"It is the active balance available for the user corresponding to the specified token.", - "example":0 - }, - "_id":{ - "type":"string", - "description":"User ID.", - "example":"5e318fc4948cc789bb5f7bb4" - }, - "ethAddress":{ - "type":"string", - "description":"The ethereum public address of the user.", - "example":"user-01" - }, - "token":{ - "type":"string", - "description":"The token for which the balances are provided.", - "example":"ETH" - } - } - }, - "withdrawHistoryResponse": { - "type":"object", - "properties":{ - "_id":{ - "type":"string", - "description":"Withdrawal ID.", - "example":"53cb6b9b4f4ddef1ad47f943" - }, - "token":{ - "type":"string", - "description":"The token that was withdrawn.", - "example":"USDT" - }, - "amount":{ - "type":"number", - "description":"The amount that was withdrawn.", - "example":100 - }, - "createdAt":{ - "type":"string", - "description":"The date and time of the withdrawal.", - "example":"2020-01-29T14:13:05.898Z" - }, - "readyToWithdrawOnChain":{ - "type":"bool", - "description":"The withdrawal is ready to be requested.", - "example":true - } - } - }, - "getConfResponse":{ - "type":"object", - "properties":{ - "DVF":{ - "type":"object", - "description":"This contains application configuration details to set up for deposits and trading.", - "example":{ - "defaultFeeRate":0.002, - "deversifiAddress":"0x9ab450355b4ab504cbc0e4de484781dac08e6a26", - "starkExContractAddress":"0xF3731d0cdC9834f6F32104580bD226EF1bc1A9F9", - "exchangeSymbols":"[\"tETHUSD\",\"tZRXUSD\",\"tZRXETH\"]", - "tempStarkVaultId":1 - }, - "properties":{ - "defaultFeeRate":{ - "type":"number", - "description":"The default fee rate, if no volume or maker discount." - }, - "deversifiAddress":{ - "type":"string", - "description":"The address of the DeversiFi exchange." - }, - "starkExContractAddress":{ - "type":"string", - "description":"Stark deposit contract address." - }, - "exchangeSymbols":{ - "type":"array", - "description":"Currency pairs available at the DeversiFi exchange for trading" - }, - "tempStarkVaultId":{ - "type":"number", - "description":"Transit Stark vault ID used for deposit privacy" - } - } - }, - "tokenRegistry":{ - "type":"object", - "description": "Detailed information related to each available token." - } - } - }, - "getDepositsResponse":{ - "type":"object", - "properties":{ - "ethAddress":{ - "type":"string", - "description":"The ethereum public address of the user.", - "example":"0x341E46a49F15785373edE443Df0220DEa6a41Bbc" - }, - "starkKey":{ - "type":"string", - "description":"The Stark public key.", - "example":"77a3b314db07c45076d11f62b6f9e748a39790441823307743cf00d6597ea43" - }, - "starkVaultId":{ - "type":"number", - "description":"The Stark vault ID.", - "example":123 - }, - "starkTokenId":{ - "type":"string", - "description":"The Stark token ID.", - "example":"0x7" - }, - "token":{ - "type":"string", - "description":"The token that was deposited", - "example":"USDT" - }, - "amount":{ - "type":"number", - "description":"The amount that was deposited.", - "example":1000 - }, - "createdAt":{ - "type":"string", - "description":"The date and time of the deposit.", - "example":"2020-01-29T14:02:08.477Z" - }, - "isPostedOffchain":{ - "type":"boolean", - "description":"Flag to indicate if the deposit was posted off chain.", - "example":false - }, - "isConfirmedOnChain":{ - "type":"boolean", - "description":"Flag to indicate if the deposit was confirmed off chain.", - "example":true - } - } - }, - "getOrderPayload": { - "type": "object", - "properties": { - "orderId": { - "type": "string", - "description": "The ID of the order. In case you want to view all open orders, check POST openOrders.", - "example": "123" - }, - "cid": { - "type": "string", - "description": "An optional user-defined identifier for this order", - "example": "satoshi-order-2083236893" - }, - "nonce": { - "type": "string", - "description": "This nonce is used to provide the time until which this nonce is valid. It is presented as seconds since epoch.", - "example": "v2-1704114061.000" - }, - "signature": { - "type": "string", - "description": "The signature obtained by signing the nonce with your private ethereum key.", - "example": "0xec3606b6b0ee3e28b66803f65aafec4dfe9d4e49be68270fa7275dd8435349c45574c0476edd99641bc13523985ad0b29924f0d4204ce56bc6af00874a0126dc00" - } - }, - "required": ["orderId", "nonce", "signature"] - }, - "getOrderResponse": { - "type": "object", - "properties": { - "_id": { - "type": "string", - "description": "Id for the order. This can be used for orderId when calling cancelOrder or getOrder", - "example": "L1tarX5wUem" - }, - "amount": { - "type": "number", - "description": "Actual order amount.", - "example": "-0.15" - }, - "price": { - "type": "number", - "description": "Cost per unit.", - "example": "250" - }, - "symbol": { - "type": "string", - "description": "Trading symbol for the order", - "example": "ETH:USDT" - }, - "canceled": { - "type": "string", - "description": "Canceled status true or false.", - "example": "ACTIVE" - }, - "pending": { - "type": "string", - "description": "Pending status true or false.", - "example": "ACTIVE" - } - } - }, - "getPendingWithdrawalsPayload":{ - "type":"object", - "properties":{ - "nonce": { - "type": "string", - "description": "This nonce is used to provide the time until which this nonce is valid. It is presented as seconds since epoch.", - "example": "v2-1704114061.000" - }, - "signature": { - "type": "string", - "description": "The signature obtained by signing the nonce with your private ethereum key.", - "example": "0x2b48d53f2e3a696630ebdcd1ff057556bbc9de9c294adfaa5b1f13df91b67b347fdd88c29594c377ba0024dec40cd9808829e7f4447772482f50a7a8e9a903561c" - }, - "token":{ - "type":"string", - "description":"The token that will be withdrawn.", - "example":"ETH" - } - }, - "required":[ - "nonce", - "signature" - ] - }, - "getUserConfPayload":{ - "type":"object", - "properties":{ - "nonce":{ - "type":"string", - "description":"A user generated nonce.", - "example": "v2-1704114061.000" - }, - "signature":{ - "type":"string", - "description":"The signed hash (signature) received during the pre-registration process.", - "example":"0x2b48d53f2e3a696630ebdcd1ff057556bbc9de9c294adfaa5b1f13df91b67b347fdd88c29594c377ba0024dec40cd9808829e7f4447772482f50a7a8e9a903561c" - } - }, - "required":[ - "nonce", - "signature" - ] - }, - "getUserConfResponse":{ - "type":"object", - "properties":{ - "DVF":{ - "type":"object", - "description":"This contains application configuration details to set up for deposits and trading.", - "example":{ - "defaultFeeRate":0.002, - "deversifiAddress":"0x9ab450355b4ab504cbc0e4de484781dac08e6a26", - "starkExContractAddress":"0xF3731d0cdC9834f6F32104580bD226EF1bc1A9F9", - "exchangeSymbols":"[\"tETHUSD\",\"tZRXUSD\",\"tZRXETH\"]", - "tempStarkVaultId":1 - }, - "properties":{ - "defaultFeeRate":{ - "type":"number", - "description":"The default fee rate, if no volume or maker discount." - }, - "deversifiAddress":{ - "type":"string", - "description":"The address of the DeversiFi exchange." - }, - "starkExContractAddress":{ - "type":"string", - "description":"Stark deposit contract address." - }, - "exchangeSymbols":{ - "type":"string", - "description":"Currency pairs available at the DeversiFi exchange for trading" - }, - "tempStarkVaultId":{ - "type":"number", - "description":"Transit Stark vault ID used for deposit privacy" - } - } - }, - "tokenRegistry":{ - "type":"object", - "description": "Detailed information related to each available token." - }, - "isRegistered":{ - "type":"string", - "description":"Registration status.", - "example":"true" - }, - "ethAddress":{ - "type":"string", - "description":"Ethereum address.", - "example":"0x278ff3bb25c5b1bb7032e822661974479280fa74" - } - } - }, - "getWithdrawalPayload":{ - "type":"object", - "properties":{ - "withdrawalId":{ - "type":"string", - "description":"Used to identify a specific withdrawal.", - "example":"i6JjTE2PDL" - }, - "nonce":{ - "type":"string", - "description":"This nonce is used to provide the time until which this nonce is valid. It is presented as seconds since epoch.", - "example": "v2-1704114061.000" - }, - "signature":{ - "type":"string", - "description":"The signature obtained by signing the nonce with your private ethereum key.", - "example":"0x2b48d53f2e3a696630ebdcd1ff057556bbc9de9c294adfaa5b1f13df91b67b347fdd88c29594c377ba0024dec40cd9808829e7f4447772482f50a7a8e9a903561c" - } - }, - "required":[ - "withdrawalId", - "nonce", - "signature" - ] - }, - "getWithdrawalResponse":{ - "type":"object", - "properties":{ - "_id":{ - "type":"string", - "example":"53cb6b9b4f4ddef1ad47f943" - }, - "ethAddress":{ - "type":"string", - "description":"Ethereum public address of the user.", - "example":"0x14d06788090769f669427b6aea1c0240d2321f34" - }, - "starkKey":{ - "type":"string", - "description":"The Stark public key of the user.", - "example":"77a3b314db07c45076d11f62b6f9e748a39790441823307743cf00d6597ea43" - }, - "token":{ - "type":"string", - "description":"The token that was withdrawn.", - "example":"USDT" - }, - "amount":{ - "type":"number", - "description":"The amount that was withdrawn.", - "example":100 - }, - "createdAt":{ - "type":"string", - "description":"The date and time of the withdrawal.", - "example":"2020-01-29T14:13:05.898Z" - } - } - }, - "openOrdersPayload": { - "type": "object", - "properties": { - "nonce": { - "type": "string", - "description": "This nonce is used to provide the time until which this nonce is valid. It is presented as seconds since epoch.", - "example": "v2-1704114061.000" - }, - "signature": { - "type": "string", - "description": "The signature obtained by signing the nonce with your private ethereum key.", - "example": "0x2b48d53f2e3a696630ebdcd1ff057556bbc9de9c294adfaa5b1f13df91b67b347fdd88c29594c377ba0024dec40cd9808829e7f4447772482f50a7a8e9a903561c" - }, - "symbol": { - "type": "string", - "description": "Specifies the trading pair.", - "example": "ETH:USDT" - } - }, - "required": ["nonce", "signature"] - }, - "openOrdersObject": { - "type": "object", - "properties": { - "_id": { - "type": "string", - "description": "Id for the order. This can be used for orderId when calling cancelOrder or getOrder", - "example": "L1tarX5wUem" - }, - "type": { - "type": "string", - "description": "Type of the order. Currently, \"EXCHANGE LIMIT\" is the only type that is supported.", - "example": "EXCHANGE LIMIT" - }, - "pair": { - "type": "string", - "description": "The trading pair that was used for this order.", - "example": "ETHUSD" - }, - "amount": { - "type": "number", - "description": "Actual order amount.", - "example": "-0.5" - }, - "totalFilled": { - "type": "number", - "description": "Total of all fills executed.", - "example": "-0.5" - }, - "price": { - "type": "number", - "description": "Cost per unit.", - "example": "250" - }, - "status": { - "type": "string", - "description": "The status of the order.", - "example": "CANCELED" - }, - "mtsTIF": { - "type": "number", - "description": "Milliseconds till order expires.", - "example": "250" - }, - "id": { "type": "string", "example": "1151079509" }, - "created_at": { - "type": "string", - "description": "The date and time when the order was created.", - "example": "2018-07-21 16:15:58" - }, - "updated_at": { - "type": "string", - "description": "The date and time when the order was last updated.", - "example": "2018-07-23 19:52:51" - } - } - }, - "openOrdersResponse": { - "type": "array", - "items": { - "type": "object", - "properties": { - "_id": { - "type": "string", - "description": "Id for the order. This can be used for orderId when calling cancelOrder or getOrder", - "example": "L1tarX5wUem" - }, - "type": { - "type": "string", - "description": "Type of the order. Currently, \"EXCHANGE LIMIT\" is the only type that is supported.", - "example": "EXCHANGE LIMIT" - }, - "pair": { - "type": "string", - "description": "The trading pair that was used for this order.", - "example": "ETHUSD" - }, - "amount": { - "type": "number", - "description": "Actual order amount.", - "example": "-0.5" - }, - "totalFilled": { - "type": "number", - "description": "Total of all fills executed.", - "example": "-0.5" - }, - "price": { - "type": "number", - "description": "Cost per unit.", - "example": "250" - }, - "status": { - "type": "string", - "description": "The status of the order.", - "example": "CANCELED" - }, - "mtsTIF": { - "type": "number", - "description": "Milliseconds till order expires.", - "example": "250" - }, - "id": { "type": "string", "example": "1151079509" }, - "created_at": { - "type": "string", - "description": "The date and time when the order was created.", - "example": "2018-07-21 16:15:58" - }, - "updated_at": { - "type": "string", - "description": "The date and time when the order was last updated.", - "example": "2018-07-23 19:52:51" - } - } - } - }, - "orderHistoryPayload": { - "type": "object", - "properties": { - "nonce": { - "type": "string", - "description": "This nonce is used to provide the time until which this nonce is valid. It is presented as seconds since epoch.", - "example": "v2-1704114061.000" - }, - "signature": { - "type": "string", - "description": "The signature obtained by signing the nonce with your private ethereum key.", - "example": "0x2b48d53f2e3a696630ebdcd1ff057556bbc9de9c294adfaa5b1f13df91b67b347fdd88c29594c377ba0024dec40cd9808829e7f4447772482f50a7a8e9a903561c" - }, - "symbol": { - "type": "string", - "description": "Specifies the trading pair.", - "example": "ETH:USDT" - } - }, - "required": ["nonce", "signature"] - }, - "meta": { - "type": "object", - "description": "Contains metadata $F15 and auth.", - "properties": { - "orderId": { - "type": "string", - "description": "Id for the order. This can be used for orderId when calling cancelOrder or getOrder", - "example": "L1tarX5wUem" - }, - "auth": { - "type": "string", - "example": "0x97ebb3391b30f495ce8cb97857db9b72d3e9dbcb" - }, - "user": { - "type": "string", - "example": "0x97ebb3391b30f495ce8cb97857db9b72d3e9dbcb" - } - } - }, - "orderHistoryResponse": { - "type": "object", - "properties": { - "_id": { - "type": "string", - "description": "Order Id, this can be used as orderId when calling cancelOrder or getOrder.", - "example": "L1tarX5wUem" - }, - "user": { - "type": "string", - "description": "Ethereum address of the user.", - "example": "0x341e46a49f15785373ede443df0220dea6a41bbc" - }, - "symbol": { - "type": "string", - "description": "The trading pair symbol for this order.", - "example": "ZRX:ETH" - }, - "amount": { - "type": "number", - "description": "Original order size placed.", - "example": "50" - }, - "totalFilled": { - "type": "number", - "description": "Total of all fills executed.", - "example": "50" - }, - "tokenBuy": { - "type": "string", - "description": "Token being bought as part of this exchange order.", - "example": "ETH" - }, - "totalBought": { - "type": "number", - "description": "Total tokens bought, in quantized units.", - "example": "4990000000" - }, - "tokenSell": { - "type": "string", - "description": "Token being sold as part of this exchange order.", - "example": "ETH" - }, - "totalSold": { - "type": "number", - "description": "Total tokens sold, in quantized units.", - "example": "45555500" - }, - "type": { - "type": "string", - "description": "Type of the order. Currently, \"EXCHANGE LIMIT\" is the only type that is supported.", - "example": "EXCHANGE LIMIT" - }, - "price": { - "type": "number", - "description": "Cost per unit.", - "example": "0.01" - }, - "averagePrice": { - "type": "number", - "description": "Average price at which the order has been settled.", - "example": "0.0091111" - }, - "feeRate": { - "type": "number", - "description": "The max fee rate applicable for the order.", - "example": "0.002" - }, - "createdAt": { - "type": "string", - "description": "The date and time when the order was created.", - "example": "2020-05-13T14:11:02.205+00:002018-07-21 16:15:58" - }, - "updatedAt": { - "type": "string", - "description": "The date and time when the order was last updated.", - "example": "2020-05-13T14:13:10.403+00:00" - }, - "activatedAt": { - "type": "string", - "description": "The date and time when the order was activated.", - "example": "2020-05-13T14:11:03.000+00:00" - } - } - }, - "cancelOrderPayload":{ - "type":"object", - "properties":{ - "orderId":{ - "type":"string", - "description":"The order ID.", - "example":"d7c8b9" - }, - "cid": { - "type": "string", - "description": "An optional user-defined identifier for this order", - "example": "satoshi-order-2083236893" - }, - "nonce": { - "type": "string", - "description": "This nonce is used to provide the time until which this nonce is valid. It is presented as seconds since epoch.", - "example": "v2-1704114061.000" - }, - "signature":{ - "type":"string", - "description":"The signed hash (signature) received during the pre-registration process.", - "example":"0x0277b6e85ffdfb8cdc34c89b8b60c42a1a96a57e1b528ca3ff203b2dac8c9a200dbedd5ab8d2ed7ef19e915daf00327db91c1f5a1988666089e6b8420881699501" - } - }, - "required":[ - "orderId", - "nonce", - "signature" - ] - }, - "cancelOrderResponse":{ - "type":"object", - "properties":{ - "orderId":{ - "type":"string", - "description":"The order ID.", - "example":"d7c8b9" - }, - "canceled":{ - "type":"boolean", - "description":"only if order is already canceled", - "example":true - } - } - }, - "cancelWithdrawalPayload":{ - "type":"object", - "properties":{ - "id":{ - "type":"string", - "description":"The withdrawal ID.", - "example":"q7w8e9" - }, - "nonce": { - "type": "string", - "description": "This nonce is used to provide the time until which this nonce is valid. It is presented as seconds since epoch.", - "example": "v2-1704114061.000" - }, - "signature":{ - "type":"string", - "description":"The signed hash (signature) received during the pre-registration process.", - "example":"0x0277b6e85ffdfb8cdc34c89b8b60c42a1a96a57e1b528ca3ff203b2dac8c9a200dbedd5ab8d2ed7ef19e915daf00327db91c1f5a1988666089e6b8420881699501" - } - }, - "required":[ - "id" - ] - }, - "cancelWithdrawalResponse":{ - "type":"object", - "properties":{ - "_id":{ - "type":"string", - "description":"The withdrawal ID.", - "example":"q7w8e9" - }, - "token":{ - "type":"string", - "description":"The token for which the withdrawal was requested.", - "example":"USDT" - }, - "amount":{ - "type":"number", - "description":"The withdrawal amount.", - "example":1 - }, - "createdAt":{ - "type":"string", - "description":"The date and time of the withdrawal.", - "example":"2020-01-01T22:57:47.323Z" - }, - "readyToWithdrawOnChain":{ - "type":"bool", - "description":"IF the withdrawal is ready to be requested.", - "example":false - }, - "canceled": { - "type": "string", - "description": "Canceled status.", - "example": true - } - } - }, - "starkPublicKey":{ - "type":"object", - "description":"The Stark public key. Both the \"x\" and \"y\" part are required.", - "example":{ - "x":"6d840e6d0ecfcbcfa83c0f704439e16c69383d93f51427feb9a4f2d21fbe075", - "y":"58f7ce5eb6eb5bd24f70394622b1f4d2c54ebca317a3e61bf9f349dccf166cf" - }, - "properties":{ - "x":{ - "type":"string", - "description":"The \"x\" part of the Stark public key." - }, - "y":{ - "type":"string", - "description":"The \"y\" part of the Stark public key." - } - } - }, - "starkSignature":{ - "type":"object", - "description":"Stark signature consisting of consisting of \"r\", \"s\" and the recovery parameter.", - "example":{ - "r":"1f38f551d798562c16d28733c7e3ff6850898d82f0ac9ccd39d373303b1778c", - "s":"518560420e52a37e9f580f024fc0fe8572cb2f5437a839075bbf4b2b123d572", - "recoveryParam":1 - }, - "properties":{ - "r":{ - "type":"string", - "description":"The \"r\" part of the Stark signature." - }, - "s":{ - "type":"string", - "description":"The \"s\" part of the Stark signature." - }, - "recoveryParam":{ - "type":"number", - "description":"The recovery parameter of the Stark signature." - } - } - }, - "depositPayload":{ - "type":"object", - "properties":{ - "nonce": { - "type": "string", - "description": "This nonce is used to provide the time until which this nonce is valid. It is presented as seconds since epoch.", - "example": 162543006, - "required":true - }, - "token":{ - "type":"string", - "description":"The token for which the deposit was made.", - "example":"ZRX" - }, - "amount":{ - "type":"number", - "description":"The deposit amount.", - "example":1 - }, - "starkPublicKey":{ - "type":"object", - "description":"The Stark public key. Both the \"x\" and \"y\" part are required.", - "example":{ - "x":"6d840e6d0ecfcbcfa83c0f704439e16c69383d93f51427feb9a4f2d21fbe075", - "y":"58f7ce5eb6eb5bd24f70394622b1f4d2c54ebca317a3e61bf9f349dccf166cf" - }, - "properties":{ - "x":{ - "type":"string", - "description":"The \"x\" part of the Stark public key." - }, - "y":{ - "type":"string", - "description":"The \"y\" part of the Stark public key." - } - } - }, - "starkSignature":{ - "type":"object", - "description":"Stark signature consisting of consisting of \"r\", \"s\" and the recovery parameter.", - "example":{ - "r":"1f38f551d798562c16d28733c7e3ff6850898d82f0ac9ccd39d373303b1778c", - "s":"518560420e52a37e9f580f024fc0fe8572cb2f5437a839075bbf4b2b123d572", - "recoveryParam":1 - }, - "properties":{ - "r":{ - "type":"string", - "description":"The \"r\" part of the Stark signature." - }, - "s":{ - "type":"string", - "description":"The \"s\" part of the Stark signature." - }, - "recoveryParam":{ - "type":"number", - "description":"The recovery parameter of the Stark signature." - } - } - }, - "starkVaultId":{ - "type":"number", - "description":"The Stark vault ID.", - "example":1000003 - }, - "expireTime":{ - "type":"number", - "example": 1 - } - }, - "required":[ - "token", - "amount", - "nonce", - "starkPublicKey", - "starkSignature", - "starkVaultId", - "expireTime" - ] - }, - "depositResponse":{ - "type":"object", - "properties":{ - "isPostedOffchain":{ - "type":"boolean", - "description":"Flag to indicate if the deposit was posted off chain.", - "example":false - }, - "isConfirmedOnChain":{ - "type":"boolean", - "description":"Flag to indicate if the deposit was confirmed off chain.", - "example":true - }, - "_id":{ - "type":"string", - "example":"5e335f88bdcd70001e52d0a7" - }, - "starkVaultId":{ - "type":"number", - "description":"The Stark vault ID.", - "example":1000003 - }, - "starkKey":{ - "type":"string", - "description":"The Stark public key.", - "example":"6d840e6d0ecfcbcfa83c0f704439e16c69383d93f51427feb9a4f2d21fbe075" - }, - "starkMessage":{ - "type":"string", - "description":"Stark Message ID.", - "example":"1d980821dab7adf8f422a4754b031585e663bb1f70d8adb550cde8a628fdbbb" - }, - "starkSignature":{ - "$ref":"#/definitions/starkSignature" - }, - "starkTokenId":{ - "type":"string", - "description":"The Stark token ID.", - "example":"0x3" - }, - "amount":{ - "type":"number", - "description":"The amount that was deposited.", - "example":1 - }, - "ethAddress":{ - "type":"string", - "description":"Ethereum public address of the user.", - "example":"0x341e46a49f15785373ede443df0220dea6a41bbc" - }, - "createdAt":{ - "type":"string", - "description":"The date and time of the deposit.", - "example":"2020-01-30T22:58:16.720Z" - } - }, - "required":[ - "starkSignature" - ] - }, - "registerPayload":{ - "type":"object", - "properties":{ - "starkKey":{ - "type":"string", - "description":"The Stark public key.", - "example":"6d840e6d0ecfcbcfa83c0f704439e16c69383d93f51427feb9a4f2d21fbe075" - }, - "nonce":{ - "type":"string", - "description":"A user generated nonce.", - "example":"1579783140.807" - }, - "signature":{ - "type":"string", - "description":"The signed hash (signature) received during the pre-registration process.", - "example":"0x7e83e5fb1eb382d06906efa984a1cbf9c7a5bd301cbbbfa68d5d23624f9d301358329465291f5b72a9680687badf8f01a474193bd738add3d89e8d7e0e034b2b00" - } - }, - "required":[ - "starkKey", - "nonce", - "signature" - ] - }, - "registerResponse":{ - "type":"object", - "properties":{ - "DVF":{ - "type":"object", - "description":"This contains application configuration details to set up for deposits and trading.", - "example":{ - "defaultFeeRate":0.002, - "deversifiAddress":"0x9ab450355b4ab504cbc0e4de484781dac08e6a26", - "starkExContractAddress":"0xF3731d0cdC9834f6F32104580bD226EF1bc1A9F9", - "exchangeSymbols":"[\"tETHUSD\",\"tZRXUSD\",\"tZRXETH\"]", - "tempStarkVaultId":1 - }, - "properties":{ - "defaultFeeRate":{ - "type":"number", - "description":"The default fee rate, if no volume or maker discount." - }, - "deversifiAddress":{ - "type":"string", - "description":"The address of the DeversiFi exchange." - }, - "starkExContractAddress":{ - "type":"string", - "description":"Stark deposit contract address." - }, - "exchangeSymbols":{ - "type":"string", - "description":"Currency pairs available at the DeversiFi exchange for trading" - }, - "tempStarkVaultId":{ - "type":"number", - "description":"Transit Stark vault ID used for deposit privacy" - } - } - }, - "tokenRegistry":{ - "type":"object", - "description": "Detailed information related to each available token." - }, - "isRegistered":{ - "type":"string", - "description":"Registration status.", - "example":"true" - }, - "ethAddress":{ - "type":"string", - "description":"Ethereum address.", - "example":"0x278ff3bb25c5b1bb7032e822661974479280fa74" - }, - "deFiSignature":{ - "type":"string", - "description":"Deversifi Signature", - "example":"0x0277b6e85ffdfb8cdc34c89b8d7ef19e915daf00327db91c1f5a1988666089e6b8420881699501" - } - } - }, - "starkOrder": { - "type": "object", - "description": "Stark order related meta information.", - "properties": { - "vaultIdSell": { - "type": "number", - "description": "The vault ID of the seller." - }, - "vaultIdBuy": { - "type": "number", - "description": "The vault ID of the buyer." - }, - "amountSell": { - "type": "string", - "description": "The total amount to be sold." - }, - "amountBuy": { - "type": "string", - "description": "The total amount to be bought." - }, - "tokenSell": { - "type": "string", - "description": "The Stark token ID for the token being sold." - }, - "tokenBuy": { - "type": "string", - "description": "The Stark token ID for the token being bought." - }, - "nonce": { "type": "number", "description": "Nonce value." }, - "expirationTimestamp": { - "type": "number", - "description": "Expiration timestamp of the order." - } - } - }, - "submitOrderMeta": { - "type": "object", - "description": "A set of meta values.", - "example": { - "starkOrder": { - "vaultIdSell": 1000002, - "vaultIdBuy": 1000001, - "amountSell": "97400000", - "amountBuy": "100000000000000000", - "tokenSell": "0x2", - "tokenBuy": "0x1", - "nonce": 0, - "expirationTimestamp": 438947 - }, - "starkMessage": "597f31e19f2273413833ed1408edd7a2c60e9f82422852a1be7d11049be3268", - "ethAddress": "0x341E46a49F15785373edE443Df0220DEa6a41Bbc", - "starkPublicKey": { - "x": "6d840e6d0ecfcbcfa83c0f704439e16c69383d93f51427feb9a4f2d21fbe075", - "y": "58f7ce5eb6eb5bd24f70394622b1f4d2c54ebca317a3e61bf9f349dccf166cf" - }, - "starkSignature": { - "r": "5d14357fcf8f489218de0855267c6f64bc463135debf62680ad796e63cd6d3b", - "s": "786ab874d91e3a5871134955fcb768914754760a0ada326af67f758f32819cf", - "recoveryParam": 0 - } - }, - "properties": { - "starkOrder": { "$ref": "#/definitions/starkOrder" }, - "starkMessage": { - "type": "string", - "description": "Stark Message ID." - }, - "ethAddress": { - "type": "string", - "description": "The Ethereum public address." - }, - "starkPublicKey": { - "type":"object", - "description": "Detailed information related to each available token." - }, - "starkSignature": { - "type":"object", - "description": "Detailed information related to each available token." - } - } - }, - "submitOrderPayload": { - "type": "object", - "properties": { - "cid": { - "type": "string", - "description": "Optional custom order ID that could be set when placing order and used later to retrieve order. This ID is unique per user (user A and B can each have an order with cid = AAA, but the same user cannot have two orders with the same cid)", - "example": "long-123" - }, - "gid": { "type": "string" }, - "type": { - "type": "string", - "description": "The type of order. Currently only “EXCHANGE_LIMIT” is accepted.", - "example": "EXCHANGE LIMIT", - "enum": [ - "EXCHANGE LIMIT", - "exchange limit", - "EXCHANGE MARKET", - "exchange market" - ] - }, - "symbol": { - "type": "string", - "description": "The trading pair.", - "example": "ETH:USDT" - }, - "amount": { - "type": "number", - "description": "The token amount to be traded.", - "example": 0.1 - }, - "price": { - "type": "number", - "description": "The cost per unit.", - "example": 1000 - }, - "meta": { - "type": "object", - "description": "A set of meta values.", - "example": { - "starkOrder": { - "vaultIdSell": 1000002, - "vaultIdBuy": 1000001, - "amountSell": "97400000", - "amountBuy": "100000000000000000", - "tokenSell": "0x2", - "tokenBuy": "0x1", - "nonce": 0, - "expirationTimestamp": 438947 - }, - "starkMessage": "597f31e19f2273413833ed1408edd7a2c60e9f82422852a1be7d11049be3268", - "ethAddress": "0x341E46a49F15785373edE443Df0220DEa6a41Bbc", - "starkPublicKey": { - "x": "6d840e6d0ecfcbcfa83c0f704439e16c69383d93f51427feb9a4f2d21fbe075", - "y": "58f7ce5eb6eb5bd24f70394622b1f4d2c54ebca317a3e61bf9f349dccf166cf" - }, - "starkSignature": { - "r": "5d14357fcf8f489218de0855267c6f64bc463135debf62680ad796e63cd6d3b", - "s": "786ab874d91e3a5871134955fcb768914754760a0ada326af67f758f32819cf", - "recoveryParam": 0 - } - }, - "properties": { - "starkOrder": { "$ref": "#/definitions/starkOrder" }, - "starkMessage": { - "type": "string", - "description": "Stark Message ID." - }, - "ethAddress": { - "type": "string", - "description": "The Ethereum public address." - }, - "starkPublicKey": { - "type":"object", - "description": "Detailed information related to each available token." - }, - "starkSignature": { - "type":"object", - "description": "Detailed information related to each available token." - } - } - }, - "protocol": { "type": "string", "enum": ["stark"] }, - "partnerId": { "type": "string" }, - "feeRate": { "type": "string", "example": 0.1 } - }, - "required": ["type", "symbol", "amount", "price", "meta"] - }, - "submitOrderResponse": { - "type": "object", - "properties": { - "_id": { - "type": "string", - "description": "Id for the order. This can be used for orderId when calling cancelOrder or getOrder", - "example": "L1tarX5wUem" - }, - "user": { - "type": "string", - "description": "Ethereum address of the user", - "example": "E0xc1caf2d76c49e4a60635635c329a3ac22ddeb547" - }, - "symbol": { - "type": "string", - "description": "Trading symbol for the order", - "example": "ETH:USDT" - }, - "tokenSell": { - "type": "string", - "description": "The token which is being sold", - "example": "ETH" - }, - "tokenBuy": { - "type": "string", - "description": "The token which is being bought", - "example": "USDT" - }, - "amount": { - "type": "number", - "description": "Original order size placed being sold or bought.", - "example": "-0.5" - }, - "price": { - "type": "number", - "description": "Cost per unit.", - "example": "200" - }, - "type": { - "type": "string", - "description": "Type of the order. Currently, \"EXCHANGE LIMIT\" is the only type that is supported.", - "example": "EXCHANGE LIMIT" - }, - "createdAt": { - "type": "string", - "description": "The date and time when the order was created.", - "example": "2020-05-09T18:29:56.603Z" - }, - "updatedAt": { - "type": "string", - "description": "The date and time when the order was last updated.", - "example": "2020-05-09T18:29:56.945Z" - }, - "activatedAt": { - "type": "string", - "description": "The date and time when the order was activated.", - "example": "2020-05-09T18:29:56.944Z" - } - } - }, - "withdrawalPayload":{ - "type":"object", - "properties":{ - "token":{ - "type":"string", - "description":"The token for which the withdrawal is requested.", - "example":"ZRX" - }, - "amount":{ - "type":"number", - "description":"The withdrawal amount.", - "example":1 - }, - "nonce":{ - "type":"number", - "description": "This nonce which used to provide the time until which this nonce is valid. It is presented as seconds since epoch.", - "example": "v2-1704114061.000" - }, - "starkPublicKey":{ - "type":"object", - "description":"The Stark public key. Both the \"x\" and \"y\" part are required.", - "example":{ - "x":"6d840e6d0ecfcbcfa83c0f704439e16c69383d93f51427feb9a4f2d21fbe075", - "y":"58f7ce5eb6eb5bd24f70394622b1f4d2c54ebca317a3e61bf9f349dccf166cf" - }, - "properties":{ - "x":{ - "type":"string", - "description":"The \"x\" part of the Stark public key." - }, - "y":{ - "type":"string", - "description":"The \"y\" part of the Stark public key." - } - } - }, - "starkSignature":{ - "type":"object", - "description":"Stark signature consisting of consisting of \"r\", \"s\" and the recovery parameter.", - "example":{ - "r":"1f38f551d798562c16d28733c7e3ff6850898d82f0ac9ccd39d373303b1778c", - "s":"518560420e52a37e9f580f024fc0fe8572cb2f5437a839075bbf4b2b123d572", - "recoveryParam":1 - }, - "properties":{ - "r":{ - "type":"string", - "description":"The \"r\" part of the Stark signature." - }, - "s":{ - "type":"string", - "description":"The \"s\" part of the Stark signature." - }, - "recoveryParam":{ - "type":"number", - "description":"The recovery parameter of the Stark signature." - } - } - }, - "starkVaultId":{ - "type":"number", - "description":"The Stark vault ID.", - "example":1000003 - }, - "expireTime":{ - "type":"number", - "example": 442438 - } - }, - "required":[ - "token", - "amount", - "nonce", - "starkPublicKey", - "starkSignature", - "starkVaultId", - "expireTime" - ] - }, - "getGasPriceResponse": { - "type":"object", - "properties":{ - "fast":{ - "type":"number", - "description":"Gas price in Wei for quickest onchain transaction confirmation.", - "example":70000000000 - }, - "average":{ - "type":"number", - "description":"Average gas price in Wei for average onchain transaction speed.", - "example":67000000000 - }, - "cheap":{ - "type":"number", - "description":"Low gas price in Wei and very slow transaction speed.", - "example":66000000000 - }, - "fastWait":{ - "type":"number", - "description":"The approximate time for a transaction confirmation when using fast as the gas price.", - "example":0.5 - }, - "averageWait":{ - "type":"number", - "description":"The approximate time for a transaction confirmation when using average as the gas price.", - "example":1.4 - }, - "cheapWait":{ - "type":"number", - "description":"The approximate time for a transaction confirmation when using cheap as the gas price.", - "example":10.5 - } - } - }, - "tradesResponse":{ - "type":"object", - "properties":{ - "trade_id":{ - "type":"number", - "description":"A unique ID associated with the trade for the currency pair transaction", - "example":1 - }, - "price":{ - "type":"number", - "description":"Last transacted price of base currency based on given quote currency.", - "example":275.23 - }, - "base_volume":{ - "type":"number", - "description":"Transaction amount in BASE currency.", - "example":1.5 - }, - "quote_volume":{ - "type":"number", - "description":"Transaction amount in QUOTE currency.", - "example":347.81 - }, - "timestamp":{ - "type":"number", - "description":"Unix timestamp in milliseconds for when the transaction occurred.", - "example":1548028800 - }, - "type":{ - "type":"number", - "description":"Used to determine whether or not the transaction originated as a buy or sell.", - "example":"buy" - } - } - }, - "permissionsResponse": { - "type": "object", - "properties": { - "balances": { - "type": "boolean", - "description": "is balances authorized" - }, - "tradingHistory": { - "type": "boolean", - "description": "is trading history authorized" - } - } - }, - "Model3": { - "type": "object", - "properties": { - "fillId": { - "type": "string", - "description": "Unique identifier representing the fill event", - "example": "606f207fc7aa2e91d028a17a" - }, - "orderId": { - "type": "string", - "description": "Unique identifier of the order associated with the fill", - "example": "BtHEvgY1Bz1" - }, - "symbol": { - "type": "string", - "description": "Symbol for the order associated with the fill", - "example": "ETH:USDT" - }, - "price": { - "type": "number", - "description": "Execution price of the fill", - "example": 209.9 - }, - "fillAmount": { - "type": "number", - "description": "Amount filled (negative amount for a sell event, positive for a buy event)", - "example": -0.125622 - }, - "orderAmount": { - "type": "number", - "description": "Initial amount for the placed order associated with the fill", - "example": -1 - }, - "date": { - "type": "string", - "format": "date", - "description": "Date and time of the fill event", - "example": "2020-11-11T16:37:05.957" - }, - "orderCreationDate": { - "type": "string", - "format": "date", - "description": "Date and time at which the order associated with the fill event was placed", - "example": "2020-11-11T16:37:05.262Z" - }, - "orderType": { - "type": "string", - "description": "Type of the order associated with the fill event", - "example": true, - "enum": [ - "EXCHANGE LIMIT", - "EXCHANGE MARKET" - ] - }, - "orderActive": { - "type": "boolean", - "description": "Whether the order associated with the fill event is still active", - "example": true - }, - "orderCanceled": { - "type": "boolean", - "description": "Whether the order associated with the fill event was canceled", - "example": false - } - } - }, - "Model4": { - "type": "array", - "items": { - "$ref": "#/definitions/Model3" - } - }, - "getFillsResponse": { - "type": "object", - "properties": { - "pagination": { - "$ref": "#/definitions/pagination" - }, - "items": { - "$ref": "#/definitions/Model4" - } - } - }, - "pagination": { - "type": "object", - "properties": { - "totalItems": { - "type": "number", - "description": "Total number of items matching the query", - "example": 1559, - "minimum": 0 - }, - "limit": { - "type": "number", - "description": "Limit applied on returned items", - "example": 5 - }, - "skip": { - "type": "number", - "description": "Skip applied on returned items", - "example": 2 - } - } - }, - "permissionsPayload": { - "type": "object", - "properties": { - "nonce": { - "type": "string", - "description": "This nonce which used to provide the time until which this nonce is valid. It is presented as seconds since epoch.", - "example": "v2-1704114061.000" - }, - "signature": { - "type": "string", - "description": "The signature obtained by signing the nonce with your private ethereum key.", - "example": "0x2b48d53f2e3a696630ebdcd1ff057556bbc9de9c294adfaa5b1f13df91b67b347fdd88c29594c377ba0024dec40cd9808829e7f4447772482f50a7a8e9a903561c" - }, - "key": { - "type": "string", - "description": "The permission key to change the access for", - "example": "balances" - }, - "value": { - "type": "boolean", - "description": "Whether to allow public access to the endpoints driven by provided permission", - "example": true - } - } - }, - "transferPayload": { - "type": "object", - "properties": { - "tx": { - "type": "object", - "description": "StarkWare TransferRequest for main transfer", - "example": { - "type": "TransferRequest", - "amount": "100", - "expirationTimestamp": 516578, - "nonce": 624865484, - "receiverPublicKey": "0x011869c13b32ab9b7ec84e2b31c1de58baaaa6bbb2443a33bbad8df739a6e958", - "receiverVaultId": 1478152318, - "senderPublicKey": "0x0435a5f41a1109379a143f931b6d2062623be35cc688a4f896e8689a1dd6f5c6", - "senderVaultId": 1252694399, - "signature": { - "r": "5d14357fcf8f489218de0855267c6f64bc463135debf62680ad796e63cd6d3b", - "s": "786ab874d91e3a5871134955fcb768914754760a0ada326af67f758f32819cf" - }, - "token": "0xb333e3142fe16b78628f19bb15afddaef437e72d6d7f5c6c20c6801a27fba7" - }, - "properties": { - "type": { - "type": "string", - "enum": [ - "TransferRequest" - ] - }, - "amount": { - "type": "string", - "pattern": "^[0-9]*$" - }, - "expirationTimestamp": { - "type": "integer", - "minimum": 0 - }, - "nonce": { - "type": "integer", - "minimum": 0 - }, - "receiverPublicKey": { - "type": "string", - "pattern": "^0x[a-f0-9]+$" - }, - "receiverVaultId": { - "type": "integer", - "example": 123 - }, - "senderPublicKey": { - "type": "string", - "pattern": "^0x[a-f0-9]+$" - }, - "senderVaultId": { - "type": "integer" - }, - "signature": { - "$ref": "#/definitions/signature" - }, - "token": { - "type": "string", - "pattern": "^0x[a-f0-9]+$" - } - } - }, - "feeTx": { - "type": "object", - "description": "StarkWare TansferRequest for service fee", - "example": { - "type": "TransferRequest", - "amount": "100", - "expirationTimestamp": 516578, - "nonce": 624865484, - "receiverPublicKey": "0x011869c13b32ab9b7ec84e2b31c1de58baaaa6bbb2443a33bbad8df739a6e958", - "receiverVaultId": 1478152318, - "senderPublicKey": "0x0435a5f41a1109379a143f931b6d2062623be35cc688a4f896e8689a1dd6f5c6", - "senderVaultId": 1252694399, - "signature": { - "r": "5d14357fcf8f489218de0855267c6f64bc463135debf62680ad796e63cd6d3b", - "s": "786ab874d91e3a5871134955fcb768914754760a0ada326af67f758f32819cf" - }, - "token": "0xb333e3142fe16b78628f19bb15afddaef437e72d6d7f5c6c20c6801a27fba7" - }, - "properties": { - "type": { - "type": "string", - "enum": [ - "TransferRequest" - ] - }, - "amount": { - "type": "string", - "pattern": "^[0-9]*$" - }, - "expirationTimestamp": { - "type": "integer", - "minimum": 0 - }, - "nonce": { - "type": "integer", - "minimum": 0 - }, - "receiverPublicKey": { - "type": "string", - "pattern": "^0x[a-f0-9]+$" - }, - "receiverVaultId": { - "type": "integer" - }, - "senderPublicKey": { - "type": "string", - "pattern": "^0x[a-f0-9]+$" - }, - "senderVaultId": { - "type": "integer" - }, - "signature": { - "$ref": "#/definitions/signature" - }, - "token": { - "type": "string", - "pattern": "^0x[a-f0-9]+$" - } - } - }, - "starkPublicKey": { - "$ref": "#/definitions/starkPublicKey" - } - } - }, - "signature": { - "type": "object", - "properties": { - "r": { - "type": "string", - "pattern": "^0x[a-f0-9]+$" - }, - "s": { - "type": "string", - "pattern": "^0x[a-f0-9]+$" - } - } - } - } -} diff --git a/src/spec/swagger-v12--submitted.json b/src/spec/swagger-v12--submitted.json new file mode 100644 index 0000000..fe9f84e --- /dev/null +++ b/src/spec/swagger-v12--submitted.json @@ -0,0 +1,7482 @@ +{ + "swagger": "2.0", + "host": "api.stg.deversifi.com", + "basePath": "/", + "schemes": [ + "https" + ], + "info": { + "title": "Deversifi API documentation", + "version": "2.0.0", + "description": "dvf-pub-api" + }, + "tags": [], + "paths":{ + "/v1/trading/allowances":{ + "get":{ + "summary":"This method is used to get the allowance of the user for using DeversiFi features (deposit, withdraw, trade, transfer)", + "operationId":"getV1TradingAllowances", + "parameters":[ + { + "type":"string", + "description":"Base64 of {signature, nonce} JSON representation", + "name":"authorization", + "in":"header", + "x-example":"EcRecover eyJub25jZSI6InYyLTE3MDQxMTQwNjEuMDAwIiwic2lnbmF0dXJlIjoiMHgyYjQ4ZDUzZjJlM2E2OTY2MzBlYmRjZDFmZjA1NzU1NmJiYzlkZTljMjk0YWRmYWE1YjFmMTNkZjkxYjY3YjM0N2ZkZDg4YzI5NTk0YzM3N2JhMDAyNGRlYzQwY2Q5ODA4ODI5ZTdmNDQ0Nzc3MjQ4MmY1MGE3YThlOWE5MDM1NjFjIn0=", + "required":true + } + ], + "tags":[ + "Trading" + ], + "responses":{ + "200":{ + "schema":{ + "$ref":"#/definitions/getAllowanceResponse" + }, + "description":"Successful" + } + } + } + }, + "/v1/trading/balanceHistory":{ + "get":{ + "summary":"Balance history of the authenticated user", + "operationId":"getV1TradingBalancehistory", + "parameters":[ + { + "type":"string", + "description":"Base64 of {signature, nonce} JSON representation", + "name":"authorization", + "in":"header", + "x-example":"EcRecover eyJub25jZSI6InYyLTE3MDQxMTQwNjEuMDAwIiwic2lnbmF0dXJlIjoiMHgyYjQ4ZDUzZjJlM2E2OTY2MzBlYmRjZDFmZjA1NzU1NmJiYzlkZTljMjk0YWRmYWE1YjFmMTNkZjkxYjY3YjM0N2ZkZDg4YzI5NTk0YzM3N2JhMDAyNGRlYzQwY2Q5ODA4ODI5ZTdmNDQ0Nzc3MjQ4MmY1MGE3YThlOWE5MDM1NjFjIn0=", + "required":true + }, + { + "type":"string", + "description":"This nonce which used to provide the time until which this nonce is valid. It is presented as seconds since epoch.", + "name":"nonce", + "in":"query", + "x-example":"v2-1704114061.000", + "required":false + }, + { + "type":"string", + "description":"The signature obtained by signing the nonce with your private ethereum key.", + "name":"signature", + "in":"query", + "x-example":"0x2b48d53f2e3a696630ebdcd1ff057556bbc9de9c294adfaa5b1f13df91b67b347fdd88c29594c377ba0024dec40cd9808829e7f4447772482f50a7a8e9a903561c", + "required":false + }, + { + "type":"string", + "description":"duration for the history to fetch", + "enum":[ + "1d", + "1m", + "1w", + "1y" + ], + "x-convert":{ + "case":"lower" + }, + "name":"duration", + "in":"query", + "x-example":"1d", + "required":true + } + ], + "tags":[ + "Trading" + ], + "responses":{ + "200":{ + "schema":{ + "$ref":"#/definitions/balanceHistorySchema" + }, + "description":"Successful" + } + } + } + }, + "/v1/trading/collateralBalances":{ + "get":{ + "summary":"Returns information about collateral balances (internal use)", + "operationId":"getV1TradingCollateralbalances", + "parameters":[ + { + "type":"string", + "name":"token", + "in":"query", + "required":false + } + ], + "tags":[ + "Internal" + ], + "responses":{ + "200":{ + "schema":{ + "$ref":"#/definitions/collateralBalancesSchema" + }, + "description":"Successful" + } + } + } + }, + "/v1/trading/depositsAndWithdrawals":{ + "get":{ + "summary":"This method is used to get the history of deposits and withdrawals for the authenticated user", + "operationId":"getV1TradingDepositsandwithdrawals", + "parameters":[ + { + "type":"string", + "description":"Base64 of {signature, nonce} JSON representation", + "name":"authorization", + "in":"header", + "x-example":"EcRecover eyJub25jZSI6InYyLTE3MDQxMTQwNjEuMDAwIiwic2lnbmF0dXJlIjoiMHgyYjQ4ZDUzZjJlM2E2OTY2MzBlYmRjZDFmZjA1NzU1NmJiYzlkZTljMjk0YWRmYWE1YjFmMTNkZjkxYjY3YjM0N2ZkZDg4YzI5NTk0YzM3N2JhMDAyNGRlYzQwY2Q5ODA4ODI5ZTdmNDQ0Nzc3MjQ4MmY1MGE3YThlOWE5MDM1NjFjIn0=", + "required":true + }, + { + "type":"string", + "x-convert":{ + "case":"upper" + }, + "name":"token", + "in":"query", + "x-example":"ETH" + }, + { + "type":"string", + "format":"date", + "name":"startDate", + "in":"query", + "x-example":"2020-01-01 13:45" + }, + { + "type":"string", + "format":"date", + "name":"endDate", + "in":"query", + "x-example":"2025-12-31 23:45" + }, + { + "type":"string", + "default":"date", + "enum":[ + "date" + ], + "name":"sortBy", + "in":"query" + }, + { + "type":"string", + "default":"DESC", + "enum":[ + "ASC", + "DESC" + ], + "name":"sortDirection", + "in":"query" + }, + { + "type":"integer", + "default":0, + "minimum":0, + "name":"skip", + "in":"query" + }, + { + "type":"integer", + "default":20, + "minimum":1, + "maximum":100, + "name":"limit", + "in":"query" + } + ], + "tags":[ + "Trading" + ], + "responses":{ + "200":{ + "schema":{ + "$ref":"#/definitions/getDepositsAndWithdrawalsResponse", + "x-alternatives":[ + { + "$ref":"#/x-alt-definitions/getDepositsAndWithdrawalsResponse" + }, + { + "type":"string", + "description":"Response in CSV format", + "example":"id,type,token,amount,transactionHash,date,sourceOrRecipient8oXSt1ry5EZ,Deposit,ETH,0.1,0x43154dc90de6c578d14fbe1ddae352e3a5fdc42d5944b122ac7c6c41f360d76a,1990-04-14T00:00:00.000Z,0x08152c1265dbc218ccc8ab5c574e6bd52279b3b77kyGeby7RR8,FastWithdrawal,USDT,100,0xe2d59c0e5fec11b23fb159483551b28ad80907937908fa5df26ba9b2045d4397,1990-04-14T00:02:00.000Z,0xeb3ea3ea9239577951523cafa9fd3072bc88e50aDDi37hQZSHg,Withdrawal,ETH,0.05,0x2c892f7a0326a380f027b8ef4a1a15747083ba2471313c5a30a8510d3132a18e,1990-04-14T00:04:00.000Z,0x2d5752b42440139a130f453e0c646e6e656dded4" + } + ] + }, + "description":"Successful" + } + } + } + }, + "/v1/trading/entityAccounts":{ + "get":{ + "summary":"This method is used to get the entity account information for user address (KYC)", + "operationId":"getV1TradingEntityaccounts", + "parameters":[ + { + "type":"string", + "description":"Base64 of {signature, nonce} JSON representation", + "name":"authorization", + "in":"header", + "x-example":"EcRecover eyJub25jZSI6InYyLTE3MDQxMTQwNjEuMDAwIiwic2lnbmF0dXJlIjoiMHgyYjQ4ZDUzZjJlM2E2OTY2MzBlYmRjZDFmZjA1NzU1NmJiYzlkZTljMjk0YWRmYWE1YjFmMTNkZjkxYjY3YjM0N2ZkZDg4YzI5NTk0YzM3N2JhMDAyNGRlYzQwY2Q5ODA4ODI5ZTdmNDQ0Nzc3MjQ4MmY1MGE3YThlOWE5MDM1NjFjIn0=", + "required":true + } + ], + "tags":[ + "Trading" + ], + "responses":{ + "200":{ + "schema":{ + "$ref":"#/definitions/Model3" + }, + "description":"Successful" + } + } + } + }, + "/v1/trading/fills":{ + "get":{ + "summary":"This method is used to get the history of fills (executed trades) for the authenticated user", + "operationId":"getV1TradingFills", + "parameters":[ + { + "type":"string", + "description":"Base64 of {signature, nonce} JSON representation", + "name":"authorization", + "in":"header", + "x-example":"EcRecover eyJub25jZSI6InYyLTE3MDQxMTQwNjEuMDAwIiwic2lnbmF0dXJlIjoiMHgyYjQ4ZDUzZjJlM2E2OTY2MzBlYmRjZDFmZjA1NzU1NmJiYzlkZTljMjk0YWRmYWE1YjFmMTNkZjkxYjY3YjM0N2ZkZDg4YzI5NTk0YzM3N2JhMDAyNGRlYzQwY2Q5ODA4ODI5ZTdmNDQ0Nzc3MjQ4MmY1MGE3YThlOWE5MDM1NjFjIn0=", + "required":true + }, + { + "type":"string", + "x-convert":{ + "case":"upper" + }, + "name":"symbol", + "in":"query" + }, + { + "type":"string", + "format":"date", + "name":"startDate", + "in":"query", + "x-example":"2020-01-01 13:45" + }, + { + "type":"string", + "format":"date", + "name":"endDate", + "in":"query", + "x-example":"2025-12-31 23:45" + }, + { + "type":"string", + "default":"date", + "enum":[ + "date" + ], + "name":"sortBy", + "in":"query" + }, + { + "type":"string", + "default":"DESC", + "enum":[ + "ASC", + "DESC" + ], + "name":"sortDirection", + "in":"query" + }, + { + "type":"integer", + "default":0, + "minimum":0, + "name":"skip", + "in":"query" + }, + { + "type":"integer", + "default":20, + "minimum":1, + "maximum":100, + "name":"limit", + "in":"query" + } + ], + "tags":[ + "Trading" + ], + "responses":{ + "200":{ + "schema":{ + "$ref":"#/definitions/getFillsResponse", + "x-alternatives":[ + { + "$ref":"#/x-alt-definitions/getFillsResponse" + }, + { + "type":"string", + "description":"Response in CSV format", + "example":"fillId,orderId,symbol,fillAmount,orderAmount,price,date,orderCreationDate,orderType,orderActive,orderCanceled606f4123baed6ee2d25f1f1f,79qiFBVDfbz,ZRX:USDT,-0.125622,-1,209.9,1990-04-14T00:00:00.000Z,2020-11-11T16:37:05.262Z,EXCHANGE LIMIT,false,false606f4123baed6ee2d25f1f32,7vVPHzETRQY,ZRX:USDT,-0.125622,-1,209.9,1990-04-14T00:02:00.000Z,2020-11-11T16:37:05.262Z,EXCHANGE LIMIT,false,false606f4123baed6ee2d25f1f2d,GuKPHMafYU1,ZRX:USDT,-0.125622,-1,209.9,1990-04-14T00:04:00.000Z,2020-11-11T16:37:05.262Z,EXCHANGE LIMIT,false,false606f4123baed6ee2d25f1f25,6h1i8x5apLe,ZRX:USDT,-0.125622,-1,209.9,1990-04-14T00:06:00.000Z,2020-11-11T16:37:05.262Z,EXCHANGE LIMIT,false,false606f4123baed6ee2d25f1f27,MwEnHW1MF5y,ZRX:USDT,-0.125622,-1,209.9,1990-04-14T00:08:00.000Z,2020-11-11T16:37:05.262Z,EXCHANGE LIMIT,false,false" + } + ] + }, + "description":"Successful" + } + } + } + }, + "/v1/trading/transfers":{ + "get":{ + "summary":"This method is used to get the history of transfers for the authenticated user", + "operationId":"getV1TradingTransfers", + "parameters":[ + { + "type":"string", + "description":"Base64 of {signature, nonce} JSON representation", + "name":"authorization", + "in":"header", + "x-example":"EcRecover eyJub25jZSI6InYyLTE3MDQxMTQwNjEuMDAwIiwic2lnbmF0dXJlIjoiMHgyYjQ4ZDUzZjJlM2E2OTY2MzBlYmRjZDFmZjA1NzU1NmJiYzlkZTljMjk0YWRmYWE1YjFmMTNkZjkxYjY3YjM0N2ZkZDg4YzI5NTk0YzM3N2JhMDAyNGRlYzQwY2Q5ODA4ODI5ZTdmNDQ0Nzc3MjQ4MmY1MGE3YThlOWE5MDM1NjFjIn0=", + "required":true + }, + { + "type":"string", + "x-convert":{ + "case":"upper" + }, + "name":"token", + "in":"query" + }, + { + "type":"string", + "format":"date", + "name":"startDate", + "in":"query", + "x-example":"2020-01-01 13:45" + }, + { + "type":"string", + "format":"date", + "name":"endDate", + "in":"query", + "x-example":"2025-12-31 23:45" + }, + { + "type":"string", + "default":"date", + "enum":[ + "date" + ], + "name":"sortBy", + "in":"query" + }, + { + "type":"string", + "default":"DESC", + "enum":[ + "ASC", + "DESC" + ], + "name":"sortDirection", + "in":"query" + }, + { + "type":"integer", + "default":0, + "minimum":0, + "name":"skip", + "in":"query" + }, + { + "type":"integer", + "default":20, + "minimum":1, + "maximum":100, + "name":"limit", + "in":"query" + } + ], + "tags":[ + "Trading" + ], + "responses":{ + "200":{ + "schema":{ + "$ref":"#/definitions/getTransfersResponse", + "x-alternatives":[ + { + "$ref":"#/x-alt-definitions/getTransfersResponse" + }, + { + "type":"string", + "description":"List of past transfers in CSV format", + "example":"id,token,amount,feeAmount,source,recipient,memo,date9oWC74UdzWJ,ZRX,0.05,0.001,0x08152c1265dBc218ccc8Ab5C574e6bD52279b3B7,0xeb3ea3ea9239577951523cafa9fd3072bc88e50a,reference,1990-04-14T00:00:00.000ZJtCAHChHhmU,ZRX,0.05,0.001,0x08152c1265dBc218ccc8Ab5C574e6bD52279b3B7,0xeb3ea3ea9239577951523cafa9fd3072bc88e50a,,1990-04-14T00:02:00.000ZA1vFQzqYMXu,ZRX,0.05,0.001,0x08152c1265dBc218ccc8Ab5C574e6bD52279b3B7,0xeb3ea3ea9239577951523cafa9fd3072bc88e50a,,1990-04-14T00:04:00.000Z8xFu925f72r,ZRX,0.05,0.001,0x08152c1265dBc218ccc8Ab5C574e6bD52279b3B7,0xeb3ea3ea9239577951523cafa9fd3072bc88e50a,,1990-04-14T00:06:00.000Z" + } + ] + }, + "description":"Successful" + } + } + } + }, + "/v1/trading/amm/fundingOrderData":{ + "get":{ + "summary":"Get data for AmmFundingOrder, for given token and amount.", + "operationId":"getV1TradingAmmFundingorderdata", + "description":"In order to get data for a deposit order, provide one of the tokens and the amount you want to deposit. The response will contain information on how much of the other pool token you need to deposit and how many LP tokens you will get in return.\nIn order to get data for a withdrawal, set token to pools LP token and provide the amount of it which you wish to exchange for pool tokens. The response will conatin information about how much of the pool tokens you will get in return.\nData returned by this end point can be used to actually request a deposit/withdrawal via POST app/fundingOrders.", + "parameters":[ + { + "type":"string", + "description":"Base64 of {signature, nonce} JSON representation", + "name":"authorization", + "in":"header", + "x-example":"EcRecover eyJub25jZSI6InYyLTE3MDQxMTQwNjEuMDAwIiwic2lnbmF0dXJlIjoiMHgyYjQ4ZDUzZjJlM2E2OTY2MzBlYmRjZDFmZjA1NzU1NmJiYzlkZTljMjk0YWRmYWE1YjFmMTNkZjkxYjY3YjM0N2ZkZDg4YzI5NTk0YzM3N2JhMDAyNGRlYzQwY2Q5ODA4ODI5ZTdmNDQ0Nzc3MjQ4MmY1MGE3YThlOWE5MDM1NjFjIn0=", + "required":true + }, + { + "type":"string", + "name":"pool", + "in":"query", + "x-example":"ETH:USDT" + }, + { + "type":"string", + "name":"token", + "in":"query", + "x-example":"ETH" + }, + { + "type":"string", + "name":"amount", + "in":"query", + "x-example":1 + } + ], + "tags":[ + "Trading", + "AMM" + ], + "responses":{ + "200":{ + "schema":{ + "$ref":"#/definitions/AmmFundingOrderDataGetResponse" + }, + "description":"Successful" + } + } + } + }, + "/v1/trading/r/30DaysVolume":{ + "get":{ + "summary":"Request information regarding the trading volume of a specific address for the last 30 days. The request returns the overall trading volume details for all tokens in USD as well as the trading volume per token. Results are cached for 60 minutes.", + "operationId":"getV1TradingR30daysvolume", + "parameters":[ + { + "type":"string", + "description":"This nonce which used to provide the time until which this nonce is valid. It is presented as seconds since epoch.", + "name":"nonce", + "in":"query", + "x-example":"v2-1704114061.000", + "required":false + }, + { + "type":"string", + "description":"The signature obtained by signing the nonce with your private ethereum key.", + "name":"signature", + "in":"query", + "x-example":"0x2b48d53f2e3a696630ebdcd1ff057556bbc9de9c294adfaa5b1f13df91b67b347fdd88c29594c377ba0024dec40cd9808829e7f4447772482f50a7a8e9a903561c", + "required":false + } + ], + "tags":[ + "Market" + ], + "responses":{ + "200":{ + "schema":{ + "$ref":"#/definitions/30DaysVolumeResponse" + }, + "description":"Successful" + } + } + } + }, + "/v1/trading/r/USDRanking":{ + "get":{ + "summary":"This returns a user ranking by overall trading volume quoted in USD. If the parameters startDate and endDate are provided, the ranking includes only trading volume within that window of time.", + "operationId":"getV1TradingRUsdranking", + "parameters":[ + { + "type":"number", + "description":"The start date and time (Unix timestamp in milliseconds) for which the trade volumes are requested. If startDate and endDate are not provided, it returns the volume ranking if all time.", + "name":"startDate", + "in":"query", + "x-example":1577836800000 + }, + { + "type":"number", + "description":"The end date and time (Unix timestamp in milliseconds) for which events are requested.If startDate and endDate are not provided, it returns the volume ranking if all time.", + "name":"endDate", + "in":"query", + "x-example":1747384800000 + } + ], + "tags":[ + "Market" + ], + "responses":{ + "default":{ + "schema":{ + "$ref":"#/definitions/USDRankingResponse" + }, + "description":"Ranked output of all trading volumes for all the tokens." + } + } + } + }, + "/v1/trading/r/User24HoursVolume":{ + "get":{ + "summary":"Request information regarding the trading volume of a specific address for the last 24 hours. The request returns the overall trading volume details for all tokens in USD as well as the trading volume per token. Results are cached for 2 minutes.", + "operationId":"getV1TradingRUser24hoursvolume", + "parameters":[ + { + "type":"string", + "description":"This nonce which used to provide the time until which this nonce is valid. It is presented as seconds since epoch.", + "name":"nonce", + "in":"query", + "x-example":"v2-1704114061.000", + "required":false + }, + { + "type":"string", + "description":"The signature obtained by signing the nonce with your private ethereum key.", + "name":"signature", + "in":"query", + "x-example":"0x2b48d53f2e3a696630ebdcd1ff057556bbc9de9c294adfaa5b1f13df91b67b347fdd88c29594c377ba0024dec40cd9808829e7f4447772482f50a7a8e9a903561c", + "required":false + } + ], + "tags":[ + "Market" + ], + "responses":{ + "200":{ + "schema":{ + "$ref":"#/definitions/User24HoursVolumeResponse" + }, + "description":"Successful" + }, + "default":{ + "schema":{ + "$ref":"#/definitions/Model9" + }, + "description":"Returns the overall trading volume details of a specific address for all tokens in USD as well as the trading volume per trading pair fot the last 24 hours." + } + } + } + }, + "/v1/trading/r/airdropEligibility":{ + "get":{ + "summary":"Returns the eligible DVF airdrop amount for the given address", + "operationId":"getV1TradingRAirdropeligibility", + "parameters":[ + { + "type":"string", + "description":"Ethereum address", + "name":"ethAddress", + "in":"query", + "x-example":"0x3f2b822E9A8312C6DafBF9686a5e335Af0E4D33B" + }, + { + "type":"string", + "description":"token for the airdrop", + "name":"token", + "in":"query", + "x-example":"DVF" + } + ], + "tags":[ + "Trading" + ], + "responses":{ + "200":{ + "schema":{ + "$ref":"#/definitions/Model11" + }, + "description":"Successful" + } + } + } + }, + "/v1/trading/r/beehiveStats":{ + "get":{ + "summary":"Request information regarding beehive liquidity and apy.", + "operationId":"getV1TradingRBeehivestats", + "tags":[ + "Market" + ], + "responses":{ + "200":{ + "schema":{ + "$ref":"#/definitions/beehiveStatsResponse" + }, + "description":"Successful" + }, + "default":{ + "schema":{ + "$ref":"#/definitions/Model12" + }, + "description":"Returns behive stats" + } + } + } + }, + "/v1/trading/r/estimatedNextBatchTime":{ + "get":{ + "summary":"Returns a countdown until the expected next batch proof is submitted onto the blockchain and the average time of previous batches. The next batch will include all pending withdrawals.", + "operationId":"getV1TradingREstimatednextbatchtime", + "tags":[ + "Market" + ], + "responses":{ + "default":{ + "schema":{ + "$ref":"#/definitions/estimatedNextBatchResponse" + }, + "description":"Returns the amount of time remaining until the batch is posted to Ethereum." + } + } + } + }, + "/v1/trading/r/fastWithdrawalFee":{ + "get":{ + "summary":"Returns a range of gas price options.", + "operationId":"getV1TradingRFastwithdrawalfee", + "parameters":[ + { + "type":"string", + "description":"token to be withdrawn", + "name":"token", + "in":"query", + "x-example":"BTC" + } + ], + "tags":[ + "Trading" + ], + "responses":{ + "200":{ + "schema":{ + "$ref":"#/definitions/Model13" + }, + "description":"Successful" + } + } + } + }, + "/v1/trading/r/fastWithdrawalMaxAmount":{ + "get":{ + "summary":"Returns max amount available for fast withdrawal (before fees).", + "operationId":"getV1TradingRFastwithdrawalmaxamount", + "parameters":[ + { + "type":"string", + "description":"token to be withdrawn", + "name":"token", + "in":"query", + "x-example":"BTC" + } + ], + "tags":[ + "Trading" + ], + "responses":{ + "200":{ + "schema":{ + "$ref":"#/definitions/Model14" + }, + "description":"Successful" + } + } + } + }, + "/v1/trading/r/feeRate":{ + "get":{ + "summary":"Return current fee rate for a given address. This rate is dependent on the trading volume of the user.", + "operationId":"getV1TradingRFeerate", + "parameters":[ + { + "type":"string", + "description":"This nonce which used to provide the time until which this nonce is valid. It is presented as seconds since epoch.", + "name":"nonce", + "in":"query", + "x-example":"v2-1704114061.000", + "required":false + }, + { + "type":"string", + "description":"The signature obtained by signing the nonce with your private ethereum key.", + "name":"signature", + "in":"query", + "x-example":"0x2b48d53f2e3a696630ebdcd1ff057556bbc9de9c294adfaa5b1f13df91b67b347fdd88c29594c377ba0024dec40cd9808829e7f4447772482f50a7a8e9a903561c", + "required":false + }, + { + "type":"string", + "description":"Symbol for which the fee rate will be returned", + "name":"symbol", + "in":"query", + "x-example":"ETH:USDT" + }, + { + "type":"string", + "description":"Feature for which the fee rate will be returned", + "name":"feature", + "in":"query", + "x-example":"TRADING" + } + ], + "tags":[ + "Trading" + ], + "responses":{ + "200":{ + "schema":{ + "$ref":"#/definitions/getFeeRateResponse" + }, + "description":"Successful" + } + } + } + }, + "/v1/trading/r/gasSavings":{ + "get":{ + "summary":"Returns gas savings metrics", + "operationId":"getV1TradingRGassavings", + "tags":[ + "Trading" + ], + "responses":{ + "200":{ + "schema":{ + "$ref":"#/definitions/gasSavingsResponse" + }, + "description":"Successful" + } + } + } + }, + "/v1/trading/r/getBalanceUsd":{ + "get":{ + "summary":"This is used to retrieve the sum of all user balances converted to USD.", + "operationId":"getV1TradingRGetbalanceusd", + "parameters":[ + { + "type":"string", + "description":"This nonce which used to provide the time until which this nonce is valid. It is presented as seconds since epoch.", + "name":"nonce", + "in":"query", + "x-example":"v2-1704114061.000", + "required":false + }, + { + "type":"string", + "description":"The signature obtained by signing the nonce with your private ethereum key.", + "name":"signature", + "in":"query", + "x-example":"0x2b48d53f2e3a696630ebdcd1ff057556bbc9de9c294adfaa5b1f13df91b67b347fdd88c29594c377ba0024dec40cd9808829e7f4447772482f50a7a8e9a903561c", + "required":false + } + ], + "tags":[ + "Trading" + ], + "responses":{ + "default":{ + "schema":{ + "$ref":"#/definitions/getBalanceUsdResponse" + }, + "description":"Returns the sum of all user balances converted to USD." + } + } + } + }, + "/v1/trading/r/getConf":{ + "get":{ + "summary":"Returns the DeversiFi application configuration details.", + "operationId":"getV1TradingRGetconf", + "tags":[ + "Trading" + ], + "responses":{ + "200":{ + "schema":{ + "$ref":"#/definitions/getConfResponse" + }, + "description":"Successful" + } + } + }, + "post":{ + "summary":"Returns the DeversiFi application configuration details.", + "operationId":"postV1TradingRGetconf", + "tags":[ + "Trading" + ], + "responses":{ + "200":{ + "schema":{ + "$ref":"#/definitions/getConfResponse" + }, + "description":"Successful" + } + } + } + }, + "/v1/trading/r/getGasPrice":{ + "get":{ + "summary":"Returns a range of gas price options.", + "operationId":"getV1TradingRGetgasprice", + "tags":[ + "Trading" + ], + "responses":{ + "200":{ + "description":"Range of gas prices for on chain confirmation speed", + "schema":{ + "$ref":"#/definitions/getGasPriceResponse" + } + } + } + }, + "post":{ + "summary":"Returns a range of gas price options.", + "operationId":"postV1TradingRGetgasprice", + "tags":[ + "Trading" + ], + "responses":{ + "200":{ + "description":"Range of gas prices for on chain confirmation speed", + "schema":{ + "$ref":"#/definitions/getGasPriceResponse" + } + } + }, + "deprecated":true + } + }, + "/v1/trading/r/getPublicPermissions":{ + "get":{ + "summary":"A descriptor object for all user permissions available", + "operationId":"getV1TradingRGetpublicpermissions", + "tags":[ + "public" + ], + "responses":{ + "200":{ + "schema":{ + "$ref":"#/definitions/Model15" + }, + "description":"Successful" + } + } + } + }, + "/v1/trading/r/getTokenCirculatingSupply":{ + "get":{ + "summary":"Returns token liquidity left", + "operationId":"getV1TradingRGettokencirculatingsupply", + "parameters":[ + { + "type":"string", + "description":"Token for which to get the circulating supply", + "name":"token", + "in":"query", + "x-example":"DVF" + } + ], + "tags":[ + "Trading" + ], + "responses":{ + "200":{ + "description":"Circulating supply", + "schema":{ + "type":"number", + "description":"Circulating supply", + "example":10 + } + } + } + } + }, + "/v1/trading/r/getTokenHolders":{ + "get":{ + "summary":"Returns token holders count for a given token", + "operationId":"getV1TradingRGettokenholders", + "parameters":[ + { + "type":"string", + "description":"Token for which to get the holders count", + "name":"token", + "in":"query", + "x-example":"DVF" + } + ], + "tags":[ + "Trading" + ], + "responses":{ + "200":{ + "schema":{ + "type":"number", + "example":452083 + }, + "description":"Successful" + } + } + } + }, + "/v1/trading/r/getTokenLiquidityLeft":{ + "get":{ + "summary":"Returns token liquidity left", + "operationId":"getV1TradingRGettokenliquidityleft", + "parameters":[ + { + "type":"string", + "description":"Token for which to get the liquidity left", + "name":"token", + "in":"query", + "x-example":"DVF" + } + ], + "tags":[ + "Trading" + ], + "responses":{ + "200":{ + "schema":{ + "$ref":"#/definitions/Model16" + }, + "description":"Successful" + } + } + } + }, + "/v1/trading/r/getTokenSaleStartEnd":{ + "get":{ + "summary":"Returns token sale start and end time", + "operationId":"getV1TradingRGettokensalestartend", + "parameters":[ + { + "type":"string", + "description":"Token for which to get the sale start and end time", + "name":"token", + "in":"query", + "x-example":"DVF" + } + ], + "tags":[ + "Trading" + ], + "responses":{ + "200":{ + "schema":{ + "$ref":"#/definitions/tokenSaleStartEndResponse" + }, + "description":"Successful" + } + } + } + }, + "/v1/trading/r/last24HoursVolume":{ + "get":{ + "summary":"Request information regarding the trading volume for the last 24 hours. The request returns the overall trading volume details in USD as well as the trading volume per token in USD and the native token.", + "operationId":"getV1TradingRLast24hoursvolume", + "tags":[ + "Market" + ], + "responses":{ + "default":{ + "schema":{ + "$ref":"#/definitions/last24HoursVolumeResponse" + }, + "description":"Returns the trading volume of the last 24 hours." + } + } + } + }, + "/v1/trading/r/swapVolume":{ + "get":{ + "summary":"Get swap functionality volume information for a specific token related pairs", + "operationId":"getV1TradingRSwapvolume", + "parameters":[ + { + "type":"string", + "description":"Token whose related pair volumes will be calculated", + "name":"token", + "in":"query", + "x-example":"ETH", + "required":true + }, + { + "type":"number", + "description":"Date of the volume", + "name":"date", + "in":"query", + "x-example":1577836800000, + "required":true + } + ], + "tags":[ + "Market" + ], + "responses":{ + "200":{ + "schema":{ + "$ref":"#/definitions/Model17" + }, + "description":"Successful" + } + } + } + }, + "/v1/trading/r/tokenRanking":{ + "get":{ + "summary":"This returns a user ranking by trading volume for a chosen token. If the parameters startDate and endDate are provided, the ranking includes only trading volume within that window of time. All volumes are quoted in ETH.", + "operationId":"getV1TradingRTokenranking", + "parameters":[ + { + "type":"string", + "description":"The currency relating to the requested trading volume information.", + "name":"currency", + "in":"query", + "x-example":"ETH", + "required":true + }, + { + "type":"number", + "description":"The start date and time (Unix timestamp in milliseconds) for which the trade volumes are requested. If startDate and endDate are not provided, it returns the volume ranking if all time.", + "name":"startDate", + "in":"query", + "x-example":1527836800000 + }, + { + "type":"number", + "description":"The end date and time (Unix timestamp in milliseconds) for which the trade volumes are requested. If startDate and endDate are not provided, it returns the volume ranking if all time.", + "name":"endDate", + "in":"query", + "x-example":1747384800000 + } + ], + "tags":[ + "Market" + ], + "responses":{ + "default":{ + "schema":{ + "$ref":"#/definitions/tokenRankingResponse" + }, + "description":"Returns a ranked output of all the trading volumes for a given crypto currency. All the Volumes are quoted in ETH." + } + } + } + }, + "/v1/trading/r/totalValueLocked":{ + "get":{ + "summary":"Returns total value locked by day within a given timerange", + "operationId":"getV1TradingRTotalvaluelocked", + "parameters":[ + { + "type":"string", + "format":"date", + "description":"Date from which to get TVL data", + "name":"startDate", + "in":"query", + "x-example":"2020-04-21" + }, + { + "type":"string", + "format":"date", + "description":"Date until which to get TVL data", + "name":"endDate", + "in":"query", + "x-example":"2020-05-21" + }, + { + "type":"string", + "description":"Optional, Token for which to get TVL data", + "name":"token", + "in":"query", + "required":false + } + ], + "tags":[ + "Trading" + ], + "responses":{ + "200":{ + "schema":{ + "$ref":"#/definitions/totalValueLockedResponse" + }, + "description":"Successful" + } + } + } + }, + "/v1/trading/r/tradeCountSince":{ + "get":{ + "summary":"Returns deversifi finished order count from specified date", + "operationId":"getV1TradingRTradecountsince", + "parameters":[ + { + "type":"string", + "format":"date", + "description":"Date since when orders are counted.", + "name":"startDate", + "in":"query", + "x-example":"2020-07-21T13:19:08.241Z", + "required":true + } + ], + "tags":[ + "Market" + ], + "responses":{ + "200":{ + "schema":{ + "$ref":"#/definitions/Model18" + }, + "description":"Successful" + } + } + } + }, + "/v1/trading/r/tradeHistory":{ + "get":{ + "summary":"This method is used to retrieve a list of all past executed trades for a user. This includes the different trades that have been settled for each fully executed or partially executed order.", + "operationId":"getV1TradingRTradehistory", + "parameters":[ + { + "type":"string", + "description":"This nonce which used to provide the time until which this nonce is valid. It is presented as seconds since epoch.", + "name":"nonce", + "in":"query", + "x-example":"v2-1704114061.000", + "required":false + }, + { + "type":"string", + "description":"The signature obtained by signing the nonce with your private ethereum key.", + "name":"signature", + "in":"query", + "x-example":"0x2b48d53f2e3a696630ebdcd1ff057556bbc9de9c294adfaa5b1f13df91b67b347fdd88c29594c377ba0024dec40cd9808829e7f4447772482f50a7a8e9a903561c", + "required":false + } + ], + "produces":[ + "text/csv" + ], + "tags":[ + "Trading" + ], + "responses":{ + "200":{ + "description":"Returns executed trades as a CSV file", + "schema":{ + "type":"string", + "example":"exchange_name,account_name,trade_date,buy_asset,sell_asset,buy_amount,sell_amount,exchange_order_id,fee_asset,fee_amount,transaction_type,clarification\nDeversiFi,0x08152c1265dbc218ccc8ab5c574e6bd52279b3b7,2021-01-21T16:08:39,USDT,ETH,40.918,1,NHX5FcipBCZ,USDT,0.082,trade,\nDeversiFi,0x08152c1265dbc218ccc8ab5c574e6bd52279b3b7,2021-01-20T18:30:54,USDT,ETH,41.916,1,2f7tKwGqR8v,USDT,0.084,trade,\nDeversiFi,0x08152c1265dbc218ccc8ab5c574e6bd52279b3b7,2021-01-19T10:16:31,USDT,ETH,38.6226,0.9,KRSbMNKyDwu,USDT,0.0774,trade," + } + } + } + } + }, + "/v1/trading/r/transferVolume":{ + "get":{ + "summary":"Get transfer functionality volume information for a specific token", + "operationId":"getV1TradingRTransfervolume", + "parameters":[ + { + "type":"string", + "description":"Token whose transfer volumes will be calculated", + "name":"token", + "in":"query", + "x-example":"ETH", + "required":true + }, + { + "type":"number", + "description":"Date of the volume", + "name":"date", + "in":"query", + "x-example":1577836800000, + "required":true + } + ], + "tags":[ + "Market" + ], + "responses":{ + "200":{ + "schema":{ + "$ref":"#/definitions/Model19" + }, + "description":"Successful" + } + } + } + }, + "/v1/trading/r/vaultIdAndStarkKey":{ + "get":{ + "summary":"Gets the stark public key and vault id for the user registered with and token", + "operationId":"getV1TradingRVaultidandstarkkey", + "parameters":[ + { + "type":"string", + "description":"This nonce which used to provide the time until which this nonce is valid. It is presented as seconds since epoch.", + "name":"nonce", + "in":"query", + "x-example":"v2-1704114061.000", + "required":false + }, + { + "type":"string", + "description":"The signature obtained by signing the nonce with your private ethereum key.", + "name":"signature", + "in":"query", + "x-example":"0x2b48d53f2e3a696630ebdcd1ff057556bbc9de9c294adfaa5b1f13df91b67b347fdd88c29594c377ba0024dec40cd9808829e7f4447772482f50a7a8e9a903561c", + "required":false + }, + { + "type":"string", + "description":"The ETH address of a registered user", + "name":"targetEthAddress", + "in":"query", + "x-example":"0x08152c1265dbc218ccc8ab5c574e6bd52279b3b7", + "required":true + }, + { + "type":"string", + "description":"The token for which we want retrieve the vault ID", + "name":"token", + "in":"query", + "x-example":"ETH", + "required":true + } + ], + "tags":[ + "Trading" + ], + "responses":{ + "200":{ + "schema":{ + "$ref":"#/definitions/vaultIdAndStarkKeyResponse" + }, + "description":"Successful" + }, + "404":{ + "description":"When there is no user registered with given `targetEthAddress`" + } + } + } + }, + "/v1/trading/r/votingPower":{ + "get":{ + "summary":"Returns total xDVF balance of exchange users and calculated voting power based on input amount", + "operationId":"getV1TradingRVotingpower", + "parameters":[ + { + "type":"string", + "description":"Amount of xDVF ", + "name":"amount", + "in":"query", + "x-example":"55" + } + ], + "tags":[ + "Trading" + ], + "responses":{ + "200":{ + "schema":{ + "$ref":"#/definitions/votingPowerResponse" + }, + "description":"Successful" + } + } + } + }, + "/v1/trading/registrations/{targetEthAddress}":{ + "get":{ + "summary":"This method is used to retrieve the registration statuses of the given eth address", + "operationId":"getV1TradingRegistrationsTargetethaddress", + "parameters":[ + { + "type":"string", + "description":"The ETH address of a potential user", + "name":"targetEthAddress", + "in":"path", + "x-example":"0x3f2b822E9A8312C6DafBF9686a5e335Af0E4D33B", + "required":true + } + ], + "tags":[ + "Trading" + ], + "responses":{ + "200":{ + "schema":{ + "$ref":"#/definitions/Model20" + }, + "description":"Successful" + } + } + } + }, + "/v1/trading/r/publicTradeHistory/{user}":{ + "get":{ + "summary":"This method is used to retrieve a list of all past executed trades for a user. This includes the different trades that have been settled for each fully executed or partially executed order.", + "operationId":"getV1TradingRPublictradehistoryUser", + "parameters":[ + { + "type":"string", + "description":"The ETH address of a potential user", + "name":"user", + "in":"path", + "x-example":"0x3f2b822E9A8312C6DafBF9686a5e335Af0E4D33B", + "required":true + } + ], + "tags":[ + "Trading", + "public" + ], + "responses":{ + "200":{ + "schema":{ + "$ref":"#/definitions/Model23" + }, + "description":"Successful" + }, + "401":{ + "description":"User has not authorized the use of this endpoint for their address" + } + } + } + }, + "/v1/trading/r/trades/{symbol}":{ + "get":{ + "summary":"Request information regarding all recently completed trades for a given market pair.", + "operationId":"getV1TradingRTradesSymbol", + "parameters":[ + { + "type":"string", + "description":"The market trading pair in deversifi format i.e BASE:QUOTE", + "name":"symbol", + "in":"path", + "x-example":"ETH:USDT", + "required":true + } + ], + "tags":[ + "Market" + ], + "responses":{ + "default":{ + "schema":{ + "$ref":"#/definitions/tradesResponse" + }, + "description":"The trades endpoint returns data on all recently completed trades for a given market pair for the past 24 hours" + } + } + } + }, + "/v1/trading/r/24HoursVolume/{year}/{month}/{day}":{ + "get":{ + "summary":"Request information regarding the trading volume for a specific date. The request returns the overall trading volume details for all tokens in USD as well as the trading volume per token.", + "operationId":"getV1TradingR24hoursvolumeYearMonthDay", + "parameters":[ + { + "type":"number", + "description":"The year of the specific trading volume request date - in this case 2020.", + "name":"year", + "in":"path", + "x-example":"2020", + "required":true + }, + { + "type":"number", + "description":"The month of the specific trading volume request date - in this case 01 (January).", + "name":"month", + "in":"path", + "x-example":"01", + "required":true + }, + { + "type":"number", + "description":"The day of the specific trading volume request date - in this case 01 (1st of a month).", + "name":"day", + "in":"path", + "x-example":"01", + "required":true + } + ], + "tags":[ + "Market" + ], + "responses":{ + "default":{ + "schema":{ + "$ref":"#/definitions/24HoursVolumeResponse" + }, + "description":"Returns the overall trading volume details for all tokens in USD as well as the trading volume per trading pair." + } + } + } + }, + "/v1/trading/r/tradesSince/{symbol}/{startDate}/{limit}":{ + "get":{ + "summary":"Request information regarding all completed trades in a time range for a given market pair", + "operationId":"getV1TradingRTradessinceSymbolStartdateLimit", + "parameters":[ + { + "type":"string", + "description":"The market trading pair in deversifi format i.e BASE:QUOTE", + "name":"symbol", + "in":"path", + "x-example":"ETH:BTC", + "required":true + }, + { + "type":"number", + "description":"Date of the last trade returned.", + "name":"startDate", + "in":"path", + "x-example":1747384800000, + "required":true + }, + { + "type":"number", + "description":"Limit of trades that will be returned. With a maximum limit of 1000.", + "name":"limit", + "in":"path", + "x-example":60 + } + ], + "tags":[ + "Market" + ], + "responses":{ + "default":{ + "schema":{ + "$ref":"#/definitions/Model25" + }, + "description":"Returns data on all recently completed trades for a given market pair during a time range" + } + } + } + }, + "/v1/trading/bridgedDeposits":{ + "post":{ + "summary":"Create Stark V2 BridgedDepositRequest", + "operationId":"postV1TradingBridgeddeposits", + "parameters":[ + { + "type":"string", + "description":"Base64 of {signature, nonce} JSON representation", + "name":"authorization", + "in":"header", + "x-example":"EcRecover eyJub25jZSI6InYyLTE3MDQxMTQwNjEuMDAwIiwic2lnbmF0dXJlIjoiMHgyYjQ4ZDUzZjJlM2E2OTY2MzBlYmRjZDFmZjA1NzU1NmJiYzlkZTljMjk0YWRmYWE1YjFmMTNkZjkxYjY3YjM0N2ZkZDg4YzI5NTk0YzM3N2JhMDAyNGRlYzQwY2Q5ODA4ODI5ZTdmNDQ0Nzc3MjQ4MmY1MGE3YThlOWE5MDM1NjFjIn0=", + "required":true + }, + { + "in":"body", + "name":"body", + "schema":{ + "$ref":"#/definitions/bridgedDepositsPostPayload" + } + } + ], + "tags":[ + "Trading" + ], + "responses":{ + "200":{ + "schema":{ + "$ref":"#/definitions/bridgedDepositsPostResponse" + }, + "description":"Successful" + } + } + } + }, + "/v1/trading/bridgedWithdrawals":{ + "post":{ + "summary":"Create Stark V2 BridgedWithdrawalRequest", + "operationId":"postV1TradingBridgedwithdrawals", + "parameters":[ + { + "type":"string", + "description":"Base64 of {signature, nonce} JSON representation", + "name":"authorization", + "in":"header", + "x-example":"EcRecover eyJub25jZSI6InYyLTE3MDQxMTQwNjEuMDAwIiwic2lnbmF0dXJlIjoiMHgyYjQ4ZDUzZjJlM2E2OTY2MzBlYmRjZDFmZjA1NzU1NmJiYzlkZTljMjk0YWRmYWE1YjFmMTNkZjkxYjY3YjM0N2ZkZDg4YzI5NTk0YzM3N2JhMDAyNGRlYzQwY2Q5ODA4ODI5ZTdmNDQ0Nzc3MjQ4MmY1MGE3YThlOWE5MDM1NjFjIn0=", + "required":true + }, + { + "in":"body", + "name":"body", + "schema":{ + "$ref":"#/definitions/bridgedWithdrawalsPostPayload" + } + } + ], + "tags":[ + "Trading" + ], + "responses":{ + "200":{ + "schema":{ + "$ref":"#/definitions/bridgedWithdrawalsPostResponse" + }, + "description":"Successful" + } + } + } + }, + "/v1/trading/deposits":{ + "post":{ + "summary":"Create Stark V2 DepositRequest", + "operationId":"postV1TradingDeposits", + "parameters":[ + { + "type":"string", + "description":"Base64 of {signature, nonce} JSON representation", + "name":"authorization", + "in":"header", + "x-example":"EcRecover eyJub25jZSI6InYyLTE3MDQxMTQwNjEuMDAwIiwic2lnbmF0dXJlIjoiMHgyYjQ4ZDUzZjJlM2E2OTY2MzBlYmRjZDFmZjA1NzU1NmJiYzlkZTljMjk0YWRmYWE1YjFmMTNkZjkxYjY3YjM0N2ZkZDg4YzI5NTk0YzM3N2JhMDAyNGRlYzQwY2Q5ODA4ODI5ZTdmNDQ0Nzc3MjQ4MmY1MGE3YThlOWE5MDM1NjFjIn0=", + "required":true + }, + { + "in":"body", + "name":"body", + "schema":{ + "$ref":"#/definitions/depositsPostPayload" + } + } + ], + "tags":[ + "Trading" + ], + "responses":{ + "200":{ + "schema":{ + "$ref":"#/definitions/depositsPostResponse" + }, + "description":"Successful" + } + } + } + }, + "/v1/trading/deposits-validate":{ + "post":{ + "summary":"Create Stark V2 Deposits-validateRequest", + "operationId":"postV1TradingDepositsvalidate", + "parameters":[ + { + "type":"string", + "description":"Base64 of {signature, nonce} JSON representation", + "name":"authorization", + "in":"header", + "x-example":"EcRecover eyJub25jZSI6InYyLTE3MDQxMTQwNjEuMDAwIiwic2lnbmF0dXJlIjoiMHgyYjQ4ZDUzZjJlM2E2OTY2MzBlYmRjZDFmZjA1NzU1NmJiYzlkZTljMjk0YWRmYWE1YjFmMTNkZjkxYjY3YjM0N2ZkZDg4YzI5NTk0YzM3N2JhMDAyNGRlYzQwY2Q5ODA4ODI5ZTdmNDQ0Nzc3MjQ4MmY1MGE3YThlOWE5MDM1NjFjIn0=", + "required":true + }, + { + "in":"body", + "name":"body", + "schema":{ + "$ref":"#/definitions/deposits-validatePostPayload" + } + } + ], + "tags":[ + "Trading" + ], + "responses":{ + "200":{ + "schema":{ + "$ref":"#/definitions/deposits-validatePostResponse" + }, + "description":"Successful" + } + } + } + }, + "/v1/trading/withdrawals":{ + "post":{ + "summary":"Create Stark V2 WithdrawalRequest", + "operationId":"postV1TradingWithdrawals", + "parameters":[ + { + "type":"string", + "description":"Base64 of {signature, nonce} JSON representation", + "name":"authorization", + "in":"header", + "x-example":"EcRecover eyJub25jZSI6InYyLTE3MDQxMTQwNjEuMDAwIiwic2lnbmF0dXJlIjoiMHgyYjQ4ZDUzZjJlM2E2OTY2MzBlYmRjZDFmZjA1NzU1NmJiYzlkZTljMjk0YWRmYWE1YjFmMTNkZjkxYjY3YjM0N2ZkZDg4YzI5NTk0YzM3N2JhMDAyNGRlYzQwY2Q5ODA4ODI5ZTdmNDQ0Nzc3MjQ4MmY1MGE3YThlOWE5MDM1NjFjIn0=", + "required":true + }, + { + "in":"body", + "name":"body", + "schema":{ + "$ref":"#/definitions/withdrawalsPostPayload" + } + } + ], + "tags":[ + "Trading" + ], + "responses":{ + "200":{ + "schema":{ + "$ref":"#/definitions/withdrawalsPostResponse" + }, + "description":"Successful" + } + } + } + }, + "/v1/trading/amm/fundingOrders":{ + "post":{ + "summary":"Submit AMM fundingOrder. Used to deposit or withdrawal liquidity.", + "operationId":"postV1TradingAmmFundingorders", + "parameters":[ + { + "in":"body", + "name":"body", + "schema":{ + "$ref":"#/definitions/AmmFundingOrdersPostPayload" + } + } + ], + "tags":[ + "Trading", + "AMM" + ], + "responses":{ + "200":{ + "schema":{ + "$ref":"#/definitions/AmmFundingOrdersPostResponse" + }, + "description":"Successful" + } + } + } + }, + "/v1/trading/r/addAirdrops":{ + "post":{ + "summary":"Add a list of airdops", + "operationId":"postV1TradingRAddairdrops", + "parameters":[ + { + "in":"body", + "name":"body", + "schema":{ + "$ref":"#/definitions/addAirdropRequestSchema" + } + } + ], + "tags":[ + "Internal" + ], + "responses":{ + "200":{ + "schema":{ + "$ref":"#/definitions/addAirdropResponseSchema" + }, + "description":"Successful" + } + } + } + }, + "/v1/trading/r/getBalance":{ + "post":{ + "summary":"This is used to retrieve the total and active balances of a user per token. Active balance is the balance that is currently available. Total balance (specified as balance) is the sum of all the balances including those locked for trading.", + "operationId":"postV1TradingRGetbalance", + "parameters":[ + { + "in":"body", + "name":"body", + "schema":{ + "$ref":"#/definitions/getBalancePayload" + } + } + ], + "tags":[ + "Trading" + ], + "responses":{ + "default":{ + "schema":{ + "$ref":"#/definitions/getBalanceResponse" + }, + "description":"Returns the total, available and locked balances of a user per token." + } + } + } + }, + "/v1/trading/r/getDeposits":{ + "post":{ + "summary":"This is an authenticated endpoint used to retrieve deposits. A token can be specified to get deposits for a specific token. The limit of deposits returned is 1000.", + "operationId":"postV1TradingRGetdeposits", + "parameters":[ + { + "type":"number", + "description":"Date of the last deposit returned.", + "name":"startDate", + "in":"query", + "x-example":1747384800000 + }, + { + "type":"number", + "description":"Limit of deposits that will be returned. With a maximum limit of 1000.", + "name":"limit", + "in":"query", + "x-example":60 + }, + { + "in":"body", + "name":"body", + "schema":{ + "$ref":"#/definitions/getDepositsPayload" + } + } + ], + "tags":[ + "Trading" + ], + "responses":{ + "default":{ + "schema":{ + "$ref":"#/definitions/getDepositsResponse" + }, + "description":"Returns the list of deposits. A token can be specified to get deposits for a specific token." + } + } + } + }, + "/v1/trading/r/getOrder":{ + "post":{ + "summary":"This is endpoint is used to retrieve the details for a specific order using the order ID.", + "operationId":"postV1TradingRGetorder", + "parameters":[ + { + "in":"body", + "name":"body", + "schema":{ + "$ref":"#/definitions/getOrderPayload" + } + } + ], + "tags":[ + "Trading" + ], + "responses":{ + "default":{ + "schema":{ + "$ref":"#/definitions/getOrderResponse" + }, + "description":"Returns details relating to a particular order." + } + } + } + }, + "/v1/trading/r/getPendingWithdrawals":{ + "post":{ + "summary":"This endpoint is used to retrieve all pending withdrawals. If a token is specified, withdrawals pertaining to only that particular token are provided.", + "operationId":"postV1TradingRGetpendingwithdrawals", + "parameters":[ + { + "in":"body", + "name":"body", + "schema":{ + "$ref":"#/definitions/getPendingWithdrawalsPayload" + } + } + ], + "tags":[ + "Trading" + ], + "responses":{ + "default":{ + "schema":{ + "type":"string" + }, + "description":"Successful" + } + } + } + }, + "/v1/trading/r/getPublicUserPermissions":{ + "post":{ + "summary":"Used to get all configured permissions for the authenticated user", + "operationId":"postV1TradingRGetpublicuserpermissions", + "parameters":[ + { + "in":"body", + "name":"body", + "schema":{ + "$ref":"#/definitions/authPayload" + } + } + ], + "tags":[ + "public" + ], + "responses":{ + "200":{ + "schema":{ + "$ref":"#/definitions/Model36" + }, + "description":"Successful" + } + } + } + }, + "/v1/trading/r/getUserConf":{ + "post":{ + "summary":"Returns the DeversiFi application and user configuration details.", + "operationId":"postV1TradingRGetuserconf", + "parameters":[ + { + "in":"body", + "name":"body", + "schema":{ + "$ref":"#/definitions/authPayload" + } + } + ], + "tags":[ + "Trading" + ], + "responses":{ + "default":{ + "schema":{ + "$ref":"#/definitions/getUserConfResponse" + }, + "description":"Returns the overall trading volume details for all tokens in USD as well as the trading volume per trading pair." + } + } + } + }, + "/v1/trading/r/getVaultId":{ + "post":{ + "summary":"An authenticated endpoint used to retrieve a vaultId for given token.", + "operationId":"postV1TradingRGetvaultid", + "parameters":[ + { + "in":"body", + "name":"body", + "schema":{ + "$ref":"#/definitions/getVaultIdPayload" + } + } + ], + "tags":[ + "Trading" + ], + "responses":{ + "200":{ + "description":"the vault id.", + "schema":{ + "type":"number", + "description":"the vault id.", + "example":1851736 + } + } + } + } + }, + "/v1/trading/r/getWithdrawal":{ + "post":{ + "summary":"This endpoint is used to retrieve details relating to a particular withdrawal.", + "operationId":"postV1TradingRGetwithdrawal", + "parameters":[ + { + "in":"body", + "name":"body", + "schema":{ + "$ref":"#/definitions/getWithdrawalPayload" + } + } + ], + "tags":[ + "Trading" + ], + "responses":{ + "200":{ + "schema":{ + "$ref":"#/definitions/withdrawHistoryObject" + }, + "description":"Successful" + } + } + } + }, + "/v1/trading/r/hasReceivedCompensation":{ + "post":{ + "summary":"Returns whether the user already received registration compensation.", + "operationId":"postV1TradingRHasreceivedcompensation", + "parameters":[ + { + "in":"body", + "name":"body", + "schema":{ + "$ref":"#/definitions/authPayload" + } + } + ], + "tags":[ + "Internal" + ], + "responses":{ + "200":{ + "schema":{ + "$ref":"#/definitions/Model38" + }, + "description":"Successful" + } + } + } + }, + "/v1/trading/r/openOrders":{ + "post":{ + "summary":"This endpoints allows to retrieve details on all open orders.", + "operationId":"postV1TradingROpenorders", + "parameters":[ + { + "in":"body", + "name":"body", + "schema":{ + "$ref":"#/definitions/openOrdersPayload" + } + } + ], + "tags":[ + "Trading" + ], + "responses":{ + "200":{ + "schema":{ + "$ref":"#/definitions/openOrdersResponse" + }, + "description":"Successful" + } + } + } + }, + "/v1/trading/r/orderHistory":{ + "post":{ + "summary":"This method is used to retrieve a list of all past orders for a user. This includes executed trades, as well as expired and cancelled orders. The limit of orders returned is 1000.", + "operationId":"postV1TradingROrderhistory", + "parameters":[ + { + "type":"number", + "description":"Date of the last order returned.", + "name":"startDate", + "in":"query", + "x-example":1747384800000 + }, + { + "type":"number", + "description":"Limit of orders that will be returned. With a maximum limit of 1000.", + "name":"limit", + "in":"query", + "x-example":60 + }, + { + "in":"body", + "name":"body", + "schema":{ + "$ref":"#/definitions/orderHistoryPayload" + } + } + ], + "tags":[ + "Trading" + ], + "responses":{ + "200":{ + "schema":{ + "$ref":"#/definitions/Model39" + }, + "description":"Successful" + } + } + } + }, + "/v1/trading/r/recoverTradingKey":{ + "post":{ + "summary":"Returns the encrypted Stark Trading Key.", + "operationId":"postV1TradingRRecovertradingkey", + "parameters":[ + { + "in":"body", + "name":"body", + "schema":{ + "$ref":"#/definitions/authPayload" + } + } + ], + "tags":[ + "Trading" + ], + "responses":{ + "default":{ + "schema":{ + "$ref":"#/definitions/recoverTradingKeyResponse" + }, + "description":"Returns the encrypted Stark Trading key." + } + } + } + }, + "/v1/trading/r/setPublicUserPermissions":{ + "post":{ + "summary":"Used to set a specific permission for a given user", + "operationId":"postV1TradingRSetpublicuserpermissions", + "parameters":[ + { + "in":"body", + "name":"body", + "schema":{ + "$ref":"#/definitions/permissionsPayload" + } + } + ], + "tags":[ + "Trading" + ], + "responses":{ + "200":{ + "schema":{ + "$ref":"#/definitions/Model36" + }, + "description":"Successful" + } + } + } + }, + "/v1/trading/r/userOrderCount":{ + "post":{ + "summary":"This method is used to retrieve user's count of filled orders.", + "operationId":"postV1TradingRUserordercount", + "parameters":[ + { + "in":"body", + "name":"body", + "schema":{ + "$ref":"#/definitions/authPayload" + } + } + ], + "tags":[ + "Trading" + ], + "responses":{ + "200":{ + "schema":{ + "$ref":"#/definitions/Model40" + }, + "description":"Successful" + } + } + } + }, + "/v1/trading/r/withdrawHistory":{ + "post":{ + "summary":"An authenticated endpoint used to retrieve a list of user's past withdrawals. This includes ready, completed, as well as cancelled withdrawals. The limit of withdrawals returned is 1000.", + "operationId":"postV1TradingRWithdrawhistory", + "parameters":[ + { + "type":"number", + "description":"Date of the last withdraw returned.", + "name":"startDate", + "in":"query", + "x-example":1747384800000 + }, + { + "type":"number", + "description":"Limit of withdraws that will be returned. With a maximum limit of 1000.", + "name":"limit", + "in":"query", + "x-example":60 + }, + { + "in":"body", + "name":"body", + "schema":{ + "$ref":"#/definitions/getPendingWithdrawalsPayload" + } + } + ], + "tags":[ + "Trading" + ], + "responses":{ + "200":{ + "schema":{ + "$ref":"#/definitions/withdrawHistoryResponse" + }, + "description":"Successful" + } + } + } + }, + "/v1/trading/w/cancelOpenOrders":{ + "post":{ + "summary":"This endpoint allows to cancel all open orders of the requestor", + "operationId":"postV1TradingWCancelopenorders", + "parameters":[ + { + "in":"body", + "name":"body", + "schema":{ + "$ref":"#/definitions/authPayload" + } + } + ], + "tags":[ + "Trading" + ], + "responses":{ + "200":{ + "schema":{ + "$ref":"#/definitions/cancelOpenOrdersResponse" + }, + "description":"Successful" + } + } + } + }, + "/v1/trading/w/cancelOrder":{ + "post":{ + "summary":"This endpoint allows to cancel a specific order.", + "operationId":"postV1TradingWCancelorder", + "parameters":[ + { + "in":"body", + "name":"body", + "schema":{ + "$ref":"#/definitions/getOrderPayload" + } + } + ], + "tags":[ + "Trading" + ], + "responses":{ + "200":{ + "schema":{ + "$ref":"#/definitions/cancelOrderResponse" + }, + "description":"Queues cancellation request and returns the order ID of the cancelled order." + }, + "502":{ + "description":"Unable to determine the status of order cancellation request, verify by fetching orders list" + } + } + } + }, + "/v1/trading/w/cancelWithdrawal":{ + "post":{ + "summary":"Cancel withdrawal with given id.", + "operationId":"postV1TradingWCancelwithdrawal", + "parameters":[ + { + "in":"body", + "name":"body", + "schema":{ + "$ref":"#/definitions/cancelWithdrawalPayload" + } + } + ], + "tags":[ + "Trading" + ], + "responses":{ + "200":{ + "schema":{ + "$ref":"#/definitions/withdrawHistoryObject" + }, + "description":"Successful" + } + } + } + }, + "/v1/trading/w/claimAirdrop":{ + "post":{ + "summary":"Request airdrop claim for the specified token/address", + "operationId":"postV1TradingWClaimairdrop", + "parameters":[ + { + "in":"body", + "name":"body", + "schema":{ + "$ref":"#/definitions/airdropEligibilityQuery" + } + } + ], + "tags":[ + "Trading" + ], + "responses":{ + "200":{ + "schema":{ + "$ref":"#/definitions/Model42" + }, + "description":"Successful" + } + } + } + }, + "/v1/trading/w/deposit":{ + "post":{ + "summary":"Submit a signed notification of a new deposit made.", + "operationId":"postV1TradingWDeposit", + "parameters":[ + { + "in":"body", + "name":"body", + "schema":{ + "$ref":"#/definitions/depositPayload" + } + } + ], + "tags":[ + "Trading" + ], + "responses":{ + "default":{ + "schema":{ + "$ref":"#/definitions/depositResponse" + }, + "description":"Returns the deposit notifcation." + } + } + } + }, + "/v1/trading/w/fastWithdrawal":{ + "post":{ + "summary":"Submit a request for a new fast withdrawal.", + "operationId":"postV1TradingWFastwithdrawal", + "parameters":[ + { + "in":"body", + "name":"body", + "schema":{ + "$ref":"#/definitions/fastWithdrawalPayload" + } + } + ], + "tags":[ + "Trading" + ], + "responses":{ + "200":{ + "schema":{ + "$ref":"#/definitions/Model45" + }, + "description":"Successful" + } + } + } + }, + "/v1/trading/w/feedback":{ + "post":{ + "summary":"This endpoint allows to send the email of an user.", + "operationId":"postV1TradingWFeedback", + "parameters":[ + { + "in":"body", + "name":"body", + "schema":{ + "$ref":"#/definitions/feedbackPayload" + } + } + ], + "tags":[ + "Internal" + ], + "responses":{ + "200":{ + "schema":{ + "$ref":"#/definitions/Model46" + }, + "description":"Successful" + } + } + } + }, + "/v1/trading/w/notifications":{ + "post":{ + "summary":"Creates a new notification.", + "operationId":"postV1TradingWNotifications", + "parameters":[ + { + "in":"body", + "name":"body", + "schema":{ + "$ref":"#/definitions/notificationPayload" + } + } + ], + "tags":[ + "Internal" + ], + "responses":{ + "200":{ + "schema":{ + "$ref":"#/definitions/notification" + }, + "description":"Successful" + } + } + } + }, + "/v1/trading/w/register":{ + "post":{ + "summary":"This method is used to register a Stark key that corresponds to an Ethereum public address. This will return deversifi Signature or DeversiFi application and user configuration details.", + "operationId":"postV1TradingWRegister", + "parameters":[ + { + "in":"body", + "name":"body", + "schema":{ + "$ref":"#/definitions/registerPayload" + } + } + ], + "tags":[ + "Trading" + ], + "responses":{ + "200":{ + "schema":{ + "$ref":"#/definitions/registerResponseUserRegisteredOnChain", + "x-alternatives":[ + { + "$ref":"#/x-alt-definitions/registerResponseUserRegisteredOnChain" + }, + { + "$ref":"#/x-alt-definitions/registerResponseUserNotRegisteredOnChain" + } + ] + }, + "description":"Successful" + } + } + } + }, + "/v1/trading/w/storeStarkTradingKey":{ + "post":{ + "summary":"This endpoint allows storing encrypted Stark Trading Key.", + "operationId":"postV1TradingWStorestarktradingkey", + "parameters":[ + { + "in":"body", + "name":"body", + "schema":{ + "$ref":"#/definitions/storeTradingKeyPayload" + } + } + ], + "tags":[ + "Trading" + ], + "responses":{ + "default":{ + "schema":{ + "$ref":"#/definitions/storeTradingKeyResponse" + }, + "description":"Returns flag of whether or not the key was stored successfully." + } + } + } + }, + "/v1/trading/w/submitOrder":{ + "post":{ + "summary":"This authenticated endpoint is used to submit an order.", + "operationId":"postV1TradingWSubmitorder", + "parameters":[ + { + "x-alternatives":[ + { + "$ref":"#/x-alt-definitions/submitOrderPayload" + }, + { + "$ref":"#/x-alt-definitions/Model6" + } + ], + "in":"body", + "name":"body", + "schema":{ + "$ref":"#/definitions/submitOrderPayload" + } + } + ], + "tags":[ + "Trading" + ], + "responses":{ + "200":{ + "schema":{ + "$ref":"#/definitions/submitOrderResponse", + "x-alternatives":[ + { + "$ref":"#/x-alt-definitions/submitOrderResponse" + }, + { + "$ref":"#/x-alt-definitions/Model7" + } + ] + }, + "description":"Queues order for market submission and returns the order ID of the submitted order." + }, + "502":{ + "description":"Unable to determine the status of order submission request, verify by fetching orders list" + } + } + } + }, + "/v1/trading/w/transfer":{ + "post":{ + "summary":"Submit a request for internal transfer (NOTE: currently not available to wider public).", + "operationId":"postV1TradingWTransfer", + "parameters":[ + { + "in":"body", + "name":"body", + "schema":{ + "$ref":"#/definitions/transferPayload" + } + } + ], + "tags":[ + "Trading" + ], + "responses":{ + "200":{ + "schema":{ + "$ref":"#/definitions/transferResponseObject" + }, + "description":"Successful" + } + } + } + }, + "/v1/trading/w/withdraw":{ + "post":{ + "summary":"Submit a request for a new withdrawal.", + "operationId":"postV1TradingWWithdraw", + "parameters":[ + { + "in":"body", + "name":"body", + "schema":{ + "$ref":"#/definitions/withdrawalPayload" + } + } + ], + "tags":[ + "Trading" + ], + "responses":{ + "default":{ + "schema":{ + "type":"string" + }, + "description":"Successful" + } + } + } + }, + "/v1/trading/r/getBalanceForUser/{userEthAddress}":{ + "post":{ + "summary":"This is used to retrieve the total and active balances of a user per token. Active balance is the balance that is currently available. Total balance (specified as balance) is the sum of all the balances including those locked for trading.", + "operationId":"postV1TradingRGetbalanceforuserUserethaddress", + "parameters":[ + { + "type":"string", + "description":"The ETH address of a potential user", + "name":"userEthAddress", + "in":"path", + "x-example":"0x08152c1265dbc218ccc8ab5c574e6bd52279b3b7", + "required":true + }, + { + "in":"body", + "name":"body", + "schema":{ + "$ref":"#/definitions/Model52" + } + } + ], + "tags":[ + "Trading", + "public" + ], + "responses":{ + "200":{ + "schema":{ + "$ref":"#/definitions/getBalanceResponse" + }, + "description":"Successful" + }, + "401":{ + "description":"User has not authorized the use of this endpoint for their address" + } + } + } + }, + "/v1/trading/w/notifications/{id}":{ + "delete":{ + "summary":"Deletes a notification.", + "operationId":"deleteV1TradingWNotificationsId", + "parameters":[ + { + "type":"string", + "name":"id", + "in":"path", + "required":true + } + ], + "tags":[ + "Internal" + ], + "responses":{ + "200":{ + "schema":{ + "$ref":"#/definitions/notification" + }, + "description":"Successful" + } + } + } + } + }, + "definitions":{ + "getAllowanceResponse":{ + "type":"object", + "properties":{ + "allowance":{ + "type":"string", + "example":"ALLOWED", + "enum":[ + "ALLOWED", + "DENIED", + "KYC_REQUIRED" + ] + }, + "reason":{ + "type":"string", + "example":"NO_POLICY" + } + } + }, + "ETH":{ + "type":"object", + "properties":{ + "token":{ + "type":"string", + "description":"Token symbol", + "example":"ETH" + }, + "balance":{ + "type":"string", + "description":"Quantised token balance", + "example":"10" + }, + "usdBalance":{ + "type":"string", + "description":"USD equivalent of token balance", + "example":"20" + } + } + }, + "Model1":{ + "type":"object", + "properties":{ + "time":{ + "type":"string", + "format":"date", + "description":"DateTime of the aggregation", + "example":"2021-07-14T11:28:45.828Z" + }, + "onChainTotalUsd":{ + "type":"string", + "description":"total USD equivalent of the on-chain assets", + "example":"20" + }, + "exchangeTotalUsd":{ + "type":"string", + "description":"total USD equivalent of the exchange assets", + "example":"20" + }, + "totalUsd":{ + "type":"string", + "description":"total USD equivalent of both on-chain and exchange assets", + "example":"40" + }, + "onChainBalances":{ + "type":"object", + "description":"Map of on-chain token balances", + "name":"tokenBalanceSchema", + "properties":{ + "ETH":{ + "$ref":"#/definitions/ETH" + } + } + }, + "exchangeBalances":{ + "type":"object", + "description":"Map of exchange token balances", + "name":"tokenBalanceSchema", + "properties":{ + "ETH":{ + "$ref":"#/definitions/ETH" + } + } + } + } + }, + "balanceHistorySchema":{ + "type":"array", + "items":{ + "$ref":"#/definitions/Model1" + } + }, + "collateralBalancesSchema":{ + "type":"object" + }, + "pagination":{ + "type":"object", + "properties":{ + "totalItems":{ + "type":"number", + "description":"Total number of items matching the query", + "example":1559, + "minimum":0 + }, + "limit":{ + "type":"number", + "description":"Limit applied on returned items", + "example":5 + }, + "skip":{ + "type":"number", + "description":"Skip applied on returned items", + "example":2 + } + } + }, + "Model2":{ + "type":"object", + "properties":{ + "_id":{ + "type":"string", + "description":"Unique identifier representing the deposit or withdrawal", + "example":"606f207fc7aa2e91d028a17a" + }, + "type":{ + "type":"string", + "description":"Whether the transaction is a deposit, a classic withdrawal or a fast withdrawal", + "example":"Deposit", + "enum":[ + "Deposit", + "Withdrawal", + "FastWithdrawal" + ] + }, + "token":{ + "type":"string", + "description":"Token deposited or withdrawn", + "example":"ZRX" + }, + "amount":{ + "type":"number", + "description":"Amount deposited or withdrawn", + "example":1 + }, + "transactionHash":{ + "type":"string", + "description":"Hash of the Ethereum transaction leading to L1 balance debit or credit", + "example":"0xb5c8bd9430b6cc87a0e2fe110ece6bf527fa4f170a4bc8cd032f768fc5219838" + }, + "date":{ + "type":"string", + "format":"date", + "description":"Date and time deposit or withdrawal", + "example":"2020-11-11T16:37:05.957" + }, + "sourceOrRecipient":{ + "type":"string", + "description":"Originator of the deposit or recipient of the withdrawal", + "example":"0x148426fdc4c8a51b96b4bed827907b5fa6491ad0" + }, + "gateway":{ + "type":"string", + "description":"Set when operation used a gateway. Corresponds to a chain identifier", + "example":"MATIC_POS" + } + } + }, + "items":{ + "type":"array", + "items":{ + "$ref":"#/definitions/Model2" + } + }, + "getDepositsAndWithdrawalsResponse":{ + "type":"object", + "properties":{ + "pagination":{ + "$ref":"#/definitions/pagination" + }, + "items":{ + "$ref":"#/definitions/items" + } + } + }, + "addresses":{ + "type":"array", + "example":[ + "0x5317c63f870e8d2f85f0de3c2666d1414f5a728c", + "0x08152c1265dbc218ccc8ab5c574e6bd52279b3b7" + ], + "items":{ + "type":"string" + } + }, + "Model3":{ + "type":"object", + "properties":{ + "addresses":{ + "$ref":"#/definitions/addresses" + }, + "kycStatus":{ + "type":"string", + "example":"PASS", + "enum":[ + "PENDING", + "PASS", + "FAILED", + "EXPIRED" + ] + } + } + }, + "Model4":{ + "type":"object", + "properties":{ + "fillId":{ + "type":"string", + "description":"Unique identifier representing the fill event", + "example":"606f207fc7aa2e91d028a17a" + }, + "orderId":{ + "type":"string", + "description":"Unique identifier of the order associated with the fill", + "example":"BtHEvgY1Bz1" + }, + "symbol":{ + "type":"string", + "description":"Symbol for the order associated with the fill", + "example":"ETH:USDT" + }, + "price":{ + "type":"number", + "description":"Execution price of the fill", + "example":209.9 + }, + "fillAmount":{ + "type":"number", + "description":"Amount filled (negative amount for a sell event, positive for a buy event)", + "example":-0.125622 + }, + "orderAmount":{ + "type":"number", + "description":"Initial amount for the placed order associated with the fill", + "example":-1 + }, + "date":{ + "type":"string", + "format":"date", + "description":"Date and time of the fill event", + "example":"2020-11-11T16:37:05.957" + }, + "orderCreationDate":{ + "type":"string", + "format":"date", + "description":"Date and time at which the order associated with the fill event was placed", + "example":"2020-11-11T16:37:05.262Z" + }, + "orderType":{ + "type":"string", + "description":"Type of the order associated with the fill event", + "example":true, + "enum":[ + "EXCHANGE LIMIT", + "EXCHANGE MARKET" + ] + }, + "orderActive":{ + "type":"boolean", + "description":"Whether the order associated with the fill event is still active", + "example":true + }, + "orderCanceled":{ + "type":"boolean", + "description":"Whether the order associated with the fill event was canceled", + "example":false + } + } + }, + "Model5":{ + "type":"array", + "items":{ + "$ref":"#/definitions/Model4" + } + }, + "getFillsResponse":{ + "type":"object", + "properties":{ + "pagination":{ + "$ref":"#/definitions/pagination" + }, + "items":{ + "$ref":"#/definitions/Model5" + } + } + }, + "Model6":{ + "type":"object", + "properties":{ + "_id":{ + "type":"string", + "description":"Unique identifier representing this transfer", + "example":"MphMkBBZjnS" + }, + "token":{ + "type":"string", + "description":"Token transfered", + "example":"ETH" + }, + "amount":{ + "type":"number", + "description":"Amount transfered (effective amount received by the recipient)", + "example":3.14, + "minimum":0 + }, + "feeAmount":{ + "type":"number", + "description":"Transfer fee amount (in transfer token units)", + "example":3.14, + "minimum":0 + }, + "source":{ + "type":"string", + "description":"Source Ethereum address", + "example":"0x08152c1265dBc218ccc8Ab5C574e6bD52279b3B7" + }, + "recipient":{ + "type":"string", + "description":"Recipient Ethereum address", + "example":"0xeb3ea3ea9239577951523cafa9fd3072bc88e50a" + }, + "memo":{ + "type":"string", + "description":"Transfer memo", + "example":"my reference" + }, + "date":{ + "type":"string", + "format":"date", + "description":"Date and time of the transfer", + "example":"1990-04-14T00:20:00.000Z" + } + } + }, + "Model7":{ + "type":"array", + "items":{ + "$ref":"#/definitions/Model6" + } + }, + "getTransfersResponse":{ + "type":"object", + "properties":{ + "pagination":{ + "$ref":"#/definitions/pagination" + }, + "items":{ + "$ref":"#/definitions/Model7" + } + } + }, + "starkOrder":{ + "type":"object", + "description":"Stark Limit Order Data.", + "example":{ + "vaultIdSell":1000002, + "vaultIdBuy":1000001, + "amountSell":"97400000", + "amountBuy":"100000000000000000", + "tokenSell":"0x2", + "tokenBuy":"0x1" + }, + "properties":{ + "vaultIdSell":{ + "type":"integer", + "description":"The vault ID of the seller.", + "minimum":0 + }, + "vaultIdBuy":{ + "type":"integer", + "description":"The vault ID of the buyer.", + "minimum":0 + }, + "amountSell":{ + "type":"string", + "description":"The total amount to be sold." + }, + "amountBuy":{ + "type":"string", + "description":"The total amount to be bought." + }, + "tokenSell":{ + "type":"string", + "description":"The Stark token ID for the token being sold." + }, + "tokenBuy":{ + "type":"string", + "description":"The Stark token ID for the token being bought." + } + } + }, + "Model8":{ + "type":"object", + "properties":{ + "amountBuy":{ + "type":"string" + }, + "amountSell":{ + "type":"string" + }, + "tokenBuy":{ + "type":"string" + }, + "tokenSell":{ + "type":"string" + }, + "starkOrder":{ + "$ref":"#/definitions/starkOrder" + } + } + }, + "orders":{ + "type":"array", + "x-constraint":{ + "length":2 + }, + "items":{ + "$ref":"#/definitions/Model8" + } + }, + "AmmFundingOrderDataGetResponse":{ + "type":"object", + "example":{ + "pool":"ETHUSDT", + "orders":[ + { + "tokenBuy":"LP-ETHUSDT", + "amountBuy":"50", + "tokenSell":"ETH", + "amountSell":"2", + "starkOrder":{ + "tokenBuy":"0x11af21d6b234cd669edd702dd3d1d017be888337010b950ae3679eb4194b4bc", + "amountBuy":"5000000000", + "vaultIdBuy":247827906, + "tokenSell":"0xb333e3142fe16b78628f19bb15afddaef437e72d6d7f5c6c20c6801a27fba6", + "amountSell":"200000000", + "vaultIdSell":2121602419 + } + }, + { + "tokenBuy":"LP-ETHUSDT", + "amountBuy":"50", + "tokenSell":"USDT", + "amountSell":"1230", + "starkOrder":{ + "tokenBuy":"0x11af21d6b234cd669edd702dd3d1d017be888337010b950ae3679eb4194b4bc", + "amountBuy":"5000000000", + "vaultIdBuy":247827906, + "tokenSell":"0xb333e3142fe16b78628f19bb15afddaef437e72d6d7f5c6c20c6801a27fba6", + "amountSell":"200000000", + "vaultIdSell":2121602419 + } + } + ] + }, + "properties":{ + "pool":{ + "type":"string" + }, + "orders":{ + "$ref":"#/definitions/orders" + } + } + }, + "string":{ + "type":"object", + "properties":{ + "tokenAmount":{ + "type":"number", + "example":0.1 + }, + "USDVolume":{ + "type":"number", + "example":1.1 + } + }, + "required":[ + "tokenAmount", + "USDVolume" + ] + }, + "30DaysVolumeResponse":{ + "type":"object", + "properties":{ + "totalUSDVolume":{ + "type":"number", + "description":"The total trade volume in terms of USD.", + "example":73364.1749445 + }, + "tokens":{ + "type":"object", + "description":"Volumes for individual tokens.", + "name":"tokens", + "properties":{ + "string":{ + "$ref":"#/definitions/string" + } + } + }, + "startDate":{ + "type":"string", + "format":"date", + "description":"The start date and time for the volume presented.", + "example":"2020-01-01T00:00:00.714Z" + }, + "endDate":{ + "type":"string", + "format":"date", + "description":"The end date and time for the volume presented.", + "example":"2020-01-01T00:00:00.714Z" + } + }, + "required":[ + "totalUSDVolume" + ] + }, + "USDRankingResponse":{ + "type":"object", + "properties":{ + "address":{ + "type":"string", + "description":"The address of the trader.", + "example":"0xfc898b18a70ce49579f8d79a32e29928c15b4bc8" + }, + "USDValue":{ + "type":"number", + "description":"The trading volume for the address quoted in USD.", + "example":119128.566703 + } + } + }, + "User24HoursVolumeResponse":{ + "type":"object", + "properties":{ + "totalUSDVolume":{ + "type":"number", + "description":"The total trade volume in terms of USD.", + "example":3320.75 + }, + "tokens":{ + "type":"object", + "description":"Volumes for individual tokens.", + "name":"tokens", + "properties":{ + "string":{ + "$ref":"#/definitions/string" + } + } + } + }, + "required":[ + "totalUSDVolume" + ] + }, + "Model9":{ + "type":"object", + "properties":{ + "totalUSDVolume":{ + "type":"number", + "description":"The total trade volume in terms of USD.", + "example":3320.75 + }, + "tokens":{ + "$ref":"#/definitions/collateralBalancesSchema" + } + } + }, + "Model10":{ + "type":"object", + "properties":{ + "user":{ + "type":"string", + "description":"Ethereum address", + "example":"0x3f2b822E9A8312C6DafBF9686a5e335Af0E4D33B" + }, + "token":{ + "type":"string", + "description":"token for the airdrop", + "example":"DVF" + }, + "amount":{ + "type":"number", + "description":"DVF airdrop eligible amount", + "example":"15.52" + }, + "requested":{ + "type":"boolean", + "description":"Has this claim been already requested", + "example":"false" + } + } + }, + "claims":{ + "type":"array", + "items":{ + "$ref":"#/definitions/Model10" + } + }, + "Model11":{ + "type":"object", + "properties":{ + "claims":{ + "$ref":"#/definitions/claims" + }, + "isRegistered":{ + "type":"boolean", + "description":"is the eth address registered", + "example":true + } + } + }, + "beehiveStatsResponse":{ + "type":"object", + "properties":{ + "pool_identifier":{ + "type":"string", + "description":"Returns the pool identifier.", + "example":"NEC/wETH" + }, + "liquidity_locked":{ + "type":"number", + "description":"The total liquidity in terms of USD.", + "example":28751428.1231 + }, + "apy":{ + "type":"number", + "description":"The APY.", + "example":404.47648991003564 + } + }, + "required":[ + "pool_identifier", + "liquidity_locked", + "apy" + ] + }, + "Model12":{ + "type":"object", + "properties":{ + "pool_identifier":{ + "type":"string", + "description":"Returns the pool identifier.", + "example":"NEC/wETH" + }, + "liquidity_locked":{ + "type":"number", + "description":"The total liquidity in terms of USD.", + "example":28751428.1231 + }, + "apy":{ + "type":"number", + "description":"The APY.", + "example":404.47648991003564 + } + } + }, + "estimatedNextBatchResponse":{ + "type":"object", + "properties":{ + "estimatedTime":{ + "type":"number", + "description":"The number of seconds until the batch is sent to be processed and broadcast to the blockchain.", + "example":608 + }, + "averageTime":{ + "type":"number", + "description":"The configured number of seconds between batches.", + "example":608 + }, + "finalisedBatchPendingConfirmation":{ + "type":"boolean", + "description":"True if the previous batch has been created but still pending confirmation on the blockchain.", + "example":true + } + } + }, + "Model13":{ + "type":"object", + "properties":{ + "feeQuantised":{ + "type":"string", + "description":"Fast withdrawal fee as quantised amount of token to be withdrawn.", + "example":"1224000", + "pattern":"^[0-9]*$" + }, + "feeBaseUnits":{ + "type":"string", + "description":"Fast withdrawal fee as base units of token to be withdrawn.", + "example":"0.01224", + "pattern":"^[+-]?((\\d+(\\.\\d*)?)|(\\.\\d+))$" + } + } + }, + "Model14":{ + "type":"object", + "properties":{ + "maxAmountQuantised":{ + "type":"string", + "description":"Max amount as quantised amount of token to be withdrawn.", + "example":"1224000", + "pattern":"^[0-9]*$" + }, + "maxAmountBaseUnits":{ + "type":"string", + "description":"Max amount as base units of token to be withdrawn.", + "example":"0.01224", + "pattern":"^[+-]?((\\d+(\\.\\d*)?)|(\\.\\d+))$" + } + } + }, + "fees":{ + "type":"object", + "properties":{ + "maker":{ + "type":"number", + "description":"The fee basis points for maker orders (adding bids or offers to the order book).", + "example":15 + }, + "taker":{ + "type":"number", + "description":"The fee basis points for taker orders (removing liquidity from the order book).", + "example":20 + } + } + }, + "getFeeRateResponse":{ + "type":"object", + "properties":{ + "address":{ + "type":"string", + "description":"The Ethereum address of the user verified by nonce and signature.", + "example":"0x116f494a2ce567067f319fea1c9f294f23d2fe68" + }, + "timestamp":{ + "type":"number", + "description":"Timestamp in milliseconds since epoch.", + "example":1590263332427 + }, + "fees":{ + "$ref":"#/definitions/fees" + } + } + }, + "gasSavingsResponse":{ + "type":"object", + "properties":{ + "totalUSD":{ + "type":"number", + "description":"Total gas savings in USD", + "example":7123000 + }, + "monthUSD":{ + "type":"number", + "description":"Gas savings within last 30 days", + "example":421000 + }, + "changePerSecondUSD":{ + "type":"number", + "description":"Rate at which gas savings increase per second", + "example":0.0312 + } + } + }, + "getBalanceUsdResponse":{ + "type":"object", + "properties":{ + "ethAddress":{ + "type":"string", + "description":"The ethereum public address of the user.", + "example":"0x14d06788090769f669427b6aea1c0240d2321f34" + }, + "balanceUsd":{ + "type":"number", + "description":"It is the sum of all user balances converted to USD.", + "example":"2" + } + } + }, + "newMarkets":{ + "type":"array", + "description":"Currency pairs that were newly added", + "items":{ + "type":"string" + } + }, + "DVF":{ + "type":"object", + "description":"This contains application configuration details to set up for deposits and trading.", + "example":{ + "defaultFeeRate":0.002, + "deversifiAddress":"0x9ab450355b4ab504cbc0e4de484781dac08e6a26", + "starkExContractAddress":"0xF3731d0cdC9834f6F32104580bD226EF1bc1A9F9", + "exchangeSymbols":[ + "ETH:USDT", + "ZRX:USDT", + "ZRX:ETH" + ], + "newMarkets":[ + "ZRX:USDT", + "ZRX:ETH" + ], + "tempStarkVaultId":1 + }, + "properties":{ + "defaultFeeRate":{ + "type":"number", + "description":"The default fee rate, if no volume or maker discount." + }, + "deversifiAddress":{ + "type":"string", + "description":"The address of the DeversiFi exchange." + }, + "starkExContractAddress":{ + "type":"string", + "description":"Stark deposit contract address." + }, + "exchangeSymbols":{ + "type":"string", + "description":"Currency pairs available at the DeversiFi exchange for trading" + }, + "newMarkets":{ + "$ref":"#/definitions/newMarkets" + }, + "tempStarkVaultId":{ + "type":"number", + "description":"Transit Stark vault ID used for deposit privacy" + } + } + }, + "getConfResponse":{ + "type":"object", + "example":{ + "DVF":{ + "defaultFeeRate":0.002, + "deversifiAddress":"0x9ab450355b4ab504cbc0e4de484781dac08e6a26", + "starkExContractAddress":"0xF3731d0cdC9834f6F32104580bD226EF1bc1A9F9", + "exchangeSymbols":[ + "ETH:USDT", + "ZRX:USDT", + "ZRX:ETH" + ], + "newMarkets":[ + "ZRX:USDT", + "ZRX:ETH" + ], + "tempStarkVaultId":1 + }, + "tokenRegistry":{ + "ETH":{ + "decimals":18, + "quantization":10000000000, + "minOrderSize":0.05, + "transferFee":0.0005, + "starkTokenId":"0xb333e3142fe16b78628f19bb15afddaef437e72d6d7f5c6c20c6801a27fba6", + "tokenAddressPerChain":{ + "ETHEREUM":"0x0000000000000000000000000000000000000000" + }, + "fastWithdrawalRequiredGas":70000, + "coingeckoId":"ethereum", + "deployedAtBlock":0 + }, + "DAI":{ + "decimals":18, + "quantization":10000000000, + "minOrderSize":10, + "transferFee":1, + "tokenAddress":"0x633cc66389201d3884c9cc0e51eedfb0ce241e6c", + "tokenAddressPerChain":{ + "ETHEREUM":"0x633cc66389201d3884c9cc0e51eedfb0ce241e6c", + "MATIC_POS":"0x0478d34dc7eb3d8622e214a3d119bd32e4a3216d", + "MATIC_POS_PARENT":"0xaeee769968b43457589d10e4b08ee7adfe67544f" + }, + "starkTokenId":"0x3df71c14fe878afe2df7484fdfb52b0fcec01408c590c937e872ecf607d8c51", + "fastWithdrawalRequiredGas":120000, + "coingeckoId":"dai", + "deployedAtBlock":9681200 + } + } + }, + "properties":{ + "DVF":{ + "$ref":"#/definitions/DVF" + }, + "tokenRegistry":{ + "$ref":"#/definitions/collateralBalancesSchema" + } + } + }, + "getGasPriceResponse":{ + "type":"object", + "description":"Range of gas prices for on chain confirmation speed", + "example":{ + "fast":"70000000000", + "fastWait":0.5, + "average":"67000000000", + "averageWait":1.4, + "cheap":"66000000000", + "cheapWait":10.5 + }, + "properties":{ + "fast":{ + "type":"string", + "description":"Gas price in Wei for quickest onchain transaction confirmation.", + "pattern":"^[0-9]*$" + }, + "average":{ + "type":"string", + "description":"Average gas price in Wei for average onchain transaction speed.", + "pattern":"^[0-9]*$" + }, + "cheap":{ + "type":"string", + "description":"Low gas price in Wei and very slow transaction speed.", + "pattern":"^[0-9]*$" + }, + "fastWait":{ + "type":"number", + "description":"The approximate time for a transaction confirmation when using fast as the gas price." + }, + "averageWait":{ + "type":"number", + "description":"The approximate time for a transaction confirmation when using average as the gas price." + }, + "cheapWait":{ + "type":"number", + "description":"The approximate time for a transaction confirmation when using cheap as the gas price." + } + } + }, + "BALANCES":{ + "type":"object", + "properties":{ + "key":{ + "type":"string", + "description":"Permission key" + }, + "description":{ + "type":"string", + "description":"description of the permission" + } + } + }, + "Model15":{ + "type":"object", + "properties":{ + "BALANCES":{ + "$ref":"#/definitions/BALANCES" + }, + "TRADING_HISTORY":{ + "$ref":"#/definitions/BALANCES" + } + } + }, + "Model16":{ + "type":"object", + "properties":{ + "liquidityAvailable":{ + "type":"number", + "description":"Remaining liquidity", + "example":10 + }, + "totalSupply":{ + "type":"number", + "description":"Total supply", + "example":1000 + } + } + }, + "tokenSaleStartEndResponse":{ + "type":"object", + "properties":{ + "start":{ + "type":"number", + "description":"Token sale start timestamp", + "example":1625036000 + }, + "end":{ + "type":"number", + "description":"Token sale end timestamp", + "example":1625076000 + }, + "startPrice":{ + "type":"number", + "description":"Token sale start price", + "example":1.5 + } + } + }, + "last24HoursVolumeResponse":{ + "type":"object", + "properties":{ + "TotalUSDValue":{ + "type":"number", + "description":"The total trade volume in terms of USD.", + "example":28751428.1231 + }, + "tokens":{ + "$ref":"#/definitions/collateralBalancesSchema" + }, + "symbols":{ + "$ref":"#/definitions/collateralBalancesSchema" + }, + "startDate":{ + "type":"string", + "description":"The start date and time for the volume presented.", + "example":"2020-05-22T03:11:29.014Z" + } + } + }, + "Model17":{ + "type":"object", + "properties":{ + "volume":{ + "type":"number", + "description":"token swap volume." + } + } + }, + "tokenRankingResponse":{ + "type":"object", + "properties":{ + "address":{ + "type":"string", + "description":"The address of the trader.", + "example":"0xfc898b18a70ce49579f8d79a32e29928c15b4bc8" + }, + "amount":{ + "type":"number", + "description":"The trading volume for the address", + "example":852.9290936325145 + } + } + }, + "totalValueLockedResponseItem":{ + "type":"object", + "properties":{ + "date":{ + "type":"string", + "format":"date", + "description":"Date on which `value` represents TVL", + "example":"2021-08-12T16:57:12.869Z" + }, + "value":{ + "type":"number", + "description":"Total value locked for a particular date", + "example":421000 + } + } + }, + "totalValueLockedResponse":{ + "type":"array", + "items":{ + "$ref":"#/definitions/totalValueLockedResponseItem" + } + }, + "Model18":{ + "type":"object", + "properties":{ + "count":{ + "type":"number", + "description":"Trades executed within time." + } + } + }, + "Model19":{ + "type":"object", + "properties":{ + "volume":{ + "type":"number", + "description":"token transfer volume." + } + } + }, + "vaultIdAndStarkKeyResponse":{ + "type":"object", + "properties":{ + "vaultId":{ + "type":"number", + "description":"The vault ID corresponding to the user registered with and token", + "example":1644016910 + }, + "starkKey":{ + "type":"string", + "description":"The public stark key for the user registered with ", + "example":"0x0180fc633b754b50370614a587218cf36a4fa7c2f11d65ec761dded48a81ab9e", + "pattern":"^0x[a-f0-9]+$" + } + } + }, + "votingPowerResponse":{ + "type":"object", + "properties":{ + "totalSupply":{ + "type":"string", + "description":"Total xDVF balance of users on exchange", + "example":"321000000" + }, + "votingPower":{ + "type":"number", + "description":"Percentage of amount compared to total balance", + "example":13.37 + } + } + }, + "Model20":{ + "type":"object", + "properties":{ + "isRegisteredOnDeversifi":{ + "type":"boolean", + "description":"Whether the user is registered on DeversiFi servers.", + "example":true, + "enum":[ + true, + false + ] + }, + "isRegisteredOnChain":{ + "type":"boolean", + "description":"Whether the user is registered with Starkware.", + "example":true, + "enum":[ + true, + false + ] + }, + "ethAddress":{ + "type":"string", + "description":"Ethereum address.", + "example":"0x3f2b822E9A8312C6DafBF9686a5e335Af0E4D33B" + } + }, + "required":[ + "isRegisteredOnDeversifi", + "isRegisteredOnChain", + "ethAddress" + ] + }, + "Model21":{ + "type":"object", + "properties":{ + "fillAmount":{ + "type":"number", + "description":"amount filled" + }, + "user":{ + "type":"string", + "description":"User ETH address" + }, + "date":{ + "type":"string", + "format":"date", + "description":"Date of the settlement" + }, + "tokenBuy":{ + "type":"string", + "description":"Buy token" + }, + "tokenSell":{ + "type":"string", + "description":"Sell token" + }, + "amountBuy":{ + "type":"string", + "description":"Amount of buy order" + }, + "amountSell":{ + "type":"string", + "description":"Amount of sell order" + }, + "orderId":{ + "type":"string", + "description":"Id of the order" + }, + "feeCurrency":{ + "type":"string", + "description":"Currency of the fee" + }, + "feeAmount":{ + "type":"string", + "description":"Amount of fee" + } + } + }, + "Model22":{ + "type":"array", + "items":{ + "$ref":"#/definitions/Model21" + } + }, + "Model23":{ + "type":"object", + "properties":{ + "items":{ + "$ref":"#/definitions/Model22" + } + } + }, + "tradesObject":{ + "type":"object", + "properties":{ + "trade_id":{ + "type":"number", + "description":"A unique ID associated with the trade for the currency pair transaction", + "example":1 + }, + "price":{ + "type":"number", + "description":"Last transacted price of base currency based on given quote currency.", + "example":275.23 + }, + "base_volume":{ + "type":"number", + "description":"Transaction amount in BASE currency.", + "example":1.5 + }, + "quote_volume":{ + "type":"number", + "description":"Transaction amount in QUOTE currency.", + "example":347.81 + }, + "timestamp":{ + "type":"number", + "description":"Unix timestamp in milliseconds for when the transaction occurred.", + "example":1747384800000 + }, + "type":{ + "type":"string", + "description":"Used to determine whether or not the transaction originated as a buy or sell.", + "example":"buy" + } + } + }, + "tradesResponse":{ + "type":"array", + "items":{ + "$ref":"#/definitions/tradesObject" + } + }, + "24HoursVolumeResponse":{ + "type":"object", + "properties":{ + "TotalUSDValue":{ + "type":"number", + "description":"The total trade volume in terms of USD.", + "example":3320.75 + }, + "tokens":{ + "$ref":"#/definitions/collateralBalancesSchema" + }, + "startDate":{ + "type":"string", + "description":"The start date and time for the volume presented.", + "example":"2020-01-01T00:00:00.714Z" + }, + "endDate":{ + "type":"string", + "description":"The end date and time for the volume presented.", + "example":"2020-01-01T00:00:00.714Z" + } + } + }, + "Model24":{ + "type":"object", + "properties":{ + "trade_id":{ + "type":"number", + "description":"A unique ID associated with the trade for the currency pair transaction", + "example":1 + }, + "price":{ + "type":"number", + "description":"Last transacted price of base currency based on given quote currency.", + "example":275.23 + }, + "base_volume":{ + "type":"number", + "description":"Transaction amount in BASE currency.", + "example":1.5 + }, + "quote_volume":{ + "type":"number", + "description":"Transaction amount in QUOTE currency.", + "example":347.81 + }, + "timestamp":{ + "type":"number", + "description":"Unix timestamp in milliseconds for when the transaction occurred.", + "example":1548028800 + }, + "type":{ + "type":"string", + "description":"Used to determine whether or not the transaction originated as a buy or sell.", + "example":"buy" + } + } + }, + "Model25":{ + "type":"array", + "items":{ + "$ref":"#/definitions/Model24" + } + }, + "bridgedDepositsPostPayload":{ + "type":"object", + "properties":{ + "token":{ + "type":"string", + "example":"ETH" + }, + "amount":{ + "type":"string", + "description":"quantised amount of the token to be undefined", + "example":"10000000" + }, + "txHash":{ + "type":"string", + "description":"Transaction Hash of the corresponding Ethereum transaction", + "example":"0xeef10fc5170f669b86c4cd0444882a96087221325f8bf2f55d6188633aa7be7c", + "pattern":"^0x[a-f0-9]+$", + "x-constraint":{ + "length":66 + } + }, + "chain":{ + "type":"string", + "example":"MATIC_POS", + "enum":[ + "MATIC_POS" + ] + } + } + }, + "bridgedDepositsPostResponse":{ + "type":"object", + "properties":{ + "_id":{ + "type":"string", + "example":"FEHn8HYEQQw" + }, + "createdAt":{ + "type":"string", + "format":"date", + "description":"The date (ISO 8601) at which bridgedDeposit was created.", + "example":"2020-05-13T14:11:02.205Z" + }, + "updatedAt":{ + "type":"string", + "format":"date", + "description":"The date (ISO 8601) at which bridgedDeposit was last updated.", + "example":"2020-05-13T14:13:10.403Z" + }, + "token":{ + "type":"string", + "example":"ETH" + }, + "amount":{ + "type":"string", + "description":"quantised amount of the token to be undefined", + "example":"10000000" + }, + "pending":{ + "type":"boolean", + "example":true + }, + "expiresAt":{ + "type":"string", + "format":"date", + "example":"2021-08-12T17:02:15.857Z" + }, + "txHash":{ + "type":"string", + "description":"Transaction Hash of the corresponding Ethereum transaction", + "example":"0xeef10fc5170f669b86c4cd0444882a96087221325f8bf2f55d6188633aa7be7c", + "pattern":"^0x[a-f0-9]+$", + "x-constraint":{ + "length":66 + } + }, + "chain":{ + "type":"string", + "example":"MATIC_POS", + "enum":[ + "MATIC_POS" + ] + } + } + }, + "signature":{ + "type":"object", + "properties":{ + "r":{ + "type":"string", + "pattern":"^0x[a-f0-9]+$" + }, + "s":{ + "type":"string", + "pattern":"^0x[a-f0-9]+$" + } + } + }, + "tx":{ + "type":"object", + "description":"StarkWare TansferRequest from the user to DeversiFi", + "properties":{ + "type":{ + "type":"string", + "enum":[ + "TransferRequest" + ] + }, + "amount":{ + "type":"string", + "pattern":"^[0-9]*$" + }, + "expirationTimestamp":{ + "type":"integer", + "minimum":0 + }, + "nonce":{ + "type":"integer", + "minimum":0 + }, + "receiverPublicKey":{ + "type":"string", + "pattern":"^0x[a-f0-9]+$" + }, + "receiverVaultId":{ + "type":"integer" + }, + "senderPublicKey":{ + "type":"string", + "pattern":"^0x[a-f0-9]+$" + }, + "senderVaultId":{ + "type":"integer" + }, + "signature":{ + "$ref":"#/definitions/signature" + }, + "token":{ + "type":"string", + "pattern":"^0x[a-f0-9]+$" + } + } + }, + "bridgedWithdrawalsPostPayload":{ + "type":"object", + "properties":{ + "token":{ + "type":"string", + "example":"ETH" + }, + "amount":{ + "type":"string", + "description":"quantised amount of the token to be undefined", + "example":"10000000" + }, + "nonce":{ + "type":"integer", + "description":"Used to prevent creation of duplicate withdrawal if the request is retried with the same payload. withdrawal are be uniquely identified by a combination of user, token, amount and nonce.", + "example":976614084, + "minimum":0 + }, + "chain":{ + "type":"string", + "example":"MATIC_POS", + "enum":[ + "MATIC_POS" + ] + }, + "tx":{ + "$ref":"#/definitions/tx" + } + } + }, + "onChain":{ + "type":"object", + "properties":{ + "amount":{ + "type":"string", + "description":"Amount which recipient will receive on chain.", + "example":"1000", + "pattern":"^[0-9]*$" + }, + "submittedAt":{ + "type":"string", + "format":"date", + "description":"Date at which withdrawal has been sent on chain.", + "example":"2020-01-29T14:13:05.898Z" + } + } + }, + "fastWithdrawalData":{ + "type":"object", + "properties":{ + "transactionFee":{ + "type":"string", + "description":"fee to paid by the user in the currency of the transaction (quantised units).", + "example":"1", + "pattern":"^[0-9]*$" + }, + "recipientEthAddress":{ + "type":"string", + "description":"Ethereum address of recipient who will receive funds on chain.", + "example":"0x948cd3ad67c5f21412bfcd07a7981322f9fa01f0" + }, + "onChain":{ + "$ref":"#/definitions/onChain" + } + } + }, + "bridgedWithdrawalsPostResponse":{ + "type":"object", + "properties":{ + "_id":{ + "type":"string", + "example":"FEHn8HYEQQw" + }, + "createdAt":{ + "type":"string", + "format":"date", + "description":"The date (ISO 8601) at which bridgedWithdrawal was created.", + "example":"2020-05-13T14:11:02.205Z" + }, + "updatedAt":{ + "type":"string", + "format":"date", + "description":"The date (ISO 8601) at which bridgedWithdrawal was last updated.", + "example":"2020-05-13T14:13:10.403Z" + }, + "token":{ + "type":"string", + "example":"ETH" + }, + "amount":{ + "type":"string", + "description":"quantised amount of the token to be undefined", + "example":"10000000" + }, + "readyToWithdrawOnChain":{ + "type":"boolean", + "example":true + }, + "nonce":{ + "type":"integer", + "description":"Used to prevent creation of duplicate withdrawal if the request is retried with the same payload. withdrawal are be uniquely identified by a combination of user, token, amount and nonce.", + "example":976614084, + "minimum":0 + }, + "fastWithdrawalData":{ + "$ref":"#/definitions/fastWithdrawalData" + }, + "chain":{ + "type":"string", + "example":"MATIC_POS", + "enum":[ + "MATIC_POS" + ] + } + } + }, + "depositsPostPayload":{ + "type":"object", + "properties":{ + "token":{ + "type":"string", + "example":"ETH" + }, + "amount":{ + "type":"string", + "description":"quantised amount of the token to be deposited", + "example":"10000000" + }, + "txHash":{ + "type":"string", + "description":"Transaction Hash of the corresponding Ethereum transaction", + "example":"0xeef10fc5170f669b86c4cd0444882a96087221325f8bf2f55d6188633aa7be7c", + "pattern":"^0x[a-f0-9]+$", + "x-constraint":{ + "length":66 + } + } + } + }, + "Model26":{ + "type":"object", + "description":"Parameters of the Stark transaction created by this request.", + "properties":{ + "starkKey":{ + "type":"string", + "description":"Stark key of the owner of the destination vault", + "example":"0x1a2b3c", + "pattern":"^0x[a-f0-9]+$" + }, + "tokenId":{ + "type":"string", + "description":"Stark token id corresponding to the token being deposited.", + "example":"0xa1b2c3", + "pattern":"^0x[a-f0-9]+$" + }, + "vaultId":{ + "type":"number", + "description":"Stark vault id to which the funds will be deposited.", + "example":123 + }, + "amount":{ + "type":"string", + "description":"quantised amount of the token to be deposited", + "example":"10000000" + } + } + }, + "depositsPostResponse":{ + "type":"object", + "properties":{ + "_id":{ + "type":"string", + "example":"FEHn8HYEQQw" + }, + "createdAt":{ + "type":"string", + "format":"date", + "description":"The date (ISO 8601) at which deposit was created.", + "example":"2020-05-13T14:11:02.205Z" + }, + "updatedAt":{ + "type":"string", + "format":"date", + "description":"The date (ISO 8601) at which deposit was last updated.", + "example":"2020-05-13T14:13:10.403Z" + }, + "token":{ + "type":"string", + "example":"ETH" + }, + "amount":{ + "type":"string", + "description":"quantised amount of the token to be deposited", + "example":"10000000" + }, + "pending":{ + "type":"boolean", + "example":true + }, + "expiresAt":{ + "type":"string", + "format":"date", + "example":"2021-08-12T17:12:18.058Z" + }, + "txHash":{ + "type":"string", + "description":"Transaction Hash of the corresponding Ethereum transaction", + "example":"0xeef10fc5170f669b86c4cd0444882a96087221325f8bf2f55d6188633aa7be7c", + "pattern":"^0x[a-f0-9]+$", + "x-constraint":{ + "length":66 + } + }, + "tx":{ + "$ref":"#/definitions/Model26" + } + } + }, + "deposits-validatePostPayload":{ + "type":"object", + "properties":{ + "token":{ + "type":"string", + "example":"ETH" + }, + "amount":{ + "type":"string", + "description":"quantised amount of the token to be undefined", + "example":"10000000" + } + } + }, + "deposits-validatePostResponse":{ + "type":"object", + "properties":{ + "token":{ + "type":"string", + "example":"ETH" + }, + "amount":{ + "type":"string", + "description":"quantised amount of the token to be undefined", + "example":"10000000" + }, + "starkKey":{ + "type":"string", + "description":"Stark key of the owner of the destination vault", + "example":"0x1a2b3c", + "pattern":"^0x[a-f0-9]+$" + }, + "tokenId":{ + "type":"string", + "description":"Stark token id corresponding to the token being deposited.", + "example":"0xa1b2c3", + "pattern":"^0x[a-f0-9]+$" + }, + "vaultId":{ + "type":"number", + "description":"Stark vault id to which the funds will be deposited.", + "example":123 + } + } + }, + "withdrawalsPostPayload":{ + "type":"object", + "properties":{ + "token":{ + "type":"string", + "example":"ETH" + }, + "amount":{ + "type":"string", + "description":"quantised amount of the token to be withdrawn", + "example":"10000000" + }, + "nonce":{ + "type":"integer", + "description":"Used to prevent creation of duplicate withdrawal if the request is retried with the same payload. withdrawal are be uniquely identified by a combination of user, token, amount and nonce.", + "example":976614084, + "minimum":0 + } + } + }, + "withdrawalsPostResponse":{ + "type":"object", + "properties":{ + "_id":{ + "type":"string", + "example":"FEHn8HYEQQw" + }, + "createdAt":{ + "type":"string", + "format":"date", + "description":"The date (ISO 8601) at which withdrawal was created.", + "example":"2020-05-13T14:11:02.205Z" + }, + "updatedAt":{ + "type":"string", + "format":"date", + "description":"The date (ISO 8601) at which withdrawal was last updated.", + "example":"2020-05-13T14:13:10.403Z" + }, + "token":{ + "type":"string", + "example":"ETH" + }, + "amount":{ + "type":"string", + "description":"quantised amount of the token to be withdrawn", + "example":"10000000" + }, + "readyToWithdrawOnChain":{ + "type":"boolean" + }, + "nonce":{ + "type":"integer", + "description":"Used to prevent creation of duplicate withdrawal if the request is retried with the same payload. withdrawal are be uniquely identified by a combination of user, token, amount and nonce.", + "example":976614084, + "minimum":0 + } + } + }, + "starkPublicKey":{ + "type":"object", + "description":"The Stark public key. Both the \"x\" and \"y\" part are required.", + "example":{ + "x":"0746919ecbb54563de512f6fb556c21dab091748b41a60a946dbdbf118ac0a85", + "y":"58f7ce5eb6eb5bd24f70394622b1f4d2c54ebca317a3e61bf9f349dccf166cf" + }, + "properties":{ + "x":{ + "type":"string", + "description":"The \"x\" part of the Stark public key.", + "minLength":64, + "maxLength":64, + "x-format":{ + "hex":{ + "byteAligned":false + } + } + }, + "y":{ + "type":"string", + "description":"The \"y\" part of the Stark public key.", + "x-format":{ + "hex":{ + "byteAligned":false + } + } + } + }, + "required":[ + "x", + "y" + ] + }, + "Model27":{ + "type":"object", + "description":"Stark signature consisting of consisting of \"r\" and \"s\"", + "example":{ + "v":"3b46dfe03caef623048fedc8457a92385cd63eff6349ad135c945cd84937677", + "r":"1f38f551d798562c16d28733c7e3ff6850898d82f0ac9ccd39d373303b1778c", + "s":"518560420e52a37e9f580f024fc0fe8572cb2f5437a839075bbf4b2b123d572" + }, + "properties":{ + "v":{ + "type":"string", + "description":"The \"v\" part of the Stark signature." + }, + "r":{ + "type":"string", + "description":"The \"r\" part of the Stark signature." + }, + "s":{ + "type":"string", + "description":"The \"s\" part of the Stark signature." + } + }, + "required":[ + "r", + "s" + ] + }, + "Model28":{ + "type":"object", + "description":"Stark Limit Order Object.", + "example":{ + "vaultIdSell":1000002, + "vaultIdBuy":1000001, + "amountSell":"97400000", + "amountBuy":"100000000000000000", + "tokenSell":"0x2", + "tokenBuy":"0x1" + }, + "properties":{ + "vaultIdSell":{ + "type":"integer", + "description":"The vault ID of the seller.", + "minimum":0 + }, + "vaultIdBuy":{ + "type":"integer", + "description":"The vault ID of the buyer.", + "minimum":0 + }, + "amountSell":{ + "type":"string", + "description":"The total amount to be sold." + }, + "amountBuy":{ + "type":"string", + "description":"The total amount to be bought." + }, + "tokenSell":{ + "type":"string", + "description":"The Stark token ID for the token being sold." + }, + "tokenBuy":{ + "type":"string", + "description":"The Stark token ID for the token being bought." + }, + "nonce":{ + "type":"integer", + "description":"Used make identical stark transactions unique.", + "minimum":0, + "maximum":2147483647 + }, + "expirationTimestamp":{ + "type":"integer", + "description":"Expiration timestamp of the order.", + "minimum":0 + }, + "signature":{ + "$ref":"#/definitions/Model27" + } + } + }, + "Model29":{ + "type":"object", + "properties":{ + "starkOrder":{ + "$ref":"#/definitions/Model28" + } + } + }, + "Model30":{ + "type":"array", + "example":[ + { + "starkOrder":{ + "tokenBuy":"0x11af21d6b234cd669edd702dd3d1d017be888337010b950ae3679eb4194b4bc", + "amountBuy":"5000000000", + "vaultIdBuy":247827906, + "tokenSell":"0xb333e3142fe16b78628f19bb15afddaef437e72d6d7f5c6c20c6801a27fba6", + "amountSell":"200000000", + "vaultIdSell":2121602419, + "nonce":1079618848, + "expirationTimestamp":455582, + "signature":{ + "r":"0x2857ca21310ab87bb7c37ebad0e7166f1fb46e43cf32d6587a31e148d44b677", + "s":"0x45e939717a6de4ad5e79993d918bb40e629760da7a04062e965394d1d14106a" + } + } + }, + { + "starkOrder":{ + "tokenBuy":"0x11af21d6b234cd669edd702dd3d1d017be888337010b950ae3679eb4194b4bc", + "amountBuy":"5000000000", + "vaultIdBuy":247827906, + "tokenSell":"0xb333e3142fe16b78628f19bb15afddaef437e72d6d7f5c6c20c6801a27fba6", + "amountSell":"200000000", + "vaultIdSell":2121602419, + "nonce":1079618848, + "expirationTimestamp":455582, + "signature":{ + "r":"0x2857ca21310ab87bb7c37ebad0e7166f1fb46e43cf32d6587a31e148d44b677", + "s":"0x45e939717a6de4ad5e79993d918bb40e629760da7a04062e965394d1d14106a" + } + } + } + ], + "x-constraint":{ + "length":2 + }, + "items":{ + "$ref":"#/definitions/Model29" + } + }, + "AmmFundingOrdersPostPayload":{ + "type":"object", + "properties":{ + "pool":{ + "type":"string", + "example":"ETH:USDT" + }, + "starkPublicKey":{ + "$ref":"#/definitions/starkPublicKey" + }, + "orders":{ + "$ref":"#/definitions/Model30" + } + } + }, + "fill":{ + "type":"object", + "properties":{ + "amountBuy":{ + "type":"string" + }, + "amountSell":{ + "type":"string" + } + } + }, + "Model31":{ + "type":"object", + "properties":{ + "amountBuy":{ + "type":"string" + }, + "amountSell":{ + "type":"string" + }, + "fill":{ + "$ref":"#/definitions/fill" + }, + "starkOrder":{ + "$ref":"#/definitions/Model28" + }, + "tokenBuy":{ + "type":"string" + }, + "tokenSell":{ + "type":"string" + } + } + }, + "Model32":{ + "type":"array", + "x-constraint":{ + "length":2 + }, + "items":{ + "$ref":"#/definitions/Model31" + } + }, + "AmmFundingOrdersPostResponse":{ + "type":"object", + "example":{ + "_id":"L5QTNJtb2yF-GYa1NFCy1p5", + "closedAt":"2020-05-13T14:11:02.205Z", + "failed":false, + "pending":true, + "pool":"ETHUSDT", + "type":"Deposit", + "user":"0x948cd3ad67c5f21412bfcd07a7981322f9fa01f0", + "orders":[ + { + "tokenBuy":"LP-ETHUSDT", + "amountBuy":"50", + "tokenSell":"ETH", + "amountSell":"2", + "fill":{ + "amountBuy":"45", + "amountSell":"1" + }, + "starkOrder":{ + "tokenBuy":"0x11af21d6b234cd669edd702dd3d1d017be888337010b950ae3679eb4194b4bc", + "amountBuy":"5000000000", + "vaultIdBuy":247827906, + "tokenSell":"0xb333e3142fe16b78628f19bb15afddaef437e72d6d7f5c6c20c6801a27fba6", + "amountSell":"200000000", + "vaultIdSell":2121602419, + "nonce":1079618848, + "expirationTimestamp":455582, + "signature":{ + "r":"0x2857ca21310ab87bb7c37ebad0e7166f1fb46e43cf32d6587a31e148d44b677", + "s":"0x45e939717a6de4ad5e79993d918bb40e629760da7a04062e965394d1d14106a" + } + } + }, + { + "tokenBuy":"LP-ETHUSDT", + "amountBuy":"50", + "tokenSell":"USDT", + "amountSell":"1230", + "fill":{ + "amountBuy":"48", + "amountSell":"1220" + }, + "starkOrder":{ + "tokenBuy":"0x11af21d6b234cd669edd702dd3d1d017be888337010b950ae3679eb4194b4bc", + "amountBuy":"5000000000", + "vaultIdBuy":247827906, + "tokenSell":"0xb333e3142fe16b78628f19bb15afddaef437e72d6d7f5c6c20c6801a27fba6", + "amountSell":"200000000", + "vaultIdSell":2121602419, + "nonce":1079618848, + "expirationTimestamp":455582, + "signature":{ + "r":"0x2857ca21310ab87bb7c37ebad0e7166f1fb46e43cf32d6587a31e148d44b677", + "s":"0x45e939717a6de4ad5e79993d918bb40e629760da7a04062e965394d1d14106a" + } + } + } + ], + "starkPublicKey":{ + "x":"0746919ecbb54563de512f6fb556c21dab091748b41a60a946dbdbf118ac0a85", + "y":"690890d33f62e706b80d214546ab3fd063fad5893d990df876bafae113be981" + }, + "createdAt":"2020-05-13T14:11:02.205Z", + "updatedAt":"2020-05-13T14:13:10.403Z" + }, + "properties":{ + "pool":{ + "type":"string", + "example":"ETH:USDT" + }, + "starkPublicKey":{ + "$ref":"#/definitions/starkPublicKey" + }, + "_id":{ + "type":"string" + }, + "closedAt":{ + "type":"string", + "format":"date" + }, + "failed":{ + "type":"boolean" + }, + "pending":{ + "type":"boolean" + }, + "type":{ + "type":"string", + "enum":[ + "Deposit", + "Withdrawal" + ] + }, + "user":{ + "type":"string" + }, + "orders":{ + "$ref":"#/definitions/Model32" + }, + "createdAt":{ + "type":"string", + "format":"date", + "description":"The date (ISO 8601) at which AmmFundingOrder was created.", + "example":"2020-05-13T14:11:02.205Z" + }, + "updatedAt":{ + "type":"string", + "format":"date", + "description":"The date (ISO 8601) at which AmmFundingOrder was last updated.", + "example":"2020-05-13T14:13:10.403Z" + } + } + }, + "Model33":{ + "type":"object", + "properties":{ + "user":{ + "type":"string" + }, + "token":{ + "type":"string", + "description":"token for the airdrop", + "example":"DVF" + }, + "amount":{ + "type":"string", + "description":"Amount of token to give in standard format" + } + } + }, + "airdrops":{ + "type":"array", + "items":{ + "$ref":"#/definitions/Model33" + } + }, + "addAirdropRequestSchema":{ + "type":"object", + "properties":{ + "nonce":{ + "type":"string", + "description":"This nonce which used to provide the time until which this nonce is valid. It is presented as seconds since epoch.", + "example":"v2-1704114061.000" + }, + "signature":{ + "type":"string", + "description":"The signature obtained by signing the nonce with your private ethereum key.", + "example":"0x2b48d53f2e3a696630ebdcd1ff057556bbc9de9c294adfaa5b1f13df91b67b347fdd88c29594c377ba0024dec40cd9808829e7f4447772482f50a7a8e9a903561c" + }, + "airdrops":{ + "$ref":"#/definitions/airdrops" + } + } + }, + "Model34":{ + "type":"object", + "properties":{ + "user":{ + "type":"string", + "description":"Ethereum address", + "example":"0x08152c1265dbc218ccc8ab5c574e6bd52279b3b7" + }, + "token":{ + "type":"string", + "description":"token for the airdrop", + "example":"DVF" + }, + "amount":{ + "type":"string", + "description":"DVF airdrop eligible amount", + "example":"15.52" + } + } + }, + "addAirdropResponseSchema":{ + "type":"array", + "items":{ + "$ref":"#/definitions/Model34" + } + }, + "fields":{ + "type":"array", + "description":"Specific fields to be returned for balance information", + "example":[ + "balance", + "updatedAt" + ], + "items":{ + "type":"string", + "enum":[ + "balance", + "available", + "locked", + "updatedAt" + ] + } + }, + "getBalancePayload":{ + "type":"object", + "properties":{ + "nonce":{ + "type":"string", + "description":"This nonce which used to provide the time until which this nonce is valid. It is presented as seconds since epoch.", + "example":"v2-1704114061.000" + }, + "signature":{ + "type":"string", + "description":"The signature obtained by signing the nonce with your private ethereum key.", + "example":"0x2b48d53f2e3a696630ebdcd1ff057556bbc9de9c294adfaa5b1f13df91b67b347fdd88c29594c377ba0024dec40cd9808829e7f4447772482f50a7a8e9a903561c" + }, + "token":{ + "type":"string", + "description":"The token which the balance is specifically requested for.", + "example":"ETH" + }, + "fields":{ + "$ref":"#/definitions/fields" + } + } + }, + "Model35":{ + "type":"object", + "properties":{ + "token":{ + "type":"string", + "description":"The token for which the balances are provided.", + "example":"ETH" + }, + "balance":{ + "type":"number", + "description":"It is the total balance for the user corresponding to the specified token.", + "example":42 + }, + "available":{ + "type":"number", + "description":"It is the part of the balance available for use.", + "example":23 + }, + "locked":{ + "type":"number", + "description":"It is the part of the balance currently in open orders or pending withdrawal.", + "example":19 + } + } + }, + "getBalanceResponse":{ + "type":"array", + "items":{ + "$ref":"#/definitions/Model35" + } + }, + "getDepositsPayload":{ + "type":"object", + "properties":{ + "nonce":{ + "type":"string", + "description":"This nonce which used to provide the time until which this nonce is valid. It is presented as seconds since epoch.", + "example":"v2-1704114061.000" + }, + "signature":{ + "type":"string", + "description":"The signature obtained by signing the nonce with your private ethereum key.", + "example":"0x2b48d53f2e3a696630ebdcd1ff057556bbc9de9c294adfaa5b1f13df91b67b347fdd88c29594c377ba0024dec40cd9808829e7f4447772482f50a7a8e9a903561c" + }, + "token":{ + "type":"string", + "description":"The token which the balance is specifically requested for.", + "example":"ETH" + } + } + }, + "getDepositsResponse":{ + "type":"object", + "properties":{ + "ethAddress":{ + "type":"string", + "description":"The ethereum public address of the user.", + "example":"0x341E46a49F15785373edE443Df0220DEa6a41Bbc" + }, + "starkKey":{ + "type":"string", + "description":"The Stark public key.", + "example":"77a3b314db07c45076d11f62b6f9e748a39790441823307743cf00d6597ea43" + }, + "starkVaultId":{ + "type":"number", + "description":"The Stark vault ID.", + "example":123 + }, + "starkTokenId":{ + "type":"string", + "description":"The Stark token ID.", + "example":"0x7" + }, + "token":{ + "type":"string", + "description":"The token that was deposited", + "example":"NEC" + }, + "amount":{ + "type":"number", + "description":"The amount that was deposited.", + "example":1000 + }, + "createdAt":{ + "type":"string", + "description":"The date and time of the deposit.", + "example":"2020-01-29T14:02:08.477Z" + }, + "isPostedOffchain":{ + "type":"boolean", + "description":"Flag to indicate if the deposit was posted off chain.", + "example":false + }, + "isConfirmedOnChain":{ + "type":"boolean", + "description":"Flag to indicate if the deposit was confirmed off chain.", + "example":true + } + } + }, + "getOrderPayload":{ + "type":"object", + "properties":{ + "nonce":{ + "type":"string", + "description":"This nonce which used to provide the time until which this nonce is valid. It is presented as seconds since epoch.", + "example":"v2-1704114061.000" + }, + "signature":{ + "type":"string", + "description":"The signature obtained by signing the nonce with your private ethereum key.", + "example":"0x2b48d53f2e3a696630ebdcd1ff057556bbc9de9c294adfaa5b1f13df91b67b347fdd88c29594c377ba0024dec40cd9808829e7f4447772482f50a7a8e9a903561c" + }, + "orderId":{ + "type":"string", + "description":"The order ID.", + "example":"d7c8b9" + }, + "cid":{ + "type":"string", + "description":"An optional user-defined identifier for this order", + "example":"satoshi-order-2083236893" + } + } + }, + "getOrderResponse":{ + "type":"object", + "properties":{ + "_id":{ + "type":"string", + "description":"Id for the order. This can be used for orderId when calling cancelOrder or getOrder", + "example":"L1tarX5wUem" + }, + "amount":{ + "type":"string", + "description":"Original order size placed.", + "example":"-0.15" + }, + "totalFilled":{ + "type":"number", + "description":"Total of all fills executed.", + "example":"-0.15" + }, + "price":{ + "type":"string", + "description":"Cost per unit.", + "example":"250" + }, + "symbol":{ + "type":"string", + "description":"Trading symbol for the order", + "example":"ETH:USDT" + }, + "active":{ + "type":"boolean", + "description":"Active status true or false.", + "example":false + }, + "canceled":{ + "type":"boolean", + "description":"Canceled status true or false.", + "example":false + }, + "pending":{ + "type":"boolean", + "description":"Pending status true or false.", + "example":false + }, + "cid":{ + "type":"string", + "description":"An optional user-defined identifier for this order", + "example":"satoshi-order-2083236893" + } + } + }, + "getPendingWithdrawalsPayload":{ + "type":"object", + "properties":{ + "nonce":{ + "type":"string", + "description":"This nonce which used to provide the time until which this nonce is valid. It is presented as seconds since epoch.", + "example":"v2-1704114061.000" + }, + "signature":{ + "type":"string", + "description":"The signature obtained by signing the nonce with your private ethereum key.", + "example":"0x2b48d53f2e3a696630ebdcd1ff057556bbc9de9c294adfaa5b1f13df91b67b347fdd88c29594c377ba0024dec40cd9808829e7f4447772482f50a7a8e9a903561c" + }, + "token":{ + "type":"string" + } + } + }, + "authPayload":{ + "type":"object", + "properties":{ + "nonce":{ + "type":"string", + "description":"This nonce which used to provide the time until which this nonce is valid. It is presented as seconds since epoch.", + "example":"v2-1704114061.000" + }, + "signature":{ + "type":"string", + "description":"The signature obtained by signing the nonce with your private ethereum key.", + "example":"0x2b48d53f2e3a696630ebdcd1ff057556bbc9de9c294adfaa5b1f13df91b67b347fdd88c29594c377ba0024dec40cd9808829e7f4447772482f50a7a8e9a903561c" + } + } + }, + "Model36":{ + "type":"object", + "properties":{ + "balances":{ + "type":"boolean", + "description":"is balances authorized" + }, + "tradingHistory":{ + "type":"boolean", + "description":"is trading history authorized" + } + } + }, + "Model37":{ + "type":"object", + "description":"This contains application configuration details to set up for deposits and trading.", + "example":{ + "defaultFeeRate":0.002, + "deversifiAddress":"0x9ab450355b4ab504cbc0e4de484781dac08e6a26", + "starkExContractAddress":"0xF3731d0cdC9834f6F32104580bD226EF1bc1A9F9", + "exchangeSymbols":"[\"ETH:USDT\",\"ZRX:USDT\",\"ZRX:ETH\"]", + "newMarkets":[ + "ZRX:USDT", + "ZRX:ETH" + ], + "tempStarkVaultId":1 + }, + "properties":{ + "defaultFeeRate":{ + "type":"number", + "description":"The default fee rate, if no volume or maker discount." + }, + "deversifiAddress":{ + "type":"string", + "description":"The address of the DeversiFi exchange." + }, + "starkExContractAddress":{ + "type":"string", + "description":"Stark deposit contract address." + }, + "exchangeSymbols":{ + "type":"string", + "description":"Currency pairs available at the DeversiFi exchange for trading" + }, + "newMarkets":{ + "$ref":"#/definitions/newMarkets" + }, + "tempStarkVaultId":{ + "type":"number", + "description":"Transit Stark vault ID used for deposit privacy" + } + } + }, + "getUserConfResponse":{ + "type":"object", + "properties":{ + "DVF":{ + "$ref":"#/definitions/Model37" + }, + "tokenRegistry":{ + "$ref":"#/definitions/collateralBalancesSchema" + }, + "isRegistered":{ + "type":"string", + "description":"Registration status.", + "example":"true" + }, + "isRegisteredOnChain":{ + "type":"boolean", + "description":"Whether the user is registered with Starkware.", + "example":true, + "enum":[ + true, + false + ] + }, + "allowance":{ + "$ref":"#/definitions/getAllowanceResponse" + }, + "ethAddress":{ + "type":"string", + "description":"Ethereum address.", + "example":"0x278ff3bb25c5b1bb7032e822661974479280fa74" + }, + "starkKeyHex":{ + "type":"string", + "description":"Stark Public key as hex string.", + "example":"0x011869c13b32ab9b7ec84e2b31c1de58baaaa6bbb2443a33bbad8df739a6e957" + } + } + }, + "getVaultIdPayload":{ + "type":"object", + "properties":{ + "nonce":{ + "type":"string", + "description":"This nonce which used to provide the time until which this nonce is valid. It is presented as seconds since epoch.", + "example":"v2-1704114061.000" + }, + "signature":{ + "type":"string", + "description":"The signature obtained by signing the nonce with your private ethereum key.", + "example":"0x2b48d53f2e3a696630ebdcd1ff057556bbc9de9c294adfaa5b1f13df91b67b347fdd88c29594c377ba0024dec40cd9808829e7f4447772482f50a7a8e9a903561c" + }, + "token":{ + "type":"string", + "description":"The new token for which a new vault Id needs to be allocated.", + "example":"DAI" + } + }, + "required":[ + "token" + ] + }, + "getWithdrawalPayload":{ + "type":"object", + "properties":{ + "nonce":{ + "type":"string", + "description":"This nonce which used to provide the time until which this nonce is valid. It is presented as seconds since epoch.", + "example":"v2-1704114061.000" + }, + "signature":{ + "type":"string", + "description":"The signature obtained by signing the nonce with your private ethereum key.", + "example":"0x2b48d53f2e3a696630ebdcd1ff057556bbc9de9c294adfaa5b1f13df91b67b347fdd88c29594c377ba0024dec40cd9808829e7f4447772482f50a7a8e9a903561c" + }, + "withdrawalId":{ + "type":"string", + "description":"Used to identify a specific withdrawal.", + "example":"i6JjTE2PDL" + } + }, + "required":[ + "withdrawalId" + ] + }, + "withdrawHistoryObject":{ + "type":"object", + "properties":{ + "_id":{ + "type":"string", + "description":"Withdrawal ID.", + "example":"LCafcGC6tBH" + }, + "token":{ + "type":"string", + "description":"The token that was withdrawn.", + "example":"NEC" + }, + "amount":{ + "type":"string", + "description":"The amount that was withdrawn.", + "example":"100", + "pattern":"^[0-9]*$" + }, + "createdAt":{ + "type":"string", + "format":"date", + "description":"The date and time withdrawal request was received.", + "example":"2020-01-29T14:13:05.898Z" + }, + "readyToWithdrawOnChain":{ + "type":"boolean", + "description":"The withdrawal is ready to be requested.", + "example":true + }, + "canceled":{ + "type":"boolean", + "description":"The withdrawal has been canceled.", + "example":true + } + }, + "required":[ + "_id", + "token", + "createdAt", + "readyToWithdrawOnChain" + ] + }, + "Model38":{ + "type":"object", + "properties":{ + "hasReceived":{ + "type":"boolean", + "description":"Registration compensation was/not received.", + "example":true + }, + "date":{ + "type":"string", + "format":"date", + "description":"When was the compensation received", + "example":"2021-08-12T17:17:37.009Z" + } + } + }, + "openOrdersPayload":{ + "type":"object", + "properties":{ + "nonce":{ + "type":"string", + "description":"This nonce which used to provide the time until which this nonce is valid. It is presented as seconds since epoch.", + "example":"v2-1704114061.000" + }, + "signature":{ + "type":"string", + "description":"The signature obtained by signing the nonce with your private ethereum key.", + "example":"0x2b48d53f2e3a696630ebdcd1ff057556bbc9de9c294adfaa5b1f13df91b67b347fdd88c29594c377ba0024dec40cd9808829e7f4447772482f50a7a8e9a903561c" + }, + "symbol":{ + "type":"string", + "description":"Specifies the trading pair.", + "example":"ZRX:ETH" + } + } + }, + "openOrderResponseObject.js":{ + "type":"object", + "properties":{ + "_id":{ + "type":"string", + "description":"Order Id, this can be used as orderId when calling cancelOrder or getOrder.", + "example":"L1tarX5wUem" + }, + "user":{ + "type":"string", + "description":"Ethereum address of the user.", + "example":"0x341e46a49f15785373ede443df0220dea6a41bbc" + }, + "symbol":{ + "type":"string", + "description":"The trading pair symbol for this order.", + "example":"ZRX:ETH" + }, + "amount":{ + "type":"number", + "description":"Original order size placed.", + "example":50 + }, + "amountOrig":{ + "type":"number", + "description":"Same as amount, included for backward compatibility.", + "example":50 + }, + "totalFilled":{ + "type":"number", + "description":"Total of all fills executed.", + "example":50 + }, + "tokenBuy":{ + "type":"string", + "description":"Token being bought as part of this exchange order.", + "example":"ETH" + }, + "totalBought":{ + "type":"string", + "description":"Total tokens bought, in quantized units.", + "example":"4990000000", + "pattern":"^[0-9]*$" + }, + "tokenSell":{ + "type":"string", + "description":"Token being sold as part of this exchange order.", + "example":"ETH" + }, + "tokenSellLockedBalance":{ + "type":"string", + "description":"Amount of tokens to be sold, locked when order was submitted (quantized units).", + "example":"45555500", + "pattern":"^[0-9]*$" + }, + "totalSold":{ + "type":"string", + "description":"Total tokens sold, in quantized units.", + "example":"45555500", + "pattern":"^[0-9]*$" + }, + "type":{ + "type":"string", + "description":"Type of the order. Currently, \"EXCHANGE LIMIT\" is the only type that is supported.", + "example":"EXCHANGE LIMIT" + }, + "price":{ + "type":"number", + "description":"Cost per unit.", + "example":0.01 + }, + "averagePrice":{ + "type":"number", + "description":"Average price at which the order has been settled.", + "example":0.0091111 + }, + "feeRate":{ + "type":"number", + "description":"The max fee rate applicable for the order.", + "example":0.002 + }, + "createdAt":{ + "type":"string", + "format":"date", + "description":"The date and time when the order was created.", + "example":"2020-05-13T14:11:02.205Z" + }, + "updatedAt":{ + "type":"string", + "format":"date", + "description":"The date and time when the order was last updated.", + "example":"2020-05-13T14:13:10.403Z" + }, + "activatedAt":{ + "type":"string", + "format":"date", + "description":"The date and time when the order was activated.", + "example":"2020-05-13T14:11:03.000Z" + }, + "lastFillTime":{ + "type":"string", + "format":"date", + "description":"The date and time when the last fill occurred for this order.", + "example":"2020-05-13T14:13:18.000Z" + }, + "canceled":{ + "type":"boolean", + "description":"Canceled status true or false.", + "example":false + }, + "isPostOnly":{ + "type":"boolean", + "description":"Flag to indicate if the order is post-only.", + "example":false + }, + "isHidden":{ + "type":"boolean", + "description":"Flag to indicate if the order is hidden.", + "example":false + }, + "isFillOrKill":{ + "type":"boolean", + "description":"Flag to indicate if fill or kill order.", + "example":false + }, + "isSlippageDisabled":{ + "type":"boolean", + "description":"Flag to indicate if slippage protection is disabled.", + "example":false + }, + "partnerId":{ + "type":"string", + "description":"TODO", + "example":"P1" + }, + "cid":{ + "type":"string", + "description":"An optional user-defined identifier for this order", + "example":"satoshi-order-2083236893" + }, + "awaitingSettlement":{ + "type":"number", + "description":"TODO", + "example":10 + }, + "meta":{ + "$ref":"#/definitions/collateralBalancesSchema" + }, + "active":{ + "type":"boolean", + "description":"If false, the order has not been included in the order book yet.", + "example":false + } + }, + "required":[ + "_id", + "user", + "symbol", + "amount", + "amountOrig", + "tokenBuy", + "tokenSell", + "tokenSellLockedBalance", + "type", + "price", + "createdAt", + "updatedAt", + "active" + ] + }, + "openOrdersResponse":{ + "type":"array", + "items":{ + "$ref":"#/definitions/openOrderResponseObject.js" + } + }, + "orderHistoryPayload":{ + "type":"object", + "properties":{ + "nonce":{ + "type":"string", + "description":"This nonce which used to provide the time until which this nonce is valid. It is presented as seconds since epoch.", + "example":"v2-1704114061.000" + }, + "signature":{ + "type":"string", + "description":"The signature obtained by signing the nonce with your private ethereum key.", + "example":"0x2b48d53f2e3a696630ebdcd1ff057556bbc9de9c294adfaa5b1f13df91b67b347fdd88c29594c377ba0024dec40cd9808829e7f4447772482f50a7a8e9a903561c" + }, + "symbol":{ + "type":"string", + "description":"Specifies the trading pair.", + "example":"ETH:USDT" + } + } + }, + "closedOrderResponseObject":{ + "type":"object", + "properties":{ + "_id":{ + "type":"string", + "description":"Order Id, this can be used as orderId when calling cancelOrder or getOrder.", + "example":"L1tarX5wUem" + }, + "user":{ + "type":"string", + "description":"Ethereum address of the user.", + "example":"0x341e46a49f15785373ede443df0220dea6a41bbc" + }, + "symbol":{ + "type":"string", + "description":"The trading pair symbol for this order.", + "example":"ZRX:ETH" + }, + "amount":{ + "type":"number", + "description":"Original order size placed.", + "example":50 + }, + "amountOrig":{ + "type":"number", + "description":"Same as amount, included for backward compatibility.", + "example":50 + }, + "totalFilled":{ + "type":"number", + "description":"Total of all fills executed.", + "example":50 + }, + "tokenBuy":{ + "type":"string", + "description":"Token being bought as part of this exchange order.", + "example":"ETH" + }, + "totalBought":{ + "type":"string", + "description":"Total tokens bought, in quantized units.", + "example":"4990000000", + "pattern":"^[0-9]*$" + }, + "tokenSell":{ + "type":"string", + "description":"Token being sold as part of this exchange order.", + "example":"ETH" + }, + "tokenSellLockedBalance":{ + "type":"string", + "description":"Amount of tokens to be sold, locked when order was submitted (quantized units).", + "example":"45555500", + "pattern":"^[0-9]*$" + }, + "totalSold":{ + "type":"string", + "description":"Total tokens sold, in quantized units.", + "example":"45555500", + "pattern":"^[0-9]*$" + }, + "type":{ + "type":"string", + "description":"Type of the order. Currently, \"EXCHANGE LIMIT\" is the only type that is supported.", + "example":"EXCHANGE LIMIT" + }, + "price":{ + "type":"number", + "description":"Cost per unit.", + "example":0.01 + }, + "averagePrice":{ + "type":"number", + "description":"Average price at which the order has been settled.", + "example":0.0091111 + }, + "feeRate":{ + "type":"number", + "description":"The max fee rate applicable for the order.", + "example":0.002 + }, + "createdAt":{ + "type":"string", + "format":"date", + "description":"The date and time when the order was created.", + "example":"2020-05-13T14:11:02.205Z" + }, + "updatedAt":{ + "type":"string", + "format":"date", + "description":"The date and time when the order was last updated.", + "example":"2020-05-13T14:13:10.403Z" + }, + "activatedAt":{ + "type":"string", + "format":"date", + "description":"The date and time when the order was activated.", + "example":"2020-05-13T14:11:03.000Z" + }, + "lastFillTime":{ + "type":"string", + "format":"date", + "description":"The date and time when the last fill occurred for this order.", + "example":"2020-05-13T14:13:18.000Z" + }, + "canceled":{ + "type":"boolean", + "description":"Canceled status true or false.", + "example":false + }, + "isPostOnly":{ + "type":"boolean", + "description":"Flag to indicate if the order is post-only.", + "example":false + }, + "isHidden":{ + "type":"boolean", + "description":"Flag to indicate if the order is hidden.", + "example":false + }, + "isFillOrKill":{ + "type":"boolean", + "description":"Flag to indicate if fill or kill order.", + "example":false + }, + "isSlippageDisabled":{ + "type":"boolean", + "description":"Flag to indicate if slippage protection is disabled.", + "example":false + }, + "partnerId":{ + "type":"string", + "description":"TODO", + "example":"P1" + }, + "cid":{ + "type":"string", + "description":"An optional user-defined identifier for this order", + "example":"satoshi-order-2083236893" + }, + "awaitingSettlement":{ + "type":"number", + "description":"TODO", + "example":10 + }, + "meta":{ + "$ref":"#/definitions/collateralBalancesSchema" + } + }, + "required":[ + "_id", + "user", + "symbol", + "amount", + "amountOrig", + "tokenBuy", + "tokenSell", + "tokenSellLockedBalance", + "type", + "price", + "createdAt", + "updatedAt" + ] + }, + "Model39":{ + "type":"array", + "items":{ + "$ref":"#/definitions/closedOrderResponseObject" + } + }, + "recoverTradingKeyResponse":{ + "type":"object", + "properties":{ + "encryptedTradingKey":{ + "type":"string", + "description":"Encrypted Stark Trading Key", + "example":"7b2276657273696f6e223a227832353531392d7873616c736132302d706f6c7931333035222c226e6f6e6365223a22765633313730366571496f696432717944444539465055346f7466346171457a222c22657068656d5075626c69634b6579223a227358657a625174556c453476555661547857466b326555427532627746342f6641434378536a592f306e513d222c2263697068657274657874223a22444e5041615a76726331374f4d656a5451354f544e4243536d594b504466745335574b307278794b716671715770486d53676a4568782b3259352f6b4a6e3233674e5454476c31306973556271696d72636e67676a61636e346335317672484a697a427166324737227d" + }, + "dtkVersion":{ + "type":"string", + "description":"Trading Key Version", + "example":"v2" + } + } + }, + "permissionsPayload":{ + "type":"object", + "properties":{ + "nonce":{ + "type":"string", + "description":"This nonce which used to provide the time until which this nonce is valid. It is presented as seconds since epoch.", + "example":"v2-1704114061.000" + }, + "signature":{ + "type":"string", + "description":"The signature obtained by signing the nonce with your private ethereum key.", + "example":"0x2b48d53f2e3a696630ebdcd1ff057556bbc9de9c294adfaa5b1f13df91b67b347fdd88c29594c377ba0024dec40cd9808829e7f4447772482f50a7a8e9a903561c" + }, + "key":{ + "type":"string", + "description":"The permission key to change the access for", + "example":"balances" + }, + "value":{ + "type":"boolean", + "description":"Whether to allow public access to the endpoints driven by provided permission", + "example":true + } + } + }, + "Model40":{ + "type":"object", + "properties":{ + "count":{ + "type":"number", + "description":"Total count of user's filled orders.", + "example":1414 + } + } + }, + "withdrawHistoryResponse":{ + "type":"array", + "items":{ + "$ref":"#/definitions/withdrawHistoryObject" + } + }, + "Model41":{ + "type":"object", + "properties":{ + "orderId":{ + "type":"string", + "description":"The order ID", + "example":"d7c8b9" + }, + "canceled":{ + "type":"boolean", + "description":"only if order is already canceled", + "example":true + }, + "active":{ + "type":"boolean", + "description":"whether order is active", + "example":true + } + } + }, + "cancelOpenOrdersResponse":{ + "type":"array", + "items":{ + "$ref":"#/definitions/Model41" + } + }, + "cancelOrderResponse":{ + "type":"object", + "properties":{ + "orderId":{ + "type":"string", + "description":"The order ID.", + "example":"d7c8b9" + }, + "canceled":{ + "type":"boolean", + "description":"only if order is already canceled", + "example":true + } + } + }, + "cancelWithdrawalPayload":{ + "type":"object", + "properties":{ + "nonce":{ + "type":"string", + "description":"This nonce which used to provide the time until which this nonce is valid. It is presented as seconds since epoch.", + "example":"v2-1704114061.000" + }, + "signature":{ + "type":"string", + "description":"The signature obtained by signing the nonce with your private ethereum key.", + "example":"0x2b48d53f2e3a696630ebdcd1ff057556bbc9de9c294adfaa5b1f13df91b67b347fdd88c29594c377ba0024dec40cd9808829e7f4447772482f50a7a8e9a903561c" + }, + "id":{ + "type":"string", + "description":"Withdrawal ID.", + "example":"LCafcGC6tBH" + } + }, + "required":[ + "id" + ] + }, + "airdropEligibilityQuery":{ + "type":"object", + "properties":{ + "nonce":{ + "type":"string", + "description":"This nonce which used to provide the time until which this nonce is valid. It is presented as seconds since epoch.", + "example":"v2-1704114061.000" + }, + "signature":{ + "type":"string", + "description":"The signature obtained by signing the nonce with your private ethereum key.", + "example":"0x2b48d53f2e3a696630ebdcd1ff057556bbc9de9c294adfaa5b1f13df91b67b347fdd88c29594c377ba0024dec40cd9808829e7f4447772482f50a7a8e9a903561c" + }, + "token":{ + "type":"string", + "description":"token for the airdrop", + "example":"DVF" + } + }, + "required":[ + "token" + ] + }, + "Model42":{ + "type":"object", + "properties":{ + "_id":{ + "type":"string", + "description":"ID of the airdrop claim eligibility", + "example":"d7c8b9" + } + } + }, + "Model43":{ + "type":"object", + "description":"The Stark public key. Both the \"x\" and \"y\" part are required.", + "example":{ + "x":"0746919ecbb54563de512f6fb556c21dab091748b41a60a946dbdbf118ac0a85", + "y":"58f7ce5eb6eb5bd24f70394622b1f4d2c54ebca317a3e61bf9f349dccf166cf" + }, + "properties":{ + "x":{ + "type":"string", + "description":"The \"x\" part of the Stark public key." + }, + "y":{ + "type":"string", + "description":"The \"y\" part of the Stark public key." + } + } + }, + "depositPayload":{ + "type":"object", + "properties":{ + "token":{ + "type":"string", + "description":"The token for which the deposit was made.", + "example":"ZRX" + }, + "amount":{ + "type":"number", + "description":"The deposit amount.", + "example":1 + }, + "nonce":{ + "type":"number" + }, + "starkPublicKey":{ + "$ref":"#/definitions/Model43" + }, + "starkSignature":{ + "$ref":"#/definitions/Model27" + }, + "starkVaultId":{ + "type":"number", + "description":"The Stark vault ID.", + "example":1000003 + }, + "expireTime":{ + "type":"number", + "description":"Expiry time in hours", + "example":454934 + } + }, + "required":[ + "token", + "amount", + "nonce", + "starkPublicKey", + "starkSignature", + "starkVaultId", + "expireTime" + ] + }, + "depositResponse":{ + "type":"object", + "properties":{ + "isPostedOffchain":{ + "type":"boolean", + "description":"Flag to indicate if the deposit was posted off chain.", + "example":false + }, + "isConfirmedOnChain":{ + "type":"boolean", + "description":"Flag to indicate if the deposit was confirmed off chain.", + "example":true + }, + "_id":{ + "type":"string", + "example":"5e335f88bdcd70001e52d0a7" + }, + "starkVaultId":{ + "type":"number", + "description":"The Stark vault ID.", + "example":1000003 + }, + "starkKey":{ + "type":"string", + "description":"The Stark public key.", + "example":"0746919ecbb54563de512f6fb556c21dab091748b41a60a946dbdbf118ac0a85" + }, + "starkSignature":{ + "$ref":"#/definitions/Model27" + }, + "starkTokenId":{ + "type":"string", + "description":"The Stark token ID.", + "example":"0x3" + }, + "amount":{ + "type":"number", + "description":"The amount that was deposited.", + "example":1 + }, + "ethAddress":{ + "type":"string", + "description":"Ethereum public address of the user.", + "example":"0x341e46a49f15785373ede443df0220dea6a41bbc" + }, + "createdAt":{ + "type":"string", + "description":"The date and time of the deposit.", + "example":"2020-01-30T22:58:16.720Z" + } + }, + "required":[ + "starkSignature" + ] + }, + "Model44":{ + "type":"object", + "description":"StarkWare ConditionalTansferRequest", + "example":{ + "amount":"10000000", + "expirationTimestamp":446134, + "fact":"3c3f4eb0255776079339f0b253cc85310a3a56a0dcdd76ca5a995f4816cd0763", + "factRegistryAddress":"0xA9F9cC1189b9d6051b26467b29629787C671905d", + "nonce":976614084, + "receiverPublicKey":"0x077a3b314db07c45076d11f62b6f9e748a39790441823307743cf00d6597ea43", + "receiverVaultId":1863686755, + "senderPublicKey":"0x044926648f4b6f002dfa389c536129ae178f34d9be452724268cc48ebea2b37c", + "senderVaultId":2010760265, + "token":"0x180bef8ae3462e919489763b84dc1dc700c45a249dec4d1136814a639f2dd7b", + "type":"ConditionalTransferRequest", + "signature":{ + "r":"0x2857ca21310ab87bb7c37ebad0e7166f1fb46e43cf32d6587a31e148d44b677", + "s":"0x45e939717a6de4ad5e79993d918bb40e629760da7a04062e965394d1d14106a" + } + }, + "properties":{ + "amount":{ + "type":"string", + "pattern":"^[0-9]*$" + }, + "expirationTimestamp":{ + "type":"integer", + "minimum":0 + }, + "nonce":{ + "type":"integer", + "minimum":0 + }, + "receiverPublicKey":{ + "type":"string", + "pattern":"^0x[a-f0-9]+$" + }, + "receiverVaultId":{ + "type":"integer" + }, + "senderPublicKey":{ + "type":"string", + "pattern":"^0x[a-f0-9]+$" + }, + "senderVaultId":{ + "type":"integer" + }, + "signature":{ + "$ref":"#/definitions/signature" + }, + "token":{ + "type":"string", + "pattern":"^0x[a-f0-9]+$" + }, + "type":{ + "type":"string", + "enum":[ + "ConditionalTransferRequest" + ] + }, + "fact":{ + "type":"string", + "x-format":{ + "hex":{ + "byteAligned":false + } + } + }, + "factRegistryAddress":{ + "type":"string", + "pattern":"^0x[a-f0-9]+$" + } + } + }, + "fastWithdrawalPayload":{ + "type":"object", + "properties":{ + "recipientEthAddress":{ + "type":"string", + "description":"Ethereum address of recipient who will receive funds on chain.", + "example":"0x948cd3ad67c5f21412bfcd07a7981322f9fa01f0" + }, + "tx":{ + "$ref":"#/definitions/Model44" + }, + "transactionFee":{ + "type":"string", + "description":"fee to paid by the user in the currency of the transaction (quantised units).", + "example":"1", + "pattern":"^[0-9]*$" + }, + "starkPublicKey":{ + "$ref":"#/definitions/starkPublicKey" + } + } + }, + "Model45":{ + "type":"object", + "properties":{ + "_id":{ + "type":"string", + "description":"Withdrawal ID.", + "example":"LCafcGC6tBH" + }, + "token":{ + "type":"string", + "description":"The token that was withdrawn.", + "example":"NEC" + }, + "amount":{ + "type":"string", + "description":"The amount that was withdrawn.", + "example":"100", + "pattern":"^[0-9]*$" + }, + "createdAt":{ + "type":"string", + "format":"date", + "description":"The date and time withdrawal request was received.", + "example":"2020-01-29T14:13:05.898Z" + }, + "readyToWithdrawOnChain":{ + "type":"boolean", + "description":"The withdrawal is ready to be requested.", + "example":true + }, + "canceled":{ + "type":"boolean", + "description":"The withdrawal has been canceled.", + "example":true + }, + "fastWithdrawalData":{ + "$ref":"#/definitions/fastWithdrawalData" + } + }, + "required":[ + "_id", + "token", + "createdAt", + "readyToWithdrawOnChain", + "fastWithdrawalData" + ] + }, + "feedbackPayload":{ + "type":"object", + "properties":{ + "nonce":{ + "type":"string", + "description":"This nonce which used to provide the time until which this nonce is valid. It is presented as seconds since epoch.", + "example":"v2-1704114061.000" + }, + "signature":{ + "type":"string", + "description":"The signature obtained by signing the nonce with your private ethereum key.", + "example":"0x2b48d53f2e3a696630ebdcd1ff057556bbc9de9c294adfaa5b1f13df91b67b347fdd88c29594c377ba0024dec40cd9808829e7f4447772482f50a7a8e9a903561c" + }, + "email":{ + "type":"string", + "description":"Email of the user providing feedback.", + "example":"hello@deversifi.com" + } + }, + "required":[ + "email" + ] + }, + "Model46":{ + "type":"object", + "properties":{ + "_id":{ + "type":"string", + "description":"ID of the feedback entry", + "example":"d7c8b9" + } + } + }, + "notificationPayload":{ + "type":"object", + "properties":{ + "message":{ + "type":"string" + }, + "urgency":{ + "type":"string", + "default":"NORMAL", + "enum":[ + "HIGH", + "NORMAL" + ] + }, + "startDate":{ + "type":"string", + "format":"date" + }, + "endDate":{ + "type":"string", + "format":"date" + }, + "userAddress":{ + "type":"string" + } + }, + "required":[ + "message", + "startDate", + "endDate" + ] + }, + "notification":{ + "type":"object", + "properties":{ + "_id":{ + "type":"string" + }, + "message":{ + "type":"string" + }, + "urgency":{ + "type":"string", + "enum":[ + "HIGH", + "NORMAL" + ] + }, + "startDate":{ + "type":"string", + "format":"date" + }, + "endDate":{ + "type":"string", + "format":"date" + }, + "userAddress":{ + "type":"string" + } + }, + "required":[ + "message", + "startDate", + "endDate" + ] + }, + "Model47":{ + "type":"object", + "properties":{ + "dtk":{ + "type":"string", + "description":"The encrypted Stark trading key.", + "example":"6d840e6d251e2165e3214eecfcbcfa83c0f704439e16c69383d93fc0f704439e16c69383d93fc0f704439e16c69383d93fc0f704439e16c69383d93fc0f704439e16c69383d93f", + "minLength":66, + "maxLength":1000, + "pattern":"[a-zA-Z0-9]{66,}" + }, + "dtkVersion":{ + "type":"string", + "description":"Version of the trading key mechanism.", + "example":"v1", + "default":"v1" + } + } + }, + "registerPayload":{ + "type":"object", + "properties":{ + "nonce":{ + "type":"string", + "description":"This nonce which used to provide the time until which this nonce is valid. It is presented as seconds since epoch.", + "example":"v2-1704114061.000" + }, + "signature":{ + "type":"string", + "description":"The signature obtained by signing the nonce with your private ethereum key.", + "example":"0x2b48d53f2e3a696630ebdcd1ff057556bbc9de9c294adfaa5b1f13df91b67b347fdd88c29594c377ba0024dec40cd9808829e7f4447772482f50a7a8e9a903561c" + }, + "starkKey":{ + "type":"string", + "description":"The Stark public key.", + "example":"0746919ecbb54563de512f6fb556c21dab091748b41a60a946dbdbf118ac0a85" + }, + "encryptedTradingKey":{ + "$ref":"#/definitions/Model47", + "x-alternatives":[ + { + "$ref":"#/x-alt-definitions/encryptedTradingKey" + }, + { + "type":"string", + "description":"The encrypted Stark trading key.", + "example":"6d840e6d251e2165e3214eecfcbcfa83c0f704439e16c69383d93fc0f704439e16c69383d93fc0f704439e16c69383d93fc0f704439e16c69383d93fc0f704439e16c69383d93f", + "minLength":66, + "maxLength":1000, + "pattern":"[a-zA-Z0-9]{66,}" + } + ] + }, + "meta":{ + "$ref":"#/definitions/collateralBalancesSchema" + }, + "contractWalletAddress":{ + "type":"string", + "description":"The address of the contract wallet that is registering.", + "example":"0x8d12A197cB00D4747a1fe03395095ce2A5CC6819" + } + }, + "required":[ + "starkKey" + ] + }, + "exchangeSymbols":{ + "type":"array", + "description":"Currency pairs available at the DeversiFi exchange for trading", + "items":{ + "type":"string" + } + }, + "Model48":{ + "type":"object", + "description":"This contains application configuration details to set up for deposits and trading.", + "example":{ + "defaultFeeRate":0.002, + "deversifiAddress":"0x9ab450355b4ab504cbc0e4de484781dac08e6a26", + "starkExContractAddress":"0xF3731d0cdC9834f6F32104580bD226EF1bc1A9F9", + "exchangeSymbols":[ + "ETH:USDT", + "ZRX:USDT", + "ZRX:ETH", + "BTC:USDT", + "ETH:BTC" + ], + "newMarkets":[ + "ZRX:USDT", + "ZRX:ETH" + ], + "tempStarkVaultId":1 + }, + "properties":{ + "defaultFeeRate":{ + "type":"number", + "description":"The default fee rate, if no volume or maker discount." + }, + "deversifiAddress":{ + "type":"string", + "description":"The address of the DeversiFi exchange." + }, + "starkExContractAddress":{ + "type":"string", + "description":"Stark deposit contract address." + }, + "exchangeSymbols":{ + "$ref":"#/definitions/exchangeSymbols" + }, + "newMarkets":{ + "$ref":"#/definitions/newMarkets" + }, + "tempStarkVaultId":{ + "type":"number", + "description":"Transit Stark vault ID used for deposit privacy" + }, + "minDepositUSDT":{ + "type":"number", + "description":"Minimum deposit amount denominated in USDT" + } + } + }, + "registerResponseUserRegisteredOnChain":{ + "type":"object", + "properties":{ + "isRegistered":{ + "type":"boolean", + "description":"Registration status.", + "example":true, + "enum":[ + true + ] + }, + "ethAddress":{ + "type":"string", + "description":"Ethereum address.", + "example":"0x278ff3bb25c5b1bb7032e822661974479280fa74" + }, + "DVF":{ + "$ref":"#/definitions/Model48" + }, + "tokenRegistry":{ + "$ref":"#/definitions/collateralBalancesSchema" + } + }, + "required":[ + "isRegistered", + "ethAddress" + ] + }, + "storeTradingKeyPayload":{ + "type":"object", + "properties":{ + "nonce":{ + "type":"string", + "description":"This nonce which used to provide the time until which this nonce is valid. It is presented as seconds since epoch.", + "example":"v2-1704114061.000" + }, + "signature":{ + "type":"string", + "description":"The signature obtained by signing the nonce with your private ethereum key.", + "example":"0x2b48d53f2e3a696630ebdcd1ff057556bbc9de9c294adfaa5b1f13df91b67b347fdd88c29594c377ba0024dec40cd9808829e7f4447772482f50a7a8e9a903561c" + }, + "encryptedTradingKey":{ + "type":"string", + "description":"Encrypted Stark Trading Key.", + "example":"7b2276657273696f6e223a227832353531392d7873616c736132302d706f6c7931333035222c226e6f6e6365223a22765633313730366571496f696432717944444539465055346f7466346171457a222c22657068656d5075626c69634b6579223a227358657a625174556c453476555661547857466b326555427532627746342f6641434378536a592f306e513d222c2263697068657274657874223a22444e5041615a76726331374f4d656a5451354f544e4243536d594b504466745335574b307278794b716671715770486d53676a4568782b3259352f6b4a6e3233674e5454476c31306973556271696d72636e67676a61636e346335317672484a697a427166324737227d", + "minLength":66, + "maxLength":1000, + "pattern":"[a-zA-Z0-9]{66,}" + }, + "dtkVersion":{ + "type":"string", + "description":"Trading Key Version", + "example":"v2", + "minLength":0, + "maxLength":4 + } + }, + "required":[ + "encryptedTradingKey" + ] + }, + "storeTradingKeyResponse":{ + "type":"object", + "properties":{ + "status":{ + "type":"boolean", + "description":"Returns true if trading key is stored successfully", + "example":true + } + } + }, + "Model49":{ + "type":"object", + "description":"Stark order related meta information.", + "properties":{ + "vaultIdSell":{ + "type":"number", + "description":"The vault ID of the seller." + }, + "vaultIdBuy":{ + "type":"number", + "description":"The vault ID of the buyer." + }, + "amountSell":{ + "type":"string", + "description":"The total amount to be sold." + }, + "amountBuy":{ + "type":"string", + "description":"The total amount to be bought." + }, + "tokenSell":{ + "type":"string", + "description":"The Stark token ID for the token being sold." + }, + "tokenBuy":{ + "type":"string", + "description":"The Stark token ID for the token being bought." + }, + "nonce":{ + "type":"number", + "description":"Nonce value." + }, + "expirationTimestamp":{ + "type":"number", + "description":"Expiration timestamp of the order." + } + } + }, + "submitOrderMeta":{ + "type":"object", + "description":"A set of meta values.", + "example":{ + "starkOrder":{ + "vaultIdSell":1000002, + "vaultIdBuy":1000001, + "amountSell":"97400000", + "amountBuy":"100000000000000000", + "tokenSell":"0x2", + "tokenBuy":"0x1", + "nonce":0, + "expirationTimestamp":438947 + }, + "ethAddress":"0x341E46a49F15785373edE443Df0220DEa6a41Bbc", + "starkPublicKey":{ + "x":"0746919ecbb54563de512f6fb556c21dab091748b41a60a946dbdbf118ac0a85", + "y":"58f7ce5eb6eb5bd24f70394622b1f4d2c54ebca317a3e61bf9f349dccf166cf" + }, + "starkSignature":{ + "r":"5d14357fcf8f489218de0855267c6f64bc463135debf62680ad796e63cd6d3b", + "s":"786ab874d91e3a5871134955fcb768914754760a0ada326af67f758f32819cf" + } + }, + "properties":{ + "starkOrder":{ + "$ref":"#/definitions/Model49" + }, + "ethAddress":{ + "type":"string", + "description":"The Ethereum public address." + }, + "feature":{ + "type":"string", + "description":"Origin of the order" + }, + "starkPublicKey":{ + "$ref":"#/definitions/collateralBalancesSchema" + }, + "starkSignature":{ + "$ref":"#/definitions/Model27" + } + }, + "required":[ + "starkSignature" + ] + }, + "submitOrderPayload":{ + "type":"object", + "properties":{ + "cid":{ + "type":"string", + "description":"Optional custom order ID that could be set when placing order and used later to retrieve order. This ID is unique per user (user A and B can each have an order with cid = AAA, but the same user cannot have two orders with the same cid)", + "example":"long-123" + }, + "gid":{ + "type":"string" + }, + "type":{ + "type":"string", + "description":"The type of order. Currently only “EXCHANGE_LIMIT” is accepted.", + "example":"EXCHANGE LIMIT", + "enum":[ + "EXCHANGE LIMIT", + "exchange limit", + "EXCHANGE MARKET", + "exchange market" + ] + }, + "symbol":{ + "type":"string", + "description":"The trading pair.", + "example":"ETH:USDT" + }, + "amount":{ + "type":"string", + "description":"The token amount to be traded. Will be rounded up to 8 decimal places.", + "example":"0.1" + }, + "price":{ + "type":"string", + "description":"The cost per unit. Will be rounded down to 5 significant digits.", + "example":"1000" + }, + "meta":{ + "$ref":"#/definitions/submitOrderMeta" + }, + "protocol":{ + "type":"string", + "enum":[ + "stark" + ] + }, + "partnerId":{ + "type":"string" + }, + "feeRate":{ + "type":"string" + }, + "isPostOnly":{ + "type":"boolean", + "description":"Flag to indicate if the order is post-only. Mutually exclusive with isFillOrKill" + }, + "isHidden":{ + "type":"boolean", + "description":"Flag to indicate if the order is hidden." + }, + "isFillOrKill":{ + "type":"boolean", + "description":"Flag to indicate if fill or kill order. Mutually exclusive with isPostOnly" + }, + "isSlippageDisabled":{ + "type":"boolean", + "description":"Flag to indicate if slippage protection is disabled." + } + }, + "required":[ + "type", + "symbol", + "amount", + "price", + "meta" + ] + }, + "submitOrderResponse":{ + "type":"object", + "properties":{ + "_id":{ + "type":"string", + "description":"Id for the order. This can be used for orderId when calling cancelOrder or getOrder", + "example":"L1tarX5wUem" + }, + "user":{ + "type":"string", + "description":"Ethereum address of the user", + "example":"E0xc1caf2d76c49e4a60635635c329a3ac22ddeb547" + }, + "symbol":{ + "type":"string", + "description":"Trading symbol for the order", + "example":"ETH:USDT" + }, + "tokenSell":{ + "type":"string", + "description":"The token which is being sold", + "example":"ETH" + }, + "tokenBuy":{ + "type":"string", + "description":"The token which is being bought", + "example":"USDT" + }, + "amount":{ + "type":"number", + "description":"Original order size placed being sold or bought.", + "example":"-0.5" + }, + "price":{ + "type":"number", + "description":"Cost per unit.", + "example":"200" + }, + "type":{ + "type":"string", + "description":"Type of the order. Currently, \"EXCHANGE LIMIT\" is the only type that is supported.", + "example":"EXCHANGE LIMIT" + }, + "createdAt":{ + "type":"string", + "description":"The date and time when the order was created.", + "example":"2020-05-09T18:29:56.603Z" + }, + "updatedAt":{ + "type":"string", + "description":"The date and time when the order was last updated.", + "example":"2020-05-09T18:29:56.945Z" + }, + "activatedAt":{ + "type":"string", + "description":"The date and time when the order was activated.", + "example":"2020-05-09T18:29:56.944Z" + }, + "isPostOnly":{ + "type":"boolean", + "description":"Flag to indicate if the order is post-only.", + "example":false + }, + "isHidden":{ + "type":"boolean", + "description":"Flag to indicate if the order is hidden.", + "example":false + }, + "isFillOrKill":{ + "type":"boolean", + "description":"Flag to indicate if fill or kill order.", + "example":false + }, + "isSlippageDisabled":{ + "type":"boolean", + "description":"Flag to indicate if slippage protection is disabled.", + "example":false + }, + "cid":{ + "type":"string", + "description":"An optional user-defined identifier for this order", + "example":"satoshi-order-2083236893" + } + } + }, + "Model50":{ + "type":"object", + "description":"StarkWare TansferRequest for main transfer", + "properties":{ + "type":{ + "type":"string", + "enum":[ + "TransferRequest" + ] + }, + "amount":{ + "type":"string", + "pattern":"^[0-9]*$" + }, + "expirationTimestamp":{ + "type":"integer", + "minimum":0 + }, + "nonce":{ + "type":"integer", + "minimum":0 + }, + "receiverPublicKey":{ + "type":"string", + "pattern":"^0x[a-f0-9]+$" + }, + "receiverVaultId":{ + "type":"integer" + }, + "senderPublicKey":{ + "type":"string", + "pattern":"^0x[a-f0-9]+$" + }, + "senderVaultId":{ + "type":"integer" + }, + "signature":{ + "$ref":"#/definitions/signature" + }, + "token":{ + "type":"string", + "pattern":"^0x[a-f0-9]+$" + } + } + }, + "feeTx":{ + "type":"object", + "description":"StarkWare TansferRequest for service fee", + "properties":{ + "type":{ + "type":"string", + "enum":[ + "TransferRequest" + ] + }, + "amount":{ + "type":"string", + "pattern":"^[0-9]*$" + }, + "expirationTimestamp":{ + "type":"integer", + "minimum":0 + }, + "nonce":{ + "type":"integer", + "minimum":0 + }, + "receiverPublicKey":{ + "type":"string", + "pattern":"^0x[a-f0-9]+$" + }, + "receiverVaultId":{ + "type":"integer" + }, + "senderPublicKey":{ + "type":"string", + "pattern":"^0x[a-f0-9]+$" + }, + "senderVaultId":{ + "type":"integer" + }, + "signature":{ + "$ref":"#/definitions/signature" + }, + "token":{ + "type":"string", + "pattern":"^0x[a-f0-9]+$" + } + } + }, + "transferPayload":{ + "type":"object", + "properties":{ + "tx":{ + "$ref":"#/definitions/Model50" + }, + "feeTx":{ + "$ref":"#/definitions/feeTx" + }, + "memo":{ + "type":"string", + "description":"Optional memo string", + "maxLength":42 + }, + "starkPublicKey":{ + "$ref":"#/definitions/starkPublicKey" + } + } + }, + "Model51":{ + "type":"object", + "example":{ + "type":"TransferRequest", + "amount":"10000000", + "expirationTimestamp":446134, + "nonce":976614084, + "receiverPublicKey":"0x077a3b314db07c45076d11f62b6f9e748a39790441823307743cf00d6597ea43", + "receiverVaultId":1863686755, + "senderPublicKey":"0x044926648f4b6f002dfa389c536129ae178f34d9be452724268cc48ebea2b37c", + "senderVaultId":2010760265, + "token":"0x180bef8ae3462e919489763b84dc1dc700c45a249dec4d1136814a639f2dd7b", + "signature":{ + "r":"0x2857ca21310ab87bb7c37ebad0e7166f1fb46e43cf32d6587a31e148d44b677", + "s":"0x45e939717a6de4ad5e79993d918bb40e629760da7a04062e965394d1d14106a" + } + }, + "properties":{ + "type":{ + "type":"string", + "enum":[ + "TransferRequest" + ] + }, + "amount":{ + "type":"string", + "pattern":"^[0-9]*$" + }, + "expirationTimestamp":{ + "type":"integer", + "minimum":0 + }, + "nonce":{ + "type":"integer", + "minimum":0 + }, + "receiverPublicKey":{ + "type":"string", + "pattern":"^0x[a-f0-9]+$" + }, + "receiverVaultId":{ + "type":"integer" + }, + "senderPublicKey":{ + "type":"string", + "pattern":"^0x[a-f0-9]+$" + }, + "senderVaultId":{ + "type":"integer" + }, + "signature":{ + "$ref":"#/definitions/signature" + }, + "token":{ + "type":"string", + "pattern":"^0x[a-f0-9]+$" + } + } + }, + "transferResponseObject":{ + "type":"object", + "properties":{ + "_id":{ + "type":"string", + "description":"Transfer ID.", + "example":"LCafcGC6tBH" + }, + "token":{ + "type":"string", + "description":"The token that was transferred.", + "example":"NEC" + }, + "amount":{ + "type":"string", + "description":"The amount that was transferred (in quantised units).", + "example":"100", + "pattern":"^[0-9]*$" + }, + "recipient":{ + "type":"string", + "description":"Deversifi user id of recipient of the transfer.", + "example":"0x948cd3ad67c5f21412bfcd07a7981322f9fa01f0" + }, + "createdAt":{ + "type":"string", + "format":"date", + "description":"The date and time transfer request was received.", + "example":"2020-01-29T14:13:05.898Z" + }, + "updatedAt":{ + "type":"string", + "format":"date", + "description":"The date and time transfer request was received.", + "example":"2020-01-29T14:13:05.898Z" + }, + "memo":{ + "type":"string", + "description":"Transfer memo", + "example":"my reference" + }, + "tx":{ + "$ref":"#/definitions/Model51" + } + }, + "required":[ + "_id", + "token", + "createdAt", + "updatedAt" + ] + }, + "withdrawalPayload":{ + "type":"object", + "properties":{ + "token":{ + "type":"string", + "description":"The token for which the withdrawal is requested.", + "example":"ZRX" + }, + "amount":{ + "type":"number", + "description":"The withdrawal amount.", + "example":1 + }, + "nonce":{ + "type":"number", + "example":45435743 + }, + "starkPublicKey":{ + "$ref":"#/definitions/starkPublicKey" + }, + "starkSignature":{ + "$ref":"#/definitions/Model27" + }, + "starkVaultId":{ + "type":"number", + "description":"The Stark vault ID.", + "example":1000003 + }, + "expireTime":{ + "type":"number", + "description":"Expiry time in hours", + "example":454934 + } + }, + "required":[ + "token", + "amount", + "nonce", + "starkPublicKey", + "starkSignature", + "starkVaultId", + "expireTime" + ] + }, + "Model52":{ + "type":"object", + "properties":{ + "token":{ + "type":"string", + "description":"The token which the balance is specifically requested for.", + "example":"ETH" + }, + "fields":{ + "$ref":"#/definitions/fields" + } + } + } + }, + "x-alt-definitions":{ + "pagination":{ + "type":"object", + "properties":{ + "totalItems":{ + "type":"number", + "description":"Total number of items matching the query", + "example":1559, + "minimum":0 + }, + "limit":{ + "type":"number", + "description":"Limit applied on returned items", + "example":5 + }, + "skip":{ + "type":"number", + "description":"Skip applied on returned items", + "example":2 + } + } + }, + "Model1":{ + "type":"object", + "properties":{ + "_id":{ + "type":"string", + "description":"Unique identifier representing the deposit or withdrawal", + "example":"606f207fc7aa2e91d028a17a" + }, + "type":{ + "type":"string", + "description":"Whether the transaction is a deposit, a classic withdrawal or a fast withdrawal", + "example":"Deposit", + "enum":[ + "Deposit", + "Withdrawal", + "FastWithdrawal" + ] + }, + "token":{ + "type":"string", + "description":"Token deposited or withdrawn", + "example":"ZRX" + }, + "amount":{ + "type":"number", + "description":"Amount deposited or withdrawn", + "example":1 + }, + "transactionHash":{ + "type":"string", + "description":"Hash of the Ethereum transaction leading to L1 balance debit or credit", + "example":"0xb5c8bd9430b6cc87a0e2fe110ece6bf527fa4f170a4bc8cd032f768fc5219838" + }, + "date":{ + "type":"string", + "format":"date", + "description":"Date and time deposit or withdrawal", + "example":"2020-11-11T16:37:05.957" + }, + "sourceOrRecipient":{ + "type":"string", + "description":"Originator of the deposit or recipient of the withdrawal", + "example":"0x148426fdc4c8a51b96b4bed827907b5fa6491ad0" + }, + "gateway":{ + "type":"string", + "description":"Set when operation used a gateway. Corresponds to a chain identifier", + "example":"MATIC_POS" + } + } + }, + "items":{ + "type":"array", + "items":{ + "$ref":"#/x-alt-definitions/Model1" + } + }, + "getDepositsAndWithdrawalsResponse":{ + "type":"object", + "properties":{ + "pagination":{ + "$ref":"#/x-alt-definitions/pagination" + }, + "items":{ + "$ref":"#/x-alt-definitions/items" + } + } + }, + "Model2":{ + "type":"object", + "properties":{ + "fillId":{ + "type":"string", + "description":"Unique identifier representing the fill event", + "example":"606f207fc7aa2e91d028a17a" + }, + "orderId":{ + "type":"string", + "description":"Unique identifier of the order associated with the fill", + "example":"BtHEvgY1Bz1" + }, + "symbol":{ + "type":"string", + "description":"Symbol for the order associated with the fill", + "example":"ETH:USDT" + }, + "price":{ + "type":"number", + "description":"Execution price of the fill", + "example":209.9 + }, + "fillAmount":{ + "type":"number", + "description":"Amount filled (negative amount for a sell event, positive for a buy event)", + "example":-0.125622 + }, + "orderAmount":{ + "type":"number", + "description":"Initial amount for the placed order associated with the fill", + "example":-1 + }, + "date":{ + "type":"string", + "format":"date", + "description":"Date and time of the fill event", + "example":"2020-11-11T16:37:05.957" + }, + "orderCreationDate":{ + "type":"string", + "format":"date", + "description":"Date and time at which the order associated with the fill event was placed", + "example":"2020-11-11T16:37:05.262Z" + }, + "orderType":{ + "type":"string", + "description":"Type of the order associated with the fill event", + "example":true, + "enum":[ + "EXCHANGE LIMIT", + "EXCHANGE MARKET" + ] + }, + "orderActive":{ + "type":"boolean", + "description":"Whether the order associated with the fill event is still active", + "example":true + }, + "orderCanceled":{ + "type":"boolean", + "description":"Whether the order associated with the fill event was canceled", + "example":false + } + } + }, + "Model3":{ + "type":"array", + "items":{ + "$ref":"#/x-alt-definitions/Model2" + } + }, + "getFillsResponse":{ + "type":"object", + "properties":{ + "pagination":{ + "$ref":"#/x-alt-definitions/pagination" + }, + "items":{ + "$ref":"#/x-alt-definitions/Model3" + } + } + }, + "Model4":{ + "type":"object", + "properties":{ + "_id":{ + "type":"string", + "description":"Unique identifier representing this transfer", + "example":"MphMkBBZjnS" + }, + "token":{ + "type":"string", + "description":"Token transfered", + "example":"ETH" + }, + "amount":{ + "type":"number", + "description":"Amount transfered (effective amount received by the recipient)", + "example":3.14, + "minimum":0 + }, + "feeAmount":{ + "type":"number", + "description":"Transfer fee amount (in transfer token units)", + "example":3.14, + "minimum":0 + }, + "source":{ + "type":"string", + "description":"Source Ethereum address", + "example":"0x08152c1265dBc218ccc8Ab5C574e6bD52279b3B7" + }, + "recipient":{ + "type":"string", + "description":"Recipient Ethereum address", + "example":"0xeb3ea3ea9239577951523cafa9fd3072bc88e50a" + }, + "memo":{ + "type":"string", + "description":"Transfer memo", + "example":"my reference" + }, + "date":{ + "type":"string", + "format":"date", + "description":"Date and time of the transfer", + "example":"1990-04-14T00:20:00.000Z" + } + } + }, + "Model5":{ + "type":"array", + "items":{ + "$ref":"#/x-alt-definitions/Model4" + } + }, + "getTransfersResponse":{ + "type":"object", + "properties":{ + "pagination":{ + "$ref":"#/x-alt-definitions/pagination" + }, + "items":{ + "$ref":"#/x-alt-definitions/Model5" + } + } + }, + "encryptedTradingKey":{ + "type":"object", + "properties":{ + "dtk":{ + "type":"string", + "description":"The encrypted Stark trading key.", + "example":"6d840e6d251e2165e3214eecfcbcfa83c0f704439e16c69383d93fc0f704439e16c69383d93fc0f704439e16c69383d93fc0f704439e16c69383d93fc0f704439e16c69383d93f", + "minLength":66, + "maxLength":1000, + "pattern":"[a-zA-Z0-9]{66,}" + }, + "dtkVersion":{ + "type":"string", + "description":"Version of the trading key mechanism.", + "example":"v1", + "default":"v1" + } + } + }, + "exchangeSymbols":{ + "type":"array", + "description":"Currency pairs available at the DeversiFi exchange for trading", + "items":{ + "type":"string" + } + }, + "newMarkets":{ + "type":"array", + "description":"Currency pairs that were newly added", + "items":{ + "type":"string" + } + }, + "DVF":{ + "type":"object", + "description":"This contains application configuration details to set up for deposits and trading.", + "example":{ + "defaultFeeRate":0.002, + "deversifiAddress":"0x9ab450355b4ab504cbc0e4de484781dac08e6a26", + "starkExContractAddress":"0xF3731d0cdC9834f6F32104580bD226EF1bc1A9F9", + "exchangeSymbols":[ + "ETH:USDT", + "ZRX:USDT", + "ZRX:ETH", + "BTC:USDT", + "ETH:BTC" + ], + "newMarkets":[ + "ZRX:USDT", + "ZRX:ETH" + ], + "tempStarkVaultId":1 + }, + "properties":{ + "defaultFeeRate":{ + "type":"number", + "description":"The default fee rate, if no volume or maker discount." + }, + "deversifiAddress":{ + "type":"string", + "description":"The address of the DeversiFi exchange." + }, + "starkExContractAddress":{ + "type":"string", + "description":"Stark deposit contract address." + }, + "exchangeSymbols":{ + "$ref":"#/x-alt-definitions/exchangeSymbols" + }, + "newMarkets":{ + "$ref":"#/x-alt-definitions/newMarkets" + }, + "tempStarkVaultId":{ + "type":"number", + "description":"Transit Stark vault ID used for deposit privacy" + }, + "minDepositUSDT":{ + "type":"number", + "description":"Minimum deposit amount denominated in USDT" + } + } + }, + "tokenRegistry":{ + "type":"object" + }, + "registerResponseUserRegisteredOnChain":{ + "type":"object", + "properties":{ + "isRegistered":{ + "type":"boolean", + "description":"Registration status.", + "example":true, + "enum":[ + true + ] + }, + "ethAddress":{ + "type":"string", + "description":"Ethereum address.", + "example":"0x278ff3bb25c5b1bb7032e822661974479280fa74" + }, + "DVF":{ + "$ref":"#/x-alt-definitions/DVF" + }, + "tokenRegistry":{ + "$ref":"#/x-alt-definitions/tokenRegistry" + } + }, + "required":[ + "isRegistered", + "ethAddress" + ] + }, + "registerResponseUserNotRegisteredOnChain":{ + "type":"object", + "properties":{ + "isRegistered":{ + "type":"boolean", + "description":"Registration status.", + "example":false, + "enum":[ + false + ] + }, + "deFiSignature":{ + "type":"string", + "description":"Deversifi Signature", + "example":"0x0277b6e85ffdfb8cdc34c89b8d7ef19e915daf00327db91c1f5a1988666089e6b8420881699501" + } + }, + "required":[ + "isRegistered", + "deFiSignature" + ] + }, + "starkOrder":{ + "type":"object", + "description":"Stark order related meta information.", + "properties":{ + "vaultIdSell":{ + "type":"number", + "description":"The vault ID of the seller." + }, + "vaultIdBuy":{ + "type":"number", + "description":"The vault ID of the buyer." + }, + "amountSell":{ + "type":"string", + "description":"The total amount to be sold." + }, + "amountBuy":{ + "type":"string", + "description":"The total amount to be bought." + }, + "tokenSell":{ + "type":"string", + "description":"The Stark token ID for the token being sold." + }, + "tokenBuy":{ + "type":"string", + "description":"The Stark token ID for the token being bought." + }, + "nonce":{ + "type":"number", + "description":"Nonce value." + }, + "expirationTimestamp":{ + "type":"number", + "description":"Expiration timestamp of the order." + } + } + }, + "starkSignature":{ + "type":"object", + "description":"Stark signature consisting of consisting of \"r\" and \"s\"", + "example":{ + "v":"3b46dfe03caef623048fedc8457a92385cd63eff6349ad135c945cd84937677", + "r":"1f38f551d798562c16d28733c7e3ff6850898d82f0ac9ccd39d373303b1778c", + "s":"518560420e52a37e9f580f024fc0fe8572cb2f5437a839075bbf4b2b123d572" + }, + "properties":{ + "v":{ + "type":"string", + "description":"The \"v\" part of the Stark signature." + }, + "r":{ + "type":"string", + "description":"The \"r\" part of the Stark signature." + }, + "s":{ + "type":"string", + "description":"The \"s\" part of the Stark signature." + } + }, + "required":[ + "r", + "s" + ] + }, + "submitOrderMeta":{ + "type":"object", + "description":"A set of meta values.", + "example":{ + "starkOrder":{ + "vaultIdSell":1000002, + "vaultIdBuy":1000001, + "amountSell":"97400000", + "amountBuy":"100000000000000000", + "tokenSell":"0x2", + "tokenBuy":"0x1", + "nonce":0, + "expirationTimestamp":438947 + }, + "ethAddress":"0x341E46a49F15785373edE443Df0220DEa6a41Bbc", + "starkPublicKey":{ + "x":"0746919ecbb54563de512f6fb556c21dab091748b41a60a946dbdbf118ac0a85", + "y":"58f7ce5eb6eb5bd24f70394622b1f4d2c54ebca317a3e61bf9f349dccf166cf" + }, + "starkSignature":{ + "r":"5d14357fcf8f489218de0855267c6f64bc463135debf62680ad796e63cd6d3b", + "s":"786ab874d91e3a5871134955fcb768914754760a0ada326af67f758f32819cf" + } + }, + "properties":{ + "starkOrder":{ + "$ref":"#/x-alt-definitions/starkOrder" + }, + "ethAddress":{ + "type":"string", + "description":"The Ethereum public address." + }, + "feature":{ + "type":"string", + "description":"Origin of the order" + }, + "starkPublicKey":{ + "$ref":"#/x-alt-definitions/tokenRegistry" + }, + "starkSignature":{ + "$ref":"#/x-alt-definitions/starkSignature" + } + }, + "required":[ + "starkSignature" + ] + }, + "submitOrderPayload":{ + "type":"object", + "properties":{ + "cid":{ + "type":"string", + "description":"Optional custom order ID that could be set when placing order and used later to retrieve order. This ID is unique per user (user A and B can each have an order with cid = AAA, but the same user cannot have two orders with the same cid)", + "example":"long-123" + }, + "gid":{ + "type":"string" + }, + "type":{ + "type":"string", + "description":"The type of order. Currently only “EXCHANGE_LIMIT” is accepted.", + "example":"EXCHANGE LIMIT", + "enum":[ + "EXCHANGE LIMIT", + "exchange limit", + "EXCHANGE MARKET", + "exchange market" + ] + }, + "symbol":{ + "type":"string", + "description":"The trading pair.", + "example":"ETH:USDT" + }, + "amount":{ + "type":"string", + "description":"The token amount to be traded. Will be rounded up to 8 decimal places.", + "example":"0.1" + }, + "price":{ + "type":"string", + "description":"The cost per unit. Will be rounded down to 5 significant digits.", + "example":"1000" + }, + "meta":{ + "$ref":"#/x-alt-definitions/submitOrderMeta" + }, + "protocol":{ + "type":"string", + "enum":[ + "stark" + ] + }, + "partnerId":{ + "type":"string" + }, + "feeRate":{ + "type":"string" + }, + "isPostOnly":{ + "type":"boolean", + "description":"Flag to indicate if the order is post-only. Mutually exclusive with isFillOrKill" + }, + "isHidden":{ + "type":"boolean", + "description":"Flag to indicate if the order is hidden." + }, + "isFillOrKill":{ + "type":"boolean", + "description":"Flag to indicate if fill or kill order. Mutually exclusive with isPostOnly" + }, + "isSlippageDisabled":{ + "type":"boolean", + "description":"Flag to indicate if slippage protection is disabled." + } + }, + "required":[ + "type", + "symbol", + "amount", + "price", + "meta" + ] + }, + "Model6":{ + "type":"array", + "items":{ + "$ref":"#/x-alt-definitions/submitOrderPayload" + } + }, + "submitOrderResponse":{ + "type":"object", + "properties":{ + "_id":{ + "type":"string", + "description":"Id for the order. This can be used for orderId when calling cancelOrder or getOrder", + "example":"L1tarX5wUem" + }, + "user":{ + "type":"string", + "description":"Ethereum address of the user", + "example":"E0xc1caf2d76c49e4a60635635c329a3ac22ddeb547" + }, + "symbol":{ + "type":"string", + "description":"Trading symbol for the order", + "example":"ETH:USDT" + }, + "tokenSell":{ + "type":"string", + "description":"The token which is being sold", + "example":"ETH" + }, + "tokenBuy":{ + "type":"string", + "description":"The token which is being bought", + "example":"USDT" + }, + "amount":{ + "type":"number", + "description":"Original order size placed being sold or bought.", + "example":"-0.5" + }, + "price":{ + "type":"number", + "description":"Cost per unit.", + "example":"200" + }, + "type":{ + "type":"string", + "description":"Type of the order. Currently, \"EXCHANGE LIMIT\" is the only type that is supported.", + "example":"EXCHANGE LIMIT" + }, + "createdAt":{ + "type":"string", + "description":"The date and time when the order was created.", + "example":"2020-05-09T18:29:56.603Z" + }, + "updatedAt":{ + "type":"string", + "description":"The date and time when the order was last updated.", + "example":"2020-05-09T18:29:56.945Z" + }, + "activatedAt":{ + "type":"string", + "description":"The date and time when the order was activated.", + "example":"2020-05-09T18:29:56.944Z" + }, + "isPostOnly":{ + "type":"boolean", + "description":"Flag to indicate if the order is post-only.", + "example":false + }, + "isHidden":{ + "type":"boolean", + "description":"Flag to indicate if the order is hidden.", + "example":false + }, + "isFillOrKill":{ + "type":"boolean", + "description":"Flag to indicate if fill or kill order.", + "example":false + }, + "isSlippageDisabled":{ + "type":"boolean", + "description":"Flag to indicate if slippage protection is disabled.", + "example":false + }, + "cid":{ + "type":"string", + "description":"An optional user-defined identifier for this order", + "example":"satoshi-order-2083236893" + } + } + }, + "Model7":{ + "type":"array", + "items":{ + "$ref":"#/x-alt-definitions/submitOrderResponse" + } + } + } +} diff --git a/src/spec/tryEndpoint.js b/src/spec/tryEndpoint.js index 1bc4a3f..c51c456 100644 --- a/src/spec/tryEndpoint.js +++ b/src/spec/tryEndpoint.js @@ -1,20 +1,27 @@ +import { getExtraHeaders } from './getExtraHeaders'; +import { getParamExample } from './getParamExample'; + export async function tryEndpoint(endpoint, parameterValues, body) { try { const path = getUrl(endpoint.path, parameterValues, endpoint.parameters); + const extraHeaders = getExtraHeaders(endpoint.headers) const response = await fetch(path, { method: endpoint.method, headers: { Accept: 'application/json', 'Content-Type': 'application/json', + ...extraHeaders }, body, }); - const json = await response.json(); + const responseBody = response.headers.get('Content-Type').includes('application/json') + ? await response.json() + : await response.text() return [null, { status: response.status, statusText: response.statusText, - body: json, + body: responseBody, }]; } catch (err) { return [err]; @@ -23,7 +30,7 @@ export async function tryEndpoint(endpoint, parameterValues, body) { function getUrl(path, parameterValues, parameters) { const getParameterDefaultValue = (name) => - parameters.find((p) => p.name === name)?.['x-example']; + getParamExample(parameters.find((p) => p.name === name)) path = path.replace( /\{([^}]*)\}/g, (_, name) => parameterValues[name] ?? getParameterDefaultValue(name) @@ -32,7 +39,7 @@ function getUrl(path, parameterValues, parameters) { const formatedPath = parameters && parameters.length ? parameters.reduce((acc, current) => { - const currentExample = current['x-example']; + const currentExample = getParamExample(current); const currentValueInParameter = parameterValues[current.name]; if ( diff --git a/src/ui/Docs/TryEndpoint.jsx b/src/ui/Docs/TryEndpoint.jsx index 026edf4..8aea03d 100644 --- a/src/ui/Docs/TryEndpoint.jsx +++ b/src/ui/Docs/TryEndpoint.jsx @@ -10,6 +10,7 @@ import styled from 'styled-components'; import {useLayout} from '../common/Layout/LayoutProvider'; import {PrismCode} from './PrismCode'; import { Details } from './Details'; +import { getParamExample } from '../../spec/getParamExample'; export const TryEndpoint = ({endpoint, method}) => { const [parameterValues, setParameterValues] = useState({}); @@ -45,6 +46,8 @@ export const TryEndpoint = ({endpoint, method}) => { {endpoint.parameters.map((parameter, index) => { const {name, required, description, type} = parameter; + const example = getParamExample(parameter) + return ( { value={parameterValues[name]} onChange={value => setParameterValues(old => ({...old, [name]: value !== '' ? value : null}))} description={description} - placeholder={parameter['x-example']} + placeholder={example} /> ); })} diff --git a/yarn.lock b/yarn.lock index 6995cbe..eb2db84 100644 --- a/yarn.lock +++ b/yarn.lock @@ -3935,6 +3935,11 @@ lodash.debounce@^4: resolved "https://registry.yarnpkg.com/lodash.debounce/-/lodash.debounce-4.0.8.tgz#82d79bff30a67c4005ffd5e2515300ad9ca4d7af" integrity sha1-gteb/zCmfEAF/9XiUVMArZyk168= +lodash.mapvalues@^4.6.0: + version "4.6.0" + resolved "https://registry.yarnpkg.com/lodash.mapvalues/-/lodash.mapvalues-4.6.0.tgz#1bafa5005de9dd6f4f26668c30ca37230cc9689c" + integrity sha1-G6+lAF3p3W9PJmaMMMo3IwzJaJw= + lodash.memoize@^4.1.2: version "4.1.2" resolved "https://registry.yarnpkg.com/lodash.memoize/-/lodash.memoize-4.1.2.tgz#bcc6c49a42a2840ed997f323eada5ecd182e0bfe" From 48b19b957e3a60f378072d986b09e130fdf6f287 Mon Sep 17 00:00:00 2001 From: neozaru Date: Mon, 16 Aug 2021 17:56:00 +0200 Subject: [PATCH 3/8] doc: VEN-54 remove commented code + full lodash --- package.json | 3 ++- src/spec/makePythonCode.js | 2 -- yarn.lock | 5 +++++ 3 files changed, 7 insertions(+), 3 deletions(-) diff --git a/package.json b/package.json index 4f17e20..df3495e 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "deversifi-api-docs", - "version": "0.0.9", + "version": "0.1.0", "private": true, "scripts": { "start": "parcel src/index.html", @@ -12,6 +12,7 @@ "dependencies": { "@babel/polyfill": "^7.8.3", "highlight-words-core": "^1.2.2", + "lodash": "^4.17.21", "lodash.mapvalues": "^4.6.0", "lodash.merge": "^4.6.2", "prismjs": "^1.23.0", diff --git a/src/spec/makePythonCode.js b/src/spec/makePythonCode.js index d786e8e..ba52170 100644 --- a/src/spec/makePythonCode.js +++ b/src/spec/makePythonCode.js @@ -88,8 +88,6 @@ function getHeaders(parameters = []) { getHeadersWithExtras(parameters.filter(parameter => parameter.in === 'header')) ).map(([key, value]) => ` "${key}": "${value}"`) .join(',\n') + '\n' + - // ' "Accept": "application/json",\n' + - // ' "Content-Type": "application/json",\n' + '}\n\n' ); } diff --git a/yarn.lock b/yarn.lock index eb2db84..b01e842 100644 --- a/yarn.lock +++ b/yarn.lock @@ -3980,6 +3980,11 @@ lodash@^4.17.11, lodash@^4.17.13, lodash@^4.17.14, lodash@^4.17.15, lodash@^4.17 resolved "https://registry.yarnpkg.com/lodash/-/lodash-4.17.19.tgz#e48ddedbe30b3321783c5b4301fbd353bc1e4a4b" integrity sha512-JNvd8XER9GQX0v2qJgsaN/mzFCNA5BRe/j8JN9d+tWyGLSodKQHKFicdwNYzWwI3wjRnaKPsGj1XkBjx/F96DQ== +lodash@^4.17.21: + version "4.17.21" + resolved "https://registry.yarnpkg.com/lodash/-/lodash-4.17.21.tgz#679591c564c3bffaae8454cf0b3df370c3d6911c" + integrity sha512-v2kDEe57lecTulaDIuNTPy3Ry4gLGJ6Z1O3vE1krgXZNrsQ+LFTGHVxVjcXPs17LhbZVGedAJv8XZ1tvj5FvSg== + log-symbols@^2.2.0: version "2.2.0" resolved "https://registry.yarnpkg.com/log-symbols/-/log-symbols-2.2.0.tgz#5740e1c5d6f0dfda4ad9323b5332107ef6b4c40a" From 664e1c6910702c04b1281d826c7cdde412ec5cb6 Mon Sep 17 00:00:00 2001 From: neozaru Date: Tue, 14 Sep 2021 14:24:56 +0200 Subject: [PATCH 4/8] doc: VEN-54 hide internal/deprecated + sort resp --- src/spec/getEndpoints.js | 3 ++- src/spec/getSidebar.js | 9 ++++++++- 2 files changed, 10 insertions(+), 2 deletions(-) diff --git a/src/spec/getEndpoints.js b/src/spec/getEndpoints.js index 3aded3c..4d02292 100644 --- a/src/spec/getEndpoints.js +++ b/src/spec/getEndpoints.js @@ -7,6 +7,7 @@ import {makeCppCode, makeWsCppCode} from './mapeCppCode'; import {makeCurlCode} from './makeCurlCode'; import {makeWscatCode} from './makeWscatCode'; import { getParamExample } from './getParamExample'; +import { sortBy } from 'lodash'; export function getEndpoints(spec) { const endpoints = []; @@ -144,7 +145,7 @@ function getResponses(entry) { // TODO: details }); } - return responses; + return sortBy(responses, response => response.code !== 'default'); } function getResponsesDetails(entry) { diff --git a/src/spec/getSidebar.js b/src/spec/getSidebar.js index 6cb0f2e..05ffd2d 100644 --- a/src/spec/getSidebar.js +++ b/src/spec/getSidebar.js @@ -1,5 +1,11 @@ import {forEachEndpoint} from './forEachEndpoint'; +var categoriesToExclude = [ + 'internal', // Here to stay but for internal use + 'deprecated', // Is meant to disapear in the future / not to be used anymore + 'hidden' // Hidden for other reasons (ex: feature not released yet) +] + export function getSidebar(spec) { const categories = new Map(); forEachEndpoint(spec, (entry, orgPath) => { @@ -12,5 +18,6 @@ export function getSidebar(spec) { }); categories.set(categoryName, category); }); - return [...categories.values()]; + return [...categories.values()] + .filter(category => !categoriesToExclude.includes(category.name.toLowerCase())) } From cd3f36d9f17512b2491d68b888ce2b72e9627e78 Mon Sep 17 00:00:00 2001 From: neozaru Date: Tue, 14 Sep 2021 14:25:31 +0200 Subject: [PATCH 5/8] doc: VEN-54 add missing examples + fix some endpts --- src/spec/swagger-overlay.json | 324 +- src/spec/swagger-v12--submitted.json | 15362 +++++++++++++------------ 2 files changed, 7906 insertions(+), 7780 deletions(-) diff --git a/src/spec/swagger-overlay.json b/src/spec/swagger-overlay.json index af6e5f4..fd1a25c 100644 --- a/src/spec/swagger-overlay.json +++ b/src/spec/swagger-overlay.json @@ -670,14 +670,7 @@ }, "/v1/trading/r/getVaultId":{ "post":{ - "title":"Get Vault Id", - "responses":{ - "default":{ - "examples":{ - "application/json":1851736 - } - } - } + "title":"Get Vault Id" } }, "/v1/trading/w/withdraw":{ @@ -715,222 +708,32 @@ }, "/v1/trading/r/getWithdrawal":{ "post":{ - "title":"Get Withdrawal", - "responses":{ - "default":{ - "examples":{ - "application/json":[ - { - "_id":"53cb6b9b4f4ddef1ad47f943", - "ethAddress":"0x14d06788090769f669427b6aea1c0240d2321f34", - "starkKey":"77a3b314db07c45076d11f62b6f9e748a39790441823307743cf00d6597ea43", - "token":"USDT", - "amount":1000, - "createdAt":"2020-01-29T14:13:05.898Z" - } - ] - } - } - } + "title":"Get Withdrawal" } }, "/v1/trading/r/openOrders":{ "post":{ - "title":"All Orders", - "responses":{ - "default":{ - "examples":{ - "application/json":[ - { - "_id": "L1tarX5wUem", - "user": "0xc1caf2d76c49e4a60635635c329a3ac22ddeb547", - "symbol": "ETH:USDT", - "amount": -0.3, - "totalFilled": -0.2, - "price": 200, - "averagePrice": 199.20, - "feeRate": "0.002", - "tokenBuy": "USDT", - "totalBought": "4990000000", - "tokenSell": "ETH", - "totalSold": "45555500", - "active": true, - "type": "EXCHANGE LIMIT", - "createdAt": "2020-05-09T18:29:56.882Z", - "updatedAt": "2020-05-09T18:29:56.893Z", - "activatedAt": "2020-05-09T18:29:56.893Z" - }, - { - "_id": "L1tarX5wUem", - "user": "0xc1caf2d76c49e4a60635635c329a3ac22ddeb547", - "symbol": "BTC:USDT", - "amount": -0.03, - "totalFilled": -0.01, - "price": 8000, - "averagePrice": 7950, - "feeRate": "0.002", - "tokenBuy": "USDT", - "totalBought": "2400000000", - "tokenSell": "BTC", - "totalSold": "30000000", - "active": true, - "type": "EXCHANGE LIMIT", - "createdAt": "2020-05-09T18:29:56.882Z", - "updatedAt": "2020-05-09T18:29:56.893Z", - "activatedAt": "2020-05-09T18:29:56.893Z" - } - ] - } - } - } + "title":"All Orders" } }, "/v1/trading/r/orderHistory":{ "post":{ - "title":"Order History", - "responses":{ - "default":{ - "examples":{ - "application/json":[ - { - "_id": "L1tarX5wUem", - "user": "0xc1caf2d76c49e4a60635635c329a3ac22ddeb547", - "symbol": "ETH:USDT", - "amount": -0.3, - "totalFilled": -0.2, - "price": 200, - "averagePrice": 199.20, - "feeRate": "0.002", - "tokenBuy": "USDT", - "totalBought": "4990000000", - "tokenSell": "ETH", - "totalSold": "45555500", - "active": true, - "type": "EXCHANGE LIMIT", - "createdAt": "2020-05-09T18:29:56.882Z", - "updatedAt": "2020-05-09T18:29:56.893Z", - "activatedAt": "2020-05-09T18:29:56.893Z" - }, - { - "_id": "L1tarX5wUem", - "user": "0xc1caf2d76c49e4a60635635c329a3ac22ddeb547", - "symbol": "BTC:USDT", - "amount": -0.03, - "totalFilled": -0.01, - "price": 8000, - "averagePrice": 7950, - "feeRate": "0.002", - "tokenBuy": "USDT", - "totalBought": "2400000000", - "tokenSell": "BTC", - "totalSold": "30000000", - "active": true, - "type": "EXCHANGE LIMIT", - "createdAt": "2020-05-09T18:29:56.882Z", - "updatedAt": "2020-05-09T18:29:56.893Z", - "activatedAt": "2020-05-09T18:29:56.893Z" - }, - { - "_id": "L1tarX5wUem", - "user": "0xc1caf2d76c49e4a60635635c329a3ac22ddeb547", - "symbol": "BTC:USDT", - "amount": -0.03, - "totalFilled": -0.01, - "price": 8000, - "averagePrice": 7950, - "feeRate": "0.002", - "tokenBuy": "USDT", - "totalBought": "2400000000", - "tokenSell": "BTC", - "totalSold": "30000000", - "active": true, - "type": "EXCHANGE LIMIT", - "createdAt": "2020-05-09T18:29:56.882Z", - "updatedAt": "2020-05-09T18:29:56.893Z", - "activatedAt": "2020-05-09T18:29:56.893Z" - } - ] - } - } - } + "title":"Order History" } }, "/v1/trading/r/withdrawHistory":{ "post":{ - "title":"Withdrawal History", - "responses":{ - "default":{ - "examples":{ - "application/json":[ - { - "_id":"5e318fc4948cc789bb5f7bb4", - "token":"ETH", - "amount":100, - "createdAt":"2020-01-29T14:13:05.898Z", - "readyToWithdrawOnChain": false - }, - { - "_id":"5e318fc4948cc789bb5f7bb5", - "token":"USD", - "amount":27, - "createdAt":"2020-01-30T14:13:05.898Z", - "readyToWithdrawOnChain": true - } - ] - } - } - } + "title":"Withdrawal History" } }, "/v1/trading/w/cancelOrder":{ "post":{ - "title":"Cancel Order", - "responses":{ - "default":{ - "examples":{ - "application/json":{ - "orderId":"d7c8b9" - } - } - }, - "Server Error": { - "examples": { - "application/json":{ - "statusCode": 502, - "error": "Unable to determine the status of order cancellation request" - } - } - } - } + "title":"Cancel Order" } }, "/v1/trading/w/cancelWithdrawal":{ "post":{ - "title":"Cancel Withdrawal", - "responses":{ - "default":{ - "examples":{ - "application/json":{ - "_id": "LCafcGC6tBH", - "token": "USDT", - "amount": "100", - "createdAt": "2020-01-01T22:57:47.323Z", - "readyToWithdrawOnChain": false, - "canceled": true - } - } - }, - "withdrawal not found": { - "examples": { - "application/json":{ - "statusCode": 422, - "error": "WITHDRAWAL_NOT_FOUND", - "message": "WITHDRAWAL_NOT_FOUND", - "type": "DVFError" - } - } - } - } + "title":"Cancel Withdrawal" } }, "/v1/trading/w/deposit":{ @@ -970,119 +773,12 @@ }, "/v1/trading/w/register":{ "post":{ - "title":"Register", - "responses":{ - "default":{ - "examples":{ - "application/json":{ - "DVF":{ - "depositExpiry":720, - "depositNonce":1, - "deversifiAddress":"0x9ab450355b4ab504cbc0e4de484781dac08e6a26", - "starkExContractAddress":"0xF3731d0cdC9834f6F32104580bD226EF1bc1A9F9", - "exchangeSymbols":[ - "tETHUSD", - "tZRXUSD", - "tZRXETH" - ], - "tempStarkVaultId":1 - }, - "tokenRegistry":{ - "ETH":{ - "decimals":18, - "minOrderSize":0.1, - "starkTokenId":"0x1" - }, - "USD":{ - "decimals":6, - "minOrderSize":25, - "settleSpread":-0.026, - "starkTokenId":"0x2", - "tokenAddress":"0xdac17f958d2ee523a2206206994597c13d831ec7" - }, - "ZRX":{ - "decimals":18, - "minOrderSize":40, - "starkTokenId":"22e6d888f32dea3c6e8ba64609a314eebbe1eb704e9e9febe368b0bacb21efe", - "tokenAddress":"0xe41d2489571d322189246dafa5ebde1f4699f498" - } - }, - "isRegistered":true, - "ethAddress":"0x341e46a49f15785373ede443df0220dea6a41bbc" - } - } - } - } + "title":"Register" } }, "/v1/trading/w/submitOrder": { "post": { - "title": "Submit Order", - "summary": "This authenticated endpoint is used to submit an order.", - "operationId": "postV1TradingWSubmitorder", - "parameters": [ - { - "in": "body", - "name": "body", - "schema": { - "$ref": "#/definitions/submitOrderPayload" - } - } - ], - "tags": ["Trading"], - "responses": { - "default": { - "examples": { - "application/json":{ - "pending": true, - "_id": "", - "user": "0xc2fff68dbdb8c0dcceb2b84a921cc2c8004104fa", - "symbol": "ZRX:ETH", - "amount": 50, - "type": "EXCHANGE LIMIT", - "price": 0.005, - "feeRate": 0.002, - "partnerId": "P1", - "meta": { - "ethAddress": "0xc2fff68dbdb8c0dcceb2b84a921cc2c8004104fa", - "starkPublicKey": { - "x": "07fc758ce6d8591c46b34c4c94f37c81f9a2763cf7b4abce7779bfeea582a754", - "y": "12e340b350a82322bae0106b952d5b9a3a80265dfa4228acb8c4e309bacd826" - }, - "starkOrder": { - "vaultIdSell": 1845686579, - "vaultIdBuy": 1671627635, - "amountSell": "25000000", - "amountBuy": "4990000000", - "tokenSell": "0xb333e3142fe16b78628f19bb15afddaef437e72d6d7f5c6c20c6801a27fba6", - "tokenBuy": "0x3901ee6a6c5ac0f6e284f4273b961b7e9f29d25367d31d90b75820473a202f7", - "nonce": 143600912, - "expirationTimestamp": 442384 - }, - "starkMessage": "6157ce5d1df3572f43cfae5742454988218e4106797f0fcbe820a984215803e", - "starkSignature": { - "r": "34fbf0f9eab6b26388e96abfaa9903c257e64f268ab0a3246ac2bcbfc3f5154", - "s": "4836111bf1cb0683b6145ebf667ec01030d7e25d3832f28fadb0dfcd9522b43", - "recoveryParam": 0 - } - }, - "tokenSell": "ETH", - "tokenSellLockedBalance": "25000000", - "tokenBuy": "ZRX", - "createdAt": "2020-05-20T16:24:36.452Z", - "updatedAt": "2020-05-20T16:24:36.452Z" - } - } - }, - "Server Error": { - "examples": { - "application/json": { - "statusCode": 502, - "error": "Unable to determine the status of order submission request" - } - } - } - } + "title": "Submit Order" } }, "/v1/trading/r/getBalanceForUser/{userEthAddress}": { @@ -2335,6 +2031,8 @@ "/v1/trading/r/getTokenHolders": { "get": { "title": "Token Holders" } }, "/v1/trading/r/getTokenLiquidityLeft": { "get": { "title": "Token Liquidity" } }, "/v1/trading/r/getTokenSaleStartEnd": { "get": { "title": "Sale start/end" } }, + "/v1/trading/r/registeredAccounts": { "get": { "title": "Registered Accounts" } }, + "/v1/trading/r/tokenBalancesHistory": { "get": { "title": "Token Balances History" } }, "/v1/trading/r/totalValueLocked": { "get": { "title": "Allowance" } }, "/v1/trading/r/tradeHistory": { "get": { "title": "Trade History" } }, "/v1/trading/r/vaultIdAndStarkKey": { "get": { "title": "VaultId + StarkKey" } }, diff --git a/src/spec/swagger-v12--submitted.json b/src/spec/swagger-v12--submitted.json index fe9f84e..39b5911 100644 --- a/src/spec/swagger-v12--submitted.json +++ b/src/spec/swagger-v12--submitted.json @@ -12,7471 +12,7899 @@ }, "tags": [], "paths":{ - "/v1/trading/allowances":{ - "get":{ - "summary":"This method is used to get the allowance of the user for using DeversiFi features (deposit, withdraw, trade, transfer)", - "operationId":"getV1TradingAllowances", - "parameters":[ - { - "type":"string", - "description":"Base64 of {signature, nonce} JSON representation", - "name":"authorization", - "in":"header", - "x-example":"EcRecover eyJub25jZSI6InYyLTE3MDQxMTQwNjEuMDAwIiwic2lnbmF0dXJlIjoiMHgyYjQ4ZDUzZjJlM2E2OTY2MzBlYmRjZDFmZjA1NzU1NmJiYzlkZTljMjk0YWRmYWE1YjFmMTNkZjkxYjY3YjM0N2ZkZDg4YzI5NTk0YzM3N2JhMDAyNGRlYzQwY2Q5ODA4ODI5ZTdmNDQ0Nzc3MjQ4MmY1MGE3YThlOWE5MDM1NjFjIn0=", - "required":true - } - ], - "tags":[ - "Trading" - ], - "responses":{ - "200":{ - "schema":{ - "$ref":"#/definitions/getAllowanceResponse" - }, - "description":"Successful" - } - } - } - }, - "/v1/trading/balanceHistory":{ - "get":{ - "summary":"Balance history of the authenticated user", - "operationId":"getV1TradingBalancehistory", - "parameters":[ - { - "type":"string", - "description":"Base64 of {signature, nonce} JSON representation", - "name":"authorization", - "in":"header", - "x-example":"EcRecover eyJub25jZSI6InYyLTE3MDQxMTQwNjEuMDAwIiwic2lnbmF0dXJlIjoiMHgyYjQ4ZDUzZjJlM2E2OTY2MzBlYmRjZDFmZjA1NzU1NmJiYzlkZTljMjk0YWRmYWE1YjFmMTNkZjkxYjY3YjM0N2ZkZDg4YzI5NTk0YzM3N2JhMDAyNGRlYzQwY2Q5ODA4ODI5ZTdmNDQ0Nzc3MjQ4MmY1MGE3YThlOWE5MDM1NjFjIn0=", - "required":true - }, - { - "type":"string", - "description":"This nonce which used to provide the time until which this nonce is valid. It is presented as seconds since epoch.", - "name":"nonce", - "in":"query", - "x-example":"v2-1704114061.000", - "required":false - }, - { - "type":"string", - "description":"The signature obtained by signing the nonce with your private ethereum key.", - "name":"signature", - "in":"query", - "x-example":"0x2b48d53f2e3a696630ebdcd1ff057556bbc9de9c294adfaa5b1f13df91b67b347fdd88c29594c377ba0024dec40cd9808829e7f4447772482f50a7a8e9a903561c", - "required":false - }, - { - "type":"string", - "description":"duration for the history to fetch", - "enum":[ - "1d", - "1m", - "1w", - "1y" - ], - "x-convert":{ - "case":"lower" - }, - "name":"duration", - "in":"query", - "x-example":"1d", - "required":true - } - ], - "tags":[ - "Trading" - ], - "responses":{ - "200":{ - "schema":{ - "$ref":"#/definitions/balanceHistorySchema" - }, - "description":"Successful" - } - } - } - }, - "/v1/trading/collateralBalances":{ - "get":{ - "summary":"Returns information about collateral balances (internal use)", - "operationId":"getV1TradingCollateralbalances", - "parameters":[ - { - "type":"string", - "name":"token", - "in":"query", - "required":false - } - ], - "tags":[ - "Internal" - ], - "responses":{ - "200":{ - "schema":{ - "$ref":"#/definitions/collateralBalancesSchema" - }, - "description":"Successful" - } - } - } - }, - "/v1/trading/depositsAndWithdrawals":{ - "get":{ - "summary":"This method is used to get the history of deposits and withdrawals for the authenticated user", - "operationId":"getV1TradingDepositsandwithdrawals", - "parameters":[ - { - "type":"string", - "description":"Base64 of {signature, nonce} JSON representation", - "name":"authorization", - "in":"header", - "x-example":"EcRecover eyJub25jZSI6InYyLTE3MDQxMTQwNjEuMDAwIiwic2lnbmF0dXJlIjoiMHgyYjQ4ZDUzZjJlM2E2OTY2MzBlYmRjZDFmZjA1NzU1NmJiYzlkZTljMjk0YWRmYWE1YjFmMTNkZjkxYjY3YjM0N2ZkZDg4YzI5NTk0YzM3N2JhMDAyNGRlYzQwY2Q5ODA4ODI5ZTdmNDQ0Nzc3MjQ4MmY1MGE3YThlOWE5MDM1NjFjIn0=", - "required":true - }, - { - "type":"string", - "x-convert":{ - "case":"upper" - }, - "name":"token", - "in":"query", - "x-example":"ETH" - }, - { - "type":"string", - "format":"date", - "name":"startDate", - "in":"query", - "x-example":"2020-01-01 13:45" - }, - { - "type":"string", - "format":"date", - "name":"endDate", - "in":"query", - "x-example":"2025-12-31 23:45" - }, - { - "type":"string", - "default":"date", - "enum":[ - "date" - ], - "name":"sortBy", - "in":"query" - }, - { - "type":"string", - "default":"DESC", - "enum":[ - "ASC", - "DESC" - ], - "name":"sortDirection", - "in":"query" - }, - { - "type":"integer", - "default":0, - "minimum":0, - "name":"skip", - "in":"query" - }, - { - "type":"integer", - "default":20, - "minimum":1, - "maximum":100, - "name":"limit", - "in":"query" - } - ], - "tags":[ - "Trading" - ], - "responses":{ - "200":{ - "schema":{ - "$ref":"#/definitions/getDepositsAndWithdrawalsResponse", - "x-alternatives":[ - { - "$ref":"#/x-alt-definitions/getDepositsAndWithdrawalsResponse" - }, - { - "type":"string", - "description":"Response in CSV format", - "example":"id,type,token,amount,transactionHash,date,sourceOrRecipient8oXSt1ry5EZ,Deposit,ETH,0.1,0x43154dc90de6c578d14fbe1ddae352e3a5fdc42d5944b122ac7c6c41f360d76a,1990-04-14T00:00:00.000Z,0x08152c1265dbc218ccc8ab5c574e6bd52279b3b77kyGeby7RR8,FastWithdrawal,USDT,100,0xe2d59c0e5fec11b23fb159483551b28ad80907937908fa5df26ba9b2045d4397,1990-04-14T00:02:00.000Z,0xeb3ea3ea9239577951523cafa9fd3072bc88e50aDDi37hQZSHg,Withdrawal,ETH,0.05,0x2c892f7a0326a380f027b8ef4a1a15747083ba2471313c5a30a8510d3132a18e,1990-04-14T00:04:00.000Z,0x2d5752b42440139a130f453e0c646e6e656dded4" - } - ] - }, - "description":"Successful" - } - } - } - }, - "/v1/trading/entityAccounts":{ - "get":{ - "summary":"This method is used to get the entity account information for user address (KYC)", - "operationId":"getV1TradingEntityaccounts", - "parameters":[ - { - "type":"string", - "description":"Base64 of {signature, nonce} JSON representation", - "name":"authorization", - "in":"header", - "x-example":"EcRecover eyJub25jZSI6InYyLTE3MDQxMTQwNjEuMDAwIiwic2lnbmF0dXJlIjoiMHgyYjQ4ZDUzZjJlM2E2OTY2MzBlYmRjZDFmZjA1NzU1NmJiYzlkZTljMjk0YWRmYWE1YjFmMTNkZjkxYjY3YjM0N2ZkZDg4YzI5NTk0YzM3N2JhMDAyNGRlYzQwY2Q5ODA4ODI5ZTdmNDQ0Nzc3MjQ4MmY1MGE3YThlOWE5MDM1NjFjIn0=", - "required":true - } - ], - "tags":[ - "Trading" - ], - "responses":{ - "200":{ - "schema":{ - "$ref":"#/definitions/Model3" - }, - "description":"Successful" - } - } - } - }, - "/v1/trading/fills":{ - "get":{ - "summary":"This method is used to get the history of fills (executed trades) for the authenticated user", - "operationId":"getV1TradingFills", - "parameters":[ - { - "type":"string", - "description":"Base64 of {signature, nonce} JSON representation", - "name":"authorization", - "in":"header", - "x-example":"EcRecover eyJub25jZSI6InYyLTE3MDQxMTQwNjEuMDAwIiwic2lnbmF0dXJlIjoiMHgyYjQ4ZDUzZjJlM2E2OTY2MzBlYmRjZDFmZjA1NzU1NmJiYzlkZTljMjk0YWRmYWE1YjFmMTNkZjkxYjY3YjM0N2ZkZDg4YzI5NTk0YzM3N2JhMDAyNGRlYzQwY2Q5ODA4ODI5ZTdmNDQ0Nzc3MjQ4MmY1MGE3YThlOWE5MDM1NjFjIn0=", - "required":true - }, - { - "type":"string", - "x-convert":{ - "case":"upper" - }, - "name":"symbol", - "in":"query" - }, - { - "type":"string", - "format":"date", - "name":"startDate", - "in":"query", - "x-example":"2020-01-01 13:45" - }, - { - "type":"string", - "format":"date", - "name":"endDate", - "in":"query", - "x-example":"2025-12-31 23:45" - }, - { - "type":"string", - "default":"date", - "enum":[ - "date" - ], - "name":"sortBy", - "in":"query" - }, - { - "type":"string", - "default":"DESC", - "enum":[ - "ASC", - "DESC" - ], - "name":"sortDirection", - "in":"query" - }, - { - "type":"integer", - "default":0, - "minimum":0, - "name":"skip", - "in":"query" - }, - { - "type":"integer", - "default":20, - "minimum":1, - "maximum":100, - "name":"limit", - "in":"query" - } - ], - "tags":[ - "Trading" - ], - "responses":{ - "200":{ - "schema":{ - "$ref":"#/definitions/getFillsResponse", - "x-alternatives":[ - { - "$ref":"#/x-alt-definitions/getFillsResponse" - }, - { - "type":"string", - "description":"Response in CSV format", - "example":"fillId,orderId,symbol,fillAmount,orderAmount,price,date,orderCreationDate,orderType,orderActive,orderCanceled606f4123baed6ee2d25f1f1f,79qiFBVDfbz,ZRX:USDT,-0.125622,-1,209.9,1990-04-14T00:00:00.000Z,2020-11-11T16:37:05.262Z,EXCHANGE LIMIT,false,false606f4123baed6ee2d25f1f32,7vVPHzETRQY,ZRX:USDT,-0.125622,-1,209.9,1990-04-14T00:02:00.000Z,2020-11-11T16:37:05.262Z,EXCHANGE LIMIT,false,false606f4123baed6ee2d25f1f2d,GuKPHMafYU1,ZRX:USDT,-0.125622,-1,209.9,1990-04-14T00:04:00.000Z,2020-11-11T16:37:05.262Z,EXCHANGE LIMIT,false,false606f4123baed6ee2d25f1f25,6h1i8x5apLe,ZRX:USDT,-0.125622,-1,209.9,1990-04-14T00:06:00.000Z,2020-11-11T16:37:05.262Z,EXCHANGE LIMIT,false,false606f4123baed6ee2d25f1f27,MwEnHW1MF5y,ZRX:USDT,-0.125622,-1,209.9,1990-04-14T00:08:00.000Z,2020-11-11T16:37:05.262Z,EXCHANGE LIMIT,false,false" - } - ] - }, - "description":"Successful" - } - } - } - }, - "/v1/trading/transfers":{ - "get":{ - "summary":"This method is used to get the history of transfers for the authenticated user", - "operationId":"getV1TradingTransfers", - "parameters":[ - { - "type":"string", - "description":"Base64 of {signature, nonce} JSON representation", - "name":"authorization", - "in":"header", - "x-example":"EcRecover eyJub25jZSI6InYyLTE3MDQxMTQwNjEuMDAwIiwic2lnbmF0dXJlIjoiMHgyYjQ4ZDUzZjJlM2E2OTY2MzBlYmRjZDFmZjA1NzU1NmJiYzlkZTljMjk0YWRmYWE1YjFmMTNkZjkxYjY3YjM0N2ZkZDg4YzI5NTk0YzM3N2JhMDAyNGRlYzQwY2Q5ODA4ODI5ZTdmNDQ0Nzc3MjQ4MmY1MGE3YThlOWE5MDM1NjFjIn0=", - "required":true - }, - { - "type":"string", - "x-convert":{ - "case":"upper" - }, - "name":"token", - "in":"query" - }, - { - "type":"string", - "format":"date", - "name":"startDate", - "in":"query", - "x-example":"2020-01-01 13:45" - }, - { - "type":"string", - "format":"date", - "name":"endDate", - "in":"query", - "x-example":"2025-12-31 23:45" - }, - { - "type":"string", - "default":"date", - "enum":[ - "date" - ], - "name":"sortBy", - "in":"query" - }, - { - "type":"string", - "default":"DESC", - "enum":[ - "ASC", - "DESC" - ], - "name":"sortDirection", - "in":"query" - }, - { - "type":"integer", - "default":0, - "minimum":0, - "name":"skip", - "in":"query" - }, - { - "type":"integer", - "default":20, - "minimum":1, - "maximum":100, - "name":"limit", - "in":"query" - } - ], - "tags":[ - "Trading" - ], - "responses":{ - "200":{ - "schema":{ - "$ref":"#/definitions/getTransfersResponse", - "x-alternatives":[ - { - "$ref":"#/x-alt-definitions/getTransfersResponse" - }, - { - "type":"string", - "description":"List of past transfers in CSV format", - "example":"id,token,amount,feeAmount,source,recipient,memo,date9oWC74UdzWJ,ZRX,0.05,0.001,0x08152c1265dBc218ccc8Ab5C574e6bD52279b3B7,0xeb3ea3ea9239577951523cafa9fd3072bc88e50a,reference,1990-04-14T00:00:00.000ZJtCAHChHhmU,ZRX,0.05,0.001,0x08152c1265dBc218ccc8Ab5C574e6bD52279b3B7,0xeb3ea3ea9239577951523cafa9fd3072bc88e50a,,1990-04-14T00:02:00.000ZA1vFQzqYMXu,ZRX,0.05,0.001,0x08152c1265dBc218ccc8Ab5C574e6bD52279b3B7,0xeb3ea3ea9239577951523cafa9fd3072bc88e50a,,1990-04-14T00:04:00.000Z8xFu925f72r,ZRX,0.05,0.001,0x08152c1265dBc218ccc8Ab5C574e6bD52279b3B7,0xeb3ea3ea9239577951523cafa9fd3072bc88e50a,,1990-04-14T00:06:00.000Z" - } - ] - }, - "description":"Successful" - } - } - } - }, - "/v1/trading/amm/fundingOrderData":{ - "get":{ - "summary":"Get data for AmmFundingOrder, for given token and amount.", - "operationId":"getV1TradingAmmFundingorderdata", - "description":"In order to get data for a deposit order, provide one of the tokens and the amount you want to deposit. The response will contain information on how much of the other pool token you need to deposit and how many LP tokens you will get in return.\nIn order to get data for a withdrawal, set token to pools LP token and provide the amount of it which you wish to exchange for pool tokens. The response will conatin information about how much of the pool tokens you will get in return.\nData returned by this end point can be used to actually request a deposit/withdrawal via POST app/fundingOrders.", - "parameters":[ - { - "type":"string", - "description":"Base64 of {signature, nonce} JSON representation", - "name":"authorization", - "in":"header", - "x-example":"EcRecover eyJub25jZSI6InYyLTE3MDQxMTQwNjEuMDAwIiwic2lnbmF0dXJlIjoiMHgyYjQ4ZDUzZjJlM2E2OTY2MzBlYmRjZDFmZjA1NzU1NmJiYzlkZTljMjk0YWRmYWE1YjFmMTNkZjkxYjY3YjM0N2ZkZDg4YzI5NTk0YzM3N2JhMDAyNGRlYzQwY2Q5ODA4ODI5ZTdmNDQ0Nzc3MjQ4MmY1MGE3YThlOWE5MDM1NjFjIn0=", - "required":true - }, - { - "type":"string", - "name":"pool", - "in":"query", - "x-example":"ETH:USDT" - }, - { - "type":"string", - "name":"token", - "in":"query", - "x-example":"ETH" - }, - { - "type":"string", - "name":"amount", - "in":"query", - "x-example":1 - } - ], - "tags":[ - "Trading", - "AMM" - ], - "responses":{ - "200":{ - "schema":{ - "$ref":"#/definitions/AmmFundingOrderDataGetResponse" - }, - "description":"Successful" - } - } - } - }, - "/v1/trading/r/30DaysVolume":{ - "get":{ - "summary":"Request information regarding the trading volume of a specific address for the last 30 days. The request returns the overall trading volume details for all tokens in USD as well as the trading volume per token. Results are cached for 60 minutes.", - "operationId":"getV1TradingR30daysvolume", - "parameters":[ - { - "type":"string", - "description":"This nonce which used to provide the time until which this nonce is valid. It is presented as seconds since epoch.", - "name":"nonce", - "in":"query", - "x-example":"v2-1704114061.000", - "required":false - }, - { - "type":"string", - "description":"The signature obtained by signing the nonce with your private ethereum key.", - "name":"signature", - "in":"query", - "x-example":"0x2b48d53f2e3a696630ebdcd1ff057556bbc9de9c294adfaa5b1f13df91b67b347fdd88c29594c377ba0024dec40cd9808829e7f4447772482f50a7a8e9a903561c", - "required":false - } - ], - "tags":[ - "Market" - ], - "responses":{ - "200":{ - "schema":{ - "$ref":"#/definitions/30DaysVolumeResponse" - }, - "description":"Successful" - } - } - } - }, - "/v1/trading/r/USDRanking":{ - "get":{ - "summary":"This returns a user ranking by overall trading volume quoted in USD. If the parameters startDate and endDate are provided, the ranking includes only trading volume within that window of time.", - "operationId":"getV1TradingRUsdranking", - "parameters":[ - { - "type":"number", - "description":"The start date and time (Unix timestamp in milliseconds) for which the trade volumes are requested. If startDate and endDate are not provided, it returns the volume ranking if all time.", - "name":"startDate", - "in":"query", - "x-example":1577836800000 - }, - { - "type":"number", - "description":"The end date and time (Unix timestamp in milliseconds) for which events are requested.If startDate and endDate are not provided, it returns the volume ranking if all time.", - "name":"endDate", - "in":"query", - "x-example":1747384800000 - } - ], - "tags":[ - "Market" - ], - "responses":{ - "default":{ - "schema":{ - "$ref":"#/definitions/USDRankingResponse" - }, - "description":"Ranked output of all trading volumes for all the tokens." - } - } - } - }, - "/v1/trading/r/User24HoursVolume":{ - "get":{ - "summary":"Request information regarding the trading volume of a specific address for the last 24 hours. The request returns the overall trading volume details for all tokens in USD as well as the trading volume per token. Results are cached for 2 minutes.", - "operationId":"getV1TradingRUser24hoursvolume", - "parameters":[ - { - "type":"string", - "description":"This nonce which used to provide the time until which this nonce is valid. It is presented as seconds since epoch.", - "name":"nonce", - "in":"query", - "x-example":"v2-1704114061.000", - "required":false - }, - { - "type":"string", - "description":"The signature obtained by signing the nonce with your private ethereum key.", - "name":"signature", - "in":"query", - "x-example":"0x2b48d53f2e3a696630ebdcd1ff057556bbc9de9c294adfaa5b1f13df91b67b347fdd88c29594c377ba0024dec40cd9808829e7f4447772482f50a7a8e9a903561c", - "required":false - } - ], - "tags":[ - "Market" - ], - "responses":{ - "200":{ - "schema":{ - "$ref":"#/definitions/User24HoursVolumeResponse" - }, - "description":"Successful" - }, - "default":{ - "schema":{ - "$ref":"#/definitions/Model9" - }, - "description":"Returns the overall trading volume details of a specific address for all tokens in USD as well as the trading volume per trading pair fot the last 24 hours." - } - } - } - }, - "/v1/trading/r/airdropEligibility":{ - "get":{ - "summary":"Returns the eligible DVF airdrop amount for the given address", - "operationId":"getV1TradingRAirdropeligibility", - "parameters":[ - { - "type":"string", - "description":"Ethereum address", - "name":"ethAddress", - "in":"query", - "x-example":"0x3f2b822E9A8312C6DafBF9686a5e335Af0E4D33B" - }, - { - "type":"string", - "description":"token for the airdrop", - "name":"token", - "in":"query", - "x-example":"DVF" - } - ], - "tags":[ - "Trading" - ], - "responses":{ - "200":{ - "schema":{ - "$ref":"#/definitions/Model11" - }, - "description":"Successful" - } - } - } - }, - "/v1/trading/r/beehiveStats":{ - "get":{ - "summary":"Request information regarding beehive liquidity and apy.", - "operationId":"getV1TradingRBeehivestats", - "tags":[ - "Market" - ], - "responses":{ - "200":{ - "schema":{ - "$ref":"#/definitions/beehiveStatsResponse" - }, - "description":"Successful" - }, - "default":{ - "schema":{ - "$ref":"#/definitions/Model12" - }, - "description":"Returns behive stats" - } - } - } - }, - "/v1/trading/r/estimatedNextBatchTime":{ - "get":{ - "summary":"Returns a countdown until the expected next batch proof is submitted onto the blockchain and the average time of previous batches. The next batch will include all pending withdrawals.", - "operationId":"getV1TradingREstimatednextbatchtime", - "tags":[ - "Market" - ], - "responses":{ - "default":{ - "schema":{ - "$ref":"#/definitions/estimatedNextBatchResponse" - }, - "description":"Returns the amount of time remaining until the batch is posted to Ethereum." - } - } - } - }, - "/v1/trading/r/fastWithdrawalFee":{ - "get":{ - "summary":"Returns a range of gas price options.", - "operationId":"getV1TradingRFastwithdrawalfee", - "parameters":[ - { - "type":"string", - "description":"token to be withdrawn", - "name":"token", - "in":"query", - "x-example":"BTC" - } - ], - "tags":[ - "Trading" - ], - "responses":{ - "200":{ - "schema":{ - "$ref":"#/definitions/Model13" - }, - "description":"Successful" - } - } - } - }, - "/v1/trading/r/fastWithdrawalMaxAmount":{ - "get":{ - "summary":"Returns max amount available for fast withdrawal (before fees).", - "operationId":"getV1TradingRFastwithdrawalmaxamount", - "parameters":[ - { - "type":"string", - "description":"token to be withdrawn", - "name":"token", - "in":"query", - "x-example":"BTC" - } - ], - "tags":[ - "Trading" - ], - "responses":{ - "200":{ - "schema":{ - "$ref":"#/definitions/Model14" - }, - "description":"Successful" - } - } - } - }, - "/v1/trading/r/feeRate":{ - "get":{ - "summary":"Return current fee rate for a given address. This rate is dependent on the trading volume of the user.", - "operationId":"getV1TradingRFeerate", - "parameters":[ - { - "type":"string", - "description":"This nonce which used to provide the time until which this nonce is valid. It is presented as seconds since epoch.", - "name":"nonce", - "in":"query", - "x-example":"v2-1704114061.000", - "required":false - }, - { - "type":"string", - "description":"The signature obtained by signing the nonce with your private ethereum key.", - "name":"signature", - "in":"query", - "x-example":"0x2b48d53f2e3a696630ebdcd1ff057556bbc9de9c294adfaa5b1f13df91b67b347fdd88c29594c377ba0024dec40cd9808829e7f4447772482f50a7a8e9a903561c", - "required":false - }, - { - "type":"string", - "description":"Symbol for which the fee rate will be returned", - "name":"symbol", - "in":"query", - "x-example":"ETH:USDT" - }, - { - "type":"string", - "description":"Feature for which the fee rate will be returned", - "name":"feature", - "in":"query", - "x-example":"TRADING" - } - ], - "tags":[ - "Trading" - ], - "responses":{ - "200":{ - "schema":{ - "$ref":"#/definitions/getFeeRateResponse" - }, - "description":"Successful" - } - } - } - }, - "/v1/trading/r/gasSavings":{ - "get":{ - "summary":"Returns gas savings metrics", - "operationId":"getV1TradingRGassavings", - "tags":[ - "Trading" - ], - "responses":{ - "200":{ - "schema":{ - "$ref":"#/definitions/gasSavingsResponse" - }, - "description":"Successful" - } - } - } - }, - "/v1/trading/r/getBalanceUsd":{ - "get":{ - "summary":"This is used to retrieve the sum of all user balances converted to USD.", - "operationId":"getV1TradingRGetbalanceusd", - "parameters":[ - { - "type":"string", - "description":"This nonce which used to provide the time until which this nonce is valid. It is presented as seconds since epoch.", - "name":"nonce", - "in":"query", - "x-example":"v2-1704114061.000", - "required":false - }, - { - "type":"string", - "description":"The signature obtained by signing the nonce with your private ethereum key.", - "name":"signature", - "in":"query", - "x-example":"0x2b48d53f2e3a696630ebdcd1ff057556bbc9de9c294adfaa5b1f13df91b67b347fdd88c29594c377ba0024dec40cd9808829e7f4447772482f50a7a8e9a903561c", - "required":false - } - ], - "tags":[ - "Trading" - ], - "responses":{ - "default":{ - "schema":{ - "$ref":"#/definitions/getBalanceUsdResponse" - }, - "description":"Returns the sum of all user balances converted to USD." - } - } - } - }, - "/v1/trading/r/getConf":{ - "get":{ - "summary":"Returns the DeversiFi application configuration details.", - "operationId":"getV1TradingRGetconf", - "tags":[ - "Trading" - ], - "responses":{ - "200":{ - "schema":{ - "$ref":"#/definitions/getConfResponse" - }, - "description":"Successful" - } - } - }, - "post":{ - "summary":"Returns the DeversiFi application configuration details.", - "operationId":"postV1TradingRGetconf", - "tags":[ - "Trading" - ], - "responses":{ - "200":{ - "schema":{ - "$ref":"#/definitions/getConfResponse" - }, - "description":"Successful" - } - } - } - }, - "/v1/trading/r/getGasPrice":{ - "get":{ - "summary":"Returns a range of gas price options.", - "operationId":"getV1TradingRGetgasprice", - "tags":[ - "Trading" - ], - "responses":{ - "200":{ - "description":"Range of gas prices for on chain confirmation speed", - "schema":{ - "$ref":"#/definitions/getGasPriceResponse" - } - } - } - }, - "post":{ - "summary":"Returns a range of gas price options.", - "operationId":"postV1TradingRGetgasprice", - "tags":[ - "Trading" - ], - "responses":{ - "200":{ - "description":"Range of gas prices for on chain confirmation speed", - "schema":{ - "$ref":"#/definitions/getGasPriceResponse" - } - } - }, - "deprecated":true - } - }, - "/v1/trading/r/getPublicPermissions":{ - "get":{ - "summary":"A descriptor object for all user permissions available", - "operationId":"getV1TradingRGetpublicpermissions", - "tags":[ - "public" - ], - "responses":{ - "200":{ - "schema":{ - "$ref":"#/definitions/Model15" - }, - "description":"Successful" - } - } - } - }, - "/v1/trading/r/getTokenCirculatingSupply":{ - "get":{ - "summary":"Returns token liquidity left", - "operationId":"getV1TradingRGettokencirculatingsupply", - "parameters":[ - { - "type":"string", - "description":"Token for which to get the circulating supply", - "name":"token", - "in":"query", - "x-example":"DVF" - } - ], - "tags":[ - "Trading" - ], - "responses":{ - "200":{ - "description":"Circulating supply", - "schema":{ - "type":"number", - "description":"Circulating supply", - "example":10 - } - } - } - } - }, - "/v1/trading/r/getTokenHolders":{ - "get":{ - "summary":"Returns token holders count for a given token", - "operationId":"getV1TradingRGettokenholders", - "parameters":[ - { - "type":"string", - "description":"Token for which to get the holders count", - "name":"token", - "in":"query", - "x-example":"DVF" - } - ], - "tags":[ - "Trading" - ], - "responses":{ - "200":{ - "schema":{ - "type":"number", - "example":452083 - }, - "description":"Successful" - } - } - } - }, - "/v1/trading/r/getTokenLiquidityLeft":{ - "get":{ - "summary":"Returns token liquidity left", - "operationId":"getV1TradingRGettokenliquidityleft", - "parameters":[ - { - "type":"string", - "description":"Token for which to get the liquidity left", - "name":"token", - "in":"query", - "x-example":"DVF" - } - ], - "tags":[ - "Trading" - ], - "responses":{ - "200":{ - "schema":{ - "$ref":"#/definitions/Model16" - }, - "description":"Successful" - } - } - } - }, - "/v1/trading/r/getTokenSaleStartEnd":{ - "get":{ - "summary":"Returns token sale start and end time", - "operationId":"getV1TradingRGettokensalestartend", - "parameters":[ - { - "type":"string", - "description":"Token for which to get the sale start and end time", - "name":"token", - "in":"query", - "x-example":"DVF" - } - ], - "tags":[ - "Trading" - ], - "responses":{ - "200":{ - "schema":{ - "$ref":"#/definitions/tokenSaleStartEndResponse" - }, - "description":"Successful" - } - } - } - }, - "/v1/trading/r/last24HoursVolume":{ - "get":{ - "summary":"Request information regarding the trading volume for the last 24 hours. The request returns the overall trading volume details in USD as well as the trading volume per token in USD and the native token.", - "operationId":"getV1TradingRLast24hoursvolume", - "tags":[ - "Market" - ], - "responses":{ - "default":{ - "schema":{ - "$ref":"#/definitions/last24HoursVolumeResponse" - }, - "description":"Returns the trading volume of the last 24 hours." - } - } - } - }, - "/v1/trading/r/swapVolume":{ - "get":{ - "summary":"Get swap functionality volume information for a specific token related pairs", - "operationId":"getV1TradingRSwapvolume", - "parameters":[ - { - "type":"string", - "description":"Token whose related pair volumes will be calculated", - "name":"token", - "in":"query", - "x-example":"ETH", - "required":true - }, - { - "type":"number", - "description":"Date of the volume", - "name":"date", - "in":"query", - "x-example":1577836800000, - "required":true - } - ], - "tags":[ - "Market" - ], - "responses":{ - "200":{ - "schema":{ - "$ref":"#/definitions/Model17" - }, - "description":"Successful" - } - } - } - }, - "/v1/trading/r/tokenRanking":{ - "get":{ - "summary":"This returns a user ranking by trading volume for a chosen token. If the parameters startDate and endDate are provided, the ranking includes only trading volume within that window of time. All volumes are quoted in ETH.", - "operationId":"getV1TradingRTokenranking", - "parameters":[ - { - "type":"string", - "description":"The currency relating to the requested trading volume information.", - "name":"currency", - "in":"query", - "x-example":"ETH", - "required":true - }, - { - "type":"number", - "description":"The start date and time (Unix timestamp in milliseconds) for which the trade volumes are requested. If startDate and endDate are not provided, it returns the volume ranking if all time.", - "name":"startDate", - "in":"query", - "x-example":1527836800000 - }, - { - "type":"number", - "description":"The end date and time (Unix timestamp in milliseconds) for which the trade volumes are requested. If startDate and endDate are not provided, it returns the volume ranking if all time.", - "name":"endDate", - "in":"query", - "x-example":1747384800000 - } - ], - "tags":[ - "Market" - ], - "responses":{ - "default":{ - "schema":{ - "$ref":"#/definitions/tokenRankingResponse" - }, - "description":"Returns a ranked output of all the trading volumes for a given crypto currency. All the Volumes are quoted in ETH." - } - } - } - }, - "/v1/trading/r/totalValueLocked":{ - "get":{ - "summary":"Returns total value locked by day within a given timerange", - "operationId":"getV1TradingRTotalvaluelocked", - "parameters":[ - { - "type":"string", - "format":"date", - "description":"Date from which to get TVL data", - "name":"startDate", - "in":"query", - "x-example":"2020-04-21" - }, - { - "type":"string", - "format":"date", - "description":"Date until which to get TVL data", - "name":"endDate", - "in":"query", - "x-example":"2020-05-21" - }, - { - "type":"string", - "description":"Optional, Token for which to get TVL data", - "name":"token", - "in":"query", - "required":false - } - ], - "tags":[ - "Trading" - ], - "responses":{ - "200":{ - "schema":{ - "$ref":"#/definitions/totalValueLockedResponse" - }, - "description":"Successful" - } - } - } - }, - "/v1/trading/r/tradeCountSince":{ - "get":{ - "summary":"Returns deversifi finished order count from specified date", - "operationId":"getV1TradingRTradecountsince", - "parameters":[ - { - "type":"string", - "format":"date", - "description":"Date since when orders are counted.", - "name":"startDate", - "in":"query", - "x-example":"2020-07-21T13:19:08.241Z", - "required":true - } - ], - "tags":[ - "Market" - ], - "responses":{ - "200":{ - "schema":{ - "$ref":"#/definitions/Model18" - }, - "description":"Successful" - } - } - } - }, - "/v1/trading/r/tradeHistory":{ - "get":{ - "summary":"This method is used to retrieve a list of all past executed trades for a user. This includes the different trades that have been settled for each fully executed or partially executed order.", - "operationId":"getV1TradingRTradehistory", - "parameters":[ - { - "type":"string", - "description":"This nonce which used to provide the time until which this nonce is valid. It is presented as seconds since epoch.", - "name":"nonce", - "in":"query", - "x-example":"v2-1704114061.000", - "required":false - }, - { - "type":"string", - "description":"The signature obtained by signing the nonce with your private ethereum key.", - "name":"signature", - "in":"query", - "x-example":"0x2b48d53f2e3a696630ebdcd1ff057556bbc9de9c294adfaa5b1f13df91b67b347fdd88c29594c377ba0024dec40cd9808829e7f4447772482f50a7a8e9a903561c", - "required":false - } - ], - "produces":[ - "text/csv" - ], - "tags":[ - "Trading" - ], - "responses":{ - "200":{ - "description":"Returns executed trades as a CSV file", - "schema":{ - "type":"string", - "example":"exchange_name,account_name,trade_date,buy_asset,sell_asset,buy_amount,sell_amount,exchange_order_id,fee_asset,fee_amount,transaction_type,clarification\nDeversiFi,0x08152c1265dbc218ccc8ab5c574e6bd52279b3b7,2021-01-21T16:08:39,USDT,ETH,40.918,1,NHX5FcipBCZ,USDT,0.082,trade,\nDeversiFi,0x08152c1265dbc218ccc8ab5c574e6bd52279b3b7,2021-01-20T18:30:54,USDT,ETH,41.916,1,2f7tKwGqR8v,USDT,0.084,trade,\nDeversiFi,0x08152c1265dbc218ccc8ab5c574e6bd52279b3b7,2021-01-19T10:16:31,USDT,ETH,38.6226,0.9,KRSbMNKyDwu,USDT,0.0774,trade," - } - } - } - } - }, - "/v1/trading/r/transferVolume":{ - "get":{ - "summary":"Get transfer functionality volume information for a specific token", - "operationId":"getV1TradingRTransfervolume", - "parameters":[ - { - "type":"string", - "description":"Token whose transfer volumes will be calculated", - "name":"token", - "in":"query", - "x-example":"ETH", - "required":true - }, - { - "type":"number", - "description":"Date of the volume", - "name":"date", - "in":"query", - "x-example":1577836800000, - "required":true - } - ], - "tags":[ - "Market" - ], - "responses":{ - "200":{ - "schema":{ - "$ref":"#/definitions/Model19" - }, - "description":"Successful" - } - } - } - }, - "/v1/trading/r/vaultIdAndStarkKey":{ - "get":{ - "summary":"Gets the stark public key and vault id for the user registered with and token", - "operationId":"getV1TradingRVaultidandstarkkey", - "parameters":[ - { - "type":"string", - "description":"This nonce which used to provide the time until which this nonce is valid. It is presented as seconds since epoch.", - "name":"nonce", - "in":"query", - "x-example":"v2-1704114061.000", - "required":false - }, - { - "type":"string", - "description":"The signature obtained by signing the nonce with your private ethereum key.", - "name":"signature", - "in":"query", - "x-example":"0x2b48d53f2e3a696630ebdcd1ff057556bbc9de9c294adfaa5b1f13df91b67b347fdd88c29594c377ba0024dec40cd9808829e7f4447772482f50a7a8e9a903561c", - "required":false - }, - { - "type":"string", - "description":"The ETH address of a registered user", - "name":"targetEthAddress", - "in":"query", - "x-example":"0x08152c1265dbc218ccc8ab5c574e6bd52279b3b7", - "required":true - }, - { - "type":"string", - "description":"The token for which we want retrieve the vault ID", - "name":"token", - "in":"query", - "x-example":"ETH", - "required":true - } - ], - "tags":[ - "Trading" - ], - "responses":{ - "200":{ - "schema":{ - "$ref":"#/definitions/vaultIdAndStarkKeyResponse" - }, - "description":"Successful" - }, - "404":{ - "description":"When there is no user registered with given `targetEthAddress`" - } - } - } - }, - "/v1/trading/r/votingPower":{ - "get":{ - "summary":"Returns total xDVF balance of exchange users and calculated voting power based on input amount", - "operationId":"getV1TradingRVotingpower", - "parameters":[ - { - "type":"string", - "description":"Amount of xDVF ", - "name":"amount", - "in":"query", - "x-example":"55" - } - ], - "tags":[ - "Trading" - ], - "responses":{ - "200":{ - "schema":{ - "$ref":"#/definitions/votingPowerResponse" - }, - "description":"Successful" - } - } - } - }, - "/v1/trading/registrations/{targetEthAddress}":{ - "get":{ - "summary":"This method is used to retrieve the registration statuses of the given eth address", - "operationId":"getV1TradingRegistrationsTargetethaddress", - "parameters":[ - { - "type":"string", - "description":"The ETH address of a potential user", - "name":"targetEthAddress", - "in":"path", - "x-example":"0x3f2b822E9A8312C6DafBF9686a5e335Af0E4D33B", - "required":true - } - ], - "tags":[ - "Trading" - ], - "responses":{ - "200":{ - "schema":{ - "$ref":"#/definitions/Model20" - }, - "description":"Successful" - } - } - } - }, - "/v1/trading/r/publicTradeHistory/{user}":{ - "get":{ - "summary":"This method is used to retrieve a list of all past executed trades for a user. This includes the different trades that have been settled for each fully executed or partially executed order.", - "operationId":"getV1TradingRPublictradehistoryUser", - "parameters":[ - { - "type":"string", - "description":"The ETH address of a potential user", - "name":"user", - "in":"path", - "x-example":"0x3f2b822E9A8312C6DafBF9686a5e335Af0E4D33B", - "required":true - } - ], - "tags":[ - "Trading", - "public" - ], - "responses":{ - "200":{ - "schema":{ - "$ref":"#/definitions/Model23" - }, - "description":"Successful" - }, - "401":{ - "description":"User has not authorized the use of this endpoint for their address" - } - } - } - }, - "/v1/trading/r/trades/{symbol}":{ - "get":{ - "summary":"Request information regarding all recently completed trades for a given market pair.", - "operationId":"getV1TradingRTradesSymbol", - "parameters":[ - { - "type":"string", - "description":"The market trading pair in deversifi format i.e BASE:QUOTE", - "name":"symbol", - "in":"path", - "x-example":"ETH:USDT", - "required":true - } - ], - "tags":[ - "Market" - ], - "responses":{ - "default":{ - "schema":{ - "$ref":"#/definitions/tradesResponse" - }, - "description":"The trades endpoint returns data on all recently completed trades for a given market pair for the past 24 hours" - } - } - } - }, - "/v1/trading/r/24HoursVolume/{year}/{month}/{day}":{ - "get":{ - "summary":"Request information regarding the trading volume for a specific date. The request returns the overall trading volume details for all tokens in USD as well as the trading volume per token.", - "operationId":"getV1TradingR24hoursvolumeYearMonthDay", - "parameters":[ - { - "type":"number", - "description":"The year of the specific trading volume request date - in this case 2020.", - "name":"year", - "in":"path", - "x-example":"2020", - "required":true - }, - { - "type":"number", - "description":"The month of the specific trading volume request date - in this case 01 (January).", - "name":"month", - "in":"path", - "x-example":"01", - "required":true - }, - { - "type":"number", - "description":"The day of the specific trading volume request date - in this case 01 (1st of a month).", - "name":"day", - "in":"path", - "x-example":"01", - "required":true - } - ], - "tags":[ - "Market" - ], - "responses":{ - "default":{ - "schema":{ - "$ref":"#/definitions/24HoursVolumeResponse" - }, - "description":"Returns the overall trading volume details for all tokens in USD as well as the trading volume per trading pair." - } - } - } - }, - "/v1/trading/r/tradesSince/{symbol}/{startDate}/{limit}":{ - "get":{ - "summary":"Request information regarding all completed trades in a time range for a given market pair", - "operationId":"getV1TradingRTradessinceSymbolStartdateLimit", - "parameters":[ - { - "type":"string", - "description":"The market trading pair in deversifi format i.e BASE:QUOTE", - "name":"symbol", - "in":"path", - "x-example":"ETH:BTC", - "required":true - }, - { - "type":"number", - "description":"Date of the last trade returned.", - "name":"startDate", - "in":"path", - "x-example":1747384800000, - "required":true - }, - { - "type":"number", - "description":"Limit of trades that will be returned. With a maximum limit of 1000.", - "name":"limit", - "in":"path", - "x-example":60 - } - ], - "tags":[ - "Market" - ], - "responses":{ - "default":{ - "schema":{ - "$ref":"#/definitions/Model25" - }, - "description":"Returns data on all recently completed trades for a given market pair during a time range" - } - } - } - }, - "/v1/trading/bridgedDeposits":{ - "post":{ - "summary":"Create Stark V2 BridgedDepositRequest", - "operationId":"postV1TradingBridgeddeposits", - "parameters":[ - { - "type":"string", - "description":"Base64 of {signature, nonce} JSON representation", - "name":"authorization", - "in":"header", - "x-example":"EcRecover eyJub25jZSI6InYyLTE3MDQxMTQwNjEuMDAwIiwic2lnbmF0dXJlIjoiMHgyYjQ4ZDUzZjJlM2E2OTY2MzBlYmRjZDFmZjA1NzU1NmJiYzlkZTljMjk0YWRmYWE1YjFmMTNkZjkxYjY3YjM0N2ZkZDg4YzI5NTk0YzM3N2JhMDAyNGRlYzQwY2Q5ODA4ODI5ZTdmNDQ0Nzc3MjQ4MmY1MGE3YThlOWE5MDM1NjFjIn0=", - "required":true - }, - { - "in":"body", - "name":"body", - "schema":{ - "$ref":"#/definitions/bridgedDepositsPostPayload" - } - } - ], - "tags":[ - "Trading" - ], - "responses":{ - "200":{ - "schema":{ - "$ref":"#/definitions/bridgedDepositsPostResponse" - }, - "description":"Successful" - } - } - } - }, - "/v1/trading/bridgedWithdrawals":{ - "post":{ - "summary":"Create Stark V2 BridgedWithdrawalRequest", - "operationId":"postV1TradingBridgedwithdrawals", - "parameters":[ - { - "type":"string", - "description":"Base64 of {signature, nonce} JSON representation", - "name":"authorization", - "in":"header", - "x-example":"EcRecover eyJub25jZSI6InYyLTE3MDQxMTQwNjEuMDAwIiwic2lnbmF0dXJlIjoiMHgyYjQ4ZDUzZjJlM2E2OTY2MzBlYmRjZDFmZjA1NzU1NmJiYzlkZTljMjk0YWRmYWE1YjFmMTNkZjkxYjY3YjM0N2ZkZDg4YzI5NTk0YzM3N2JhMDAyNGRlYzQwY2Q5ODA4ODI5ZTdmNDQ0Nzc3MjQ4MmY1MGE3YThlOWE5MDM1NjFjIn0=", - "required":true - }, - { - "in":"body", - "name":"body", - "schema":{ - "$ref":"#/definitions/bridgedWithdrawalsPostPayload" - } - } - ], - "tags":[ - "Trading" - ], - "responses":{ - "200":{ - "schema":{ - "$ref":"#/definitions/bridgedWithdrawalsPostResponse" - }, - "description":"Successful" - } - } - } - }, - "/v1/trading/deposits":{ - "post":{ - "summary":"Create Stark V2 DepositRequest", - "operationId":"postV1TradingDeposits", - "parameters":[ - { - "type":"string", - "description":"Base64 of {signature, nonce} JSON representation", - "name":"authorization", - "in":"header", - "x-example":"EcRecover eyJub25jZSI6InYyLTE3MDQxMTQwNjEuMDAwIiwic2lnbmF0dXJlIjoiMHgyYjQ4ZDUzZjJlM2E2OTY2MzBlYmRjZDFmZjA1NzU1NmJiYzlkZTljMjk0YWRmYWE1YjFmMTNkZjkxYjY3YjM0N2ZkZDg4YzI5NTk0YzM3N2JhMDAyNGRlYzQwY2Q5ODA4ODI5ZTdmNDQ0Nzc3MjQ4MmY1MGE3YThlOWE5MDM1NjFjIn0=", - "required":true - }, - { - "in":"body", - "name":"body", - "schema":{ - "$ref":"#/definitions/depositsPostPayload" - } - } - ], - "tags":[ - "Trading" - ], - "responses":{ - "200":{ - "schema":{ - "$ref":"#/definitions/depositsPostResponse" - }, - "description":"Successful" - } - } - } - }, - "/v1/trading/deposits-validate":{ - "post":{ - "summary":"Create Stark V2 Deposits-validateRequest", - "operationId":"postV1TradingDepositsvalidate", - "parameters":[ - { - "type":"string", - "description":"Base64 of {signature, nonce} JSON representation", - "name":"authorization", - "in":"header", - "x-example":"EcRecover eyJub25jZSI6InYyLTE3MDQxMTQwNjEuMDAwIiwic2lnbmF0dXJlIjoiMHgyYjQ4ZDUzZjJlM2E2OTY2MzBlYmRjZDFmZjA1NzU1NmJiYzlkZTljMjk0YWRmYWE1YjFmMTNkZjkxYjY3YjM0N2ZkZDg4YzI5NTk0YzM3N2JhMDAyNGRlYzQwY2Q5ODA4ODI5ZTdmNDQ0Nzc3MjQ4MmY1MGE3YThlOWE5MDM1NjFjIn0=", - "required":true - }, - { - "in":"body", - "name":"body", - "schema":{ - "$ref":"#/definitions/deposits-validatePostPayload" - } - } - ], - "tags":[ - "Trading" - ], - "responses":{ - "200":{ - "schema":{ - "$ref":"#/definitions/deposits-validatePostResponse" - }, - "description":"Successful" - } - } - } - }, - "/v1/trading/withdrawals":{ - "post":{ - "summary":"Create Stark V2 WithdrawalRequest", - "operationId":"postV1TradingWithdrawals", - "parameters":[ - { - "type":"string", - "description":"Base64 of {signature, nonce} JSON representation", - "name":"authorization", - "in":"header", - "x-example":"EcRecover eyJub25jZSI6InYyLTE3MDQxMTQwNjEuMDAwIiwic2lnbmF0dXJlIjoiMHgyYjQ4ZDUzZjJlM2E2OTY2MzBlYmRjZDFmZjA1NzU1NmJiYzlkZTljMjk0YWRmYWE1YjFmMTNkZjkxYjY3YjM0N2ZkZDg4YzI5NTk0YzM3N2JhMDAyNGRlYzQwY2Q5ODA4ODI5ZTdmNDQ0Nzc3MjQ4MmY1MGE3YThlOWE5MDM1NjFjIn0=", - "required":true - }, - { - "in":"body", - "name":"body", - "schema":{ - "$ref":"#/definitions/withdrawalsPostPayload" - } - } - ], - "tags":[ - "Trading" - ], - "responses":{ - "200":{ - "schema":{ - "$ref":"#/definitions/withdrawalsPostResponse" - }, - "description":"Successful" - } - } - } - }, - "/v1/trading/amm/fundingOrders":{ - "post":{ - "summary":"Submit AMM fundingOrder. Used to deposit or withdrawal liquidity.", - "operationId":"postV1TradingAmmFundingorders", - "parameters":[ - { - "in":"body", - "name":"body", - "schema":{ - "$ref":"#/definitions/AmmFundingOrdersPostPayload" - } - } - ], - "tags":[ - "Trading", - "AMM" - ], - "responses":{ - "200":{ - "schema":{ - "$ref":"#/definitions/AmmFundingOrdersPostResponse" - }, - "description":"Successful" - } - } - } - }, - "/v1/trading/r/addAirdrops":{ - "post":{ - "summary":"Add a list of airdops", - "operationId":"postV1TradingRAddairdrops", - "parameters":[ - { - "in":"body", - "name":"body", - "schema":{ - "$ref":"#/definitions/addAirdropRequestSchema" - } - } - ], - "tags":[ - "Internal" - ], - "responses":{ - "200":{ - "schema":{ - "$ref":"#/definitions/addAirdropResponseSchema" - }, - "description":"Successful" - } - } - } - }, - "/v1/trading/r/getBalance":{ - "post":{ - "summary":"This is used to retrieve the total and active balances of a user per token. Active balance is the balance that is currently available. Total balance (specified as balance) is the sum of all the balances including those locked for trading.", - "operationId":"postV1TradingRGetbalance", - "parameters":[ - { - "in":"body", - "name":"body", - "schema":{ - "$ref":"#/definitions/getBalancePayload" - } - } - ], - "tags":[ - "Trading" - ], - "responses":{ - "default":{ - "schema":{ - "$ref":"#/definitions/getBalanceResponse" - }, - "description":"Returns the total, available and locked balances of a user per token." - } - } - } - }, - "/v1/trading/r/getDeposits":{ - "post":{ - "summary":"This is an authenticated endpoint used to retrieve deposits. A token can be specified to get deposits for a specific token. The limit of deposits returned is 1000.", - "operationId":"postV1TradingRGetdeposits", - "parameters":[ - { - "type":"number", - "description":"Date of the last deposit returned.", - "name":"startDate", - "in":"query", - "x-example":1747384800000 - }, - { - "type":"number", - "description":"Limit of deposits that will be returned. With a maximum limit of 1000.", - "name":"limit", - "in":"query", - "x-example":60 - }, - { - "in":"body", - "name":"body", - "schema":{ - "$ref":"#/definitions/getDepositsPayload" - } - } - ], - "tags":[ - "Trading" - ], - "responses":{ - "default":{ - "schema":{ - "$ref":"#/definitions/getDepositsResponse" - }, - "description":"Returns the list of deposits. A token can be specified to get deposits for a specific token." - } - } - } - }, - "/v1/trading/r/getOrder":{ - "post":{ - "summary":"This is endpoint is used to retrieve the details for a specific order using the order ID.", - "operationId":"postV1TradingRGetorder", - "parameters":[ - { - "in":"body", - "name":"body", - "schema":{ - "$ref":"#/definitions/getOrderPayload" - } - } - ], - "tags":[ - "Trading" - ], - "responses":{ - "default":{ - "schema":{ - "$ref":"#/definitions/getOrderResponse" - }, - "description":"Returns details relating to a particular order." - } - } - } - }, - "/v1/trading/r/getPendingWithdrawals":{ - "post":{ - "summary":"This endpoint is used to retrieve all pending withdrawals. If a token is specified, withdrawals pertaining to only that particular token are provided.", - "operationId":"postV1TradingRGetpendingwithdrawals", - "parameters":[ - { - "in":"body", - "name":"body", - "schema":{ - "$ref":"#/definitions/getPendingWithdrawalsPayload" - } - } - ], - "tags":[ - "Trading" - ], - "responses":{ - "default":{ - "schema":{ - "type":"string" - }, - "description":"Successful" - } - } - } - }, - "/v1/trading/r/getPublicUserPermissions":{ - "post":{ - "summary":"Used to get all configured permissions for the authenticated user", - "operationId":"postV1TradingRGetpublicuserpermissions", - "parameters":[ - { - "in":"body", - "name":"body", - "schema":{ - "$ref":"#/definitions/authPayload" - } - } - ], - "tags":[ - "public" - ], - "responses":{ - "200":{ - "schema":{ - "$ref":"#/definitions/Model36" - }, - "description":"Successful" - } - } - } - }, - "/v1/trading/r/getUserConf":{ - "post":{ - "summary":"Returns the DeversiFi application and user configuration details.", - "operationId":"postV1TradingRGetuserconf", - "parameters":[ - { - "in":"body", - "name":"body", - "schema":{ - "$ref":"#/definitions/authPayload" - } - } - ], - "tags":[ - "Trading" - ], - "responses":{ - "default":{ - "schema":{ - "$ref":"#/definitions/getUserConfResponse" - }, - "description":"Returns the overall trading volume details for all tokens in USD as well as the trading volume per trading pair." - } - } - } - }, - "/v1/trading/r/getVaultId":{ - "post":{ - "summary":"An authenticated endpoint used to retrieve a vaultId for given token.", - "operationId":"postV1TradingRGetvaultid", - "parameters":[ - { - "in":"body", - "name":"body", - "schema":{ - "$ref":"#/definitions/getVaultIdPayload" - } - } - ], - "tags":[ - "Trading" - ], - "responses":{ - "200":{ - "description":"the vault id.", - "schema":{ - "type":"number", - "description":"the vault id.", - "example":1851736 - } - } - } - } - }, - "/v1/trading/r/getWithdrawal":{ - "post":{ - "summary":"This endpoint is used to retrieve details relating to a particular withdrawal.", - "operationId":"postV1TradingRGetwithdrawal", - "parameters":[ - { - "in":"body", - "name":"body", - "schema":{ - "$ref":"#/definitions/getWithdrawalPayload" - } - } - ], - "tags":[ - "Trading" - ], - "responses":{ - "200":{ - "schema":{ - "$ref":"#/definitions/withdrawHistoryObject" - }, - "description":"Successful" - } - } - } - }, - "/v1/trading/r/hasReceivedCompensation":{ - "post":{ - "summary":"Returns whether the user already received registration compensation.", - "operationId":"postV1TradingRHasreceivedcompensation", - "parameters":[ - { - "in":"body", - "name":"body", - "schema":{ - "$ref":"#/definitions/authPayload" - } - } - ], - "tags":[ - "Internal" - ], - "responses":{ - "200":{ - "schema":{ - "$ref":"#/definitions/Model38" - }, - "description":"Successful" - } - } - } - }, - "/v1/trading/r/openOrders":{ - "post":{ - "summary":"This endpoints allows to retrieve details on all open orders.", - "operationId":"postV1TradingROpenorders", - "parameters":[ - { - "in":"body", - "name":"body", - "schema":{ - "$ref":"#/definitions/openOrdersPayload" - } - } - ], - "tags":[ - "Trading" - ], - "responses":{ - "200":{ - "schema":{ - "$ref":"#/definitions/openOrdersResponse" - }, - "description":"Successful" - } - } - } - }, - "/v1/trading/r/orderHistory":{ - "post":{ - "summary":"This method is used to retrieve a list of all past orders for a user. This includes executed trades, as well as expired and cancelled orders. The limit of orders returned is 1000.", - "operationId":"postV1TradingROrderhistory", - "parameters":[ - { - "type":"number", - "description":"Date of the last order returned.", - "name":"startDate", - "in":"query", - "x-example":1747384800000 - }, - { - "type":"number", - "description":"Limit of orders that will be returned. With a maximum limit of 1000.", - "name":"limit", - "in":"query", - "x-example":60 - }, - { - "in":"body", - "name":"body", - "schema":{ - "$ref":"#/definitions/orderHistoryPayload" - } - } - ], - "tags":[ - "Trading" - ], - "responses":{ - "200":{ - "schema":{ - "$ref":"#/definitions/Model39" - }, - "description":"Successful" - } - } - } - }, - "/v1/trading/r/recoverTradingKey":{ - "post":{ - "summary":"Returns the encrypted Stark Trading Key.", - "operationId":"postV1TradingRRecovertradingkey", - "parameters":[ - { - "in":"body", - "name":"body", - "schema":{ - "$ref":"#/definitions/authPayload" - } - } - ], - "tags":[ - "Trading" - ], - "responses":{ - "default":{ - "schema":{ - "$ref":"#/definitions/recoverTradingKeyResponse" - }, - "description":"Returns the encrypted Stark Trading key." - } - } - } - }, - "/v1/trading/r/setPublicUserPermissions":{ - "post":{ - "summary":"Used to set a specific permission for a given user", - "operationId":"postV1TradingRSetpublicuserpermissions", - "parameters":[ - { - "in":"body", - "name":"body", - "schema":{ - "$ref":"#/definitions/permissionsPayload" - } - } - ], - "tags":[ - "Trading" - ], - "responses":{ - "200":{ - "schema":{ - "$ref":"#/definitions/Model36" - }, - "description":"Successful" - } - } - } - }, - "/v1/trading/r/userOrderCount":{ - "post":{ - "summary":"This method is used to retrieve user's count of filled orders.", - "operationId":"postV1TradingRUserordercount", - "parameters":[ - { - "in":"body", - "name":"body", - "schema":{ - "$ref":"#/definitions/authPayload" - } - } - ], - "tags":[ - "Trading" - ], - "responses":{ - "200":{ - "schema":{ - "$ref":"#/definitions/Model40" - }, - "description":"Successful" - } - } - } - }, - "/v1/trading/r/withdrawHistory":{ - "post":{ - "summary":"An authenticated endpoint used to retrieve a list of user's past withdrawals. This includes ready, completed, as well as cancelled withdrawals. The limit of withdrawals returned is 1000.", - "operationId":"postV1TradingRWithdrawhistory", - "parameters":[ - { - "type":"number", - "description":"Date of the last withdraw returned.", - "name":"startDate", - "in":"query", - "x-example":1747384800000 - }, - { - "type":"number", - "description":"Limit of withdraws that will be returned. With a maximum limit of 1000.", - "name":"limit", - "in":"query", - "x-example":60 - }, - { - "in":"body", - "name":"body", - "schema":{ - "$ref":"#/definitions/getPendingWithdrawalsPayload" - } - } - ], - "tags":[ - "Trading" - ], - "responses":{ - "200":{ - "schema":{ - "$ref":"#/definitions/withdrawHistoryResponse" - }, - "description":"Successful" - } - } - } - }, - "/v1/trading/w/cancelOpenOrders":{ - "post":{ - "summary":"This endpoint allows to cancel all open orders of the requestor", - "operationId":"postV1TradingWCancelopenorders", - "parameters":[ - { - "in":"body", - "name":"body", - "schema":{ - "$ref":"#/definitions/authPayload" - } - } - ], - "tags":[ - "Trading" - ], - "responses":{ - "200":{ - "schema":{ - "$ref":"#/definitions/cancelOpenOrdersResponse" - }, - "description":"Successful" - } - } - } - }, - "/v1/trading/w/cancelOrder":{ - "post":{ - "summary":"This endpoint allows to cancel a specific order.", - "operationId":"postV1TradingWCancelorder", - "parameters":[ - { - "in":"body", - "name":"body", - "schema":{ - "$ref":"#/definitions/getOrderPayload" - } - } - ], - "tags":[ - "Trading" - ], - "responses":{ - "200":{ - "schema":{ - "$ref":"#/definitions/cancelOrderResponse" - }, - "description":"Queues cancellation request and returns the order ID of the cancelled order." - }, - "502":{ - "description":"Unable to determine the status of order cancellation request, verify by fetching orders list" - } - } - } - }, - "/v1/trading/w/cancelWithdrawal":{ - "post":{ - "summary":"Cancel withdrawal with given id.", - "operationId":"postV1TradingWCancelwithdrawal", - "parameters":[ - { - "in":"body", - "name":"body", - "schema":{ - "$ref":"#/definitions/cancelWithdrawalPayload" - } - } - ], - "tags":[ - "Trading" - ], - "responses":{ - "200":{ - "schema":{ - "$ref":"#/definitions/withdrawHistoryObject" - }, - "description":"Successful" - } - } - } - }, - "/v1/trading/w/claimAirdrop":{ - "post":{ - "summary":"Request airdrop claim for the specified token/address", - "operationId":"postV1TradingWClaimairdrop", - "parameters":[ - { - "in":"body", - "name":"body", - "schema":{ - "$ref":"#/definitions/airdropEligibilityQuery" - } - } - ], - "tags":[ - "Trading" - ], - "responses":{ - "200":{ - "schema":{ - "$ref":"#/definitions/Model42" - }, - "description":"Successful" - } - } - } - }, - "/v1/trading/w/deposit":{ - "post":{ - "summary":"Submit a signed notification of a new deposit made.", - "operationId":"postV1TradingWDeposit", - "parameters":[ - { - "in":"body", - "name":"body", - "schema":{ - "$ref":"#/definitions/depositPayload" - } - } - ], - "tags":[ - "Trading" - ], - "responses":{ - "default":{ - "schema":{ - "$ref":"#/definitions/depositResponse" - }, - "description":"Returns the deposit notifcation." - } - } - } - }, - "/v1/trading/w/fastWithdrawal":{ - "post":{ - "summary":"Submit a request for a new fast withdrawal.", - "operationId":"postV1TradingWFastwithdrawal", - "parameters":[ - { - "in":"body", - "name":"body", - "schema":{ - "$ref":"#/definitions/fastWithdrawalPayload" - } - } - ], - "tags":[ - "Trading" - ], - "responses":{ - "200":{ - "schema":{ - "$ref":"#/definitions/Model45" - }, - "description":"Successful" - } - } - } - }, - "/v1/trading/w/feedback":{ - "post":{ - "summary":"This endpoint allows to send the email of an user.", - "operationId":"postV1TradingWFeedback", - "parameters":[ - { - "in":"body", - "name":"body", - "schema":{ - "$ref":"#/definitions/feedbackPayload" - } - } - ], - "tags":[ - "Internal" - ], - "responses":{ - "200":{ - "schema":{ - "$ref":"#/definitions/Model46" - }, - "description":"Successful" - } - } - } - }, - "/v1/trading/w/notifications":{ - "post":{ - "summary":"Creates a new notification.", - "operationId":"postV1TradingWNotifications", - "parameters":[ - { - "in":"body", - "name":"body", - "schema":{ - "$ref":"#/definitions/notificationPayload" - } - } - ], - "tags":[ - "Internal" - ], - "responses":{ - "200":{ - "schema":{ - "$ref":"#/definitions/notification" - }, - "description":"Successful" - } - } - } - }, - "/v1/trading/w/register":{ - "post":{ - "summary":"This method is used to register a Stark key that corresponds to an Ethereum public address. This will return deversifi Signature or DeversiFi application and user configuration details.", - "operationId":"postV1TradingWRegister", - "parameters":[ - { - "in":"body", - "name":"body", - "schema":{ - "$ref":"#/definitions/registerPayload" - } - } - ], - "tags":[ - "Trading" - ], - "responses":{ - "200":{ - "schema":{ - "$ref":"#/definitions/registerResponseUserRegisteredOnChain", - "x-alternatives":[ - { - "$ref":"#/x-alt-definitions/registerResponseUserRegisteredOnChain" - }, - { - "$ref":"#/x-alt-definitions/registerResponseUserNotRegisteredOnChain" - } - ] - }, - "description":"Successful" - } - } - } - }, - "/v1/trading/w/storeStarkTradingKey":{ - "post":{ - "summary":"This endpoint allows storing encrypted Stark Trading Key.", - "operationId":"postV1TradingWStorestarktradingkey", - "parameters":[ - { - "in":"body", - "name":"body", - "schema":{ - "$ref":"#/definitions/storeTradingKeyPayload" - } - } - ], - "tags":[ - "Trading" - ], - "responses":{ - "default":{ - "schema":{ - "$ref":"#/definitions/storeTradingKeyResponse" - }, - "description":"Returns flag of whether or not the key was stored successfully." - } - } - } - }, - "/v1/trading/w/submitOrder":{ - "post":{ - "summary":"This authenticated endpoint is used to submit an order.", - "operationId":"postV1TradingWSubmitorder", - "parameters":[ - { - "x-alternatives":[ - { - "$ref":"#/x-alt-definitions/submitOrderPayload" - }, - { - "$ref":"#/x-alt-definitions/Model6" - } - ], - "in":"body", - "name":"body", - "schema":{ - "$ref":"#/definitions/submitOrderPayload" - } - } - ], - "tags":[ - "Trading" - ], - "responses":{ - "200":{ - "schema":{ - "$ref":"#/definitions/submitOrderResponse", - "x-alternatives":[ - { - "$ref":"#/x-alt-definitions/submitOrderResponse" - }, - { - "$ref":"#/x-alt-definitions/Model7" - } - ] - }, - "description":"Queues order for market submission and returns the order ID of the submitted order." - }, - "502":{ - "description":"Unable to determine the status of order submission request, verify by fetching orders list" - } - } - } - }, - "/v1/trading/w/transfer":{ - "post":{ - "summary":"Submit a request for internal transfer (NOTE: currently not available to wider public).", - "operationId":"postV1TradingWTransfer", - "parameters":[ - { - "in":"body", - "name":"body", - "schema":{ - "$ref":"#/definitions/transferPayload" - } - } - ], - "tags":[ - "Trading" - ], - "responses":{ - "200":{ - "schema":{ - "$ref":"#/definitions/transferResponseObject" - }, - "description":"Successful" - } - } - } - }, - "/v1/trading/w/withdraw":{ - "post":{ - "summary":"Submit a request for a new withdrawal.", - "operationId":"postV1TradingWWithdraw", - "parameters":[ - { - "in":"body", - "name":"body", - "schema":{ - "$ref":"#/definitions/withdrawalPayload" - } - } - ], - "tags":[ - "Trading" - ], - "responses":{ - "default":{ - "schema":{ - "type":"string" - }, - "description":"Successful" - } - } - } - }, - "/v1/trading/r/getBalanceForUser/{userEthAddress}":{ - "post":{ - "summary":"This is used to retrieve the total and active balances of a user per token. Active balance is the balance that is currently available. Total balance (specified as balance) is the sum of all the balances including those locked for trading.", - "operationId":"postV1TradingRGetbalanceforuserUserethaddress", - "parameters":[ - { - "type":"string", - "description":"The ETH address of a potential user", - "name":"userEthAddress", - "in":"path", - "x-example":"0x08152c1265dbc218ccc8ab5c574e6bd52279b3b7", - "required":true - }, - { - "in":"body", - "name":"body", - "schema":{ - "$ref":"#/definitions/Model52" - } - } - ], - "tags":[ - "Trading", - "public" - ], - "responses":{ - "200":{ - "schema":{ - "$ref":"#/definitions/getBalanceResponse" - }, - "description":"Successful" - }, - "401":{ - "description":"User has not authorized the use of this endpoint for their address" - } - } - } - }, - "/v1/trading/w/notifications/{id}":{ - "delete":{ - "summary":"Deletes a notification.", - "operationId":"deleteV1TradingWNotificationsId", - "parameters":[ - { - "type":"string", - "name":"id", - "in":"path", - "required":true - } - ], - "tags":[ - "Internal" - ], - "responses":{ - "200":{ - "schema":{ - "$ref":"#/definitions/notification" - }, - "description":"Successful" - } - } - } - } - }, - "definitions":{ - "getAllowanceResponse":{ - "type":"object", - "properties":{ - "allowance":{ - "type":"string", - "example":"ALLOWED", - "enum":[ - "ALLOWED", - "DENIED", - "KYC_REQUIRED" - ] - }, - "reason":{ - "type":"string", - "example":"NO_POLICY" - } - } - }, - "ETH":{ - "type":"object", - "properties":{ - "token":{ - "type":"string", - "description":"Token symbol", - "example":"ETH" - }, - "balance":{ - "type":"string", - "description":"Quantised token balance", - "example":"10" - }, - "usdBalance":{ - "type":"string", - "description":"USD equivalent of token balance", - "example":"20" - } - } - }, - "Model1":{ - "type":"object", - "properties":{ - "time":{ - "type":"string", - "format":"date", - "description":"DateTime of the aggregation", - "example":"2021-07-14T11:28:45.828Z" - }, - "onChainTotalUsd":{ - "type":"string", - "description":"total USD equivalent of the on-chain assets", - "example":"20" - }, - "exchangeTotalUsd":{ - "type":"string", - "description":"total USD equivalent of the exchange assets", - "example":"20" - }, - "totalUsd":{ - "type":"string", - "description":"total USD equivalent of both on-chain and exchange assets", - "example":"40" - }, - "onChainBalances":{ - "type":"object", - "description":"Map of on-chain token balances", - "name":"tokenBalanceSchema", - "properties":{ - "ETH":{ - "$ref":"#/definitions/ETH" - } - } - }, - "exchangeBalances":{ - "type":"object", - "description":"Map of exchange token balances", - "name":"tokenBalanceSchema", - "properties":{ - "ETH":{ - "$ref":"#/definitions/ETH" - } - } - } - } - }, - "balanceHistorySchema":{ - "type":"array", - "items":{ - "$ref":"#/definitions/Model1" - } - }, - "collateralBalancesSchema":{ - "type":"object" - }, - "pagination":{ - "type":"object", - "properties":{ - "totalItems":{ - "type":"number", - "description":"Total number of items matching the query", - "example":1559, - "minimum":0 - }, - "limit":{ - "type":"number", - "description":"Limit applied on returned items", - "example":5 - }, - "skip":{ - "type":"number", - "description":"Skip applied on returned items", - "example":2 - } - } - }, - "Model2":{ - "type":"object", - "properties":{ - "_id":{ - "type":"string", - "description":"Unique identifier representing the deposit or withdrawal", - "example":"606f207fc7aa2e91d028a17a" - }, - "type":{ - "type":"string", - "description":"Whether the transaction is a deposit, a classic withdrawal or a fast withdrawal", - "example":"Deposit", - "enum":[ - "Deposit", - "Withdrawal", - "FastWithdrawal" - ] - }, - "token":{ - "type":"string", - "description":"Token deposited or withdrawn", - "example":"ZRX" - }, - "amount":{ - "type":"number", - "description":"Amount deposited or withdrawn", - "example":1 - }, - "transactionHash":{ - "type":"string", - "description":"Hash of the Ethereum transaction leading to L1 balance debit or credit", - "example":"0xb5c8bd9430b6cc87a0e2fe110ece6bf527fa4f170a4bc8cd032f768fc5219838" - }, - "date":{ - "type":"string", - "format":"date", - "description":"Date and time deposit or withdrawal", - "example":"2020-11-11T16:37:05.957" - }, - "sourceOrRecipient":{ - "type":"string", - "description":"Originator of the deposit or recipient of the withdrawal", - "example":"0x148426fdc4c8a51b96b4bed827907b5fa6491ad0" - }, - "gateway":{ - "type":"string", - "description":"Set when operation used a gateway. Corresponds to a chain identifier", - "example":"MATIC_POS" - } - } - }, - "items":{ - "type":"array", - "items":{ - "$ref":"#/definitions/Model2" - } - }, - "getDepositsAndWithdrawalsResponse":{ - "type":"object", - "properties":{ - "pagination":{ - "$ref":"#/definitions/pagination" - }, - "items":{ - "$ref":"#/definitions/items" - } - } - }, - "addresses":{ - "type":"array", - "example":[ - "0x5317c63f870e8d2f85f0de3c2666d1414f5a728c", - "0x08152c1265dbc218ccc8ab5c574e6bd52279b3b7" - ], - "items":{ - "type":"string" - } - }, - "Model3":{ - "type":"object", - "properties":{ - "addresses":{ - "$ref":"#/definitions/addresses" - }, - "kycStatus":{ - "type":"string", - "example":"PASS", - "enum":[ - "PENDING", - "PASS", - "FAILED", - "EXPIRED" - ] - } - } - }, - "Model4":{ - "type":"object", - "properties":{ - "fillId":{ - "type":"string", - "description":"Unique identifier representing the fill event", - "example":"606f207fc7aa2e91d028a17a" - }, - "orderId":{ - "type":"string", - "description":"Unique identifier of the order associated with the fill", - "example":"BtHEvgY1Bz1" - }, - "symbol":{ - "type":"string", - "description":"Symbol for the order associated with the fill", - "example":"ETH:USDT" - }, - "price":{ - "type":"number", - "description":"Execution price of the fill", - "example":209.9 - }, - "fillAmount":{ - "type":"number", - "description":"Amount filled (negative amount for a sell event, positive for a buy event)", - "example":-0.125622 - }, - "orderAmount":{ - "type":"number", - "description":"Initial amount for the placed order associated with the fill", - "example":-1 - }, - "date":{ - "type":"string", - "format":"date", - "description":"Date and time of the fill event", - "example":"2020-11-11T16:37:05.957" - }, - "orderCreationDate":{ - "type":"string", - "format":"date", - "description":"Date and time at which the order associated with the fill event was placed", - "example":"2020-11-11T16:37:05.262Z" - }, - "orderType":{ - "type":"string", - "description":"Type of the order associated with the fill event", - "example":true, - "enum":[ - "EXCHANGE LIMIT", - "EXCHANGE MARKET" - ] - }, - "orderActive":{ - "type":"boolean", - "description":"Whether the order associated with the fill event is still active", - "example":true - }, - "orderCanceled":{ - "type":"boolean", - "description":"Whether the order associated with the fill event was canceled", - "example":false - } - } - }, - "Model5":{ - "type":"array", - "items":{ - "$ref":"#/definitions/Model4" - } - }, - "getFillsResponse":{ - "type":"object", - "properties":{ - "pagination":{ - "$ref":"#/definitions/pagination" - }, - "items":{ - "$ref":"#/definitions/Model5" - } - } - }, - "Model6":{ - "type":"object", - "properties":{ - "_id":{ - "type":"string", - "description":"Unique identifier representing this transfer", - "example":"MphMkBBZjnS" - }, - "token":{ - "type":"string", - "description":"Token transfered", - "example":"ETH" - }, - "amount":{ - "type":"number", - "description":"Amount transfered (effective amount received by the recipient)", - "example":3.14, - "minimum":0 - }, - "feeAmount":{ - "type":"number", - "description":"Transfer fee amount (in transfer token units)", - "example":3.14, - "minimum":0 - }, - "source":{ - "type":"string", - "description":"Source Ethereum address", - "example":"0x08152c1265dBc218ccc8Ab5C574e6bD52279b3B7" - }, - "recipient":{ - "type":"string", - "description":"Recipient Ethereum address", - "example":"0xeb3ea3ea9239577951523cafa9fd3072bc88e50a" - }, - "memo":{ - "type":"string", - "description":"Transfer memo", - "example":"my reference" - }, - "date":{ - "type":"string", - "format":"date", - "description":"Date and time of the transfer", - "example":"1990-04-14T00:20:00.000Z" - } - } - }, - "Model7":{ - "type":"array", - "items":{ - "$ref":"#/definitions/Model6" - } - }, - "getTransfersResponse":{ - "type":"object", - "properties":{ - "pagination":{ - "$ref":"#/definitions/pagination" - }, - "items":{ - "$ref":"#/definitions/Model7" - } - } - }, - "starkOrder":{ - "type":"object", - "description":"Stark Limit Order Data.", - "example":{ - "vaultIdSell":1000002, - "vaultIdBuy":1000001, - "amountSell":"97400000", - "amountBuy":"100000000000000000", - "tokenSell":"0x2", - "tokenBuy":"0x1" - }, - "properties":{ - "vaultIdSell":{ - "type":"integer", - "description":"The vault ID of the seller.", - "minimum":0 - }, - "vaultIdBuy":{ - "type":"integer", - "description":"The vault ID of the buyer.", - "minimum":0 - }, - "amountSell":{ - "type":"string", - "description":"The total amount to be sold." - }, - "amountBuy":{ - "type":"string", - "description":"The total amount to be bought." - }, - "tokenSell":{ - "type":"string", - "description":"The Stark token ID for the token being sold." - }, - "tokenBuy":{ - "type":"string", - "description":"The Stark token ID for the token being bought." - } - } - }, - "Model8":{ - "type":"object", - "properties":{ - "amountBuy":{ - "type":"string" - }, - "amountSell":{ - "type":"string" - }, - "tokenBuy":{ - "type":"string" - }, - "tokenSell":{ - "type":"string" - }, - "starkOrder":{ - "$ref":"#/definitions/starkOrder" - } - } - }, - "orders":{ - "type":"array", - "x-constraint":{ - "length":2 - }, - "items":{ - "$ref":"#/definitions/Model8" - } - }, - "AmmFundingOrderDataGetResponse":{ - "type":"object", - "example":{ - "pool":"ETHUSDT", - "orders":[ - { - "tokenBuy":"LP-ETHUSDT", - "amountBuy":"50", - "tokenSell":"ETH", - "amountSell":"2", - "starkOrder":{ - "tokenBuy":"0x11af21d6b234cd669edd702dd3d1d017be888337010b950ae3679eb4194b4bc", - "amountBuy":"5000000000", - "vaultIdBuy":247827906, - "tokenSell":"0xb333e3142fe16b78628f19bb15afddaef437e72d6d7f5c6c20c6801a27fba6", - "amountSell":"200000000", - "vaultIdSell":2121602419 - } - }, - { - "tokenBuy":"LP-ETHUSDT", - "amountBuy":"50", - "tokenSell":"USDT", - "amountSell":"1230", - "starkOrder":{ - "tokenBuy":"0x11af21d6b234cd669edd702dd3d1d017be888337010b950ae3679eb4194b4bc", - "amountBuy":"5000000000", - "vaultIdBuy":247827906, - "tokenSell":"0xb333e3142fe16b78628f19bb15afddaef437e72d6d7f5c6c20c6801a27fba6", - "amountSell":"200000000", - "vaultIdSell":2121602419 - } - } - ] - }, - "properties":{ - "pool":{ - "type":"string" - }, - "orders":{ - "$ref":"#/definitions/orders" - } - } - }, - "string":{ - "type":"object", - "properties":{ - "tokenAmount":{ - "type":"number", - "example":0.1 - }, - "USDVolume":{ - "type":"number", - "example":1.1 - } - }, - "required":[ - "tokenAmount", - "USDVolume" - ] - }, - "30DaysVolumeResponse":{ - "type":"object", - "properties":{ - "totalUSDVolume":{ - "type":"number", - "description":"The total trade volume in terms of USD.", - "example":73364.1749445 - }, - "tokens":{ - "type":"object", - "description":"Volumes for individual tokens.", - "name":"tokens", - "properties":{ - "string":{ - "$ref":"#/definitions/string" - } - } - }, - "startDate":{ - "type":"string", - "format":"date", - "description":"The start date and time for the volume presented.", - "example":"2020-01-01T00:00:00.714Z" - }, - "endDate":{ - "type":"string", - "format":"date", - "description":"The end date and time for the volume presented.", - "example":"2020-01-01T00:00:00.714Z" - } - }, - "required":[ - "totalUSDVolume" - ] - }, - "USDRankingResponse":{ - "type":"object", - "properties":{ - "address":{ - "type":"string", - "description":"The address of the trader.", - "example":"0xfc898b18a70ce49579f8d79a32e29928c15b4bc8" - }, - "USDValue":{ - "type":"number", - "description":"The trading volume for the address quoted in USD.", - "example":119128.566703 - } - } - }, - "User24HoursVolumeResponse":{ - "type":"object", - "properties":{ - "totalUSDVolume":{ - "type":"number", - "description":"The total trade volume in terms of USD.", - "example":3320.75 - }, - "tokens":{ - "type":"object", - "description":"Volumes for individual tokens.", - "name":"tokens", - "properties":{ - "string":{ - "$ref":"#/definitions/string" - } - } - } - }, - "required":[ - "totalUSDVolume" - ] - }, - "Model9":{ - "type":"object", - "properties":{ - "totalUSDVolume":{ - "type":"number", - "description":"The total trade volume in terms of USD.", - "example":3320.75 - }, - "tokens":{ - "$ref":"#/definitions/collateralBalancesSchema" - } - } - }, - "Model10":{ - "type":"object", - "properties":{ - "user":{ - "type":"string", - "description":"Ethereum address", - "example":"0x3f2b822E9A8312C6DafBF9686a5e335Af0E4D33B" - }, - "token":{ - "type":"string", - "description":"token for the airdrop", - "example":"DVF" - }, - "amount":{ - "type":"number", - "description":"DVF airdrop eligible amount", - "example":"15.52" - }, - "requested":{ - "type":"boolean", - "description":"Has this claim been already requested", - "example":"false" - } - } - }, - "claims":{ - "type":"array", - "items":{ - "$ref":"#/definitions/Model10" - } - }, - "Model11":{ - "type":"object", - "properties":{ - "claims":{ - "$ref":"#/definitions/claims" - }, - "isRegistered":{ - "type":"boolean", - "description":"is the eth address registered", - "example":true - } - } - }, - "beehiveStatsResponse":{ - "type":"object", - "properties":{ - "pool_identifier":{ - "type":"string", - "description":"Returns the pool identifier.", - "example":"NEC/wETH" - }, - "liquidity_locked":{ - "type":"number", - "description":"The total liquidity in terms of USD.", - "example":28751428.1231 - }, - "apy":{ - "type":"number", - "description":"The APY.", - "example":404.47648991003564 - } - }, - "required":[ - "pool_identifier", - "liquidity_locked", - "apy" - ] - }, - "Model12":{ - "type":"object", - "properties":{ - "pool_identifier":{ - "type":"string", - "description":"Returns the pool identifier.", - "example":"NEC/wETH" - }, - "liquidity_locked":{ - "type":"number", - "description":"The total liquidity in terms of USD.", - "example":28751428.1231 - }, - "apy":{ - "type":"number", - "description":"The APY.", - "example":404.47648991003564 - } - } - }, - "estimatedNextBatchResponse":{ - "type":"object", - "properties":{ - "estimatedTime":{ - "type":"number", - "description":"The number of seconds until the batch is sent to be processed and broadcast to the blockchain.", - "example":608 - }, - "averageTime":{ - "type":"number", - "description":"The configured number of seconds between batches.", - "example":608 - }, - "finalisedBatchPendingConfirmation":{ - "type":"boolean", - "description":"True if the previous batch has been created but still pending confirmation on the blockchain.", - "example":true - } - } - }, - "Model13":{ - "type":"object", - "properties":{ - "feeQuantised":{ - "type":"string", - "description":"Fast withdrawal fee as quantised amount of token to be withdrawn.", - "example":"1224000", - "pattern":"^[0-9]*$" - }, - "feeBaseUnits":{ - "type":"string", - "description":"Fast withdrawal fee as base units of token to be withdrawn.", - "example":"0.01224", - "pattern":"^[+-]?((\\d+(\\.\\d*)?)|(\\.\\d+))$" - } - } - }, - "Model14":{ - "type":"object", - "properties":{ - "maxAmountQuantised":{ - "type":"string", - "description":"Max amount as quantised amount of token to be withdrawn.", - "example":"1224000", - "pattern":"^[0-9]*$" - }, - "maxAmountBaseUnits":{ - "type":"string", - "description":"Max amount as base units of token to be withdrawn.", - "example":"0.01224", - "pattern":"^[+-]?((\\d+(\\.\\d*)?)|(\\.\\d+))$" - } - } - }, - "fees":{ - "type":"object", - "properties":{ - "maker":{ - "type":"number", - "description":"The fee basis points for maker orders (adding bids or offers to the order book).", - "example":15 - }, - "taker":{ - "type":"number", - "description":"The fee basis points for taker orders (removing liquidity from the order book).", - "example":20 - } - } - }, - "getFeeRateResponse":{ - "type":"object", - "properties":{ - "address":{ - "type":"string", - "description":"The Ethereum address of the user verified by nonce and signature.", - "example":"0x116f494a2ce567067f319fea1c9f294f23d2fe68" - }, - "timestamp":{ - "type":"number", - "description":"Timestamp in milliseconds since epoch.", - "example":1590263332427 - }, - "fees":{ - "$ref":"#/definitions/fees" - } - } - }, - "gasSavingsResponse":{ - "type":"object", - "properties":{ - "totalUSD":{ - "type":"number", - "description":"Total gas savings in USD", - "example":7123000 - }, - "monthUSD":{ - "type":"number", - "description":"Gas savings within last 30 days", - "example":421000 - }, - "changePerSecondUSD":{ - "type":"number", - "description":"Rate at which gas savings increase per second", - "example":0.0312 - } - } - }, - "getBalanceUsdResponse":{ - "type":"object", - "properties":{ - "ethAddress":{ - "type":"string", - "description":"The ethereum public address of the user.", - "example":"0x14d06788090769f669427b6aea1c0240d2321f34" - }, - "balanceUsd":{ - "type":"number", - "description":"It is the sum of all user balances converted to USD.", - "example":"2" - } - } - }, - "newMarkets":{ - "type":"array", - "description":"Currency pairs that were newly added", - "items":{ - "type":"string" - } - }, - "DVF":{ - "type":"object", - "description":"This contains application configuration details to set up for deposits and trading.", - "example":{ - "defaultFeeRate":0.002, - "deversifiAddress":"0x9ab450355b4ab504cbc0e4de484781dac08e6a26", - "starkExContractAddress":"0xF3731d0cdC9834f6F32104580bD226EF1bc1A9F9", - "exchangeSymbols":[ - "ETH:USDT", - "ZRX:USDT", - "ZRX:ETH" - ], - "newMarkets":[ - "ZRX:USDT", - "ZRX:ETH" - ], - "tempStarkVaultId":1 - }, - "properties":{ - "defaultFeeRate":{ - "type":"number", - "description":"The default fee rate, if no volume or maker discount." - }, - "deversifiAddress":{ - "type":"string", - "description":"The address of the DeversiFi exchange." - }, - "starkExContractAddress":{ - "type":"string", - "description":"Stark deposit contract address." - }, - "exchangeSymbols":{ - "type":"string", - "description":"Currency pairs available at the DeversiFi exchange for trading" - }, - "newMarkets":{ - "$ref":"#/definitions/newMarkets" - }, - "tempStarkVaultId":{ - "type":"number", - "description":"Transit Stark vault ID used for deposit privacy" - } - } - }, - "getConfResponse":{ - "type":"object", - "example":{ - "DVF":{ - "defaultFeeRate":0.002, - "deversifiAddress":"0x9ab450355b4ab504cbc0e4de484781dac08e6a26", - "starkExContractAddress":"0xF3731d0cdC9834f6F32104580bD226EF1bc1A9F9", - "exchangeSymbols":[ - "ETH:USDT", - "ZRX:USDT", - "ZRX:ETH" - ], - "newMarkets":[ - "ZRX:USDT", - "ZRX:ETH" - ], - "tempStarkVaultId":1 - }, - "tokenRegistry":{ - "ETH":{ - "decimals":18, - "quantization":10000000000, - "minOrderSize":0.05, - "transferFee":0.0005, - "starkTokenId":"0xb333e3142fe16b78628f19bb15afddaef437e72d6d7f5c6c20c6801a27fba6", - "tokenAddressPerChain":{ - "ETHEREUM":"0x0000000000000000000000000000000000000000" - }, - "fastWithdrawalRequiredGas":70000, - "coingeckoId":"ethereum", - "deployedAtBlock":0 - }, - "DAI":{ - "decimals":18, - "quantization":10000000000, - "minOrderSize":10, - "transferFee":1, - "tokenAddress":"0x633cc66389201d3884c9cc0e51eedfb0ce241e6c", - "tokenAddressPerChain":{ - "ETHEREUM":"0x633cc66389201d3884c9cc0e51eedfb0ce241e6c", - "MATIC_POS":"0x0478d34dc7eb3d8622e214a3d119bd32e4a3216d", - "MATIC_POS_PARENT":"0xaeee769968b43457589d10e4b08ee7adfe67544f" - }, - "starkTokenId":"0x3df71c14fe878afe2df7484fdfb52b0fcec01408c590c937e872ecf607d8c51", - "fastWithdrawalRequiredGas":120000, - "coingeckoId":"dai", - "deployedAtBlock":9681200 - } - } - }, - "properties":{ - "DVF":{ - "$ref":"#/definitions/DVF" - }, - "tokenRegistry":{ - "$ref":"#/definitions/collateralBalancesSchema" - } - } - }, - "getGasPriceResponse":{ - "type":"object", - "description":"Range of gas prices for on chain confirmation speed", - "example":{ - "fast":"70000000000", - "fastWait":0.5, - "average":"67000000000", - "averageWait":1.4, - "cheap":"66000000000", - "cheapWait":10.5 - }, - "properties":{ - "fast":{ - "type":"string", - "description":"Gas price in Wei for quickest onchain transaction confirmation.", - "pattern":"^[0-9]*$" - }, - "average":{ - "type":"string", - "description":"Average gas price in Wei for average onchain transaction speed.", - "pattern":"^[0-9]*$" - }, - "cheap":{ - "type":"string", - "description":"Low gas price in Wei and very slow transaction speed.", - "pattern":"^[0-9]*$" - }, - "fastWait":{ - "type":"number", - "description":"The approximate time for a transaction confirmation when using fast as the gas price." - }, - "averageWait":{ - "type":"number", - "description":"The approximate time for a transaction confirmation when using average as the gas price." - }, - "cheapWait":{ - "type":"number", - "description":"The approximate time for a transaction confirmation when using cheap as the gas price." - } - } - }, - "BALANCES":{ - "type":"object", - "properties":{ - "key":{ - "type":"string", - "description":"Permission key" - }, - "description":{ - "type":"string", - "description":"description of the permission" - } - } - }, - "Model15":{ - "type":"object", - "properties":{ - "BALANCES":{ - "$ref":"#/definitions/BALANCES" - }, - "TRADING_HISTORY":{ - "$ref":"#/definitions/BALANCES" - } - } - }, - "Model16":{ - "type":"object", - "properties":{ - "liquidityAvailable":{ - "type":"number", - "description":"Remaining liquidity", - "example":10 - }, - "totalSupply":{ - "type":"number", - "description":"Total supply", - "example":1000 - } - } - }, - "tokenSaleStartEndResponse":{ - "type":"object", - "properties":{ - "start":{ - "type":"number", - "description":"Token sale start timestamp", - "example":1625036000 - }, - "end":{ - "type":"number", - "description":"Token sale end timestamp", - "example":1625076000 - }, - "startPrice":{ - "type":"number", - "description":"Token sale start price", - "example":1.5 - } - } - }, - "last24HoursVolumeResponse":{ - "type":"object", - "properties":{ - "TotalUSDValue":{ - "type":"number", - "description":"The total trade volume in terms of USD.", - "example":28751428.1231 - }, - "tokens":{ - "$ref":"#/definitions/collateralBalancesSchema" - }, - "symbols":{ - "$ref":"#/definitions/collateralBalancesSchema" - }, - "startDate":{ - "type":"string", - "description":"The start date and time for the volume presented.", - "example":"2020-05-22T03:11:29.014Z" - } - } - }, - "Model17":{ - "type":"object", - "properties":{ - "volume":{ - "type":"number", - "description":"token swap volume." - } - } - }, - "tokenRankingResponse":{ - "type":"object", - "properties":{ - "address":{ - "type":"string", - "description":"The address of the trader.", - "example":"0xfc898b18a70ce49579f8d79a32e29928c15b4bc8" - }, - "amount":{ - "type":"number", - "description":"The trading volume for the address", - "example":852.9290936325145 - } - } - }, - "totalValueLockedResponseItem":{ - "type":"object", - "properties":{ - "date":{ - "type":"string", - "format":"date", - "description":"Date on which `value` represents TVL", - "example":"2021-08-12T16:57:12.869Z" - }, - "value":{ - "type":"number", - "description":"Total value locked for a particular date", - "example":421000 - } - } - }, - "totalValueLockedResponse":{ - "type":"array", - "items":{ - "$ref":"#/definitions/totalValueLockedResponseItem" - } - }, - "Model18":{ - "type":"object", - "properties":{ - "count":{ - "type":"number", - "description":"Trades executed within time." - } - } - }, - "Model19":{ - "type":"object", - "properties":{ - "volume":{ - "type":"number", - "description":"token transfer volume." - } - } - }, - "vaultIdAndStarkKeyResponse":{ - "type":"object", - "properties":{ - "vaultId":{ - "type":"number", - "description":"The vault ID corresponding to the user registered with and token", - "example":1644016910 - }, - "starkKey":{ - "type":"string", - "description":"The public stark key for the user registered with ", - "example":"0x0180fc633b754b50370614a587218cf36a4fa7c2f11d65ec761dded48a81ab9e", - "pattern":"^0x[a-f0-9]+$" - } - } - }, - "votingPowerResponse":{ - "type":"object", - "properties":{ - "totalSupply":{ - "type":"string", - "description":"Total xDVF balance of users on exchange", - "example":"321000000" - }, - "votingPower":{ - "type":"number", - "description":"Percentage of amount compared to total balance", - "example":13.37 - } - } - }, - "Model20":{ - "type":"object", - "properties":{ - "isRegisteredOnDeversifi":{ - "type":"boolean", - "description":"Whether the user is registered on DeversiFi servers.", - "example":true, - "enum":[ - true, - false - ] - }, - "isRegisteredOnChain":{ - "type":"boolean", - "description":"Whether the user is registered with Starkware.", - "example":true, - "enum":[ - true, - false - ] - }, - "ethAddress":{ - "type":"string", - "description":"Ethereum address.", - "example":"0x3f2b822E9A8312C6DafBF9686a5e335Af0E4D33B" - } - }, - "required":[ - "isRegisteredOnDeversifi", - "isRegisteredOnChain", - "ethAddress" - ] - }, - "Model21":{ - "type":"object", - "properties":{ - "fillAmount":{ - "type":"number", - "description":"amount filled" - }, - "user":{ - "type":"string", - "description":"User ETH address" - }, - "date":{ - "type":"string", - "format":"date", - "description":"Date of the settlement" - }, - "tokenBuy":{ - "type":"string", - "description":"Buy token" - }, - "tokenSell":{ - "type":"string", - "description":"Sell token" - }, - "amountBuy":{ - "type":"string", - "description":"Amount of buy order" - }, - "amountSell":{ - "type":"string", - "description":"Amount of sell order" - }, - "orderId":{ - "type":"string", - "description":"Id of the order" - }, - "feeCurrency":{ - "type":"string", - "description":"Currency of the fee" - }, - "feeAmount":{ - "type":"string", - "description":"Amount of fee" - } - } - }, - "Model22":{ - "type":"array", - "items":{ - "$ref":"#/definitions/Model21" - } - }, - "Model23":{ - "type":"object", - "properties":{ - "items":{ - "$ref":"#/definitions/Model22" - } - } - }, - "tradesObject":{ - "type":"object", - "properties":{ - "trade_id":{ - "type":"number", - "description":"A unique ID associated with the trade for the currency pair transaction", - "example":1 - }, - "price":{ - "type":"number", - "description":"Last transacted price of base currency based on given quote currency.", - "example":275.23 - }, - "base_volume":{ - "type":"number", - "description":"Transaction amount in BASE currency.", - "example":1.5 - }, - "quote_volume":{ - "type":"number", - "description":"Transaction amount in QUOTE currency.", - "example":347.81 - }, - "timestamp":{ - "type":"number", - "description":"Unix timestamp in milliseconds for when the transaction occurred.", - "example":1747384800000 - }, - "type":{ - "type":"string", - "description":"Used to determine whether or not the transaction originated as a buy or sell.", - "example":"buy" - } - } - }, - "tradesResponse":{ - "type":"array", - "items":{ - "$ref":"#/definitions/tradesObject" - } - }, - "24HoursVolumeResponse":{ - "type":"object", - "properties":{ - "TotalUSDValue":{ - "type":"number", - "description":"The total trade volume in terms of USD.", - "example":3320.75 - }, - "tokens":{ - "$ref":"#/definitions/collateralBalancesSchema" - }, - "startDate":{ - "type":"string", - "description":"The start date and time for the volume presented.", - "example":"2020-01-01T00:00:00.714Z" - }, - "endDate":{ - "type":"string", - "description":"The end date and time for the volume presented.", - "example":"2020-01-01T00:00:00.714Z" - } - } - }, - "Model24":{ - "type":"object", - "properties":{ - "trade_id":{ - "type":"number", - "description":"A unique ID associated with the trade for the currency pair transaction", - "example":1 - }, - "price":{ - "type":"number", - "description":"Last transacted price of base currency based on given quote currency.", - "example":275.23 - }, - "base_volume":{ - "type":"number", - "description":"Transaction amount in BASE currency.", - "example":1.5 - }, - "quote_volume":{ - "type":"number", - "description":"Transaction amount in QUOTE currency.", - "example":347.81 - }, - "timestamp":{ - "type":"number", - "description":"Unix timestamp in milliseconds for when the transaction occurred.", - "example":1548028800 - }, - "type":{ - "type":"string", - "description":"Used to determine whether or not the transaction originated as a buy or sell.", - "example":"buy" - } - } - }, - "Model25":{ - "type":"array", - "items":{ - "$ref":"#/definitions/Model24" - } - }, - "bridgedDepositsPostPayload":{ - "type":"object", - "properties":{ - "token":{ - "type":"string", - "example":"ETH" - }, - "amount":{ - "type":"string", - "description":"quantised amount of the token to be undefined", - "example":"10000000" - }, - "txHash":{ - "type":"string", - "description":"Transaction Hash of the corresponding Ethereum transaction", - "example":"0xeef10fc5170f669b86c4cd0444882a96087221325f8bf2f55d6188633aa7be7c", - "pattern":"^0x[a-f0-9]+$", - "x-constraint":{ - "length":66 - } - }, - "chain":{ - "type":"string", - "example":"MATIC_POS", - "enum":[ - "MATIC_POS" - ] - } - } - }, - "bridgedDepositsPostResponse":{ - "type":"object", - "properties":{ - "_id":{ - "type":"string", - "example":"FEHn8HYEQQw" - }, - "createdAt":{ - "type":"string", - "format":"date", - "description":"The date (ISO 8601) at which bridgedDeposit was created.", - "example":"2020-05-13T14:11:02.205Z" - }, - "updatedAt":{ - "type":"string", - "format":"date", - "description":"The date (ISO 8601) at which bridgedDeposit was last updated.", - "example":"2020-05-13T14:13:10.403Z" - }, - "token":{ - "type":"string", - "example":"ETH" - }, - "amount":{ - "type":"string", - "description":"quantised amount of the token to be undefined", - "example":"10000000" - }, - "pending":{ - "type":"boolean", - "example":true - }, - "expiresAt":{ - "type":"string", - "format":"date", - "example":"2021-08-12T17:02:15.857Z" - }, - "txHash":{ - "type":"string", - "description":"Transaction Hash of the corresponding Ethereum transaction", - "example":"0xeef10fc5170f669b86c4cd0444882a96087221325f8bf2f55d6188633aa7be7c", - "pattern":"^0x[a-f0-9]+$", - "x-constraint":{ - "length":66 - } - }, - "chain":{ - "type":"string", - "example":"MATIC_POS", - "enum":[ - "MATIC_POS" - ] - } - } - }, - "signature":{ - "type":"object", - "properties":{ - "r":{ - "type":"string", - "pattern":"^0x[a-f0-9]+$" - }, - "s":{ - "type":"string", - "pattern":"^0x[a-f0-9]+$" - } - } - }, - "tx":{ - "type":"object", - "description":"StarkWare TansferRequest from the user to DeversiFi", - "properties":{ - "type":{ - "type":"string", - "enum":[ - "TransferRequest" - ] - }, - "amount":{ - "type":"string", - "pattern":"^[0-9]*$" - }, - "expirationTimestamp":{ - "type":"integer", - "minimum":0 - }, - "nonce":{ - "type":"integer", - "minimum":0 - }, - "receiverPublicKey":{ - "type":"string", - "pattern":"^0x[a-f0-9]+$" - }, - "receiverVaultId":{ - "type":"integer" - }, - "senderPublicKey":{ - "type":"string", - "pattern":"^0x[a-f0-9]+$" - }, - "senderVaultId":{ - "type":"integer" - }, - "signature":{ - "$ref":"#/definitions/signature" - }, - "token":{ - "type":"string", - "pattern":"^0x[a-f0-9]+$" - } - } - }, - "bridgedWithdrawalsPostPayload":{ - "type":"object", - "properties":{ - "token":{ - "type":"string", - "example":"ETH" - }, - "amount":{ - "type":"string", - "description":"quantised amount of the token to be undefined", - "example":"10000000" - }, - "nonce":{ - "type":"integer", - "description":"Used to prevent creation of duplicate withdrawal if the request is retried with the same payload. withdrawal are be uniquely identified by a combination of user, token, amount and nonce.", - "example":976614084, - "minimum":0 - }, - "chain":{ - "type":"string", - "example":"MATIC_POS", - "enum":[ - "MATIC_POS" - ] - }, - "tx":{ - "$ref":"#/definitions/tx" - } - } - }, - "onChain":{ - "type":"object", - "properties":{ - "amount":{ - "type":"string", - "description":"Amount which recipient will receive on chain.", - "example":"1000", - "pattern":"^[0-9]*$" - }, - "submittedAt":{ - "type":"string", - "format":"date", - "description":"Date at which withdrawal has been sent on chain.", - "example":"2020-01-29T14:13:05.898Z" - } - } - }, - "fastWithdrawalData":{ - "type":"object", - "properties":{ - "transactionFee":{ - "type":"string", - "description":"fee to paid by the user in the currency of the transaction (quantised units).", - "example":"1", - "pattern":"^[0-9]*$" - }, - "recipientEthAddress":{ - "type":"string", - "description":"Ethereum address of recipient who will receive funds on chain.", - "example":"0x948cd3ad67c5f21412bfcd07a7981322f9fa01f0" - }, - "onChain":{ - "$ref":"#/definitions/onChain" - } - } - }, - "bridgedWithdrawalsPostResponse":{ - "type":"object", - "properties":{ - "_id":{ - "type":"string", - "example":"FEHn8HYEQQw" - }, - "createdAt":{ - "type":"string", - "format":"date", - "description":"The date (ISO 8601) at which bridgedWithdrawal was created.", - "example":"2020-05-13T14:11:02.205Z" - }, - "updatedAt":{ - "type":"string", - "format":"date", - "description":"The date (ISO 8601) at which bridgedWithdrawal was last updated.", - "example":"2020-05-13T14:13:10.403Z" - }, - "token":{ - "type":"string", - "example":"ETH" - }, - "amount":{ - "type":"string", - "description":"quantised amount of the token to be undefined", - "example":"10000000" - }, - "readyToWithdrawOnChain":{ - "type":"boolean", - "example":true - }, - "nonce":{ - "type":"integer", - "description":"Used to prevent creation of duplicate withdrawal if the request is retried with the same payload. withdrawal are be uniquely identified by a combination of user, token, amount and nonce.", - "example":976614084, - "minimum":0 - }, - "fastWithdrawalData":{ - "$ref":"#/definitions/fastWithdrawalData" - }, - "chain":{ - "type":"string", - "example":"MATIC_POS", - "enum":[ - "MATIC_POS" - ] - } - } - }, - "depositsPostPayload":{ - "type":"object", - "properties":{ - "token":{ - "type":"string", - "example":"ETH" - }, - "amount":{ - "type":"string", - "description":"quantised amount of the token to be deposited", - "example":"10000000" - }, - "txHash":{ - "type":"string", - "description":"Transaction Hash of the corresponding Ethereum transaction", - "example":"0xeef10fc5170f669b86c4cd0444882a96087221325f8bf2f55d6188633aa7be7c", - "pattern":"^0x[a-f0-9]+$", - "x-constraint":{ - "length":66 - } - } - } - }, - "Model26":{ - "type":"object", - "description":"Parameters of the Stark transaction created by this request.", - "properties":{ - "starkKey":{ - "type":"string", - "description":"Stark key of the owner of the destination vault", - "example":"0x1a2b3c", - "pattern":"^0x[a-f0-9]+$" - }, - "tokenId":{ - "type":"string", - "description":"Stark token id corresponding to the token being deposited.", - "example":"0xa1b2c3", - "pattern":"^0x[a-f0-9]+$" - }, - "vaultId":{ - "type":"number", - "description":"Stark vault id to which the funds will be deposited.", - "example":123 - }, - "amount":{ - "type":"string", - "description":"quantised amount of the token to be deposited", - "example":"10000000" - } - } - }, - "depositsPostResponse":{ - "type":"object", - "properties":{ - "_id":{ - "type":"string", - "example":"FEHn8HYEQQw" - }, - "createdAt":{ - "type":"string", - "format":"date", - "description":"The date (ISO 8601) at which deposit was created.", - "example":"2020-05-13T14:11:02.205Z" - }, - "updatedAt":{ - "type":"string", - "format":"date", - "description":"The date (ISO 8601) at which deposit was last updated.", - "example":"2020-05-13T14:13:10.403Z" - }, - "token":{ - "type":"string", - "example":"ETH" - }, - "amount":{ - "type":"string", - "description":"quantised amount of the token to be deposited", - "example":"10000000" - }, - "pending":{ - "type":"boolean", - "example":true - }, - "expiresAt":{ - "type":"string", - "format":"date", - "example":"2021-08-12T17:12:18.058Z" - }, - "txHash":{ - "type":"string", - "description":"Transaction Hash of the corresponding Ethereum transaction", - "example":"0xeef10fc5170f669b86c4cd0444882a96087221325f8bf2f55d6188633aa7be7c", - "pattern":"^0x[a-f0-9]+$", - "x-constraint":{ - "length":66 - } - }, - "tx":{ - "$ref":"#/definitions/Model26" - } - } - }, - "deposits-validatePostPayload":{ - "type":"object", - "properties":{ - "token":{ - "type":"string", - "example":"ETH" - }, - "amount":{ - "type":"string", - "description":"quantised amount of the token to be undefined", - "example":"10000000" - } - } - }, - "deposits-validatePostResponse":{ - "type":"object", - "properties":{ - "token":{ - "type":"string", - "example":"ETH" - }, - "amount":{ - "type":"string", - "description":"quantised amount of the token to be undefined", - "example":"10000000" - }, - "starkKey":{ - "type":"string", - "description":"Stark key of the owner of the destination vault", - "example":"0x1a2b3c", - "pattern":"^0x[a-f0-9]+$" - }, - "tokenId":{ - "type":"string", - "description":"Stark token id corresponding to the token being deposited.", - "example":"0xa1b2c3", - "pattern":"^0x[a-f0-9]+$" - }, - "vaultId":{ - "type":"number", - "description":"Stark vault id to which the funds will be deposited.", - "example":123 - } - } - }, - "withdrawalsPostPayload":{ - "type":"object", - "properties":{ - "token":{ - "type":"string", - "example":"ETH" - }, - "amount":{ - "type":"string", - "description":"quantised amount of the token to be withdrawn", - "example":"10000000" - }, - "nonce":{ - "type":"integer", - "description":"Used to prevent creation of duplicate withdrawal if the request is retried with the same payload. withdrawal are be uniquely identified by a combination of user, token, amount and nonce.", - "example":976614084, - "minimum":0 - } - } - }, - "withdrawalsPostResponse":{ - "type":"object", - "properties":{ - "_id":{ - "type":"string", - "example":"FEHn8HYEQQw" - }, - "createdAt":{ - "type":"string", - "format":"date", - "description":"The date (ISO 8601) at which withdrawal was created.", - "example":"2020-05-13T14:11:02.205Z" - }, - "updatedAt":{ - "type":"string", - "format":"date", - "description":"The date (ISO 8601) at which withdrawal was last updated.", - "example":"2020-05-13T14:13:10.403Z" - }, - "token":{ - "type":"string", - "example":"ETH" - }, - "amount":{ - "type":"string", - "description":"quantised amount of the token to be withdrawn", - "example":"10000000" - }, - "readyToWithdrawOnChain":{ - "type":"boolean" - }, - "nonce":{ - "type":"integer", - "description":"Used to prevent creation of duplicate withdrawal if the request is retried with the same payload. withdrawal are be uniquely identified by a combination of user, token, amount and nonce.", - "example":976614084, - "minimum":0 - } - } - }, - "starkPublicKey":{ - "type":"object", - "description":"The Stark public key. Both the \"x\" and \"y\" part are required.", - "example":{ - "x":"0746919ecbb54563de512f6fb556c21dab091748b41a60a946dbdbf118ac0a85", - "y":"58f7ce5eb6eb5bd24f70394622b1f4d2c54ebca317a3e61bf9f349dccf166cf" - }, - "properties":{ - "x":{ - "type":"string", - "description":"The \"x\" part of the Stark public key.", - "minLength":64, - "maxLength":64, - "x-format":{ - "hex":{ - "byteAligned":false - } - } - }, - "y":{ - "type":"string", - "description":"The \"y\" part of the Stark public key.", - "x-format":{ - "hex":{ - "byteAligned":false - } - } - } - }, - "required":[ - "x", - "y" - ] - }, - "Model27":{ - "type":"object", - "description":"Stark signature consisting of consisting of \"r\" and \"s\"", - "example":{ - "v":"3b46dfe03caef623048fedc8457a92385cd63eff6349ad135c945cd84937677", - "r":"1f38f551d798562c16d28733c7e3ff6850898d82f0ac9ccd39d373303b1778c", - "s":"518560420e52a37e9f580f024fc0fe8572cb2f5437a839075bbf4b2b123d572" - }, - "properties":{ - "v":{ - "type":"string", - "description":"The \"v\" part of the Stark signature." - }, - "r":{ - "type":"string", - "description":"The \"r\" part of the Stark signature." - }, - "s":{ - "type":"string", - "description":"The \"s\" part of the Stark signature." - } - }, - "required":[ - "r", - "s" - ] - }, - "Model28":{ - "type":"object", - "description":"Stark Limit Order Object.", - "example":{ - "vaultIdSell":1000002, - "vaultIdBuy":1000001, - "amountSell":"97400000", - "amountBuy":"100000000000000000", - "tokenSell":"0x2", - "tokenBuy":"0x1" - }, - "properties":{ - "vaultIdSell":{ - "type":"integer", - "description":"The vault ID of the seller.", - "minimum":0 - }, - "vaultIdBuy":{ - "type":"integer", - "description":"The vault ID of the buyer.", - "minimum":0 - }, - "amountSell":{ - "type":"string", - "description":"The total amount to be sold." - }, - "amountBuy":{ - "type":"string", - "description":"The total amount to be bought." - }, - "tokenSell":{ - "type":"string", - "description":"The Stark token ID for the token being sold." - }, - "tokenBuy":{ - "type":"string", - "description":"The Stark token ID for the token being bought." - }, - "nonce":{ - "type":"integer", - "description":"Used make identical stark transactions unique.", - "minimum":0, - "maximum":2147483647 - }, - "expirationTimestamp":{ - "type":"integer", - "description":"Expiration timestamp of the order.", - "minimum":0 - }, - "signature":{ - "$ref":"#/definitions/Model27" - } - } - }, - "Model29":{ - "type":"object", - "properties":{ - "starkOrder":{ - "$ref":"#/definitions/Model28" - } - } - }, - "Model30":{ - "type":"array", - "example":[ - { - "starkOrder":{ - "tokenBuy":"0x11af21d6b234cd669edd702dd3d1d017be888337010b950ae3679eb4194b4bc", - "amountBuy":"5000000000", - "vaultIdBuy":247827906, - "tokenSell":"0xb333e3142fe16b78628f19bb15afddaef437e72d6d7f5c6c20c6801a27fba6", - "amountSell":"200000000", - "vaultIdSell":2121602419, - "nonce":1079618848, - "expirationTimestamp":455582, - "signature":{ - "r":"0x2857ca21310ab87bb7c37ebad0e7166f1fb46e43cf32d6587a31e148d44b677", - "s":"0x45e939717a6de4ad5e79993d918bb40e629760da7a04062e965394d1d14106a" - } - } - }, - { - "starkOrder":{ - "tokenBuy":"0x11af21d6b234cd669edd702dd3d1d017be888337010b950ae3679eb4194b4bc", - "amountBuy":"5000000000", - "vaultIdBuy":247827906, - "tokenSell":"0xb333e3142fe16b78628f19bb15afddaef437e72d6d7f5c6c20c6801a27fba6", - "amountSell":"200000000", - "vaultIdSell":2121602419, - "nonce":1079618848, - "expirationTimestamp":455582, - "signature":{ - "r":"0x2857ca21310ab87bb7c37ebad0e7166f1fb46e43cf32d6587a31e148d44b677", - "s":"0x45e939717a6de4ad5e79993d918bb40e629760da7a04062e965394d1d14106a" - } - } - } - ], - "x-constraint":{ - "length":2 - }, - "items":{ - "$ref":"#/definitions/Model29" - } - }, - "AmmFundingOrdersPostPayload":{ - "type":"object", - "properties":{ - "pool":{ - "type":"string", - "example":"ETH:USDT" - }, - "starkPublicKey":{ - "$ref":"#/definitions/starkPublicKey" - }, - "orders":{ - "$ref":"#/definitions/Model30" - } - } - }, - "fill":{ - "type":"object", - "properties":{ - "amountBuy":{ - "type":"string" - }, - "amountSell":{ - "type":"string" - } - } - }, - "Model31":{ - "type":"object", - "properties":{ - "amountBuy":{ - "type":"string" - }, - "amountSell":{ - "type":"string" - }, - "fill":{ - "$ref":"#/definitions/fill" - }, - "starkOrder":{ - "$ref":"#/definitions/Model28" - }, - "tokenBuy":{ - "type":"string" - }, - "tokenSell":{ - "type":"string" - } - } - }, - "Model32":{ - "type":"array", - "x-constraint":{ - "length":2 - }, - "items":{ - "$ref":"#/definitions/Model31" - } - }, - "AmmFundingOrdersPostResponse":{ - "type":"object", - "example":{ - "_id":"L5QTNJtb2yF-GYa1NFCy1p5", - "closedAt":"2020-05-13T14:11:02.205Z", - "failed":false, - "pending":true, - "pool":"ETHUSDT", - "type":"Deposit", - "user":"0x948cd3ad67c5f21412bfcd07a7981322f9fa01f0", - "orders":[ - { - "tokenBuy":"LP-ETHUSDT", - "amountBuy":"50", - "tokenSell":"ETH", - "amountSell":"2", - "fill":{ - "amountBuy":"45", - "amountSell":"1" - }, - "starkOrder":{ - "tokenBuy":"0x11af21d6b234cd669edd702dd3d1d017be888337010b950ae3679eb4194b4bc", - "amountBuy":"5000000000", - "vaultIdBuy":247827906, - "tokenSell":"0xb333e3142fe16b78628f19bb15afddaef437e72d6d7f5c6c20c6801a27fba6", - "amountSell":"200000000", - "vaultIdSell":2121602419, - "nonce":1079618848, - "expirationTimestamp":455582, - "signature":{ - "r":"0x2857ca21310ab87bb7c37ebad0e7166f1fb46e43cf32d6587a31e148d44b677", - "s":"0x45e939717a6de4ad5e79993d918bb40e629760da7a04062e965394d1d14106a" - } - } - }, - { - "tokenBuy":"LP-ETHUSDT", - "amountBuy":"50", - "tokenSell":"USDT", - "amountSell":"1230", - "fill":{ - "amountBuy":"48", - "amountSell":"1220" - }, - "starkOrder":{ - "tokenBuy":"0x11af21d6b234cd669edd702dd3d1d017be888337010b950ae3679eb4194b4bc", - "amountBuy":"5000000000", - "vaultIdBuy":247827906, - "tokenSell":"0xb333e3142fe16b78628f19bb15afddaef437e72d6d7f5c6c20c6801a27fba6", - "amountSell":"200000000", - "vaultIdSell":2121602419, - "nonce":1079618848, - "expirationTimestamp":455582, - "signature":{ - "r":"0x2857ca21310ab87bb7c37ebad0e7166f1fb46e43cf32d6587a31e148d44b677", - "s":"0x45e939717a6de4ad5e79993d918bb40e629760da7a04062e965394d1d14106a" - } - } - } - ], - "starkPublicKey":{ - "x":"0746919ecbb54563de512f6fb556c21dab091748b41a60a946dbdbf118ac0a85", - "y":"690890d33f62e706b80d214546ab3fd063fad5893d990df876bafae113be981" - }, - "createdAt":"2020-05-13T14:11:02.205Z", - "updatedAt":"2020-05-13T14:13:10.403Z" - }, - "properties":{ - "pool":{ - "type":"string", - "example":"ETH:USDT" - }, - "starkPublicKey":{ - "$ref":"#/definitions/starkPublicKey" - }, - "_id":{ - "type":"string" - }, - "closedAt":{ - "type":"string", - "format":"date" - }, - "failed":{ - "type":"boolean" - }, - "pending":{ - "type":"boolean" - }, - "type":{ - "type":"string", - "enum":[ - "Deposit", - "Withdrawal" - ] - }, - "user":{ - "type":"string" - }, - "orders":{ - "$ref":"#/definitions/Model32" - }, - "createdAt":{ - "type":"string", - "format":"date", - "description":"The date (ISO 8601) at which AmmFundingOrder was created.", - "example":"2020-05-13T14:11:02.205Z" - }, - "updatedAt":{ - "type":"string", - "format":"date", - "description":"The date (ISO 8601) at which AmmFundingOrder was last updated.", - "example":"2020-05-13T14:13:10.403Z" - } - } - }, - "Model33":{ - "type":"object", - "properties":{ - "user":{ - "type":"string" - }, - "token":{ - "type":"string", - "description":"token for the airdrop", - "example":"DVF" - }, - "amount":{ - "type":"string", - "description":"Amount of token to give in standard format" - } - } - }, - "airdrops":{ - "type":"array", - "items":{ - "$ref":"#/definitions/Model33" - } - }, - "addAirdropRequestSchema":{ - "type":"object", - "properties":{ - "nonce":{ - "type":"string", - "description":"This nonce which used to provide the time until which this nonce is valid. It is presented as seconds since epoch.", - "example":"v2-1704114061.000" - }, - "signature":{ - "type":"string", - "description":"The signature obtained by signing the nonce with your private ethereum key.", - "example":"0x2b48d53f2e3a696630ebdcd1ff057556bbc9de9c294adfaa5b1f13df91b67b347fdd88c29594c377ba0024dec40cd9808829e7f4447772482f50a7a8e9a903561c" - }, - "airdrops":{ - "$ref":"#/definitions/airdrops" - } - } - }, - "Model34":{ - "type":"object", - "properties":{ - "user":{ - "type":"string", - "description":"Ethereum address", - "example":"0x08152c1265dbc218ccc8ab5c574e6bd52279b3b7" - }, - "token":{ - "type":"string", - "description":"token for the airdrop", - "example":"DVF" - }, - "amount":{ - "type":"string", - "description":"DVF airdrop eligible amount", - "example":"15.52" - } - } - }, - "addAirdropResponseSchema":{ - "type":"array", - "items":{ - "$ref":"#/definitions/Model34" - } - }, - "fields":{ - "type":"array", - "description":"Specific fields to be returned for balance information", - "example":[ - "balance", - "updatedAt" - ], - "items":{ - "type":"string", - "enum":[ - "balance", - "available", - "locked", - "updatedAt" - ] - } - }, - "getBalancePayload":{ - "type":"object", - "properties":{ - "nonce":{ - "type":"string", - "description":"This nonce which used to provide the time until which this nonce is valid. It is presented as seconds since epoch.", - "example":"v2-1704114061.000" - }, - "signature":{ - "type":"string", - "description":"The signature obtained by signing the nonce with your private ethereum key.", - "example":"0x2b48d53f2e3a696630ebdcd1ff057556bbc9de9c294adfaa5b1f13df91b67b347fdd88c29594c377ba0024dec40cd9808829e7f4447772482f50a7a8e9a903561c" - }, - "token":{ - "type":"string", - "description":"The token which the balance is specifically requested for.", - "example":"ETH" - }, - "fields":{ - "$ref":"#/definitions/fields" - } - } - }, - "Model35":{ - "type":"object", - "properties":{ - "token":{ - "type":"string", - "description":"The token for which the balances are provided.", - "example":"ETH" - }, - "balance":{ - "type":"number", - "description":"It is the total balance for the user corresponding to the specified token.", - "example":42 - }, - "available":{ - "type":"number", - "description":"It is the part of the balance available for use.", - "example":23 - }, - "locked":{ - "type":"number", - "description":"It is the part of the balance currently in open orders or pending withdrawal.", - "example":19 - } - } - }, - "getBalanceResponse":{ - "type":"array", - "items":{ - "$ref":"#/definitions/Model35" - } - }, - "getDepositsPayload":{ - "type":"object", - "properties":{ - "nonce":{ - "type":"string", - "description":"This nonce which used to provide the time until which this nonce is valid. It is presented as seconds since epoch.", - "example":"v2-1704114061.000" - }, - "signature":{ - "type":"string", - "description":"The signature obtained by signing the nonce with your private ethereum key.", - "example":"0x2b48d53f2e3a696630ebdcd1ff057556bbc9de9c294adfaa5b1f13df91b67b347fdd88c29594c377ba0024dec40cd9808829e7f4447772482f50a7a8e9a903561c" - }, - "token":{ - "type":"string", - "description":"The token which the balance is specifically requested for.", - "example":"ETH" - } - } - }, - "getDepositsResponse":{ - "type":"object", - "properties":{ - "ethAddress":{ - "type":"string", - "description":"The ethereum public address of the user.", - "example":"0x341E46a49F15785373edE443Df0220DEa6a41Bbc" - }, - "starkKey":{ - "type":"string", - "description":"The Stark public key.", - "example":"77a3b314db07c45076d11f62b6f9e748a39790441823307743cf00d6597ea43" - }, - "starkVaultId":{ - "type":"number", - "description":"The Stark vault ID.", - "example":123 - }, - "starkTokenId":{ - "type":"string", - "description":"The Stark token ID.", - "example":"0x7" - }, - "token":{ - "type":"string", - "description":"The token that was deposited", - "example":"NEC" - }, - "amount":{ - "type":"number", - "description":"The amount that was deposited.", - "example":1000 - }, - "createdAt":{ - "type":"string", - "description":"The date and time of the deposit.", - "example":"2020-01-29T14:02:08.477Z" - }, - "isPostedOffchain":{ - "type":"boolean", - "description":"Flag to indicate if the deposit was posted off chain.", - "example":false - }, - "isConfirmedOnChain":{ - "type":"boolean", - "description":"Flag to indicate if the deposit was confirmed off chain.", - "example":true - } - } - }, - "getOrderPayload":{ - "type":"object", - "properties":{ - "nonce":{ - "type":"string", - "description":"This nonce which used to provide the time until which this nonce is valid. It is presented as seconds since epoch.", - "example":"v2-1704114061.000" - }, - "signature":{ - "type":"string", - "description":"The signature obtained by signing the nonce with your private ethereum key.", - "example":"0x2b48d53f2e3a696630ebdcd1ff057556bbc9de9c294adfaa5b1f13df91b67b347fdd88c29594c377ba0024dec40cd9808829e7f4447772482f50a7a8e9a903561c" - }, - "orderId":{ - "type":"string", - "description":"The order ID.", - "example":"d7c8b9" - }, - "cid":{ - "type":"string", - "description":"An optional user-defined identifier for this order", - "example":"satoshi-order-2083236893" - } - } - }, - "getOrderResponse":{ - "type":"object", - "properties":{ - "_id":{ - "type":"string", - "description":"Id for the order. This can be used for orderId when calling cancelOrder or getOrder", - "example":"L1tarX5wUem" - }, - "amount":{ - "type":"string", - "description":"Original order size placed.", - "example":"-0.15" - }, - "totalFilled":{ - "type":"number", - "description":"Total of all fills executed.", - "example":"-0.15" - }, - "price":{ - "type":"string", - "description":"Cost per unit.", - "example":"250" - }, - "symbol":{ - "type":"string", - "description":"Trading symbol for the order", - "example":"ETH:USDT" - }, - "active":{ - "type":"boolean", - "description":"Active status true or false.", - "example":false - }, - "canceled":{ - "type":"boolean", - "description":"Canceled status true or false.", - "example":false - }, - "pending":{ - "type":"boolean", - "description":"Pending status true or false.", - "example":false - }, - "cid":{ - "type":"string", - "description":"An optional user-defined identifier for this order", - "example":"satoshi-order-2083236893" - } - } - }, - "getPendingWithdrawalsPayload":{ - "type":"object", - "properties":{ - "nonce":{ - "type":"string", - "description":"This nonce which used to provide the time until which this nonce is valid. It is presented as seconds since epoch.", - "example":"v2-1704114061.000" - }, - "signature":{ - "type":"string", - "description":"The signature obtained by signing the nonce with your private ethereum key.", - "example":"0x2b48d53f2e3a696630ebdcd1ff057556bbc9de9c294adfaa5b1f13df91b67b347fdd88c29594c377ba0024dec40cd9808829e7f4447772482f50a7a8e9a903561c" - }, - "token":{ - "type":"string" - } - } - }, - "authPayload":{ - "type":"object", - "properties":{ - "nonce":{ - "type":"string", - "description":"This nonce which used to provide the time until which this nonce is valid. It is presented as seconds since epoch.", - "example":"v2-1704114061.000" - }, - "signature":{ - "type":"string", - "description":"The signature obtained by signing the nonce with your private ethereum key.", - "example":"0x2b48d53f2e3a696630ebdcd1ff057556bbc9de9c294adfaa5b1f13df91b67b347fdd88c29594c377ba0024dec40cd9808829e7f4447772482f50a7a8e9a903561c" - } - } - }, - "Model36":{ - "type":"object", - "properties":{ - "balances":{ - "type":"boolean", - "description":"is balances authorized" - }, - "tradingHistory":{ - "type":"boolean", - "description":"is trading history authorized" - } - } - }, - "Model37":{ - "type":"object", - "description":"This contains application configuration details to set up for deposits and trading.", - "example":{ - "defaultFeeRate":0.002, - "deversifiAddress":"0x9ab450355b4ab504cbc0e4de484781dac08e6a26", - "starkExContractAddress":"0xF3731d0cdC9834f6F32104580bD226EF1bc1A9F9", - "exchangeSymbols":"[\"ETH:USDT\",\"ZRX:USDT\",\"ZRX:ETH\"]", - "newMarkets":[ - "ZRX:USDT", - "ZRX:ETH" - ], - "tempStarkVaultId":1 - }, - "properties":{ - "defaultFeeRate":{ - "type":"number", - "description":"The default fee rate, if no volume or maker discount." - }, - "deversifiAddress":{ - "type":"string", - "description":"The address of the DeversiFi exchange." - }, - "starkExContractAddress":{ - "type":"string", - "description":"Stark deposit contract address." - }, - "exchangeSymbols":{ - "type":"string", - "description":"Currency pairs available at the DeversiFi exchange for trading" - }, - "newMarkets":{ - "$ref":"#/definitions/newMarkets" - }, - "tempStarkVaultId":{ - "type":"number", - "description":"Transit Stark vault ID used for deposit privacy" - } - } - }, - "getUserConfResponse":{ - "type":"object", - "properties":{ - "DVF":{ - "$ref":"#/definitions/Model37" - }, - "tokenRegistry":{ - "$ref":"#/definitions/collateralBalancesSchema" - }, - "isRegistered":{ - "type":"string", - "description":"Registration status.", - "example":"true" - }, - "isRegisteredOnChain":{ - "type":"boolean", - "description":"Whether the user is registered with Starkware.", - "example":true, - "enum":[ - true, - false - ] - }, - "allowance":{ - "$ref":"#/definitions/getAllowanceResponse" - }, - "ethAddress":{ - "type":"string", - "description":"Ethereum address.", - "example":"0x278ff3bb25c5b1bb7032e822661974479280fa74" - }, - "starkKeyHex":{ - "type":"string", - "description":"Stark Public key as hex string.", - "example":"0x011869c13b32ab9b7ec84e2b31c1de58baaaa6bbb2443a33bbad8df739a6e957" - } - } - }, - "getVaultIdPayload":{ - "type":"object", - "properties":{ - "nonce":{ - "type":"string", - "description":"This nonce which used to provide the time until which this nonce is valid. It is presented as seconds since epoch.", - "example":"v2-1704114061.000" - }, - "signature":{ - "type":"string", - "description":"The signature obtained by signing the nonce with your private ethereum key.", - "example":"0x2b48d53f2e3a696630ebdcd1ff057556bbc9de9c294adfaa5b1f13df91b67b347fdd88c29594c377ba0024dec40cd9808829e7f4447772482f50a7a8e9a903561c" - }, - "token":{ - "type":"string", - "description":"The new token for which a new vault Id needs to be allocated.", - "example":"DAI" - } - }, - "required":[ - "token" - ] - }, - "getWithdrawalPayload":{ - "type":"object", - "properties":{ - "nonce":{ - "type":"string", - "description":"This nonce which used to provide the time until which this nonce is valid. It is presented as seconds since epoch.", - "example":"v2-1704114061.000" - }, - "signature":{ - "type":"string", - "description":"The signature obtained by signing the nonce with your private ethereum key.", - "example":"0x2b48d53f2e3a696630ebdcd1ff057556bbc9de9c294adfaa5b1f13df91b67b347fdd88c29594c377ba0024dec40cd9808829e7f4447772482f50a7a8e9a903561c" - }, - "withdrawalId":{ - "type":"string", - "description":"Used to identify a specific withdrawal.", - "example":"i6JjTE2PDL" - } - }, - "required":[ - "withdrawalId" - ] - }, - "withdrawHistoryObject":{ - "type":"object", - "properties":{ - "_id":{ - "type":"string", - "description":"Withdrawal ID.", - "example":"LCafcGC6tBH" - }, - "token":{ - "type":"string", - "description":"The token that was withdrawn.", - "example":"NEC" - }, - "amount":{ - "type":"string", - "description":"The amount that was withdrawn.", - "example":"100", - "pattern":"^[0-9]*$" - }, - "createdAt":{ - "type":"string", - "format":"date", - "description":"The date and time withdrawal request was received.", - "example":"2020-01-29T14:13:05.898Z" - }, - "readyToWithdrawOnChain":{ - "type":"boolean", - "description":"The withdrawal is ready to be requested.", - "example":true - }, - "canceled":{ - "type":"boolean", - "description":"The withdrawal has been canceled.", - "example":true - } - }, - "required":[ - "_id", - "token", - "createdAt", - "readyToWithdrawOnChain" - ] - }, - "Model38":{ - "type":"object", - "properties":{ - "hasReceived":{ - "type":"boolean", - "description":"Registration compensation was/not received.", - "example":true - }, - "date":{ - "type":"string", - "format":"date", - "description":"When was the compensation received", - "example":"2021-08-12T17:17:37.009Z" - } - } - }, - "openOrdersPayload":{ - "type":"object", - "properties":{ - "nonce":{ - "type":"string", - "description":"This nonce which used to provide the time until which this nonce is valid. It is presented as seconds since epoch.", - "example":"v2-1704114061.000" - }, - "signature":{ - "type":"string", - "description":"The signature obtained by signing the nonce with your private ethereum key.", - "example":"0x2b48d53f2e3a696630ebdcd1ff057556bbc9de9c294adfaa5b1f13df91b67b347fdd88c29594c377ba0024dec40cd9808829e7f4447772482f50a7a8e9a903561c" - }, - "symbol":{ - "type":"string", - "description":"Specifies the trading pair.", - "example":"ZRX:ETH" - } - } - }, - "openOrderResponseObject.js":{ - "type":"object", - "properties":{ - "_id":{ - "type":"string", - "description":"Order Id, this can be used as orderId when calling cancelOrder or getOrder.", - "example":"L1tarX5wUem" - }, - "user":{ - "type":"string", - "description":"Ethereum address of the user.", - "example":"0x341e46a49f15785373ede443df0220dea6a41bbc" - }, - "symbol":{ - "type":"string", - "description":"The trading pair symbol for this order.", - "example":"ZRX:ETH" - }, - "amount":{ - "type":"number", - "description":"Original order size placed.", - "example":50 - }, - "amountOrig":{ - "type":"number", - "description":"Same as amount, included for backward compatibility.", - "example":50 - }, - "totalFilled":{ - "type":"number", - "description":"Total of all fills executed.", - "example":50 - }, - "tokenBuy":{ - "type":"string", - "description":"Token being bought as part of this exchange order.", - "example":"ETH" - }, - "totalBought":{ - "type":"string", - "description":"Total tokens bought, in quantized units.", - "example":"4990000000", - "pattern":"^[0-9]*$" - }, - "tokenSell":{ - "type":"string", - "description":"Token being sold as part of this exchange order.", - "example":"ETH" - }, - "tokenSellLockedBalance":{ - "type":"string", - "description":"Amount of tokens to be sold, locked when order was submitted (quantized units).", - "example":"45555500", - "pattern":"^[0-9]*$" - }, - "totalSold":{ - "type":"string", - "description":"Total tokens sold, in quantized units.", - "example":"45555500", - "pattern":"^[0-9]*$" - }, - "type":{ - "type":"string", - "description":"Type of the order. Currently, \"EXCHANGE LIMIT\" is the only type that is supported.", - "example":"EXCHANGE LIMIT" - }, - "price":{ - "type":"number", - "description":"Cost per unit.", - "example":0.01 - }, - "averagePrice":{ - "type":"number", - "description":"Average price at which the order has been settled.", - "example":0.0091111 - }, - "feeRate":{ - "type":"number", - "description":"The max fee rate applicable for the order.", - "example":0.002 - }, - "createdAt":{ - "type":"string", - "format":"date", - "description":"The date and time when the order was created.", - "example":"2020-05-13T14:11:02.205Z" - }, - "updatedAt":{ - "type":"string", - "format":"date", - "description":"The date and time when the order was last updated.", - "example":"2020-05-13T14:13:10.403Z" - }, - "activatedAt":{ - "type":"string", - "format":"date", - "description":"The date and time when the order was activated.", - "example":"2020-05-13T14:11:03.000Z" - }, - "lastFillTime":{ - "type":"string", - "format":"date", - "description":"The date and time when the last fill occurred for this order.", - "example":"2020-05-13T14:13:18.000Z" - }, - "canceled":{ - "type":"boolean", - "description":"Canceled status true or false.", - "example":false - }, - "isPostOnly":{ - "type":"boolean", - "description":"Flag to indicate if the order is post-only.", - "example":false - }, - "isHidden":{ - "type":"boolean", - "description":"Flag to indicate if the order is hidden.", - "example":false - }, - "isFillOrKill":{ - "type":"boolean", - "description":"Flag to indicate if fill or kill order.", - "example":false - }, - "isSlippageDisabled":{ - "type":"boolean", - "description":"Flag to indicate if slippage protection is disabled.", - "example":false - }, - "partnerId":{ - "type":"string", - "description":"TODO", - "example":"P1" - }, - "cid":{ - "type":"string", - "description":"An optional user-defined identifier for this order", - "example":"satoshi-order-2083236893" - }, - "awaitingSettlement":{ - "type":"number", - "description":"TODO", - "example":10 - }, - "meta":{ - "$ref":"#/definitions/collateralBalancesSchema" - }, - "active":{ - "type":"boolean", - "description":"If false, the order has not been included in the order book yet.", - "example":false - } - }, - "required":[ - "_id", - "user", - "symbol", - "amount", - "amountOrig", - "tokenBuy", - "tokenSell", - "tokenSellLockedBalance", - "type", - "price", - "createdAt", - "updatedAt", - "active" - ] - }, - "openOrdersResponse":{ - "type":"array", - "items":{ - "$ref":"#/definitions/openOrderResponseObject.js" - } - }, - "orderHistoryPayload":{ - "type":"object", - "properties":{ - "nonce":{ - "type":"string", - "description":"This nonce which used to provide the time until which this nonce is valid. It is presented as seconds since epoch.", - "example":"v2-1704114061.000" - }, - "signature":{ - "type":"string", - "description":"The signature obtained by signing the nonce with your private ethereum key.", - "example":"0x2b48d53f2e3a696630ebdcd1ff057556bbc9de9c294adfaa5b1f13df91b67b347fdd88c29594c377ba0024dec40cd9808829e7f4447772482f50a7a8e9a903561c" - }, - "symbol":{ - "type":"string", - "description":"Specifies the trading pair.", - "example":"ETH:USDT" - } - } - }, - "closedOrderResponseObject":{ - "type":"object", - "properties":{ - "_id":{ - "type":"string", - "description":"Order Id, this can be used as orderId when calling cancelOrder or getOrder.", - "example":"L1tarX5wUem" - }, - "user":{ - "type":"string", - "description":"Ethereum address of the user.", - "example":"0x341e46a49f15785373ede443df0220dea6a41bbc" - }, - "symbol":{ - "type":"string", - "description":"The trading pair symbol for this order.", - "example":"ZRX:ETH" - }, - "amount":{ - "type":"number", - "description":"Original order size placed.", - "example":50 - }, - "amountOrig":{ - "type":"number", - "description":"Same as amount, included for backward compatibility.", - "example":50 - }, - "totalFilled":{ - "type":"number", - "description":"Total of all fills executed.", - "example":50 - }, - "tokenBuy":{ - "type":"string", - "description":"Token being bought as part of this exchange order.", - "example":"ETH" - }, - "totalBought":{ - "type":"string", - "description":"Total tokens bought, in quantized units.", - "example":"4990000000", - "pattern":"^[0-9]*$" - }, - "tokenSell":{ - "type":"string", - "description":"Token being sold as part of this exchange order.", - "example":"ETH" - }, - "tokenSellLockedBalance":{ - "type":"string", - "description":"Amount of tokens to be sold, locked when order was submitted (quantized units).", - "example":"45555500", - "pattern":"^[0-9]*$" - }, - "totalSold":{ - "type":"string", - "description":"Total tokens sold, in quantized units.", - "example":"45555500", - "pattern":"^[0-9]*$" - }, - "type":{ - "type":"string", - "description":"Type of the order. Currently, \"EXCHANGE LIMIT\" is the only type that is supported.", - "example":"EXCHANGE LIMIT" - }, - "price":{ - "type":"number", - "description":"Cost per unit.", - "example":0.01 - }, - "averagePrice":{ - "type":"number", - "description":"Average price at which the order has been settled.", - "example":0.0091111 - }, - "feeRate":{ - "type":"number", - "description":"The max fee rate applicable for the order.", - "example":0.002 - }, - "createdAt":{ - "type":"string", - "format":"date", - "description":"The date and time when the order was created.", - "example":"2020-05-13T14:11:02.205Z" - }, - "updatedAt":{ - "type":"string", - "format":"date", - "description":"The date and time when the order was last updated.", - "example":"2020-05-13T14:13:10.403Z" - }, - "activatedAt":{ - "type":"string", - "format":"date", - "description":"The date and time when the order was activated.", - "example":"2020-05-13T14:11:03.000Z" - }, - "lastFillTime":{ - "type":"string", - "format":"date", - "description":"The date and time when the last fill occurred for this order.", - "example":"2020-05-13T14:13:18.000Z" - }, - "canceled":{ - "type":"boolean", - "description":"Canceled status true or false.", - "example":false - }, - "isPostOnly":{ - "type":"boolean", - "description":"Flag to indicate if the order is post-only.", - "example":false - }, - "isHidden":{ - "type":"boolean", - "description":"Flag to indicate if the order is hidden.", - "example":false - }, - "isFillOrKill":{ - "type":"boolean", - "description":"Flag to indicate if fill or kill order.", - "example":false - }, - "isSlippageDisabled":{ - "type":"boolean", - "description":"Flag to indicate if slippage protection is disabled.", - "example":false - }, - "partnerId":{ - "type":"string", - "description":"TODO", - "example":"P1" - }, - "cid":{ - "type":"string", - "description":"An optional user-defined identifier for this order", - "example":"satoshi-order-2083236893" - }, - "awaitingSettlement":{ - "type":"number", - "description":"TODO", - "example":10 - }, - "meta":{ - "$ref":"#/definitions/collateralBalancesSchema" - } - }, - "required":[ - "_id", - "user", - "symbol", - "amount", - "amountOrig", - "tokenBuy", - "tokenSell", - "tokenSellLockedBalance", - "type", - "price", - "createdAt", - "updatedAt" - ] - }, - "Model39":{ - "type":"array", - "items":{ - "$ref":"#/definitions/closedOrderResponseObject" - } - }, - "recoverTradingKeyResponse":{ - "type":"object", - "properties":{ - "encryptedTradingKey":{ - "type":"string", - "description":"Encrypted Stark Trading Key", - "example":"7b2276657273696f6e223a227832353531392d7873616c736132302d706f6c7931333035222c226e6f6e6365223a22765633313730366571496f696432717944444539465055346f7466346171457a222c22657068656d5075626c69634b6579223a227358657a625174556c453476555661547857466b326555427532627746342f6641434378536a592f306e513d222c2263697068657274657874223a22444e5041615a76726331374f4d656a5451354f544e4243536d594b504466745335574b307278794b716671715770486d53676a4568782b3259352f6b4a6e3233674e5454476c31306973556271696d72636e67676a61636e346335317672484a697a427166324737227d" - }, - "dtkVersion":{ - "type":"string", - "description":"Trading Key Version", - "example":"v2" - } - } - }, - "permissionsPayload":{ - "type":"object", - "properties":{ - "nonce":{ - "type":"string", - "description":"This nonce which used to provide the time until which this nonce is valid. It is presented as seconds since epoch.", - "example":"v2-1704114061.000" - }, - "signature":{ - "type":"string", - "description":"The signature obtained by signing the nonce with your private ethereum key.", - "example":"0x2b48d53f2e3a696630ebdcd1ff057556bbc9de9c294adfaa5b1f13df91b67b347fdd88c29594c377ba0024dec40cd9808829e7f4447772482f50a7a8e9a903561c" - }, - "key":{ - "type":"string", - "description":"The permission key to change the access for", - "example":"balances" - }, - "value":{ - "type":"boolean", - "description":"Whether to allow public access to the endpoints driven by provided permission", - "example":true - } - } - }, - "Model40":{ - "type":"object", - "properties":{ - "count":{ - "type":"number", - "description":"Total count of user's filled orders.", - "example":1414 - } - } - }, - "withdrawHistoryResponse":{ - "type":"array", - "items":{ - "$ref":"#/definitions/withdrawHistoryObject" - } - }, - "Model41":{ - "type":"object", - "properties":{ - "orderId":{ - "type":"string", - "description":"The order ID", - "example":"d7c8b9" - }, - "canceled":{ - "type":"boolean", - "description":"only if order is already canceled", - "example":true - }, - "active":{ - "type":"boolean", - "description":"whether order is active", - "example":true - } - } - }, - "cancelOpenOrdersResponse":{ - "type":"array", - "items":{ - "$ref":"#/definitions/Model41" - } - }, - "cancelOrderResponse":{ - "type":"object", - "properties":{ - "orderId":{ - "type":"string", - "description":"The order ID.", - "example":"d7c8b9" - }, - "canceled":{ - "type":"boolean", - "description":"only if order is already canceled", - "example":true - } - } - }, - "cancelWithdrawalPayload":{ - "type":"object", - "properties":{ - "nonce":{ - "type":"string", - "description":"This nonce which used to provide the time until which this nonce is valid. It is presented as seconds since epoch.", - "example":"v2-1704114061.000" - }, - "signature":{ - "type":"string", - "description":"The signature obtained by signing the nonce with your private ethereum key.", - "example":"0x2b48d53f2e3a696630ebdcd1ff057556bbc9de9c294adfaa5b1f13df91b67b347fdd88c29594c377ba0024dec40cd9808829e7f4447772482f50a7a8e9a903561c" - }, - "id":{ - "type":"string", - "description":"Withdrawal ID.", - "example":"LCafcGC6tBH" - } - }, - "required":[ - "id" - ] - }, - "airdropEligibilityQuery":{ - "type":"object", - "properties":{ - "nonce":{ - "type":"string", - "description":"This nonce which used to provide the time until which this nonce is valid. It is presented as seconds since epoch.", - "example":"v2-1704114061.000" - }, - "signature":{ - "type":"string", - "description":"The signature obtained by signing the nonce with your private ethereum key.", - "example":"0x2b48d53f2e3a696630ebdcd1ff057556bbc9de9c294adfaa5b1f13df91b67b347fdd88c29594c377ba0024dec40cd9808829e7f4447772482f50a7a8e9a903561c" - }, - "token":{ - "type":"string", - "description":"token for the airdrop", - "example":"DVF" - } - }, - "required":[ - "token" - ] - }, - "Model42":{ - "type":"object", - "properties":{ - "_id":{ - "type":"string", - "description":"ID of the airdrop claim eligibility", - "example":"d7c8b9" - } - } - }, - "Model43":{ - "type":"object", - "description":"The Stark public key. Both the \"x\" and \"y\" part are required.", - "example":{ - "x":"0746919ecbb54563de512f6fb556c21dab091748b41a60a946dbdbf118ac0a85", - "y":"58f7ce5eb6eb5bd24f70394622b1f4d2c54ebca317a3e61bf9f349dccf166cf" - }, - "properties":{ - "x":{ - "type":"string", - "description":"The \"x\" part of the Stark public key." - }, - "y":{ - "type":"string", - "description":"The \"y\" part of the Stark public key." - } - } - }, - "depositPayload":{ - "type":"object", - "properties":{ - "token":{ - "type":"string", - "description":"The token for which the deposit was made.", - "example":"ZRX" - }, - "amount":{ - "type":"number", - "description":"The deposit amount.", - "example":1 - }, - "nonce":{ - "type":"number" - }, - "starkPublicKey":{ - "$ref":"#/definitions/Model43" - }, - "starkSignature":{ - "$ref":"#/definitions/Model27" - }, - "starkVaultId":{ - "type":"number", - "description":"The Stark vault ID.", - "example":1000003 - }, - "expireTime":{ - "type":"number", - "description":"Expiry time in hours", - "example":454934 - } - }, - "required":[ - "token", - "amount", - "nonce", - "starkPublicKey", - "starkSignature", - "starkVaultId", - "expireTime" - ] - }, - "depositResponse":{ - "type":"object", - "properties":{ - "isPostedOffchain":{ - "type":"boolean", - "description":"Flag to indicate if the deposit was posted off chain.", - "example":false - }, - "isConfirmedOnChain":{ - "type":"boolean", - "description":"Flag to indicate if the deposit was confirmed off chain.", - "example":true - }, - "_id":{ - "type":"string", - "example":"5e335f88bdcd70001e52d0a7" - }, - "starkVaultId":{ - "type":"number", - "description":"The Stark vault ID.", - "example":1000003 - }, - "starkKey":{ - "type":"string", - "description":"The Stark public key.", - "example":"0746919ecbb54563de512f6fb556c21dab091748b41a60a946dbdbf118ac0a85" - }, - "starkSignature":{ - "$ref":"#/definitions/Model27" - }, - "starkTokenId":{ - "type":"string", - "description":"The Stark token ID.", - "example":"0x3" - }, - "amount":{ - "type":"number", - "description":"The amount that was deposited.", - "example":1 - }, - "ethAddress":{ - "type":"string", - "description":"Ethereum public address of the user.", - "example":"0x341e46a49f15785373ede443df0220dea6a41bbc" - }, - "createdAt":{ - "type":"string", - "description":"The date and time of the deposit.", - "example":"2020-01-30T22:58:16.720Z" - } - }, - "required":[ - "starkSignature" - ] - }, - "Model44":{ - "type":"object", - "description":"StarkWare ConditionalTansferRequest", - "example":{ - "amount":"10000000", - "expirationTimestamp":446134, - "fact":"3c3f4eb0255776079339f0b253cc85310a3a56a0dcdd76ca5a995f4816cd0763", - "factRegistryAddress":"0xA9F9cC1189b9d6051b26467b29629787C671905d", - "nonce":976614084, - "receiverPublicKey":"0x077a3b314db07c45076d11f62b6f9e748a39790441823307743cf00d6597ea43", - "receiverVaultId":1863686755, - "senderPublicKey":"0x044926648f4b6f002dfa389c536129ae178f34d9be452724268cc48ebea2b37c", - "senderVaultId":2010760265, - "token":"0x180bef8ae3462e919489763b84dc1dc700c45a249dec4d1136814a639f2dd7b", - "type":"ConditionalTransferRequest", - "signature":{ - "r":"0x2857ca21310ab87bb7c37ebad0e7166f1fb46e43cf32d6587a31e148d44b677", - "s":"0x45e939717a6de4ad5e79993d918bb40e629760da7a04062e965394d1d14106a" - } - }, - "properties":{ - "amount":{ - "type":"string", - "pattern":"^[0-9]*$" - }, - "expirationTimestamp":{ - "type":"integer", - "minimum":0 - }, - "nonce":{ - "type":"integer", - "minimum":0 - }, - "receiverPublicKey":{ - "type":"string", - "pattern":"^0x[a-f0-9]+$" - }, - "receiverVaultId":{ - "type":"integer" - }, - "senderPublicKey":{ - "type":"string", - "pattern":"^0x[a-f0-9]+$" - }, - "senderVaultId":{ - "type":"integer" - }, - "signature":{ - "$ref":"#/definitions/signature" - }, - "token":{ - "type":"string", - "pattern":"^0x[a-f0-9]+$" - }, - "type":{ - "type":"string", - "enum":[ - "ConditionalTransferRequest" - ] - }, - "fact":{ - "type":"string", - "x-format":{ - "hex":{ - "byteAligned":false - } - } - }, - "factRegistryAddress":{ - "type":"string", - "pattern":"^0x[a-f0-9]+$" - } - } - }, - "fastWithdrawalPayload":{ - "type":"object", - "properties":{ - "recipientEthAddress":{ - "type":"string", - "description":"Ethereum address of recipient who will receive funds on chain.", - "example":"0x948cd3ad67c5f21412bfcd07a7981322f9fa01f0" - }, - "tx":{ - "$ref":"#/definitions/Model44" - }, - "transactionFee":{ - "type":"string", - "description":"fee to paid by the user in the currency of the transaction (quantised units).", - "example":"1", - "pattern":"^[0-9]*$" - }, - "starkPublicKey":{ - "$ref":"#/definitions/starkPublicKey" - } - } - }, - "Model45":{ - "type":"object", - "properties":{ - "_id":{ - "type":"string", - "description":"Withdrawal ID.", - "example":"LCafcGC6tBH" - }, - "token":{ - "type":"string", - "description":"The token that was withdrawn.", - "example":"NEC" - }, - "amount":{ - "type":"string", - "description":"The amount that was withdrawn.", - "example":"100", - "pattern":"^[0-9]*$" - }, - "createdAt":{ - "type":"string", - "format":"date", - "description":"The date and time withdrawal request was received.", - "example":"2020-01-29T14:13:05.898Z" - }, - "readyToWithdrawOnChain":{ - "type":"boolean", - "description":"The withdrawal is ready to be requested.", - "example":true - }, - "canceled":{ - "type":"boolean", - "description":"The withdrawal has been canceled.", - "example":true - }, - "fastWithdrawalData":{ - "$ref":"#/definitions/fastWithdrawalData" - } - }, - "required":[ - "_id", - "token", - "createdAt", - "readyToWithdrawOnChain", - "fastWithdrawalData" - ] - }, - "feedbackPayload":{ - "type":"object", - "properties":{ - "nonce":{ - "type":"string", - "description":"This nonce which used to provide the time until which this nonce is valid. It is presented as seconds since epoch.", - "example":"v2-1704114061.000" - }, - "signature":{ - "type":"string", - "description":"The signature obtained by signing the nonce with your private ethereum key.", - "example":"0x2b48d53f2e3a696630ebdcd1ff057556bbc9de9c294adfaa5b1f13df91b67b347fdd88c29594c377ba0024dec40cd9808829e7f4447772482f50a7a8e9a903561c" - }, - "email":{ - "type":"string", - "description":"Email of the user providing feedback.", - "example":"hello@deversifi.com" - } - }, - "required":[ - "email" - ] - }, - "Model46":{ - "type":"object", - "properties":{ - "_id":{ - "type":"string", - "description":"ID of the feedback entry", - "example":"d7c8b9" - } - } - }, - "notificationPayload":{ - "type":"object", - "properties":{ - "message":{ - "type":"string" - }, - "urgency":{ - "type":"string", - "default":"NORMAL", - "enum":[ - "HIGH", - "NORMAL" - ] - }, - "startDate":{ - "type":"string", - "format":"date" - }, - "endDate":{ - "type":"string", - "format":"date" - }, - "userAddress":{ - "type":"string" - } - }, - "required":[ - "message", - "startDate", - "endDate" - ] - }, - "notification":{ - "type":"object", - "properties":{ - "_id":{ - "type":"string" - }, - "message":{ - "type":"string" - }, - "urgency":{ - "type":"string", - "enum":[ - "HIGH", - "NORMAL" - ] - }, - "startDate":{ - "type":"string", - "format":"date" - }, - "endDate":{ - "type":"string", - "format":"date" - }, - "userAddress":{ - "type":"string" - } - }, - "required":[ - "message", - "startDate", - "endDate" - ] - }, - "Model47":{ - "type":"object", - "properties":{ - "dtk":{ - "type":"string", - "description":"The encrypted Stark trading key.", - "example":"6d840e6d251e2165e3214eecfcbcfa83c0f704439e16c69383d93fc0f704439e16c69383d93fc0f704439e16c69383d93fc0f704439e16c69383d93fc0f704439e16c69383d93f", - "minLength":66, - "maxLength":1000, - "pattern":"[a-zA-Z0-9]{66,}" - }, - "dtkVersion":{ - "type":"string", - "description":"Version of the trading key mechanism.", - "example":"v1", - "default":"v1" - } - } - }, - "registerPayload":{ - "type":"object", - "properties":{ - "nonce":{ - "type":"string", - "description":"This nonce which used to provide the time until which this nonce is valid. It is presented as seconds since epoch.", - "example":"v2-1704114061.000" - }, - "signature":{ - "type":"string", - "description":"The signature obtained by signing the nonce with your private ethereum key.", - "example":"0x2b48d53f2e3a696630ebdcd1ff057556bbc9de9c294adfaa5b1f13df91b67b347fdd88c29594c377ba0024dec40cd9808829e7f4447772482f50a7a8e9a903561c" - }, - "starkKey":{ - "type":"string", - "description":"The Stark public key.", - "example":"0746919ecbb54563de512f6fb556c21dab091748b41a60a946dbdbf118ac0a85" - }, - "encryptedTradingKey":{ - "$ref":"#/definitions/Model47", - "x-alternatives":[ - { - "$ref":"#/x-alt-definitions/encryptedTradingKey" - }, - { - "type":"string", - "description":"The encrypted Stark trading key.", - "example":"6d840e6d251e2165e3214eecfcbcfa83c0f704439e16c69383d93fc0f704439e16c69383d93fc0f704439e16c69383d93fc0f704439e16c69383d93fc0f704439e16c69383d93f", - "minLength":66, - "maxLength":1000, - "pattern":"[a-zA-Z0-9]{66,}" - } - ] - }, - "meta":{ - "$ref":"#/definitions/collateralBalancesSchema" - }, - "contractWalletAddress":{ - "type":"string", - "description":"The address of the contract wallet that is registering.", - "example":"0x8d12A197cB00D4747a1fe03395095ce2A5CC6819" - } - }, - "required":[ - "starkKey" - ] - }, - "exchangeSymbols":{ - "type":"array", - "description":"Currency pairs available at the DeversiFi exchange for trading", - "items":{ - "type":"string" - } - }, - "Model48":{ - "type":"object", - "description":"This contains application configuration details to set up for deposits and trading.", - "example":{ - "defaultFeeRate":0.002, - "deversifiAddress":"0x9ab450355b4ab504cbc0e4de484781dac08e6a26", - "starkExContractAddress":"0xF3731d0cdC9834f6F32104580bD226EF1bc1A9F9", - "exchangeSymbols":[ - "ETH:USDT", - "ZRX:USDT", - "ZRX:ETH", - "BTC:USDT", - "ETH:BTC" - ], - "newMarkets":[ - "ZRX:USDT", - "ZRX:ETH" - ], - "tempStarkVaultId":1 - }, - "properties":{ - "defaultFeeRate":{ - "type":"number", - "description":"The default fee rate, if no volume or maker discount." - }, - "deversifiAddress":{ - "type":"string", - "description":"The address of the DeversiFi exchange." - }, - "starkExContractAddress":{ - "type":"string", - "description":"Stark deposit contract address." - }, - "exchangeSymbols":{ - "$ref":"#/definitions/exchangeSymbols" - }, - "newMarkets":{ - "$ref":"#/definitions/newMarkets" - }, - "tempStarkVaultId":{ - "type":"number", - "description":"Transit Stark vault ID used for deposit privacy" - }, - "minDepositUSDT":{ - "type":"number", - "description":"Minimum deposit amount denominated in USDT" - } - } - }, - "registerResponseUserRegisteredOnChain":{ - "type":"object", - "properties":{ - "isRegistered":{ - "type":"boolean", - "description":"Registration status.", - "example":true, - "enum":[ - true - ] - }, - "ethAddress":{ - "type":"string", - "description":"Ethereum address.", - "example":"0x278ff3bb25c5b1bb7032e822661974479280fa74" - }, - "DVF":{ - "$ref":"#/definitions/Model48" - }, - "tokenRegistry":{ - "$ref":"#/definitions/collateralBalancesSchema" - } - }, - "required":[ - "isRegistered", - "ethAddress" - ] - }, - "storeTradingKeyPayload":{ - "type":"object", - "properties":{ - "nonce":{ - "type":"string", - "description":"This nonce which used to provide the time until which this nonce is valid. It is presented as seconds since epoch.", - "example":"v2-1704114061.000" - }, - "signature":{ - "type":"string", - "description":"The signature obtained by signing the nonce with your private ethereum key.", - "example":"0x2b48d53f2e3a696630ebdcd1ff057556bbc9de9c294adfaa5b1f13df91b67b347fdd88c29594c377ba0024dec40cd9808829e7f4447772482f50a7a8e9a903561c" - }, - "encryptedTradingKey":{ - "type":"string", - "description":"Encrypted Stark Trading Key.", - "example":"7b2276657273696f6e223a227832353531392d7873616c736132302d706f6c7931333035222c226e6f6e6365223a22765633313730366571496f696432717944444539465055346f7466346171457a222c22657068656d5075626c69634b6579223a227358657a625174556c453476555661547857466b326555427532627746342f6641434378536a592f306e513d222c2263697068657274657874223a22444e5041615a76726331374f4d656a5451354f544e4243536d594b504466745335574b307278794b716671715770486d53676a4568782b3259352f6b4a6e3233674e5454476c31306973556271696d72636e67676a61636e346335317672484a697a427166324737227d", - "minLength":66, - "maxLength":1000, - "pattern":"[a-zA-Z0-9]{66,}" - }, - "dtkVersion":{ - "type":"string", - "description":"Trading Key Version", - "example":"v2", - "minLength":0, - "maxLength":4 - } - }, - "required":[ - "encryptedTradingKey" - ] - }, - "storeTradingKeyResponse":{ - "type":"object", - "properties":{ - "status":{ - "type":"boolean", - "description":"Returns true if trading key is stored successfully", - "example":true - } - } - }, - "Model49":{ - "type":"object", - "description":"Stark order related meta information.", - "properties":{ - "vaultIdSell":{ - "type":"number", - "description":"The vault ID of the seller." - }, - "vaultIdBuy":{ - "type":"number", - "description":"The vault ID of the buyer." - }, - "amountSell":{ - "type":"string", - "description":"The total amount to be sold." - }, - "amountBuy":{ - "type":"string", - "description":"The total amount to be bought." - }, - "tokenSell":{ - "type":"string", - "description":"The Stark token ID for the token being sold." - }, - "tokenBuy":{ - "type":"string", - "description":"The Stark token ID for the token being bought." - }, - "nonce":{ - "type":"number", - "description":"Nonce value." - }, - "expirationTimestamp":{ - "type":"number", - "description":"Expiration timestamp of the order." - } - } - }, - "submitOrderMeta":{ - "type":"object", - "description":"A set of meta values.", - "example":{ - "starkOrder":{ - "vaultIdSell":1000002, - "vaultIdBuy":1000001, - "amountSell":"97400000", - "amountBuy":"100000000000000000", - "tokenSell":"0x2", - "tokenBuy":"0x1", - "nonce":0, - "expirationTimestamp":438947 - }, - "ethAddress":"0x341E46a49F15785373edE443Df0220DEa6a41Bbc", - "starkPublicKey":{ - "x":"0746919ecbb54563de512f6fb556c21dab091748b41a60a946dbdbf118ac0a85", - "y":"58f7ce5eb6eb5bd24f70394622b1f4d2c54ebca317a3e61bf9f349dccf166cf" - }, - "starkSignature":{ - "r":"5d14357fcf8f489218de0855267c6f64bc463135debf62680ad796e63cd6d3b", - "s":"786ab874d91e3a5871134955fcb768914754760a0ada326af67f758f32819cf" - } - }, - "properties":{ - "starkOrder":{ - "$ref":"#/definitions/Model49" - }, - "ethAddress":{ - "type":"string", - "description":"The Ethereum public address." - }, - "feature":{ - "type":"string", - "description":"Origin of the order" - }, - "starkPublicKey":{ - "$ref":"#/definitions/collateralBalancesSchema" - }, - "starkSignature":{ - "$ref":"#/definitions/Model27" - } - }, - "required":[ - "starkSignature" - ] - }, - "submitOrderPayload":{ - "type":"object", - "properties":{ - "cid":{ - "type":"string", - "description":"Optional custom order ID that could be set when placing order and used later to retrieve order. This ID is unique per user (user A and B can each have an order with cid = AAA, but the same user cannot have two orders with the same cid)", - "example":"long-123" - }, - "gid":{ - "type":"string" - }, - "type":{ - "type":"string", - "description":"The type of order. Currently only “EXCHANGE_LIMIT” is accepted.", - "example":"EXCHANGE LIMIT", - "enum":[ - "EXCHANGE LIMIT", - "exchange limit", - "EXCHANGE MARKET", - "exchange market" - ] - }, - "symbol":{ - "type":"string", - "description":"The trading pair.", - "example":"ETH:USDT" - }, - "amount":{ - "type":"string", - "description":"The token amount to be traded. Will be rounded up to 8 decimal places.", - "example":"0.1" - }, - "price":{ - "type":"string", - "description":"The cost per unit. Will be rounded down to 5 significant digits.", - "example":"1000" - }, - "meta":{ - "$ref":"#/definitions/submitOrderMeta" - }, - "protocol":{ - "type":"string", - "enum":[ - "stark" - ] - }, - "partnerId":{ - "type":"string" - }, - "feeRate":{ - "type":"string" - }, - "isPostOnly":{ - "type":"boolean", - "description":"Flag to indicate if the order is post-only. Mutually exclusive with isFillOrKill" - }, - "isHidden":{ - "type":"boolean", - "description":"Flag to indicate if the order is hidden." - }, - "isFillOrKill":{ - "type":"boolean", - "description":"Flag to indicate if fill or kill order. Mutually exclusive with isPostOnly" - }, - "isSlippageDisabled":{ - "type":"boolean", - "description":"Flag to indicate if slippage protection is disabled." - } - }, - "required":[ - "type", - "symbol", - "amount", - "price", - "meta" - ] - }, - "submitOrderResponse":{ - "type":"object", - "properties":{ - "_id":{ - "type":"string", - "description":"Id for the order. This can be used for orderId when calling cancelOrder or getOrder", - "example":"L1tarX5wUem" - }, - "user":{ - "type":"string", - "description":"Ethereum address of the user", - "example":"E0xc1caf2d76c49e4a60635635c329a3ac22ddeb547" - }, - "symbol":{ - "type":"string", - "description":"Trading symbol for the order", - "example":"ETH:USDT" - }, - "tokenSell":{ - "type":"string", - "description":"The token which is being sold", - "example":"ETH" - }, - "tokenBuy":{ - "type":"string", - "description":"The token which is being bought", - "example":"USDT" - }, - "amount":{ - "type":"number", - "description":"Original order size placed being sold or bought.", - "example":"-0.5" - }, - "price":{ - "type":"number", - "description":"Cost per unit.", - "example":"200" - }, - "type":{ - "type":"string", - "description":"Type of the order. Currently, \"EXCHANGE LIMIT\" is the only type that is supported.", - "example":"EXCHANGE LIMIT" - }, - "createdAt":{ - "type":"string", - "description":"The date and time when the order was created.", - "example":"2020-05-09T18:29:56.603Z" - }, - "updatedAt":{ - "type":"string", - "description":"The date and time when the order was last updated.", - "example":"2020-05-09T18:29:56.945Z" - }, - "activatedAt":{ - "type":"string", - "description":"The date and time when the order was activated.", - "example":"2020-05-09T18:29:56.944Z" - }, - "isPostOnly":{ - "type":"boolean", - "description":"Flag to indicate if the order is post-only.", - "example":false - }, - "isHidden":{ - "type":"boolean", - "description":"Flag to indicate if the order is hidden.", - "example":false - }, - "isFillOrKill":{ - "type":"boolean", - "description":"Flag to indicate if fill or kill order.", - "example":false - }, - "isSlippageDisabled":{ - "type":"boolean", - "description":"Flag to indicate if slippage protection is disabled.", - "example":false - }, - "cid":{ - "type":"string", - "description":"An optional user-defined identifier for this order", - "example":"satoshi-order-2083236893" - } - } - }, - "Model50":{ - "type":"object", - "description":"StarkWare TansferRequest for main transfer", - "properties":{ - "type":{ - "type":"string", - "enum":[ - "TransferRequest" - ] - }, - "amount":{ - "type":"string", - "pattern":"^[0-9]*$" - }, - "expirationTimestamp":{ - "type":"integer", - "minimum":0 - }, - "nonce":{ - "type":"integer", - "minimum":0 - }, - "receiverPublicKey":{ - "type":"string", - "pattern":"^0x[a-f0-9]+$" - }, - "receiverVaultId":{ - "type":"integer" - }, - "senderPublicKey":{ - "type":"string", - "pattern":"^0x[a-f0-9]+$" - }, - "senderVaultId":{ - "type":"integer" - }, - "signature":{ - "$ref":"#/definitions/signature" - }, - "token":{ - "type":"string", - "pattern":"^0x[a-f0-9]+$" - } - } - }, - "feeTx":{ - "type":"object", - "description":"StarkWare TansferRequest for service fee", - "properties":{ - "type":{ - "type":"string", - "enum":[ - "TransferRequest" - ] - }, - "amount":{ - "type":"string", - "pattern":"^[0-9]*$" - }, - "expirationTimestamp":{ - "type":"integer", - "minimum":0 - }, - "nonce":{ - "type":"integer", - "minimum":0 - }, - "receiverPublicKey":{ - "type":"string", - "pattern":"^0x[a-f0-9]+$" - }, - "receiverVaultId":{ - "type":"integer" - }, - "senderPublicKey":{ - "type":"string", - "pattern":"^0x[a-f0-9]+$" - }, - "senderVaultId":{ - "type":"integer" - }, - "signature":{ - "$ref":"#/definitions/signature" - }, - "token":{ - "type":"string", - "pattern":"^0x[a-f0-9]+$" - } - } - }, - "transferPayload":{ - "type":"object", - "properties":{ - "tx":{ - "$ref":"#/definitions/Model50" - }, - "feeTx":{ - "$ref":"#/definitions/feeTx" - }, - "memo":{ - "type":"string", - "description":"Optional memo string", - "maxLength":42 - }, - "starkPublicKey":{ - "$ref":"#/definitions/starkPublicKey" - } - } - }, - "Model51":{ - "type":"object", - "example":{ - "type":"TransferRequest", - "amount":"10000000", - "expirationTimestamp":446134, - "nonce":976614084, - "receiverPublicKey":"0x077a3b314db07c45076d11f62b6f9e748a39790441823307743cf00d6597ea43", - "receiverVaultId":1863686755, - "senderPublicKey":"0x044926648f4b6f002dfa389c536129ae178f34d9be452724268cc48ebea2b37c", - "senderVaultId":2010760265, - "token":"0x180bef8ae3462e919489763b84dc1dc700c45a249dec4d1136814a639f2dd7b", - "signature":{ - "r":"0x2857ca21310ab87bb7c37ebad0e7166f1fb46e43cf32d6587a31e148d44b677", - "s":"0x45e939717a6de4ad5e79993d918bb40e629760da7a04062e965394d1d14106a" - } - }, - "properties":{ - "type":{ - "type":"string", - "enum":[ - "TransferRequest" - ] - }, - "amount":{ - "type":"string", - "pattern":"^[0-9]*$" - }, - "expirationTimestamp":{ - "type":"integer", - "minimum":0 - }, - "nonce":{ - "type":"integer", - "minimum":0 - }, - "receiverPublicKey":{ - "type":"string", - "pattern":"^0x[a-f0-9]+$" - }, - "receiverVaultId":{ - "type":"integer" - }, - "senderPublicKey":{ - "type":"string", - "pattern":"^0x[a-f0-9]+$" - }, - "senderVaultId":{ - "type":"integer" - }, - "signature":{ - "$ref":"#/definitions/signature" - }, - "token":{ - "type":"string", - "pattern":"^0x[a-f0-9]+$" - } - } - }, - "transferResponseObject":{ - "type":"object", - "properties":{ - "_id":{ - "type":"string", - "description":"Transfer ID.", - "example":"LCafcGC6tBH" - }, - "token":{ - "type":"string", - "description":"The token that was transferred.", - "example":"NEC" - }, - "amount":{ - "type":"string", - "description":"The amount that was transferred (in quantised units).", - "example":"100", - "pattern":"^[0-9]*$" - }, - "recipient":{ - "type":"string", - "description":"Deversifi user id of recipient of the transfer.", - "example":"0x948cd3ad67c5f21412bfcd07a7981322f9fa01f0" - }, - "createdAt":{ - "type":"string", - "format":"date", - "description":"The date and time transfer request was received.", - "example":"2020-01-29T14:13:05.898Z" - }, - "updatedAt":{ - "type":"string", - "format":"date", - "description":"The date and time transfer request was received.", - "example":"2020-01-29T14:13:05.898Z" - }, - "memo":{ - "type":"string", - "description":"Transfer memo", - "example":"my reference" - }, - "tx":{ - "$ref":"#/definitions/Model51" - } - }, - "required":[ - "_id", - "token", - "createdAt", - "updatedAt" - ] - }, - "withdrawalPayload":{ - "type":"object", - "properties":{ - "token":{ - "type":"string", - "description":"The token for which the withdrawal is requested.", - "example":"ZRX" - }, - "amount":{ - "type":"number", - "description":"The withdrawal amount.", - "example":1 - }, - "nonce":{ - "type":"number", - "example":45435743 - }, - "starkPublicKey":{ - "$ref":"#/definitions/starkPublicKey" - }, - "starkSignature":{ - "$ref":"#/definitions/Model27" - }, - "starkVaultId":{ - "type":"number", - "description":"The Stark vault ID.", - "example":1000003 - }, - "expireTime":{ - "type":"number", - "description":"Expiry time in hours", - "example":454934 - } - }, - "required":[ - "token", - "amount", - "nonce", - "starkPublicKey", - "starkSignature", - "starkVaultId", - "expireTime" - ] - }, - "Model52":{ - "type":"object", - "properties":{ - "token":{ - "type":"string", - "description":"The token which the balance is specifically requested for.", - "example":"ETH" - }, - "fields":{ - "$ref":"#/definitions/fields" - } - } - } - }, - "x-alt-definitions":{ - "pagination":{ - "type":"object", - "properties":{ - "totalItems":{ - "type":"number", - "description":"Total number of items matching the query", - "example":1559, - "minimum":0 - }, - "limit":{ - "type":"number", - "description":"Limit applied on returned items", - "example":5 - }, - "skip":{ - "type":"number", - "description":"Skip applied on returned items", - "example":2 - } - } - }, - "Model1":{ - "type":"object", - "properties":{ - "_id":{ - "type":"string", - "description":"Unique identifier representing the deposit or withdrawal", - "example":"606f207fc7aa2e91d028a17a" - }, - "type":{ - "type":"string", - "description":"Whether the transaction is a deposit, a classic withdrawal or a fast withdrawal", - "example":"Deposit", - "enum":[ - "Deposit", - "Withdrawal", - "FastWithdrawal" - ] - }, - "token":{ - "type":"string", - "description":"Token deposited or withdrawn", - "example":"ZRX" - }, - "amount":{ - "type":"number", - "description":"Amount deposited or withdrawn", - "example":1 - }, - "transactionHash":{ - "type":"string", - "description":"Hash of the Ethereum transaction leading to L1 balance debit or credit", - "example":"0xb5c8bd9430b6cc87a0e2fe110ece6bf527fa4f170a4bc8cd032f768fc5219838" - }, - "date":{ - "type":"string", - "format":"date", - "description":"Date and time deposit or withdrawal", - "example":"2020-11-11T16:37:05.957" - }, - "sourceOrRecipient":{ - "type":"string", - "description":"Originator of the deposit or recipient of the withdrawal", - "example":"0x148426fdc4c8a51b96b4bed827907b5fa6491ad0" - }, - "gateway":{ - "type":"string", - "description":"Set when operation used a gateway. Corresponds to a chain identifier", - "example":"MATIC_POS" - } - } - }, - "items":{ - "type":"array", - "items":{ - "$ref":"#/x-alt-definitions/Model1" - } - }, - "getDepositsAndWithdrawalsResponse":{ - "type":"object", - "properties":{ - "pagination":{ - "$ref":"#/x-alt-definitions/pagination" - }, - "items":{ - "$ref":"#/x-alt-definitions/items" - } - } - }, - "Model2":{ - "type":"object", - "properties":{ - "fillId":{ - "type":"string", - "description":"Unique identifier representing the fill event", - "example":"606f207fc7aa2e91d028a17a" - }, - "orderId":{ - "type":"string", - "description":"Unique identifier of the order associated with the fill", - "example":"BtHEvgY1Bz1" - }, - "symbol":{ - "type":"string", - "description":"Symbol for the order associated with the fill", - "example":"ETH:USDT" - }, - "price":{ - "type":"number", - "description":"Execution price of the fill", - "example":209.9 - }, - "fillAmount":{ - "type":"number", - "description":"Amount filled (negative amount for a sell event, positive for a buy event)", - "example":-0.125622 - }, - "orderAmount":{ - "type":"number", - "description":"Initial amount for the placed order associated with the fill", - "example":-1 - }, - "date":{ - "type":"string", - "format":"date", - "description":"Date and time of the fill event", - "example":"2020-11-11T16:37:05.957" - }, - "orderCreationDate":{ - "type":"string", - "format":"date", - "description":"Date and time at which the order associated with the fill event was placed", - "example":"2020-11-11T16:37:05.262Z" - }, - "orderType":{ - "type":"string", - "description":"Type of the order associated with the fill event", - "example":true, - "enum":[ - "EXCHANGE LIMIT", - "EXCHANGE MARKET" - ] - }, - "orderActive":{ - "type":"boolean", - "description":"Whether the order associated with the fill event is still active", - "example":true - }, - "orderCanceled":{ - "type":"boolean", - "description":"Whether the order associated with the fill event was canceled", - "example":false - } - } - }, - "Model3":{ - "type":"array", - "items":{ - "$ref":"#/x-alt-definitions/Model2" - } - }, - "getFillsResponse":{ - "type":"object", - "properties":{ - "pagination":{ - "$ref":"#/x-alt-definitions/pagination" - }, - "items":{ - "$ref":"#/x-alt-definitions/Model3" - } - } - }, - "Model4":{ - "type":"object", - "properties":{ - "_id":{ - "type":"string", - "description":"Unique identifier representing this transfer", - "example":"MphMkBBZjnS" - }, - "token":{ - "type":"string", - "description":"Token transfered", - "example":"ETH" - }, - "amount":{ - "type":"number", - "description":"Amount transfered (effective amount received by the recipient)", - "example":3.14, - "minimum":0 - }, - "feeAmount":{ - "type":"number", - "description":"Transfer fee amount (in transfer token units)", - "example":3.14, - "minimum":0 - }, - "source":{ - "type":"string", - "description":"Source Ethereum address", - "example":"0x08152c1265dBc218ccc8Ab5C574e6bD52279b3B7" - }, - "recipient":{ - "type":"string", - "description":"Recipient Ethereum address", - "example":"0xeb3ea3ea9239577951523cafa9fd3072bc88e50a" - }, - "memo":{ - "type":"string", - "description":"Transfer memo", - "example":"my reference" - }, - "date":{ - "type":"string", - "format":"date", - "description":"Date and time of the transfer", - "example":"1990-04-14T00:20:00.000Z" - } - } - }, - "Model5":{ - "type":"array", - "items":{ - "$ref":"#/x-alt-definitions/Model4" - } - }, - "getTransfersResponse":{ - "type":"object", - "properties":{ - "pagination":{ - "$ref":"#/x-alt-definitions/pagination" - }, - "items":{ - "$ref":"#/x-alt-definitions/Model5" - } - } - }, - "encryptedTradingKey":{ - "type":"object", - "properties":{ - "dtk":{ - "type":"string", - "description":"The encrypted Stark trading key.", - "example":"6d840e6d251e2165e3214eecfcbcfa83c0f704439e16c69383d93fc0f704439e16c69383d93fc0f704439e16c69383d93fc0f704439e16c69383d93fc0f704439e16c69383d93f", - "minLength":66, - "maxLength":1000, - "pattern":"[a-zA-Z0-9]{66,}" - }, - "dtkVersion":{ - "type":"string", - "description":"Version of the trading key mechanism.", - "example":"v1", - "default":"v1" - } - } - }, - "exchangeSymbols":{ - "type":"array", - "description":"Currency pairs available at the DeversiFi exchange for trading", - "items":{ - "type":"string" - } - }, - "newMarkets":{ - "type":"array", - "description":"Currency pairs that were newly added", - "items":{ - "type":"string" - } - }, - "DVF":{ - "type":"object", - "description":"This contains application configuration details to set up for deposits and trading.", - "example":{ - "defaultFeeRate":0.002, - "deversifiAddress":"0x9ab450355b4ab504cbc0e4de484781dac08e6a26", - "starkExContractAddress":"0xF3731d0cdC9834f6F32104580bD226EF1bc1A9F9", - "exchangeSymbols":[ - "ETH:USDT", - "ZRX:USDT", - "ZRX:ETH", - "BTC:USDT", - "ETH:BTC" - ], - "newMarkets":[ - "ZRX:USDT", - "ZRX:ETH" - ], - "tempStarkVaultId":1 - }, - "properties":{ - "defaultFeeRate":{ - "type":"number", - "description":"The default fee rate, if no volume or maker discount." - }, - "deversifiAddress":{ - "type":"string", - "description":"The address of the DeversiFi exchange." - }, - "starkExContractAddress":{ - "type":"string", - "description":"Stark deposit contract address." - }, - "exchangeSymbols":{ - "$ref":"#/x-alt-definitions/exchangeSymbols" - }, - "newMarkets":{ - "$ref":"#/x-alt-definitions/newMarkets" - }, - "tempStarkVaultId":{ - "type":"number", - "description":"Transit Stark vault ID used for deposit privacy" - }, - "minDepositUSDT":{ - "type":"number", - "description":"Minimum deposit amount denominated in USDT" - } - } - }, - "tokenRegistry":{ - "type":"object" - }, - "registerResponseUserRegisteredOnChain":{ - "type":"object", - "properties":{ - "isRegistered":{ - "type":"boolean", - "description":"Registration status.", - "example":true, - "enum":[ - true - ] - }, - "ethAddress":{ - "type":"string", - "description":"Ethereum address.", - "example":"0x278ff3bb25c5b1bb7032e822661974479280fa74" - }, - "DVF":{ - "$ref":"#/x-alt-definitions/DVF" - }, - "tokenRegistry":{ - "$ref":"#/x-alt-definitions/tokenRegistry" - } - }, - "required":[ - "isRegistered", - "ethAddress" - ] - }, - "registerResponseUserNotRegisteredOnChain":{ - "type":"object", - "properties":{ - "isRegistered":{ - "type":"boolean", - "description":"Registration status.", - "example":false, - "enum":[ - false - ] - }, - "deFiSignature":{ - "type":"string", - "description":"Deversifi Signature", - "example":"0x0277b6e85ffdfb8cdc34c89b8d7ef19e915daf00327db91c1f5a1988666089e6b8420881699501" - } - }, - "required":[ - "isRegistered", - "deFiSignature" - ] - }, - "starkOrder":{ - "type":"object", - "description":"Stark order related meta information.", - "properties":{ - "vaultIdSell":{ - "type":"number", - "description":"The vault ID of the seller." - }, - "vaultIdBuy":{ - "type":"number", - "description":"The vault ID of the buyer." - }, - "amountSell":{ - "type":"string", - "description":"The total amount to be sold." - }, - "amountBuy":{ - "type":"string", - "description":"The total amount to be bought." - }, - "tokenSell":{ - "type":"string", - "description":"The Stark token ID for the token being sold." - }, - "tokenBuy":{ - "type":"string", - "description":"The Stark token ID for the token being bought." - }, - "nonce":{ - "type":"number", - "description":"Nonce value." - }, - "expirationTimestamp":{ - "type":"number", - "description":"Expiration timestamp of the order." - } - } - }, - "starkSignature":{ - "type":"object", - "description":"Stark signature consisting of consisting of \"r\" and \"s\"", - "example":{ - "v":"3b46dfe03caef623048fedc8457a92385cd63eff6349ad135c945cd84937677", - "r":"1f38f551d798562c16d28733c7e3ff6850898d82f0ac9ccd39d373303b1778c", - "s":"518560420e52a37e9f580f024fc0fe8572cb2f5437a839075bbf4b2b123d572" - }, - "properties":{ - "v":{ - "type":"string", - "description":"The \"v\" part of the Stark signature." - }, - "r":{ - "type":"string", - "description":"The \"r\" part of the Stark signature." - }, - "s":{ - "type":"string", - "description":"The \"s\" part of the Stark signature." - } - }, - "required":[ - "r", - "s" - ] - }, - "submitOrderMeta":{ - "type":"object", - "description":"A set of meta values.", - "example":{ - "starkOrder":{ - "vaultIdSell":1000002, - "vaultIdBuy":1000001, - "amountSell":"97400000", - "amountBuy":"100000000000000000", - "tokenSell":"0x2", - "tokenBuy":"0x1", - "nonce":0, - "expirationTimestamp":438947 - }, - "ethAddress":"0x341E46a49F15785373edE443Df0220DEa6a41Bbc", - "starkPublicKey":{ - "x":"0746919ecbb54563de512f6fb556c21dab091748b41a60a946dbdbf118ac0a85", - "y":"58f7ce5eb6eb5bd24f70394622b1f4d2c54ebca317a3e61bf9f349dccf166cf" - }, - "starkSignature":{ - "r":"5d14357fcf8f489218de0855267c6f64bc463135debf62680ad796e63cd6d3b", - "s":"786ab874d91e3a5871134955fcb768914754760a0ada326af67f758f32819cf" - } - }, - "properties":{ - "starkOrder":{ - "$ref":"#/x-alt-definitions/starkOrder" - }, - "ethAddress":{ - "type":"string", - "description":"The Ethereum public address." - }, - "feature":{ - "type":"string", - "description":"Origin of the order" - }, - "starkPublicKey":{ - "$ref":"#/x-alt-definitions/tokenRegistry" - }, - "starkSignature":{ - "$ref":"#/x-alt-definitions/starkSignature" - } - }, - "required":[ - "starkSignature" - ] - }, - "submitOrderPayload":{ - "type":"object", - "properties":{ - "cid":{ - "type":"string", - "description":"Optional custom order ID that could be set when placing order and used later to retrieve order. This ID is unique per user (user A and B can each have an order with cid = AAA, but the same user cannot have two orders with the same cid)", - "example":"long-123" - }, - "gid":{ - "type":"string" - }, - "type":{ - "type":"string", - "description":"The type of order. Currently only “EXCHANGE_LIMIT” is accepted.", - "example":"EXCHANGE LIMIT", - "enum":[ - "EXCHANGE LIMIT", - "exchange limit", - "EXCHANGE MARKET", - "exchange market" - ] - }, - "symbol":{ - "type":"string", - "description":"The trading pair.", - "example":"ETH:USDT" - }, - "amount":{ - "type":"string", - "description":"The token amount to be traded. Will be rounded up to 8 decimal places.", - "example":"0.1" - }, - "price":{ - "type":"string", - "description":"The cost per unit. Will be rounded down to 5 significant digits.", - "example":"1000" - }, - "meta":{ - "$ref":"#/x-alt-definitions/submitOrderMeta" - }, - "protocol":{ - "type":"string", - "enum":[ - "stark" - ] - }, - "partnerId":{ - "type":"string" - }, - "feeRate":{ - "type":"string" - }, - "isPostOnly":{ - "type":"boolean", - "description":"Flag to indicate if the order is post-only. Mutually exclusive with isFillOrKill" - }, - "isHidden":{ - "type":"boolean", - "description":"Flag to indicate if the order is hidden." - }, - "isFillOrKill":{ - "type":"boolean", - "description":"Flag to indicate if fill or kill order. Mutually exclusive with isPostOnly" - }, - "isSlippageDisabled":{ - "type":"boolean", - "description":"Flag to indicate if slippage protection is disabled." - } - }, - "required":[ - "type", - "symbol", - "amount", - "price", - "meta" - ] - }, - "Model6":{ - "type":"array", - "items":{ - "$ref":"#/x-alt-definitions/submitOrderPayload" - } - }, - "submitOrderResponse":{ - "type":"object", - "properties":{ - "_id":{ - "type":"string", - "description":"Id for the order. This can be used for orderId when calling cancelOrder or getOrder", - "example":"L1tarX5wUem" - }, - "user":{ - "type":"string", - "description":"Ethereum address of the user", - "example":"E0xc1caf2d76c49e4a60635635c329a3ac22ddeb547" - }, - "symbol":{ - "type":"string", - "description":"Trading symbol for the order", - "example":"ETH:USDT" - }, - "tokenSell":{ - "type":"string", - "description":"The token which is being sold", - "example":"ETH" - }, - "tokenBuy":{ - "type":"string", - "description":"The token which is being bought", - "example":"USDT" - }, - "amount":{ - "type":"number", - "description":"Original order size placed being sold or bought.", - "example":"-0.5" - }, - "price":{ - "type":"number", - "description":"Cost per unit.", - "example":"200" - }, - "type":{ - "type":"string", - "description":"Type of the order. Currently, \"EXCHANGE LIMIT\" is the only type that is supported.", - "example":"EXCHANGE LIMIT" - }, - "createdAt":{ - "type":"string", - "description":"The date and time when the order was created.", - "example":"2020-05-09T18:29:56.603Z" - }, - "updatedAt":{ - "type":"string", - "description":"The date and time when the order was last updated.", - "example":"2020-05-09T18:29:56.945Z" - }, - "activatedAt":{ - "type":"string", - "description":"The date and time when the order was activated.", - "example":"2020-05-09T18:29:56.944Z" - }, - "isPostOnly":{ - "type":"boolean", - "description":"Flag to indicate if the order is post-only.", - "example":false - }, - "isHidden":{ - "type":"boolean", - "description":"Flag to indicate if the order is hidden.", - "example":false - }, - "isFillOrKill":{ - "type":"boolean", - "description":"Flag to indicate if fill or kill order.", - "example":false - }, - "isSlippageDisabled":{ - "type":"boolean", - "description":"Flag to indicate if slippage protection is disabled.", - "example":false - }, - "cid":{ - "type":"string", - "description":"An optional user-defined identifier for this order", - "example":"satoshi-order-2083236893" - } - } - }, - "Model7":{ - "type":"array", - "items":{ - "$ref":"#/x-alt-definitions/submitOrderResponse" - } - } - } + "/v1/trading/allowances":{ + "get":{ + "summary":"This method is used to get the allowance of the user for using DeversiFi features (deposit, withdraw, trade, transfer)", + "operationId":"getV1TradingAllowances", + "parameters":[ + { + "type":"string", + "description":"Base64 of {signature, nonce} JSON representation", + "name":"authorization", + "in":"header", + "x-example":"EcRecover eyJub25jZSI6InYyLTE3MDQxMTQwNjEuMDAwIiwic2lnbmF0dXJlIjoiMHgyYjQ4ZDUzZjJlM2E2OTY2MzBlYmRjZDFmZjA1NzU1NmJiYzlkZTljMjk0YWRmYWE1YjFmMTNkZjkxYjY3YjM0N2ZkZDg4YzI5NTk0YzM3N2JhMDAyNGRlYzQwY2Q5ODA4ODI5ZTdmNDQ0Nzc3MjQ4MmY1MGE3YThlOWE5MDM1NjFjIn0=", + "required":true + } + ], + "tags":[ + "Trading" + ], + "responses":{ + "200":{ + "schema":{ + "$ref":"#/definitions/getAllowanceResponse" + }, + "description":"Successful" + } + } + } + }, + "/v1/trading/balanceHistory":{ + "get":{ + "summary":"Balance history of the authenticated user", + "operationId":"getV1TradingBalancehistory", + "parameters":[ + { + "type":"string", + "description":"Base64 of {signature, nonce} JSON representation", + "name":"authorization", + "in":"header", + "x-example":"EcRecover eyJub25jZSI6InYyLTE3MDQxMTQwNjEuMDAwIiwic2lnbmF0dXJlIjoiMHgyYjQ4ZDUzZjJlM2E2OTY2MzBlYmRjZDFmZjA1NzU1NmJiYzlkZTljMjk0YWRmYWE1YjFmMTNkZjkxYjY3YjM0N2ZkZDg4YzI5NTk0YzM3N2JhMDAyNGRlYzQwY2Q5ODA4ODI5ZTdmNDQ0Nzc3MjQ4MmY1MGE3YThlOWE5MDM1NjFjIn0=", + "required":true + }, + { + "type":"string", + "description":"This nonce which used to provide the time until which this nonce is valid. It is presented as seconds since epoch.", + "name":"nonce", + "in":"query", + "x-example":"v2-1704114061.000", + "required":false + }, + { + "type":"string", + "description":"The signature obtained by signing the nonce with your private ethereum key.", + "name":"signature", + "in":"query", + "x-example":"0x2b48d53f2e3a696630ebdcd1ff057556bbc9de9c294adfaa5b1f13df91b67b347fdd88c29594c377ba0024dec40cd9808829e7f4447772482f50a7a8e9a903561c", + "required":false + }, + { + "type":"string", + "description":"duration for the history to fetch", + "enum":[ + "1d", + "1m", + "1w", + "1y" + ], + "x-convert":{ + "case":"lower" + }, + "name":"duration", + "in":"query", + "x-example":"1d", + "required":true + } + ], + "tags":[ + "Trading" + ], + "responses":{ + "200":{ + "schema":{ + "$ref":"#/definitions/balanceHistorySchema" + }, + "description":"Successful" + } + } + } + }, + "/v1/trading/collateralBalances":{ + "get":{ + "summary":"Returns information about collateral balances (internal use)", + "operationId":"getV1TradingCollateralbalances", + "parameters":[ + { + "type":"string", + "name":"token", + "in":"query", + "required":false + } + ], + "tags":[ + "Internal" + ], + "responses":{ + "200":{ + "schema":{ + "$ref":"#/definitions/collateralBalancesSchema" + }, + "description":"Successful" + } + } + } + }, + "/v1/trading/depositsAndWithdrawals":{ + "get":{ + "summary":"This method is used to get the history of deposits and withdrawals for the authenticated user", + "operationId":"getV1TradingDepositsandwithdrawals", + "parameters":[ + { + "type":"string", + "description":"Base64 of {signature, nonce} JSON representation", + "name":"authorization", + "in":"header", + "x-example":"EcRecover eyJub25jZSI6InYyLTE3MDQxMTQwNjEuMDAwIiwic2lnbmF0dXJlIjoiMHgyYjQ4ZDUzZjJlM2E2OTY2MzBlYmRjZDFmZjA1NzU1NmJiYzlkZTljMjk0YWRmYWE1YjFmMTNkZjkxYjY3YjM0N2ZkZDg4YzI5NTk0YzM3N2JhMDAyNGRlYzQwY2Q5ODA4ODI5ZTdmNDQ0Nzc3MjQ4MmY1MGE3YThlOWE5MDM1NjFjIn0=", + "required":true + }, + { + "type":"string", + "x-convert":{ + "case":"upper" + }, + "name":"token", + "in":"query", + "x-example":"ETH" + }, + { + "type":"string", + "format":"date", + "name":"startDate", + "in":"query", + "x-example":"2020-01-01 13:45" + }, + { + "type":"string", + "format":"date", + "name":"endDate", + "in":"query", + "x-example":"2025-12-31 23:45" + }, + { + "type":"string", + "default":"date", + "enum":[ + "date" + ], + "name":"sortBy", + "in":"query" + }, + { + "type":"string", + "default":"DESC", + "enum":[ + "ASC", + "DESC" + ], + "name":"sortDirection", + "in":"query" + }, + { + "type":"integer", + "default":0, + "minimum":0, + "name":"skip", + "in":"query" + }, + { + "type":"integer", + "default":20, + "minimum":1, + "maximum":100, + "name":"limit", + "in":"query" + } + ], + "tags":[ + "Trading" + ], + "responses":{ + "200":{ + "schema":{ + "$ref":"#/definitions/getDepositsAndWithdrawalsResponse", + "x-alternatives":[ + { + "$ref":"#/x-alt-definitions/getDepositsAndWithdrawalsResponse" + }, + { + "type":"string", + "description":"Response in CSV format", + "example":"id,type,token,amount,transactionHash,date,sourceOrRecipient8oXSt1ry5EZ,Deposit,ETH,0.1,0x43154dc90de6c578d14fbe1ddae352e3a5fdc42d5944b122ac7c6c41f360d76a,1990-04-14T00:00:00.000Z,0x08152c1265dbc218ccc8ab5c574e6bd52279b3b77kyGeby7RR8,FastWithdrawal,USDT,100,0xe2d59c0e5fec11b23fb159483551b28ad80907937908fa5df26ba9b2045d4397,1990-04-14T00:02:00.000Z,0xeb3ea3ea9239577951523cafa9fd3072bc88e50aDDi37hQZSHg,Withdrawal,ETH,0.05,0x2c892f7a0326a380f027b8ef4a1a15747083ba2471313c5a30a8510d3132a18e,1990-04-14T00:04:00.000Z,0x2d5752b42440139a130f453e0c646e6e656dded4" + } + ] + }, + "description":"Successful" + } + } + } + }, + "/v1/trading/entityAccounts":{ + "get":{ + "summary":"This method is used to get the entity account information for user address (KYC)", + "operationId":"getV1TradingEntityaccounts", + "parameters":[ + { + "type":"string", + "description":"Base64 of {signature, nonce} JSON representation", + "name":"authorization", + "in":"header", + "x-example":"EcRecover eyJub25jZSI6InYyLTE3MDQxMTQwNjEuMDAwIiwic2lnbmF0dXJlIjoiMHgyYjQ4ZDUzZjJlM2E2OTY2MzBlYmRjZDFmZjA1NzU1NmJiYzlkZTljMjk0YWRmYWE1YjFmMTNkZjkxYjY3YjM0N2ZkZDg4YzI5NTk0YzM3N2JhMDAyNGRlYzQwY2Q5ODA4ODI5ZTdmNDQ0Nzc3MjQ4MmY1MGE3YThlOWE5MDM1NjFjIn0=", + "required":true + } + ], + "tags":[ + "Trading" + ], + "responses":{ + "200":{ + "schema":{ + "$ref":"#/definitions/Model3" + }, + "description":"Successful" + } + } + } + }, + "/v1/trading/fills":{ + "get":{ + "summary":"This method is used to get the history of fills (executed trades) for the authenticated user", + "operationId":"getV1TradingFills", + "parameters":[ + { + "type":"string", + "description":"Base64 of {signature, nonce} JSON representation", + "name":"authorization", + "in":"header", + "x-example":"EcRecover eyJub25jZSI6InYyLTE3MDQxMTQwNjEuMDAwIiwic2lnbmF0dXJlIjoiMHgyYjQ4ZDUzZjJlM2E2OTY2MzBlYmRjZDFmZjA1NzU1NmJiYzlkZTljMjk0YWRmYWE1YjFmMTNkZjkxYjY3YjM0N2ZkZDg4YzI5NTk0YzM3N2JhMDAyNGRlYzQwY2Q5ODA4ODI5ZTdmNDQ0Nzc3MjQ4MmY1MGE3YThlOWE5MDM1NjFjIn0=", + "required":true + }, + { + "type":"string", + "x-convert":{ + "case":"upper" + }, + "name":"symbol", + "in":"query" + }, + { + "type":"string", + "format":"date", + "name":"startDate", + "in":"query", + "x-example":"2020-01-01 13:45" + }, + { + "type":"string", + "format":"date", + "name":"endDate", + "in":"query", + "x-example":"2025-12-31 23:45" + }, + { + "type":"string", + "default":"date", + "enum":[ + "date" + ], + "name":"sortBy", + "in":"query" + }, + { + "type":"string", + "default":"DESC", + "enum":[ + "ASC", + "DESC" + ], + "name":"sortDirection", + "in":"query" + }, + { + "type":"integer", + "default":0, + "minimum":0, + "name":"skip", + "in":"query" + }, + { + "type":"integer", + "default":20, + "minimum":1, + "maximum":100, + "name":"limit", + "in":"query" + } + ], + "tags":[ + "Trading" + ], + "responses":{ + "200":{ + "schema":{ + "$ref":"#/definitions/getFillsResponse", + "x-alternatives":[ + { + "$ref":"#/x-alt-definitions/getFillsResponse" + }, + { + "type":"string", + "description":"Response in CSV format", + "example":"fillId,orderId,symbol,fillAmount,orderAmount,price,date,orderCreationDate,orderType,orderActive,orderCanceled606f4123baed6ee2d25f1f1f,79qiFBVDfbz,ZRX:USDT,-0.125622,-1,209.9,1990-04-14T00:00:00.000Z,2020-11-11T16:37:05.262Z,EXCHANGE LIMIT,false,false606f4123baed6ee2d25f1f32,7vVPHzETRQY,ZRX:USDT,-0.125622,-1,209.9,1990-04-14T00:02:00.000Z,2020-11-11T16:37:05.262Z,EXCHANGE LIMIT,false,false606f4123baed6ee2d25f1f2d,GuKPHMafYU1,ZRX:USDT,-0.125622,-1,209.9,1990-04-14T00:04:00.000Z,2020-11-11T16:37:05.262Z,EXCHANGE LIMIT,false,false606f4123baed6ee2d25f1f25,6h1i8x5apLe,ZRX:USDT,-0.125622,-1,209.9,1990-04-14T00:06:00.000Z,2020-11-11T16:37:05.262Z,EXCHANGE LIMIT,false,false606f4123baed6ee2d25f1f27,MwEnHW1MF5y,ZRX:USDT,-0.125622,-1,209.9,1990-04-14T00:08:00.000Z,2020-11-11T16:37:05.262Z,EXCHANGE LIMIT,false,false" + } + ] + }, + "description":"Successful" + } + } + } + }, + "/v1/trading/transfers":{ + "get":{ + "summary":"This method is used to get the history of transfers for the authenticated user", + "operationId":"getV1TradingTransfers", + "parameters":[ + { + "type":"string", + "description":"Base64 of {signature, nonce} JSON representation", + "name":"authorization", + "in":"header", + "x-example":"EcRecover eyJub25jZSI6InYyLTE3MDQxMTQwNjEuMDAwIiwic2lnbmF0dXJlIjoiMHgyYjQ4ZDUzZjJlM2E2OTY2MzBlYmRjZDFmZjA1NzU1NmJiYzlkZTljMjk0YWRmYWE1YjFmMTNkZjkxYjY3YjM0N2ZkZDg4YzI5NTk0YzM3N2JhMDAyNGRlYzQwY2Q5ODA4ODI5ZTdmNDQ0Nzc3MjQ4MmY1MGE3YThlOWE5MDM1NjFjIn0=", + "required":true + }, + { + "type":"string", + "x-convert":{ + "case":"upper" + }, + "name":"token", + "in":"query" + }, + { + "type":"string", + "format":"date", + "name":"startDate", + "in":"query", + "x-example":"2020-01-01 13:45" + }, + { + "type":"string", + "format":"date", + "name":"endDate", + "in":"query", + "x-example":"2025-12-31 23:45" + }, + { + "type":"string", + "default":"date", + "enum":[ + "date" + ], + "name":"sortBy", + "in":"query" + }, + { + "type":"string", + "default":"DESC", + "enum":[ + "ASC", + "DESC" + ], + "name":"sortDirection", + "in":"query" + }, + { + "type":"integer", + "default":0, + "minimum":0, + "name":"skip", + "in":"query" + }, + { + "type":"integer", + "default":20, + "minimum":1, + "maximum":100, + "name":"limit", + "in":"query" + } + ], + "tags":[ + "Trading" + ], + "responses":{ + "200":{ + "schema":{ + "$ref":"#/definitions/getTransfersResponse", + "x-alternatives":[ + { + "$ref":"#/x-alt-definitions/getTransfersResponse" + }, + { + "type":"string", + "description":"List of past transfers in CSV format", + "example":"id,token,amount,feeAmount,source,recipient,memo,date9oWC74UdzWJ,ZRX,0.05,0.001,0x08152c1265dBc218ccc8Ab5C574e6bD52279b3B7,0xeb3ea3ea9239577951523cafa9fd3072bc88e50a,reference,1990-04-14T00:00:00.000ZJtCAHChHhmU,ZRX,0.05,0.001,0x08152c1265dBc218ccc8Ab5C574e6bD52279b3B7,0xeb3ea3ea9239577951523cafa9fd3072bc88e50a,,1990-04-14T00:02:00.000ZA1vFQzqYMXu,ZRX,0.05,0.001,0x08152c1265dBc218ccc8Ab5C574e6bD52279b3B7,0xeb3ea3ea9239577951523cafa9fd3072bc88e50a,,1990-04-14T00:04:00.000Z8xFu925f72r,ZRX,0.05,0.001,0x08152c1265dBc218ccc8Ab5C574e6bD52279b3B7,0xeb3ea3ea9239577951523cafa9fd3072bc88e50a,,1990-04-14T00:06:00.000Z" + } + ] + }, + "description":"Successful" + } + } + } + }, + "/v1/trading/amm/fundingOrderData":{ + "get":{ + "summary":"Get data for AmmFundingOrder, for given token and amount.", + "operationId":"getV1TradingAmmFundingorderdata", + "description":"In order to get data for a deposit order, provide one of the tokens and the amount you want to deposit. The response will contain information on how much of the other pool token you need to deposit and how many LP tokens you will get in return.\nIn order to get data for a withdrawal, set token to pools LP token and provide the amount of it which you wish to exchange for pool tokens. The response will conatin information about how much of the pool tokens you will get in return.\nData returned by this end point can be used to actually request a deposit/withdrawal via POST app/fundingOrders.", + "parameters":[ + { + "type":"string", + "description":"Base64 of {signature, nonce} JSON representation", + "name":"authorization", + "in":"header", + "x-example":"EcRecover eyJub25jZSI6InYyLTE3MDQxMTQwNjEuMDAwIiwic2lnbmF0dXJlIjoiMHgyYjQ4ZDUzZjJlM2E2OTY2MzBlYmRjZDFmZjA1NzU1NmJiYzlkZTljMjk0YWRmYWE1YjFmMTNkZjkxYjY3YjM0N2ZkZDg4YzI5NTk0YzM3N2JhMDAyNGRlYzQwY2Q5ODA4ODI5ZTdmNDQ0Nzc3MjQ4MmY1MGE3YThlOWE5MDM1NjFjIn0=", + "required":true + }, + { + "type":"string", + "name":"pool", + "in":"query", + "x-example":"ETH:USDT" + }, + { + "type":"string", + "name":"token", + "in":"query", + "x-example":"ETH" + }, + { + "type":"string", + "name":"amount", + "in":"query", + "x-example":1 + } + ], + "tags":[ + "Trading", + "AMM" + ], + "responses":{ + "200":{ + "schema":{ + "$ref":"#/definitions/AmmFundingOrderDataGetResponse" + }, + "description":"Successful" + } + } + } + }, + "/v1/trading/r/30DaysVolume":{ + "get":{ + "summary":"Request information regarding the trading volume of a specific address for the last 30 days. The request returns the overall trading volume details for all tokens in USD as well as the trading volume per token. Results are cached for 60 minutes.", + "operationId":"getV1TradingR30daysvolume", + "parameters":[ + { + "type":"string", + "description":"This nonce which used to provide the time until which this nonce is valid. It is presented as seconds since epoch.", + "name":"nonce", + "in":"query", + "x-example":"v2-1704114061.000", + "required":false + }, + { + "type":"string", + "description":"The signature obtained by signing the nonce with your private ethereum key.", + "name":"signature", + "in":"query", + "x-example":"0x2b48d53f2e3a696630ebdcd1ff057556bbc9de9c294adfaa5b1f13df91b67b347fdd88c29594c377ba0024dec40cd9808829e7f4447772482f50a7a8e9a903561c", + "required":false + } + ], + "tags":[ + "Market" + ], + "responses":{ + "200":{ + "schema":{ + "$ref":"#/definitions/30DaysVolumeResponse" + }, + "description":"Successful" + } + } + } + }, + "/v1/trading/r/USDRanking":{ + "get":{ + "summary":"This returns a user ranking by overall trading volume quoted in USD. If the parameters startDate and endDate are provided, the ranking includes only trading volume within that window of time.", + "operationId":"getV1TradingRUsdranking", + "parameters":[ + { + "type":"number", + "description":"The start date and time (Unix timestamp in milliseconds) for which the trade volumes are requested. If startDate and endDate are not provided, it returns the volume ranking if all time.", + "name":"startDate", + "in":"query", + "x-example":1577836800000 + }, + { + "type":"number", + "description":"The end date and time (Unix timestamp in milliseconds) for which events are requested.If startDate and endDate are not provided, it returns the volume ranking if all time.", + "name":"endDate", + "in":"query", + "x-example":1747384800000 + } + ], + "tags":[ + "Market" + ], + "responses":{ + "default":{ + "schema":{ + "$ref":"#/definitions/USDRankingResponse" + }, + "description":"Ranked output of all trading volumes for all the tokens." + } + } + } + }, + "/v1/trading/r/User24HoursVolume":{ + "get":{ + "summary":"Request information regarding the trading volume of a specific address for the last 24 hours. The request returns the overall trading volume details for all tokens in USD as well as the trading volume per token. Results are cached for 2 minutes.", + "operationId":"getV1TradingRUser24hoursvolume", + "parameters":[ + { + "type":"string", + "description":"This nonce which used to provide the time until which this nonce is valid. It is presented as seconds since epoch.", + "name":"nonce", + "in":"query", + "x-example":"v2-1704114061.000", + "required":false + }, + { + "type":"string", + "description":"The signature obtained by signing the nonce with your private ethereum key.", + "name":"signature", + "in":"query", + "x-example":"0x2b48d53f2e3a696630ebdcd1ff057556bbc9de9c294adfaa5b1f13df91b67b347fdd88c29594c377ba0024dec40cd9808829e7f4447772482f50a7a8e9a903561c", + "required":false + } + ], + "tags":[ + "Market" + ], + "responses":{ + "200":{ + "schema":{ + "$ref":"#/definitions/User24HoursVolumeResponse" + }, + "description":"Successful" + }, + "default":{ + "schema":{ + "$ref":"#/definitions/Model9" + }, + "description":"Returns the overall trading volume details of a specific address for all tokens in USD as well as the trading volume per trading pair fot the last 24 hours." + } + } + } + }, + "/v1/trading/r/airdropEligibility":{ + "get":{ + "summary":"Returns the eligible DVF airdrop amount for the given address", + "operationId":"getV1TradingRAirdropeligibility", + "parameters":[ + { + "type":"string", + "description":"Ethereum address", + "name":"ethAddress", + "in":"query", + "x-example":"0x3f2b822E9A8312C6DafBF9686a5e335Af0E4D33B" + }, + { + "type":"string", + "description":"token for the airdrop", + "name":"token", + "in":"query", + "x-example":"DVF" + } + ], + "tags":[ + "Trading" + ], + "responses":{ + "200":{ + "schema":{ + "$ref":"#/definitions/Model11" + }, + "description":"Successful" + } + } + } + }, + "/v1/trading/r/beehiveStats":{ + "get":{ + "summary":"Request information regarding beehive liquidity and apy.", + "operationId":"getV1TradingRBeehivestats", + "tags":[ + "Market", + "deprecated" + ], + "responses":{ + "200":{ + "schema":{ + "$ref":"#/definitions/beehiveStatsResponse" + }, + "description":"Successful" + }, + "default":{ + "schema":{ + "$ref":"#/definitions/Model12" + }, + "description":"Returns behive stats" + } + } + } + }, + "/v1/trading/r/estimatedNextBatchTime":{ + "get":{ + "summary":"Returns a countdown until the expected next batch proof is submitted onto the blockchain and the average time of previous batches. The next batch will include all pending withdrawals.", + "operationId":"getV1TradingREstimatednextbatchtime", + "tags":[ + "Market" + ], + "responses":{ + "default":{ + "schema":{ + "$ref":"#/definitions/estimatedNextBatchResponse" + }, + "description":"Returns the amount of time remaining until the batch is posted to Ethereum." + } + } + } + }, + "/v1/trading/r/fastWithdrawalFee":{ + "get":{ + "summary":"Returns a range of gas price options.", + "operationId":"getV1TradingRFastwithdrawalfee", + "parameters":[ + { + "type":"string", + "description":"token to be withdrawn", + "name":"token", + "in":"query", + "x-example":"BTC" + } + ], + "tags":[ + "Trading" + ], + "responses":{ + "200":{ + "schema":{ + "$ref":"#/definitions/Model13" + }, + "description":"Successful" + } + } + } + }, + "/v1/trading/r/fastWithdrawalMaxAmount":{ + "get":{ + "summary":"Returns max amount available for fast withdrawal (before fees).", + "operationId":"getV1TradingRFastwithdrawalmaxamount", + "parameters":[ + { + "type":"string", + "description":"Base64 of {signature, nonce} JSON representation", + "name":"authorization", + "in":"header", + "x-example":"EcRecover eyJub25jZSI6InYyLTE3MDQxMTQwNjEuMDAwIiwic2lnbmF0dXJlIjoiMHgyYjQ4ZDUzZjJlM2E2OTY2MzBlYmRjZDFmZjA1NzU1NmJiYzlkZTljMjk0YWRmYWE1YjFmMTNkZjkxYjY3YjM0N2ZkZDg4YzI5NTk0YzM3N2JhMDAyNGRlYzQwY2Q5ODA4ODI5ZTdmNDQ0Nzc3MjQ4MmY1MGE3YThlOWE5MDM1NjFjIn0=", + "required":true + }, + { + "type":"string", + "description":"token to be withdrawn", + "name":"token", + "in":"query", + "x-example":"BTC" + } + ], + "tags":[ + "Trading" + ], + "responses":{ + "200":{ + "schema":{ + "$ref":"#/definitions/Model14" + }, + "description":"Successful" + } + } + } + }, + "/v1/trading/r/feeRate":{ + "get":{ + "summary":"Return current fee rate for a given address. This rate is dependent on the trading volume of the user.", + "operationId":"getV1TradingRFeerate", + "parameters":[ + { + "type":"string", + "description":"This nonce which used to provide the time until which this nonce is valid. It is presented as seconds since epoch.", + "name":"nonce", + "in":"query", + "x-example":"v2-1704114061.000", + "required":false + }, + { + "type":"string", + "description":"The signature obtained by signing the nonce with your private ethereum key.", + "name":"signature", + "in":"query", + "x-example":"0x2b48d53f2e3a696630ebdcd1ff057556bbc9de9c294adfaa5b1f13df91b67b347fdd88c29594c377ba0024dec40cd9808829e7f4447772482f50a7a8e9a903561c", + "required":false + }, + { + "type":"string", + "description":"Symbol for which the fee rate will be returned", + "name":"symbol", + "in":"query", + "x-example":"ETH:USDT" + }, + { + "type":"string", + "description":"Feature for which the fee rate will be returned", + "name":"feature", + "in":"query", + "x-example":"TRADING" + } + ], + "tags":[ + "Trading" + ], + "responses":{ + "200":{ + "schema":{ + "$ref":"#/definitions/getFeeRateResponse" + }, + "description":"Successful" + } + } + } + }, + "/v1/trading/r/gasSavings":{ + "get":{ + "summary":"Returns gas savings metrics", + "operationId":"getV1TradingRGassavings", + "tags":[ + "Trading" + ], + "responses":{ + "200":{ + "schema":{ + "$ref":"#/definitions/gasSavingsResponse" + }, + "description":"Successful" + } + } + } + }, + "/v1/trading/r/getBalanceUsd":{ + "get":{ + "summary":"This is used to retrieve the sum of all user balances converted to USD.", + "operationId":"getV1TradingRGetbalanceusd", + "parameters":[ + { + "type":"string", + "description":"This nonce which used to provide the time until which this nonce is valid. It is presented as seconds since epoch.", + "name":"nonce", + "in":"query", + "x-example":"v2-1704114061.000", + "required":false + }, + { + "type":"string", + "description":"The signature obtained by signing the nonce with your private ethereum key.", + "name":"signature", + "in":"query", + "x-example":"0x2b48d53f2e3a696630ebdcd1ff057556bbc9de9c294adfaa5b1f13df91b67b347fdd88c29594c377ba0024dec40cd9808829e7f4447772482f50a7a8e9a903561c", + "required":false + } + ], + "tags":[ + "Trading" + ], + "responses":{ + "default":{ + "schema":{ + "$ref":"#/definitions/getBalanceUsdResponse" + }, + "description":"Returns the sum of all user balances converted to USD." + } + } + } + }, + "/v1/trading/r/getConf":{ + "get":{ + "summary":"Returns the DeversiFi application configuration details.", + "operationId":"getV1TradingRGetconf", + "tags":[ + "Trading" + ], + "responses":{ + "default":{ + "schema":{ + "type":"string" + }, + "description":"Successful" + } + } + }, + "post":{ + "summary":"Returns the DeversiFi application configuration details.", + "operationId":"postV1TradingRGetconf", + "tags":[ + "Trading" + ], + "responses":{ + "default":{ + "schema":{ + "type":"string" + }, + "description":"Successful" + } + } + } + }, + "/v1/trading/r/getGasPrice":{ + "get":{ + "summary":"Returns a range of gas price options.", + "operationId":"getV1TradingRGetgasprice", + "tags":[ + "Trading" + ], + "responses":{ + "200":{ + "description":"Range of gas prices for on chain confirmation speed", + "schema":{ + "$ref":"#/definitions/getGasPriceResponse" + } + } + } + }, + "post":{ + "summary":"Returns a range of gas price options.", + "operationId":"postV1TradingRGetgasprice", + "tags":[ + "Trading" + ], + "responses":{ + "200":{ + "description":"Range of gas prices for on chain confirmation speed", + "schema":{ + "$ref":"#/definitions/getGasPriceResponse" + } + } + }, + "deprecated":true + } + }, + "/v1/trading/r/getPublicPermissions":{ + "get":{ + "summary":"A descriptor object for all user permissions available", + "operationId":"getV1TradingRGetpublicpermissions", + "tags":[ + "public" + ], + "responses":{ + "200":{ + "schema":{ + "$ref":"#/definitions/Model15" + }, + "description":"Successful" + } + } + } + }, + "/v1/trading/r/getTokenCirculatingSupply":{ + "get":{ + "summary":"Returns token liquidity left", + "operationId":"getV1TradingRGettokencirculatingsupply", + "parameters":[ + { + "type":"string", + "description":"Token for which to get the circulating supply", + "name":"token", + "in":"query", + "x-example":"DVF" + } + ], + "tags":[ + "Trading" + ], + "responses":{ + "200":{ + "description":"Circulating supply", + "schema":{ + "type":"number", + "description":"Circulating supply", + "example":10 + } + } + } + } + }, + "/v1/trading/r/getTokenHolders":{ + "get":{ + "summary":"Returns token holders count for a given token", + "operationId":"getV1TradingRGettokenholders", + "parameters":[ + { + "type":"string", + "description":"Token for which to get the holders count", + "name":"token", + "in":"query", + "x-example":"DVF" + } + ], + "tags":[ + "Trading" + ], + "responses":{ + "200":{ + "schema":{ + "type":"number", + "example":452083 + }, + "description":"Successful" + } + } + } + }, + "/v1/trading/r/getTokenLiquidityLeft":{ + "get":{ + "summary":"Returns token liquidity left", + "operationId":"getV1TradingRGettokenliquidityleft", + "parameters":[ + { + "type":"string", + "description":"Token for which to get the liquidity left", + "name":"token", + "in":"query", + "x-example":"DVF" + } + ], + "tags":[ + "Trading" + ], + "responses":{ + "200":{ + "schema":{ + "$ref":"#/definitions/Model16" + }, + "description":"Successful" + } + } + } + }, + "/v1/trading/r/getTokenSaleStartEnd":{ + "get":{ + "summary":"Returns token sale start and end time", + "operationId":"getV1TradingRGettokensalestartend", + "parameters":[ + { + "type":"string", + "description":"Token for which to get the sale start and end time", + "name":"token", + "in":"query", + "x-example":"DVF" + } + ], + "tags":[ + "Trading" + ], + "responses":{ + "200":{ + "schema":{ + "$ref":"#/definitions/tokenSaleStartEndResponse" + }, + "description":"Successful" + } + } + } + }, + "/v1/trading/r/last24HoursVolume":{ + "get":{ + "summary":"Request information regarding the trading volume for the last 24 hours. The request returns the overall trading volume details in USD as well as the trading volume per token in USD and the native token.", + "operationId":"getV1TradingRLast24hoursvolume", + "tags":[ + "Market" + ], + "responses":{ + "default":{ + "schema":{ + "$ref":"#/definitions/last24HoursVolumeResponse" + }, + "description":"Returns the trading volume of the last 24 hours." + } + } + } + }, + "/v1/trading/r/registeredAccounts":{ + "get":{ + "summary":"Returns total registered accounts", + "operationId":"getV1TradingRRegisteredaccounts", + "tags":[ + "Trading" + ], + "responses":{ + "200":{ + "schema":{ + "$ref":"#/definitions/registeredAccountsResponse" + }, + "description":"Successful" + } + } + } + }, + "/v1/trading/r/swapVolume":{ + "get":{ + "summary":"Get swap functionality volume information for a specific token related pairs", + "operationId":"getV1TradingRSwapvolume", + "parameters":[ + { + "type":"string", + "description":"Token whose related pair volumes will be calculated", + "name":"token", + "in":"query", + "x-example":"ETH", + "required":true + }, + { + "type":"number", + "description":"Date of the volume", + "name":"date", + "in":"query", + "x-example":1577836800000, + "required":true + } + ], + "tags":[ + "Market" + ], + "responses":{ + "200":{ + "schema":{ + "$ref":"#/definitions/Model17" + }, + "description":"Successful" + } + } + } + }, + "/v1/trading/r/tokenBalancesHistory":{ + "get":{ + "summary":"Return the token balances for the given addresses, token, block number", + "operationId":"getV1TradingRTokenbalanceshistory", + "parameters":[ + { + "type":"number", + "x-alternatives":[ + { + "type":"number", + "example":10822562 + }, + { + "type":"string", + "enum":[ + { + "override":true + }, + "latest" + ] + } + ], + "name":"blockNumber", + "in":"query", + "x-example":10822562 + }, + { + "type":"string", + "description":"token we want the balances of", + "name":"token", + "in":"query", + "x-example":"xDVF" + }, + { + "type":"array", + "items":{ + "type":"string", + "description":"addresses we want the balances of" + }, + "collectionFormat":"multi", + "x-alternatives":[ + { + "type":"array", + "example":[ + "0xc0e9bd267626e2393ddaf520ae5df27ef6c533bd" + ], + "items":{ + "type":"string", + "description":"addresses we want the balances of" + }, + "collectionFormat":"multi", + "name":"addresses" + }, + { + "type":"object" + }, + { + "type":"string", + "example":"0xc0e9bd267626e2393ddaf520ae5df27ef6c533bd" + } + ], + "name":"addresses", + "in":"query", + "x-example":[ + "0xc0e9bd267626e2393ddaf520ae5df27ef6c533bd" + ] + } + ], + "tags":[ + "Trading" + ], + "responses":{ + "200":{ + "schema":{ + "$ref":"#/definitions/Model19" + }, + "description":"Successful" + } + } + } + }, + "/v1/trading/r/tokenRanking":{ + "get":{ + "summary":"This returns a user ranking by trading volume for a chosen token. If the parameters startDate and endDate are provided, the ranking includes only trading volume within that window of time. All volumes are quoted in ETH.", + "operationId":"getV1TradingRTokenranking", + "parameters":[ + { + "type":"string", + "description":"The currency relating to the requested trading volume information.", + "name":"currency", + "in":"query", + "x-example":"ETH", + "required":true + }, + { + "type":"number", + "description":"The start date and time (Unix timestamp in milliseconds) for which the trade volumes are requested. If startDate and endDate are not provided, it returns the volume ranking if all time.", + "name":"startDate", + "in":"query", + "x-example":1527836800000 + }, + { + "type":"number", + "description":"The end date and time (Unix timestamp in milliseconds) for which the trade volumes are requested. If startDate and endDate are not provided, it returns the volume ranking if all time.", + "name":"endDate", + "in":"query", + "x-example":1747384800000 + } + ], + "tags":[ + "Market" + ], + "responses":{ + "default":{ + "schema":{ + "$ref":"#/definitions/tokenRankingResponse" + }, + "description":"Returns a ranked output of all the trading volumes for a given crypto currency. All the Volumes are quoted in ETH." + } + } + } + }, + "/v1/trading/r/totalValueLocked":{ + "get":{ + "summary":"Returns total value locked by day within a given timerange", + "operationId":"getV1TradingRTotalvaluelocked", + "parameters":[ + { + "type":"string", + "format":"date", + "description":"Date from which to get TVL data", + "name":"startDate", + "in":"query", + "x-example":"2020-04-21" + }, + { + "type":"string", + "format":"date", + "description":"Date until which to get TVL data", + "name":"endDate", + "in":"query", + "x-example":"2020-05-21" + }, + { + "type":"string", + "description":"Optional, Token for which to get TVL data", + "name":"token", + "in":"query", + "required":false + } + ], + "tags":[ + "Trading" + ], + "responses":{ + "200":{ + "schema":{ + "$ref":"#/definitions/totalValueLockedResponse" + }, + "description":"Successful" + } + } + } + }, + "/v1/trading/r/tradeCountSince":{ + "get":{ + "summary":"Returns deversifi finished order count from specified date", + "operationId":"getV1TradingRTradecountsince", + "parameters":[ + { + "type":"string", + "format":"date", + "description":"Date since when orders are counted.", + "name":"startDate", + "in":"query", + "x-example":"2020-07-21T13:19:08.241Z", + "required":true + } + ], + "tags":[ + "Market" + ], + "responses":{ + "200":{ + "schema":{ + "$ref":"#/definitions/Model20" + }, + "description":"Successful" + } + } + } + }, + "/v1/trading/r/tradeHistory":{ + "get":{ + "summary":"This method is used to retrieve a list of all past executed trades for a user. This includes the different trades that have been settled for each fully executed or partially executed order.", + "operationId":"getV1TradingRTradehistory", + "parameters":[ + { + "type":"string", + "description":"This nonce which used to provide the time until which this nonce is valid. It is presented as seconds since epoch.", + "name":"nonce", + "in":"query", + "x-example":"v2-1704114061.000", + "required":false + }, + { + "type":"string", + "description":"The signature obtained by signing the nonce with your private ethereum key.", + "name":"signature", + "in":"query", + "x-example":"0x2b48d53f2e3a696630ebdcd1ff057556bbc9de9c294adfaa5b1f13df91b67b347fdd88c29594c377ba0024dec40cd9808829e7f4447772482f50a7a8e9a903561c", + "required":false + } + ], + "produces":[ + "text/csv" + ], + "tags":[ + "Trading" + ], + "responses":{ + "200":{ + "description":"Returns executed trades as a CSV file", + "schema":{ + "type":"string", + "example":"exchange_name,account_name,trade_date,buy_asset,sell_asset,buy_amount,sell_amount,exchange_order_id,fee_asset,fee_amount,transaction_type,clarification\nDeversiFi,0x08152c1265dbc218ccc8ab5c574e6bd52279b3b7,2021-01-21T16:08:39,USDT,ETH,40.918,1,NHX5FcipBCZ,USDT,0.082,trade,\nDeversiFi,0x08152c1265dbc218ccc8ab5c574e6bd52279b3b7,2021-01-20T18:30:54,USDT,ETH,41.916,1,2f7tKwGqR8v,USDT,0.084,trade,\nDeversiFi,0x08152c1265dbc218ccc8ab5c574e6bd52279b3b7,2021-01-19T10:16:31,USDT,ETH,38.6226,0.9,KRSbMNKyDwu,USDT,0.0774,trade," + } + } + } + } + }, + "/v1/trading/r/transferVolume":{ + "get":{ + "summary":"Get transfer functionality volume information for a specific token", + "operationId":"getV1TradingRTransfervolume", + "parameters":[ + { + "type":"string", + "description":"Token whose transfer volumes will be calculated", + "name":"token", + "in":"query", + "x-example":"ETH", + "required":true + }, + { + "type":"number", + "description":"Date of the volume", + "name":"date", + "in":"query", + "x-example":1577836800000, + "required":true + } + ], + "tags":[ + "Market" + ], + "responses":{ + "200":{ + "schema":{ + "$ref":"#/definitions/Model21" + }, + "description":"Successful" + } + } + } + }, + "/v1/trading/r/vaultIdAndStarkKey":{ + "get":{ + "summary":"Gets the stark public key and vault id for the user registered with and token", + "operationId":"getV1TradingRVaultidandstarkkey", + "parameters":[ + { + "type":"string", + "description":"This nonce which used to provide the time until which this nonce is valid. It is presented as seconds since epoch.", + "name":"nonce", + "in":"query", + "x-example":"v2-1704114061.000", + "required":false + }, + { + "type":"string", + "description":"The signature obtained by signing the nonce with your private ethereum key.", + "name":"signature", + "in":"query", + "x-example":"0x2b48d53f2e3a696630ebdcd1ff057556bbc9de9c294adfaa5b1f13df91b67b347fdd88c29594c377ba0024dec40cd9808829e7f4447772482f50a7a8e9a903561c", + "required":false + }, + { + "type":"string", + "description":"The ETH address of a registered user", + "name":"targetEthAddress", + "in":"query", + "x-example":"0x08152c1265dbc218ccc8ab5c574e6bd52279b3b7", + "required":true + }, + { + "type":"string", + "description":"The token for which we want retrieve the vault ID", + "name":"token", + "in":"query", + "x-example":"ETH", + "required":true + } + ], + "tags":[ + "Trading" + ], + "responses":{ + "200":{ + "schema":{ + "$ref":"#/definitions/vaultIdAndStarkKeyResponse" + }, + "description":"Successful" + }, + "404":{ + "description":"When there is no user registered with given `targetEthAddress`" + } + } + } + }, + "/v1/trading/r/votingPower":{ + "get":{ + "summary":"Returns total xDVF balance of exchange users and calculated voting power based on input amount", + "operationId":"getV1TradingRVotingpower", + "parameters":[ + { + "type":"string", + "description":"Amount of xDVF ", + "name":"amount", + "in":"query", + "x-example":"55" + } + ], + "tags":[ + "Trading" + ], + "responses":{ + "200":{ + "schema":{ + "$ref":"#/definitions/votingPowerResponse" + }, + "description":"Successful" + } + } + } + }, + "/v1/trading/registrations/{targetEthAddress}":{ + "get":{ + "summary":"This method is used to retrieve the registration statuses of the given eth address", + "operationId":"getV1TradingRegistrationsTargetethaddress", + "parameters":[ + { + "type":"string", + "description":"The ETH address of a potential user", + "name":"targetEthAddress", + "in":"path", + "x-example":"0x3f2b822E9A8312C6DafBF9686a5e335Af0E4D33B", + "required":true + } + ], + "tags":[ + "Trading" + ], + "responses":{ + "200":{ + "schema":{ + "$ref":"#/definitions/Model22" + }, + "description":"Successful" + } + } + } + }, + "/v1/trading/r/publicTradeHistory/{user}":{ + "get":{ + "summary":"This method is used to retrieve a list of all past executed trades for a user. This includes the different trades that have been settled for each fully executed or partially executed order.", + "operationId":"getV1TradingRPublictradehistoryUser", + "parameters":[ + { + "type":"string", + "description":"The ETH address of a potential user", + "name":"user", + "in":"path", + "x-example":"0x3f2b822E9A8312C6DafBF9686a5e335Af0E4D33B", + "required":true + } + ], + "tags":[ + "Trading", + "public" + ], + "responses":{ + "200":{ + "schema":{ + "$ref":"#/definitions/Model25" + }, + "description":"Successful" + }, + "401":{ + "description":"User has not authorized the use of this endpoint for their address" + } + } + } + }, + "/v1/trading/r/trades/{symbol}":{ + "get":{ + "summary":"Request information regarding all recently completed trades for a given market pair.", + "operationId":"getV1TradingRTradesSymbol", + "parameters":[ + { + "type":"string", + "description":"The market trading pair in deversifi format i.e BASE:QUOTE", + "name":"symbol", + "in":"path", + "x-example":"ETH:USDT", + "required":true + } + ], + "tags":[ + "Market" + ], + "responses":{ + "default":{ + "schema":{ + "$ref":"#/definitions/tradesResponse" + }, + "description":"The trades endpoint returns data on all recently completed trades for a given market pair for the past 24 hours" + } + } + } + }, + "/v1/trading/r/24HoursVolume/{year}/{month}/{day}":{ + "get":{ + "summary":"Request information regarding the trading volume for a specific date. The request returns the overall trading volume details for all tokens in USD as well as the trading volume per token.", + "operationId":"getV1TradingR24hoursvolumeYearMonthDay", + "parameters":[ + { + "type":"number", + "description":"The year of the specific trading volume request date - in this case 2020.", + "name":"year", + "in":"path", + "x-example":"2020", + "required":true + }, + { + "type":"number", + "description":"The month of the specific trading volume request date - in this case 01 (January).", + "name":"month", + "in":"path", + "x-example":"01", + "required":true + }, + { + "type":"number", + "description":"The day of the specific trading volume request date - in this case 01 (1st of a month).", + "name":"day", + "in":"path", + "x-example":"01", + "required":true + } + ], + "tags":[ + "Market" + ], + "responses":{ + "200":{ + "schema":{ + "$ref":"#/definitions/24HoursVolumeResponse" + }, + "description":"Successful" + } + } + } + }, + "/v1/trading/r/tradesSince/{symbol}/{startDate}/{limit}":{ + "get":{ + "summary":"Request information regarding all completed trades in a time range for a given market pair", + "operationId":"getV1TradingRTradessinceSymbolStartdateLimit", + "parameters":[ + { + "type":"string", + "description":"The market trading pair in deversifi format i.e BASE:QUOTE", + "name":"symbol", + "in":"path", + "x-example":"ETH:BTC", + "required":true + }, + { + "type":"number", + "description":"Date of the last trade returned.", + "name":"startDate", + "in":"path", + "x-example":1747384800000, + "required":true + }, + { + "type":"number", + "description":"Limit of trades that will be returned. With a maximum limit of 1000.", + "name":"limit", + "in":"path", + "x-example":60 + } + ], + "tags":[ + "Market" + ], + "responses":{ + "default":{ + "schema":{ + "$ref":"#/definitions/Model27" + }, + "description":"Returns data on all recently completed trades for a given market pair during a time range" + } + } + } + }, + "/v1/trading/bridgedDeposits":{ + "post":{ + "summary":"Create Stark V2 BridgedDepositRequest", + "operationId":"postV1TradingBridgeddeposits", + "parameters":[ + { + "type":"string", + "description":"Base64 of {signature, nonce} JSON representation", + "name":"authorization", + "in":"header", + "x-example":"EcRecover eyJub25jZSI6InYyLTE3MDQxMTQwNjEuMDAwIiwic2lnbmF0dXJlIjoiMHgyYjQ4ZDUzZjJlM2E2OTY2MzBlYmRjZDFmZjA1NzU1NmJiYzlkZTljMjk0YWRmYWE1YjFmMTNkZjkxYjY3YjM0N2ZkZDg4YzI5NTk0YzM3N2JhMDAyNGRlYzQwY2Q5ODA4ODI5ZTdmNDQ0Nzc3MjQ4MmY1MGE3YThlOWE5MDM1NjFjIn0=", + "required":true + }, + { + "in":"body", + "name":"body", + "schema":{ + "$ref":"#/definitions/bridgedDepositsPostPayload" + } + } + ], + "tags":[ + "Trading" + ], + "responses":{ + "200":{ + "schema":{ + "$ref":"#/definitions/bridgedDepositsPostResponse" + }, + "description":"Successful" + } + } + } + }, + "/v1/trading/bridgedWithdrawals":{ + "post":{ + "summary":"Create Stark V2 BridgedWithdrawalRequest", + "operationId":"postV1TradingBridgedwithdrawals", + "parameters":[ + { + "type":"string", + "description":"Base64 of {signature, nonce} JSON representation", + "name":"authorization", + "in":"header", + "x-example":"EcRecover eyJub25jZSI6InYyLTE3MDQxMTQwNjEuMDAwIiwic2lnbmF0dXJlIjoiMHgyYjQ4ZDUzZjJlM2E2OTY2MzBlYmRjZDFmZjA1NzU1NmJiYzlkZTljMjk0YWRmYWE1YjFmMTNkZjkxYjY3YjM0N2ZkZDg4YzI5NTk0YzM3N2JhMDAyNGRlYzQwY2Q5ODA4ODI5ZTdmNDQ0Nzc3MjQ4MmY1MGE3YThlOWE5MDM1NjFjIn0=", + "required":true + }, + { + "in":"body", + "name":"body", + "schema":{ + "$ref":"#/definitions/bridgedWithdrawalsPostPayload" + } + } + ], + "tags":[ + "Trading" + ], + "responses":{ + "200":{ + "schema":{ + "$ref":"#/definitions/bridgedWithdrawalsPostResponse" + }, + "description":"Successful" + } + } + } + }, + "/v1/trading/deposits":{ + "post":{ + "summary":"Create Stark V2 DepositRequest", + "operationId":"postV1TradingDeposits", + "parameters":[ + { + "type":"string", + "description":"Base64 of {signature, nonce} JSON representation", + "name":"authorization", + "in":"header", + "x-example":"EcRecover eyJub25jZSI6InYyLTE3MDQxMTQwNjEuMDAwIiwic2lnbmF0dXJlIjoiMHgyYjQ4ZDUzZjJlM2E2OTY2MzBlYmRjZDFmZjA1NzU1NmJiYzlkZTljMjk0YWRmYWE1YjFmMTNkZjkxYjY3YjM0N2ZkZDg4YzI5NTk0YzM3N2JhMDAyNGRlYzQwY2Q5ODA4ODI5ZTdmNDQ0Nzc3MjQ4MmY1MGE3YThlOWE5MDM1NjFjIn0=", + "required":true + }, + { + "in":"body", + "name":"body", + "schema":{ + "$ref":"#/definitions/depositsPostPayload" + } + } + ], + "tags":[ + "Trading" + ], + "responses":{ + "200":{ + "schema":{ + "$ref":"#/definitions/depositsPostResponse" + }, + "description":"Successful" + } + } + } + }, + "/v1/trading/deposits-validate":{ + "post":{ + "summary":"Create Stark V2 Deposits-validateRequest", + "operationId":"postV1TradingDepositsvalidate", + "parameters":[ + { + "type":"string", + "description":"Base64 of {signature, nonce} JSON representation", + "name":"authorization", + "in":"header", + "x-example":"EcRecover eyJub25jZSI6InYyLTE3MDQxMTQwNjEuMDAwIiwic2lnbmF0dXJlIjoiMHgyYjQ4ZDUzZjJlM2E2OTY2MzBlYmRjZDFmZjA1NzU1NmJiYzlkZTljMjk0YWRmYWE1YjFmMTNkZjkxYjY3YjM0N2ZkZDg4YzI5NTk0YzM3N2JhMDAyNGRlYzQwY2Q5ODA4ODI5ZTdmNDQ0Nzc3MjQ4MmY1MGE3YThlOWE5MDM1NjFjIn0=", + "required":true + }, + { + "in":"body", + "name":"body", + "schema":{ + "$ref":"#/definitions/deposits-validatePostPayload" + } + } + ], + "tags":[ + "Trading" + ], + "responses":{ + "200":{ + "schema":{ + "$ref":"#/definitions/deposits-validatePostResponse" + }, + "description":"Successful" + } + } + } + }, + "/v1/trading/withdrawals":{ + "post":{ + "summary":"Create Stark V2 WithdrawalRequest", + "operationId":"postV1TradingWithdrawals", + "parameters":[ + { + "type":"string", + "description":"Base64 of {signature, nonce} JSON representation", + "name":"authorization", + "in":"header", + "x-example":"EcRecover eyJub25jZSI6InYyLTE3MDQxMTQwNjEuMDAwIiwic2lnbmF0dXJlIjoiMHgyYjQ4ZDUzZjJlM2E2OTY2MzBlYmRjZDFmZjA1NzU1NmJiYzlkZTljMjk0YWRmYWE1YjFmMTNkZjkxYjY3YjM0N2ZkZDg4YzI5NTk0YzM3N2JhMDAyNGRlYzQwY2Q5ODA4ODI5ZTdmNDQ0Nzc3MjQ4MmY1MGE3YThlOWE5MDM1NjFjIn0=", + "required":true + }, + { + "in":"body", + "name":"body", + "schema":{ + "$ref":"#/definitions/withdrawalsPostPayload" + } + } + ], + "tags":[ + "Trading" + ], + "responses":{ + "200":{ + "schema":{ + "$ref":"#/definitions/withdrawalsPostResponse" + }, + "description":"Successful" + } + } + } + }, + "/v1/trading/amm/fundingOrders":{ + "post":{ + "summary":"Submit AMM fundingOrder. Used to deposit or withdrawal liquidity.", + "operationId":"postV1TradingAmmFundingorders", + "parameters":[ + { + "in":"body", + "name":"body", + "schema":{ + "$ref":"#/definitions/AmmFundingOrdersPostPayload" + } + } + ], + "tags":[ + "Trading", + "AMM" + ], + "responses":{ + "200":{ + "schema":{ + "$ref":"#/definitions/AmmFundingOrdersPostResponse" + }, + "description":"Successful" + } + } + } + }, + "/v1/trading/r/addAirdrops":{ + "post":{ + "summary":"Add a list of airdops", + "operationId":"postV1TradingRAddairdrops", + "parameters":[ + { + "in":"body", + "name":"body", + "schema":{ + "$ref":"#/definitions/addAirdropRequestSchema" + } + } + ], + "tags":[ + "Internal" + ], + "responses":{ + "200":{ + "schema":{ + "$ref":"#/definitions/addAirdropResponseSchema" + }, + "description":"Successful" + } + } + } + }, + "/v1/trading/r/getBalance":{ + "post":{ + "summary":"This is used to retrieve the total and active balances of a user per token. Active balance is the balance that is currently available. Total balance (specified as balance) is the sum of all the balances including those locked for trading.", + "operationId":"postV1TradingRGetbalance", + "parameters":[ + { + "in":"body", + "name":"body", + "schema":{ + "$ref":"#/definitions/getBalancePayload" + } + } + ], + "tags":[ + "Trading" + ], + "responses":{ + "default":{ + "schema":{ + "$ref":"#/definitions/getBalanceResponse" + }, + "description":"Returns the total, available and locked balances of a user per token." + } + } + } + }, + "/v1/trading/r/getDeposits":{ + "post":{ + "summary":"This is an authenticated endpoint used to retrieve deposits. A token can be specified to get deposits for a specific token. The limit of deposits returned is 1000.", + "operationId":"postV1TradingRGetdeposits", + "parameters":[ + { + "type":"number", + "description":"Date of the last deposit returned.", + "name":"startDate", + "in":"query", + "x-example":1747384800000 + }, + { + "type":"number", + "description":"Limit of deposits that will be returned. With a maximum limit of 1000.", + "name":"limit", + "in":"query", + "x-example":60 + }, + { + "in":"body", + "name":"body", + "schema":{ + "$ref":"#/definitions/getDepositsPayload" + } + } + ], + "tags":[ + "Trading" + ], + "responses":{ + "default":{ + "schema":{ + "$ref":"#/definitions/getDepositsResponse" + }, + "description":"Returns the list of deposits. A token can be specified to get deposits for a specific token." + } + } + } + }, + "/v1/trading/r/getOrder":{ + "post":{ + "summary":"This is endpoint is used to retrieve the details for a specific order using the order ID.", + "operationId":"postV1TradingRGetorder", + "parameters":[ + { + "in":"body", + "name":"body", + "schema":{ + "$ref":"#/definitions/getOrderPayload" + } + } + ], + "tags":[ + "Trading" + ], + "responses":{ + "default":{ + "schema":{ + "$ref":"#/definitions/getOrderResponse" + }, + "description":"Returns details relating to a particular order." + } + } + } + }, + "/v1/trading/r/getPendingWithdrawals":{ + "post":{ + "summary":"This endpoint is used to retrieve all pending withdrawals. If a token is specified, withdrawals pertaining to only that particular token are provided.", + "operationId":"postV1TradingRGetpendingwithdrawals", + "parameters":[ + { + "in":"body", + "name":"body", + "schema":{ + "$ref":"#/definitions/getPendingWithdrawalsPayload" + } + } + ], + "tags":[ + "Trading" + ], + "responses":{ + "default":{ + "schema":{ + "type":"string" + }, + "description":"Successful" + } + } + } + }, + "/v1/trading/r/getPublicUserPermissions":{ + "post":{ + "summary":"Used to get all configured permissions for the authenticated user", + "operationId":"postV1TradingRGetpublicuserpermissions", + "parameters":[ + { + "in":"body", + "name":"body", + "schema":{ + "$ref":"#/definitions/authPayload" + } + } + ], + "tags":[ + "public" + ], + "responses":{ + "200":{ + "schema":{ + "$ref":"#/definitions/Model38" + }, + "description":"Successful" + } + } + } + }, + "/v1/trading/r/getUserConf":{ + "post":{ + "summary":"Returns the DeversiFi application and user configuration details.", + "operationId":"postV1TradingRGetuserconf", + "parameters":[ + { + "in":"body", + "name":"body", + "schema":{ + "$ref":"#/definitions/authPayload" + } + } + ], + "tags":[ + "Trading" + ], + "responses":{ + "default":{ + "schema":{ + "$ref":"#/definitions/getUserConfResponse" + }, + "description":"Returns the overall trading volume details for all tokens in USD as well as the trading volume per trading pair." + } + } + } + }, + "/v1/trading/r/getVaultId":{ + "post":{ + "summary":"An authenticated endpoint used to retrieve a vaultId for given token.", + "operationId":"postV1TradingRGetvaultid", + "parameters":[ + { + "in":"body", + "name":"body", + "schema":{ + "$ref":"#/definitions/getVaultIdPayload" + } + } + ], + "tags":[ + "Trading" + ], + "responses":{ + "200":{ + "description":"the vault id.", + "schema":{ + "type":"number", + "description":"the vault id.", + "example":1851736 + } + } + } + } + }, + "/v1/trading/r/getWithdrawal":{ + "post":{ + "summary":"This endpoint is used to retrieve details relating to a particular withdrawal.", + "operationId":"postV1TradingRGetwithdrawal", + "parameters":[ + { + "in":"body", + "name":"body", + "schema":{ + "$ref":"#/definitions/getWithdrawalPayload" + } + } + ], + "tags":[ + "Trading" + ], + "responses":{ + "200":{ + "schema":{ + "$ref":"#/definitions/withdrawHistoryObject" + }, + "description":"Successful" + } + } + } + }, + "/v1/trading/r/hasReceivedCompensation":{ + "post":{ + "summary":"Returns whether the user already received registration compensation.", + "operationId":"postV1TradingRHasreceivedcompensation", + "parameters":[ + { + "in":"body", + "name":"body", + "schema":{ + "$ref":"#/definitions/authPayload" + } + } + ], + "tags":[ + "Internal" + ], + "responses":{ + "200":{ + "schema":{ + "$ref":"#/definitions/Model39" + }, + "description":"Successful" + } + } + } + }, + "/v1/trading/r/openOrders":{ + "post":{ + "summary":"This endpoints allows to retrieve details on all open orders.", + "operationId":"postV1TradingROpenorders", + "parameters":[ + { + "in":"body", + "name":"body", + "schema":{ + "$ref":"#/definitions/openOrdersPayload" + } + } + ], + "tags":[ + "Trading" + ], + "responses":{ + "200":{ + "schema":{ + "$ref":"#/definitions/openOrdersResponse" + }, + "description":"Successful" + } + } + } + }, + "/v1/trading/r/orderHistory":{ + "post":{ + "summary":"This method is used to retrieve a list of all past orders for a user. This includes executed trades, as well as expired and cancelled orders. The limit of orders returned is 1000.", + "operationId":"postV1TradingROrderhistory", + "parameters":[ + { + "type":"number", + "description":"Date of the last order returned.", + "name":"startDate", + "in":"query", + "x-example":1747384800000 + }, + { + "type":"number", + "description":"Limit of orders that will be returned. With a maximum limit of 1000.", + "name":"limit", + "in":"query", + "x-example":60 + }, + { + "in":"body", + "name":"body", + "schema":{ + "$ref":"#/definitions/openOrdersPayload" + } + } + ], + "tags":[ + "Trading" + ], + "responses":{ + "200":{ + "schema":{ + "$ref":"#/definitions/Model40" + }, + "description":"Successful" + } + } + } + }, + "/v1/trading/r/recoverTradingKey":{ + "post":{ + "summary":"Returns the encrypted Stark Trading Key.", + "operationId":"postV1TradingRRecovertradingkey", + "parameters":[ + { + "in":"body", + "name":"body", + "schema":{ + "$ref":"#/definitions/authPayload" + } + } + ], + "tags":[ + "Trading" + ], + "responses":{ + "default":{ + "schema":{ + "$ref":"#/definitions/recoverTradingKeyResponse" + }, + "description":"Returns the encrypted Stark Trading key." + } + } + } + }, + "/v1/trading/r/setPublicUserPermissions":{ + "post":{ + "summary":"Used to set a specific permission for a given user", + "operationId":"postV1TradingRSetpublicuserpermissions", + "parameters":[ + { + "in":"body", + "name":"body", + "schema":{ + "$ref":"#/definitions/permissionsPayload" + } + } + ], + "tags":[ + "Trading" + ], + "responses":{ + "200":{ + "schema":{ + "$ref":"#/definitions/Model38" + }, + "description":"Successful" + } + } + } + }, + "/v1/trading/r/userOrderCount":{ + "post":{ + "summary":"This method is used to retrieve user's count of filled orders.", + "operationId":"postV1TradingRUserordercount", + "parameters":[ + { + "in":"body", + "name":"body", + "schema":{ + "$ref":"#/definitions/authPayload" + } + } + ], + "tags":[ + "Trading" + ], + "responses":{ + "200":{ + "schema":{ + "$ref":"#/definitions/Model41" + }, + "description":"Successful" + } + } + } + }, + "/v1/trading/r/withdrawHistory":{ + "post":{ + "summary":"An authenticated endpoint used to retrieve a list of user's past withdrawals. This includes ready, completed, as well as cancelled withdrawals. The limit of withdrawals returned is 1000.", + "operationId":"postV1TradingRWithdrawhistory", + "parameters":[ + { + "type":"number", + "description":"Date of the last withdraw returned.", + "name":"startDate", + "in":"query", + "x-example":1747384800000 + }, + { + "type":"number", + "description":"Limit of withdraws that will be returned. With a maximum limit of 1000.", + "name":"limit", + "in":"query", + "x-example":60 + }, + { + "in":"body", + "name":"body", + "schema":{ + "$ref":"#/definitions/getPendingWithdrawalsPayload" + } + } + ], + "tags":[ + "Trading" + ], + "responses":{ + "200":{ + "schema":{ + "$ref":"#/definitions/withdrawHistoryResponse" + }, + "description":"Successful" + } + } + } + }, + "/v1/trading/w/cancelOpenOrders":{ + "post":{ + "summary":"This endpoint allows to cancel all open orders of the requestor", + "operationId":"postV1TradingWCancelopenorders", + "parameters":[ + { + "in":"body", + "name":"body", + "schema":{ + "$ref":"#/definitions/authPayload" + } + } + ], + "tags":[ + "Trading" + ], + "responses":{ + "200":{ + "schema":{ + "$ref":"#/definitions/cancelOpenOrdersResponse" + }, + "description":"Successful" + } + } + } + }, + "/v1/trading/w/cancelOrder":{ + "post":{ + "summary":"This endpoint allows to cancel a specific order.", + "operationId":"postV1TradingWCancelorder", + "parameters":[ + { + "in":"body", + "name":"body", + "schema":{ + "$ref":"#/definitions/cancelOrderPayload" + } + } + ], + "tags":[ + "Trading" + ], + "responses":{ + "200":{ + "schema":{ + "$ref":"#/definitions/cancelOrderResponse" + }, + "description":"Queues cancellation request and returns the order ID of the cancelled order." + }, + "502":{ + "description":"Unable to determine the status of order cancellation request, verify by fetching orders list" + } + } + } + }, + "/v1/trading/w/cancelWithdrawal":{ + "post":{ + "summary":"Cancel withdrawal with given id.", + "operationId":"postV1TradingWCancelwithdrawal", + "parameters":[ + { + "in":"body", + "name":"body", + "schema":{ + "$ref":"#/definitions/cancelWithdrawalPayload" + } + } + ], + "tags":[ + "Trading" + ], + "responses":{ + "200":{ + "schema":{ + "$ref":"#/definitions/withdrawHistoryObject" + }, + "description":"Successful" + } + } + } + }, + "/v1/trading/w/claimAirdrop":{ + "post":{ + "summary":"Request airdrop claim for the specified token/address", + "operationId":"postV1TradingWClaimairdrop", + "parameters":[ + { + "in":"body", + "name":"body", + "schema":{ + "$ref":"#/definitions/airdropEligibilityQuery" + } + } + ], + "tags":[ + "Trading" + ], + "responses":{ + "200":{ + "schema":{ + "$ref":"#/definitions/Model43" + }, + "description":"Successful" + } + } + } + }, + "/v1/trading/w/deposit":{ + "post":{ + "summary":"Submit a signed notification of a new deposit made.", + "operationId":"postV1TradingWDeposit", + "parameters":[ + { + "in":"body", + "name":"body", + "schema":{ + "$ref":"#/definitions/depositPayload" + } + } + ], + "tags":[ + "Trading" + ], + "responses":{ + "default":{ + "schema":{ + "$ref":"#/definitions/depositResponse" + }, + "description":"Returns the deposit notifcation." + } + } + } + }, + "/v1/trading/w/fastWithdrawal":{ + "post":{ + "summary":"Submit a request for a new fast withdrawal.", + "operationId":"postV1TradingWFastwithdrawal", + "parameters":[ + { + "in":"body", + "name":"body", + "schema":{ + "$ref":"#/definitions/fastWithdrawalPayload" + } + } + ], + "tags":[ + "Trading" + ], + "responses":{ + "200":{ + "schema":{ + "$ref":"#/definitions/Model46" + }, + "description":"Successful" + } + } + } + }, + "/v1/trading/w/feedback":{ + "post":{ + "summary":"This endpoint allows to send the email of an user.", + "operationId":"postV1TradingWFeedback", + "parameters":[ + { + "in":"body", + "name":"body", + "schema":{ + "$ref":"#/definitions/feedbackPayload" + } + } + ], + "tags":[ + "Internal" + ], + "responses":{ + "200":{ + "schema":{ + "$ref":"#/definitions/Model47" + }, + "description":"Successful" + } + } + } + }, + "/v1/trading/w/notifications":{ + "post":{ + "summary":"Creates a new notification.", + "operationId":"postV1TradingWNotifications", + "parameters":[ + { + "in":"body", + "name":"body", + "schema":{ + "$ref":"#/definitions/notificationPayload" + } + } + ], + "tags":[ + "Internal" + ], + "responses":{ + "200":{ + "schema":{ + "$ref":"#/definitions/notification" + }, + "description":"Successful" + } + } + } + }, + "/v1/trading/w/register":{ + "post":{ + "summary":"This method is used to register a Stark key that corresponds to an Ethereum public address. This will return deversifi Signature or DeversiFi application and user configuration details.", + "operationId":"postV1TradingWRegister", + "parameters":[ + { + "in":"body", + "name":"body", + "schema":{ + "$ref":"#/definitions/registerPayload" + } + } + ], + "tags":[ + "Trading" + ], + "responses":{ + "200":{ + "schema":{ + "$ref":"#/definitions/registerResponseUserRegisteredOnChain", + "x-alternatives":[ + { + "$ref":"#/x-alt-definitions/registerResponseUserRegisteredOnChain" + }, + { + "$ref":"#/x-alt-definitions/registerResponseUserNotRegisteredOnChain" + } + ] + }, + "description":"Successful" + } + } + } + }, + "/v1/trading/w/storeStarkTradingKey":{ + "post":{ + "summary":"This endpoint allows storing encrypted Stark Trading Key.", + "operationId":"postV1TradingWStorestarktradingkey", + "parameters":[ + { + "in":"body", + "name":"body", + "schema":{ + "$ref":"#/definitions/storeTradingKeyPayload" + } + } + ], + "tags":[ + "Trading" + ], + "responses":{ + "default":{ + "schema":{ + "$ref":"#/definitions/storeTradingKeyResponse" + }, + "description":"Returns flag of whether or not the key was stored successfully." + } + } + } + }, + "/v1/trading/w/submitOrder":{ + "post":{ + "summary":"This authenticated endpoint is used to submit an order.", + "operationId":"postV1TradingWSubmitorder", + "parameters":[ + { + "x-alternatives":[ + { + "$ref":"#/x-alt-definitions/submitOrderPayload" + }, + { + "$ref":"#/x-alt-definitions/Model6" + } + ], + "in":"body", + "name":"body", + "schema":{ + "$ref":"#/definitions/submitOrderPayload" + } + } + ], + "tags":[ + "Trading" + ], + "responses":{ + "200":{ + "schema":{ + "$ref":"#/definitions/submitOrderResponse", + "x-alternatives":[ + { + "$ref":"#/x-alt-definitions/submitOrderResponse" + }, + { + "$ref":"#/x-alt-definitions/Model7" + } + ] + }, + "description":"Successful" + }, + "202":{ + "description":"One or more orders of a batch of orders did not succeed" + }, + "502":{ + "description":"Unable to determine the status of order submission request, verify by fetching orders list" + } + } + } + }, + "/v1/trading/w/transfer":{ + "post":{ + "summary":"Submit a request for internal transfer (NOTE: currently not available to wider public).", + "operationId":"postV1TradingWTransfer", + "parameters":[ + { + "in":"body", + "name":"body", + "schema":{ + "$ref":"#/definitions/transferPayload" + } + } + ], + "tags":[ + "Trading" + ], + "responses":{ + "200":{ + "schema":{ + "$ref":"#/definitions/transferResponseObject" + }, + "description":"Successful" + } + } + } + }, + "/v1/trading/w/withdraw":{ + "post":{ + "summary":"Submit a request for a new withdrawal.", + "operationId":"postV1TradingWWithdraw", + "parameters":[ + { + "in":"body", + "name":"body", + "schema":{ + "$ref":"#/definitions/withdrawalPayload" + } + } + ], + "tags":[ + "Trading" + ], + "responses":{ + "default":{ + "schema":{ + "type":"string" + }, + "description":"Successful" + } + } + } + }, + "/v1/trading/r/getBalanceForUser/{userEthAddress}":{ + "post":{ + "summary":"This is used to retrieve the total and active balances of a user per token. Active balance is the balance that is currently available. Total balance (specified as balance) is the sum of all the balances including those locked for trading.", + "operationId":"postV1TradingRGetbalanceforuserUserethaddress", + "parameters":[ + { + "type":"string", + "description":"The ETH address of a potential user", + "name":"userEthAddress", + "in":"path", + "x-example":"0x3f2b822e9a8312c6dafbf9686a5e335af0e4d33b", + "required":true + }, + { + "in":"body", + "name":"body", + "schema":{ + "$ref":"#/definitions/Model54" + } + } + ], + "tags":[ + "Trading", + "public" + ], + "responses":{ + "200":{ + "schema":{ + "$ref":"#/definitions/getBalanceResponse" + }, + "description":"Successful" + }, + "401":{ + "description":"User has not authorized the use of this endpoint for their address" + } + } + } + }, + "/v1/trading/w/notifications/{id}":{ + "delete":{ + "summary":"Deletes a notification.", + "operationId":"deleteV1TradingWNotificationsId", + "parameters":[ + { + "type":"string", + "name":"id", + "in":"path", + "required":true + } + ], + "tags":[ + "Internal" + ], + "responses":{ + "200":{ + "schema":{ + "$ref":"#/definitions/notification" + }, + "description":"Successful" + } + } + } + } +}, +"definitions":{ + "getAllowanceResponse":{ + "type":"object", + "properties":{ + "allowance":{ + "type":"string", + "example":"ALLOWED", + "enum":[ + "ALLOWED", + "DENIED", + "KYC_REQUIRED" + ] + }, + "reason":{ + "type":"string", + "example":"NO_POLICY" + } + } + }, + "ETH":{ + "type":"object", + "properties":{ + "token":{ + "type":"string", + "description":"Token symbol", + "example":"ETH" + }, + "balance":{ + "type":"string", + "description":"Quantised token balance", + "example":"10" + }, + "usdBalance":{ + "type":"string", + "description":"USD equivalent of token balance", + "example":"20" + } + } + }, + "Model1":{ + "type":"object", + "properties":{ + "time":{ + "type":"string", + "format":"date", + "description":"DateTime of the aggregation", + "example":"2021-07-14T11:28:45.828Z" + }, + "onChainTotalUsd":{ + "type":"string", + "description":"total USD equivalent of the on-chain assets", + "example":"20" + }, + "exchangeTotalUsd":{ + "type":"string", + "description":"total USD equivalent of the exchange assets", + "example":"20" + }, + "totalUsd":{ + "type":"string", + "description":"total USD equivalent of both on-chain and exchange assets", + "example":"40" + }, + "onChainBalances":{ + "type":"object", + "description":"Map of on-chain token balances", + "name":"tokenBalanceSchema", + "properties":{ + "ETH":{ + "$ref":"#/definitions/ETH" + } + } + }, + "exchangeBalances":{ + "type":"object", + "description":"Map of exchange token balances", + "name":"tokenBalanceSchema", + "properties":{ + "ETH":{ + "$ref":"#/definitions/ETH" + } + } + } + } + }, + "balanceHistorySchema":{ + "type":"array", + "items":{ + "$ref":"#/definitions/Model1" + } + }, + "collateralBalancesSchema":{ + "type":"object" + }, + "pagination":{ + "type":"object", + "properties":{ + "totalItems":{ + "type":"number", + "description":"Total number of items matching the query", + "example":1559, + "minimum":0 + }, + "limit":{ + "type":"number", + "description":"Limit applied on returned items", + "example":5 + }, + "skip":{ + "type":"number", + "description":"Skip applied on returned items", + "example":2 + } + } + }, + "Model2":{ + "type":"object", + "properties":{ + "_id":{ + "type":"string", + "description":"Unique identifier representing the deposit or withdrawal", + "example":"606f207fc7aa2e91d028a17a" + }, + "type":{ + "type":"string", + "description":"Whether the transaction is a deposit, a classic withdrawal or a fast withdrawal", + "example":"Deposit", + "enum":[ + "Deposit", + "Withdrawal", + "FastWithdrawal" + ] + }, + "token":{ + "type":"string", + "description":"Token deposited or withdrawn", + "example":"ZRX" + }, + "amount":{ + "type":"number", + "description":"Amount deposited or withdrawn", + "example":1 + }, + "transactionHash":{ + "type":"string", + "description":"Hash of the Ethereum transaction leading to L1 balance debit or credit", + "example":"0xb5c8bd9430b6cc87a0e2fe110ece6bf527fa4f170a4bc8cd032f768fc5219838" + }, + "date":{ + "type":"string", + "format":"date", + "description":"Date and time deposit or withdrawal", + "example":"2020-11-11T16:37:05.957" + }, + "sourceOrRecipient":{ + "type":"string", + "description":"Originator of the deposit or recipient of the withdrawal", + "example":"0x148426fdc4c8a51b96b4bed827907b5fa6491ad0" + }, + "gateway":{ + "type":"string", + "description":"Set when operation used a gateway. Corresponds to a chain identifier", + "example":"MATIC_POS" + } + } + }, + "items":{ + "type":"array", + "items":{ + "$ref":"#/definitions/Model2" + } + }, + "getDepositsAndWithdrawalsResponse":{ + "type":"object", + "properties":{ + "pagination":{ + "$ref":"#/definitions/pagination" + }, + "items":{ + "$ref":"#/definitions/items" + } + } + }, + "addresses":{ + "type":"array", + "example":[ + "0x5317c63f870e8d2f85f0de3c2666d1414f5a728c", + "0x08152c1265dbc218ccc8ab5c574e6bd52279b3b7" + ], + "items":{ + "type":"string" + } + }, + "Model3":{ + "type":"object", + "properties":{ + "addresses":{ + "$ref":"#/definitions/addresses" + }, + "kycStatus":{ + "type":"string", + "example":"PASS", + "enum":[ + "PENDING", + "PASS", + "FAILED", + "EXPIRED" + ] + } + } + }, + "Model4":{ + "type":"object", + "properties":{ + "fillId":{ + "type":"string", + "description":"Unique identifier representing the fill event", + "example":"606f207fc7aa2e91d028a17a" + }, + "orderId":{ + "type":"string", + "description":"Unique identifier of the order associated with the fill", + "example":"BtHEvgY1Bz1" + }, + "symbol":{ + "type":"string", + "description":"Symbol for the order associated with the fill", + "example":"ETH:USDT" + }, + "price":{ + "type":"number", + "description":"Execution price of the fill", + "example":209.9 + }, + "fillAmount":{ + "type":"number", + "description":"Amount filled (negative amount for a sell event, positive for a buy event)", + "example":-0.125622 + }, + "orderAmount":{ + "type":"number", + "description":"Initial amount for the placed order associated with the fill", + "example":-1 + }, + "date":{ + "type":"string", + "format":"date", + "description":"Date and time of the fill event", + "example":"2020-11-11T16:37:05.957" + }, + "orderCreationDate":{ + "type":"string", + "format":"date", + "description":"Date and time at which the order associated with the fill event was placed", + "example":"2020-11-11T16:37:05.262Z" + }, + "orderType":{ + "type":"string", + "description":"Type of the order associated with the fill event", + "example":true, + "enum":[ + "EXCHANGE LIMIT", + "EXCHANGE MARKET" + ] + }, + "orderActive":{ + "type":"boolean", + "description":"Whether the order associated with the fill event is still active", + "example":true + }, + "orderCanceled":{ + "type":"boolean", + "description":"Whether the order associated with the fill event was canceled", + "example":false + } + } + }, + "Model5":{ + "type":"array", + "items":{ + "$ref":"#/definitions/Model4" + } + }, + "getFillsResponse":{ + "type":"object", + "properties":{ + "pagination":{ + "$ref":"#/definitions/pagination" + }, + "items":{ + "$ref":"#/definitions/Model5" + } + } + }, + "Model6":{ + "type":"object", + "properties":{ + "_id":{ + "type":"string", + "description":"Unique identifier representing this transfer", + "example":"MphMkBBZjnS" + }, + "token":{ + "type":"string", + "description":"Token transfered", + "example":"ETH" + }, + "amount":{ + "type":"number", + "description":"Amount transfered (effective amount received by the recipient)", + "example":3.14, + "minimum":0 + }, + "feeAmount":{ + "type":"number", + "description":"Transfer fee amount (in transfer token units)", + "example":3.14, + "minimum":0 + }, + "source":{ + "type":"string", + "description":"Source Ethereum address", + "example":"0x08152c1265dBc218ccc8Ab5C574e6bD52279b3B7" + }, + "recipient":{ + "type":"string", + "description":"Recipient Ethereum address", + "example":"0xeb3ea3ea9239577951523cafa9fd3072bc88e50a" + }, + "memo":{ + "type":"string", + "description":"Transfer memo", + "example":"my reference" + }, + "date":{ + "type":"string", + "format":"date", + "description":"Date and time of the transfer", + "example":"1990-04-14T00:20:00.000Z" + } + } + }, + "Model7":{ + "type":"array", + "items":{ + "$ref":"#/definitions/Model6" + } + }, + "getTransfersResponse":{ + "type":"object", + "properties":{ + "pagination":{ + "$ref":"#/definitions/pagination" + }, + "items":{ + "$ref":"#/definitions/Model7" + } + } + }, + "starkOrder":{ + "type":"object", + "description":"Stark Limit Order Data.", + "example":{ + "vaultIdSell":1000002, + "vaultIdBuy":1000001, + "amountSell":"97400000", + "amountBuy":"100000000000000000", + "tokenSell":"0x2", + "tokenBuy":"0x1" + }, + "properties":{ + "vaultIdSell":{ + "type":"integer", + "description":"The vault ID of the seller.", + "minimum":0 + }, + "vaultIdBuy":{ + "type":"integer", + "description":"The vault ID of the buyer.", + "minimum":0 + }, + "amountSell":{ + "type":"string", + "description":"The total amount to be sold." + }, + "amountBuy":{ + "type":"string", + "description":"The total amount to be bought." + }, + "tokenSell":{ + "type":"string", + "description":"The Stark token ID for the token being sold." + }, + "tokenBuy":{ + "type":"string", + "description":"The Stark token ID for the token being bought." + } + } + }, + "Model8":{ + "type":"object", + "properties":{ + "amountBuy":{ + "type":"string" + }, + "amountSell":{ + "type":"string" + }, + "tokenBuy":{ + "type":"string" + }, + "tokenSell":{ + "type":"string" + }, + "starkOrder":{ + "$ref":"#/definitions/starkOrder" + } + } + }, + "orders":{ + "type":"array", + "x-constraint":{ + "length":2 + }, + "items":{ + "$ref":"#/definitions/Model8" + } + }, + "AmmFundingOrderDataGetResponse":{ + "type":"object", + "example":{ + "pool":"ETHUSDT", + "orders":[ + { + "tokenBuy":"LP-ETHUSDT", + "amountBuy":"50", + "tokenSell":"ETH", + "amountSell":"2", + "starkOrder":{ + "tokenBuy":"0x11af21d6b234cd669edd702dd3d1d017be888337010b950ae3679eb4194b4bc", + "amountBuy":"5000000000", + "vaultIdBuy":247827906, + "tokenSell":"0xb333e3142fe16b78628f19bb15afddaef437e72d6d7f5c6c20c6801a27fba6", + "amountSell":"200000000", + "vaultIdSell":2121602419 + } + }, + { + "tokenBuy":"LP-ETHUSDT", + "amountBuy":"50", + "tokenSell":"USDT", + "amountSell":"1230", + "starkOrder":{ + "tokenBuy":"0x11af21d6b234cd669edd702dd3d1d017be888337010b950ae3679eb4194b4bc", + "amountBuy":"5000000000", + "vaultIdBuy":247827906, + "tokenSell":"0xb333e3142fe16b78628f19bb15afddaef437e72d6d7f5c6c20c6801a27fba6", + "amountSell":"200000000", + "vaultIdSell":2121602419 + } + } + ] + }, + "properties":{ + "pool":{ + "type":"string" + }, + "orders":{ + "$ref":"#/definitions/orders" + } + } + }, + "string":{ + "type":"object", + "properties":{ + "tokenAmount":{ + "type":"number", + "example":0.1 + }, + "USDVolume":{ + "type":"number", + "example":1.1 + } + }, + "required":[ + "tokenAmount", + "USDVolume" + ] + }, + "30DaysVolumeResponse":{ + "type":"object", + "properties":{ + "totalUSDVolume":{ + "type":"number", + "description":"The total trade volume in terms of USD.", + "example":73364.1749445 + }, + "tokens":{ + "type":"object", + "description":"Volumes for individual tokens.", + "name":"tokens", + "properties":{ + "string":{ + "$ref":"#/definitions/string" + } + } + }, + "startDate":{ + "type":"string", + "format":"date", + "description":"The start date and time for the volume presented.", + "example":"2020-01-01T00:00:00.714Z" + }, + "endDate":{ + "type":"string", + "format":"date", + "description":"The end date and time for the volume presented.", + "example":"2020-01-01T00:00:00.714Z" + } + }, + "required":[ + "totalUSDVolume" + ] + }, + "USDRankingResponse":{ + "type":"object", + "properties":{ + "address":{ + "type":"string", + "description":"The address of the trader.", + "example":"0xfc898b18a70ce49579f8d79a32e29928c15b4bc8" + }, + "USDValue":{ + "type":"number", + "description":"The trading volume for the address quoted in USD.", + "example":119128.566703 + } + } + }, + "User24HoursVolumeResponse":{ + "type":"object", + "properties":{ + "totalUSDVolume":{ + "type":"number", + "description":"The total trade volume in terms of USD.", + "example":3320.75 + }, + "tokens":{ + "type":"object", + "description":"Volumes for individual tokens.", + "name":"tokens", + "properties":{ + "string":{ + "$ref":"#/definitions/string" + } + } + } + }, + "required":[ + "totalUSDVolume" + ] + }, + "Model9":{ + "type":"object", + "properties":{ + "totalUSDVolume":{ + "type":"number", + "description":"The total trade volume in terms of USD.", + "example":3320.75 + }, + "tokens":{ + "$ref":"#/definitions/collateralBalancesSchema" + } + } + }, + "Model10":{ + "type":"object", + "properties":{ + "user":{ + "type":"string", + "description":"Ethereum address", + "example":"0x3f2b822E9A8312C6DafBF9686a5e335Af0E4D33B" + }, + "token":{ + "type":"string", + "description":"token for the airdrop", + "example":"DVF" + }, + "amount":{ + "type":"number", + "description":"DVF airdrop eligible amount", + "example":"15.52" + }, + "requested":{ + "type":"boolean", + "description":"Has this claim been already requested", + "example":"false" + } + } + }, + "claims":{ + "type":"array", + "items":{ + "$ref":"#/definitions/Model10" + } + }, + "Model11":{ + "type":"object", + "properties":{ + "claims":{ + "$ref":"#/definitions/claims" + }, + "isRegistered":{ + "type":"boolean", + "description":"is the eth address registered", + "example":true + } + } + }, + "beehiveStatsResponse":{ + "type":"object", + "properties":{ + "pool_identifier":{ + "type":"string", + "description":"Returns the pool identifier.", + "example":"NEC/wETH" + }, + "liquidity_locked":{ + "type":"number", + "description":"The total liquidity in terms of USD.", + "example":28751428.1231 + }, + "apy":{ + "type":"number", + "description":"The APY.", + "example":404.47648991003564 + } + }, + "required":[ + "pool_identifier", + "liquidity_locked", + "apy" + ] + }, + "Model12":{ + "type":"object", + "properties":{ + "pool_identifier":{ + "type":"string", + "description":"Returns the pool identifier.", + "example":"NEC/wETH" + }, + "liquidity_locked":{ + "type":"number", + "description":"The total liquidity in terms of USD.", + "example":28751428.1231 + }, + "apy":{ + "type":"number", + "description":"The APY.", + "example":404.47648991003564 + } + } + }, + "estimatedNextBatchResponse":{ + "type":"object", + "properties":{ + "estimatedTime":{ + "type":"number", + "description":"The number of seconds until the batch is sent to be processed and broadcast to the blockchain.", + "example":608 + }, + "averageTime":{ + "type":"number", + "description":"The configured number of seconds between batches.", + "example":608 + }, + "finalisedBatchPendingConfirmation":{ + "type":"boolean", + "description":"True if the previous batch has been created but still pending confirmation on the blockchain.", + "example":true + } + } + }, + "Model13":{ + "type":"object", + "properties":{ + "feeQuantised":{ + "type":"string", + "description":"Fast withdrawal fee as quantised amount of token to be withdrawn.", + "example":"1224000", + "pattern":"^[0-9]*$" + }, + "feeBaseUnits":{ + "type":"string", + "description":"Fast withdrawal fee as base units of token to be withdrawn.", + "example":"0.01224", + "pattern":"^[+-]?((\\d+(\\.\\d*)?)|(\\.\\d+))$" + } + } + }, + "Model14":{ + "type":"object", + "properties":{ + "maxAmountQuantised":{ + "type":"string", + "description":"Max amount as quantised amount of token to be withdrawn.", + "example":"1224000", + "pattern":"^[0-9]*$" + }, + "maxAmountBaseUnits":{ + "type":"string", + "description":"Max amount as base units of token to be withdrawn.", + "example":"0.01224", + "pattern":"^[+-]?((\\d+(\\.\\d*)?)|(\\.\\d+))$" + } + } + }, + "fees":{ + "type":"object", + "properties":{ + "maker":{ + "type":"number", + "description":"The fee basis points for maker orders (adding bids or offers to the order book).", + "example":15 + }, + "taker":{ + "type":"number", + "description":"The fee basis points for taker orders (removing liquidity from the order book).", + "example":20 + } + } + }, + "getFeeRateResponse":{ + "type":"object", + "properties":{ + "address":{ + "type":"string", + "description":"The Ethereum address of the user verified by nonce and signature.", + "example":"0x116f494a2ce567067f319fea1c9f294f23d2fe68" + }, + "timestamp":{ + "type":"number", + "description":"Timestamp in milliseconds since epoch.", + "example":1590263332427 + }, + "fees":{ + "$ref":"#/definitions/fees" + } + } + }, + "gasSavingsResponse":{ + "type":"object", + "properties":{ + "totalUSD":{ + "type":"number", + "description":"Total gas savings in USD", + "example":7123000 + }, + "monthUSD":{ + "type":"number", + "description":"Gas savings within last 30 days", + "example":421000 + }, + "weekUSD":{ + "type":"number", + "description":"Gas savings within last 7 days", + "example":421000 + }, + "changePerSecondUSD":{ + "type":"number", + "description":"Rate at which gas savings increase per second", + "example":0.0312 + } + } + }, + "getBalanceUsdResponse":{ + "type":"object", + "properties":{ + "ethAddress":{ + "type":"string", + "description":"The ethereum public address of the user.", + "example":"0x14d06788090769f669427b6aea1c0240d2321f34" + }, + "balanceUsd":{ + "type":"number", + "description":"It is the sum of all user balances converted to USD.", + "example":"2" + } + } + }, + "getGasPriceResponse":{ + "type":"object", + "description":"Range of gas prices for on chain confirmation speed", + "example":{ + "fast":"70000000000", + "fastWait":0.5, + "average":"67000000000", + "averageWait":1.4, + "cheap":"66000000000", + "cheapWait":10.5 + }, + "properties":{ + "fast":{ + "type":"string", + "description":"Gas price in Wei for quickest onchain transaction confirmation.", + "pattern":"^[0-9]*$" + }, + "average":{ + "type":"string", + "description":"Average gas price in Wei for average onchain transaction speed.", + "pattern":"^[0-9]*$" + }, + "cheap":{ + "type":"string", + "description":"Low gas price in Wei and very slow transaction speed.", + "pattern":"^[0-9]*$" + }, + "fastWait":{ + "type":"number", + "description":"The approximate time for a transaction confirmation when using fast as the gas price." + }, + "averageWait":{ + "type":"number", + "description":"The approximate time for a transaction confirmation when using average as the gas price." + }, + "cheapWait":{ + "type":"number", + "description":"The approximate time for a transaction confirmation when using cheap as the gas price." + } + } + }, + "BALANCES":{ + "type":"object", + "example":{ + "key":"balances", + "description":"User's exchange balances" + }, + "properties":{ + "key":{ + "type":"string", + "description":"Permission key" + }, + "description":{ + "type":"string", + "description":"description of the permission" + } + } + }, + "TRADING_HISTORY":{ + "type":"object", + "example":{ + "key":"tradingHistory", + "description":"User's trading history" + }, + "properties":{ + "key":{ + "type":"string", + "description":"Permission key" + }, + "description":{ + "type":"string", + "description":"description of the permission" + } + } + }, + "Model15":{ + "type":"object", + "properties":{ + "BALANCES":{ + "$ref":"#/definitions/BALANCES" + }, + "TRADING_HISTORY":{ + "$ref":"#/definitions/TRADING_HISTORY" + } + } + }, + "Model16":{ + "type":"object", + "properties":{ + "liquidityAvailable":{ + "type":"number", + "description":"Remaining liquidity", + "example":10 + }, + "totalSupply":{ + "type":"number", + "description":"Total supply", + "example":1000 + } + } + }, + "tokenSaleStartEndResponse":{ + "type":"object", + "properties":{ + "start":{ + "type":"number", + "description":"Token sale start timestamp", + "example":1625036000 + }, + "end":{ + "type":"number", + "description":"Token sale end timestamp", + "example":1625076000 + }, + "startPrice":{ + "type":"number", + "description":"Token sale start price", + "example":1.5 + } + } + }, + "last24HoursVolumeResponse":{ + "type":"object", + "properties":{ + "TotalUSDValue":{ + "type":"number", + "description":"The total trade volume in terms of USD.", + "example":28751428.1231 + }, + "tokens":{ + "$ref":"#/definitions/collateralBalancesSchema" + }, + "symbols":{ + "$ref":"#/definitions/collateralBalancesSchema" + }, + "startDate":{ + "type":"string", + "description":"The start date and time for the volume presented.", + "example":"2020-05-22T03:11:29.014Z" + } + } + }, + "registeredAccountsResponse":{ + "type":"object", + "properties":{ + "accounts":{ + "type":"number", + "description":"Total registered accounts", + "example":421 + } + } + }, + "Model17":{ + "type":"object", + "properties":{ + "volume":{ + "type":"number", + "description":"token swap volume.", + "example":4328 + } + } + }, + "Model18":{ + "type":"object", + "properties":{ + "address":{ + "type":"string", + "description":"Ethereum address", + "example":"0xc0e9bd267626e2393ddaf520ae5df27ef6c533bd" + }, + "score":{ + "type":"number", + "description":"balance for this address/token at block number", + "example":1000000000 + } + } + }, + "score":{ + "type":"array", + "items":{ + "$ref":"#/definitions/Model18" + } + }, + "Model19":{ + "type":"object", + "properties":{ + "score":{ + "$ref":"#/definitions/score" + } + } + }, + "tokenRankingResponse":{ + "type":"object", + "properties":{ + "address":{ + "type":"string", + "description":"The address of the trader.", + "example":"0xfc898b18a70ce49579f8d79a32e29928c15b4bc8" + }, + "amount":{ + "type":"number", + "description":"The trading volume for the address", + "example":852.9290936325145 + } + } + }, + "totalValueLockedResponseItem":{ + "type":"object", + "properties":{ + "date":{ + "type":"string", + "format":"date", + "description":"Date on which `value` represents TVL", + "example":"2021-08-12T16:57:12.869Z" + }, + "value":{ + "type":"number", + "description":"Total value locked for a particular date", + "example":421000 + } + } + }, + "totalValueLockedResponse":{ + "type":"array", + "items":{ + "$ref":"#/definitions/totalValueLockedResponseItem" + } + }, + "Model20":{ + "type":"object", + "properties":{ + "count":{ + "type":"number", + "description":"Trades executed within time.", + "example":11206 + } + } + }, + "Model21":{ + "type":"object", + "properties":{ + "volume":{ + "type":"number", + "description":"token transfer volume.", + "example":3443 + } + } + }, + "vaultIdAndStarkKeyResponse":{ + "type":"object", + "properties":{ + "vaultId":{ + "type":"number", + "description":"The vault ID corresponding to the user registered with and token", + "example":1644016910 + }, + "starkKey":{ + "type":"string", + "description":"The public stark key for the user registered with ", + "example":"0x0180fc633b754b50370614a587218cf36a4fa7c2f11d65ec761dded48a81ab9e", + "pattern":"^0x[a-f0-9]+$" + } + } + }, + "votingPowerResponse":{ + "type":"object", + "properties":{ + "totalSupply":{ + "type":"string", + "description":"Total xDVF balance of users on exchange", + "example":"321000000" + }, + "votingPower":{ + "type":"number", + "description":"Percentage of amount compared to total balance", + "example":13.37 + } + } + }, + "Model22":{ + "type":"object", + "properties":{ + "isRegisteredOnDeversifi":{ + "type":"boolean", + "description":"Whether the user is registered on DeversiFi servers.", + "example":true, + "enum":[ + true, + false + ] + }, + "isRegisteredOnChain":{ + "type":"boolean", + "description":"Whether the user is registered with Starkware.", + "example":true, + "enum":[ + true, + false + ] + }, + "ethAddress":{ + "type":"string", + "description":"Ethereum address.", + "example":"0x3f2b822E9A8312C6DafBF9686a5e335Af0E4D33B" + } + }, + "required":[ + "isRegisteredOnDeversifi", + "isRegisteredOnChain", + "ethAddress" + ] + }, + "Model23":{ + "type":"object", + "properties":{ + "fillAmount":{ + "type":"number", + "description":"amount filled" + }, + "user":{ + "type":"string", + "description":"User ETH address" + }, + "date":{ + "type":"string", + "format":"date", + "description":"Date of the settlement" + }, + "tokenBuy":{ + "type":"string", + "description":"Buy token" + }, + "tokenSell":{ + "type":"string", + "description":"Sell token" + }, + "amountBuy":{ + "type":"string", + "description":"Amount of buy order" + }, + "amountSell":{ + "type":"string", + "description":"Amount of sell order" + }, + "orderId":{ + "type":"string", + "description":"Id of the order" + }, + "feeCurrency":{ + "type":"string", + "description":"Currency of the fee" + }, + "feeAmount":{ + "type":"string", + "description":"Amount of fee" + } + } + }, + "Model24":{ + "type":"array", + "items":{ + "$ref":"#/definitions/Model23" + } + }, + "Model25":{ + "type":"object", + "properties":{ + "items":{ + "$ref":"#/definitions/Model24" + } + } + }, + "tradesObject":{ + "type":"object", + "properties":{ + "trade_id":{ + "type":"number", + "description":"A unique ID associated with the trade for the currency pair transaction", + "example":1 + }, + "price":{ + "type":"number", + "description":"Last transacted price of base currency based on given quote currency.", + "example":275.23 + }, + "base_volume":{ + "type":"number", + "description":"Transaction amount in BASE currency.", + "example":1.5 + }, + "quote_volume":{ + "type":"number", + "description":"Transaction amount in QUOTE currency.", + "example":347.81 + }, + "timestamp":{ + "type":"number", + "description":"Unix timestamp in milliseconds for when the transaction occurred.", + "example":1747384800000 + }, + "type":{ + "type":"string", + "description":"Used to determine whether or not the transaction originated as a buy or sell.", + "example":"buy" + } + } + }, + "tradesResponse":{ + "type":"array", + "items":{ + "$ref":"#/definitions/tradesObject" + } + }, + "24HoursVolumeResponse":{ + "type":"object", + "example":{ + "totalUSDVolume":0, + "tokens":{ + "ETH":{ + "tokenAmount":0, + "USDVolume":0 + }, + "USDT":{ + "tokenAmount":0, + "USDVolume":0 + } + }, + "symbols":{ + "ETH:USDT":{ + "tokenAmount":0, + "USDVolume":0 + } + }, + "startDate":"2020-01-01T00:00:00.183Z", + "endDate":"2020-01-02T00:00:00.183Z" + }, + "properties":{ + "totalUSDVolume":{ + "type":"number", + "description":"The total trade volume in terms of USD.", + "example":3320.75 + }, + "tokens":{ + "$ref":"#/definitions/collateralBalancesSchema" + }, + "symbols":{ + "$ref":"#/definitions/collateralBalancesSchema" + }, + "startDate":{ + "type":"string", + "description":"The start date and time for the volume presented.", + "example":"2020-01-01T00:00:00.714Z" + }, + "endDate":{ + "type":"string", + "description":"The end date and time for the volume presented.", + "example":"2020-01-01T00:00:00.714Z" + } + } + }, + "Model26":{ + "type":"object", + "properties":{ + "trade_id":{ + "type":"number", + "description":"A unique ID associated with the trade for the currency pair transaction", + "example":1 + }, + "price":{ + "type":"number", + "description":"Last transacted price of base currency based on given quote currency.", + "example":275.23 + }, + "base_volume":{ + "type":"number", + "description":"Transaction amount in BASE currency.", + "example":1.5 + }, + "quote_volume":{ + "type":"number", + "description":"Transaction amount in QUOTE currency.", + "example":347.81 + }, + "timestamp":{ + "type":"number", + "description":"Unix timestamp in milliseconds for when the transaction occurred.", + "example":1548028800 + }, + "type":{ + "type":"string", + "description":"Used to determine whether or not the transaction originated as a buy or sell.", + "example":"buy" + } + } + }, + "Model27":{ + "type":"array", + "items":{ + "$ref":"#/definitions/Model26" + } + }, + "bridgedDepositsPostPayload":{ + "type":"object", + "properties":{ + "token":{ + "type":"string", + "example":"ETH" + }, + "amount":{ + "type":"string", + "description":"quantised amount of the token to be undefined", + "example":"10000000" + }, + "txHash":{ + "type":"string", + "description":"Transaction Hash of the corresponding Ethereum transaction", + "example":"0xeef10fc5170f669b86c4cd0444882a96087221325f8bf2f55d6188633aa7be7c", + "pattern":"^0x[a-f0-9]+$", + "x-constraint":{ + "length":66 + } + }, + "chain":{ + "type":"string", + "example":"MATIC_POS", + "enum":[ + "MATIC_POS" + ] + } + } + }, + "bridgedDepositsPostResponse":{ + "type":"object", + "properties":{ + "_id":{ + "type":"string", + "example":"FEHn8HYEQQw" + }, + "createdAt":{ + "type":"string", + "format":"date", + "description":"The date (ISO 8601) at which bridgedDeposit was created.", + "example":"2020-05-13T14:11:02.205Z" + }, + "updatedAt":{ + "type":"string", + "format":"date", + "description":"The date (ISO 8601) at which bridgedDeposit was last updated.", + "example":"2020-05-13T14:13:10.403Z" + }, + "token":{ + "type":"string", + "example":"ETH" + }, + "amount":{ + "type":"string", + "description":"quantised amount of the token to be undefined", + "example":"10000000" + }, + "pending":{ + "type":"boolean", + "example":true + }, + "expiresAt":{ + "type":"string", + "format":"date", + "example":"2021-08-12T17:02:15.857Z" + }, + "txHash":{ + "type":"string", + "description":"Transaction Hash of the corresponding Ethereum transaction", + "example":"0xeef10fc5170f669b86c4cd0444882a96087221325f8bf2f55d6188633aa7be7c", + "pattern":"^0x[a-f0-9]+$", + "x-constraint":{ + "length":66 + } + }, + "chain":{ + "type":"string", + "example":"MATIC_POS", + "enum":[ + "MATIC_POS" + ] + } + } + }, + "signature":{ + "type":"object", + "properties":{ + "r":{ + "type":"string", + "pattern":"^0x[a-f0-9]+$" + }, + "s":{ + "type":"string", + "pattern":"^0x[a-f0-9]+$" + } + } + }, + "tx":{ + "type":"object", + "description":"StarkWare TansferRequest from the user to DeversiFi", + "example":{ + "amount":"10000000", + "expirationTimestamp":446134, + "nonce":976614084, + "receiverPublicKey":"0x077a3b314db07c45076d11f62b6f9e748a39790441823307743cf00d6597ea43", + "receiverVaultId":1863686755, + "senderPublicKey":"0x044926648f4b6f002dfa389c536129ae178f34d9be452724268cc48ebea2b37c", + "senderVaultId":2010760265, + "token":"0x180bef8ae3462e919489763b84dc1dc700c45a249dec4d1136814a639f2dd7b", + "type":"TransferRequest", + "signature":{ + "r":"0x2857ca21310ab87bb7c37ebad0e7166f1fb46e43cf32d6587a31e148d44b677", + "s":"0x45e939717a6de4ad5e79993d918bb40e629760da7a04062e965394d1d14106a" + } + }, + "properties":{ + "type":{ + "type":"string", + "enum":[ + "TransferRequest" + ] + }, + "amount":{ + "type":"string", + "pattern":"^[0-9]*$" + }, + "expirationTimestamp":{ + "type":"integer", + "minimum":0 + }, + "nonce":{ + "type":"integer", + "minimum":0 + }, + "receiverPublicKey":{ + "type":"string", + "pattern":"^0x[a-f0-9]+$" + }, + "receiverVaultId":{ + "type":"integer" + }, + "senderPublicKey":{ + "type":"string", + "pattern":"^0x[a-f0-9]+$" + }, + "senderVaultId":{ + "type":"integer" + }, + "signature":{ + "$ref":"#/definitions/signature" + }, + "token":{ + "type":"string", + "pattern":"^0x[a-f0-9]+$" + } + } + }, + "bridgedWithdrawalsPostPayload":{ + "type":"object", + "properties":{ + "token":{ + "type":"string", + "example":"ETH" + }, + "amount":{ + "type":"string", + "description":"quantised amount of the token to be undefined", + "example":"10000000" + }, + "nonce":{ + "type":"integer", + "description":"Used to prevent creation of duplicate withdrawal if the request is retried with the same payload. withdrawal are be uniquely identified by a combination of user, token, amount and nonce.", + "example":976614084, + "minimum":0 + }, + "chain":{ + "type":"string", + "example":"MATIC_POS", + "enum":[ + "MATIC_POS" + ] + }, + "tx":{ + "$ref":"#/definitions/tx" + } + } + }, + "onChain":{ + "type":"object", + "properties":{ + "amount":{ + "type":"string", + "description":"Amount which recipient will receive on chain.", + "example":"1000", + "pattern":"^[0-9]*$" + }, + "submittedAt":{ + "type":"string", + "format":"date", + "description":"Date at which withdrawal has been sent on chain.", + "example":"2020-01-29T14:13:05.898Z" + } + } + }, + "fastWithdrawalData":{ + "type":"object", + "properties":{ + "transactionFee":{ + "type":"string", + "description":"fee to paid by the user in the currency of the transaction (quantised units).", + "example":"1", + "pattern":"^[0-9]*$" + }, + "recipientEthAddress":{ + "type":"string", + "description":"Ethereum address of recipient who will receive funds on chain.", + "example":"0x948cd3ad67c5f21412bfcd07a7981322f9fa01f0" + }, + "onChain":{ + "$ref":"#/definitions/onChain" + } + } + }, + "bridgedWithdrawalsPostResponse":{ + "type":"object", + "properties":{ + "_id":{ + "type":"string", + "example":"FEHn8HYEQQw" + }, + "createdAt":{ + "type":"string", + "format":"date", + "description":"The date (ISO 8601) at which bridgedWithdrawal was created.", + "example":"2020-05-13T14:11:02.205Z" + }, + "updatedAt":{ + "type":"string", + "format":"date", + "description":"The date (ISO 8601) at which bridgedWithdrawal was last updated.", + "example":"2020-05-13T14:13:10.403Z" + }, + "token":{ + "type":"string", + "example":"ETH" + }, + "amount":{ + "type":"string", + "description":"quantised amount of the token to be undefined", + "example":"10000000" + }, + "readyToWithdrawOnChain":{ + "type":"boolean", + "example":true + }, + "nonce":{ + "type":"integer", + "description":"Used to prevent creation of duplicate withdrawal if the request is retried with the same payload. withdrawal are be uniquely identified by a combination of user, token, amount and nonce.", + "example":976614084, + "minimum":0 + }, + "fastWithdrawalData":{ + "$ref":"#/definitions/fastWithdrawalData" + }, + "chain":{ + "type":"string", + "example":"MATIC_POS", + "enum":[ + "MATIC_POS" + ] + } + } + }, + "depositsPostPayload":{ + "type":"object", + "properties":{ + "token":{ + "type":"string", + "example":"ETH" + }, + "amount":{ + "type":"string", + "description":"quantised amount of the token to be deposited", + "example":"10000000" + }, + "txHash":{ + "type":"string", + "description":"Transaction Hash of the corresponding Ethereum transaction", + "example":"0xeef10fc5170f669b86c4cd0444882a96087221325f8bf2f55d6188633aa7be7c", + "pattern":"^0x[a-f0-9]+$", + "x-constraint":{ + "length":66 + } + } + } + }, + "Model28":{ + "type":"object", + "description":"Parameters of the Stark transaction created by this request.", + "properties":{ + "starkKey":{ + "type":"string", + "description":"Stark key of the owner of the destination vault", + "example":"0x1a2b3c", + "pattern":"^0x[a-f0-9]+$" + }, + "tokenId":{ + "type":"string", + "description":"Stark token id corresponding to the token being deposited.", + "example":"0xa1b2c3", + "pattern":"^0x[a-f0-9]+$" + }, + "vaultId":{ + "type":"number", + "description":"Stark vault id to which the funds will be deposited.", + "example":123 + }, + "amount":{ + "type":"string", + "description":"quantised amount of the token to be deposited", + "example":"10000000" + } + } + }, + "depositsPostResponse":{ + "type":"object", + "properties":{ + "_id":{ + "type":"string", + "example":"FEHn8HYEQQw" + }, + "createdAt":{ + "type":"string", + "format":"date", + "description":"The date (ISO 8601) at which deposit was created.", + "example":"2020-05-13T14:11:02.205Z" + }, + "updatedAt":{ + "type":"string", + "format":"date", + "description":"The date (ISO 8601) at which deposit was last updated.", + "example":"2020-05-13T14:13:10.403Z" + }, + "token":{ + "type":"string", + "example":"ETH" + }, + "amount":{ + "type":"string", + "description":"quantised amount of the token to be deposited", + "example":"10000000" + }, + "pending":{ + "type":"boolean", + "example":true + }, + "expiresAt":{ + "type":"string", + "format":"date", + "example":"2021-08-12T17:12:18.058Z" + }, + "txHash":{ + "type":"string", + "description":"Transaction Hash of the corresponding Ethereum transaction", + "example":"0xeef10fc5170f669b86c4cd0444882a96087221325f8bf2f55d6188633aa7be7c", + "pattern":"^0x[a-f0-9]+$", + "x-constraint":{ + "length":66 + } + }, + "tx":{ + "$ref":"#/definitions/Model28" + } + } + }, + "deposits-validatePostPayload":{ + "type":"object", + "properties":{ + "token":{ + "type":"string", + "example":"ETH" + }, + "amount":{ + "type":"string", + "description":"quantised amount of the token to be undefined", + "example":"10000000" + } + } + }, + "deposits-validatePostResponse":{ + "type":"object", + "properties":{ + "token":{ + "type":"string", + "example":"ETH" + }, + "amount":{ + "type":"string", + "description":"quantised amount of the token to be undefined", + "example":"10000000" + }, + "starkKey":{ + "type":"string", + "description":"Stark key of the owner of the destination vault", + "example":"0x1a2b3c", + "pattern":"^0x[a-f0-9]+$" + }, + "tokenId":{ + "type":"string", + "description":"Stark token id corresponding to the token being deposited.", + "example":"0xa1b2c3", + "pattern":"^0x[a-f0-9]+$" + }, + "vaultId":{ + "type":"number", + "description":"Stark vault id to which the funds will be deposited.", + "example":123 + } + } + }, + "withdrawalsPostPayload":{ + "type":"object", + "properties":{ + "token":{ + "type":"string", + "example":"ETH" + }, + "amount":{ + "type":"string", + "description":"quantised amount of the token to be withdrawn", + "example":"10000000" + }, + "nonce":{ + "type":"integer", + "description":"Used to prevent creation of duplicate withdrawal if the request is retried with the same payload. withdrawal are be uniquely identified by a combination of user, token, amount and nonce.", + "example":976614084, + "minimum":0 + } + } + }, + "withdrawalsPostResponse":{ + "type":"object", + "properties":{ + "_id":{ + "type":"string", + "example":"FEHn8HYEQQw" + }, + "createdAt":{ + "type":"string", + "format":"date", + "description":"The date (ISO 8601) at which withdrawal was created.", + "example":"2020-05-13T14:11:02.205Z" + }, + "updatedAt":{ + "type":"string", + "format":"date", + "description":"The date (ISO 8601) at which withdrawal was last updated.", + "example":"2020-05-13T14:13:10.403Z" + }, + "token":{ + "type":"string", + "example":"ETH" + }, + "amount":{ + "type":"string", + "description":"quantised amount of the token to be withdrawn", + "example":"10000000" + }, + "readyToWithdrawOnChain":{ + "type":"boolean", + "example":true + }, + "nonce":{ + "type":"integer", + "description":"Used to prevent creation of duplicate withdrawal if the request is retried with the same payload. withdrawal are be uniquely identified by a combination of user, token, amount and nonce.", + "example":976614084, + "minimum":0 + } + } + }, + "starkPublicKey":{ + "type":"object", + "description":"The Stark public key. Both the \"x\" and \"y\" part are required.", + "example":{ + "x":"0746919ecbb54563de512f6fb556c21dab091748b41a60a946dbdbf118ac0a85", + "y":"58f7ce5eb6eb5bd24f70394622b1f4d2c54ebca317a3e61bf9f349dccf166cf" + }, + "properties":{ + "x":{ + "type":"string", + "description":"The \"x\" part of the Stark public key.", + "minLength":64, + "maxLength":64, + "x-format":{ + "hex":{ + "byteAligned":false + } + } + }, + "y":{ + "type":"string", + "description":"The \"y\" part of the Stark public key.", + "x-format":{ + "hex":{ + "byteAligned":false + } + } + } + }, + "required":[ + "x", + "y" + ] + }, + "Model29":{ + "type":"object", + "description":"Stark signature consisting of consisting of \"r\" and \"s\"", + "example":{ + "v":"3b46dfe03caef623048fedc8457a92385cd63eff6349ad135c945cd84937677", + "r":"1f38f551d798562c16d28733c7e3ff6850898d82f0ac9ccd39d373303b1778c", + "s":"518560420e52a37e9f580f024fc0fe8572cb2f5437a839075bbf4b2b123d572" + }, + "properties":{ + "v":{ + "type":"string", + "description":"The \"v\" part of the Stark signature." + }, + "r":{ + "type":"string", + "description":"The \"r\" part of the Stark signature." + }, + "s":{ + "type":"string", + "description":"The \"s\" part of the Stark signature." + } + }, + "required":[ + "r", + "s" + ] + }, + "Model30":{ + "type":"object", + "description":"Stark Limit Order Object.", + "example":{ + "vaultIdSell":1000002, + "vaultIdBuy":1000001, + "amountSell":"97400000", + "amountBuy":"100000000000000000", + "tokenSell":"0x2", + "tokenBuy":"0x1" + }, + "properties":{ + "vaultIdSell":{ + "type":"integer", + "description":"The vault ID of the seller.", + "minimum":0 + }, + "vaultIdBuy":{ + "type":"integer", + "description":"The vault ID of the buyer.", + "minimum":0 + }, + "amountSell":{ + "type":"string", + "description":"The total amount to be sold." + }, + "amountBuy":{ + "type":"string", + "description":"The total amount to be bought." + }, + "tokenSell":{ + "type":"string", + "description":"The Stark token ID for the token being sold." + }, + "tokenBuy":{ + "type":"string", + "description":"The Stark token ID for the token being bought." + }, + "nonce":{ + "type":"integer", + "description":"Used make identical stark transactions unique.", + "minimum":0, + "maximum":2147483647 + }, + "expirationTimestamp":{ + "type":"integer", + "description":"Expiration timestamp of the order.", + "minimum":0 + }, + "signature":{ + "$ref":"#/definitions/Model29" + } + } + }, + "Model31":{ + "type":"object", + "properties":{ + "starkOrder":{ + "$ref":"#/definitions/Model30" + } + } + }, + "Model32":{ + "type":"array", + "example":[ + { + "starkOrder":{ + "tokenBuy":"0x11af21d6b234cd669edd702dd3d1d017be888337010b950ae3679eb4194b4bc", + "amountBuy":"5000000000", + "vaultIdBuy":247827906, + "tokenSell":"0xb333e3142fe16b78628f19bb15afddaef437e72d6d7f5c6c20c6801a27fba6", + "amountSell":"200000000", + "vaultIdSell":2121602419, + "nonce":1079618848, + "expirationTimestamp":455582, + "signature":{ + "r":"0x2857ca21310ab87bb7c37ebad0e7166f1fb46e43cf32d6587a31e148d44b677", + "s":"0x45e939717a6de4ad5e79993d918bb40e629760da7a04062e965394d1d14106a" + } + } + }, + { + "starkOrder":{ + "tokenBuy":"0x11af21d6b234cd669edd702dd3d1d017be888337010b950ae3679eb4194b4bc", + "amountBuy":"5000000000", + "vaultIdBuy":247827906, + "tokenSell":"0xb333e3142fe16b78628f19bb15afddaef437e72d6d7f5c6c20c6801a27fba6", + "amountSell":"200000000", + "vaultIdSell":2121602419, + "nonce":1079618848, + "expirationTimestamp":455582, + "signature":{ + "r":"0x2857ca21310ab87bb7c37ebad0e7166f1fb46e43cf32d6587a31e148d44b677", + "s":"0x45e939717a6de4ad5e79993d918bb40e629760da7a04062e965394d1d14106a" + } + } + } + ], + "x-constraint":{ + "length":2 + }, + "items":{ + "$ref":"#/definitions/Model31" + } + }, + "AmmFundingOrdersPostPayload":{ + "type":"object", + "properties":{ + "pool":{ + "type":"string", + "example":"ETH:USDT" + }, + "starkPublicKey":{ + "$ref":"#/definitions/starkPublicKey" + }, + "orders":{ + "$ref":"#/definitions/Model32" + } + } + }, + "fill":{ + "type":"object", + "properties":{ + "amountBuy":{ + "type":"string" + }, + "amountSell":{ + "type":"string" + } + } + }, + "Model33":{ + "type":"object", + "properties":{ + "amountBuy":{ + "type":"string" + }, + "amountSell":{ + "type":"string" + }, + "fill":{ + "$ref":"#/definitions/fill" + }, + "starkOrder":{ + "$ref":"#/definitions/Model30" + }, + "tokenBuy":{ + "type":"string" + }, + "tokenSell":{ + "type":"string" + } + } + }, + "Model34":{ + "type":"array", + "x-constraint":{ + "length":2 + }, + "items":{ + "$ref":"#/definitions/Model33" + } + }, + "AmmFundingOrdersPostResponse":{ + "type":"object", + "example":{ + "_id":"L5QTNJtb2yF-GYa1NFCy1p5", + "closedAt":"2020-05-13T14:11:02.205Z", + "failed":false, + "pending":true, + "pool":"ETHUSDT", + "type":"Deposit", + "user":"0x948cd3ad67c5f21412bfcd07a7981322f9fa01f0", + "orders":[ + { + "tokenBuy":"LP-ETHUSDT", + "amountBuy":"50", + "tokenSell":"ETH", + "amountSell":"2", + "fill":{ + "amountBuy":"45", + "amountSell":"1" + }, + "starkOrder":{ + "tokenBuy":"0x11af21d6b234cd669edd702dd3d1d017be888337010b950ae3679eb4194b4bc", + "amountBuy":"5000000000", + "vaultIdBuy":247827906, + "tokenSell":"0xb333e3142fe16b78628f19bb15afddaef437e72d6d7f5c6c20c6801a27fba6", + "amountSell":"200000000", + "vaultIdSell":2121602419, + "nonce":1079618848, + "expirationTimestamp":455582, + "signature":{ + "r":"0x2857ca21310ab87bb7c37ebad0e7166f1fb46e43cf32d6587a31e148d44b677", + "s":"0x45e939717a6de4ad5e79993d918bb40e629760da7a04062e965394d1d14106a" + } + } + }, + { + "tokenBuy":"LP-ETHUSDT", + "amountBuy":"50", + "tokenSell":"USDT", + "amountSell":"1230", + "fill":{ + "amountBuy":"48", + "amountSell":"1220" + }, + "starkOrder":{ + "tokenBuy":"0x11af21d6b234cd669edd702dd3d1d017be888337010b950ae3679eb4194b4bc", + "amountBuy":"5000000000", + "vaultIdBuy":247827906, + "tokenSell":"0xb333e3142fe16b78628f19bb15afddaef437e72d6d7f5c6c20c6801a27fba6", + "amountSell":"200000000", + "vaultIdSell":2121602419, + "nonce":1079618848, + "expirationTimestamp":455582, + "signature":{ + "r":"0x2857ca21310ab87bb7c37ebad0e7166f1fb46e43cf32d6587a31e148d44b677", + "s":"0x45e939717a6de4ad5e79993d918bb40e629760da7a04062e965394d1d14106a" + } + } + } + ], + "starkPublicKey":{ + "x":"0746919ecbb54563de512f6fb556c21dab091748b41a60a946dbdbf118ac0a85", + "y":"690890d33f62e706b80d214546ab3fd063fad5893d990df876bafae113be981" + }, + "createdAt":"2020-05-13T14:11:02.205Z", + "updatedAt":"2020-05-13T14:13:10.403Z" + }, + "properties":{ + "pool":{ + "type":"string", + "example":"ETH:USDT" + }, + "starkPublicKey":{ + "$ref":"#/definitions/starkPublicKey" + }, + "_id":{ + "type":"string" + }, + "closedAt":{ + "type":"string", + "format":"date" + }, + "failed":{ + "type":"boolean" + }, + "pending":{ + "type":"boolean" + }, + "type":{ + "type":"string", + "enum":[ + "Deposit", + "Withdrawal" + ] + }, + "user":{ + "type":"string" + }, + "orders":{ + "$ref":"#/definitions/Model34" + }, + "createdAt":{ + "type":"string", + "format":"date", + "description":"The date (ISO 8601) at which AmmFundingOrder was created.", + "example":"2020-05-13T14:11:02.205Z" + }, + "updatedAt":{ + "type":"string", + "format":"date", + "description":"The date (ISO 8601) at which AmmFundingOrder was last updated.", + "example":"2020-05-13T14:13:10.403Z" + } + } + }, + "Model35":{ + "type":"object", + "properties":{ + "user":{ + "type":"string" + }, + "token":{ + "type":"string", + "description":"token for the airdrop", + "example":"DVF" + }, + "amount":{ + "type":"string", + "description":"Amount of token to give in standard format" + } + } + }, + "airdrops":{ + "type":"array", + "items":{ + "$ref":"#/definitions/Model35" + } + }, + "addAirdropRequestSchema":{ + "type":"object", + "properties":{ + "nonce":{ + "type":"string", + "description":"This nonce which used to provide the time until which this nonce is valid. It is presented as seconds since epoch.", + "example":"v2-1704114061.000" + }, + "signature":{ + "type":"string", + "description":"The signature obtained by signing the nonce with your private ethereum key.", + "example":"0x2b48d53f2e3a696630ebdcd1ff057556bbc9de9c294adfaa5b1f13df91b67b347fdd88c29594c377ba0024dec40cd9808829e7f4447772482f50a7a8e9a903561c" + }, + "airdrops":{ + "$ref":"#/definitions/airdrops" + } + } + }, + "Model36":{ + "type":"object", + "properties":{ + "user":{ + "type":"string", + "description":"Ethereum address", + "example":"0x08152c1265dbc218ccc8ab5c574e6bd52279b3b7" + }, + "token":{ + "type":"string", + "description":"token for the airdrop", + "example":"DVF" + }, + "amount":{ + "type":"string", + "description":"DVF airdrop eligible amount", + "example":"15.52" + } + } + }, + "addAirdropResponseSchema":{ + "type":"array", + "items":{ + "$ref":"#/definitions/Model36" + } + }, + "fields":{ + "type":"array", + "description":"Specific fields to be returned for balance information", + "example":[ + "balance", + "updatedAt" + ], + "items":{ + "type":"string", + "enum":[ + "balance", + "available", + "locked", + "updatedAt" + ] + } + }, + "getBalancePayload":{ + "type":"object", + "properties":{ + "nonce":{ + "type":"string", + "description":"This nonce which used to provide the time until which this nonce is valid. It is presented as seconds since epoch.", + "example":"v2-1704114061.000" + }, + "signature":{ + "type":"string", + "description":"The signature obtained by signing the nonce with your private ethereum key.", + "example":"0x2b48d53f2e3a696630ebdcd1ff057556bbc9de9c294adfaa5b1f13df91b67b347fdd88c29594c377ba0024dec40cd9808829e7f4447772482f50a7a8e9a903561c" + }, + "token":{ + "type":"string", + "description":"The token which the balance is specifically requested for.", + "example":"ETH" + }, + "fields":{ + "$ref":"#/definitions/fields" + } + } + }, + "Model37":{ + "type":"object", + "properties":{ + "token":{ + "type":"string", + "description":"The token for which the balances are provided.", + "example":"ETH" + }, + "balance":{ + "type":"number", + "description":"It is the total balance for the user corresponding to the specified token.", + "example":42 + }, + "available":{ + "type":"number", + "description":"It is the part of the balance available for use.", + "example":23 + }, + "locked":{ + "type":"number", + "description":"It is the part of the balance currently in open orders or pending withdrawal.", + "example":19 + } + } + }, + "getBalanceResponse":{ + "type":"array", + "items":{ + "$ref":"#/definitions/Model37" + } + }, + "getDepositsPayload":{ + "type":"object", + "properties":{ + "nonce":{ + "type":"string", + "description":"This nonce which used to provide the time until which this nonce is valid. It is presented as seconds since epoch.", + "example":"v2-1704114061.000" + }, + "signature":{ + "type":"string", + "description":"The signature obtained by signing the nonce with your private ethereum key.", + "example":"0x2b48d53f2e3a696630ebdcd1ff057556bbc9de9c294adfaa5b1f13df91b67b347fdd88c29594c377ba0024dec40cd9808829e7f4447772482f50a7a8e9a903561c" + }, + "token":{ + "type":"string", + "description":"The token which the balance is specifically requested for.", + "example":"ETH" + } + } + }, + "getDepositsResponse":{ + "type":"object", + "properties":{ + "ethAddress":{ + "type":"string", + "description":"The ethereum public address of the user.", + "example":"0x341E46a49F15785373edE443Df0220DEa6a41Bbc" + }, + "starkKey":{ + "type":"string", + "description":"The Stark public key.", + "example":"77a3b314db07c45076d11f62b6f9e748a39790441823307743cf00d6597ea43" + }, + "starkVaultId":{ + "type":"number", + "description":"The Stark vault ID.", + "example":123 + }, + "starkTokenId":{ + "type":"string", + "description":"The Stark token ID.", + "example":"0x7" + }, + "token":{ + "type":"string", + "description":"The token that was deposited", + "example":"NEC" + }, + "amount":{ + "type":"number", + "description":"The amount that was deposited.", + "example":1000 + }, + "createdAt":{ + "type":"string", + "description":"The date and time of the deposit.", + "example":"2020-01-29T14:02:08.477Z" + }, + "isPostedOffchain":{ + "type":"boolean", + "description":"Flag to indicate if the deposit was posted off chain.", + "example":false + }, + "isConfirmedOnChain":{ + "type":"boolean", + "description":"Flag to indicate if the deposit was confirmed off chain.", + "example":true + } + } + }, + "getOrderPayload":{ + "type":"object", + "properties":{ + "nonce":{ + "type":"string", + "description":"This nonce which used to provide the time until which this nonce is valid. It is presented as seconds since epoch.", + "example":"v2-1704114061.000" + }, + "signature":{ + "type":"string", + "description":"The signature obtained by signing the nonce with your private ethereum key.", + "example":"0x2b48d53f2e3a696630ebdcd1ff057556bbc9de9c294adfaa5b1f13df91b67b347fdd88c29594c377ba0024dec40cd9808829e7f4447772482f50a7a8e9a903561c" + }, + "orderId":{ + "type":"string", + "description":"The order ID.", + "example":"d7c8b9" + }, + "cid":{ + "type":"string", + "description":"An optional user-defined identifier for this order", + "example":"satoshi-order-2083236893" + } + } + }, + "getOrderResponse":{ + "type":"object", + "properties":{ + "_id":{ + "type":"string", + "description":"Id for the order. This can be used for orderId when calling cancelOrder or getOrder", + "example":"L1tarX5wUem" + }, + "amount":{ + "type":"string", + "description":"Original order size placed.", + "example":"-0.15" + }, + "totalFilled":{ + "type":"number", + "description":"Total of all fills executed.", + "example":"-0.15" + }, + "price":{ + "type":"string", + "description":"Cost per unit.", + "example":"250" + }, + "symbol":{ + "type":"string", + "description":"Trading symbol for the order", + "example":"ETH:USDT" + }, + "active":{ + "type":"boolean", + "description":"Active status true or false.", + "example":false + }, + "canceled":{ + "type":"boolean", + "description":"Canceled status true or false.", + "example":false + }, + "pending":{ + "type":"boolean", + "description":"Pending status true or false.", + "example":false + }, + "cid":{ + "type":"string", + "description":"An optional user-defined identifier for this order", + "example":"satoshi-order-2083236893" + } + } + }, + "getPendingWithdrawalsPayload":{ + "type":"object", + "properties":{ + "nonce":{ + "type":"string", + "description":"This nonce which used to provide the time until which this nonce is valid. It is presented as seconds since epoch.", + "example":"v2-1704114061.000" + }, + "signature":{ + "type":"string", + "description":"The signature obtained by signing the nonce with your private ethereum key.", + "example":"0x2b48d53f2e3a696630ebdcd1ff057556bbc9de9c294adfaa5b1f13df91b67b347fdd88c29594c377ba0024dec40cd9808829e7f4447772482f50a7a8e9a903561c" + }, + "token":{ + "type":"string" + } + } + }, + "authPayload":{ + "type":"object", + "properties":{ + "nonce":{ + "type":"string", + "description":"This nonce which used to provide the time until which this nonce is valid. It is presented as seconds since epoch.", + "example":"v2-1704114061.000" + }, + "signature":{ + "type":"string", + "description":"The signature obtained by signing the nonce with your private ethereum key.", + "example":"0x2b48d53f2e3a696630ebdcd1ff057556bbc9de9c294adfaa5b1f13df91b67b347fdd88c29594c377ba0024dec40cd9808829e7f4447772482f50a7a8e9a903561c" + } + } + }, + "Model38":{ + "type":"object", + "properties":{ + "balances":{ + "type":"boolean", + "description":"is balances authorized" + }, + "tradingHistory":{ + "type":"boolean", + "description":"is trading history authorized" + } + } + }, + "newMarkets":{ + "type":"array", + "description":"Currency pairs that were newly added", + "items":{ + "type":"string" + } + }, + "DVF":{ + "type":"object", + "description":"This contains application configuration details to set up for deposits and trading.", + "example":{ + "defaultFeeRate":0.002, + "deversifiAddress":"0x9ab450355b4ab504cbc0e4de484781dac08e6a26", + "starkExContractAddress":"0xF3731d0cdC9834f6F32104580bD226EF1bc1A9F9", + "exchangeSymbols":"[\"ETH:USDT\",\"ZRX:USDT\",\"ZRX:ETH\"]", + "newMarkets":[ + "ZRX:USDT", + "ZRX:ETH" + ], + "tempStarkVaultId":1 + }, + "properties":{ + "defaultFeeRate":{ + "type":"number", + "description":"The default fee rate, if no volume or maker discount." + }, + "deversifiAddress":{ + "type":"string", + "description":"The address of the DeversiFi exchange." + }, + "starkExContractAddress":{ + "type":"string", + "description":"Stark deposit contract address." + }, + "exchangeSymbols":{ + "type":"string", + "description":"Currency pairs available at the DeversiFi exchange for trading" + }, + "newMarkets":{ + "$ref":"#/definitions/newMarkets" + }, + "tempStarkVaultId":{ + "type":"number", + "description":"Transit Stark vault ID used for deposit privacy" + } + } + }, + "getUserConfResponse":{ + "type":"object", + "properties":{ + "DVF":{ + "$ref":"#/definitions/DVF" + }, + "tokenRegistry":{ + "$ref":"#/definitions/collateralBalancesSchema" + }, + "isRegistered":{ + "type":"string", + "description":"Registration status.", + "example":"true" + }, + "isRegisteredOnChain":{ + "type":"boolean", + "description":"Whether the user is registered with Starkware.", + "example":true, + "enum":[ + true, + false + ] + }, + "allowance":{ + "$ref":"#/definitions/getAllowanceResponse" + }, + "ethAddress":{ + "type":"string", + "description":"Ethereum address.", + "example":"0x278ff3bb25c5b1bb7032e822661974479280fa74" + }, + "starkKeyHex":{ + "type":"string", + "description":"Stark Public key as hex string.", + "example":"0x011869c13b32ab9b7ec84e2b31c1de58baaaa6bbb2443a33bbad8df739a6e957" + } + } + }, + "getVaultIdPayload":{ + "type":"object", + "properties":{ + "nonce":{ + "type":"string", + "description":"This nonce which used to provide the time until which this nonce is valid. It is presented as seconds since epoch.", + "example":"v2-1704114061.000" + }, + "signature":{ + "type":"string", + "description":"The signature obtained by signing the nonce with your private ethereum key.", + "example":"0x2b48d53f2e3a696630ebdcd1ff057556bbc9de9c294adfaa5b1f13df91b67b347fdd88c29594c377ba0024dec40cd9808829e7f4447772482f50a7a8e9a903561c" + }, + "token":{ + "type":"string", + "description":"The new token for which a new vault Id needs to be allocated.", + "example":"DAI" + } + }, + "required":[ + "token" + ] + }, + "getWithdrawalPayload":{ + "type":"object", + "properties":{ + "nonce":{ + "type":"string", + "description":"This nonce which used to provide the time until which this nonce is valid. It is presented as seconds since epoch.", + "example":"v2-1704114061.000" + }, + "signature":{ + "type":"string", + "description":"The signature obtained by signing the nonce with your private ethereum key.", + "example":"0x2b48d53f2e3a696630ebdcd1ff057556bbc9de9c294adfaa5b1f13df91b67b347fdd88c29594c377ba0024dec40cd9808829e7f4447772482f50a7a8e9a903561c" + }, + "withdrawalId":{ + "type":"string", + "description":"Used to identify a specific withdrawal.", + "example":"i6JjTE2PDL" + } + }, + "required":[ + "withdrawalId" + ] + }, + "withdrawHistoryObject":{ + "type":"object", + "properties":{ + "_id":{ + "type":"string", + "description":"Withdrawal ID.", + "example":"LCafcGC6tBH" + }, + "token":{ + "type":"string", + "description":"The token that was withdrawn.", + "example":"NEC" + }, + "amount":{ + "type":"string", + "description":"The amount that was withdrawn.", + "example":"100", + "pattern":"^[0-9]*$" + }, + "createdAt":{ + "type":"string", + "format":"date", + "description":"The date and time withdrawal request was received.", + "example":"2020-01-29T14:13:05.898Z" + }, + "readyToWithdrawOnChain":{ + "type":"boolean", + "description":"The withdrawal is ready to be requested.", + "example":true + }, + "canceled":{ + "type":"boolean", + "description":"The withdrawal has been canceled.", + "example":true + } + }, + "required":[ + "_id", + "token", + "createdAt", + "readyToWithdrawOnChain" + ] + }, + "Model39":{ + "type":"object", + "properties":{ + "hasReceived":{ + "type":"boolean", + "description":"Registration compensation was/not received.", + "example":true + }, + "date":{ + "type":"string", + "format":"date", + "description":"When was the compensation received", + "example":"2021-08-12T17:17:37.009Z" + } + } + }, + "openOrdersPayload":{ + "type":"object", + "properties":{ + "nonce":{ + "type":"string", + "description":"This nonce which used to provide the time until which this nonce is valid. It is presented as seconds since epoch.", + "example":"v2-1704114061.000" + }, + "signature":{ + "type":"string", + "description":"The signature obtained by signing the nonce with your private ethereum key.", + "example":"0x2b48d53f2e3a696630ebdcd1ff057556bbc9de9c294adfaa5b1f13df91b67b347fdd88c29594c377ba0024dec40cd9808829e7f4447772482f50a7a8e9a903561c" + }, + "symbol":{ + "type":"string", + "description":"Specifies the trading pair.", + "example":"ETH:USDT" + } + } + }, + "openOrderResponseObject.js":{ + "type":"object", + "properties":{ + "_id":{ + "type":"string", + "description":"Order Id, this can be used as orderId when calling cancelOrder or getOrder.", + "example":"L1tarX5wUem" + }, + "user":{ + "type":"string", + "description":"Ethereum address of the user.", + "example":"0x341e46a49f15785373ede443df0220dea6a41bbc" + }, + "symbol":{ + "type":"string", + "description":"The trading pair symbol for this order.", + "example":"ZRX:ETH" + }, + "amount":{ + "type":"number", + "description":"Original order size placed.", + "example":50 + }, + "amountOrig":{ + "type":"number", + "description":"Same as amount, included for backward compatibility.", + "example":50 + }, + "totalFilled":{ + "type":"number", + "description":"Total of all fills executed.", + "example":50 + }, + "tokenBuy":{ + "type":"string", + "description":"Token being bought as part of this exchange order.", + "example":"ETH" + }, + "totalBought":{ + "type":"string", + "description":"Total tokens bought, in quantized units.", + "example":"4990000000", + "pattern":"^[0-9]*$" + }, + "tokenSell":{ + "type":"string", + "description":"Token being sold as part of this exchange order.", + "example":"ETH" + }, + "tokenSellLockedBalance":{ + "type":"string", + "description":"Amount of tokens to be sold, locked when order was submitted (quantized units).", + "example":"45555500", + "pattern":"^[0-9]*$" + }, + "totalSold":{ + "type":"string", + "description":"Total tokens sold, in quantized units.", + "example":"45555500", + "pattern":"^[0-9]*$" + }, + "type":{ + "type":"string", + "description":"Type of the order. Currently, \"EXCHANGE LIMIT\" is the only type that is supported.", + "example":"EXCHANGE LIMIT" + }, + "price":{ + "type":"number", + "description":"Cost per unit.", + "example":0.01 + }, + "averagePrice":{ + "type":"number", + "description":"Average price at which the order has been settled.", + "example":0.0091111 + }, + "feeRate":{ + "type":"number", + "description":"The max fee rate applicable for the order.", + "example":0.002 + }, + "createdAt":{ + "type":"string", + "format":"date", + "description":"The date and time when the order was created.", + "example":"2020-05-13T14:11:02.205Z" + }, + "updatedAt":{ + "type":"string", + "format":"date", + "description":"The date and time when the order was last updated.", + "example":"2020-05-13T14:13:10.403Z" + }, + "activatedAt":{ + "type":"string", + "format":"date", + "description":"The date and time when the order was activated.", + "example":"2020-05-13T14:11:03.000Z" + }, + "lastFillTime":{ + "type":"string", + "format":"date", + "description":"The date and time when the last fill occurred for this order.", + "example":"2020-05-13T14:13:18.000Z" + }, + "canceled":{ + "type":"boolean", + "description":"Canceled status true or false.", + "example":false + }, + "isPostOnly":{ + "type":"boolean", + "description":"Flag to indicate if the order is post-only.", + "example":false + }, + "isHidden":{ + "type":"boolean", + "description":"Flag to indicate if the order is hidden.", + "example":false + }, + "isFillOrKill":{ + "type":"boolean", + "description":"Flag to indicate if fill or kill order.", + "example":false + }, + "isSlippageDisabled":{ + "type":"boolean", + "description":"Flag to indicate if slippage protection is disabled.", + "example":false + }, + "partnerId":{ + "type":"string", + "description":"TODO", + "example":"P1" + }, + "cid":{ + "type":"string", + "description":"An optional user-defined identifier for this order", + "example":"satoshi-order-2083236893" + }, + "awaitingSettlement":{ + "type":"number", + "description":"TODO", + "example":10 + }, + "meta":{ + "$ref":"#/definitions/collateralBalancesSchema" + }, + "active":{ + "type":"boolean", + "description":"If false, the order has not been included in the order book yet.", + "example":false + } + }, + "required":[ + "_id", + "user", + "symbol", + "amount", + "amountOrig", + "tokenBuy", + "tokenSell", + "tokenSellLockedBalance", + "type", + "price", + "createdAt", + "updatedAt", + "active" + ] + }, + "openOrdersResponse":{ + "type":"array", + "example":[ + { + "_id":"L1tarX5wUem", + "user":"0x341e46a49f15785373ede443df0220dea6a41bbc", + "symbol":"ZRX:ETH", + "amount":50, + "amountOrig":50, + "totalFilled":50, + "tokenBuy":"ETH", + "totalBought":"4990000000", + "tokenSell":"ETH", + "tokenSellLockedBalance":"45555500", + "totalSold":"45555500", + "type":"EXCHANGE LIMIT", + "price":0.01, + "averagePrice":0.0091111, + "feeRate":0.002, + "createdAt":"2020-05-13T14:11:02.205Z", + "updatedAt":"2020-05-13T14:13:10.403Z", + "active":true, + "activatedAt":"2020-05-13T14:11:03.000Z", + "canceled":true, + "isPostOnly":true, + "isHidden":true, + "isFillOrKill":true, + "isSlippageDisabled":true, + "partnerId":"P1", + "awaitingSettlement":0 + } + ], + "items":{ + "$ref":"#/definitions/openOrderResponseObject.js" + } + }, + "closedOrderResponseObject":{ + "type":"object", + "properties":{ + "_id":{ + "type":"string", + "description":"Order Id, this can be used as orderId when calling cancelOrder or getOrder.", + "example":"L1tarX5wUem" + }, + "user":{ + "type":"string", + "description":"Ethereum address of the user.", + "example":"0x341e46a49f15785373ede443df0220dea6a41bbc" + }, + "symbol":{ + "type":"string", + "description":"The trading pair symbol for this order.", + "example":"ZRX:ETH" + }, + "amount":{ + "type":"number", + "description":"Original order size placed.", + "example":50 + }, + "amountOrig":{ + "type":"number", + "description":"Same as amount, included for backward compatibility.", + "example":50 + }, + "totalFilled":{ + "type":"number", + "description":"Total of all fills executed.", + "example":50 + }, + "tokenBuy":{ + "type":"string", + "description":"Token being bought as part of this exchange order.", + "example":"ETH" + }, + "totalBought":{ + "type":"string", + "description":"Total tokens bought, in quantized units.", + "example":"4990000000", + "pattern":"^[0-9]*$" + }, + "tokenSell":{ + "type":"string", + "description":"Token being sold as part of this exchange order.", + "example":"ETH" + }, + "tokenSellLockedBalance":{ + "type":"string", + "description":"Amount of tokens to be sold, locked when order was submitted (quantized units).", + "example":"45555500", + "pattern":"^[0-9]*$" + }, + "totalSold":{ + "type":"string", + "description":"Total tokens sold, in quantized units.", + "example":"45555500", + "pattern":"^[0-9]*$" + }, + "type":{ + "type":"string", + "description":"Type of the order. Currently, \"EXCHANGE LIMIT\" is the only type that is supported.", + "example":"EXCHANGE LIMIT" + }, + "price":{ + "type":"number", + "description":"Cost per unit.", + "example":0.01 + }, + "averagePrice":{ + "type":"number", + "description":"Average price at which the order has been settled.", + "example":0.0091111 + }, + "feeRate":{ + "type":"number", + "description":"The max fee rate applicable for the order.", + "example":0.002 + }, + "createdAt":{ + "type":"string", + "format":"date", + "description":"The date and time when the order was created.", + "example":"2020-05-13T14:11:02.205Z" + }, + "updatedAt":{ + "type":"string", + "format":"date", + "description":"The date and time when the order was last updated.", + "example":"2020-05-13T14:13:10.403Z" + }, + "activatedAt":{ + "type":"string", + "format":"date", + "description":"The date and time when the order was activated.", + "example":"2020-05-13T14:11:03.000Z" + }, + "lastFillTime":{ + "type":"string", + "format":"date", + "description":"The date and time when the last fill occurred for this order.", + "example":"2020-05-13T14:13:18.000Z" + }, + "canceled":{ + "type":"boolean", + "description":"Canceled status true or false.", + "example":false + }, + "isPostOnly":{ + "type":"boolean", + "description":"Flag to indicate if the order is post-only.", + "example":false + }, + "isHidden":{ + "type":"boolean", + "description":"Flag to indicate if the order is hidden.", + "example":false + }, + "isFillOrKill":{ + "type":"boolean", + "description":"Flag to indicate if fill or kill order.", + "example":false + }, + "isSlippageDisabled":{ + "type":"boolean", + "description":"Flag to indicate if slippage protection is disabled.", + "example":false + }, + "partnerId":{ + "type":"string", + "description":"TODO", + "example":"P1" + }, + "cid":{ + "type":"string", + "description":"An optional user-defined identifier for this order", + "example":"satoshi-order-2083236893" + }, + "awaitingSettlement":{ + "type":"number", + "description":"TODO", + "example":10 + }, + "meta":{ + "$ref":"#/definitions/collateralBalancesSchema" + } + }, + "required":[ + "_id", + "user", + "symbol", + "amount", + "amountOrig", + "tokenBuy", + "tokenSell", + "tokenSellLockedBalance", + "type", + "price", + "createdAt", + "updatedAt" + ] + }, + "Model40":{ + "type":"array", + "example":[ + { + "_id":"L1tarX5wUem", + "user":"0x341e46a49f15785373ede443df0220dea6a41bbc", + "symbol":"ZRX:ETH", + "amount":50, + "amountOrig":50, + "totalFilled":50, + "tokenBuy":"ETH", + "totalBought":"4990000000", + "tokenSell":"ETH", + "tokenSellLockedBalance":"45555500", + "totalSold":"45555500", + "type":"EXCHANGE LIMIT", + "price":0.01, + "averagePrice":0.0091111, + "feeRate":0.002, + "createdAt":"2020-05-13T14:11:02.205Z", + "updatedAt":"2020-05-13T14:13:10.403Z", + "activatedAt":"2020-05-13T14:11:03.000Z", + "canceled":true, + "isPostOnly":true, + "isHidden":true, + "isFillOrKill":true, + "isSlippageDisabled":true, + "partnerId":"P1", + "awaitingSettlement":0 + } + ], + "items":{ + "$ref":"#/definitions/closedOrderResponseObject" + } + }, + "recoverTradingKeyResponse":{ + "type":"object", + "properties":{ + "encryptedTradingKey":{ + "type":"string", + "description":"Encrypted Stark Trading Key", + "example":"7b2276657273696f6e223a227832353531392d7873616c736132302d706f6c7931333035222c226e6f6e6365223a22765633313730366571496f696432717944444539465055346f7466346171457a222c22657068656d5075626c69634b6579223a227358657a625174556c453476555661547857466b326555427532627746342f6641434378536a592f306e513d222c2263697068657274657874223a22444e5041615a76726331374f4d656a5451354f544e4243536d594b504466745335574b307278794b716671715770486d53676a4568782b3259352f6b4a6e3233674e5454476c31306973556271696d72636e67676a61636e346335317672484a697a427166324737227d" + }, + "dtkVersion":{ + "type":"string", + "description":"Trading Key Version", + "example":"v2" + } + } + }, + "permissionsPayload":{ + "type":"object", + "properties":{ + "nonce":{ + "type":"string", + "description":"This nonce which used to provide the time until which this nonce is valid. It is presented as seconds since epoch.", + "example":"v2-1704114061.000" + }, + "signature":{ + "type":"string", + "description":"The signature obtained by signing the nonce with your private ethereum key.", + "example":"0x2b48d53f2e3a696630ebdcd1ff057556bbc9de9c294adfaa5b1f13df91b67b347fdd88c29594c377ba0024dec40cd9808829e7f4447772482f50a7a8e9a903561c" + }, + "key":{ + "type":"string", + "description":"The permission key to change the access for", + "example":"balances" + }, + "value":{ + "type":"boolean", + "description":"Whether to allow public access to the endpoints driven by provided permission", + "example":true + } + } + }, + "Model41":{ + "type":"object", + "properties":{ + "count":{ + "type":"number", + "description":"Total count of user's filled orders.", + "example":1414 + } + } + }, + "withdrawHistoryResponse":{ + "type":"array", + "items":{ + "$ref":"#/definitions/withdrawHistoryObject" + } + }, + "Model42":{ + "type":"object", + "properties":{ + "orderId":{ + "type":"string", + "description":"The order ID", + "example":"d7c8b9" + }, + "canceled":{ + "type":"boolean", + "description":"only if order is already canceled", + "example":true + }, + "active":{ + "type":"boolean", + "description":"whether order is active", + "example":true + } + } + }, + "cancelOpenOrdersResponse":{ + "type":"array", + "items":{ + "$ref":"#/definitions/Model42" + } + }, + "cancelOrderPayload":{ + "type":"object", + "example":{ + "nonce":"v2-1704114061.000", + "signature":"0x2b48d53f2e3a696630ebdcd1ff057556bbc9de9c294adfaa5b1f13df91b67b347fdd88c29594c377ba0024dec40cd9808829e7f4447772482f50a7a8e9a903561c", + "orderId":"d7c8b9" + }, + "properties":{ + "nonce":{ + "type":"string", + "description":"This nonce which used to provide the time until which this nonce is valid. It is presented as seconds since epoch.", + "example":"v2-1704114061.000" + }, + "signature":{ + "type":"string", + "description":"The signature obtained by signing the nonce with your private ethereum key.", + "example":"0x2b48d53f2e3a696630ebdcd1ff057556bbc9de9c294adfaa5b1f13df91b67b347fdd88c29594c377ba0024dec40cd9808829e7f4447772482f50a7a8e9a903561c" + }, + "orderId":{ + "type":"string", + "description":"The order ID.", + "example":"d7c8b9" + }, + "cid":{ + "type":"string", + "description":"An optional user-defined identifier for this order" + } + } + }, + "cancelOrderResponse":{ + "type":"object", + "properties":{ + "orderId":{ + "type":"string", + "description":"The order ID.", + "example":"d7c8b9" + }, + "canceled":{ + "type":"boolean", + "description":"only if order is already canceled", + "example":true + } + } + }, + "cancelWithdrawalPayload":{ + "type":"object", + "properties":{ + "nonce":{ + "type":"string", + "description":"This nonce which used to provide the time until which this nonce is valid. It is presented as seconds since epoch.", + "example":"v2-1704114061.000" + }, + "signature":{ + "type":"string", + "description":"The signature obtained by signing the nonce with your private ethereum key.", + "example":"0x2b48d53f2e3a696630ebdcd1ff057556bbc9de9c294adfaa5b1f13df91b67b347fdd88c29594c377ba0024dec40cd9808829e7f4447772482f50a7a8e9a903561c" + }, + "id":{ + "type":"string", + "description":"Withdrawal ID.", + "example":"LCafcGC6tBH" + } + }, + "required":[ + "id" + ] + }, + "airdropEligibilityQuery":{ + "type":"object", + "properties":{ + "nonce":{ + "type":"string", + "description":"This nonce which used to provide the time until which this nonce is valid. It is presented as seconds since epoch.", + "example":"v2-1704114061.000" + }, + "signature":{ + "type":"string", + "description":"The signature obtained by signing the nonce with your private ethereum key.", + "example":"0x2b48d53f2e3a696630ebdcd1ff057556bbc9de9c294adfaa5b1f13df91b67b347fdd88c29594c377ba0024dec40cd9808829e7f4447772482f50a7a8e9a903561c" + }, + "token":{ + "type":"string", + "description":"token for the airdrop", + "example":"DVF" + } + }, + "required":[ + "token" + ] + }, + "Model43":{ + "type":"object", + "properties":{ + "_id":{ + "type":"string", + "description":"ID of the airdrop claim eligibility", + "example":"d7c8b9" + } + } + }, + "Model44":{ + "type":"object", + "description":"The Stark public key. Both the \"x\" and \"y\" part are required.", + "example":{ + "x":"0746919ecbb54563de512f6fb556c21dab091748b41a60a946dbdbf118ac0a85", + "y":"58f7ce5eb6eb5bd24f70394622b1f4d2c54ebca317a3e61bf9f349dccf166cf" + }, + "properties":{ + "x":{ + "type":"string", + "description":"The \"x\" part of the Stark public key." + }, + "y":{ + "type":"string", + "description":"The \"y\" part of the Stark public key." + } + } + }, + "depositPayload":{ + "type":"object", + "properties":{ + "token":{ + "type":"string", + "description":"The token for which the deposit was made.", + "example":"ZRX" + }, + "amount":{ + "type":"number", + "description":"The deposit amount.", + "example":1 + }, + "nonce":{ + "type":"number" + }, + "starkPublicKey":{ + "$ref":"#/definitions/Model44" + }, + "starkSignature":{ + "$ref":"#/definitions/Model29" + }, + "starkVaultId":{ + "type":"number", + "description":"The Stark vault ID.", + "example":1000003 + }, + "expireTime":{ + "type":"number", + "description":"Expiry time in hours", + "example":454934 + } + }, + "required":[ + "token", + "amount", + "nonce", + "starkPublicKey", + "starkSignature", + "starkVaultId", + "expireTime" + ] + }, + "depositResponse":{ + "type":"object", + "properties":{ + "isPostedOffchain":{ + "type":"boolean", + "description":"Flag to indicate if the deposit was posted off chain.", + "example":false + }, + "isConfirmedOnChain":{ + "type":"boolean", + "description":"Flag to indicate if the deposit was confirmed off chain.", + "example":true + }, + "_id":{ + "type":"string", + "example":"5e335f88bdcd70001e52d0a7" + }, + "starkVaultId":{ + "type":"number", + "description":"The Stark vault ID.", + "example":1000003 + }, + "starkKey":{ + "type":"string", + "description":"The Stark public key.", + "example":"0746919ecbb54563de512f6fb556c21dab091748b41a60a946dbdbf118ac0a85" + }, + "starkSignature":{ + "$ref":"#/definitions/Model29" + }, + "starkTokenId":{ + "type":"string", + "description":"The Stark token ID.", + "example":"0x3" + }, + "amount":{ + "type":"number", + "description":"The amount that was deposited.", + "example":1 + }, + "ethAddress":{ + "type":"string", + "description":"Ethereum public address of the user.", + "example":"0x341e46a49f15785373ede443df0220dea6a41bbc" + }, + "createdAt":{ + "type":"string", + "description":"The date and time of the deposit.", + "example":"2020-01-30T22:58:16.720Z" + } + }, + "required":[ + "starkSignature" + ] + }, + "Model45":{ + "type":"object", + "description":"StarkWare ConditionalTansferRequest", + "example":{ + "amount":"10000000", + "expirationTimestamp":446134, + "fact":"3c3f4eb0255776079339f0b253cc85310a3a56a0dcdd76ca5a995f4816cd0763", + "factRegistryAddress":"0xA9F9cC1189b9d6051b26467b29629787C671905d", + "nonce":976614084, + "receiverPublicKey":"0x077a3b314db07c45076d11f62b6f9e748a39790441823307743cf00d6597ea43", + "receiverVaultId":1863686755, + "senderPublicKey":"0x044926648f4b6f002dfa389c536129ae178f34d9be452724268cc48ebea2b37c", + "senderVaultId":2010760265, + "token":"0x180bef8ae3462e919489763b84dc1dc700c45a249dec4d1136814a639f2dd7b", + "type":"ConditionalTransferRequest", + "signature":{ + "r":"0x2857ca21310ab87bb7c37ebad0e7166f1fb46e43cf32d6587a31e148d44b677", + "s":"0x45e939717a6de4ad5e79993d918bb40e629760da7a04062e965394d1d14106a" + } + }, + "properties":{ + "amount":{ + "type":"string", + "pattern":"^[0-9]*$" + }, + "expirationTimestamp":{ + "type":"integer", + "minimum":0 + }, + "nonce":{ + "type":"integer", + "minimum":0 + }, + "receiverPublicKey":{ + "type":"string", + "pattern":"^0x[a-f0-9]+$" + }, + "receiverVaultId":{ + "type":"integer" + }, + "senderPublicKey":{ + "type":"string", + "pattern":"^0x[a-f0-9]+$" + }, + "senderVaultId":{ + "type":"integer" + }, + "signature":{ + "$ref":"#/definitions/signature" + }, + "token":{ + "type":"string", + "pattern":"^0x[a-f0-9]+$" + }, + "type":{ + "type":"string", + "enum":[ + "ConditionalTransferRequest" + ] + }, + "fact":{ + "type":"string", + "x-format":{ + "hex":{ + "byteAligned":false + } + } + }, + "factRegistryAddress":{ + "type":"string", + "pattern":"^0x[a-f0-9]+$" + } + } + }, + "fastWithdrawalPayload":{ + "type":"object", + "properties":{ + "recipientEthAddress":{ + "type":"string", + "description":"Ethereum address of recipient who will receive funds on chain.", + "example":"0x948cd3ad67c5f21412bfcd07a7981322f9fa01f0" + }, + "tx":{ + "$ref":"#/definitions/Model45" + }, + "transactionFee":{ + "type":"string", + "description":"fee to paid by the user in the currency of the transaction (quantised units).", + "example":"1", + "pattern":"^[0-9]*$" + }, + "starkPublicKey":{ + "$ref":"#/definitions/starkPublicKey" + } + } + }, + "Model46":{ + "type":"object", + "properties":{ + "_id":{ + "type":"string", + "description":"Withdrawal ID.", + "example":"LCafcGC6tBH" + }, + "token":{ + "type":"string", + "description":"The token that was withdrawn.", + "example":"NEC" + }, + "amount":{ + "type":"string", + "description":"The amount that was withdrawn.", + "example":"100", + "pattern":"^[0-9]*$" + }, + "createdAt":{ + "type":"string", + "format":"date", + "description":"The date and time withdrawal request was received.", + "example":"2020-01-29T14:13:05.898Z" + }, + "readyToWithdrawOnChain":{ + "type":"boolean", + "description":"The withdrawal is ready to be requested.", + "example":true + }, + "canceled":{ + "type":"boolean", + "description":"The withdrawal has been canceled.", + "example":true + }, + "fastWithdrawalData":{ + "$ref":"#/definitions/fastWithdrawalData" + } + }, + "required":[ + "_id", + "token", + "createdAt", + "readyToWithdrawOnChain", + "fastWithdrawalData" + ] + }, + "feedbackPayload":{ + "type":"object", + "properties":{ + "nonce":{ + "type":"string", + "description":"This nonce which used to provide the time until which this nonce is valid. It is presented as seconds since epoch.", + "example":"v2-1704114061.000" + }, + "signature":{ + "type":"string", + "description":"The signature obtained by signing the nonce with your private ethereum key.", + "example":"0x2b48d53f2e3a696630ebdcd1ff057556bbc9de9c294adfaa5b1f13df91b67b347fdd88c29594c377ba0024dec40cd9808829e7f4447772482f50a7a8e9a903561c" + }, + "email":{ + "type":"string", + "description":"Email of the user providing feedback.", + "example":"hello@deversifi.com" + } + }, + "required":[ + "email" + ] + }, + "Model47":{ + "type":"object", + "properties":{ + "_id":{ + "type":"string", + "description":"ID of the feedback entry", + "example":"d7c8b9" + } + } + }, + "notificationPayload":{ + "type":"object", + "properties":{ + "message":{ + "type":"string" + }, + "icon":{ + "type":"string" + }, + "ctaText":{ + "type":"string" + }, + "ctaURL":{ + "type":"string" + }, + "ctaID":{ + "type":"string" + }, + "userAddress":{ + "type":"string", + "x-convert":{ + "case":"lower" + } + }, + "startDate":{ + "type":"string", + "format":"date" + }, + "endDate":{ + "type":"string", + "format":"date" + } + }, + "required":[ + "message", + "icon", + "ctaText" + ] + }, + "notification":{ + "type":"object", + "properties":{ + "_id":{ + "type":"string" + }, + "message":{ + "type":"string" + }, + "icon":{ + "type":"string" + }, + "ctaText":{ + "type":"string" + }, + "ctaURL":{ + "type":"string" + }, + "ctaID":{ + "type":"string" + }, + "userAddress":{ + "type":"string", + "x-convert":{ + "case":"lower" + } + }, + "startDate":{ + "type":"string", + "format":"date" + }, + "endDate":{ + "type":"string", + "format":"date" + } + }, + "required":[ + "message", + "icon", + "ctaText" + ] + }, + "Model48":{ + "type":"object", + "properties":{ + "dtk":{ + "type":"string", + "description":"The encrypted Stark trading key.", + "example":"6d840e6d251e2165e3214eecfcbcfa83c0f704439e16c69383d93fc0f704439e16c69383d93fc0f704439e16c69383d93fc0f704439e16c69383d93fc0f704439e16c69383d93f", + "minLength":66, + "maxLength":1000, + "pattern":"[a-zA-Z0-9]{66,}" + }, + "dtkVersion":{ + "type":"string", + "description":"Version of the trading key mechanism.", + "example":"v1", + "default":"v1" + } + } + }, + "registerPayload":{ + "type":"object", + "properties":{ + "nonce":{ + "type":"string", + "description":"This nonce which used to provide the time until which this nonce is valid. It is presented as seconds since epoch.", + "example":"v2-1704114061.000" + }, + "signature":{ + "type":"string", + "description":"The signature obtained by signing the nonce with your private ethereum key.", + "example":"0x2b48d53f2e3a696630ebdcd1ff057556bbc9de9c294adfaa5b1f13df91b67b347fdd88c29594c377ba0024dec40cd9808829e7f4447772482f50a7a8e9a903561c" + }, + "starkKey":{ + "type":"string", + "description":"The Stark public key.", + "example":"0746919ecbb54563de512f6fb556c21dab091748b41a60a946dbdbf118ac0a85" + }, + "encryptedTradingKey":{ + "$ref":"#/definitions/Model48", + "x-alternatives":[ + { + "$ref":"#/x-alt-definitions/encryptedTradingKey" + }, + { + "type":"string", + "description":"The encrypted Stark trading key.", + "example":"6d840e6d251e2165e3214eecfcbcfa83c0f704439e16c69383d93fc0f704439e16c69383d93fc0f704439e16c69383d93fc0f704439e16c69383d93fc0f704439e16c69383d93f", + "minLength":66, + "maxLength":1000, + "pattern":"[a-zA-Z0-9]{66,}" + } + ] + }, + "meta":{ + "$ref":"#/definitions/collateralBalancesSchema" + }, + "contractWalletAddress":{ + "type":"string", + "description":"The address of the contract wallet that is registering.", + "example":"0x8d12A197cB00D4747a1fe03395095ce2A5CC6819" + } + }, + "required":[ + "starkKey" + ] + }, + "exchangeSymbols":{ + "type":"array", + "description":"Currency pairs available at the DeversiFi exchange for trading", + "example":[ + "ETH:USDT" + ], + "items":{ + "type":"string" + } + }, + "Model49":{ + "type":"array", + "description":"Currency pairs that were newly added", + "example":[ + "ETH:USDT" + ], + "items":{ + "type":"string" + } + }, + "Model50":{ + "type":"object", + "description":"This contains application configuration details to set up for deposits and trading.", + "example":{ + "defaultFeeRate":0.002, + "deversifiAddress":"0x9ab450355b4ab504cbc0e4de484781dac08e6a26", + "starkExContractAddress":"0xF3731d0cdC9834f6F32104580bD226EF1bc1A9F9", + "exchangeSymbols":[ + "ETH:USDT", + "ZRX:USDT", + "ZRX:ETH", + "BTC:USDT", + "ETH:BTC" + ], + "newMarkets":[ + "ZRX:USDT", + "ZRX:ETH" + ], + "tempStarkVaultId":1 + }, + "properties":{ + "defaultFeeRate":{ + "type":"number", + "description":"The default fee rate, if no volume or maker discount.", + "example":0.2 + }, + "deversifiAddress":{ + "type":"string", + "description":"The address of the DeversiFi exchange.", + "example":"0x9ab450355b4ab504cbc0e4de484781dac08e6a26" + }, + "starkExContractAddress":{ + "type":"string", + "description":"Stark deposit contract address.", + "example":"0x69C6392Eb02a2882314134c98DDCBF73B7AdBab1" + }, + "exchangeSymbols":{ + "$ref":"#/definitions/exchangeSymbols" + }, + "newMarkets":{ + "$ref":"#/definitions/Model49" + }, + "tempStarkVaultId":{ + "type":"number", + "description":"Transit Stark vault ID used for deposit privacy", + "example":1 + }, + "minDepositUSDT":{ + "type":"number", + "description":"Minimum deposit amount denominated in USDT", + "example":1 + } + } + }, + "registerResponseUserRegisteredOnChain":{ + "type":"object", + "example":{ + "isRegistered":true, + "ethAddress":"0xe16841977feae28ce69f9d6b6f3fcf1e9610f2fe", + "DVF":{ + "defaultFeeRate":0.002, + "deversifiAddress":"0xc0e9bd267626e2393ddaf520ae5df27ef6c533bd", + "starkExContractAddress":"0x5783323064dDa4A1ebe62defFeF46750BD2C560c", + "exchangeSymbols":[ + "ETH:USDT", + "ZRX:USDT", + "ZRX:ETH", + "BTC:USDT", + "ETH:BTC" + ], + "newMarkets":[ + "ZRX:USDT", + "ZRX:ETH" + ], + "tempStarkVaultId":1, + "minDepositUSDT":1 + }, + "tokenRegistry":{ + "ETH":{ + "decimals":18, + "quantization":10000000000, + "minOrderSize":0.05, + "starkTokenId":"0xb333e3142fe16b78628f19bb15afddaef437e72d6d7f5c6c20c6801a27fba6" + }, + "USDT":{ + "decimals":6, + "quantization":1, + "minOrderSize":10, + "settleSpread":0, + "starkTokenId":"0x4507594b0258664463ad7bd1d1e9b1ff67821113abd1b9c7e082bb304da322", + "tokenAddress":"0x1c0f17436740bfb92c1070ee86322de890837c6a" + }, + "ZRX":{ + "decimals":18, + "quantization":10000000000, + "minOrderSize":10, + "starkTokenId":"0x3901ee6a6c5ac0f6e284f4273b961b7e9f29d25367d31d90b75820473a202f7", + "tokenAddress":"0xcd077abedd831a3443ffbe24fb76661bbb17eb69" + }, + "BTC":{ + "decimals":18, + "quantization":10000000000, + "minOrderSize":0.0004, + "starkTokenId":"0x21ef21d6b234cd669edd702dd3d1d017be888337010b950ae3679eb4194b4bc", + "tokenAddress":"0x40d8978500bf68324a51533cd6a21e3e59be324a" + } + } + }, + "properties":{ + "isRegistered":{ + "type":"boolean", + "description":"Registration status.", + "example":true, + "enum":[ + true + ] + }, + "ethAddress":{ + "type":"string", + "description":"Ethereum address.", + "example":"0x278ff3bb25c5b1bb7032e822661974479280fa74" + }, + "DVF":{ + "$ref":"#/definitions/Model50" + }, + "tokenRegistry":{ + "$ref":"#/definitions/collateralBalancesSchema" + } + }, + "required":[ + "isRegistered", + "ethAddress" + ] + }, + "storeTradingKeyPayload":{ + "type":"object", + "properties":{ + "nonce":{ + "type":"string", + "description":"This nonce which used to provide the time until which this nonce is valid. It is presented as seconds since epoch.", + "example":"v2-1704114061.000" + }, + "signature":{ + "type":"string", + "description":"The signature obtained by signing the nonce with your private ethereum key.", + "example":"0x2b48d53f2e3a696630ebdcd1ff057556bbc9de9c294adfaa5b1f13df91b67b347fdd88c29594c377ba0024dec40cd9808829e7f4447772482f50a7a8e9a903561c" + }, + "encryptedTradingKey":{ + "type":"string", + "description":"Encrypted Stark Trading Key.", + "example":"7b2276657273696f6e223a227832353531392d7873616c736132302d706f6c7931333035222c226e6f6e6365223a22765633313730366571496f696432717944444539465055346f7466346171457a222c22657068656d5075626c69634b6579223a227358657a625174556c453476555661547857466b326555427532627746342f6641434378536a592f306e513d222c2263697068657274657874223a22444e5041615a76726331374f4d656a5451354f544e4243536d594b504466745335574b307278794b716671715770486d53676a4568782b3259352f6b4a6e3233674e5454476c31306973556271696d72636e67676a61636e346335317672484a697a427166324737227d", + "minLength":66, + "maxLength":1000, + "pattern":"[a-zA-Z0-9]{66,}" + }, + "dtkVersion":{ + "type":"string", + "description":"Trading Key Version", + "example":"v2", + "minLength":0, + "maxLength":4 + } + }, + "required":[ + "encryptedTradingKey" + ] + }, + "storeTradingKeyResponse":{ + "type":"object", + "properties":{ + "status":{ + "type":"boolean", + "description":"Returns true if trading key is stored successfully", + "example":true + } + } + }, + "Model51":{ + "type":"object", + "description":"Stark order related meta information.", + "properties":{ + "vaultIdSell":{ + "type":"number", + "description":"The vault ID of the seller." + }, + "vaultIdBuy":{ + "type":"number", + "description":"The vault ID of the buyer." + }, + "amountSell":{ + "type":"string", + "description":"The total amount to be sold." + }, + "amountBuy":{ + "type":"string", + "description":"The total amount to be bought." + }, + "tokenSell":{ + "type":"string", + "description":"The Stark token ID for the token being sold." + }, + "tokenBuy":{ + "type":"string", + "description":"The Stark token ID for the token being bought." + }, + "nonce":{ + "type":"number", + "description":"Nonce value." + }, + "expirationTimestamp":{ + "type":"number", + "description":"Expiration timestamp of the order." + } + } + }, + "submitOrderMeta":{ + "type":"object", + "description":"A set of meta values.", + "example":{ + "starkOrder":{ + "vaultIdSell":1000002, + "vaultIdBuy":1000001, + "amountSell":"97400000", + "amountBuy":"100000000000000000", + "tokenSell":"0x2", + "tokenBuy":"0x1", + "nonce":0, + "expirationTimestamp":438947 + }, + "ethAddress":"0x341E46a49F15785373edE443Df0220DEa6a41Bbc", + "starkPublicKey":{ + "x":"0746919ecbb54563de512f6fb556c21dab091748b41a60a946dbdbf118ac0a85", + "y":"58f7ce5eb6eb5bd24f70394622b1f4d2c54ebca317a3e61bf9f349dccf166cf" + }, + "starkSignature":{ + "r":"5d14357fcf8f489218de0855267c6f64bc463135debf62680ad796e63cd6d3b", + "s":"786ab874d91e3a5871134955fcb768914754760a0ada326af67f758f32819cf" + } + }, + "properties":{ + "starkOrder":{ + "$ref":"#/definitions/Model51" + }, + "ethAddress":{ + "type":"string", + "description":"The Ethereum public address." + }, + "feature":{ + "type":"string", + "description":"Origin of the order" + }, + "platform":{ + "type":"string", + "description":"Platform on which the order was initiated", + "default":"DESKTOP", + "enum":[ + "DESKTOP", + "MOBILE" + ] + }, + "starkPublicKey":{ + "$ref":"#/definitions/collateralBalancesSchema" + }, + "starkSignature":{ + "$ref":"#/definitions/Model29" + } + }, + "required":[ + "starkSignature" + ] + }, + "submitOrderPayload":{ + "type":"object", + "properties":{ + "cid":{ + "type":"string", + "description":"Optional custom order ID that could be set when placing order and used later to retrieve order. This ID is unique per user (user A and B can each have an order with cid = AAA, but the same user cannot have two orders with the same cid)", + "example":"long-123" + }, + "gid":{ + "type":"string" + }, + "type":{ + "type":"string", + "description":"The type of order. Currently only “EXCHANGE_LIMIT” is accepted.", + "example":"EXCHANGE LIMIT", + "enum":[ + "EXCHANGE LIMIT", + "exchange limit", + "EXCHANGE MARKET", + "exchange market" + ] + }, + "symbol":{ + "type":"string", + "description":"The trading pair.", + "example":"ETH:USDT" + }, + "amount":{ + "type":"string", + "description":"The token amount to be traded. Will be rounded up to 8 decimal places.", + "example":"0.1" + }, + "price":{ + "type":"string", + "description":"The cost per unit. Will be rounded down to 5 significant digits.", + "example":"1000" + }, + "meta":{ + "$ref":"#/definitions/submitOrderMeta" + }, + "protocol":{ + "type":"string", + "enum":[ + "stark" + ] + }, + "partnerId":{ + "type":"string" + }, + "feeRate":{ + "type":"string", + "example":0.002 + }, + "isPostOnly":{ + "type":"boolean", + "description":"Flag to indicate if the order is post-only. Mutually exclusive with isFillOrKill" + }, + "isHidden":{ + "type":"boolean", + "description":"Flag to indicate if the order is hidden." + }, + "isFillOrKill":{ + "type":"boolean", + "description":"Flag to indicate if fill or kill order. Mutually exclusive with isPostOnly" + }, + "isSlippageDisabled":{ + "type":"boolean", + "description":"Flag to indicate if slippage protection is disabled." + } + }, + "required":[ + "type", + "symbol", + "amount", + "price", + "meta" + ] + }, + "submitOrderResponse":{ + "type":"object", + "properties":{ + "_id":{ + "type":"string", + "description":"Id for the order. This can be used for orderId when calling cancelOrder or getOrder", + "example":"L1tarX5wUem" + }, + "user":{ + "type":"string", + "description":"Ethereum address of the user", + "example":"E0xc1caf2d76c49e4a60635635c329a3ac22ddeb547" + }, + "symbol":{ + "type":"string", + "description":"Trading symbol for the order", + "example":"ETH:USDT" + }, + "tokenSell":{ + "type":"string", + "description":"The token which is being sold", + "example":"ETH" + }, + "tokenBuy":{ + "type":"string", + "description":"The token which is being bought", + "example":"USDT" + }, + "amount":{ + "type":"number", + "description":"Original order size placed being sold or bought.", + "example":"-0.5" + }, + "feeRate":{ + "type":"string", + "description":"Applied fee rate for this order", + "example":0.002 + }, + "meta":{ + "$ref":"#/definitions/collateralBalancesSchema" + }, + "cancelRequested":{ + "type":"boolean", + "description":"Whether or not this order was canceled by the user", + "example":true + }, + "pending":{ + "type":"boolean", + "description":"Whether or not this order is still pending to be filled", + "example":true + }, + "tokenSellLockedBalance":{ + "type":"string", + "description":"Amount (quantized) of token being locked to honor the order", + "example":"50000000" + }, + "price":{ + "type":"number", + "description":"Cost per unit.", + "example":"200" + }, + "type":{ + "type":"string", + "description":"Type of the order. Currently, \"EXCHANGE LIMIT\" is the only type that is supported.", + "example":"EXCHANGE LIMIT" + }, + "createdAt":{ + "type":"string", + "description":"The date and time when the order was created.", + "example":"2020-05-09T18:29:56.603Z" + }, + "updatedAt":{ + "type":"string", + "description":"The date and time when the order was last updated.", + "example":"2020-05-09T18:29:56.945Z" + }, + "activatedAt":{ + "type":"string", + "description":"The date and time when the order was activated.", + "example":"2020-05-09T18:29:56.944Z" + }, + "isPostOnly":{ + "type":"boolean", + "description":"Flag to indicate if the order is post-only.", + "example":false + }, + "isHidden":{ + "type":"boolean", + "description":"Flag to indicate if the order is hidden.", + "example":false + }, + "isFillOrKill":{ + "type":"boolean", + "description":"Flag to indicate if fill or kill order.", + "example":false + }, + "isSlippageDisabled":{ + "type":"boolean", + "description":"Flag to indicate if slippage protection is disabled.", + "example":false + }, + "cid":{ + "type":"string", + "description":"An optional user-defined identifier for this order", + "example":"satoshi-order-2083236893" + } + } + }, + "Model52":{ + "type":"object", + "description":"StarkWare TansferRequest for main transfer", + "example":{ + "amount":"9000000", + "senderPublicKey":"0x06537d3a116bcaa05be2f4d600280e1cf6a563a8808bcddef8c3b6ac71cdc5d2", + "receiverPublicKey":"0x000000000000000000000000000000000000000000000000000000000001a2b3", + "receiverVaultId":2141966986, + "senderVaultId":862115662, + "token":"0x180bef8ae3462e919489763b84dc1dc700c45a249dec4d1136814a639f2dd7b", + "type":"TransferRequest", + "nonce":919908315, + "expirationTimestamp":452912, + "signature":{ + "r":"0x6d1fa97e1088d236ecbac506c4647643c657c4bfa0f3dac19bf9fbd3164ae3b", + "s":"0x5faa1c05486186883154038c666e17470180e2b40ba2301bcf86098a8904b00" + } + }, + "properties":{ + "type":{ + "type":"string", + "enum":[ + "TransferRequest" + ] + }, + "amount":{ + "type":"string", + "pattern":"^[0-9]*$" + }, + "expirationTimestamp":{ + "type":"integer", + "minimum":0 + }, + "nonce":{ + "type":"integer", + "minimum":0 + }, + "receiverPublicKey":{ + "type":"string", + "pattern":"^0x[a-f0-9]+$" + }, + "receiverVaultId":{ + "type":"integer" + }, + "senderPublicKey":{ + "type":"string", + "pattern":"^0x[a-f0-9]+$" + }, + "senderVaultId":{ + "type":"integer" + }, + "signature":{ + "$ref":"#/definitions/signature" + }, + "token":{ + "type":"string", + "pattern":"^0x[a-f0-9]+$" + } + } + }, + "feeTx":{ + "type":"object", + "description":"StarkWare TansferRequest for service fee", + "example":{ + "amount":"1000000", + "senderPublicKey":"0x06537d3a116bcaa05be2f4d600280e1cf6a563a8808bcddef8c3b6ac71cdc5d2", + "receiverPublicKey":"0x077a3b314db07c45076d11f62b6f9e748a39790441823307743cf00d6597ea43", + "receiverVaultId":1635824404, + "senderVaultId":862115662, + "token":"0x180bef8ae3462e919489763b84dc1dc700c45a249dec4d1136814a639f2dd7b", + "type":"TransferRequest", + "nonce":727678229, + "expirationTimestamp":452912, + "signature":{ + "r":"0x6aead08672aff1f86185f0d68073ab64a70299fbdbf01a869d2bc53e5c1e440", + "s":"0x359c52b8c6e6d4087d530ece2f5dc590b98cf9a83c971e42205e636276bac0e" + } + }, + "properties":{ + "type":{ + "type":"string", + "enum":[ + "TransferRequest" + ] + }, + "amount":{ + "type":"string", + "pattern":"^[0-9]*$" + }, + "expirationTimestamp":{ + "type":"integer", + "minimum":0 + }, + "nonce":{ + "type":"integer", + "minimum":0 + }, + "receiverPublicKey":{ + "type":"string", + "pattern":"^0x[a-f0-9]+$" + }, + "receiverVaultId":{ + "type":"integer" + }, + "senderPublicKey":{ + "type":"string", + "pattern":"^0x[a-f0-9]+$" + }, + "senderVaultId":{ + "type":"integer" + }, + "signature":{ + "$ref":"#/definitions/signature" + }, + "token":{ + "type":"string", + "pattern":"^0x[a-f0-9]+$" + } + } + }, + "transferPayload":{ + "type":"object", + "properties":{ + "tx":{ + "$ref":"#/definitions/Model52" + }, + "feeTx":{ + "$ref":"#/definitions/feeTx" + }, + "memo":{ + "type":"string", + "description":"Optional memo string", + "example":"my reference", + "maxLength":42 + }, + "starkPublicKey":{ + "$ref":"#/definitions/starkPublicKey" + } + } + }, + "Model53":{ + "type":"object", + "example":{ + "type":"TransferRequest", + "amount":"10000000", + "expirationTimestamp":446134, + "nonce":976614084, + "receiverPublicKey":"0x077a3b314db07c45076d11f62b6f9e748a39790441823307743cf00d6597ea43", + "receiverVaultId":1863686755, + "senderPublicKey":"0x044926648f4b6f002dfa389c536129ae178f34d9be452724268cc48ebea2b37c", + "senderVaultId":2010760265, + "token":"0x180bef8ae3462e919489763b84dc1dc700c45a249dec4d1136814a639f2dd7b", + "signature":{ + "r":"0x2857ca21310ab87bb7c37ebad0e7166f1fb46e43cf32d6587a31e148d44b677", + "s":"0x45e939717a6de4ad5e79993d918bb40e629760da7a04062e965394d1d14106a" + } + }, + "properties":{ + "type":{ + "type":"string", + "enum":[ + "TransferRequest" + ] + }, + "amount":{ + "type":"string", + "pattern":"^[0-9]*$" + }, + "expirationTimestamp":{ + "type":"integer", + "minimum":0 + }, + "nonce":{ + "type":"integer", + "minimum":0 + }, + "receiverPublicKey":{ + "type":"string", + "pattern":"^0x[a-f0-9]+$" + }, + "receiverVaultId":{ + "type":"integer" + }, + "senderPublicKey":{ + "type":"string", + "pattern":"^0x[a-f0-9]+$" + }, + "senderVaultId":{ + "type":"integer" + }, + "signature":{ + "$ref":"#/definitions/signature" + }, + "token":{ + "type":"string", + "pattern":"^0x[a-f0-9]+$" + } + } + }, + "transferResponseObject":{ + "type":"object", + "properties":{ + "_id":{ + "type":"string", + "description":"Transfer ID.", + "example":"LCafcGC6tBH" + }, + "token":{ + "type":"string", + "description":"The token that was transferred.", + "example":"NEC" + }, + "amount":{ + "type":"string", + "description":"The amount that was transferred (in quantised units).", + "example":"100", + "pattern":"^[0-9]*$" + }, + "recipient":{ + "type":"string", + "description":"Deversifi user id of recipient of the transfer.", + "example":"0x948cd3ad67c5f21412bfcd07a7981322f9fa01f0" + }, + "createdAt":{ + "type":"string", + "format":"date", + "description":"The date and time transfer request was received.", + "example":"2020-01-29T14:13:05.898Z" + }, + "updatedAt":{ + "type":"string", + "format":"date", + "description":"The date and time transfer request was received.", + "example":"2020-01-29T14:13:05.898Z" + }, + "memo":{ + "type":"string", + "description":"Transfer memo", + "example":"my reference" + }, + "tx":{ + "$ref":"#/definitions/Model53" + } + }, + "required":[ + "_id", + "token", + "createdAt", + "updatedAt" + ] + }, + "withdrawalPayload":{ + "type":"object", + "properties":{ + "token":{ + "type":"string", + "description":"The token for which the withdrawal is requested.", + "example":"ZRX" + }, + "amount":{ + "type":"number", + "description":"The withdrawal amount.", + "example":1 + }, + "nonce":{ + "type":"number", + "example":45435743 + }, + "starkPublicKey":{ + "$ref":"#/definitions/starkPublicKey" + }, + "starkSignature":{ + "$ref":"#/definitions/Model29" + }, + "starkVaultId":{ + "type":"number", + "description":"The Stark vault ID.", + "example":1000003 + }, + "expireTime":{ + "type":"number", + "description":"Expiry time in hours", + "example":454934 + } + }, + "required":[ + "token", + "amount", + "nonce", + "starkPublicKey", + "starkSignature", + "starkVaultId", + "expireTime" + ] + }, + "Model54":{ + "type":"object", + "properties":{ + "token":{ + "type":"string", + "description":"The token which the balance is specifically requested for.", + "example":"ETH" + }, + "fields":{ + "$ref":"#/definitions/fields" + } + } + } +}, +"x-alt-definitions":{ + "pagination":{ + "type":"object", + "properties":{ + "totalItems":{ + "type":"number", + "description":"Total number of items matching the query", + "example":1559, + "minimum":0 + }, + "limit":{ + "type":"number", + "description":"Limit applied on returned items", + "example":5 + }, + "skip":{ + "type":"number", + "description":"Skip applied on returned items", + "example":2 + } + } + }, + "Model1":{ + "type":"object", + "properties":{ + "_id":{ + "type":"string", + "description":"Unique identifier representing the deposit or withdrawal", + "example":"606f207fc7aa2e91d028a17a" + }, + "type":{ + "type":"string", + "description":"Whether the transaction is a deposit, a classic withdrawal or a fast withdrawal", + "example":"Deposit", + "enum":[ + "Deposit", + "Withdrawal", + "FastWithdrawal" + ] + }, + "token":{ + "type":"string", + "description":"Token deposited or withdrawn", + "example":"ZRX" + }, + "amount":{ + "type":"number", + "description":"Amount deposited or withdrawn", + "example":1 + }, + "transactionHash":{ + "type":"string", + "description":"Hash of the Ethereum transaction leading to L1 balance debit or credit", + "example":"0xb5c8bd9430b6cc87a0e2fe110ece6bf527fa4f170a4bc8cd032f768fc5219838" + }, + "date":{ + "type":"string", + "format":"date", + "description":"Date and time deposit or withdrawal", + "example":"2020-11-11T16:37:05.957" + }, + "sourceOrRecipient":{ + "type":"string", + "description":"Originator of the deposit or recipient of the withdrawal", + "example":"0x148426fdc4c8a51b96b4bed827907b5fa6491ad0" + }, + "gateway":{ + "type":"string", + "description":"Set when operation used a gateway. Corresponds to a chain identifier", + "example":"MATIC_POS" + } + } + }, + "items":{ + "type":"array", + "items":{ + "$ref":"#/x-alt-definitions/Model1" + } + }, + "getDepositsAndWithdrawalsResponse":{ + "type":"object", + "properties":{ + "pagination":{ + "$ref":"#/x-alt-definitions/pagination" + }, + "items":{ + "$ref":"#/x-alt-definitions/items" + } + } + }, + "Model2":{ + "type":"object", + "properties":{ + "fillId":{ + "type":"string", + "description":"Unique identifier representing the fill event", + "example":"606f207fc7aa2e91d028a17a" + }, + "orderId":{ + "type":"string", + "description":"Unique identifier of the order associated with the fill", + "example":"BtHEvgY1Bz1" + }, + "symbol":{ + "type":"string", + "description":"Symbol for the order associated with the fill", + "example":"ETH:USDT" + }, + "price":{ + "type":"number", + "description":"Execution price of the fill", + "example":209.9 + }, + "fillAmount":{ + "type":"number", + "description":"Amount filled (negative amount for a sell event, positive for a buy event)", + "example":-0.125622 + }, + "orderAmount":{ + "type":"number", + "description":"Initial amount for the placed order associated with the fill", + "example":-1 + }, + "date":{ + "type":"string", + "format":"date", + "description":"Date and time of the fill event", + "example":"2020-11-11T16:37:05.957" + }, + "orderCreationDate":{ + "type":"string", + "format":"date", + "description":"Date and time at which the order associated with the fill event was placed", + "example":"2020-11-11T16:37:05.262Z" + }, + "orderType":{ + "type":"string", + "description":"Type of the order associated with the fill event", + "example":true, + "enum":[ + "EXCHANGE LIMIT", + "EXCHANGE MARKET" + ] + }, + "orderActive":{ + "type":"boolean", + "description":"Whether the order associated with the fill event is still active", + "example":true + }, + "orderCanceled":{ + "type":"boolean", + "description":"Whether the order associated with the fill event was canceled", + "example":false + } + } + }, + "Model3":{ + "type":"array", + "items":{ + "$ref":"#/x-alt-definitions/Model2" + } + }, + "getFillsResponse":{ + "type":"object", + "properties":{ + "pagination":{ + "$ref":"#/x-alt-definitions/pagination" + }, + "items":{ + "$ref":"#/x-alt-definitions/Model3" + } + } + }, + "Model4":{ + "type":"object", + "properties":{ + "_id":{ + "type":"string", + "description":"Unique identifier representing this transfer", + "example":"MphMkBBZjnS" + }, + "token":{ + "type":"string", + "description":"Token transfered", + "example":"ETH" + }, + "amount":{ + "type":"number", + "description":"Amount transfered (effective amount received by the recipient)", + "example":3.14, + "minimum":0 + }, + "feeAmount":{ + "type":"number", + "description":"Transfer fee amount (in transfer token units)", + "example":3.14, + "minimum":0 + }, + "source":{ + "type":"string", + "description":"Source Ethereum address", + "example":"0x08152c1265dBc218ccc8Ab5C574e6bD52279b3B7" + }, + "recipient":{ + "type":"string", + "description":"Recipient Ethereum address", + "example":"0xeb3ea3ea9239577951523cafa9fd3072bc88e50a" + }, + "memo":{ + "type":"string", + "description":"Transfer memo", + "example":"my reference" + }, + "date":{ + "type":"string", + "format":"date", + "description":"Date and time of the transfer", + "example":"1990-04-14T00:20:00.000Z" + } + } + }, + "Model5":{ + "type":"array", + "items":{ + "$ref":"#/x-alt-definitions/Model4" + } + }, + "getTransfersResponse":{ + "type":"object", + "properties":{ + "pagination":{ + "$ref":"#/x-alt-definitions/pagination" + }, + "items":{ + "$ref":"#/x-alt-definitions/Model5" + } + } + }, + "encryptedTradingKey":{ + "type":"object", + "properties":{ + "dtk":{ + "type":"string", + "description":"The encrypted Stark trading key.", + "example":"6d840e6d251e2165e3214eecfcbcfa83c0f704439e16c69383d93fc0f704439e16c69383d93fc0f704439e16c69383d93fc0f704439e16c69383d93fc0f704439e16c69383d93f", + "minLength":66, + "maxLength":1000, + "pattern":"[a-zA-Z0-9]{66,}" + }, + "dtkVersion":{ + "type":"string", + "description":"Version of the trading key mechanism.", + "example":"v1", + "default":"v1" + } + } + }, + "exchangeSymbols":{ + "type":"array", + "description":"Currency pairs available at the DeversiFi exchange for trading", + "example":[ + "ETH:USDT" + ], + "items":{ + "type":"string" + } + }, + "newMarkets":{ + "type":"array", + "description":"Currency pairs that were newly added", + "example":[ + "ETH:USDT" + ], + "items":{ + "type":"string" + } + }, + "DVF":{ + "type":"object", + "description":"This contains application configuration details to set up for deposits and trading.", + "example":{ + "defaultFeeRate":0.002, + "deversifiAddress":"0x9ab450355b4ab504cbc0e4de484781dac08e6a26", + "starkExContractAddress":"0xF3731d0cdC9834f6F32104580bD226EF1bc1A9F9", + "exchangeSymbols":[ + "ETH:USDT", + "ZRX:USDT", + "ZRX:ETH", + "BTC:USDT", + "ETH:BTC" + ], + "newMarkets":[ + "ZRX:USDT", + "ZRX:ETH" + ], + "tempStarkVaultId":1 + }, + "properties":{ + "defaultFeeRate":{ + "type":"number", + "description":"The default fee rate, if no volume or maker discount.", + "example":0.2 + }, + "deversifiAddress":{ + "type":"string", + "description":"The address of the DeversiFi exchange.", + "example":"0x9ab450355b4ab504cbc0e4de484781dac08e6a26" + }, + "starkExContractAddress":{ + "type":"string", + "description":"Stark deposit contract address.", + "example":"0x69C6392Eb02a2882314134c98DDCBF73B7AdBab1" + }, + "exchangeSymbols":{ + "$ref":"#/x-alt-definitions/exchangeSymbols" + }, + "newMarkets":{ + "$ref":"#/x-alt-definitions/newMarkets" + }, + "tempStarkVaultId":{ + "type":"number", + "description":"Transit Stark vault ID used for deposit privacy", + "example":1 + }, + "minDepositUSDT":{ + "type":"number", + "description":"Minimum deposit amount denominated in USDT", + "example":1 + } + } + }, + "tokenRegistry":{ + "type":"object" + }, + "registerResponseUserRegisteredOnChain":{ + "type":"object", + "example":{ + "isRegistered":true, + "ethAddress":"0xe16841977feae28ce69f9d6b6f3fcf1e9610f2fe", + "DVF":{ + "defaultFeeRate":0.002, + "deversifiAddress":"0xc0e9bd267626e2393ddaf520ae5df27ef6c533bd", + "starkExContractAddress":"0x5783323064dDa4A1ebe62defFeF46750BD2C560c", + "exchangeSymbols":[ + "ETH:USDT", + "ZRX:USDT", + "ZRX:ETH", + "BTC:USDT", + "ETH:BTC" + ], + "newMarkets":[ + "ZRX:USDT", + "ZRX:ETH" + ], + "tempStarkVaultId":1, + "minDepositUSDT":1 + }, + "tokenRegistry":{ + "ETH":{ + "decimals":18, + "quantization":10000000000, + "minOrderSize":0.05, + "starkTokenId":"0xb333e3142fe16b78628f19bb15afddaef437e72d6d7f5c6c20c6801a27fba6" + }, + "USDT":{ + "decimals":6, + "quantization":1, + "minOrderSize":10, + "settleSpread":0, + "starkTokenId":"0x4507594b0258664463ad7bd1d1e9b1ff67821113abd1b9c7e082bb304da322", + "tokenAddress":"0x1c0f17436740bfb92c1070ee86322de890837c6a" + }, + "ZRX":{ + "decimals":18, + "quantization":10000000000, + "minOrderSize":10, + "starkTokenId":"0x3901ee6a6c5ac0f6e284f4273b961b7e9f29d25367d31d90b75820473a202f7", + "tokenAddress":"0xcd077abedd831a3443ffbe24fb76661bbb17eb69" + }, + "BTC":{ + "decimals":18, + "quantization":10000000000, + "minOrderSize":0.0004, + "starkTokenId":"0x21ef21d6b234cd669edd702dd3d1d017be888337010b950ae3679eb4194b4bc", + "tokenAddress":"0x40d8978500bf68324a51533cd6a21e3e59be324a" + } + } + }, + "properties":{ + "isRegistered":{ + "type":"boolean", + "description":"Registration status.", + "example":true, + "enum":[ + true + ] + }, + "ethAddress":{ + "type":"string", + "description":"Ethereum address.", + "example":"0x278ff3bb25c5b1bb7032e822661974479280fa74" + }, + "DVF":{ + "$ref":"#/x-alt-definitions/DVF" + }, + "tokenRegistry":{ + "$ref":"#/x-alt-definitions/tokenRegistry" + } + }, + "required":[ + "isRegistered", + "ethAddress" + ] + }, + "registerResponseUserNotRegisteredOnChain":{ + "type":"object", + "properties":{ + "isRegistered":{ + "type":"boolean", + "description":"Registration status.", + "example":false, + "enum":[ + false + ] + }, + "deFiSignature":{ + "type":"string", + "description":"Deversifi Signature", + "example":"0x0277b6e85ffdfb8cdc34c89b8d7ef19e915daf00327db91c1f5a1988666089e6b8420881699501" + } + }, + "required":[ + "isRegistered", + "deFiSignature" + ] + }, + "starkOrder":{ + "type":"object", + "description":"Stark order related meta information.", + "properties":{ + "vaultIdSell":{ + "type":"number", + "description":"The vault ID of the seller." + }, + "vaultIdBuy":{ + "type":"number", + "description":"The vault ID of the buyer." + }, + "amountSell":{ + "type":"string", + "description":"The total amount to be sold." + }, + "amountBuy":{ + "type":"string", + "description":"The total amount to be bought." + }, + "tokenSell":{ + "type":"string", + "description":"The Stark token ID for the token being sold." + }, + "tokenBuy":{ + "type":"string", + "description":"The Stark token ID for the token being bought." + }, + "nonce":{ + "type":"number", + "description":"Nonce value." + }, + "expirationTimestamp":{ + "type":"number", + "description":"Expiration timestamp of the order." + } + } + }, + "starkSignature":{ + "type":"object", + "description":"Stark signature consisting of consisting of \"r\" and \"s\"", + "example":{ + "v":"3b46dfe03caef623048fedc8457a92385cd63eff6349ad135c945cd84937677", + "r":"1f38f551d798562c16d28733c7e3ff6850898d82f0ac9ccd39d373303b1778c", + "s":"518560420e52a37e9f580f024fc0fe8572cb2f5437a839075bbf4b2b123d572" + }, + "properties":{ + "v":{ + "type":"string", + "description":"The \"v\" part of the Stark signature." + }, + "r":{ + "type":"string", + "description":"The \"r\" part of the Stark signature." + }, + "s":{ + "type":"string", + "description":"The \"s\" part of the Stark signature." + } + }, + "required":[ + "r", + "s" + ] + }, + "submitOrderMeta":{ + "type":"object", + "description":"A set of meta values.", + "example":{ + "starkOrder":{ + "vaultIdSell":1000002, + "vaultIdBuy":1000001, + "amountSell":"97400000", + "amountBuy":"100000000000000000", + "tokenSell":"0x2", + "tokenBuy":"0x1", + "nonce":0, + "expirationTimestamp":438947 + }, + "ethAddress":"0x341E46a49F15785373edE443Df0220DEa6a41Bbc", + "starkPublicKey":{ + "x":"0746919ecbb54563de512f6fb556c21dab091748b41a60a946dbdbf118ac0a85", + "y":"58f7ce5eb6eb5bd24f70394622b1f4d2c54ebca317a3e61bf9f349dccf166cf" + }, + "starkSignature":{ + "r":"5d14357fcf8f489218de0855267c6f64bc463135debf62680ad796e63cd6d3b", + "s":"786ab874d91e3a5871134955fcb768914754760a0ada326af67f758f32819cf" + } + }, + "properties":{ + "starkOrder":{ + "$ref":"#/x-alt-definitions/starkOrder" + }, + "ethAddress":{ + "type":"string", + "description":"The Ethereum public address." + }, + "feature":{ + "type":"string", + "description":"Origin of the order" + }, + "platform":{ + "type":"string", + "description":"Platform on which the order was initiated", + "default":"DESKTOP", + "enum":[ + "DESKTOP", + "MOBILE" + ] + }, + "starkPublicKey":{ + "$ref":"#/x-alt-definitions/tokenRegistry" + }, + "starkSignature":{ + "$ref":"#/x-alt-definitions/starkSignature" + } + }, + "required":[ + "starkSignature" + ] + }, + "submitOrderPayload":{ + "type":"object", + "properties":{ + "cid":{ + "type":"string", + "description":"Optional custom order ID that could be set when placing order and used later to retrieve order. This ID is unique per user (user A and B can each have an order with cid = AAA, but the same user cannot have two orders with the same cid)", + "example":"long-123" + }, + "gid":{ + "type":"string" + }, + "type":{ + "type":"string", + "description":"The type of order. Currently only “EXCHANGE_LIMIT” is accepted.", + "example":"EXCHANGE LIMIT", + "enum":[ + "EXCHANGE LIMIT", + "exchange limit", + "EXCHANGE MARKET", + "exchange market" + ] + }, + "symbol":{ + "type":"string", + "description":"The trading pair.", + "example":"ETH:USDT" + }, + "amount":{ + "type":"string", + "description":"The token amount to be traded. Will be rounded up to 8 decimal places.", + "example":"0.1" + }, + "price":{ + "type":"string", + "description":"The cost per unit. Will be rounded down to 5 significant digits.", + "example":"1000" + }, + "meta":{ + "$ref":"#/x-alt-definitions/submitOrderMeta" + }, + "protocol":{ + "type":"string", + "enum":[ + "stark" + ] + }, + "partnerId":{ + "type":"string" + }, + "feeRate":{ + "type":"string", + "example":0.002 + }, + "isPostOnly":{ + "type":"boolean", + "description":"Flag to indicate if the order is post-only. Mutually exclusive with isFillOrKill" + }, + "isHidden":{ + "type":"boolean", + "description":"Flag to indicate if the order is hidden." + }, + "isFillOrKill":{ + "type":"boolean", + "description":"Flag to indicate if fill or kill order. Mutually exclusive with isPostOnly" + }, + "isSlippageDisabled":{ + "type":"boolean", + "description":"Flag to indicate if slippage protection is disabled." + } + }, + "required":[ + "type", + "symbol", + "amount", + "price", + "meta" + ] + }, + "Model6":{ + "type":"array", + "items":{ + "$ref":"#/x-alt-definitions/submitOrderPayload" + } + }, + "submitOrderResponse":{ + "type":"object", + "properties":{ + "_id":{ + "type":"string", + "description":"Id for the order. This can be used for orderId when calling cancelOrder or getOrder", + "example":"L1tarX5wUem" + }, + "user":{ + "type":"string", + "description":"Ethereum address of the user", + "example":"E0xc1caf2d76c49e4a60635635c329a3ac22ddeb547" + }, + "symbol":{ + "type":"string", + "description":"Trading symbol for the order", + "example":"ETH:USDT" + }, + "tokenSell":{ + "type":"string", + "description":"The token which is being sold", + "example":"ETH" + }, + "tokenBuy":{ + "type":"string", + "description":"The token which is being bought", + "example":"USDT" + }, + "amount":{ + "type":"number", + "description":"Original order size placed being sold or bought.", + "example":"-0.5" + }, + "feeRate":{ + "type":"string", + "description":"Applied fee rate for this order", + "example":0.002 + }, + "meta":{ + "$ref":"#/x-alt-definitions/tokenRegistry" + }, + "cancelRequested":{ + "type":"boolean", + "description":"Whether or not this order was canceled by the user", + "example":true + }, + "pending":{ + "type":"boolean", + "description":"Whether or not this order is still pending to be filled", + "example":true + }, + "tokenSellLockedBalance":{ + "type":"string", + "description":"Amount (quantized) of token being locked to honor the order", + "example":"50000000" + }, + "price":{ + "type":"number", + "description":"Cost per unit.", + "example":"200" + }, + "type":{ + "type":"string", + "description":"Type of the order. Currently, \"EXCHANGE LIMIT\" is the only type that is supported.", + "example":"EXCHANGE LIMIT" + }, + "createdAt":{ + "type":"string", + "description":"The date and time when the order was created.", + "example":"2020-05-09T18:29:56.603Z" + }, + "updatedAt":{ + "type":"string", + "description":"The date and time when the order was last updated.", + "example":"2020-05-09T18:29:56.945Z" + }, + "activatedAt":{ + "type":"string", + "description":"The date and time when the order was activated.", + "example":"2020-05-09T18:29:56.944Z" + }, + "isPostOnly":{ + "type":"boolean", + "description":"Flag to indicate if the order is post-only.", + "example":false + }, + "isHidden":{ + "type":"boolean", + "description":"Flag to indicate if the order is hidden.", + "example":false + }, + "isFillOrKill":{ + "type":"boolean", + "description":"Flag to indicate if fill or kill order.", + "example":false + }, + "isSlippageDisabled":{ + "type":"boolean", + "description":"Flag to indicate if slippage protection is disabled.", + "example":false + }, + "cid":{ + "type":"string", + "description":"An optional user-defined identifier for this order", + "example":"satoshi-order-2083236893" + } + } + }, + "Model7":{ + "type":"array", + "items":{ + "$ref":"#/x-alt-definitions/submitOrderResponse" + } + } +} } From 7ae5b4f2f1936116724d0306f2d97068b50a9bcc Mon Sep 17 00:00:00 2001 From: neozaru Date: Thu, 6 Jan 2022 16:31:47 -0800 Subject: [PATCH 6/8] feat: VEN-54 dynamic doc fetching + various fixes --- src/spec/getBodyExample.js | 2 +- src/spec/getEndpoints.js | 18 +- src/spec/getParamExample.js | 20 +- src/spec/getSidebar.js | 27 +- src/spec/index.js | 28 +- src/spec/makePythonCode.js | 2 +- src/spec/makeWscatCode.js | 5 +- src/spec/mapeCppCode.js | 2 +- src/spec/swagger-overlay.json | 241 +- src/spec/swagger-v12--submitted.json | 7910 ----------------- src/ui/Docs/DocsScreen.jsx | 9 +- .../SmartContractsSection.jsx | 2 +- src/ui/common/Tabs.jsx | 1 - 13 files changed, 82 insertions(+), 8185 deletions(-) delete mode 100644 src/spec/swagger-v12--submitted.json diff --git a/src/spec/getBodyExample.js b/src/spec/getBodyExample.js index 11b20dc..db1d740 100644 --- a/src/spec/getBodyExample.js +++ b/src/spec/getBodyExample.js @@ -10,7 +10,7 @@ export function getExampleFromSchema(schema) { case 'number': return schema.example; case 'object': - return mapValues(schema.properties, getExampleFromSchema); + return schema.example || mapValues(schema.properties, getExampleFromSchema); } } diff --git a/src/spec/getEndpoints.js b/src/spec/getEndpoints.js index 4d02292..60dd306 100644 --- a/src/spec/getEndpoints.js +++ b/src/spec/getEndpoints.js @@ -40,14 +40,6 @@ export function getEndpoints(spec) { requestDetails }; - if (method === 'ws') { - const wscat = makeWscatCode(spec, entry, path); - endpoint.wscat = wscat; - } else { - const curl = makeCurlCode(spec, entry, path, method); - endpoint.curl = curl; - } - endpoints.push(endpoint); }); return endpoints; @@ -65,6 +57,13 @@ function getHeaders(entry) { function getCalls(spec, entry, path, method) { return [ + { + language: 'bash', + name: method === 'ws' ? 'wscat' : 'cURL', + content: method === 'ws' + ? makeWscatCode(spec, entry, path) + : makeCurlCode(spec, entry, path, method) + }, { language: 'js', name: 'JavaScript', @@ -85,11 +84,12 @@ function getCalls(spec, entry, path, method) { content: method === 'ws' ? makeWsCppCode(spec, entry, path) : makeCppCode(spec, entry, path, method) - }, + } ]; } function buildExample(schema) { + console.log('build example', schema) const schemaWideExample = getParamExample(schema) if (schemaWideExample !== undefined) { return schemaWideExample diff --git a/src/spec/getParamExample.js b/src/spec/getParamExample.js index 9b53828..6acf3d0 100644 --- a/src/spec/getParamExample.js +++ b/src/spec/getParamExample.js @@ -1,15 +1,15 @@ -export function getParamExample(queryParam = {}) { - if (queryParam.hasOwnProperty('example')) { - return queryParam['example'] +export function getParamExample(params = {}) { + if (params.hasOwnProperty('example')) { + return params['example'] } - if (queryParam.hasOwnProperty('x-example')) { - return queryParam['x-example'] + if (params.hasOwnProperty('x-example')) { + return params['x-example'] } - if (queryParam.hasOwnProperty('default')) { - return queryParam.default + if (params.hasOwnProperty('default')) { + return params.default } - if (queryParam.enum && queryParam.enum.length > 0) { - return queryParam.enum[0] + if (params.enum && params.enum.length > 0) { + return params.enum[0] } -} \ No newline at end of file +} diff --git a/src/spec/getSidebar.js b/src/spec/getSidebar.js index 05ffd2d..0736d40 100644 --- a/src/spec/getSidebar.js +++ b/src/spec/getSidebar.js @@ -4,15 +4,35 @@ var categoriesToExclude = [ 'internal', // Here to stay but for internal use 'deprecated', // Is meant to disapear in the future / not to be used anymore 'hidden' // Hidden for other reasons (ex: feature not released yet) -] +]; + +var categoriesOrder = [ + 'platform', + 'wallet', + 'trading', + 'amm', + 'market', + 'governance', + 'dlm', + 'account', + 'public', + 'integration' +]; + +const getCategoryWeight = (category) => { + return categoriesOrder.length - categoriesOrder.indexOf(category.name.toLowerCase()) +}; export function getSidebar(spec) { const categories = new Map(); - forEachEndpoint(spec, (entry, orgPath) => { + forEachEndpoint(spec, (entry, orgPath, method) => { const categoryName = entry.tags && entry.tags[0]; const category = categories.get(categoryName) || {name: categoryName, items: []}; category.items.push({ - title: entry.title || orgPath, + title: + entry.title || // From swagger overlay JSON when entered manually + entry.description || // From 'notes' field of dvf-pub-api route options if exists + `${method.toUpperCase()} ${orgPath}`, // GET/POST by default name: entry.operationId, link: '#' + entry.operationId, }); @@ -20,4 +40,5 @@ export function getSidebar(spec) { }); return [...categories.values()] .filter(category => !categoriesToExclude.includes(category.name.toLowerCase())) + .sort((categoryA, categoryB) => getCategoryWeight(categoryB) - getCategoryWeight(categoryA)) } diff --git a/src/spec/index.js b/src/spec/index.js index f9017b8..a2a8deb 100644 --- a/src/spec/index.js +++ b/src/spec/index.js @@ -1,9 +1,14 @@ -import swaggerData from './swagger-v12--submitted.json'; import swaggerMarketData from './swagger-market-data.json'; import swaggerOverlay from './swagger-overlay.json'; import {preprocess} from './preprocess'; import merge from 'lodash.merge'; +import request from 'request'; + +// Swagger URL to be fetched from prod +const swaggerJsonUrl = process.env.SWAGGER_URL || 'https://api.deversifi.com/v1/trading/docs/swagger.json' +// But endpoints to be reached on staging for "Try Endpoint" buttons +const endpointsHost = process.env.ENDPOINTS_HOST || 'api.stg.deversifi.com' const parseRefs = (properties, definitions) => { Object.keys(properties).forEach(propKey => { @@ -56,8 +61,21 @@ const conciliation = data => { return data; }; -export function loadSpec() { - const spec = conciliation(swaggerData); - const fullSpec = merge(spec, swaggerMarketData, swaggerOverlay); - return preprocess(fullSpec); +export function loadSpecAsync() { + return new Promise((resolve, reject) => { + return request(swaggerJsonUrl, function (error, response, body) { + if (error) { + return reject(error); + } + const fetchedSwaggerData = JSON.parse(body); + const swaggerDataToUse = { + ...fetchedSwaggerData, + host: endpointsHost, + schemes: ['https'] + }; + const spec = conciliation(swaggerDataToUse); + const fullSpec = merge(spec, swaggerMarketData, swaggerOverlay); + return resolve(preprocess(fullSpec)); + }); + }); } diff --git a/src/spec/makePythonCode.js b/src/spec/makePythonCode.js index ba52170..d950856 100644 --- a/src/spec/makePythonCode.js +++ b/src/spec/makePythonCode.js @@ -25,7 +25,7 @@ export function makePythonCode(spec, entry, path, method) { } export function makeWsPythonCode(spec, entry, path) { - const url = `'wss://${spec.host}/${path}'`; + const url = `'wss://${spec.host}${path}'`; const subParams = getWsSubscribeParams(entry.parameters, entry.operationId); return ( `ws = websocket.WebSocketApp(${url})\n` + diff --git a/src/spec/makeWscatCode.js b/src/spec/makeWscatCode.js index bfb1ffb..af51156 100644 --- a/src/spec/makeWscatCode.js +++ b/src/spec/makeWscatCode.js @@ -1,11 +1,10 @@ import {getWsSubscribeParams} from './makeJsCode'; export function makeWscatCode(spec, entry, path) { - const url = `'wss://${spec.host}/${path}'`; + const url = `'wss://${spec.host}${path}'`; const subParams = getWsSubscribeParams(entry.parameters, entry.operationId); const code = `wscat -c ${url} - < {"event":"info","version":2,"serverId":"11111111-1111-1111-1111-111111111111","platform":{"status":1}} - > {${subParams.map((p) => `${p.name}:${p.value}`)}}`; + {${subParams.map((p) => `${p.name}:${p.value}`)}}`; return code; } diff --git a/src/spec/mapeCppCode.js b/src/spec/mapeCppCode.js index 225404e..f8e585a 100644 --- a/src/spec/mapeCppCode.js +++ b/src/spec/mapeCppCode.js @@ -53,7 +53,7 @@ std::cout << response.str() << std::endl; } export function makeWsCppCode(spec, entry, path) { - const url = `wss://${spec.host}/${path}`; + const url = `wss://${spec.host}${path}`; const subParams = getWsSubscribeParams(entry.parameters, entry.operationId); return `// Required on Windows ix::initNetSystem(); diff --git a/src/spec/swagger-overlay.json b/src/spec/swagger-overlay.json index fd1a25c..6b8541f 100644 --- a/src/spec/swagger-overlay.json +++ b/src/spec/swagger-overlay.json @@ -541,29 +541,6 @@ } } }, - "/v1/trading/r/getOrder":{ - "post":{ - "title":"Order", - "responses":{ - "default":{ - "examples":{ - "application/json":[ - { - "_id": "HrPujXPVQBY", - "symbol": "ETH:USDT", - "amount": -0.3, - "price": 280, - "totalFilled": 0, - "pending": false, - "canceled": false, - "active": true - } - ] - } - } - } - } - }, "/v1/trading/r/getPendingWithdrawals":{ "post":{ "title":"Pending Withdrawals", @@ -706,21 +683,6 @@ } } }, - "/v1/trading/r/getWithdrawal":{ - "post":{ - "title":"Get Withdrawal" - } - }, - "/v1/trading/r/openOrders":{ - "post":{ - "title":"All Orders" - } - }, - "/v1/trading/r/orderHistory":{ - "post":{ - "title":"Order History" - } - }, "/v1/trading/r/withdrawHistory":{ "post":{ "title":"Withdrawal History" @@ -736,41 +698,7 @@ "title":"Cancel Withdrawal" } }, - "/v1/trading/w/deposit":{ - "post":{ - "title":"New Deposit", - "operationId": "postV1TradingWDeposit", - "responses":{ - "default":{ - "examples":{ - "application/json":{ - "pending": true, - "user": "0x52d92399dfb73df49383614170880ba09b66338e", - "token": "ETH", - "amount": "1020400", - "meta": { - "ethAddress": "0x52d92399dfb73df49383614170880ba09b66338e", - "starkKey": "00e0326547480bc8bf0fb143f08d23d3ff85aa450e6253bb721dee1410a83b73", - "starkVaultId": 1937164364, - "starkTokenId": "0xb333e3142fe16b78628f19bb15afddaef437e72d6d7f5c6c20c6801a27fba6", - "expireTime": 442425, - "starkMessage": "598f0f08033ca8bf16552d460b2510715c689d630ef5480d50c17ada5541821", - "starkSignature": { - "r": "5a00d9ebdfac03fdbe55f393b34fd252447cdee79179c8c0a5227b2fe2e577", - "s": "58e2d3972f1d482b26440197b518bb0bdeb50d03750e731118bafe3a819989d", - "recoveryParam": 1 - }, - "nonce": 162543006 - }, - "_id": "FyqJSSXFXPU", - "createdAt": "2020-05-22T09:43:36.348Z", - "updatedAt": "2020-05-22T09:43:36.348Z" - } - } - } - } - } - }, + "/v1/trading/w/register":{ "post":{ "title":"Register" @@ -781,117 +709,6 @@ "title": "Submit Order" } }, - "/v1/trading/r/getBalanceForUser/{userEthAddress}": { - "post": { - "title": "Get User Balances", - "summary": "This is used to retrieve the total and active balances of a user per token. Active balance is the balance that is currently available. Total balance (specified as balance) is the sum of all the balances including those locked for trading.", - "operationId": "postV1TradingRGetbalanceforuserUserethaddress", - "parameters": [ - { - "type": "string", - "description": "The ETH address of a potential user", - "name": "userEthAddress", - "in": "path", - "required": true - }, - { - "in": "body", - "name": "body", - "schema": { - "type": "object", - "properties": { - "token": { - "type": "string", - "description": "The token which the balance is specifically requested for.", - "example": "ETH" - }, - "fields": { - "type": "array", - "description": "Specific fields to be returned for balance information", - "example": [ - "balance", - "updatedAt" - ], - "items": { - "type": "string", - "enum": [ - "balance", - "available", - "locked", - "updatedAt" - ] - } - } - } - } - } - ], - "tags": [ - "Trading", - "public" - ], - "responses": { - "default": { - "schema": { - "type": "array", - "items": { - "type": "object", - "properties": { - "token": { - "type": "string", - "description": "The token for which the balances are provided.", - "example": "ETH" - }, - "balance": { - "type": "number", - "description": "It is the total balance for the user corresponding to the specified token.", - "example": 42 - }, - "available": { - "type": "number", - "description": "It is the part of the balance available for use.", - "example": 23 - }, - "locked": { - "type": "number", - "description": "It is the part of the balance currently in open orders or pending withdrawal.", - "example": 19 - } - } - } - }, - "examples": { - "application/json": [ - { - "token": "BTC", - "balance": 0, - "available": 0, - "locked": 0 - }, - { - "token": "ETH", - "balance": 114036369, - "available": 89036369, - "locked": 25000000 - }, - { - "token": "KON", - "balance": 99800000, - "available": 99800000, - "locked": 0 - }, - { - "token": "USDT", - "balance": 2781535529, - "available": 2781535529, - "locked": 0 - } - ] - } - } - } - } - }, "/v1/trading/r/publicTradeHistory/{user}": { "get": { "title": "User Trade History", @@ -1182,7 +999,7 @@ }, "/v1/trading/fills": { "get": { - "title": "Fills history", + "title": "Fills History", "operationId": "getV1TradingFills", "summary": "This method is used to get the history of fills (executed trades) for the authenticated user", "responses": { @@ -2014,58 +1831,6 @@ } } } - }, - "/v1/trading/allowances": { "get": { "title": "Allowance" } }, - "/v1/trading/balanceHistory": { "get": { "title": "Balance History" } }, - "/v1/trading/depositsAndWithdrawals": { "get": { "title": "Deposit/Withdraw History" } }, - "/v1/trading/entityAccounts": { "get": { "title": "Entity Accounts" } }, - "/v1/trading/r/airdropEligibility": { "get": { "title": "Airdrop Eligibility" } }, - "/v1/trading/r/fastWithdrawalFee": { "get": { "title": "Fast Withdrawal Fee" } }, - "/v1/trading/r/fastWithdrawalMaxAmount": { "get": { "title": "Fast Withdrawal Limits" } }, - "/v1/trading/r/feeRate": { "get": { "title": "Fees" } }, - "/v1/trading/r/gasSavings": { "get": { "title": "Gas Savings" } }, - "/v1/trading/r/getBalanceUsd": { "get": { "title": "USD Balance" } }, - "/v1/trading/r/getConf": { "get": { "title": "Get Configuration" }, "post": { "title": "Get Configuration" } }, - "/v1/trading/r/getGasPrice": { "get": { "title": "Get Gas Price" }, "post": { "title": "Get Gas Price" } }, - "/v1/trading/r/getTokenCirculatingSupply": { "get": { "title": "Token Supply" } }, - "/v1/trading/r/getTokenHolders": { "get": { "title": "Token Holders" } }, - "/v1/trading/r/getTokenLiquidityLeft": { "get": { "title": "Token Liquidity" } }, - "/v1/trading/r/getTokenSaleStartEnd": { "get": { "title": "Sale start/end" } }, - "/v1/trading/r/registeredAccounts": { "get": { "title": "Registered Accounts" } }, - "/v1/trading/r/tokenBalancesHistory": { "get": { "title": "Token Balances History" } }, - "/v1/trading/r/totalValueLocked": { "get": { "title": "Allowance" } }, - "/v1/trading/r/tradeHistory": { "get": { "title": "Trade History" } }, - "/v1/trading/r/vaultIdAndStarkKey": { "get": { "title": "VaultId + StarkKey" } }, - "/v1/trading/r/votingPower": { "get": { "title": "Voting Power" } }, - "/v1/trading/registrations/{targetEthAddress}": { "get": { "title": "Registration Status" } }, - "/v1/trading/bridgedDeposits": { "post": { "title": "Bridged Deposit" } }, - "/v1/trading/bridgedWithdrawals": { "post": { "title": "Bridged Withdrawal" } }, - "/v1/trading/deposits": { "post": { "title": "Deposit" } }, - "/v1/trading/deposits-validate": { "post": { "title": "Dry Run Deposit" } }, - "/v1/trading/withdrawals": { "post": { "title": "Withdraw" } }, - "/v1/trading/amm/fundingOrderData": { "get": { "title": "AMM Funding Order Data" } }, - "/v1/trading/amm/fundingOrders": { "post": { "title": "AMM Funding Order" } }, - "/v1/trading/r/addAirdrops": { "post": { "title": "Add Airdrops" } }, - "/v1/trading/r/hasReceivedCompensation": { "post": { "title": "Check Received Bonus" } }, - "/v1/trading/r/recoverTradingKey": { "post": { "title": "Recover DTK" } }, - "/v1/trading/r/userOrderCount": { "post": { "title": "User Order Count" } }, - "/v1/trading/w/cancelOpenOrders": { "post": { "title": "Cancel All Orders" } }, - "/v1/trading/w/claimAirdrop": { "post": { "title": "Claim Airdrop" } }, - "/v1/trading/w/fastWithdrawal": { "post": { "title": "Fast-Withdraw" } }, - "/v1/trading/w/feedback": { "post": { "title": "Feedback Subscribe" } }, - "/v1/trading/w/storeStarkTradingKey": { "post": { "title": "Store DTK" } }, - "/v1/trading/w/transfer": { "post": { "title": "Transfer" } }, - "/v1/trading/collateralBalances": { "get": { "title": "Collateral Balances" } }, - "/v1/trading/r/beehiveStats": { "get": { "title": "Beehive Stats" } }, - "/v1/trading/r/swapVolume": { "get": { "title": "Swap Volume" } }, - "/v1/trading/r/transferVolume": { "get": { "title": "Transfer Volume" } }, - "/v1/trading/r/tradeCountSince": { "get": { "title": "Trade Count Since" } }, - "/v1/trading/r/trades/{symbol}": { "get": { "title": "Trades For Pair" } }, - "/v1/trading/r/24HoursVolume/{year}/{month}/{day}": { "get": { "title": "24H Volume" } }, - "/v1/trading/r/tradesSince/{symbol}/{startDate}/{limit}": { "get": { "title": "Trades For Pair Since" } }, - "/v1/trading/r/getPublicPermissions": { "get": { "title": "Public Permissions" } }, - "/v1/trading/w/notifications": { "post": { "title": "Add Notification" } }, - "/v1/trading/w/notifications/{id}": { "delete": { "title": "Remove Notification" } } - + } } } diff --git a/src/spec/swagger-v12--submitted.json b/src/spec/swagger-v12--submitted.json deleted file mode 100644 index 39b5911..0000000 --- a/src/spec/swagger-v12--submitted.json +++ /dev/null @@ -1,7910 +0,0 @@ -{ - "swagger": "2.0", - "host": "api.stg.deversifi.com", - "basePath": "/", - "schemes": [ - "https" - ], - "info": { - "title": "Deversifi API documentation", - "version": "2.0.0", - "description": "dvf-pub-api" - }, - "tags": [], - "paths":{ - "/v1/trading/allowances":{ - "get":{ - "summary":"This method is used to get the allowance of the user for using DeversiFi features (deposit, withdraw, trade, transfer)", - "operationId":"getV1TradingAllowances", - "parameters":[ - { - "type":"string", - "description":"Base64 of {signature, nonce} JSON representation", - "name":"authorization", - "in":"header", - "x-example":"EcRecover eyJub25jZSI6InYyLTE3MDQxMTQwNjEuMDAwIiwic2lnbmF0dXJlIjoiMHgyYjQ4ZDUzZjJlM2E2OTY2MzBlYmRjZDFmZjA1NzU1NmJiYzlkZTljMjk0YWRmYWE1YjFmMTNkZjkxYjY3YjM0N2ZkZDg4YzI5NTk0YzM3N2JhMDAyNGRlYzQwY2Q5ODA4ODI5ZTdmNDQ0Nzc3MjQ4MmY1MGE3YThlOWE5MDM1NjFjIn0=", - "required":true - } - ], - "tags":[ - "Trading" - ], - "responses":{ - "200":{ - "schema":{ - "$ref":"#/definitions/getAllowanceResponse" - }, - "description":"Successful" - } - } - } - }, - "/v1/trading/balanceHistory":{ - "get":{ - "summary":"Balance history of the authenticated user", - "operationId":"getV1TradingBalancehistory", - "parameters":[ - { - "type":"string", - "description":"Base64 of {signature, nonce} JSON representation", - "name":"authorization", - "in":"header", - "x-example":"EcRecover eyJub25jZSI6InYyLTE3MDQxMTQwNjEuMDAwIiwic2lnbmF0dXJlIjoiMHgyYjQ4ZDUzZjJlM2E2OTY2MzBlYmRjZDFmZjA1NzU1NmJiYzlkZTljMjk0YWRmYWE1YjFmMTNkZjkxYjY3YjM0N2ZkZDg4YzI5NTk0YzM3N2JhMDAyNGRlYzQwY2Q5ODA4ODI5ZTdmNDQ0Nzc3MjQ4MmY1MGE3YThlOWE5MDM1NjFjIn0=", - "required":true - }, - { - "type":"string", - "description":"This nonce which used to provide the time until which this nonce is valid. It is presented as seconds since epoch.", - "name":"nonce", - "in":"query", - "x-example":"v2-1704114061.000", - "required":false - }, - { - "type":"string", - "description":"The signature obtained by signing the nonce with your private ethereum key.", - "name":"signature", - "in":"query", - "x-example":"0x2b48d53f2e3a696630ebdcd1ff057556bbc9de9c294adfaa5b1f13df91b67b347fdd88c29594c377ba0024dec40cd9808829e7f4447772482f50a7a8e9a903561c", - "required":false - }, - { - "type":"string", - "description":"duration for the history to fetch", - "enum":[ - "1d", - "1m", - "1w", - "1y" - ], - "x-convert":{ - "case":"lower" - }, - "name":"duration", - "in":"query", - "x-example":"1d", - "required":true - } - ], - "tags":[ - "Trading" - ], - "responses":{ - "200":{ - "schema":{ - "$ref":"#/definitions/balanceHistorySchema" - }, - "description":"Successful" - } - } - } - }, - "/v1/trading/collateralBalances":{ - "get":{ - "summary":"Returns information about collateral balances (internal use)", - "operationId":"getV1TradingCollateralbalances", - "parameters":[ - { - "type":"string", - "name":"token", - "in":"query", - "required":false - } - ], - "tags":[ - "Internal" - ], - "responses":{ - "200":{ - "schema":{ - "$ref":"#/definitions/collateralBalancesSchema" - }, - "description":"Successful" - } - } - } - }, - "/v1/trading/depositsAndWithdrawals":{ - "get":{ - "summary":"This method is used to get the history of deposits and withdrawals for the authenticated user", - "operationId":"getV1TradingDepositsandwithdrawals", - "parameters":[ - { - "type":"string", - "description":"Base64 of {signature, nonce} JSON representation", - "name":"authorization", - "in":"header", - "x-example":"EcRecover eyJub25jZSI6InYyLTE3MDQxMTQwNjEuMDAwIiwic2lnbmF0dXJlIjoiMHgyYjQ4ZDUzZjJlM2E2OTY2MzBlYmRjZDFmZjA1NzU1NmJiYzlkZTljMjk0YWRmYWE1YjFmMTNkZjkxYjY3YjM0N2ZkZDg4YzI5NTk0YzM3N2JhMDAyNGRlYzQwY2Q5ODA4ODI5ZTdmNDQ0Nzc3MjQ4MmY1MGE3YThlOWE5MDM1NjFjIn0=", - "required":true - }, - { - "type":"string", - "x-convert":{ - "case":"upper" - }, - "name":"token", - "in":"query", - "x-example":"ETH" - }, - { - "type":"string", - "format":"date", - "name":"startDate", - "in":"query", - "x-example":"2020-01-01 13:45" - }, - { - "type":"string", - "format":"date", - "name":"endDate", - "in":"query", - "x-example":"2025-12-31 23:45" - }, - { - "type":"string", - "default":"date", - "enum":[ - "date" - ], - "name":"sortBy", - "in":"query" - }, - { - "type":"string", - "default":"DESC", - "enum":[ - "ASC", - "DESC" - ], - "name":"sortDirection", - "in":"query" - }, - { - "type":"integer", - "default":0, - "minimum":0, - "name":"skip", - "in":"query" - }, - { - "type":"integer", - "default":20, - "minimum":1, - "maximum":100, - "name":"limit", - "in":"query" - } - ], - "tags":[ - "Trading" - ], - "responses":{ - "200":{ - "schema":{ - "$ref":"#/definitions/getDepositsAndWithdrawalsResponse", - "x-alternatives":[ - { - "$ref":"#/x-alt-definitions/getDepositsAndWithdrawalsResponse" - }, - { - "type":"string", - "description":"Response in CSV format", - "example":"id,type,token,amount,transactionHash,date,sourceOrRecipient8oXSt1ry5EZ,Deposit,ETH,0.1,0x43154dc90de6c578d14fbe1ddae352e3a5fdc42d5944b122ac7c6c41f360d76a,1990-04-14T00:00:00.000Z,0x08152c1265dbc218ccc8ab5c574e6bd52279b3b77kyGeby7RR8,FastWithdrawal,USDT,100,0xe2d59c0e5fec11b23fb159483551b28ad80907937908fa5df26ba9b2045d4397,1990-04-14T00:02:00.000Z,0xeb3ea3ea9239577951523cafa9fd3072bc88e50aDDi37hQZSHg,Withdrawal,ETH,0.05,0x2c892f7a0326a380f027b8ef4a1a15747083ba2471313c5a30a8510d3132a18e,1990-04-14T00:04:00.000Z,0x2d5752b42440139a130f453e0c646e6e656dded4" - } - ] - }, - "description":"Successful" - } - } - } - }, - "/v1/trading/entityAccounts":{ - "get":{ - "summary":"This method is used to get the entity account information for user address (KYC)", - "operationId":"getV1TradingEntityaccounts", - "parameters":[ - { - "type":"string", - "description":"Base64 of {signature, nonce} JSON representation", - "name":"authorization", - "in":"header", - "x-example":"EcRecover eyJub25jZSI6InYyLTE3MDQxMTQwNjEuMDAwIiwic2lnbmF0dXJlIjoiMHgyYjQ4ZDUzZjJlM2E2OTY2MzBlYmRjZDFmZjA1NzU1NmJiYzlkZTljMjk0YWRmYWE1YjFmMTNkZjkxYjY3YjM0N2ZkZDg4YzI5NTk0YzM3N2JhMDAyNGRlYzQwY2Q5ODA4ODI5ZTdmNDQ0Nzc3MjQ4MmY1MGE3YThlOWE5MDM1NjFjIn0=", - "required":true - } - ], - "tags":[ - "Trading" - ], - "responses":{ - "200":{ - "schema":{ - "$ref":"#/definitions/Model3" - }, - "description":"Successful" - } - } - } - }, - "/v1/trading/fills":{ - "get":{ - "summary":"This method is used to get the history of fills (executed trades) for the authenticated user", - "operationId":"getV1TradingFills", - "parameters":[ - { - "type":"string", - "description":"Base64 of {signature, nonce} JSON representation", - "name":"authorization", - "in":"header", - "x-example":"EcRecover eyJub25jZSI6InYyLTE3MDQxMTQwNjEuMDAwIiwic2lnbmF0dXJlIjoiMHgyYjQ4ZDUzZjJlM2E2OTY2MzBlYmRjZDFmZjA1NzU1NmJiYzlkZTljMjk0YWRmYWE1YjFmMTNkZjkxYjY3YjM0N2ZkZDg4YzI5NTk0YzM3N2JhMDAyNGRlYzQwY2Q5ODA4ODI5ZTdmNDQ0Nzc3MjQ4MmY1MGE3YThlOWE5MDM1NjFjIn0=", - "required":true - }, - { - "type":"string", - "x-convert":{ - "case":"upper" - }, - "name":"symbol", - "in":"query" - }, - { - "type":"string", - "format":"date", - "name":"startDate", - "in":"query", - "x-example":"2020-01-01 13:45" - }, - { - "type":"string", - "format":"date", - "name":"endDate", - "in":"query", - "x-example":"2025-12-31 23:45" - }, - { - "type":"string", - "default":"date", - "enum":[ - "date" - ], - "name":"sortBy", - "in":"query" - }, - { - "type":"string", - "default":"DESC", - "enum":[ - "ASC", - "DESC" - ], - "name":"sortDirection", - "in":"query" - }, - { - "type":"integer", - "default":0, - "minimum":0, - "name":"skip", - "in":"query" - }, - { - "type":"integer", - "default":20, - "minimum":1, - "maximum":100, - "name":"limit", - "in":"query" - } - ], - "tags":[ - "Trading" - ], - "responses":{ - "200":{ - "schema":{ - "$ref":"#/definitions/getFillsResponse", - "x-alternatives":[ - { - "$ref":"#/x-alt-definitions/getFillsResponse" - }, - { - "type":"string", - "description":"Response in CSV format", - "example":"fillId,orderId,symbol,fillAmount,orderAmount,price,date,orderCreationDate,orderType,orderActive,orderCanceled606f4123baed6ee2d25f1f1f,79qiFBVDfbz,ZRX:USDT,-0.125622,-1,209.9,1990-04-14T00:00:00.000Z,2020-11-11T16:37:05.262Z,EXCHANGE LIMIT,false,false606f4123baed6ee2d25f1f32,7vVPHzETRQY,ZRX:USDT,-0.125622,-1,209.9,1990-04-14T00:02:00.000Z,2020-11-11T16:37:05.262Z,EXCHANGE LIMIT,false,false606f4123baed6ee2d25f1f2d,GuKPHMafYU1,ZRX:USDT,-0.125622,-1,209.9,1990-04-14T00:04:00.000Z,2020-11-11T16:37:05.262Z,EXCHANGE LIMIT,false,false606f4123baed6ee2d25f1f25,6h1i8x5apLe,ZRX:USDT,-0.125622,-1,209.9,1990-04-14T00:06:00.000Z,2020-11-11T16:37:05.262Z,EXCHANGE LIMIT,false,false606f4123baed6ee2d25f1f27,MwEnHW1MF5y,ZRX:USDT,-0.125622,-1,209.9,1990-04-14T00:08:00.000Z,2020-11-11T16:37:05.262Z,EXCHANGE LIMIT,false,false" - } - ] - }, - "description":"Successful" - } - } - } - }, - "/v1/trading/transfers":{ - "get":{ - "summary":"This method is used to get the history of transfers for the authenticated user", - "operationId":"getV1TradingTransfers", - "parameters":[ - { - "type":"string", - "description":"Base64 of {signature, nonce} JSON representation", - "name":"authorization", - "in":"header", - "x-example":"EcRecover eyJub25jZSI6InYyLTE3MDQxMTQwNjEuMDAwIiwic2lnbmF0dXJlIjoiMHgyYjQ4ZDUzZjJlM2E2OTY2MzBlYmRjZDFmZjA1NzU1NmJiYzlkZTljMjk0YWRmYWE1YjFmMTNkZjkxYjY3YjM0N2ZkZDg4YzI5NTk0YzM3N2JhMDAyNGRlYzQwY2Q5ODA4ODI5ZTdmNDQ0Nzc3MjQ4MmY1MGE3YThlOWE5MDM1NjFjIn0=", - "required":true - }, - { - "type":"string", - "x-convert":{ - "case":"upper" - }, - "name":"token", - "in":"query" - }, - { - "type":"string", - "format":"date", - "name":"startDate", - "in":"query", - "x-example":"2020-01-01 13:45" - }, - { - "type":"string", - "format":"date", - "name":"endDate", - "in":"query", - "x-example":"2025-12-31 23:45" - }, - { - "type":"string", - "default":"date", - "enum":[ - "date" - ], - "name":"sortBy", - "in":"query" - }, - { - "type":"string", - "default":"DESC", - "enum":[ - "ASC", - "DESC" - ], - "name":"sortDirection", - "in":"query" - }, - { - "type":"integer", - "default":0, - "minimum":0, - "name":"skip", - "in":"query" - }, - { - "type":"integer", - "default":20, - "minimum":1, - "maximum":100, - "name":"limit", - "in":"query" - } - ], - "tags":[ - "Trading" - ], - "responses":{ - "200":{ - "schema":{ - "$ref":"#/definitions/getTransfersResponse", - "x-alternatives":[ - { - "$ref":"#/x-alt-definitions/getTransfersResponse" - }, - { - "type":"string", - "description":"List of past transfers in CSV format", - "example":"id,token,amount,feeAmount,source,recipient,memo,date9oWC74UdzWJ,ZRX,0.05,0.001,0x08152c1265dBc218ccc8Ab5C574e6bD52279b3B7,0xeb3ea3ea9239577951523cafa9fd3072bc88e50a,reference,1990-04-14T00:00:00.000ZJtCAHChHhmU,ZRX,0.05,0.001,0x08152c1265dBc218ccc8Ab5C574e6bD52279b3B7,0xeb3ea3ea9239577951523cafa9fd3072bc88e50a,,1990-04-14T00:02:00.000ZA1vFQzqYMXu,ZRX,0.05,0.001,0x08152c1265dBc218ccc8Ab5C574e6bD52279b3B7,0xeb3ea3ea9239577951523cafa9fd3072bc88e50a,,1990-04-14T00:04:00.000Z8xFu925f72r,ZRX,0.05,0.001,0x08152c1265dBc218ccc8Ab5C574e6bD52279b3B7,0xeb3ea3ea9239577951523cafa9fd3072bc88e50a,,1990-04-14T00:06:00.000Z" - } - ] - }, - "description":"Successful" - } - } - } - }, - "/v1/trading/amm/fundingOrderData":{ - "get":{ - "summary":"Get data for AmmFundingOrder, for given token and amount.", - "operationId":"getV1TradingAmmFundingorderdata", - "description":"In order to get data for a deposit order, provide one of the tokens and the amount you want to deposit. The response will contain information on how much of the other pool token you need to deposit and how many LP tokens you will get in return.\nIn order to get data for a withdrawal, set token to pools LP token and provide the amount of it which you wish to exchange for pool tokens. The response will conatin information about how much of the pool tokens you will get in return.\nData returned by this end point can be used to actually request a deposit/withdrawal via POST app/fundingOrders.", - "parameters":[ - { - "type":"string", - "description":"Base64 of {signature, nonce} JSON representation", - "name":"authorization", - "in":"header", - "x-example":"EcRecover eyJub25jZSI6InYyLTE3MDQxMTQwNjEuMDAwIiwic2lnbmF0dXJlIjoiMHgyYjQ4ZDUzZjJlM2E2OTY2MzBlYmRjZDFmZjA1NzU1NmJiYzlkZTljMjk0YWRmYWE1YjFmMTNkZjkxYjY3YjM0N2ZkZDg4YzI5NTk0YzM3N2JhMDAyNGRlYzQwY2Q5ODA4ODI5ZTdmNDQ0Nzc3MjQ4MmY1MGE3YThlOWE5MDM1NjFjIn0=", - "required":true - }, - { - "type":"string", - "name":"pool", - "in":"query", - "x-example":"ETH:USDT" - }, - { - "type":"string", - "name":"token", - "in":"query", - "x-example":"ETH" - }, - { - "type":"string", - "name":"amount", - "in":"query", - "x-example":1 - } - ], - "tags":[ - "Trading", - "AMM" - ], - "responses":{ - "200":{ - "schema":{ - "$ref":"#/definitions/AmmFundingOrderDataGetResponse" - }, - "description":"Successful" - } - } - } - }, - "/v1/trading/r/30DaysVolume":{ - "get":{ - "summary":"Request information regarding the trading volume of a specific address for the last 30 days. The request returns the overall trading volume details for all tokens in USD as well as the trading volume per token. Results are cached for 60 minutes.", - "operationId":"getV1TradingR30daysvolume", - "parameters":[ - { - "type":"string", - "description":"This nonce which used to provide the time until which this nonce is valid. It is presented as seconds since epoch.", - "name":"nonce", - "in":"query", - "x-example":"v2-1704114061.000", - "required":false - }, - { - "type":"string", - "description":"The signature obtained by signing the nonce with your private ethereum key.", - "name":"signature", - "in":"query", - "x-example":"0x2b48d53f2e3a696630ebdcd1ff057556bbc9de9c294adfaa5b1f13df91b67b347fdd88c29594c377ba0024dec40cd9808829e7f4447772482f50a7a8e9a903561c", - "required":false - } - ], - "tags":[ - "Market" - ], - "responses":{ - "200":{ - "schema":{ - "$ref":"#/definitions/30DaysVolumeResponse" - }, - "description":"Successful" - } - } - } - }, - "/v1/trading/r/USDRanking":{ - "get":{ - "summary":"This returns a user ranking by overall trading volume quoted in USD. If the parameters startDate and endDate are provided, the ranking includes only trading volume within that window of time.", - "operationId":"getV1TradingRUsdranking", - "parameters":[ - { - "type":"number", - "description":"The start date and time (Unix timestamp in milliseconds) for which the trade volumes are requested. If startDate and endDate are not provided, it returns the volume ranking if all time.", - "name":"startDate", - "in":"query", - "x-example":1577836800000 - }, - { - "type":"number", - "description":"The end date and time (Unix timestamp in milliseconds) for which events are requested.If startDate and endDate are not provided, it returns the volume ranking if all time.", - "name":"endDate", - "in":"query", - "x-example":1747384800000 - } - ], - "tags":[ - "Market" - ], - "responses":{ - "default":{ - "schema":{ - "$ref":"#/definitions/USDRankingResponse" - }, - "description":"Ranked output of all trading volumes for all the tokens." - } - } - } - }, - "/v1/trading/r/User24HoursVolume":{ - "get":{ - "summary":"Request information regarding the trading volume of a specific address for the last 24 hours. The request returns the overall trading volume details for all tokens in USD as well as the trading volume per token. Results are cached for 2 minutes.", - "operationId":"getV1TradingRUser24hoursvolume", - "parameters":[ - { - "type":"string", - "description":"This nonce which used to provide the time until which this nonce is valid. It is presented as seconds since epoch.", - "name":"nonce", - "in":"query", - "x-example":"v2-1704114061.000", - "required":false - }, - { - "type":"string", - "description":"The signature obtained by signing the nonce with your private ethereum key.", - "name":"signature", - "in":"query", - "x-example":"0x2b48d53f2e3a696630ebdcd1ff057556bbc9de9c294adfaa5b1f13df91b67b347fdd88c29594c377ba0024dec40cd9808829e7f4447772482f50a7a8e9a903561c", - "required":false - } - ], - "tags":[ - "Market" - ], - "responses":{ - "200":{ - "schema":{ - "$ref":"#/definitions/User24HoursVolumeResponse" - }, - "description":"Successful" - }, - "default":{ - "schema":{ - "$ref":"#/definitions/Model9" - }, - "description":"Returns the overall trading volume details of a specific address for all tokens in USD as well as the trading volume per trading pair fot the last 24 hours." - } - } - } - }, - "/v1/trading/r/airdropEligibility":{ - "get":{ - "summary":"Returns the eligible DVF airdrop amount for the given address", - "operationId":"getV1TradingRAirdropeligibility", - "parameters":[ - { - "type":"string", - "description":"Ethereum address", - "name":"ethAddress", - "in":"query", - "x-example":"0x3f2b822E9A8312C6DafBF9686a5e335Af0E4D33B" - }, - { - "type":"string", - "description":"token for the airdrop", - "name":"token", - "in":"query", - "x-example":"DVF" - } - ], - "tags":[ - "Trading" - ], - "responses":{ - "200":{ - "schema":{ - "$ref":"#/definitions/Model11" - }, - "description":"Successful" - } - } - } - }, - "/v1/trading/r/beehiveStats":{ - "get":{ - "summary":"Request information regarding beehive liquidity and apy.", - "operationId":"getV1TradingRBeehivestats", - "tags":[ - "Market", - "deprecated" - ], - "responses":{ - "200":{ - "schema":{ - "$ref":"#/definitions/beehiveStatsResponse" - }, - "description":"Successful" - }, - "default":{ - "schema":{ - "$ref":"#/definitions/Model12" - }, - "description":"Returns behive stats" - } - } - } - }, - "/v1/trading/r/estimatedNextBatchTime":{ - "get":{ - "summary":"Returns a countdown until the expected next batch proof is submitted onto the blockchain and the average time of previous batches. The next batch will include all pending withdrawals.", - "operationId":"getV1TradingREstimatednextbatchtime", - "tags":[ - "Market" - ], - "responses":{ - "default":{ - "schema":{ - "$ref":"#/definitions/estimatedNextBatchResponse" - }, - "description":"Returns the amount of time remaining until the batch is posted to Ethereum." - } - } - } - }, - "/v1/trading/r/fastWithdrawalFee":{ - "get":{ - "summary":"Returns a range of gas price options.", - "operationId":"getV1TradingRFastwithdrawalfee", - "parameters":[ - { - "type":"string", - "description":"token to be withdrawn", - "name":"token", - "in":"query", - "x-example":"BTC" - } - ], - "tags":[ - "Trading" - ], - "responses":{ - "200":{ - "schema":{ - "$ref":"#/definitions/Model13" - }, - "description":"Successful" - } - } - } - }, - "/v1/trading/r/fastWithdrawalMaxAmount":{ - "get":{ - "summary":"Returns max amount available for fast withdrawal (before fees).", - "operationId":"getV1TradingRFastwithdrawalmaxamount", - "parameters":[ - { - "type":"string", - "description":"Base64 of {signature, nonce} JSON representation", - "name":"authorization", - "in":"header", - "x-example":"EcRecover eyJub25jZSI6InYyLTE3MDQxMTQwNjEuMDAwIiwic2lnbmF0dXJlIjoiMHgyYjQ4ZDUzZjJlM2E2OTY2MzBlYmRjZDFmZjA1NzU1NmJiYzlkZTljMjk0YWRmYWE1YjFmMTNkZjkxYjY3YjM0N2ZkZDg4YzI5NTk0YzM3N2JhMDAyNGRlYzQwY2Q5ODA4ODI5ZTdmNDQ0Nzc3MjQ4MmY1MGE3YThlOWE5MDM1NjFjIn0=", - "required":true - }, - { - "type":"string", - "description":"token to be withdrawn", - "name":"token", - "in":"query", - "x-example":"BTC" - } - ], - "tags":[ - "Trading" - ], - "responses":{ - "200":{ - "schema":{ - "$ref":"#/definitions/Model14" - }, - "description":"Successful" - } - } - } - }, - "/v1/trading/r/feeRate":{ - "get":{ - "summary":"Return current fee rate for a given address. This rate is dependent on the trading volume of the user.", - "operationId":"getV1TradingRFeerate", - "parameters":[ - { - "type":"string", - "description":"This nonce which used to provide the time until which this nonce is valid. It is presented as seconds since epoch.", - "name":"nonce", - "in":"query", - "x-example":"v2-1704114061.000", - "required":false - }, - { - "type":"string", - "description":"The signature obtained by signing the nonce with your private ethereum key.", - "name":"signature", - "in":"query", - "x-example":"0x2b48d53f2e3a696630ebdcd1ff057556bbc9de9c294adfaa5b1f13df91b67b347fdd88c29594c377ba0024dec40cd9808829e7f4447772482f50a7a8e9a903561c", - "required":false - }, - { - "type":"string", - "description":"Symbol for which the fee rate will be returned", - "name":"symbol", - "in":"query", - "x-example":"ETH:USDT" - }, - { - "type":"string", - "description":"Feature for which the fee rate will be returned", - "name":"feature", - "in":"query", - "x-example":"TRADING" - } - ], - "tags":[ - "Trading" - ], - "responses":{ - "200":{ - "schema":{ - "$ref":"#/definitions/getFeeRateResponse" - }, - "description":"Successful" - } - } - } - }, - "/v1/trading/r/gasSavings":{ - "get":{ - "summary":"Returns gas savings metrics", - "operationId":"getV1TradingRGassavings", - "tags":[ - "Trading" - ], - "responses":{ - "200":{ - "schema":{ - "$ref":"#/definitions/gasSavingsResponse" - }, - "description":"Successful" - } - } - } - }, - "/v1/trading/r/getBalanceUsd":{ - "get":{ - "summary":"This is used to retrieve the sum of all user balances converted to USD.", - "operationId":"getV1TradingRGetbalanceusd", - "parameters":[ - { - "type":"string", - "description":"This nonce which used to provide the time until which this nonce is valid. It is presented as seconds since epoch.", - "name":"nonce", - "in":"query", - "x-example":"v2-1704114061.000", - "required":false - }, - { - "type":"string", - "description":"The signature obtained by signing the nonce with your private ethereum key.", - "name":"signature", - "in":"query", - "x-example":"0x2b48d53f2e3a696630ebdcd1ff057556bbc9de9c294adfaa5b1f13df91b67b347fdd88c29594c377ba0024dec40cd9808829e7f4447772482f50a7a8e9a903561c", - "required":false - } - ], - "tags":[ - "Trading" - ], - "responses":{ - "default":{ - "schema":{ - "$ref":"#/definitions/getBalanceUsdResponse" - }, - "description":"Returns the sum of all user balances converted to USD." - } - } - } - }, - "/v1/trading/r/getConf":{ - "get":{ - "summary":"Returns the DeversiFi application configuration details.", - "operationId":"getV1TradingRGetconf", - "tags":[ - "Trading" - ], - "responses":{ - "default":{ - "schema":{ - "type":"string" - }, - "description":"Successful" - } - } - }, - "post":{ - "summary":"Returns the DeversiFi application configuration details.", - "operationId":"postV1TradingRGetconf", - "tags":[ - "Trading" - ], - "responses":{ - "default":{ - "schema":{ - "type":"string" - }, - "description":"Successful" - } - } - } - }, - "/v1/trading/r/getGasPrice":{ - "get":{ - "summary":"Returns a range of gas price options.", - "operationId":"getV1TradingRGetgasprice", - "tags":[ - "Trading" - ], - "responses":{ - "200":{ - "description":"Range of gas prices for on chain confirmation speed", - "schema":{ - "$ref":"#/definitions/getGasPriceResponse" - } - } - } - }, - "post":{ - "summary":"Returns a range of gas price options.", - "operationId":"postV1TradingRGetgasprice", - "tags":[ - "Trading" - ], - "responses":{ - "200":{ - "description":"Range of gas prices for on chain confirmation speed", - "schema":{ - "$ref":"#/definitions/getGasPriceResponse" - } - } - }, - "deprecated":true - } - }, - "/v1/trading/r/getPublicPermissions":{ - "get":{ - "summary":"A descriptor object for all user permissions available", - "operationId":"getV1TradingRGetpublicpermissions", - "tags":[ - "public" - ], - "responses":{ - "200":{ - "schema":{ - "$ref":"#/definitions/Model15" - }, - "description":"Successful" - } - } - } - }, - "/v1/trading/r/getTokenCirculatingSupply":{ - "get":{ - "summary":"Returns token liquidity left", - "operationId":"getV1TradingRGettokencirculatingsupply", - "parameters":[ - { - "type":"string", - "description":"Token for which to get the circulating supply", - "name":"token", - "in":"query", - "x-example":"DVF" - } - ], - "tags":[ - "Trading" - ], - "responses":{ - "200":{ - "description":"Circulating supply", - "schema":{ - "type":"number", - "description":"Circulating supply", - "example":10 - } - } - } - } - }, - "/v1/trading/r/getTokenHolders":{ - "get":{ - "summary":"Returns token holders count for a given token", - "operationId":"getV1TradingRGettokenholders", - "parameters":[ - { - "type":"string", - "description":"Token for which to get the holders count", - "name":"token", - "in":"query", - "x-example":"DVF" - } - ], - "tags":[ - "Trading" - ], - "responses":{ - "200":{ - "schema":{ - "type":"number", - "example":452083 - }, - "description":"Successful" - } - } - } - }, - "/v1/trading/r/getTokenLiquidityLeft":{ - "get":{ - "summary":"Returns token liquidity left", - "operationId":"getV1TradingRGettokenliquidityleft", - "parameters":[ - { - "type":"string", - "description":"Token for which to get the liquidity left", - "name":"token", - "in":"query", - "x-example":"DVF" - } - ], - "tags":[ - "Trading" - ], - "responses":{ - "200":{ - "schema":{ - "$ref":"#/definitions/Model16" - }, - "description":"Successful" - } - } - } - }, - "/v1/trading/r/getTokenSaleStartEnd":{ - "get":{ - "summary":"Returns token sale start and end time", - "operationId":"getV1TradingRGettokensalestartend", - "parameters":[ - { - "type":"string", - "description":"Token for which to get the sale start and end time", - "name":"token", - "in":"query", - "x-example":"DVF" - } - ], - "tags":[ - "Trading" - ], - "responses":{ - "200":{ - "schema":{ - "$ref":"#/definitions/tokenSaleStartEndResponse" - }, - "description":"Successful" - } - } - } - }, - "/v1/trading/r/last24HoursVolume":{ - "get":{ - "summary":"Request information regarding the trading volume for the last 24 hours. The request returns the overall trading volume details in USD as well as the trading volume per token in USD and the native token.", - "operationId":"getV1TradingRLast24hoursvolume", - "tags":[ - "Market" - ], - "responses":{ - "default":{ - "schema":{ - "$ref":"#/definitions/last24HoursVolumeResponse" - }, - "description":"Returns the trading volume of the last 24 hours." - } - } - } - }, - "/v1/trading/r/registeredAccounts":{ - "get":{ - "summary":"Returns total registered accounts", - "operationId":"getV1TradingRRegisteredaccounts", - "tags":[ - "Trading" - ], - "responses":{ - "200":{ - "schema":{ - "$ref":"#/definitions/registeredAccountsResponse" - }, - "description":"Successful" - } - } - } - }, - "/v1/trading/r/swapVolume":{ - "get":{ - "summary":"Get swap functionality volume information for a specific token related pairs", - "operationId":"getV1TradingRSwapvolume", - "parameters":[ - { - "type":"string", - "description":"Token whose related pair volumes will be calculated", - "name":"token", - "in":"query", - "x-example":"ETH", - "required":true - }, - { - "type":"number", - "description":"Date of the volume", - "name":"date", - "in":"query", - "x-example":1577836800000, - "required":true - } - ], - "tags":[ - "Market" - ], - "responses":{ - "200":{ - "schema":{ - "$ref":"#/definitions/Model17" - }, - "description":"Successful" - } - } - } - }, - "/v1/trading/r/tokenBalancesHistory":{ - "get":{ - "summary":"Return the token balances for the given addresses, token, block number", - "operationId":"getV1TradingRTokenbalanceshistory", - "parameters":[ - { - "type":"number", - "x-alternatives":[ - { - "type":"number", - "example":10822562 - }, - { - "type":"string", - "enum":[ - { - "override":true - }, - "latest" - ] - } - ], - "name":"blockNumber", - "in":"query", - "x-example":10822562 - }, - { - "type":"string", - "description":"token we want the balances of", - "name":"token", - "in":"query", - "x-example":"xDVF" - }, - { - "type":"array", - "items":{ - "type":"string", - "description":"addresses we want the balances of" - }, - "collectionFormat":"multi", - "x-alternatives":[ - { - "type":"array", - "example":[ - "0xc0e9bd267626e2393ddaf520ae5df27ef6c533bd" - ], - "items":{ - "type":"string", - "description":"addresses we want the balances of" - }, - "collectionFormat":"multi", - "name":"addresses" - }, - { - "type":"object" - }, - { - "type":"string", - "example":"0xc0e9bd267626e2393ddaf520ae5df27ef6c533bd" - } - ], - "name":"addresses", - "in":"query", - "x-example":[ - "0xc0e9bd267626e2393ddaf520ae5df27ef6c533bd" - ] - } - ], - "tags":[ - "Trading" - ], - "responses":{ - "200":{ - "schema":{ - "$ref":"#/definitions/Model19" - }, - "description":"Successful" - } - } - } - }, - "/v1/trading/r/tokenRanking":{ - "get":{ - "summary":"This returns a user ranking by trading volume for a chosen token. If the parameters startDate and endDate are provided, the ranking includes only trading volume within that window of time. All volumes are quoted in ETH.", - "operationId":"getV1TradingRTokenranking", - "parameters":[ - { - "type":"string", - "description":"The currency relating to the requested trading volume information.", - "name":"currency", - "in":"query", - "x-example":"ETH", - "required":true - }, - { - "type":"number", - "description":"The start date and time (Unix timestamp in milliseconds) for which the trade volumes are requested. If startDate and endDate are not provided, it returns the volume ranking if all time.", - "name":"startDate", - "in":"query", - "x-example":1527836800000 - }, - { - "type":"number", - "description":"The end date and time (Unix timestamp in milliseconds) for which the trade volumes are requested. If startDate and endDate are not provided, it returns the volume ranking if all time.", - "name":"endDate", - "in":"query", - "x-example":1747384800000 - } - ], - "tags":[ - "Market" - ], - "responses":{ - "default":{ - "schema":{ - "$ref":"#/definitions/tokenRankingResponse" - }, - "description":"Returns a ranked output of all the trading volumes for a given crypto currency. All the Volumes are quoted in ETH." - } - } - } - }, - "/v1/trading/r/totalValueLocked":{ - "get":{ - "summary":"Returns total value locked by day within a given timerange", - "operationId":"getV1TradingRTotalvaluelocked", - "parameters":[ - { - "type":"string", - "format":"date", - "description":"Date from which to get TVL data", - "name":"startDate", - "in":"query", - "x-example":"2020-04-21" - }, - { - "type":"string", - "format":"date", - "description":"Date until which to get TVL data", - "name":"endDate", - "in":"query", - "x-example":"2020-05-21" - }, - { - "type":"string", - "description":"Optional, Token for which to get TVL data", - "name":"token", - "in":"query", - "required":false - } - ], - "tags":[ - "Trading" - ], - "responses":{ - "200":{ - "schema":{ - "$ref":"#/definitions/totalValueLockedResponse" - }, - "description":"Successful" - } - } - } - }, - "/v1/trading/r/tradeCountSince":{ - "get":{ - "summary":"Returns deversifi finished order count from specified date", - "operationId":"getV1TradingRTradecountsince", - "parameters":[ - { - "type":"string", - "format":"date", - "description":"Date since when orders are counted.", - "name":"startDate", - "in":"query", - "x-example":"2020-07-21T13:19:08.241Z", - "required":true - } - ], - "tags":[ - "Market" - ], - "responses":{ - "200":{ - "schema":{ - "$ref":"#/definitions/Model20" - }, - "description":"Successful" - } - } - } - }, - "/v1/trading/r/tradeHistory":{ - "get":{ - "summary":"This method is used to retrieve a list of all past executed trades for a user. This includes the different trades that have been settled for each fully executed or partially executed order.", - "operationId":"getV1TradingRTradehistory", - "parameters":[ - { - "type":"string", - "description":"This nonce which used to provide the time until which this nonce is valid. It is presented as seconds since epoch.", - "name":"nonce", - "in":"query", - "x-example":"v2-1704114061.000", - "required":false - }, - { - "type":"string", - "description":"The signature obtained by signing the nonce with your private ethereum key.", - "name":"signature", - "in":"query", - "x-example":"0x2b48d53f2e3a696630ebdcd1ff057556bbc9de9c294adfaa5b1f13df91b67b347fdd88c29594c377ba0024dec40cd9808829e7f4447772482f50a7a8e9a903561c", - "required":false - } - ], - "produces":[ - "text/csv" - ], - "tags":[ - "Trading" - ], - "responses":{ - "200":{ - "description":"Returns executed trades as a CSV file", - "schema":{ - "type":"string", - "example":"exchange_name,account_name,trade_date,buy_asset,sell_asset,buy_amount,sell_amount,exchange_order_id,fee_asset,fee_amount,transaction_type,clarification\nDeversiFi,0x08152c1265dbc218ccc8ab5c574e6bd52279b3b7,2021-01-21T16:08:39,USDT,ETH,40.918,1,NHX5FcipBCZ,USDT,0.082,trade,\nDeversiFi,0x08152c1265dbc218ccc8ab5c574e6bd52279b3b7,2021-01-20T18:30:54,USDT,ETH,41.916,1,2f7tKwGqR8v,USDT,0.084,trade,\nDeversiFi,0x08152c1265dbc218ccc8ab5c574e6bd52279b3b7,2021-01-19T10:16:31,USDT,ETH,38.6226,0.9,KRSbMNKyDwu,USDT,0.0774,trade," - } - } - } - } - }, - "/v1/trading/r/transferVolume":{ - "get":{ - "summary":"Get transfer functionality volume information for a specific token", - "operationId":"getV1TradingRTransfervolume", - "parameters":[ - { - "type":"string", - "description":"Token whose transfer volumes will be calculated", - "name":"token", - "in":"query", - "x-example":"ETH", - "required":true - }, - { - "type":"number", - "description":"Date of the volume", - "name":"date", - "in":"query", - "x-example":1577836800000, - "required":true - } - ], - "tags":[ - "Market" - ], - "responses":{ - "200":{ - "schema":{ - "$ref":"#/definitions/Model21" - }, - "description":"Successful" - } - } - } - }, - "/v1/trading/r/vaultIdAndStarkKey":{ - "get":{ - "summary":"Gets the stark public key and vault id for the user registered with and token", - "operationId":"getV1TradingRVaultidandstarkkey", - "parameters":[ - { - "type":"string", - "description":"This nonce which used to provide the time until which this nonce is valid. It is presented as seconds since epoch.", - "name":"nonce", - "in":"query", - "x-example":"v2-1704114061.000", - "required":false - }, - { - "type":"string", - "description":"The signature obtained by signing the nonce with your private ethereum key.", - "name":"signature", - "in":"query", - "x-example":"0x2b48d53f2e3a696630ebdcd1ff057556bbc9de9c294adfaa5b1f13df91b67b347fdd88c29594c377ba0024dec40cd9808829e7f4447772482f50a7a8e9a903561c", - "required":false - }, - { - "type":"string", - "description":"The ETH address of a registered user", - "name":"targetEthAddress", - "in":"query", - "x-example":"0x08152c1265dbc218ccc8ab5c574e6bd52279b3b7", - "required":true - }, - { - "type":"string", - "description":"The token for which we want retrieve the vault ID", - "name":"token", - "in":"query", - "x-example":"ETH", - "required":true - } - ], - "tags":[ - "Trading" - ], - "responses":{ - "200":{ - "schema":{ - "$ref":"#/definitions/vaultIdAndStarkKeyResponse" - }, - "description":"Successful" - }, - "404":{ - "description":"When there is no user registered with given `targetEthAddress`" - } - } - } - }, - "/v1/trading/r/votingPower":{ - "get":{ - "summary":"Returns total xDVF balance of exchange users and calculated voting power based on input amount", - "operationId":"getV1TradingRVotingpower", - "parameters":[ - { - "type":"string", - "description":"Amount of xDVF ", - "name":"amount", - "in":"query", - "x-example":"55" - } - ], - "tags":[ - "Trading" - ], - "responses":{ - "200":{ - "schema":{ - "$ref":"#/definitions/votingPowerResponse" - }, - "description":"Successful" - } - } - } - }, - "/v1/trading/registrations/{targetEthAddress}":{ - "get":{ - "summary":"This method is used to retrieve the registration statuses of the given eth address", - "operationId":"getV1TradingRegistrationsTargetethaddress", - "parameters":[ - { - "type":"string", - "description":"The ETH address of a potential user", - "name":"targetEthAddress", - "in":"path", - "x-example":"0x3f2b822E9A8312C6DafBF9686a5e335Af0E4D33B", - "required":true - } - ], - "tags":[ - "Trading" - ], - "responses":{ - "200":{ - "schema":{ - "$ref":"#/definitions/Model22" - }, - "description":"Successful" - } - } - } - }, - "/v1/trading/r/publicTradeHistory/{user}":{ - "get":{ - "summary":"This method is used to retrieve a list of all past executed trades for a user. This includes the different trades that have been settled for each fully executed or partially executed order.", - "operationId":"getV1TradingRPublictradehistoryUser", - "parameters":[ - { - "type":"string", - "description":"The ETH address of a potential user", - "name":"user", - "in":"path", - "x-example":"0x3f2b822E9A8312C6DafBF9686a5e335Af0E4D33B", - "required":true - } - ], - "tags":[ - "Trading", - "public" - ], - "responses":{ - "200":{ - "schema":{ - "$ref":"#/definitions/Model25" - }, - "description":"Successful" - }, - "401":{ - "description":"User has not authorized the use of this endpoint for their address" - } - } - } - }, - "/v1/trading/r/trades/{symbol}":{ - "get":{ - "summary":"Request information regarding all recently completed trades for a given market pair.", - "operationId":"getV1TradingRTradesSymbol", - "parameters":[ - { - "type":"string", - "description":"The market trading pair in deversifi format i.e BASE:QUOTE", - "name":"symbol", - "in":"path", - "x-example":"ETH:USDT", - "required":true - } - ], - "tags":[ - "Market" - ], - "responses":{ - "default":{ - "schema":{ - "$ref":"#/definitions/tradesResponse" - }, - "description":"The trades endpoint returns data on all recently completed trades for a given market pair for the past 24 hours" - } - } - } - }, - "/v1/trading/r/24HoursVolume/{year}/{month}/{day}":{ - "get":{ - "summary":"Request information regarding the trading volume for a specific date. The request returns the overall trading volume details for all tokens in USD as well as the trading volume per token.", - "operationId":"getV1TradingR24hoursvolumeYearMonthDay", - "parameters":[ - { - "type":"number", - "description":"The year of the specific trading volume request date - in this case 2020.", - "name":"year", - "in":"path", - "x-example":"2020", - "required":true - }, - { - "type":"number", - "description":"The month of the specific trading volume request date - in this case 01 (January).", - "name":"month", - "in":"path", - "x-example":"01", - "required":true - }, - { - "type":"number", - "description":"The day of the specific trading volume request date - in this case 01 (1st of a month).", - "name":"day", - "in":"path", - "x-example":"01", - "required":true - } - ], - "tags":[ - "Market" - ], - "responses":{ - "200":{ - "schema":{ - "$ref":"#/definitions/24HoursVolumeResponse" - }, - "description":"Successful" - } - } - } - }, - "/v1/trading/r/tradesSince/{symbol}/{startDate}/{limit}":{ - "get":{ - "summary":"Request information regarding all completed trades in a time range for a given market pair", - "operationId":"getV1TradingRTradessinceSymbolStartdateLimit", - "parameters":[ - { - "type":"string", - "description":"The market trading pair in deversifi format i.e BASE:QUOTE", - "name":"symbol", - "in":"path", - "x-example":"ETH:BTC", - "required":true - }, - { - "type":"number", - "description":"Date of the last trade returned.", - "name":"startDate", - "in":"path", - "x-example":1747384800000, - "required":true - }, - { - "type":"number", - "description":"Limit of trades that will be returned. With a maximum limit of 1000.", - "name":"limit", - "in":"path", - "x-example":60 - } - ], - "tags":[ - "Market" - ], - "responses":{ - "default":{ - "schema":{ - "$ref":"#/definitions/Model27" - }, - "description":"Returns data on all recently completed trades for a given market pair during a time range" - } - } - } - }, - "/v1/trading/bridgedDeposits":{ - "post":{ - "summary":"Create Stark V2 BridgedDepositRequest", - "operationId":"postV1TradingBridgeddeposits", - "parameters":[ - { - "type":"string", - "description":"Base64 of {signature, nonce} JSON representation", - "name":"authorization", - "in":"header", - "x-example":"EcRecover eyJub25jZSI6InYyLTE3MDQxMTQwNjEuMDAwIiwic2lnbmF0dXJlIjoiMHgyYjQ4ZDUzZjJlM2E2OTY2MzBlYmRjZDFmZjA1NzU1NmJiYzlkZTljMjk0YWRmYWE1YjFmMTNkZjkxYjY3YjM0N2ZkZDg4YzI5NTk0YzM3N2JhMDAyNGRlYzQwY2Q5ODA4ODI5ZTdmNDQ0Nzc3MjQ4MmY1MGE3YThlOWE5MDM1NjFjIn0=", - "required":true - }, - { - "in":"body", - "name":"body", - "schema":{ - "$ref":"#/definitions/bridgedDepositsPostPayload" - } - } - ], - "tags":[ - "Trading" - ], - "responses":{ - "200":{ - "schema":{ - "$ref":"#/definitions/bridgedDepositsPostResponse" - }, - "description":"Successful" - } - } - } - }, - "/v1/trading/bridgedWithdrawals":{ - "post":{ - "summary":"Create Stark V2 BridgedWithdrawalRequest", - "operationId":"postV1TradingBridgedwithdrawals", - "parameters":[ - { - "type":"string", - "description":"Base64 of {signature, nonce} JSON representation", - "name":"authorization", - "in":"header", - "x-example":"EcRecover eyJub25jZSI6InYyLTE3MDQxMTQwNjEuMDAwIiwic2lnbmF0dXJlIjoiMHgyYjQ4ZDUzZjJlM2E2OTY2MzBlYmRjZDFmZjA1NzU1NmJiYzlkZTljMjk0YWRmYWE1YjFmMTNkZjkxYjY3YjM0N2ZkZDg4YzI5NTk0YzM3N2JhMDAyNGRlYzQwY2Q5ODA4ODI5ZTdmNDQ0Nzc3MjQ4MmY1MGE3YThlOWE5MDM1NjFjIn0=", - "required":true - }, - { - "in":"body", - "name":"body", - "schema":{ - "$ref":"#/definitions/bridgedWithdrawalsPostPayload" - } - } - ], - "tags":[ - "Trading" - ], - "responses":{ - "200":{ - "schema":{ - "$ref":"#/definitions/bridgedWithdrawalsPostResponse" - }, - "description":"Successful" - } - } - } - }, - "/v1/trading/deposits":{ - "post":{ - "summary":"Create Stark V2 DepositRequest", - "operationId":"postV1TradingDeposits", - "parameters":[ - { - "type":"string", - "description":"Base64 of {signature, nonce} JSON representation", - "name":"authorization", - "in":"header", - "x-example":"EcRecover eyJub25jZSI6InYyLTE3MDQxMTQwNjEuMDAwIiwic2lnbmF0dXJlIjoiMHgyYjQ4ZDUzZjJlM2E2OTY2MzBlYmRjZDFmZjA1NzU1NmJiYzlkZTljMjk0YWRmYWE1YjFmMTNkZjkxYjY3YjM0N2ZkZDg4YzI5NTk0YzM3N2JhMDAyNGRlYzQwY2Q5ODA4ODI5ZTdmNDQ0Nzc3MjQ4MmY1MGE3YThlOWE5MDM1NjFjIn0=", - "required":true - }, - { - "in":"body", - "name":"body", - "schema":{ - "$ref":"#/definitions/depositsPostPayload" - } - } - ], - "tags":[ - "Trading" - ], - "responses":{ - "200":{ - "schema":{ - "$ref":"#/definitions/depositsPostResponse" - }, - "description":"Successful" - } - } - } - }, - "/v1/trading/deposits-validate":{ - "post":{ - "summary":"Create Stark V2 Deposits-validateRequest", - "operationId":"postV1TradingDepositsvalidate", - "parameters":[ - { - "type":"string", - "description":"Base64 of {signature, nonce} JSON representation", - "name":"authorization", - "in":"header", - "x-example":"EcRecover eyJub25jZSI6InYyLTE3MDQxMTQwNjEuMDAwIiwic2lnbmF0dXJlIjoiMHgyYjQ4ZDUzZjJlM2E2OTY2MzBlYmRjZDFmZjA1NzU1NmJiYzlkZTljMjk0YWRmYWE1YjFmMTNkZjkxYjY3YjM0N2ZkZDg4YzI5NTk0YzM3N2JhMDAyNGRlYzQwY2Q5ODA4ODI5ZTdmNDQ0Nzc3MjQ4MmY1MGE3YThlOWE5MDM1NjFjIn0=", - "required":true - }, - { - "in":"body", - "name":"body", - "schema":{ - "$ref":"#/definitions/deposits-validatePostPayload" - } - } - ], - "tags":[ - "Trading" - ], - "responses":{ - "200":{ - "schema":{ - "$ref":"#/definitions/deposits-validatePostResponse" - }, - "description":"Successful" - } - } - } - }, - "/v1/trading/withdrawals":{ - "post":{ - "summary":"Create Stark V2 WithdrawalRequest", - "operationId":"postV1TradingWithdrawals", - "parameters":[ - { - "type":"string", - "description":"Base64 of {signature, nonce} JSON representation", - "name":"authorization", - "in":"header", - "x-example":"EcRecover eyJub25jZSI6InYyLTE3MDQxMTQwNjEuMDAwIiwic2lnbmF0dXJlIjoiMHgyYjQ4ZDUzZjJlM2E2OTY2MzBlYmRjZDFmZjA1NzU1NmJiYzlkZTljMjk0YWRmYWE1YjFmMTNkZjkxYjY3YjM0N2ZkZDg4YzI5NTk0YzM3N2JhMDAyNGRlYzQwY2Q5ODA4ODI5ZTdmNDQ0Nzc3MjQ4MmY1MGE3YThlOWE5MDM1NjFjIn0=", - "required":true - }, - { - "in":"body", - "name":"body", - "schema":{ - "$ref":"#/definitions/withdrawalsPostPayload" - } - } - ], - "tags":[ - "Trading" - ], - "responses":{ - "200":{ - "schema":{ - "$ref":"#/definitions/withdrawalsPostResponse" - }, - "description":"Successful" - } - } - } - }, - "/v1/trading/amm/fundingOrders":{ - "post":{ - "summary":"Submit AMM fundingOrder. Used to deposit or withdrawal liquidity.", - "operationId":"postV1TradingAmmFundingorders", - "parameters":[ - { - "in":"body", - "name":"body", - "schema":{ - "$ref":"#/definitions/AmmFundingOrdersPostPayload" - } - } - ], - "tags":[ - "Trading", - "AMM" - ], - "responses":{ - "200":{ - "schema":{ - "$ref":"#/definitions/AmmFundingOrdersPostResponse" - }, - "description":"Successful" - } - } - } - }, - "/v1/trading/r/addAirdrops":{ - "post":{ - "summary":"Add a list of airdops", - "operationId":"postV1TradingRAddairdrops", - "parameters":[ - { - "in":"body", - "name":"body", - "schema":{ - "$ref":"#/definitions/addAirdropRequestSchema" - } - } - ], - "tags":[ - "Internal" - ], - "responses":{ - "200":{ - "schema":{ - "$ref":"#/definitions/addAirdropResponseSchema" - }, - "description":"Successful" - } - } - } - }, - "/v1/trading/r/getBalance":{ - "post":{ - "summary":"This is used to retrieve the total and active balances of a user per token. Active balance is the balance that is currently available. Total balance (specified as balance) is the sum of all the balances including those locked for trading.", - "operationId":"postV1TradingRGetbalance", - "parameters":[ - { - "in":"body", - "name":"body", - "schema":{ - "$ref":"#/definitions/getBalancePayload" - } - } - ], - "tags":[ - "Trading" - ], - "responses":{ - "default":{ - "schema":{ - "$ref":"#/definitions/getBalanceResponse" - }, - "description":"Returns the total, available and locked balances of a user per token." - } - } - } - }, - "/v1/trading/r/getDeposits":{ - "post":{ - "summary":"This is an authenticated endpoint used to retrieve deposits. A token can be specified to get deposits for a specific token. The limit of deposits returned is 1000.", - "operationId":"postV1TradingRGetdeposits", - "parameters":[ - { - "type":"number", - "description":"Date of the last deposit returned.", - "name":"startDate", - "in":"query", - "x-example":1747384800000 - }, - { - "type":"number", - "description":"Limit of deposits that will be returned. With a maximum limit of 1000.", - "name":"limit", - "in":"query", - "x-example":60 - }, - { - "in":"body", - "name":"body", - "schema":{ - "$ref":"#/definitions/getDepositsPayload" - } - } - ], - "tags":[ - "Trading" - ], - "responses":{ - "default":{ - "schema":{ - "$ref":"#/definitions/getDepositsResponse" - }, - "description":"Returns the list of deposits. A token can be specified to get deposits for a specific token." - } - } - } - }, - "/v1/trading/r/getOrder":{ - "post":{ - "summary":"This is endpoint is used to retrieve the details for a specific order using the order ID.", - "operationId":"postV1TradingRGetorder", - "parameters":[ - { - "in":"body", - "name":"body", - "schema":{ - "$ref":"#/definitions/getOrderPayload" - } - } - ], - "tags":[ - "Trading" - ], - "responses":{ - "default":{ - "schema":{ - "$ref":"#/definitions/getOrderResponse" - }, - "description":"Returns details relating to a particular order." - } - } - } - }, - "/v1/trading/r/getPendingWithdrawals":{ - "post":{ - "summary":"This endpoint is used to retrieve all pending withdrawals. If a token is specified, withdrawals pertaining to only that particular token are provided.", - "operationId":"postV1TradingRGetpendingwithdrawals", - "parameters":[ - { - "in":"body", - "name":"body", - "schema":{ - "$ref":"#/definitions/getPendingWithdrawalsPayload" - } - } - ], - "tags":[ - "Trading" - ], - "responses":{ - "default":{ - "schema":{ - "type":"string" - }, - "description":"Successful" - } - } - } - }, - "/v1/trading/r/getPublicUserPermissions":{ - "post":{ - "summary":"Used to get all configured permissions for the authenticated user", - "operationId":"postV1TradingRGetpublicuserpermissions", - "parameters":[ - { - "in":"body", - "name":"body", - "schema":{ - "$ref":"#/definitions/authPayload" - } - } - ], - "tags":[ - "public" - ], - "responses":{ - "200":{ - "schema":{ - "$ref":"#/definitions/Model38" - }, - "description":"Successful" - } - } - } - }, - "/v1/trading/r/getUserConf":{ - "post":{ - "summary":"Returns the DeversiFi application and user configuration details.", - "operationId":"postV1TradingRGetuserconf", - "parameters":[ - { - "in":"body", - "name":"body", - "schema":{ - "$ref":"#/definitions/authPayload" - } - } - ], - "tags":[ - "Trading" - ], - "responses":{ - "default":{ - "schema":{ - "$ref":"#/definitions/getUserConfResponse" - }, - "description":"Returns the overall trading volume details for all tokens in USD as well as the trading volume per trading pair." - } - } - } - }, - "/v1/trading/r/getVaultId":{ - "post":{ - "summary":"An authenticated endpoint used to retrieve a vaultId for given token.", - "operationId":"postV1TradingRGetvaultid", - "parameters":[ - { - "in":"body", - "name":"body", - "schema":{ - "$ref":"#/definitions/getVaultIdPayload" - } - } - ], - "tags":[ - "Trading" - ], - "responses":{ - "200":{ - "description":"the vault id.", - "schema":{ - "type":"number", - "description":"the vault id.", - "example":1851736 - } - } - } - } - }, - "/v1/trading/r/getWithdrawal":{ - "post":{ - "summary":"This endpoint is used to retrieve details relating to a particular withdrawal.", - "operationId":"postV1TradingRGetwithdrawal", - "parameters":[ - { - "in":"body", - "name":"body", - "schema":{ - "$ref":"#/definitions/getWithdrawalPayload" - } - } - ], - "tags":[ - "Trading" - ], - "responses":{ - "200":{ - "schema":{ - "$ref":"#/definitions/withdrawHistoryObject" - }, - "description":"Successful" - } - } - } - }, - "/v1/trading/r/hasReceivedCompensation":{ - "post":{ - "summary":"Returns whether the user already received registration compensation.", - "operationId":"postV1TradingRHasreceivedcompensation", - "parameters":[ - { - "in":"body", - "name":"body", - "schema":{ - "$ref":"#/definitions/authPayload" - } - } - ], - "tags":[ - "Internal" - ], - "responses":{ - "200":{ - "schema":{ - "$ref":"#/definitions/Model39" - }, - "description":"Successful" - } - } - } - }, - "/v1/trading/r/openOrders":{ - "post":{ - "summary":"This endpoints allows to retrieve details on all open orders.", - "operationId":"postV1TradingROpenorders", - "parameters":[ - { - "in":"body", - "name":"body", - "schema":{ - "$ref":"#/definitions/openOrdersPayload" - } - } - ], - "tags":[ - "Trading" - ], - "responses":{ - "200":{ - "schema":{ - "$ref":"#/definitions/openOrdersResponse" - }, - "description":"Successful" - } - } - } - }, - "/v1/trading/r/orderHistory":{ - "post":{ - "summary":"This method is used to retrieve a list of all past orders for a user. This includes executed trades, as well as expired and cancelled orders. The limit of orders returned is 1000.", - "operationId":"postV1TradingROrderhistory", - "parameters":[ - { - "type":"number", - "description":"Date of the last order returned.", - "name":"startDate", - "in":"query", - "x-example":1747384800000 - }, - { - "type":"number", - "description":"Limit of orders that will be returned. With a maximum limit of 1000.", - "name":"limit", - "in":"query", - "x-example":60 - }, - { - "in":"body", - "name":"body", - "schema":{ - "$ref":"#/definitions/openOrdersPayload" - } - } - ], - "tags":[ - "Trading" - ], - "responses":{ - "200":{ - "schema":{ - "$ref":"#/definitions/Model40" - }, - "description":"Successful" - } - } - } - }, - "/v1/trading/r/recoverTradingKey":{ - "post":{ - "summary":"Returns the encrypted Stark Trading Key.", - "operationId":"postV1TradingRRecovertradingkey", - "parameters":[ - { - "in":"body", - "name":"body", - "schema":{ - "$ref":"#/definitions/authPayload" - } - } - ], - "tags":[ - "Trading" - ], - "responses":{ - "default":{ - "schema":{ - "$ref":"#/definitions/recoverTradingKeyResponse" - }, - "description":"Returns the encrypted Stark Trading key." - } - } - } - }, - "/v1/trading/r/setPublicUserPermissions":{ - "post":{ - "summary":"Used to set a specific permission for a given user", - "operationId":"postV1TradingRSetpublicuserpermissions", - "parameters":[ - { - "in":"body", - "name":"body", - "schema":{ - "$ref":"#/definitions/permissionsPayload" - } - } - ], - "tags":[ - "Trading" - ], - "responses":{ - "200":{ - "schema":{ - "$ref":"#/definitions/Model38" - }, - "description":"Successful" - } - } - } - }, - "/v1/trading/r/userOrderCount":{ - "post":{ - "summary":"This method is used to retrieve user's count of filled orders.", - "operationId":"postV1TradingRUserordercount", - "parameters":[ - { - "in":"body", - "name":"body", - "schema":{ - "$ref":"#/definitions/authPayload" - } - } - ], - "tags":[ - "Trading" - ], - "responses":{ - "200":{ - "schema":{ - "$ref":"#/definitions/Model41" - }, - "description":"Successful" - } - } - } - }, - "/v1/trading/r/withdrawHistory":{ - "post":{ - "summary":"An authenticated endpoint used to retrieve a list of user's past withdrawals. This includes ready, completed, as well as cancelled withdrawals. The limit of withdrawals returned is 1000.", - "operationId":"postV1TradingRWithdrawhistory", - "parameters":[ - { - "type":"number", - "description":"Date of the last withdraw returned.", - "name":"startDate", - "in":"query", - "x-example":1747384800000 - }, - { - "type":"number", - "description":"Limit of withdraws that will be returned. With a maximum limit of 1000.", - "name":"limit", - "in":"query", - "x-example":60 - }, - { - "in":"body", - "name":"body", - "schema":{ - "$ref":"#/definitions/getPendingWithdrawalsPayload" - } - } - ], - "tags":[ - "Trading" - ], - "responses":{ - "200":{ - "schema":{ - "$ref":"#/definitions/withdrawHistoryResponse" - }, - "description":"Successful" - } - } - } - }, - "/v1/trading/w/cancelOpenOrders":{ - "post":{ - "summary":"This endpoint allows to cancel all open orders of the requestor", - "operationId":"postV1TradingWCancelopenorders", - "parameters":[ - { - "in":"body", - "name":"body", - "schema":{ - "$ref":"#/definitions/authPayload" - } - } - ], - "tags":[ - "Trading" - ], - "responses":{ - "200":{ - "schema":{ - "$ref":"#/definitions/cancelOpenOrdersResponse" - }, - "description":"Successful" - } - } - } - }, - "/v1/trading/w/cancelOrder":{ - "post":{ - "summary":"This endpoint allows to cancel a specific order.", - "operationId":"postV1TradingWCancelorder", - "parameters":[ - { - "in":"body", - "name":"body", - "schema":{ - "$ref":"#/definitions/cancelOrderPayload" - } - } - ], - "tags":[ - "Trading" - ], - "responses":{ - "200":{ - "schema":{ - "$ref":"#/definitions/cancelOrderResponse" - }, - "description":"Queues cancellation request and returns the order ID of the cancelled order." - }, - "502":{ - "description":"Unable to determine the status of order cancellation request, verify by fetching orders list" - } - } - } - }, - "/v1/trading/w/cancelWithdrawal":{ - "post":{ - "summary":"Cancel withdrawal with given id.", - "operationId":"postV1TradingWCancelwithdrawal", - "parameters":[ - { - "in":"body", - "name":"body", - "schema":{ - "$ref":"#/definitions/cancelWithdrawalPayload" - } - } - ], - "tags":[ - "Trading" - ], - "responses":{ - "200":{ - "schema":{ - "$ref":"#/definitions/withdrawHistoryObject" - }, - "description":"Successful" - } - } - } - }, - "/v1/trading/w/claimAirdrop":{ - "post":{ - "summary":"Request airdrop claim for the specified token/address", - "operationId":"postV1TradingWClaimairdrop", - "parameters":[ - { - "in":"body", - "name":"body", - "schema":{ - "$ref":"#/definitions/airdropEligibilityQuery" - } - } - ], - "tags":[ - "Trading" - ], - "responses":{ - "200":{ - "schema":{ - "$ref":"#/definitions/Model43" - }, - "description":"Successful" - } - } - } - }, - "/v1/trading/w/deposit":{ - "post":{ - "summary":"Submit a signed notification of a new deposit made.", - "operationId":"postV1TradingWDeposit", - "parameters":[ - { - "in":"body", - "name":"body", - "schema":{ - "$ref":"#/definitions/depositPayload" - } - } - ], - "tags":[ - "Trading" - ], - "responses":{ - "default":{ - "schema":{ - "$ref":"#/definitions/depositResponse" - }, - "description":"Returns the deposit notifcation." - } - } - } - }, - "/v1/trading/w/fastWithdrawal":{ - "post":{ - "summary":"Submit a request for a new fast withdrawal.", - "operationId":"postV1TradingWFastwithdrawal", - "parameters":[ - { - "in":"body", - "name":"body", - "schema":{ - "$ref":"#/definitions/fastWithdrawalPayload" - } - } - ], - "tags":[ - "Trading" - ], - "responses":{ - "200":{ - "schema":{ - "$ref":"#/definitions/Model46" - }, - "description":"Successful" - } - } - } - }, - "/v1/trading/w/feedback":{ - "post":{ - "summary":"This endpoint allows to send the email of an user.", - "operationId":"postV1TradingWFeedback", - "parameters":[ - { - "in":"body", - "name":"body", - "schema":{ - "$ref":"#/definitions/feedbackPayload" - } - } - ], - "tags":[ - "Internal" - ], - "responses":{ - "200":{ - "schema":{ - "$ref":"#/definitions/Model47" - }, - "description":"Successful" - } - } - } - }, - "/v1/trading/w/notifications":{ - "post":{ - "summary":"Creates a new notification.", - "operationId":"postV1TradingWNotifications", - "parameters":[ - { - "in":"body", - "name":"body", - "schema":{ - "$ref":"#/definitions/notificationPayload" - } - } - ], - "tags":[ - "Internal" - ], - "responses":{ - "200":{ - "schema":{ - "$ref":"#/definitions/notification" - }, - "description":"Successful" - } - } - } - }, - "/v1/trading/w/register":{ - "post":{ - "summary":"This method is used to register a Stark key that corresponds to an Ethereum public address. This will return deversifi Signature or DeversiFi application and user configuration details.", - "operationId":"postV1TradingWRegister", - "parameters":[ - { - "in":"body", - "name":"body", - "schema":{ - "$ref":"#/definitions/registerPayload" - } - } - ], - "tags":[ - "Trading" - ], - "responses":{ - "200":{ - "schema":{ - "$ref":"#/definitions/registerResponseUserRegisteredOnChain", - "x-alternatives":[ - { - "$ref":"#/x-alt-definitions/registerResponseUserRegisteredOnChain" - }, - { - "$ref":"#/x-alt-definitions/registerResponseUserNotRegisteredOnChain" - } - ] - }, - "description":"Successful" - } - } - } - }, - "/v1/trading/w/storeStarkTradingKey":{ - "post":{ - "summary":"This endpoint allows storing encrypted Stark Trading Key.", - "operationId":"postV1TradingWStorestarktradingkey", - "parameters":[ - { - "in":"body", - "name":"body", - "schema":{ - "$ref":"#/definitions/storeTradingKeyPayload" - } - } - ], - "tags":[ - "Trading" - ], - "responses":{ - "default":{ - "schema":{ - "$ref":"#/definitions/storeTradingKeyResponse" - }, - "description":"Returns flag of whether or not the key was stored successfully." - } - } - } - }, - "/v1/trading/w/submitOrder":{ - "post":{ - "summary":"This authenticated endpoint is used to submit an order.", - "operationId":"postV1TradingWSubmitorder", - "parameters":[ - { - "x-alternatives":[ - { - "$ref":"#/x-alt-definitions/submitOrderPayload" - }, - { - "$ref":"#/x-alt-definitions/Model6" - } - ], - "in":"body", - "name":"body", - "schema":{ - "$ref":"#/definitions/submitOrderPayload" - } - } - ], - "tags":[ - "Trading" - ], - "responses":{ - "200":{ - "schema":{ - "$ref":"#/definitions/submitOrderResponse", - "x-alternatives":[ - { - "$ref":"#/x-alt-definitions/submitOrderResponse" - }, - { - "$ref":"#/x-alt-definitions/Model7" - } - ] - }, - "description":"Successful" - }, - "202":{ - "description":"One or more orders of a batch of orders did not succeed" - }, - "502":{ - "description":"Unable to determine the status of order submission request, verify by fetching orders list" - } - } - } - }, - "/v1/trading/w/transfer":{ - "post":{ - "summary":"Submit a request for internal transfer (NOTE: currently not available to wider public).", - "operationId":"postV1TradingWTransfer", - "parameters":[ - { - "in":"body", - "name":"body", - "schema":{ - "$ref":"#/definitions/transferPayload" - } - } - ], - "tags":[ - "Trading" - ], - "responses":{ - "200":{ - "schema":{ - "$ref":"#/definitions/transferResponseObject" - }, - "description":"Successful" - } - } - } - }, - "/v1/trading/w/withdraw":{ - "post":{ - "summary":"Submit a request for a new withdrawal.", - "operationId":"postV1TradingWWithdraw", - "parameters":[ - { - "in":"body", - "name":"body", - "schema":{ - "$ref":"#/definitions/withdrawalPayload" - } - } - ], - "tags":[ - "Trading" - ], - "responses":{ - "default":{ - "schema":{ - "type":"string" - }, - "description":"Successful" - } - } - } - }, - "/v1/trading/r/getBalanceForUser/{userEthAddress}":{ - "post":{ - "summary":"This is used to retrieve the total and active balances of a user per token. Active balance is the balance that is currently available. Total balance (specified as balance) is the sum of all the balances including those locked for trading.", - "operationId":"postV1TradingRGetbalanceforuserUserethaddress", - "parameters":[ - { - "type":"string", - "description":"The ETH address of a potential user", - "name":"userEthAddress", - "in":"path", - "x-example":"0x3f2b822e9a8312c6dafbf9686a5e335af0e4d33b", - "required":true - }, - { - "in":"body", - "name":"body", - "schema":{ - "$ref":"#/definitions/Model54" - } - } - ], - "tags":[ - "Trading", - "public" - ], - "responses":{ - "200":{ - "schema":{ - "$ref":"#/definitions/getBalanceResponse" - }, - "description":"Successful" - }, - "401":{ - "description":"User has not authorized the use of this endpoint for their address" - } - } - } - }, - "/v1/trading/w/notifications/{id}":{ - "delete":{ - "summary":"Deletes a notification.", - "operationId":"deleteV1TradingWNotificationsId", - "parameters":[ - { - "type":"string", - "name":"id", - "in":"path", - "required":true - } - ], - "tags":[ - "Internal" - ], - "responses":{ - "200":{ - "schema":{ - "$ref":"#/definitions/notification" - }, - "description":"Successful" - } - } - } - } -}, -"definitions":{ - "getAllowanceResponse":{ - "type":"object", - "properties":{ - "allowance":{ - "type":"string", - "example":"ALLOWED", - "enum":[ - "ALLOWED", - "DENIED", - "KYC_REQUIRED" - ] - }, - "reason":{ - "type":"string", - "example":"NO_POLICY" - } - } - }, - "ETH":{ - "type":"object", - "properties":{ - "token":{ - "type":"string", - "description":"Token symbol", - "example":"ETH" - }, - "balance":{ - "type":"string", - "description":"Quantised token balance", - "example":"10" - }, - "usdBalance":{ - "type":"string", - "description":"USD equivalent of token balance", - "example":"20" - } - } - }, - "Model1":{ - "type":"object", - "properties":{ - "time":{ - "type":"string", - "format":"date", - "description":"DateTime of the aggregation", - "example":"2021-07-14T11:28:45.828Z" - }, - "onChainTotalUsd":{ - "type":"string", - "description":"total USD equivalent of the on-chain assets", - "example":"20" - }, - "exchangeTotalUsd":{ - "type":"string", - "description":"total USD equivalent of the exchange assets", - "example":"20" - }, - "totalUsd":{ - "type":"string", - "description":"total USD equivalent of both on-chain and exchange assets", - "example":"40" - }, - "onChainBalances":{ - "type":"object", - "description":"Map of on-chain token balances", - "name":"tokenBalanceSchema", - "properties":{ - "ETH":{ - "$ref":"#/definitions/ETH" - } - } - }, - "exchangeBalances":{ - "type":"object", - "description":"Map of exchange token balances", - "name":"tokenBalanceSchema", - "properties":{ - "ETH":{ - "$ref":"#/definitions/ETH" - } - } - } - } - }, - "balanceHistorySchema":{ - "type":"array", - "items":{ - "$ref":"#/definitions/Model1" - } - }, - "collateralBalancesSchema":{ - "type":"object" - }, - "pagination":{ - "type":"object", - "properties":{ - "totalItems":{ - "type":"number", - "description":"Total number of items matching the query", - "example":1559, - "minimum":0 - }, - "limit":{ - "type":"number", - "description":"Limit applied on returned items", - "example":5 - }, - "skip":{ - "type":"number", - "description":"Skip applied on returned items", - "example":2 - } - } - }, - "Model2":{ - "type":"object", - "properties":{ - "_id":{ - "type":"string", - "description":"Unique identifier representing the deposit or withdrawal", - "example":"606f207fc7aa2e91d028a17a" - }, - "type":{ - "type":"string", - "description":"Whether the transaction is a deposit, a classic withdrawal or a fast withdrawal", - "example":"Deposit", - "enum":[ - "Deposit", - "Withdrawal", - "FastWithdrawal" - ] - }, - "token":{ - "type":"string", - "description":"Token deposited or withdrawn", - "example":"ZRX" - }, - "amount":{ - "type":"number", - "description":"Amount deposited or withdrawn", - "example":1 - }, - "transactionHash":{ - "type":"string", - "description":"Hash of the Ethereum transaction leading to L1 balance debit or credit", - "example":"0xb5c8bd9430b6cc87a0e2fe110ece6bf527fa4f170a4bc8cd032f768fc5219838" - }, - "date":{ - "type":"string", - "format":"date", - "description":"Date and time deposit or withdrawal", - "example":"2020-11-11T16:37:05.957" - }, - "sourceOrRecipient":{ - "type":"string", - "description":"Originator of the deposit or recipient of the withdrawal", - "example":"0x148426fdc4c8a51b96b4bed827907b5fa6491ad0" - }, - "gateway":{ - "type":"string", - "description":"Set when operation used a gateway. Corresponds to a chain identifier", - "example":"MATIC_POS" - } - } - }, - "items":{ - "type":"array", - "items":{ - "$ref":"#/definitions/Model2" - } - }, - "getDepositsAndWithdrawalsResponse":{ - "type":"object", - "properties":{ - "pagination":{ - "$ref":"#/definitions/pagination" - }, - "items":{ - "$ref":"#/definitions/items" - } - } - }, - "addresses":{ - "type":"array", - "example":[ - "0x5317c63f870e8d2f85f0de3c2666d1414f5a728c", - "0x08152c1265dbc218ccc8ab5c574e6bd52279b3b7" - ], - "items":{ - "type":"string" - } - }, - "Model3":{ - "type":"object", - "properties":{ - "addresses":{ - "$ref":"#/definitions/addresses" - }, - "kycStatus":{ - "type":"string", - "example":"PASS", - "enum":[ - "PENDING", - "PASS", - "FAILED", - "EXPIRED" - ] - } - } - }, - "Model4":{ - "type":"object", - "properties":{ - "fillId":{ - "type":"string", - "description":"Unique identifier representing the fill event", - "example":"606f207fc7aa2e91d028a17a" - }, - "orderId":{ - "type":"string", - "description":"Unique identifier of the order associated with the fill", - "example":"BtHEvgY1Bz1" - }, - "symbol":{ - "type":"string", - "description":"Symbol for the order associated with the fill", - "example":"ETH:USDT" - }, - "price":{ - "type":"number", - "description":"Execution price of the fill", - "example":209.9 - }, - "fillAmount":{ - "type":"number", - "description":"Amount filled (negative amount for a sell event, positive for a buy event)", - "example":-0.125622 - }, - "orderAmount":{ - "type":"number", - "description":"Initial amount for the placed order associated with the fill", - "example":-1 - }, - "date":{ - "type":"string", - "format":"date", - "description":"Date and time of the fill event", - "example":"2020-11-11T16:37:05.957" - }, - "orderCreationDate":{ - "type":"string", - "format":"date", - "description":"Date and time at which the order associated with the fill event was placed", - "example":"2020-11-11T16:37:05.262Z" - }, - "orderType":{ - "type":"string", - "description":"Type of the order associated with the fill event", - "example":true, - "enum":[ - "EXCHANGE LIMIT", - "EXCHANGE MARKET" - ] - }, - "orderActive":{ - "type":"boolean", - "description":"Whether the order associated with the fill event is still active", - "example":true - }, - "orderCanceled":{ - "type":"boolean", - "description":"Whether the order associated with the fill event was canceled", - "example":false - } - } - }, - "Model5":{ - "type":"array", - "items":{ - "$ref":"#/definitions/Model4" - } - }, - "getFillsResponse":{ - "type":"object", - "properties":{ - "pagination":{ - "$ref":"#/definitions/pagination" - }, - "items":{ - "$ref":"#/definitions/Model5" - } - } - }, - "Model6":{ - "type":"object", - "properties":{ - "_id":{ - "type":"string", - "description":"Unique identifier representing this transfer", - "example":"MphMkBBZjnS" - }, - "token":{ - "type":"string", - "description":"Token transfered", - "example":"ETH" - }, - "amount":{ - "type":"number", - "description":"Amount transfered (effective amount received by the recipient)", - "example":3.14, - "minimum":0 - }, - "feeAmount":{ - "type":"number", - "description":"Transfer fee amount (in transfer token units)", - "example":3.14, - "minimum":0 - }, - "source":{ - "type":"string", - "description":"Source Ethereum address", - "example":"0x08152c1265dBc218ccc8Ab5C574e6bD52279b3B7" - }, - "recipient":{ - "type":"string", - "description":"Recipient Ethereum address", - "example":"0xeb3ea3ea9239577951523cafa9fd3072bc88e50a" - }, - "memo":{ - "type":"string", - "description":"Transfer memo", - "example":"my reference" - }, - "date":{ - "type":"string", - "format":"date", - "description":"Date and time of the transfer", - "example":"1990-04-14T00:20:00.000Z" - } - } - }, - "Model7":{ - "type":"array", - "items":{ - "$ref":"#/definitions/Model6" - } - }, - "getTransfersResponse":{ - "type":"object", - "properties":{ - "pagination":{ - "$ref":"#/definitions/pagination" - }, - "items":{ - "$ref":"#/definitions/Model7" - } - } - }, - "starkOrder":{ - "type":"object", - "description":"Stark Limit Order Data.", - "example":{ - "vaultIdSell":1000002, - "vaultIdBuy":1000001, - "amountSell":"97400000", - "amountBuy":"100000000000000000", - "tokenSell":"0x2", - "tokenBuy":"0x1" - }, - "properties":{ - "vaultIdSell":{ - "type":"integer", - "description":"The vault ID of the seller.", - "minimum":0 - }, - "vaultIdBuy":{ - "type":"integer", - "description":"The vault ID of the buyer.", - "minimum":0 - }, - "amountSell":{ - "type":"string", - "description":"The total amount to be sold." - }, - "amountBuy":{ - "type":"string", - "description":"The total amount to be bought." - }, - "tokenSell":{ - "type":"string", - "description":"The Stark token ID for the token being sold." - }, - "tokenBuy":{ - "type":"string", - "description":"The Stark token ID for the token being bought." - } - } - }, - "Model8":{ - "type":"object", - "properties":{ - "amountBuy":{ - "type":"string" - }, - "amountSell":{ - "type":"string" - }, - "tokenBuy":{ - "type":"string" - }, - "tokenSell":{ - "type":"string" - }, - "starkOrder":{ - "$ref":"#/definitions/starkOrder" - } - } - }, - "orders":{ - "type":"array", - "x-constraint":{ - "length":2 - }, - "items":{ - "$ref":"#/definitions/Model8" - } - }, - "AmmFundingOrderDataGetResponse":{ - "type":"object", - "example":{ - "pool":"ETHUSDT", - "orders":[ - { - "tokenBuy":"LP-ETHUSDT", - "amountBuy":"50", - "tokenSell":"ETH", - "amountSell":"2", - "starkOrder":{ - "tokenBuy":"0x11af21d6b234cd669edd702dd3d1d017be888337010b950ae3679eb4194b4bc", - "amountBuy":"5000000000", - "vaultIdBuy":247827906, - "tokenSell":"0xb333e3142fe16b78628f19bb15afddaef437e72d6d7f5c6c20c6801a27fba6", - "amountSell":"200000000", - "vaultIdSell":2121602419 - } - }, - { - "tokenBuy":"LP-ETHUSDT", - "amountBuy":"50", - "tokenSell":"USDT", - "amountSell":"1230", - "starkOrder":{ - "tokenBuy":"0x11af21d6b234cd669edd702dd3d1d017be888337010b950ae3679eb4194b4bc", - "amountBuy":"5000000000", - "vaultIdBuy":247827906, - "tokenSell":"0xb333e3142fe16b78628f19bb15afddaef437e72d6d7f5c6c20c6801a27fba6", - "amountSell":"200000000", - "vaultIdSell":2121602419 - } - } - ] - }, - "properties":{ - "pool":{ - "type":"string" - }, - "orders":{ - "$ref":"#/definitions/orders" - } - } - }, - "string":{ - "type":"object", - "properties":{ - "tokenAmount":{ - "type":"number", - "example":0.1 - }, - "USDVolume":{ - "type":"number", - "example":1.1 - } - }, - "required":[ - "tokenAmount", - "USDVolume" - ] - }, - "30DaysVolumeResponse":{ - "type":"object", - "properties":{ - "totalUSDVolume":{ - "type":"number", - "description":"The total trade volume in terms of USD.", - "example":73364.1749445 - }, - "tokens":{ - "type":"object", - "description":"Volumes for individual tokens.", - "name":"tokens", - "properties":{ - "string":{ - "$ref":"#/definitions/string" - } - } - }, - "startDate":{ - "type":"string", - "format":"date", - "description":"The start date and time for the volume presented.", - "example":"2020-01-01T00:00:00.714Z" - }, - "endDate":{ - "type":"string", - "format":"date", - "description":"The end date and time for the volume presented.", - "example":"2020-01-01T00:00:00.714Z" - } - }, - "required":[ - "totalUSDVolume" - ] - }, - "USDRankingResponse":{ - "type":"object", - "properties":{ - "address":{ - "type":"string", - "description":"The address of the trader.", - "example":"0xfc898b18a70ce49579f8d79a32e29928c15b4bc8" - }, - "USDValue":{ - "type":"number", - "description":"The trading volume for the address quoted in USD.", - "example":119128.566703 - } - } - }, - "User24HoursVolumeResponse":{ - "type":"object", - "properties":{ - "totalUSDVolume":{ - "type":"number", - "description":"The total trade volume in terms of USD.", - "example":3320.75 - }, - "tokens":{ - "type":"object", - "description":"Volumes for individual tokens.", - "name":"tokens", - "properties":{ - "string":{ - "$ref":"#/definitions/string" - } - } - } - }, - "required":[ - "totalUSDVolume" - ] - }, - "Model9":{ - "type":"object", - "properties":{ - "totalUSDVolume":{ - "type":"number", - "description":"The total trade volume in terms of USD.", - "example":3320.75 - }, - "tokens":{ - "$ref":"#/definitions/collateralBalancesSchema" - } - } - }, - "Model10":{ - "type":"object", - "properties":{ - "user":{ - "type":"string", - "description":"Ethereum address", - "example":"0x3f2b822E9A8312C6DafBF9686a5e335Af0E4D33B" - }, - "token":{ - "type":"string", - "description":"token for the airdrop", - "example":"DVF" - }, - "amount":{ - "type":"number", - "description":"DVF airdrop eligible amount", - "example":"15.52" - }, - "requested":{ - "type":"boolean", - "description":"Has this claim been already requested", - "example":"false" - } - } - }, - "claims":{ - "type":"array", - "items":{ - "$ref":"#/definitions/Model10" - } - }, - "Model11":{ - "type":"object", - "properties":{ - "claims":{ - "$ref":"#/definitions/claims" - }, - "isRegistered":{ - "type":"boolean", - "description":"is the eth address registered", - "example":true - } - } - }, - "beehiveStatsResponse":{ - "type":"object", - "properties":{ - "pool_identifier":{ - "type":"string", - "description":"Returns the pool identifier.", - "example":"NEC/wETH" - }, - "liquidity_locked":{ - "type":"number", - "description":"The total liquidity in terms of USD.", - "example":28751428.1231 - }, - "apy":{ - "type":"number", - "description":"The APY.", - "example":404.47648991003564 - } - }, - "required":[ - "pool_identifier", - "liquidity_locked", - "apy" - ] - }, - "Model12":{ - "type":"object", - "properties":{ - "pool_identifier":{ - "type":"string", - "description":"Returns the pool identifier.", - "example":"NEC/wETH" - }, - "liquidity_locked":{ - "type":"number", - "description":"The total liquidity in terms of USD.", - "example":28751428.1231 - }, - "apy":{ - "type":"number", - "description":"The APY.", - "example":404.47648991003564 - } - } - }, - "estimatedNextBatchResponse":{ - "type":"object", - "properties":{ - "estimatedTime":{ - "type":"number", - "description":"The number of seconds until the batch is sent to be processed and broadcast to the blockchain.", - "example":608 - }, - "averageTime":{ - "type":"number", - "description":"The configured number of seconds between batches.", - "example":608 - }, - "finalisedBatchPendingConfirmation":{ - "type":"boolean", - "description":"True if the previous batch has been created but still pending confirmation on the blockchain.", - "example":true - } - } - }, - "Model13":{ - "type":"object", - "properties":{ - "feeQuantised":{ - "type":"string", - "description":"Fast withdrawal fee as quantised amount of token to be withdrawn.", - "example":"1224000", - "pattern":"^[0-9]*$" - }, - "feeBaseUnits":{ - "type":"string", - "description":"Fast withdrawal fee as base units of token to be withdrawn.", - "example":"0.01224", - "pattern":"^[+-]?((\\d+(\\.\\d*)?)|(\\.\\d+))$" - } - } - }, - "Model14":{ - "type":"object", - "properties":{ - "maxAmountQuantised":{ - "type":"string", - "description":"Max amount as quantised amount of token to be withdrawn.", - "example":"1224000", - "pattern":"^[0-9]*$" - }, - "maxAmountBaseUnits":{ - "type":"string", - "description":"Max amount as base units of token to be withdrawn.", - "example":"0.01224", - "pattern":"^[+-]?((\\d+(\\.\\d*)?)|(\\.\\d+))$" - } - } - }, - "fees":{ - "type":"object", - "properties":{ - "maker":{ - "type":"number", - "description":"The fee basis points for maker orders (adding bids or offers to the order book).", - "example":15 - }, - "taker":{ - "type":"number", - "description":"The fee basis points for taker orders (removing liquidity from the order book).", - "example":20 - } - } - }, - "getFeeRateResponse":{ - "type":"object", - "properties":{ - "address":{ - "type":"string", - "description":"The Ethereum address of the user verified by nonce and signature.", - "example":"0x116f494a2ce567067f319fea1c9f294f23d2fe68" - }, - "timestamp":{ - "type":"number", - "description":"Timestamp in milliseconds since epoch.", - "example":1590263332427 - }, - "fees":{ - "$ref":"#/definitions/fees" - } - } - }, - "gasSavingsResponse":{ - "type":"object", - "properties":{ - "totalUSD":{ - "type":"number", - "description":"Total gas savings in USD", - "example":7123000 - }, - "monthUSD":{ - "type":"number", - "description":"Gas savings within last 30 days", - "example":421000 - }, - "weekUSD":{ - "type":"number", - "description":"Gas savings within last 7 days", - "example":421000 - }, - "changePerSecondUSD":{ - "type":"number", - "description":"Rate at which gas savings increase per second", - "example":0.0312 - } - } - }, - "getBalanceUsdResponse":{ - "type":"object", - "properties":{ - "ethAddress":{ - "type":"string", - "description":"The ethereum public address of the user.", - "example":"0x14d06788090769f669427b6aea1c0240d2321f34" - }, - "balanceUsd":{ - "type":"number", - "description":"It is the sum of all user balances converted to USD.", - "example":"2" - } - } - }, - "getGasPriceResponse":{ - "type":"object", - "description":"Range of gas prices for on chain confirmation speed", - "example":{ - "fast":"70000000000", - "fastWait":0.5, - "average":"67000000000", - "averageWait":1.4, - "cheap":"66000000000", - "cheapWait":10.5 - }, - "properties":{ - "fast":{ - "type":"string", - "description":"Gas price in Wei for quickest onchain transaction confirmation.", - "pattern":"^[0-9]*$" - }, - "average":{ - "type":"string", - "description":"Average gas price in Wei for average onchain transaction speed.", - "pattern":"^[0-9]*$" - }, - "cheap":{ - "type":"string", - "description":"Low gas price in Wei and very slow transaction speed.", - "pattern":"^[0-9]*$" - }, - "fastWait":{ - "type":"number", - "description":"The approximate time for a transaction confirmation when using fast as the gas price." - }, - "averageWait":{ - "type":"number", - "description":"The approximate time for a transaction confirmation when using average as the gas price." - }, - "cheapWait":{ - "type":"number", - "description":"The approximate time for a transaction confirmation when using cheap as the gas price." - } - } - }, - "BALANCES":{ - "type":"object", - "example":{ - "key":"balances", - "description":"User's exchange balances" - }, - "properties":{ - "key":{ - "type":"string", - "description":"Permission key" - }, - "description":{ - "type":"string", - "description":"description of the permission" - } - } - }, - "TRADING_HISTORY":{ - "type":"object", - "example":{ - "key":"tradingHistory", - "description":"User's trading history" - }, - "properties":{ - "key":{ - "type":"string", - "description":"Permission key" - }, - "description":{ - "type":"string", - "description":"description of the permission" - } - } - }, - "Model15":{ - "type":"object", - "properties":{ - "BALANCES":{ - "$ref":"#/definitions/BALANCES" - }, - "TRADING_HISTORY":{ - "$ref":"#/definitions/TRADING_HISTORY" - } - } - }, - "Model16":{ - "type":"object", - "properties":{ - "liquidityAvailable":{ - "type":"number", - "description":"Remaining liquidity", - "example":10 - }, - "totalSupply":{ - "type":"number", - "description":"Total supply", - "example":1000 - } - } - }, - "tokenSaleStartEndResponse":{ - "type":"object", - "properties":{ - "start":{ - "type":"number", - "description":"Token sale start timestamp", - "example":1625036000 - }, - "end":{ - "type":"number", - "description":"Token sale end timestamp", - "example":1625076000 - }, - "startPrice":{ - "type":"number", - "description":"Token sale start price", - "example":1.5 - } - } - }, - "last24HoursVolumeResponse":{ - "type":"object", - "properties":{ - "TotalUSDValue":{ - "type":"number", - "description":"The total trade volume in terms of USD.", - "example":28751428.1231 - }, - "tokens":{ - "$ref":"#/definitions/collateralBalancesSchema" - }, - "symbols":{ - "$ref":"#/definitions/collateralBalancesSchema" - }, - "startDate":{ - "type":"string", - "description":"The start date and time for the volume presented.", - "example":"2020-05-22T03:11:29.014Z" - } - } - }, - "registeredAccountsResponse":{ - "type":"object", - "properties":{ - "accounts":{ - "type":"number", - "description":"Total registered accounts", - "example":421 - } - } - }, - "Model17":{ - "type":"object", - "properties":{ - "volume":{ - "type":"number", - "description":"token swap volume.", - "example":4328 - } - } - }, - "Model18":{ - "type":"object", - "properties":{ - "address":{ - "type":"string", - "description":"Ethereum address", - "example":"0xc0e9bd267626e2393ddaf520ae5df27ef6c533bd" - }, - "score":{ - "type":"number", - "description":"balance for this address/token at block number", - "example":1000000000 - } - } - }, - "score":{ - "type":"array", - "items":{ - "$ref":"#/definitions/Model18" - } - }, - "Model19":{ - "type":"object", - "properties":{ - "score":{ - "$ref":"#/definitions/score" - } - } - }, - "tokenRankingResponse":{ - "type":"object", - "properties":{ - "address":{ - "type":"string", - "description":"The address of the trader.", - "example":"0xfc898b18a70ce49579f8d79a32e29928c15b4bc8" - }, - "amount":{ - "type":"number", - "description":"The trading volume for the address", - "example":852.9290936325145 - } - } - }, - "totalValueLockedResponseItem":{ - "type":"object", - "properties":{ - "date":{ - "type":"string", - "format":"date", - "description":"Date on which `value` represents TVL", - "example":"2021-08-12T16:57:12.869Z" - }, - "value":{ - "type":"number", - "description":"Total value locked for a particular date", - "example":421000 - } - } - }, - "totalValueLockedResponse":{ - "type":"array", - "items":{ - "$ref":"#/definitions/totalValueLockedResponseItem" - } - }, - "Model20":{ - "type":"object", - "properties":{ - "count":{ - "type":"number", - "description":"Trades executed within time.", - "example":11206 - } - } - }, - "Model21":{ - "type":"object", - "properties":{ - "volume":{ - "type":"number", - "description":"token transfer volume.", - "example":3443 - } - } - }, - "vaultIdAndStarkKeyResponse":{ - "type":"object", - "properties":{ - "vaultId":{ - "type":"number", - "description":"The vault ID corresponding to the user registered with and token", - "example":1644016910 - }, - "starkKey":{ - "type":"string", - "description":"The public stark key for the user registered with ", - "example":"0x0180fc633b754b50370614a587218cf36a4fa7c2f11d65ec761dded48a81ab9e", - "pattern":"^0x[a-f0-9]+$" - } - } - }, - "votingPowerResponse":{ - "type":"object", - "properties":{ - "totalSupply":{ - "type":"string", - "description":"Total xDVF balance of users on exchange", - "example":"321000000" - }, - "votingPower":{ - "type":"number", - "description":"Percentage of amount compared to total balance", - "example":13.37 - } - } - }, - "Model22":{ - "type":"object", - "properties":{ - "isRegisteredOnDeversifi":{ - "type":"boolean", - "description":"Whether the user is registered on DeversiFi servers.", - "example":true, - "enum":[ - true, - false - ] - }, - "isRegisteredOnChain":{ - "type":"boolean", - "description":"Whether the user is registered with Starkware.", - "example":true, - "enum":[ - true, - false - ] - }, - "ethAddress":{ - "type":"string", - "description":"Ethereum address.", - "example":"0x3f2b822E9A8312C6DafBF9686a5e335Af0E4D33B" - } - }, - "required":[ - "isRegisteredOnDeversifi", - "isRegisteredOnChain", - "ethAddress" - ] - }, - "Model23":{ - "type":"object", - "properties":{ - "fillAmount":{ - "type":"number", - "description":"amount filled" - }, - "user":{ - "type":"string", - "description":"User ETH address" - }, - "date":{ - "type":"string", - "format":"date", - "description":"Date of the settlement" - }, - "tokenBuy":{ - "type":"string", - "description":"Buy token" - }, - "tokenSell":{ - "type":"string", - "description":"Sell token" - }, - "amountBuy":{ - "type":"string", - "description":"Amount of buy order" - }, - "amountSell":{ - "type":"string", - "description":"Amount of sell order" - }, - "orderId":{ - "type":"string", - "description":"Id of the order" - }, - "feeCurrency":{ - "type":"string", - "description":"Currency of the fee" - }, - "feeAmount":{ - "type":"string", - "description":"Amount of fee" - } - } - }, - "Model24":{ - "type":"array", - "items":{ - "$ref":"#/definitions/Model23" - } - }, - "Model25":{ - "type":"object", - "properties":{ - "items":{ - "$ref":"#/definitions/Model24" - } - } - }, - "tradesObject":{ - "type":"object", - "properties":{ - "trade_id":{ - "type":"number", - "description":"A unique ID associated with the trade for the currency pair transaction", - "example":1 - }, - "price":{ - "type":"number", - "description":"Last transacted price of base currency based on given quote currency.", - "example":275.23 - }, - "base_volume":{ - "type":"number", - "description":"Transaction amount in BASE currency.", - "example":1.5 - }, - "quote_volume":{ - "type":"number", - "description":"Transaction amount in QUOTE currency.", - "example":347.81 - }, - "timestamp":{ - "type":"number", - "description":"Unix timestamp in milliseconds for when the transaction occurred.", - "example":1747384800000 - }, - "type":{ - "type":"string", - "description":"Used to determine whether or not the transaction originated as a buy or sell.", - "example":"buy" - } - } - }, - "tradesResponse":{ - "type":"array", - "items":{ - "$ref":"#/definitions/tradesObject" - } - }, - "24HoursVolumeResponse":{ - "type":"object", - "example":{ - "totalUSDVolume":0, - "tokens":{ - "ETH":{ - "tokenAmount":0, - "USDVolume":0 - }, - "USDT":{ - "tokenAmount":0, - "USDVolume":0 - } - }, - "symbols":{ - "ETH:USDT":{ - "tokenAmount":0, - "USDVolume":0 - } - }, - "startDate":"2020-01-01T00:00:00.183Z", - "endDate":"2020-01-02T00:00:00.183Z" - }, - "properties":{ - "totalUSDVolume":{ - "type":"number", - "description":"The total trade volume in terms of USD.", - "example":3320.75 - }, - "tokens":{ - "$ref":"#/definitions/collateralBalancesSchema" - }, - "symbols":{ - "$ref":"#/definitions/collateralBalancesSchema" - }, - "startDate":{ - "type":"string", - "description":"The start date and time for the volume presented.", - "example":"2020-01-01T00:00:00.714Z" - }, - "endDate":{ - "type":"string", - "description":"The end date and time for the volume presented.", - "example":"2020-01-01T00:00:00.714Z" - } - } - }, - "Model26":{ - "type":"object", - "properties":{ - "trade_id":{ - "type":"number", - "description":"A unique ID associated with the trade for the currency pair transaction", - "example":1 - }, - "price":{ - "type":"number", - "description":"Last transacted price of base currency based on given quote currency.", - "example":275.23 - }, - "base_volume":{ - "type":"number", - "description":"Transaction amount in BASE currency.", - "example":1.5 - }, - "quote_volume":{ - "type":"number", - "description":"Transaction amount in QUOTE currency.", - "example":347.81 - }, - "timestamp":{ - "type":"number", - "description":"Unix timestamp in milliseconds for when the transaction occurred.", - "example":1548028800 - }, - "type":{ - "type":"string", - "description":"Used to determine whether or not the transaction originated as a buy or sell.", - "example":"buy" - } - } - }, - "Model27":{ - "type":"array", - "items":{ - "$ref":"#/definitions/Model26" - } - }, - "bridgedDepositsPostPayload":{ - "type":"object", - "properties":{ - "token":{ - "type":"string", - "example":"ETH" - }, - "amount":{ - "type":"string", - "description":"quantised amount of the token to be undefined", - "example":"10000000" - }, - "txHash":{ - "type":"string", - "description":"Transaction Hash of the corresponding Ethereum transaction", - "example":"0xeef10fc5170f669b86c4cd0444882a96087221325f8bf2f55d6188633aa7be7c", - "pattern":"^0x[a-f0-9]+$", - "x-constraint":{ - "length":66 - } - }, - "chain":{ - "type":"string", - "example":"MATIC_POS", - "enum":[ - "MATIC_POS" - ] - } - } - }, - "bridgedDepositsPostResponse":{ - "type":"object", - "properties":{ - "_id":{ - "type":"string", - "example":"FEHn8HYEQQw" - }, - "createdAt":{ - "type":"string", - "format":"date", - "description":"The date (ISO 8601) at which bridgedDeposit was created.", - "example":"2020-05-13T14:11:02.205Z" - }, - "updatedAt":{ - "type":"string", - "format":"date", - "description":"The date (ISO 8601) at which bridgedDeposit was last updated.", - "example":"2020-05-13T14:13:10.403Z" - }, - "token":{ - "type":"string", - "example":"ETH" - }, - "amount":{ - "type":"string", - "description":"quantised amount of the token to be undefined", - "example":"10000000" - }, - "pending":{ - "type":"boolean", - "example":true - }, - "expiresAt":{ - "type":"string", - "format":"date", - "example":"2021-08-12T17:02:15.857Z" - }, - "txHash":{ - "type":"string", - "description":"Transaction Hash of the corresponding Ethereum transaction", - "example":"0xeef10fc5170f669b86c4cd0444882a96087221325f8bf2f55d6188633aa7be7c", - "pattern":"^0x[a-f0-9]+$", - "x-constraint":{ - "length":66 - } - }, - "chain":{ - "type":"string", - "example":"MATIC_POS", - "enum":[ - "MATIC_POS" - ] - } - } - }, - "signature":{ - "type":"object", - "properties":{ - "r":{ - "type":"string", - "pattern":"^0x[a-f0-9]+$" - }, - "s":{ - "type":"string", - "pattern":"^0x[a-f0-9]+$" - } - } - }, - "tx":{ - "type":"object", - "description":"StarkWare TansferRequest from the user to DeversiFi", - "example":{ - "amount":"10000000", - "expirationTimestamp":446134, - "nonce":976614084, - "receiverPublicKey":"0x077a3b314db07c45076d11f62b6f9e748a39790441823307743cf00d6597ea43", - "receiverVaultId":1863686755, - "senderPublicKey":"0x044926648f4b6f002dfa389c536129ae178f34d9be452724268cc48ebea2b37c", - "senderVaultId":2010760265, - "token":"0x180bef8ae3462e919489763b84dc1dc700c45a249dec4d1136814a639f2dd7b", - "type":"TransferRequest", - "signature":{ - "r":"0x2857ca21310ab87bb7c37ebad0e7166f1fb46e43cf32d6587a31e148d44b677", - "s":"0x45e939717a6de4ad5e79993d918bb40e629760da7a04062e965394d1d14106a" - } - }, - "properties":{ - "type":{ - "type":"string", - "enum":[ - "TransferRequest" - ] - }, - "amount":{ - "type":"string", - "pattern":"^[0-9]*$" - }, - "expirationTimestamp":{ - "type":"integer", - "minimum":0 - }, - "nonce":{ - "type":"integer", - "minimum":0 - }, - "receiverPublicKey":{ - "type":"string", - "pattern":"^0x[a-f0-9]+$" - }, - "receiverVaultId":{ - "type":"integer" - }, - "senderPublicKey":{ - "type":"string", - "pattern":"^0x[a-f0-9]+$" - }, - "senderVaultId":{ - "type":"integer" - }, - "signature":{ - "$ref":"#/definitions/signature" - }, - "token":{ - "type":"string", - "pattern":"^0x[a-f0-9]+$" - } - } - }, - "bridgedWithdrawalsPostPayload":{ - "type":"object", - "properties":{ - "token":{ - "type":"string", - "example":"ETH" - }, - "amount":{ - "type":"string", - "description":"quantised amount of the token to be undefined", - "example":"10000000" - }, - "nonce":{ - "type":"integer", - "description":"Used to prevent creation of duplicate withdrawal if the request is retried with the same payload. withdrawal are be uniquely identified by a combination of user, token, amount and nonce.", - "example":976614084, - "minimum":0 - }, - "chain":{ - "type":"string", - "example":"MATIC_POS", - "enum":[ - "MATIC_POS" - ] - }, - "tx":{ - "$ref":"#/definitions/tx" - } - } - }, - "onChain":{ - "type":"object", - "properties":{ - "amount":{ - "type":"string", - "description":"Amount which recipient will receive on chain.", - "example":"1000", - "pattern":"^[0-9]*$" - }, - "submittedAt":{ - "type":"string", - "format":"date", - "description":"Date at which withdrawal has been sent on chain.", - "example":"2020-01-29T14:13:05.898Z" - } - } - }, - "fastWithdrawalData":{ - "type":"object", - "properties":{ - "transactionFee":{ - "type":"string", - "description":"fee to paid by the user in the currency of the transaction (quantised units).", - "example":"1", - "pattern":"^[0-9]*$" - }, - "recipientEthAddress":{ - "type":"string", - "description":"Ethereum address of recipient who will receive funds on chain.", - "example":"0x948cd3ad67c5f21412bfcd07a7981322f9fa01f0" - }, - "onChain":{ - "$ref":"#/definitions/onChain" - } - } - }, - "bridgedWithdrawalsPostResponse":{ - "type":"object", - "properties":{ - "_id":{ - "type":"string", - "example":"FEHn8HYEQQw" - }, - "createdAt":{ - "type":"string", - "format":"date", - "description":"The date (ISO 8601) at which bridgedWithdrawal was created.", - "example":"2020-05-13T14:11:02.205Z" - }, - "updatedAt":{ - "type":"string", - "format":"date", - "description":"The date (ISO 8601) at which bridgedWithdrawal was last updated.", - "example":"2020-05-13T14:13:10.403Z" - }, - "token":{ - "type":"string", - "example":"ETH" - }, - "amount":{ - "type":"string", - "description":"quantised amount of the token to be undefined", - "example":"10000000" - }, - "readyToWithdrawOnChain":{ - "type":"boolean", - "example":true - }, - "nonce":{ - "type":"integer", - "description":"Used to prevent creation of duplicate withdrawal if the request is retried with the same payload. withdrawal are be uniquely identified by a combination of user, token, amount and nonce.", - "example":976614084, - "minimum":0 - }, - "fastWithdrawalData":{ - "$ref":"#/definitions/fastWithdrawalData" - }, - "chain":{ - "type":"string", - "example":"MATIC_POS", - "enum":[ - "MATIC_POS" - ] - } - } - }, - "depositsPostPayload":{ - "type":"object", - "properties":{ - "token":{ - "type":"string", - "example":"ETH" - }, - "amount":{ - "type":"string", - "description":"quantised amount of the token to be deposited", - "example":"10000000" - }, - "txHash":{ - "type":"string", - "description":"Transaction Hash of the corresponding Ethereum transaction", - "example":"0xeef10fc5170f669b86c4cd0444882a96087221325f8bf2f55d6188633aa7be7c", - "pattern":"^0x[a-f0-9]+$", - "x-constraint":{ - "length":66 - } - } - } - }, - "Model28":{ - "type":"object", - "description":"Parameters of the Stark transaction created by this request.", - "properties":{ - "starkKey":{ - "type":"string", - "description":"Stark key of the owner of the destination vault", - "example":"0x1a2b3c", - "pattern":"^0x[a-f0-9]+$" - }, - "tokenId":{ - "type":"string", - "description":"Stark token id corresponding to the token being deposited.", - "example":"0xa1b2c3", - "pattern":"^0x[a-f0-9]+$" - }, - "vaultId":{ - "type":"number", - "description":"Stark vault id to which the funds will be deposited.", - "example":123 - }, - "amount":{ - "type":"string", - "description":"quantised amount of the token to be deposited", - "example":"10000000" - } - } - }, - "depositsPostResponse":{ - "type":"object", - "properties":{ - "_id":{ - "type":"string", - "example":"FEHn8HYEQQw" - }, - "createdAt":{ - "type":"string", - "format":"date", - "description":"The date (ISO 8601) at which deposit was created.", - "example":"2020-05-13T14:11:02.205Z" - }, - "updatedAt":{ - "type":"string", - "format":"date", - "description":"The date (ISO 8601) at which deposit was last updated.", - "example":"2020-05-13T14:13:10.403Z" - }, - "token":{ - "type":"string", - "example":"ETH" - }, - "amount":{ - "type":"string", - "description":"quantised amount of the token to be deposited", - "example":"10000000" - }, - "pending":{ - "type":"boolean", - "example":true - }, - "expiresAt":{ - "type":"string", - "format":"date", - "example":"2021-08-12T17:12:18.058Z" - }, - "txHash":{ - "type":"string", - "description":"Transaction Hash of the corresponding Ethereum transaction", - "example":"0xeef10fc5170f669b86c4cd0444882a96087221325f8bf2f55d6188633aa7be7c", - "pattern":"^0x[a-f0-9]+$", - "x-constraint":{ - "length":66 - } - }, - "tx":{ - "$ref":"#/definitions/Model28" - } - } - }, - "deposits-validatePostPayload":{ - "type":"object", - "properties":{ - "token":{ - "type":"string", - "example":"ETH" - }, - "amount":{ - "type":"string", - "description":"quantised amount of the token to be undefined", - "example":"10000000" - } - } - }, - "deposits-validatePostResponse":{ - "type":"object", - "properties":{ - "token":{ - "type":"string", - "example":"ETH" - }, - "amount":{ - "type":"string", - "description":"quantised amount of the token to be undefined", - "example":"10000000" - }, - "starkKey":{ - "type":"string", - "description":"Stark key of the owner of the destination vault", - "example":"0x1a2b3c", - "pattern":"^0x[a-f0-9]+$" - }, - "tokenId":{ - "type":"string", - "description":"Stark token id corresponding to the token being deposited.", - "example":"0xa1b2c3", - "pattern":"^0x[a-f0-9]+$" - }, - "vaultId":{ - "type":"number", - "description":"Stark vault id to which the funds will be deposited.", - "example":123 - } - } - }, - "withdrawalsPostPayload":{ - "type":"object", - "properties":{ - "token":{ - "type":"string", - "example":"ETH" - }, - "amount":{ - "type":"string", - "description":"quantised amount of the token to be withdrawn", - "example":"10000000" - }, - "nonce":{ - "type":"integer", - "description":"Used to prevent creation of duplicate withdrawal if the request is retried with the same payload. withdrawal are be uniquely identified by a combination of user, token, amount and nonce.", - "example":976614084, - "minimum":0 - } - } - }, - "withdrawalsPostResponse":{ - "type":"object", - "properties":{ - "_id":{ - "type":"string", - "example":"FEHn8HYEQQw" - }, - "createdAt":{ - "type":"string", - "format":"date", - "description":"The date (ISO 8601) at which withdrawal was created.", - "example":"2020-05-13T14:11:02.205Z" - }, - "updatedAt":{ - "type":"string", - "format":"date", - "description":"The date (ISO 8601) at which withdrawal was last updated.", - "example":"2020-05-13T14:13:10.403Z" - }, - "token":{ - "type":"string", - "example":"ETH" - }, - "amount":{ - "type":"string", - "description":"quantised amount of the token to be withdrawn", - "example":"10000000" - }, - "readyToWithdrawOnChain":{ - "type":"boolean", - "example":true - }, - "nonce":{ - "type":"integer", - "description":"Used to prevent creation of duplicate withdrawal if the request is retried with the same payload. withdrawal are be uniquely identified by a combination of user, token, amount and nonce.", - "example":976614084, - "minimum":0 - } - } - }, - "starkPublicKey":{ - "type":"object", - "description":"The Stark public key. Both the \"x\" and \"y\" part are required.", - "example":{ - "x":"0746919ecbb54563de512f6fb556c21dab091748b41a60a946dbdbf118ac0a85", - "y":"58f7ce5eb6eb5bd24f70394622b1f4d2c54ebca317a3e61bf9f349dccf166cf" - }, - "properties":{ - "x":{ - "type":"string", - "description":"The \"x\" part of the Stark public key.", - "minLength":64, - "maxLength":64, - "x-format":{ - "hex":{ - "byteAligned":false - } - } - }, - "y":{ - "type":"string", - "description":"The \"y\" part of the Stark public key.", - "x-format":{ - "hex":{ - "byteAligned":false - } - } - } - }, - "required":[ - "x", - "y" - ] - }, - "Model29":{ - "type":"object", - "description":"Stark signature consisting of consisting of \"r\" and \"s\"", - "example":{ - "v":"3b46dfe03caef623048fedc8457a92385cd63eff6349ad135c945cd84937677", - "r":"1f38f551d798562c16d28733c7e3ff6850898d82f0ac9ccd39d373303b1778c", - "s":"518560420e52a37e9f580f024fc0fe8572cb2f5437a839075bbf4b2b123d572" - }, - "properties":{ - "v":{ - "type":"string", - "description":"The \"v\" part of the Stark signature." - }, - "r":{ - "type":"string", - "description":"The \"r\" part of the Stark signature." - }, - "s":{ - "type":"string", - "description":"The \"s\" part of the Stark signature." - } - }, - "required":[ - "r", - "s" - ] - }, - "Model30":{ - "type":"object", - "description":"Stark Limit Order Object.", - "example":{ - "vaultIdSell":1000002, - "vaultIdBuy":1000001, - "amountSell":"97400000", - "amountBuy":"100000000000000000", - "tokenSell":"0x2", - "tokenBuy":"0x1" - }, - "properties":{ - "vaultIdSell":{ - "type":"integer", - "description":"The vault ID of the seller.", - "minimum":0 - }, - "vaultIdBuy":{ - "type":"integer", - "description":"The vault ID of the buyer.", - "minimum":0 - }, - "amountSell":{ - "type":"string", - "description":"The total amount to be sold." - }, - "amountBuy":{ - "type":"string", - "description":"The total amount to be bought." - }, - "tokenSell":{ - "type":"string", - "description":"The Stark token ID for the token being sold." - }, - "tokenBuy":{ - "type":"string", - "description":"The Stark token ID for the token being bought." - }, - "nonce":{ - "type":"integer", - "description":"Used make identical stark transactions unique.", - "minimum":0, - "maximum":2147483647 - }, - "expirationTimestamp":{ - "type":"integer", - "description":"Expiration timestamp of the order.", - "minimum":0 - }, - "signature":{ - "$ref":"#/definitions/Model29" - } - } - }, - "Model31":{ - "type":"object", - "properties":{ - "starkOrder":{ - "$ref":"#/definitions/Model30" - } - } - }, - "Model32":{ - "type":"array", - "example":[ - { - "starkOrder":{ - "tokenBuy":"0x11af21d6b234cd669edd702dd3d1d017be888337010b950ae3679eb4194b4bc", - "amountBuy":"5000000000", - "vaultIdBuy":247827906, - "tokenSell":"0xb333e3142fe16b78628f19bb15afddaef437e72d6d7f5c6c20c6801a27fba6", - "amountSell":"200000000", - "vaultIdSell":2121602419, - "nonce":1079618848, - "expirationTimestamp":455582, - "signature":{ - "r":"0x2857ca21310ab87bb7c37ebad0e7166f1fb46e43cf32d6587a31e148d44b677", - "s":"0x45e939717a6de4ad5e79993d918bb40e629760da7a04062e965394d1d14106a" - } - } - }, - { - "starkOrder":{ - "tokenBuy":"0x11af21d6b234cd669edd702dd3d1d017be888337010b950ae3679eb4194b4bc", - "amountBuy":"5000000000", - "vaultIdBuy":247827906, - "tokenSell":"0xb333e3142fe16b78628f19bb15afddaef437e72d6d7f5c6c20c6801a27fba6", - "amountSell":"200000000", - "vaultIdSell":2121602419, - "nonce":1079618848, - "expirationTimestamp":455582, - "signature":{ - "r":"0x2857ca21310ab87bb7c37ebad0e7166f1fb46e43cf32d6587a31e148d44b677", - "s":"0x45e939717a6de4ad5e79993d918bb40e629760da7a04062e965394d1d14106a" - } - } - } - ], - "x-constraint":{ - "length":2 - }, - "items":{ - "$ref":"#/definitions/Model31" - } - }, - "AmmFundingOrdersPostPayload":{ - "type":"object", - "properties":{ - "pool":{ - "type":"string", - "example":"ETH:USDT" - }, - "starkPublicKey":{ - "$ref":"#/definitions/starkPublicKey" - }, - "orders":{ - "$ref":"#/definitions/Model32" - } - } - }, - "fill":{ - "type":"object", - "properties":{ - "amountBuy":{ - "type":"string" - }, - "amountSell":{ - "type":"string" - } - } - }, - "Model33":{ - "type":"object", - "properties":{ - "amountBuy":{ - "type":"string" - }, - "amountSell":{ - "type":"string" - }, - "fill":{ - "$ref":"#/definitions/fill" - }, - "starkOrder":{ - "$ref":"#/definitions/Model30" - }, - "tokenBuy":{ - "type":"string" - }, - "tokenSell":{ - "type":"string" - } - } - }, - "Model34":{ - "type":"array", - "x-constraint":{ - "length":2 - }, - "items":{ - "$ref":"#/definitions/Model33" - } - }, - "AmmFundingOrdersPostResponse":{ - "type":"object", - "example":{ - "_id":"L5QTNJtb2yF-GYa1NFCy1p5", - "closedAt":"2020-05-13T14:11:02.205Z", - "failed":false, - "pending":true, - "pool":"ETHUSDT", - "type":"Deposit", - "user":"0x948cd3ad67c5f21412bfcd07a7981322f9fa01f0", - "orders":[ - { - "tokenBuy":"LP-ETHUSDT", - "amountBuy":"50", - "tokenSell":"ETH", - "amountSell":"2", - "fill":{ - "amountBuy":"45", - "amountSell":"1" - }, - "starkOrder":{ - "tokenBuy":"0x11af21d6b234cd669edd702dd3d1d017be888337010b950ae3679eb4194b4bc", - "amountBuy":"5000000000", - "vaultIdBuy":247827906, - "tokenSell":"0xb333e3142fe16b78628f19bb15afddaef437e72d6d7f5c6c20c6801a27fba6", - "amountSell":"200000000", - "vaultIdSell":2121602419, - "nonce":1079618848, - "expirationTimestamp":455582, - "signature":{ - "r":"0x2857ca21310ab87bb7c37ebad0e7166f1fb46e43cf32d6587a31e148d44b677", - "s":"0x45e939717a6de4ad5e79993d918bb40e629760da7a04062e965394d1d14106a" - } - } - }, - { - "tokenBuy":"LP-ETHUSDT", - "amountBuy":"50", - "tokenSell":"USDT", - "amountSell":"1230", - "fill":{ - "amountBuy":"48", - "amountSell":"1220" - }, - "starkOrder":{ - "tokenBuy":"0x11af21d6b234cd669edd702dd3d1d017be888337010b950ae3679eb4194b4bc", - "amountBuy":"5000000000", - "vaultIdBuy":247827906, - "tokenSell":"0xb333e3142fe16b78628f19bb15afddaef437e72d6d7f5c6c20c6801a27fba6", - "amountSell":"200000000", - "vaultIdSell":2121602419, - "nonce":1079618848, - "expirationTimestamp":455582, - "signature":{ - "r":"0x2857ca21310ab87bb7c37ebad0e7166f1fb46e43cf32d6587a31e148d44b677", - "s":"0x45e939717a6de4ad5e79993d918bb40e629760da7a04062e965394d1d14106a" - } - } - } - ], - "starkPublicKey":{ - "x":"0746919ecbb54563de512f6fb556c21dab091748b41a60a946dbdbf118ac0a85", - "y":"690890d33f62e706b80d214546ab3fd063fad5893d990df876bafae113be981" - }, - "createdAt":"2020-05-13T14:11:02.205Z", - "updatedAt":"2020-05-13T14:13:10.403Z" - }, - "properties":{ - "pool":{ - "type":"string", - "example":"ETH:USDT" - }, - "starkPublicKey":{ - "$ref":"#/definitions/starkPublicKey" - }, - "_id":{ - "type":"string" - }, - "closedAt":{ - "type":"string", - "format":"date" - }, - "failed":{ - "type":"boolean" - }, - "pending":{ - "type":"boolean" - }, - "type":{ - "type":"string", - "enum":[ - "Deposit", - "Withdrawal" - ] - }, - "user":{ - "type":"string" - }, - "orders":{ - "$ref":"#/definitions/Model34" - }, - "createdAt":{ - "type":"string", - "format":"date", - "description":"The date (ISO 8601) at which AmmFundingOrder was created.", - "example":"2020-05-13T14:11:02.205Z" - }, - "updatedAt":{ - "type":"string", - "format":"date", - "description":"The date (ISO 8601) at which AmmFundingOrder was last updated.", - "example":"2020-05-13T14:13:10.403Z" - } - } - }, - "Model35":{ - "type":"object", - "properties":{ - "user":{ - "type":"string" - }, - "token":{ - "type":"string", - "description":"token for the airdrop", - "example":"DVF" - }, - "amount":{ - "type":"string", - "description":"Amount of token to give in standard format" - } - } - }, - "airdrops":{ - "type":"array", - "items":{ - "$ref":"#/definitions/Model35" - } - }, - "addAirdropRequestSchema":{ - "type":"object", - "properties":{ - "nonce":{ - "type":"string", - "description":"This nonce which used to provide the time until which this nonce is valid. It is presented as seconds since epoch.", - "example":"v2-1704114061.000" - }, - "signature":{ - "type":"string", - "description":"The signature obtained by signing the nonce with your private ethereum key.", - "example":"0x2b48d53f2e3a696630ebdcd1ff057556bbc9de9c294adfaa5b1f13df91b67b347fdd88c29594c377ba0024dec40cd9808829e7f4447772482f50a7a8e9a903561c" - }, - "airdrops":{ - "$ref":"#/definitions/airdrops" - } - } - }, - "Model36":{ - "type":"object", - "properties":{ - "user":{ - "type":"string", - "description":"Ethereum address", - "example":"0x08152c1265dbc218ccc8ab5c574e6bd52279b3b7" - }, - "token":{ - "type":"string", - "description":"token for the airdrop", - "example":"DVF" - }, - "amount":{ - "type":"string", - "description":"DVF airdrop eligible amount", - "example":"15.52" - } - } - }, - "addAirdropResponseSchema":{ - "type":"array", - "items":{ - "$ref":"#/definitions/Model36" - } - }, - "fields":{ - "type":"array", - "description":"Specific fields to be returned for balance information", - "example":[ - "balance", - "updatedAt" - ], - "items":{ - "type":"string", - "enum":[ - "balance", - "available", - "locked", - "updatedAt" - ] - } - }, - "getBalancePayload":{ - "type":"object", - "properties":{ - "nonce":{ - "type":"string", - "description":"This nonce which used to provide the time until which this nonce is valid. It is presented as seconds since epoch.", - "example":"v2-1704114061.000" - }, - "signature":{ - "type":"string", - "description":"The signature obtained by signing the nonce with your private ethereum key.", - "example":"0x2b48d53f2e3a696630ebdcd1ff057556bbc9de9c294adfaa5b1f13df91b67b347fdd88c29594c377ba0024dec40cd9808829e7f4447772482f50a7a8e9a903561c" - }, - "token":{ - "type":"string", - "description":"The token which the balance is specifically requested for.", - "example":"ETH" - }, - "fields":{ - "$ref":"#/definitions/fields" - } - } - }, - "Model37":{ - "type":"object", - "properties":{ - "token":{ - "type":"string", - "description":"The token for which the balances are provided.", - "example":"ETH" - }, - "balance":{ - "type":"number", - "description":"It is the total balance for the user corresponding to the specified token.", - "example":42 - }, - "available":{ - "type":"number", - "description":"It is the part of the balance available for use.", - "example":23 - }, - "locked":{ - "type":"number", - "description":"It is the part of the balance currently in open orders or pending withdrawal.", - "example":19 - } - } - }, - "getBalanceResponse":{ - "type":"array", - "items":{ - "$ref":"#/definitions/Model37" - } - }, - "getDepositsPayload":{ - "type":"object", - "properties":{ - "nonce":{ - "type":"string", - "description":"This nonce which used to provide the time until which this nonce is valid. It is presented as seconds since epoch.", - "example":"v2-1704114061.000" - }, - "signature":{ - "type":"string", - "description":"The signature obtained by signing the nonce with your private ethereum key.", - "example":"0x2b48d53f2e3a696630ebdcd1ff057556bbc9de9c294adfaa5b1f13df91b67b347fdd88c29594c377ba0024dec40cd9808829e7f4447772482f50a7a8e9a903561c" - }, - "token":{ - "type":"string", - "description":"The token which the balance is specifically requested for.", - "example":"ETH" - } - } - }, - "getDepositsResponse":{ - "type":"object", - "properties":{ - "ethAddress":{ - "type":"string", - "description":"The ethereum public address of the user.", - "example":"0x341E46a49F15785373edE443Df0220DEa6a41Bbc" - }, - "starkKey":{ - "type":"string", - "description":"The Stark public key.", - "example":"77a3b314db07c45076d11f62b6f9e748a39790441823307743cf00d6597ea43" - }, - "starkVaultId":{ - "type":"number", - "description":"The Stark vault ID.", - "example":123 - }, - "starkTokenId":{ - "type":"string", - "description":"The Stark token ID.", - "example":"0x7" - }, - "token":{ - "type":"string", - "description":"The token that was deposited", - "example":"NEC" - }, - "amount":{ - "type":"number", - "description":"The amount that was deposited.", - "example":1000 - }, - "createdAt":{ - "type":"string", - "description":"The date and time of the deposit.", - "example":"2020-01-29T14:02:08.477Z" - }, - "isPostedOffchain":{ - "type":"boolean", - "description":"Flag to indicate if the deposit was posted off chain.", - "example":false - }, - "isConfirmedOnChain":{ - "type":"boolean", - "description":"Flag to indicate if the deposit was confirmed off chain.", - "example":true - } - } - }, - "getOrderPayload":{ - "type":"object", - "properties":{ - "nonce":{ - "type":"string", - "description":"This nonce which used to provide the time until which this nonce is valid. It is presented as seconds since epoch.", - "example":"v2-1704114061.000" - }, - "signature":{ - "type":"string", - "description":"The signature obtained by signing the nonce with your private ethereum key.", - "example":"0x2b48d53f2e3a696630ebdcd1ff057556bbc9de9c294adfaa5b1f13df91b67b347fdd88c29594c377ba0024dec40cd9808829e7f4447772482f50a7a8e9a903561c" - }, - "orderId":{ - "type":"string", - "description":"The order ID.", - "example":"d7c8b9" - }, - "cid":{ - "type":"string", - "description":"An optional user-defined identifier for this order", - "example":"satoshi-order-2083236893" - } - } - }, - "getOrderResponse":{ - "type":"object", - "properties":{ - "_id":{ - "type":"string", - "description":"Id for the order. This can be used for orderId when calling cancelOrder or getOrder", - "example":"L1tarX5wUem" - }, - "amount":{ - "type":"string", - "description":"Original order size placed.", - "example":"-0.15" - }, - "totalFilled":{ - "type":"number", - "description":"Total of all fills executed.", - "example":"-0.15" - }, - "price":{ - "type":"string", - "description":"Cost per unit.", - "example":"250" - }, - "symbol":{ - "type":"string", - "description":"Trading symbol for the order", - "example":"ETH:USDT" - }, - "active":{ - "type":"boolean", - "description":"Active status true or false.", - "example":false - }, - "canceled":{ - "type":"boolean", - "description":"Canceled status true or false.", - "example":false - }, - "pending":{ - "type":"boolean", - "description":"Pending status true or false.", - "example":false - }, - "cid":{ - "type":"string", - "description":"An optional user-defined identifier for this order", - "example":"satoshi-order-2083236893" - } - } - }, - "getPendingWithdrawalsPayload":{ - "type":"object", - "properties":{ - "nonce":{ - "type":"string", - "description":"This nonce which used to provide the time until which this nonce is valid. It is presented as seconds since epoch.", - "example":"v2-1704114061.000" - }, - "signature":{ - "type":"string", - "description":"The signature obtained by signing the nonce with your private ethereum key.", - "example":"0x2b48d53f2e3a696630ebdcd1ff057556bbc9de9c294adfaa5b1f13df91b67b347fdd88c29594c377ba0024dec40cd9808829e7f4447772482f50a7a8e9a903561c" - }, - "token":{ - "type":"string" - } - } - }, - "authPayload":{ - "type":"object", - "properties":{ - "nonce":{ - "type":"string", - "description":"This nonce which used to provide the time until which this nonce is valid. It is presented as seconds since epoch.", - "example":"v2-1704114061.000" - }, - "signature":{ - "type":"string", - "description":"The signature obtained by signing the nonce with your private ethereum key.", - "example":"0x2b48d53f2e3a696630ebdcd1ff057556bbc9de9c294adfaa5b1f13df91b67b347fdd88c29594c377ba0024dec40cd9808829e7f4447772482f50a7a8e9a903561c" - } - } - }, - "Model38":{ - "type":"object", - "properties":{ - "balances":{ - "type":"boolean", - "description":"is balances authorized" - }, - "tradingHistory":{ - "type":"boolean", - "description":"is trading history authorized" - } - } - }, - "newMarkets":{ - "type":"array", - "description":"Currency pairs that were newly added", - "items":{ - "type":"string" - } - }, - "DVF":{ - "type":"object", - "description":"This contains application configuration details to set up for deposits and trading.", - "example":{ - "defaultFeeRate":0.002, - "deversifiAddress":"0x9ab450355b4ab504cbc0e4de484781dac08e6a26", - "starkExContractAddress":"0xF3731d0cdC9834f6F32104580bD226EF1bc1A9F9", - "exchangeSymbols":"[\"ETH:USDT\",\"ZRX:USDT\",\"ZRX:ETH\"]", - "newMarkets":[ - "ZRX:USDT", - "ZRX:ETH" - ], - "tempStarkVaultId":1 - }, - "properties":{ - "defaultFeeRate":{ - "type":"number", - "description":"The default fee rate, if no volume or maker discount." - }, - "deversifiAddress":{ - "type":"string", - "description":"The address of the DeversiFi exchange." - }, - "starkExContractAddress":{ - "type":"string", - "description":"Stark deposit contract address." - }, - "exchangeSymbols":{ - "type":"string", - "description":"Currency pairs available at the DeversiFi exchange for trading" - }, - "newMarkets":{ - "$ref":"#/definitions/newMarkets" - }, - "tempStarkVaultId":{ - "type":"number", - "description":"Transit Stark vault ID used for deposit privacy" - } - } - }, - "getUserConfResponse":{ - "type":"object", - "properties":{ - "DVF":{ - "$ref":"#/definitions/DVF" - }, - "tokenRegistry":{ - "$ref":"#/definitions/collateralBalancesSchema" - }, - "isRegistered":{ - "type":"string", - "description":"Registration status.", - "example":"true" - }, - "isRegisteredOnChain":{ - "type":"boolean", - "description":"Whether the user is registered with Starkware.", - "example":true, - "enum":[ - true, - false - ] - }, - "allowance":{ - "$ref":"#/definitions/getAllowanceResponse" - }, - "ethAddress":{ - "type":"string", - "description":"Ethereum address.", - "example":"0x278ff3bb25c5b1bb7032e822661974479280fa74" - }, - "starkKeyHex":{ - "type":"string", - "description":"Stark Public key as hex string.", - "example":"0x011869c13b32ab9b7ec84e2b31c1de58baaaa6bbb2443a33bbad8df739a6e957" - } - } - }, - "getVaultIdPayload":{ - "type":"object", - "properties":{ - "nonce":{ - "type":"string", - "description":"This nonce which used to provide the time until which this nonce is valid. It is presented as seconds since epoch.", - "example":"v2-1704114061.000" - }, - "signature":{ - "type":"string", - "description":"The signature obtained by signing the nonce with your private ethereum key.", - "example":"0x2b48d53f2e3a696630ebdcd1ff057556bbc9de9c294adfaa5b1f13df91b67b347fdd88c29594c377ba0024dec40cd9808829e7f4447772482f50a7a8e9a903561c" - }, - "token":{ - "type":"string", - "description":"The new token for which a new vault Id needs to be allocated.", - "example":"DAI" - } - }, - "required":[ - "token" - ] - }, - "getWithdrawalPayload":{ - "type":"object", - "properties":{ - "nonce":{ - "type":"string", - "description":"This nonce which used to provide the time until which this nonce is valid. It is presented as seconds since epoch.", - "example":"v2-1704114061.000" - }, - "signature":{ - "type":"string", - "description":"The signature obtained by signing the nonce with your private ethereum key.", - "example":"0x2b48d53f2e3a696630ebdcd1ff057556bbc9de9c294adfaa5b1f13df91b67b347fdd88c29594c377ba0024dec40cd9808829e7f4447772482f50a7a8e9a903561c" - }, - "withdrawalId":{ - "type":"string", - "description":"Used to identify a specific withdrawal.", - "example":"i6JjTE2PDL" - } - }, - "required":[ - "withdrawalId" - ] - }, - "withdrawHistoryObject":{ - "type":"object", - "properties":{ - "_id":{ - "type":"string", - "description":"Withdrawal ID.", - "example":"LCafcGC6tBH" - }, - "token":{ - "type":"string", - "description":"The token that was withdrawn.", - "example":"NEC" - }, - "amount":{ - "type":"string", - "description":"The amount that was withdrawn.", - "example":"100", - "pattern":"^[0-9]*$" - }, - "createdAt":{ - "type":"string", - "format":"date", - "description":"The date and time withdrawal request was received.", - "example":"2020-01-29T14:13:05.898Z" - }, - "readyToWithdrawOnChain":{ - "type":"boolean", - "description":"The withdrawal is ready to be requested.", - "example":true - }, - "canceled":{ - "type":"boolean", - "description":"The withdrawal has been canceled.", - "example":true - } - }, - "required":[ - "_id", - "token", - "createdAt", - "readyToWithdrawOnChain" - ] - }, - "Model39":{ - "type":"object", - "properties":{ - "hasReceived":{ - "type":"boolean", - "description":"Registration compensation was/not received.", - "example":true - }, - "date":{ - "type":"string", - "format":"date", - "description":"When was the compensation received", - "example":"2021-08-12T17:17:37.009Z" - } - } - }, - "openOrdersPayload":{ - "type":"object", - "properties":{ - "nonce":{ - "type":"string", - "description":"This nonce which used to provide the time until which this nonce is valid. It is presented as seconds since epoch.", - "example":"v2-1704114061.000" - }, - "signature":{ - "type":"string", - "description":"The signature obtained by signing the nonce with your private ethereum key.", - "example":"0x2b48d53f2e3a696630ebdcd1ff057556bbc9de9c294adfaa5b1f13df91b67b347fdd88c29594c377ba0024dec40cd9808829e7f4447772482f50a7a8e9a903561c" - }, - "symbol":{ - "type":"string", - "description":"Specifies the trading pair.", - "example":"ETH:USDT" - } - } - }, - "openOrderResponseObject.js":{ - "type":"object", - "properties":{ - "_id":{ - "type":"string", - "description":"Order Id, this can be used as orderId when calling cancelOrder or getOrder.", - "example":"L1tarX5wUem" - }, - "user":{ - "type":"string", - "description":"Ethereum address of the user.", - "example":"0x341e46a49f15785373ede443df0220dea6a41bbc" - }, - "symbol":{ - "type":"string", - "description":"The trading pair symbol for this order.", - "example":"ZRX:ETH" - }, - "amount":{ - "type":"number", - "description":"Original order size placed.", - "example":50 - }, - "amountOrig":{ - "type":"number", - "description":"Same as amount, included for backward compatibility.", - "example":50 - }, - "totalFilled":{ - "type":"number", - "description":"Total of all fills executed.", - "example":50 - }, - "tokenBuy":{ - "type":"string", - "description":"Token being bought as part of this exchange order.", - "example":"ETH" - }, - "totalBought":{ - "type":"string", - "description":"Total tokens bought, in quantized units.", - "example":"4990000000", - "pattern":"^[0-9]*$" - }, - "tokenSell":{ - "type":"string", - "description":"Token being sold as part of this exchange order.", - "example":"ETH" - }, - "tokenSellLockedBalance":{ - "type":"string", - "description":"Amount of tokens to be sold, locked when order was submitted (quantized units).", - "example":"45555500", - "pattern":"^[0-9]*$" - }, - "totalSold":{ - "type":"string", - "description":"Total tokens sold, in quantized units.", - "example":"45555500", - "pattern":"^[0-9]*$" - }, - "type":{ - "type":"string", - "description":"Type of the order. Currently, \"EXCHANGE LIMIT\" is the only type that is supported.", - "example":"EXCHANGE LIMIT" - }, - "price":{ - "type":"number", - "description":"Cost per unit.", - "example":0.01 - }, - "averagePrice":{ - "type":"number", - "description":"Average price at which the order has been settled.", - "example":0.0091111 - }, - "feeRate":{ - "type":"number", - "description":"The max fee rate applicable for the order.", - "example":0.002 - }, - "createdAt":{ - "type":"string", - "format":"date", - "description":"The date and time when the order was created.", - "example":"2020-05-13T14:11:02.205Z" - }, - "updatedAt":{ - "type":"string", - "format":"date", - "description":"The date and time when the order was last updated.", - "example":"2020-05-13T14:13:10.403Z" - }, - "activatedAt":{ - "type":"string", - "format":"date", - "description":"The date and time when the order was activated.", - "example":"2020-05-13T14:11:03.000Z" - }, - "lastFillTime":{ - "type":"string", - "format":"date", - "description":"The date and time when the last fill occurred for this order.", - "example":"2020-05-13T14:13:18.000Z" - }, - "canceled":{ - "type":"boolean", - "description":"Canceled status true or false.", - "example":false - }, - "isPostOnly":{ - "type":"boolean", - "description":"Flag to indicate if the order is post-only.", - "example":false - }, - "isHidden":{ - "type":"boolean", - "description":"Flag to indicate if the order is hidden.", - "example":false - }, - "isFillOrKill":{ - "type":"boolean", - "description":"Flag to indicate if fill or kill order.", - "example":false - }, - "isSlippageDisabled":{ - "type":"boolean", - "description":"Flag to indicate if slippage protection is disabled.", - "example":false - }, - "partnerId":{ - "type":"string", - "description":"TODO", - "example":"P1" - }, - "cid":{ - "type":"string", - "description":"An optional user-defined identifier for this order", - "example":"satoshi-order-2083236893" - }, - "awaitingSettlement":{ - "type":"number", - "description":"TODO", - "example":10 - }, - "meta":{ - "$ref":"#/definitions/collateralBalancesSchema" - }, - "active":{ - "type":"boolean", - "description":"If false, the order has not been included in the order book yet.", - "example":false - } - }, - "required":[ - "_id", - "user", - "symbol", - "amount", - "amountOrig", - "tokenBuy", - "tokenSell", - "tokenSellLockedBalance", - "type", - "price", - "createdAt", - "updatedAt", - "active" - ] - }, - "openOrdersResponse":{ - "type":"array", - "example":[ - { - "_id":"L1tarX5wUem", - "user":"0x341e46a49f15785373ede443df0220dea6a41bbc", - "symbol":"ZRX:ETH", - "amount":50, - "amountOrig":50, - "totalFilled":50, - "tokenBuy":"ETH", - "totalBought":"4990000000", - "tokenSell":"ETH", - "tokenSellLockedBalance":"45555500", - "totalSold":"45555500", - "type":"EXCHANGE LIMIT", - "price":0.01, - "averagePrice":0.0091111, - "feeRate":0.002, - "createdAt":"2020-05-13T14:11:02.205Z", - "updatedAt":"2020-05-13T14:13:10.403Z", - "active":true, - "activatedAt":"2020-05-13T14:11:03.000Z", - "canceled":true, - "isPostOnly":true, - "isHidden":true, - "isFillOrKill":true, - "isSlippageDisabled":true, - "partnerId":"P1", - "awaitingSettlement":0 - } - ], - "items":{ - "$ref":"#/definitions/openOrderResponseObject.js" - } - }, - "closedOrderResponseObject":{ - "type":"object", - "properties":{ - "_id":{ - "type":"string", - "description":"Order Id, this can be used as orderId when calling cancelOrder or getOrder.", - "example":"L1tarX5wUem" - }, - "user":{ - "type":"string", - "description":"Ethereum address of the user.", - "example":"0x341e46a49f15785373ede443df0220dea6a41bbc" - }, - "symbol":{ - "type":"string", - "description":"The trading pair symbol for this order.", - "example":"ZRX:ETH" - }, - "amount":{ - "type":"number", - "description":"Original order size placed.", - "example":50 - }, - "amountOrig":{ - "type":"number", - "description":"Same as amount, included for backward compatibility.", - "example":50 - }, - "totalFilled":{ - "type":"number", - "description":"Total of all fills executed.", - "example":50 - }, - "tokenBuy":{ - "type":"string", - "description":"Token being bought as part of this exchange order.", - "example":"ETH" - }, - "totalBought":{ - "type":"string", - "description":"Total tokens bought, in quantized units.", - "example":"4990000000", - "pattern":"^[0-9]*$" - }, - "tokenSell":{ - "type":"string", - "description":"Token being sold as part of this exchange order.", - "example":"ETH" - }, - "tokenSellLockedBalance":{ - "type":"string", - "description":"Amount of tokens to be sold, locked when order was submitted (quantized units).", - "example":"45555500", - "pattern":"^[0-9]*$" - }, - "totalSold":{ - "type":"string", - "description":"Total tokens sold, in quantized units.", - "example":"45555500", - "pattern":"^[0-9]*$" - }, - "type":{ - "type":"string", - "description":"Type of the order. Currently, \"EXCHANGE LIMIT\" is the only type that is supported.", - "example":"EXCHANGE LIMIT" - }, - "price":{ - "type":"number", - "description":"Cost per unit.", - "example":0.01 - }, - "averagePrice":{ - "type":"number", - "description":"Average price at which the order has been settled.", - "example":0.0091111 - }, - "feeRate":{ - "type":"number", - "description":"The max fee rate applicable for the order.", - "example":0.002 - }, - "createdAt":{ - "type":"string", - "format":"date", - "description":"The date and time when the order was created.", - "example":"2020-05-13T14:11:02.205Z" - }, - "updatedAt":{ - "type":"string", - "format":"date", - "description":"The date and time when the order was last updated.", - "example":"2020-05-13T14:13:10.403Z" - }, - "activatedAt":{ - "type":"string", - "format":"date", - "description":"The date and time when the order was activated.", - "example":"2020-05-13T14:11:03.000Z" - }, - "lastFillTime":{ - "type":"string", - "format":"date", - "description":"The date and time when the last fill occurred for this order.", - "example":"2020-05-13T14:13:18.000Z" - }, - "canceled":{ - "type":"boolean", - "description":"Canceled status true or false.", - "example":false - }, - "isPostOnly":{ - "type":"boolean", - "description":"Flag to indicate if the order is post-only.", - "example":false - }, - "isHidden":{ - "type":"boolean", - "description":"Flag to indicate if the order is hidden.", - "example":false - }, - "isFillOrKill":{ - "type":"boolean", - "description":"Flag to indicate if fill or kill order.", - "example":false - }, - "isSlippageDisabled":{ - "type":"boolean", - "description":"Flag to indicate if slippage protection is disabled.", - "example":false - }, - "partnerId":{ - "type":"string", - "description":"TODO", - "example":"P1" - }, - "cid":{ - "type":"string", - "description":"An optional user-defined identifier for this order", - "example":"satoshi-order-2083236893" - }, - "awaitingSettlement":{ - "type":"number", - "description":"TODO", - "example":10 - }, - "meta":{ - "$ref":"#/definitions/collateralBalancesSchema" - } - }, - "required":[ - "_id", - "user", - "symbol", - "amount", - "amountOrig", - "tokenBuy", - "tokenSell", - "tokenSellLockedBalance", - "type", - "price", - "createdAt", - "updatedAt" - ] - }, - "Model40":{ - "type":"array", - "example":[ - { - "_id":"L1tarX5wUem", - "user":"0x341e46a49f15785373ede443df0220dea6a41bbc", - "symbol":"ZRX:ETH", - "amount":50, - "amountOrig":50, - "totalFilled":50, - "tokenBuy":"ETH", - "totalBought":"4990000000", - "tokenSell":"ETH", - "tokenSellLockedBalance":"45555500", - "totalSold":"45555500", - "type":"EXCHANGE LIMIT", - "price":0.01, - "averagePrice":0.0091111, - "feeRate":0.002, - "createdAt":"2020-05-13T14:11:02.205Z", - "updatedAt":"2020-05-13T14:13:10.403Z", - "activatedAt":"2020-05-13T14:11:03.000Z", - "canceled":true, - "isPostOnly":true, - "isHidden":true, - "isFillOrKill":true, - "isSlippageDisabled":true, - "partnerId":"P1", - "awaitingSettlement":0 - } - ], - "items":{ - "$ref":"#/definitions/closedOrderResponseObject" - } - }, - "recoverTradingKeyResponse":{ - "type":"object", - "properties":{ - "encryptedTradingKey":{ - "type":"string", - "description":"Encrypted Stark Trading Key", - "example":"7b2276657273696f6e223a227832353531392d7873616c736132302d706f6c7931333035222c226e6f6e6365223a22765633313730366571496f696432717944444539465055346f7466346171457a222c22657068656d5075626c69634b6579223a227358657a625174556c453476555661547857466b326555427532627746342f6641434378536a592f306e513d222c2263697068657274657874223a22444e5041615a76726331374f4d656a5451354f544e4243536d594b504466745335574b307278794b716671715770486d53676a4568782b3259352f6b4a6e3233674e5454476c31306973556271696d72636e67676a61636e346335317672484a697a427166324737227d" - }, - "dtkVersion":{ - "type":"string", - "description":"Trading Key Version", - "example":"v2" - } - } - }, - "permissionsPayload":{ - "type":"object", - "properties":{ - "nonce":{ - "type":"string", - "description":"This nonce which used to provide the time until which this nonce is valid. It is presented as seconds since epoch.", - "example":"v2-1704114061.000" - }, - "signature":{ - "type":"string", - "description":"The signature obtained by signing the nonce with your private ethereum key.", - "example":"0x2b48d53f2e3a696630ebdcd1ff057556bbc9de9c294adfaa5b1f13df91b67b347fdd88c29594c377ba0024dec40cd9808829e7f4447772482f50a7a8e9a903561c" - }, - "key":{ - "type":"string", - "description":"The permission key to change the access for", - "example":"balances" - }, - "value":{ - "type":"boolean", - "description":"Whether to allow public access to the endpoints driven by provided permission", - "example":true - } - } - }, - "Model41":{ - "type":"object", - "properties":{ - "count":{ - "type":"number", - "description":"Total count of user's filled orders.", - "example":1414 - } - } - }, - "withdrawHistoryResponse":{ - "type":"array", - "items":{ - "$ref":"#/definitions/withdrawHistoryObject" - } - }, - "Model42":{ - "type":"object", - "properties":{ - "orderId":{ - "type":"string", - "description":"The order ID", - "example":"d7c8b9" - }, - "canceled":{ - "type":"boolean", - "description":"only if order is already canceled", - "example":true - }, - "active":{ - "type":"boolean", - "description":"whether order is active", - "example":true - } - } - }, - "cancelOpenOrdersResponse":{ - "type":"array", - "items":{ - "$ref":"#/definitions/Model42" - } - }, - "cancelOrderPayload":{ - "type":"object", - "example":{ - "nonce":"v2-1704114061.000", - "signature":"0x2b48d53f2e3a696630ebdcd1ff057556bbc9de9c294adfaa5b1f13df91b67b347fdd88c29594c377ba0024dec40cd9808829e7f4447772482f50a7a8e9a903561c", - "orderId":"d7c8b9" - }, - "properties":{ - "nonce":{ - "type":"string", - "description":"This nonce which used to provide the time until which this nonce is valid. It is presented as seconds since epoch.", - "example":"v2-1704114061.000" - }, - "signature":{ - "type":"string", - "description":"The signature obtained by signing the nonce with your private ethereum key.", - "example":"0x2b48d53f2e3a696630ebdcd1ff057556bbc9de9c294adfaa5b1f13df91b67b347fdd88c29594c377ba0024dec40cd9808829e7f4447772482f50a7a8e9a903561c" - }, - "orderId":{ - "type":"string", - "description":"The order ID.", - "example":"d7c8b9" - }, - "cid":{ - "type":"string", - "description":"An optional user-defined identifier for this order" - } - } - }, - "cancelOrderResponse":{ - "type":"object", - "properties":{ - "orderId":{ - "type":"string", - "description":"The order ID.", - "example":"d7c8b9" - }, - "canceled":{ - "type":"boolean", - "description":"only if order is already canceled", - "example":true - } - } - }, - "cancelWithdrawalPayload":{ - "type":"object", - "properties":{ - "nonce":{ - "type":"string", - "description":"This nonce which used to provide the time until which this nonce is valid. It is presented as seconds since epoch.", - "example":"v2-1704114061.000" - }, - "signature":{ - "type":"string", - "description":"The signature obtained by signing the nonce with your private ethereum key.", - "example":"0x2b48d53f2e3a696630ebdcd1ff057556bbc9de9c294adfaa5b1f13df91b67b347fdd88c29594c377ba0024dec40cd9808829e7f4447772482f50a7a8e9a903561c" - }, - "id":{ - "type":"string", - "description":"Withdrawal ID.", - "example":"LCafcGC6tBH" - } - }, - "required":[ - "id" - ] - }, - "airdropEligibilityQuery":{ - "type":"object", - "properties":{ - "nonce":{ - "type":"string", - "description":"This nonce which used to provide the time until which this nonce is valid. It is presented as seconds since epoch.", - "example":"v2-1704114061.000" - }, - "signature":{ - "type":"string", - "description":"The signature obtained by signing the nonce with your private ethereum key.", - "example":"0x2b48d53f2e3a696630ebdcd1ff057556bbc9de9c294adfaa5b1f13df91b67b347fdd88c29594c377ba0024dec40cd9808829e7f4447772482f50a7a8e9a903561c" - }, - "token":{ - "type":"string", - "description":"token for the airdrop", - "example":"DVF" - } - }, - "required":[ - "token" - ] - }, - "Model43":{ - "type":"object", - "properties":{ - "_id":{ - "type":"string", - "description":"ID of the airdrop claim eligibility", - "example":"d7c8b9" - } - } - }, - "Model44":{ - "type":"object", - "description":"The Stark public key. Both the \"x\" and \"y\" part are required.", - "example":{ - "x":"0746919ecbb54563de512f6fb556c21dab091748b41a60a946dbdbf118ac0a85", - "y":"58f7ce5eb6eb5bd24f70394622b1f4d2c54ebca317a3e61bf9f349dccf166cf" - }, - "properties":{ - "x":{ - "type":"string", - "description":"The \"x\" part of the Stark public key." - }, - "y":{ - "type":"string", - "description":"The \"y\" part of the Stark public key." - } - } - }, - "depositPayload":{ - "type":"object", - "properties":{ - "token":{ - "type":"string", - "description":"The token for which the deposit was made.", - "example":"ZRX" - }, - "amount":{ - "type":"number", - "description":"The deposit amount.", - "example":1 - }, - "nonce":{ - "type":"number" - }, - "starkPublicKey":{ - "$ref":"#/definitions/Model44" - }, - "starkSignature":{ - "$ref":"#/definitions/Model29" - }, - "starkVaultId":{ - "type":"number", - "description":"The Stark vault ID.", - "example":1000003 - }, - "expireTime":{ - "type":"number", - "description":"Expiry time in hours", - "example":454934 - } - }, - "required":[ - "token", - "amount", - "nonce", - "starkPublicKey", - "starkSignature", - "starkVaultId", - "expireTime" - ] - }, - "depositResponse":{ - "type":"object", - "properties":{ - "isPostedOffchain":{ - "type":"boolean", - "description":"Flag to indicate if the deposit was posted off chain.", - "example":false - }, - "isConfirmedOnChain":{ - "type":"boolean", - "description":"Flag to indicate if the deposit was confirmed off chain.", - "example":true - }, - "_id":{ - "type":"string", - "example":"5e335f88bdcd70001e52d0a7" - }, - "starkVaultId":{ - "type":"number", - "description":"The Stark vault ID.", - "example":1000003 - }, - "starkKey":{ - "type":"string", - "description":"The Stark public key.", - "example":"0746919ecbb54563de512f6fb556c21dab091748b41a60a946dbdbf118ac0a85" - }, - "starkSignature":{ - "$ref":"#/definitions/Model29" - }, - "starkTokenId":{ - "type":"string", - "description":"The Stark token ID.", - "example":"0x3" - }, - "amount":{ - "type":"number", - "description":"The amount that was deposited.", - "example":1 - }, - "ethAddress":{ - "type":"string", - "description":"Ethereum public address of the user.", - "example":"0x341e46a49f15785373ede443df0220dea6a41bbc" - }, - "createdAt":{ - "type":"string", - "description":"The date and time of the deposit.", - "example":"2020-01-30T22:58:16.720Z" - } - }, - "required":[ - "starkSignature" - ] - }, - "Model45":{ - "type":"object", - "description":"StarkWare ConditionalTansferRequest", - "example":{ - "amount":"10000000", - "expirationTimestamp":446134, - "fact":"3c3f4eb0255776079339f0b253cc85310a3a56a0dcdd76ca5a995f4816cd0763", - "factRegistryAddress":"0xA9F9cC1189b9d6051b26467b29629787C671905d", - "nonce":976614084, - "receiverPublicKey":"0x077a3b314db07c45076d11f62b6f9e748a39790441823307743cf00d6597ea43", - "receiverVaultId":1863686755, - "senderPublicKey":"0x044926648f4b6f002dfa389c536129ae178f34d9be452724268cc48ebea2b37c", - "senderVaultId":2010760265, - "token":"0x180bef8ae3462e919489763b84dc1dc700c45a249dec4d1136814a639f2dd7b", - "type":"ConditionalTransferRequest", - "signature":{ - "r":"0x2857ca21310ab87bb7c37ebad0e7166f1fb46e43cf32d6587a31e148d44b677", - "s":"0x45e939717a6de4ad5e79993d918bb40e629760da7a04062e965394d1d14106a" - } - }, - "properties":{ - "amount":{ - "type":"string", - "pattern":"^[0-9]*$" - }, - "expirationTimestamp":{ - "type":"integer", - "minimum":0 - }, - "nonce":{ - "type":"integer", - "minimum":0 - }, - "receiverPublicKey":{ - "type":"string", - "pattern":"^0x[a-f0-9]+$" - }, - "receiverVaultId":{ - "type":"integer" - }, - "senderPublicKey":{ - "type":"string", - "pattern":"^0x[a-f0-9]+$" - }, - "senderVaultId":{ - "type":"integer" - }, - "signature":{ - "$ref":"#/definitions/signature" - }, - "token":{ - "type":"string", - "pattern":"^0x[a-f0-9]+$" - }, - "type":{ - "type":"string", - "enum":[ - "ConditionalTransferRequest" - ] - }, - "fact":{ - "type":"string", - "x-format":{ - "hex":{ - "byteAligned":false - } - } - }, - "factRegistryAddress":{ - "type":"string", - "pattern":"^0x[a-f0-9]+$" - } - } - }, - "fastWithdrawalPayload":{ - "type":"object", - "properties":{ - "recipientEthAddress":{ - "type":"string", - "description":"Ethereum address of recipient who will receive funds on chain.", - "example":"0x948cd3ad67c5f21412bfcd07a7981322f9fa01f0" - }, - "tx":{ - "$ref":"#/definitions/Model45" - }, - "transactionFee":{ - "type":"string", - "description":"fee to paid by the user in the currency of the transaction (quantised units).", - "example":"1", - "pattern":"^[0-9]*$" - }, - "starkPublicKey":{ - "$ref":"#/definitions/starkPublicKey" - } - } - }, - "Model46":{ - "type":"object", - "properties":{ - "_id":{ - "type":"string", - "description":"Withdrawal ID.", - "example":"LCafcGC6tBH" - }, - "token":{ - "type":"string", - "description":"The token that was withdrawn.", - "example":"NEC" - }, - "amount":{ - "type":"string", - "description":"The amount that was withdrawn.", - "example":"100", - "pattern":"^[0-9]*$" - }, - "createdAt":{ - "type":"string", - "format":"date", - "description":"The date and time withdrawal request was received.", - "example":"2020-01-29T14:13:05.898Z" - }, - "readyToWithdrawOnChain":{ - "type":"boolean", - "description":"The withdrawal is ready to be requested.", - "example":true - }, - "canceled":{ - "type":"boolean", - "description":"The withdrawal has been canceled.", - "example":true - }, - "fastWithdrawalData":{ - "$ref":"#/definitions/fastWithdrawalData" - } - }, - "required":[ - "_id", - "token", - "createdAt", - "readyToWithdrawOnChain", - "fastWithdrawalData" - ] - }, - "feedbackPayload":{ - "type":"object", - "properties":{ - "nonce":{ - "type":"string", - "description":"This nonce which used to provide the time until which this nonce is valid. It is presented as seconds since epoch.", - "example":"v2-1704114061.000" - }, - "signature":{ - "type":"string", - "description":"The signature obtained by signing the nonce with your private ethereum key.", - "example":"0x2b48d53f2e3a696630ebdcd1ff057556bbc9de9c294adfaa5b1f13df91b67b347fdd88c29594c377ba0024dec40cd9808829e7f4447772482f50a7a8e9a903561c" - }, - "email":{ - "type":"string", - "description":"Email of the user providing feedback.", - "example":"hello@deversifi.com" - } - }, - "required":[ - "email" - ] - }, - "Model47":{ - "type":"object", - "properties":{ - "_id":{ - "type":"string", - "description":"ID of the feedback entry", - "example":"d7c8b9" - } - } - }, - "notificationPayload":{ - "type":"object", - "properties":{ - "message":{ - "type":"string" - }, - "icon":{ - "type":"string" - }, - "ctaText":{ - "type":"string" - }, - "ctaURL":{ - "type":"string" - }, - "ctaID":{ - "type":"string" - }, - "userAddress":{ - "type":"string", - "x-convert":{ - "case":"lower" - } - }, - "startDate":{ - "type":"string", - "format":"date" - }, - "endDate":{ - "type":"string", - "format":"date" - } - }, - "required":[ - "message", - "icon", - "ctaText" - ] - }, - "notification":{ - "type":"object", - "properties":{ - "_id":{ - "type":"string" - }, - "message":{ - "type":"string" - }, - "icon":{ - "type":"string" - }, - "ctaText":{ - "type":"string" - }, - "ctaURL":{ - "type":"string" - }, - "ctaID":{ - "type":"string" - }, - "userAddress":{ - "type":"string", - "x-convert":{ - "case":"lower" - } - }, - "startDate":{ - "type":"string", - "format":"date" - }, - "endDate":{ - "type":"string", - "format":"date" - } - }, - "required":[ - "message", - "icon", - "ctaText" - ] - }, - "Model48":{ - "type":"object", - "properties":{ - "dtk":{ - "type":"string", - "description":"The encrypted Stark trading key.", - "example":"6d840e6d251e2165e3214eecfcbcfa83c0f704439e16c69383d93fc0f704439e16c69383d93fc0f704439e16c69383d93fc0f704439e16c69383d93fc0f704439e16c69383d93f", - "minLength":66, - "maxLength":1000, - "pattern":"[a-zA-Z0-9]{66,}" - }, - "dtkVersion":{ - "type":"string", - "description":"Version of the trading key mechanism.", - "example":"v1", - "default":"v1" - } - } - }, - "registerPayload":{ - "type":"object", - "properties":{ - "nonce":{ - "type":"string", - "description":"This nonce which used to provide the time until which this nonce is valid. It is presented as seconds since epoch.", - "example":"v2-1704114061.000" - }, - "signature":{ - "type":"string", - "description":"The signature obtained by signing the nonce with your private ethereum key.", - "example":"0x2b48d53f2e3a696630ebdcd1ff057556bbc9de9c294adfaa5b1f13df91b67b347fdd88c29594c377ba0024dec40cd9808829e7f4447772482f50a7a8e9a903561c" - }, - "starkKey":{ - "type":"string", - "description":"The Stark public key.", - "example":"0746919ecbb54563de512f6fb556c21dab091748b41a60a946dbdbf118ac0a85" - }, - "encryptedTradingKey":{ - "$ref":"#/definitions/Model48", - "x-alternatives":[ - { - "$ref":"#/x-alt-definitions/encryptedTradingKey" - }, - { - "type":"string", - "description":"The encrypted Stark trading key.", - "example":"6d840e6d251e2165e3214eecfcbcfa83c0f704439e16c69383d93fc0f704439e16c69383d93fc0f704439e16c69383d93fc0f704439e16c69383d93fc0f704439e16c69383d93f", - "minLength":66, - "maxLength":1000, - "pattern":"[a-zA-Z0-9]{66,}" - } - ] - }, - "meta":{ - "$ref":"#/definitions/collateralBalancesSchema" - }, - "contractWalletAddress":{ - "type":"string", - "description":"The address of the contract wallet that is registering.", - "example":"0x8d12A197cB00D4747a1fe03395095ce2A5CC6819" - } - }, - "required":[ - "starkKey" - ] - }, - "exchangeSymbols":{ - "type":"array", - "description":"Currency pairs available at the DeversiFi exchange for trading", - "example":[ - "ETH:USDT" - ], - "items":{ - "type":"string" - } - }, - "Model49":{ - "type":"array", - "description":"Currency pairs that were newly added", - "example":[ - "ETH:USDT" - ], - "items":{ - "type":"string" - } - }, - "Model50":{ - "type":"object", - "description":"This contains application configuration details to set up for deposits and trading.", - "example":{ - "defaultFeeRate":0.002, - "deversifiAddress":"0x9ab450355b4ab504cbc0e4de484781dac08e6a26", - "starkExContractAddress":"0xF3731d0cdC9834f6F32104580bD226EF1bc1A9F9", - "exchangeSymbols":[ - "ETH:USDT", - "ZRX:USDT", - "ZRX:ETH", - "BTC:USDT", - "ETH:BTC" - ], - "newMarkets":[ - "ZRX:USDT", - "ZRX:ETH" - ], - "tempStarkVaultId":1 - }, - "properties":{ - "defaultFeeRate":{ - "type":"number", - "description":"The default fee rate, if no volume or maker discount.", - "example":0.2 - }, - "deversifiAddress":{ - "type":"string", - "description":"The address of the DeversiFi exchange.", - "example":"0x9ab450355b4ab504cbc0e4de484781dac08e6a26" - }, - "starkExContractAddress":{ - "type":"string", - "description":"Stark deposit contract address.", - "example":"0x69C6392Eb02a2882314134c98DDCBF73B7AdBab1" - }, - "exchangeSymbols":{ - "$ref":"#/definitions/exchangeSymbols" - }, - "newMarkets":{ - "$ref":"#/definitions/Model49" - }, - "tempStarkVaultId":{ - "type":"number", - "description":"Transit Stark vault ID used for deposit privacy", - "example":1 - }, - "minDepositUSDT":{ - "type":"number", - "description":"Minimum deposit amount denominated in USDT", - "example":1 - } - } - }, - "registerResponseUserRegisteredOnChain":{ - "type":"object", - "example":{ - "isRegistered":true, - "ethAddress":"0xe16841977feae28ce69f9d6b6f3fcf1e9610f2fe", - "DVF":{ - "defaultFeeRate":0.002, - "deversifiAddress":"0xc0e9bd267626e2393ddaf520ae5df27ef6c533bd", - "starkExContractAddress":"0x5783323064dDa4A1ebe62defFeF46750BD2C560c", - "exchangeSymbols":[ - "ETH:USDT", - "ZRX:USDT", - "ZRX:ETH", - "BTC:USDT", - "ETH:BTC" - ], - "newMarkets":[ - "ZRX:USDT", - "ZRX:ETH" - ], - "tempStarkVaultId":1, - "minDepositUSDT":1 - }, - "tokenRegistry":{ - "ETH":{ - "decimals":18, - "quantization":10000000000, - "minOrderSize":0.05, - "starkTokenId":"0xb333e3142fe16b78628f19bb15afddaef437e72d6d7f5c6c20c6801a27fba6" - }, - "USDT":{ - "decimals":6, - "quantization":1, - "minOrderSize":10, - "settleSpread":0, - "starkTokenId":"0x4507594b0258664463ad7bd1d1e9b1ff67821113abd1b9c7e082bb304da322", - "tokenAddress":"0x1c0f17436740bfb92c1070ee86322de890837c6a" - }, - "ZRX":{ - "decimals":18, - "quantization":10000000000, - "minOrderSize":10, - "starkTokenId":"0x3901ee6a6c5ac0f6e284f4273b961b7e9f29d25367d31d90b75820473a202f7", - "tokenAddress":"0xcd077abedd831a3443ffbe24fb76661bbb17eb69" - }, - "BTC":{ - "decimals":18, - "quantization":10000000000, - "minOrderSize":0.0004, - "starkTokenId":"0x21ef21d6b234cd669edd702dd3d1d017be888337010b950ae3679eb4194b4bc", - "tokenAddress":"0x40d8978500bf68324a51533cd6a21e3e59be324a" - } - } - }, - "properties":{ - "isRegistered":{ - "type":"boolean", - "description":"Registration status.", - "example":true, - "enum":[ - true - ] - }, - "ethAddress":{ - "type":"string", - "description":"Ethereum address.", - "example":"0x278ff3bb25c5b1bb7032e822661974479280fa74" - }, - "DVF":{ - "$ref":"#/definitions/Model50" - }, - "tokenRegistry":{ - "$ref":"#/definitions/collateralBalancesSchema" - } - }, - "required":[ - "isRegistered", - "ethAddress" - ] - }, - "storeTradingKeyPayload":{ - "type":"object", - "properties":{ - "nonce":{ - "type":"string", - "description":"This nonce which used to provide the time until which this nonce is valid. It is presented as seconds since epoch.", - "example":"v2-1704114061.000" - }, - "signature":{ - "type":"string", - "description":"The signature obtained by signing the nonce with your private ethereum key.", - "example":"0x2b48d53f2e3a696630ebdcd1ff057556bbc9de9c294adfaa5b1f13df91b67b347fdd88c29594c377ba0024dec40cd9808829e7f4447772482f50a7a8e9a903561c" - }, - "encryptedTradingKey":{ - "type":"string", - "description":"Encrypted Stark Trading Key.", - "example":"7b2276657273696f6e223a227832353531392d7873616c736132302d706f6c7931333035222c226e6f6e6365223a22765633313730366571496f696432717944444539465055346f7466346171457a222c22657068656d5075626c69634b6579223a227358657a625174556c453476555661547857466b326555427532627746342f6641434378536a592f306e513d222c2263697068657274657874223a22444e5041615a76726331374f4d656a5451354f544e4243536d594b504466745335574b307278794b716671715770486d53676a4568782b3259352f6b4a6e3233674e5454476c31306973556271696d72636e67676a61636e346335317672484a697a427166324737227d", - "minLength":66, - "maxLength":1000, - "pattern":"[a-zA-Z0-9]{66,}" - }, - "dtkVersion":{ - "type":"string", - "description":"Trading Key Version", - "example":"v2", - "minLength":0, - "maxLength":4 - } - }, - "required":[ - "encryptedTradingKey" - ] - }, - "storeTradingKeyResponse":{ - "type":"object", - "properties":{ - "status":{ - "type":"boolean", - "description":"Returns true if trading key is stored successfully", - "example":true - } - } - }, - "Model51":{ - "type":"object", - "description":"Stark order related meta information.", - "properties":{ - "vaultIdSell":{ - "type":"number", - "description":"The vault ID of the seller." - }, - "vaultIdBuy":{ - "type":"number", - "description":"The vault ID of the buyer." - }, - "amountSell":{ - "type":"string", - "description":"The total amount to be sold." - }, - "amountBuy":{ - "type":"string", - "description":"The total amount to be bought." - }, - "tokenSell":{ - "type":"string", - "description":"The Stark token ID for the token being sold." - }, - "tokenBuy":{ - "type":"string", - "description":"The Stark token ID for the token being bought." - }, - "nonce":{ - "type":"number", - "description":"Nonce value." - }, - "expirationTimestamp":{ - "type":"number", - "description":"Expiration timestamp of the order." - } - } - }, - "submitOrderMeta":{ - "type":"object", - "description":"A set of meta values.", - "example":{ - "starkOrder":{ - "vaultIdSell":1000002, - "vaultIdBuy":1000001, - "amountSell":"97400000", - "amountBuy":"100000000000000000", - "tokenSell":"0x2", - "tokenBuy":"0x1", - "nonce":0, - "expirationTimestamp":438947 - }, - "ethAddress":"0x341E46a49F15785373edE443Df0220DEa6a41Bbc", - "starkPublicKey":{ - "x":"0746919ecbb54563de512f6fb556c21dab091748b41a60a946dbdbf118ac0a85", - "y":"58f7ce5eb6eb5bd24f70394622b1f4d2c54ebca317a3e61bf9f349dccf166cf" - }, - "starkSignature":{ - "r":"5d14357fcf8f489218de0855267c6f64bc463135debf62680ad796e63cd6d3b", - "s":"786ab874d91e3a5871134955fcb768914754760a0ada326af67f758f32819cf" - } - }, - "properties":{ - "starkOrder":{ - "$ref":"#/definitions/Model51" - }, - "ethAddress":{ - "type":"string", - "description":"The Ethereum public address." - }, - "feature":{ - "type":"string", - "description":"Origin of the order" - }, - "platform":{ - "type":"string", - "description":"Platform on which the order was initiated", - "default":"DESKTOP", - "enum":[ - "DESKTOP", - "MOBILE" - ] - }, - "starkPublicKey":{ - "$ref":"#/definitions/collateralBalancesSchema" - }, - "starkSignature":{ - "$ref":"#/definitions/Model29" - } - }, - "required":[ - "starkSignature" - ] - }, - "submitOrderPayload":{ - "type":"object", - "properties":{ - "cid":{ - "type":"string", - "description":"Optional custom order ID that could be set when placing order and used later to retrieve order. This ID is unique per user (user A and B can each have an order with cid = AAA, but the same user cannot have two orders with the same cid)", - "example":"long-123" - }, - "gid":{ - "type":"string" - }, - "type":{ - "type":"string", - "description":"The type of order. Currently only “EXCHANGE_LIMIT” is accepted.", - "example":"EXCHANGE LIMIT", - "enum":[ - "EXCHANGE LIMIT", - "exchange limit", - "EXCHANGE MARKET", - "exchange market" - ] - }, - "symbol":{ - "type":"string", - "description":"The trading pair.", - "example":"ETH:USDT" - }, - "amount":{ - "type":"string", - "description":"The token amount to be traded. Will be rounded up to 8 decimal places.", - "example":"0.1" - }, - "price":{ - "type":"string", - "description":"The cost per unit. Will be rounded down to 5 significant digits.", - "example":"1000" - }, - "meta":{ - "$ref":"#/definitions/submitOrderMeta" - }, - "protocol":{ - "type":"string", - "enum":[ - "stark" - ] - }, - "partnerId":{ - "type":"string" - }, - "feeRate":{ - "type":"string", - "example":0.002 - }, - "isPostOnly":{ - "type":"boolean", - "description":"Flag to indicate if the order is post-only. Mutually exclusive with isFillOrKill" - }, - "isHidden":{ - "type":"boolean", - "description":"Flag to indicate if the order is hidden." - }, - "isFillOrKill":{ - "type":"boolean", - "description":"Flag to indicate if fill or kill order. Mutually exclusive with isPostOnly" - }, - "isSlippageDisabled":{ - "type":"boolean", - "description":"Flag to indicate if slippage protection is disabled." - } - }, - "required":[ - "type", - "symbol", - "amount", - "price", - "meta" - ] - }, - "submitOrderResponse":{ - "type":"object", - "properties":{ - "_id":{ - "type":"string", - "description":"Id for the order. This can be used for orderId when calling cancelOrder or getOrder", - "example":"L1tarX5wUem" - }, - "user":{ - "type":"string", - "description":"Ethereum address of the user", - "example":"E0xc1caf2d76c49e4a60635635c329a3ac22ddeb547" - }, - "symbol":{ - "type":"string", - "description":"Trading symbol for the order", - "example":"ETH:USDT" - }, - "tokenSell":{ - "type":"string", - "description":"The token which is being sold", - "example":"ETH" - }, - "tokenBuy":{ - "type":"string", - "description":"The token which is being bought", - "example":"USDT" - }, - "amount":{ - "type":"number", - "description":"Original order size placed being sold or bought.", - "example":"-0.5" - }, - "feeRate":{ - "type":"string", - "description":"Applied fee rate for this order", - "example":0.002 - }, - "meta":{ - "$ref":"#/definitions/collateralBalancesSchema" - }, - "cancelRequested":{ - "type":"boolean", - "description":"Whether or not this order was canceled by the user", - "example":true - }, - "pending":{ - "type":"boolean", - "description":"Whether or not this order is still pending to be filled", - "example":true - }, - "tokenSellLockedBalance":{ - "type":"string", - "description":"Amount (quantized) of token being locked to honor the order", - "example":"50000000" - }, - "price":{ - "type":"number", - "description":"Cost per unit.", - "example":"200" - }, - "type":{ - "type":"string", - "description":"Type of the order. Currently, \"EXCHANGE LIMIT\" is the only type that is supported.", - "example":"EXCHANGE LIMIT" - }, - "createdAt":{ - "type":"string", - "description":"The date and time when the order was created.", - "example":"2020-05-09T18:29:56.603Z" - }, - "updatedAt":{ - "type":"string", - "description":"The date and time when the order was last updated.", - "example":"2020-05-09T18:29:56.945Z" - }, - "activatedAt":{ - "type":"string", - "description":"The date and time when the order was activated.", - "example":"2020-05-09T18:29:56.944Z" - }, - "isPostOnly":{ - "type":"boolean", - "description":"Flag to indicate if the order is post-only.", - "example":false - }, - "isHidden":{ - "type":"boolean", - "description":"Flag to indicate if the order is hidden.", - "example":false - }, - "isFillOrKill":{ - "type":"boolean", - "description":"Flag to indicate if fill or kill order.", - "example":false - }, - "isSlippageDisabled":{ - "type":"boolean", - "description":"Flag to indicate if slippage protection is disabled.", - "example":false - }, - "cid":{ - "type":"string", - "description":"An optional user-defined identifier for this order", - "example":"satoshi-order-2083236893" - } - } - }, - "Model52":{ - "type":"object", - "description":"StarkWare TansferRequest for main transfer", - "example":{ - "amount":"9000000", - "senderPublicKey":"0x06537d3a116bcaa05be2f4d600280e1cf6a563a8808bcddef8c3b6ac71cdc5d2", - "receiverPublicKey":"0x000000000000000000000000000000000000000000000000000000000001a2b3", - "receiverVaultId":2141966986, - "senderVaultId":862115662, - "token":"0x180bef8ae3462e919489763b84dc1dc700c45a249dec4d1136814a639f2dd7b", - "type":"TransferRequest", - "nonce":919908315, - "expirationTimestamp":452912, - "signature":{ - "r":"0x6d1fa97e1088d236ecbac506c4647643c657c4bfa0f3dac19bf9fbd3164ae3b", - "s":"0x5faa1c05486186883154038c666e17470180e2b40ba2301bcf86098a8904b00" - } - }, - "properties":{ - "type":{ - "type":"string", - "enum":[ - "TransferRequest" - ] - }, - "amount":{ - "type":"string", - "pattern":"^[0-9]*$" - }, - "expirationTimestamp":{ - "type":"integer", - "minimum":0 - }, - "nonce":{ - "type":"integer", - "minimum":0 - }, - "receiverPublicKey":{ - "type":"string", - "pattern":"^0x[a-f0-9]+$" - }, - "receiverVaultId":{ - "type":"integer" - }, - "senderPublicKey":{ - "type":"string", - "pattern":"^0x[a-f0-9]+$" - }, - "senderVaultId":{ - "type":"integer" - }, - "signature":{ - "$ref":"#/definitions/signature" - }, - "token":{ - "type":"string", - "pattern":"^0x[a-f0-9]+$" - } - } - }, - "feeTx":{ - "type":"object", - "description":"StarkWare TansferRequest for service fee", - "example":{ - "amount":"1000000", - "senderPublicKey":"0x06537d3a116bcaa05be2f4d600280e1cf6a563a8808bcddef8c3b6ac71cdc5d2", - "receiverPublicKey":"0x077a3b314db07c45076d11f62b6f9e748a39790441823307743cf00d6597ea43", - "receiverVaultId":1635824404, - "senderVaultId":862115662, - "token":"0x180bef8ae3462e919489763b84dc1dc700c45a249dec4d1136814a639f2dd7b", - "type":"TransferRequest", - "nonce":727678229, - "expirationTimestamp":452912, - "signature":{ - "r":"0x6aead08672aff1f86185f0d68073ab64a70299fbdbf01a869d2bc53e5c1e440", - "s":"0x359c52b8c6e6d4087d530ece2f5dc590b98cf9a83c971e42205e636276bac0e" - } - }, - "properties":{ - "type":{ - "type":"string", - "enum":[ - "TransferRequest" - ] - }, - "amount":{ - "type":"string", - "pattern":"^[0-9]*$" - }, - "expirationTimestamp":{ - "type":"integer", - "minimum":0 - }, - "nonce":{ - "type":"integer", - "minimum":0 - }, - "receiverPublicKey":{ - "type":"string", - "pattern":"^0x[a-f0-9]+$" - }, - "receiverVaultId":{ - "type":"integer" - }, - "senderPublicKey":{ - "type":"string", - "pattern":"^0x[a-f0-9]+$" - }, - "senderVaultId":{ - "type":"integer" - }, - "signature":{ - "$ref":"#/definitions/signature" - }, - "token":{ - "type":"string", - "pattern":"^0x[a-f0-9]+$" - } - } - }, - "transferPayload":{ - "type":"object", - "properties":{ - "tx":{ - "$ref":"#/definitions/Model52" - }, - "feeTx":{ - "$ref":"#/definitions/feeTx" - }, - "memo":{ - "type":"string", - "description":"Optional memo string", - "example":"my reference", - "maxLength":42 - }, - "starkPublicKey":{ - "$ref":"#/definitions/starkPublicKey" - } - } - }, - "Model53":{ - "type":"object", - "example":{ - "type":"TransferRequest", - "amount":"10000000", - "expirationTimestamp":446134, - "nonce":976614084, - "receiverPublicKey":"0x077a3b314db07c45076d11f62b6f9e748a39790441823307743cf00d6597ea43", - "receiverVaultId":1863686755, - "senderPublicKey":"0x044926648f4b6f002dfa389c536129ae178f34d9be452724268cc48ebea2b37c", - "senderVaultId":2010760265, - "token":"0x180bef8ae3462e919489763b84dc1dc700c45a249dec4d1136814a639f2dd7b", - "signature":{ - "r":"0x2857ca21310ab87bb7c37ebad0e7166f1fb46e43cf32d6587a31e148d44b677", - "s":"0x45e939717a6de4ad5e79993d918bb40e629760da7a04062e965394d1d14106a" - } - }, - "properties":{ - "type":{ - "type":"string", - "enum":[ - "TransferRequest" - ] - }, - "amount":{ - "type":"string", - "pattern":"^[0-9]*$" - }, - "expirationTimestamp":{ - "type":"integer", - "minimum":0 - }, - "nonce":{ - "type":"integer", - "minimum":0 - }, - "receiverPublicKey":{ - "type":"string", - "pattern":"^0x[a-f0-9]+$" - }, - "receiverVaultId":{ - "type":"integer" - }, - "senderPublicKey":{ - "type":"string", - "pattern":"^0x[a-f0-9]+$" - }, - "senderVaultId":{ - "type":"integer" - }, - "signature":{ - "$ref":"#/definitions/signature" - }, - "token":{ - "type":"string", - "pattern":"^0x[a-f0-9]+$" - } - } - }, - "transferResponseObject":{ - "type":"object", - "properties":{ - "_id":{ - "type":"string", - "description":"Transfer ID.", - "example":"LCafcGC6tBH" - }, - "token":{ - "type":"string", - "description":"The token that was transferred.", - "example":"NEC" - }, - "amount":{ - "type":"string", - "description":"The amount that was transferred (in quantised units).", - "example":"100", - "pattern":"^[0-9]*$" - }, - "recipient":{ - "type":"string", - "description":"Deversifi user id of recipient of the transfer.", - "example":"0x948cd3ad67c5f21412bfcd07a7981322f9fa01f0" - }, - "createdAt":{ - "type":"string", - "format":"date", - "description":"The date and time transfer request was received.", - "example":"2020-01-29T14:13:05.898Z" - }, - "updatedAt":{ - "type":"string", - "format":"date", - "description":"The date and time transfer request was received.", - "example":"2020-01-29T14:13:05.898Z" - }, - "memo":{ - "type":"string", - "description":"Transfer memo", - "example":"my reference" - }, - "tx":{ - "$ref":"#/definitions/Model53" - } - }, - "required":[ - "_id", - "token", - "createdAt", - "updatedAt" - ] - }, - "withdrawalPayload":{ - "type":"object", - "properties":{ - "token":{ - "type":"string", - "description":"The token for which the withdrawal is requested.", - "example":"ZRX" - }, - "amount":{ - "type":"number", - "description":"The withdrawal amount.", - "example":1 - }, - "nonce":{ - "type":"number", - "example":45435743 - }, - "starkPublicKey":{ - "$ref":"#/definitions/starkPublicKey" - }, - "starkSignature":{ - "$ref":"#/definitions/Model29" - }, - "starkVaultId":{ - "type":"number", - "description":"The Stark vault ID.", - "example":1000003 - }, - "expireTime":{ - "type":"number", - "description":"Expiry time in hours", - "example":454934 - } - }, - "required":[ - "token", - "amount", - "nonce", - "starkPublicKey", - "starkSignature", - "starkVaultId", - "expireTime" - ] - }, - "Model54":{ - "type":"object", - "properties":{ - "token":{ - "type":"string", - "description":"The token which the balance is specifically requested for.", - "example":"ETH" - }, - "fields":{ - "$ref":"#/definitions/fields" - } - } - } -}, -"x-alt-definitions":{ - "pagination":{ - "type":"object", - "properties":{ - "totalItems":{ - "type":"number", - "description":"Total number of items matching the query", - "example":1559, - "minimum":0 - }, - "limit":{ - "type":"number", - "description":"Limit applied on returned items", - "example":5 - }, - "skip":{ - "type":"number", - "description":"Skip applied on returned items", - "example":2 - } - } - }, - "Model1":{ - "type":"object", - "properties":{ - "_id":{ - "type":"string", - "description":"Unique identifier representing the deposit or withdrawal", - "example":"606f207fc7aa2e91d028a17a" - }, - "type":{ - "type":"string", - "description":"Whether the transaction is a deposit, a classic withdrawal or a fast withdrawal", - "example":"Deposit", - "enum":[ - "Deposit", - "Withdrawal", - "FastWithdrawal" - ] - }, - "token":{ - "type":"string", - "description":"Token deposited or withdrawn", - "example":"ZRX" - }, - "amount":{ - "type":"number", - "description":"Amount deposited or withdrawn", - "example":1 - }, - "transactionHash":{ - "type":"string", - "description":"Hash of the Ethereum transaction leading to L1 balance debit or credit", - "example":"0xb5c8bd9430b6cc87a0e2fe110ece6bf527fa4f170a4bc8cd032f768fc5219838" - }, - "date":{ - "type":"string", - "format":"date", - "description":"Date and time deposit or withdrawal", - "example":"2020-11-11T16:37:05.957" - }, - "sourceOrRecipient":{ - "type":"string", - "description":"Originator of the deposit or recipient of the withdrawal", - "example":"0x148426fdc4c8a51b96b4bed827907b5fa6491ad0" - }, - "gateway":{ - "type":"string", - "description":"Set when operation used a gateway. Corresponds to a chain identifier", - "example":"MATIC_POS" - } - } - }, - "items":{ - "type":"array", - "items":{ - "$ref":"#/x-alt-definitions/Model1" - } - }, - "getDepositsAndWithdrawalsResponse":{ - "type":"object", - "properties":{ - "pagination":{ - "$ref":"#/x-alt-definitions/pagination" - }, - "items":{ - "$ref":"#/x-alt-definitions/items" - } - } - }, - "Model2":{ - "type":"object", - "properties":{ - "fillId":{ - "type":"string", - "description":"Unique identifier representing the fill event", - "example":"606f207fc7aa2e91d028a17a" - }, - "orderId":{ - "type":"string", - "description":"Unique identifier of the order associated with the fill", - "example":"BtHEvgY1Bz1" - }, - "symbol":{ - "type":"string", - "description":"Symbol for the order associated with the fill", - "example":"ETH:USDT" - }, - "price":{ - "type":"number", - "description":"Execution price of the fill", - "example":209.9 - }, - "fillAmount":{ - "type":"number", - "description":"Amount filled (negative amount for a sell event, positive for a buy event)", - "example":-0.125622 - }, - "orderAmount":{ - "type":"number", - "description":"Initial amount for the placed order associated with the fill", - "example":-1 - }, - "date":{ - "type":"string", - "format":"date", - "description":"Date and time of the fill event", - "example":"2020-11-11T16:37:05.957" - }, - "orderCreationDate":{ - "type":"string", - "format":"date", - "description":"Date and time at which the order associated with the fill event was placed", - "example":"2020-11-11T16:37:05.262Z" - }, - "orderType":{ - "type":"string", - "description":"Type of the order associated with the fill event", - "example":true, - "enum":[ - "EXCHANGE LIMIT", - "EXCHANGE MARKET" - ] - }, - "orderActive":{ - "type":"boolean", - "description":"Whether the order associated with the fill event is still active", - "example":true - }, - "orderCanceled":{ - "type":"boolean", - "description":"Whether the order associated with the fill event was canceled", - "example":false - } - } - }, - "Model3":{ - "type":"array", - "items":{ - "$ref":"#/x-alt-definitions/Model2" - } - }, - "getFillsResponse":{ - "type":"object", - "properties":{ - "pagination":{ - "$ref":"#/x-alt-definitions/pagination" - }, - "items":{ - "$ref":"#/x-alt-definitions/Model3" - } - } - }, - "Model4":{ - "type":"object", - "properties":{ - "_id":{ - "type":"string", - "description":"Unique identifier representing this transfer", - "example":"MphMkBBZjnS" - }, - "token":{ - "type":"string", - "description":"Token transfered", - "example":"ETH" - }, - "amount":{ - "type":"number", - "description":"Amount transfered (effective amount received by the recipient)", - "example":3.14, - "minimum":0 - }, - "feeAmount":{ - "type":"number", - "description":"Transfer fee amount (in transfer token units)", - "example":3.14, - "minimum":0 - }, - "source":{ - "type":"string", - "description":"Source Ethereum address", - "example":"0x08152c1265dBc218ccc8Ab5C574e6bD52279b3B7" - }, - "recipient":{ - "type":"string", - "description":"Recipient Ethereum address", - "example":"0xeb3ea3ea9239577951523cafa9fd3072bc88e50a" - }, - "memo":{ - "type":"string", - "description":"Transfer memo", - "example":"my reference" - }, - "date":{ - "type":"string", - "format":"date", - "description":"Date and time of the transfer", - "example":"1990-04-14T00:20:00.000Z" - } - } - }, - "Model5":{ - "type":"array", - "items":{ - "$ref":"#/x-alt-definitions/Model4" - } - }, - "getTransfersResponse":{ - "type":"object", - "properties":{ - "pagination":{ - "$ref":"#/x-alt-definitions/pagination" - }, - "items":{ - "$ref":"#/x-alt-definitions/Model5" - } - } - }, - "encryptedTradingKey":{ - "type":"object", - "properties":{ - "dtk":{ - "type":"string", - "description":"The encrypted Stark trading key.", - "example":"6d840e6d251e2165e3214eecfcbcfa83c0f704439e16c69383d93fc0f704439e16c69383d93fc0f704439e16c69383d93fc0f704439e16c69383d93fc0f704439e16c69383d93f", - "minLength":66, - "maxLength":1000, - "pattern":"[a-zA-Z0-9]{66,}" - }, - "dtkVersion":{ - "type":"string", - "description":"Version of the trading key mechanism.", - "example":"v1", - "default":"v1" - } - } - }, - "exchangeSymbols":{ - "type":"array", - "description":"Currency pairs available at the DeversiFi exchange for trading", - "example":[ - "ETH:USDT" - ], - "items":{ - "type":"string" - } - }, - "newMarkets":{ - "type":"array", - "description":"Currency pairs that were newly added", - "example":[ - "ETH:USDT" - ], - "items":{ - "type":"string" - } - }, - "DVF":{ - "type":"object", - "description":"This contains application configuration details to set up for deposits and trading.", - "example":{ - "defaultFeeRate":0.002, - "deversifiAddress":"0x9ab450355b4ab504cbc0e4de484781dac08e6a26", - "starkExContractAddress":"0xF3731d0cdC9834f6F32104580bD226EF1bc1A9F9", - "exchangeSymbols":[ - "ETH:USDT", - "ZRX:USDT", - "ZRX:ETH", - "BTC:USDT", - "ETH:BTC" - ], - "newMarkets":[ - "ZRX:USDT", - "ZRX:ETH" - ], - "tempStarkVaultId":1 - }, - "properties":{ - "defaultFeeRate":{ - "type":"number", - "description":"The default fee rate, if no volume or maker discount.", - "example":0.2 - }, - "deversifiAddress":{ - "type":"string", - "description":"The address of the DeversiFi exchange.", - "example":"0x9ab450355b4ab504cbc0e4de484781dac08e6a26" - }, - "starkExContractAddress":{ - "type":"string", - "description":"Stark deposit contract address.", - "example":"0x69C6392Eb02a2882314134c98DDCBF73B7AdBab1" - }, - "exchangeSymbols":{ - "$ref":"#/x-alt-definitions/exchangeSymbols" - }, - "newMarkets":{ - "$ref":"#/x-alt-definitions/newMarkets" - }, - "tempStarkVaultId":{ - "type":"number", - "description":"Transit Stark vault ID used for deposit privacy", - "example":1 - }, - "minDepositUSDT":{ - "type":"number", - "description":"Minimum deposit amount denominated in USDT", - "example":1 - } - } - }, - "tokenRegistry":{ - "type":"object" - }, - "registerResponseUserRegisteredOnChain":{ - "type":"object", - "example":{ - "isRegistered":true, - "ethAddress":"0xe16841977feae28ce69f9d6b6f3fcf1e9610f2fe", - "DVF":{ - "defaultFeeRate":0.002, - "deversifiAddress":"0xc0e9bd267626e2393ddaf520ae5df27ef6c533bd", - "starkExContractAddress":"0x5783323064dDa4A1ebe62defFeF46750BD2C560c", - "exchangeSymbols":[ - "ETH:USDT", - "ZRX:USDT", - "ZRX:ETH", - "BTC:USDT", - "ETH:BTC" - ], - "newMarkets":[ - "ZRX:USDT", - "ZRX:ETH" - ], - "tempStarkVaultId":1, - "minDepositUSDT":1 - }, - "tokenRegistry":{ - "ETH":{ - "decimals":18, - "quantization":10000000000, - "minOrderSize":0.05, - "starkTokenId":"0xb333e3142fe16b78628f19bb15afddaef437e72d6d7f5c6c20c6801a27fba6" - }, - "USDT":{ - "decimals":6, - "quantization":1, - "minOrderSize":10, - "settleSpread":0, - "starkTokenId":"0x4507594b0258664463ad7bd1d1e9b1ff67821113abd1b9c7e082bb304da322", - "tokenAddress":"0x1c0f17436740bfb92c1070ee86322de890837c6a" - }, - "ZRX":{ - "decimals":18, - "quantization":10000000000, - "minOrderSize":10, - "starkTokenId":"0x3901ee6a6c5ac0f6e284f4273b961b7e9f29d25367d31d90b75820473a202f7", - "tokenAddress":"0xcd077abedd831a3443ffbe24fb76661bbb17eb69" - }, - "BTC":{ - "decimals":18, - "quantization":10000000000, - "minOrderSize":0.0004, - "starkTokenId":"0x21ef21d6b234cd669edd702dd3d1d017be888337010b950ae3679eb4194b4bc", - "tokenAddress":"0x40d8978500bf68324a51533cd6a21e3e59be324a" - } - } - }, - "properties":{ - "isRegistered":{ - "type":"boolean", - "description":"Registration status.", - "example":true, - "enum":[ - true - ] - }, - "ethAddress":{ - "type":"string", - "description":"Ethereum address.", - "example":"0x278ff3bb25c5b1bb7032e822661974479280fa74" - }, - "DVF":{ - "$ref":"#/x-alt-definitions/DVF" - }, - "tokenRegistry":{ - "$ref":"#/x-alt-definitions/tokenRegistry" - } - }, - "required":[ - "isRegistered", - "ethAddress" - ] - }, - "registerResponseUserNotRegisteredOnChain":{ - "type":"object", - "properties":{ - "isRegistered":{ - "type":"boolean", - "description":"Registration status.", - "example":false, - "enum":[ - false - ] - }, - "deFiSignature":{ - "type":"string", - "description":"Deversifi Signature", - "example":"0x0277b6e85ffdfb8cdc34c89b8d7ef19e915daf00327db91c1f5a1988666089e6b8420881699501" - } - }, - "required":[ - "isRegistered", - "deFiSignature" - ] - }, - "starkOrder":{ - "type":"object", - "description":"Stark order related meta information.", - "properties":{ - "vaultIdSell":{ - "type":"number", - "description":"The vault ID of the seller." - }, - "vaultIdBuy":{ - "type":"number", - "description":"The vault ID of the buyer." - }, - "amountSell":{ - "type":"string", - "description":"The total amount to be sold." - }, - "amountBuy":{ - "type":"string", - "description":"The total amount to be bought." - }, - "tokenSell":{ - "type":"string", - "description":"The Stark token ID for the token being sold." - }, - "tokenBuy":{ - "type":"string", - "description":"The Stark token ID for the token being bought." - }, - "nonce":{ - "type":"number", - "description":"Nonce value." - }, - "expirationTimestamp":{ - "type":"number", - "description":"Expiration timestamp of the order." - } - } - }, - "starkSignature":{ - "type":"object", - "description":"Stark signature consisting of consisting of \"r\" and \"s\"", - "example":{ - "v":"3b46dfe03caef623048fedc8457a92385cd63eff6349ad135c945cd84937677", - "r":"1f38f551d798562c16d28733c7e3ff6850898d82f0ac9ccd39d373303b1778c", - "s":"518560420e52a37e9f580f024fc0fe8572cb2f5437a839075bbf4b2b123d572" - }, - "properties":{ - "v":{ - "type":"string", - "description":"The \"v\" part of the Stark signature." - }, - "r":{ - "type":"string", - "description":"The \"r\" part of the Stark signature." - }, - "s":{ - "type":"string", - "description":"The \"s\" part of the Stark signature." - } - }, - "required":[ - "r", - "s" - ] - }, - "submitOrderMeta":{ - "type":"object", - "description":"A set of meta values.", - "example":{ - "starkOrder":{ - "vaultIdSell":1000002, - "vaultIdBuy":1000001, - "amountSell":"97400000", - "amountBuy":"100000000000000000", - "tokenSell":"0x2", - "tokenBuy":"0x1", - "nonce":0, - "expirationTimestamp":438947 - }, - "ethAddress":"0x341E46a49F15785373edE443Df0220DEa6a41Bbc", - "starkPublicKey":{ - "x":"0746919ecbb54563de512f6fb556c21dab091748b41a60a946dbdbf118ac0a85", - "y":"58f7ce5eb6eb5bd24f70394622b1f4d2c54ebca317a3e61bf9f349dccf166cf" - }, - "starkSignature":{ - "r":"5d14357fcf8f489218de0855267c6f64bc463135debf62680ad796e63cd6d3b", - "s":"786ab874d91e3a5871134955fcb768914754760a0ada326af67f758f32819cf" - } - }, - "properties":{ - "starkOrder":{ - "$ref":"#/x-alt-definitions/starkOrder" - }, - "ethAddress":{ - "type":"string", - "description":"The Ethereum public address." - }, - "feature":{ - "type":"string", - "description":"Origin of the order" - }, - "platform":{ - "type":"string", - "description":"Platform on which the order was initiated", - "default":"DESKTOP", - "enum":[ - "DESKTOP", - "MOBILE" - ] - }, - "starkPublicKey":{ - "$ref":"#/x-alt-definitions/tokenRegistry" - }, - "starkSignature":{ - "$ref":"#/x-alt-definitions/starkSignature" - } - }, - "required":[ - "starkSignature" - ] - }, - "submitOrderPayload":{ - "type":"object", - "properties":{ - "cid":{ - "type":"string", - "description":"Optional custom order ID that could be set when placing order and used later to retrieve order. This ID is unique per user (user A and B can each have an order with cid = AAA, but the same user cannot have two orders with the same cid)", - "example":"long-123" - }, - "gid":{ - "type":"string" - }, - "type":{ - "type":"string", - "description":"The type of order. Currently only “EXCHANGE_LIMIT” is accepted.", - "example":"EXCHANGE LIMIT", - "enum":[ - "EXCHANGE LIMIT", - "exchange limit", - "EXCHANGE MARKET", - "exchange market" - ] - }, - "symbol":{ - "type":"string", - "description":"The trading pair.", - "example":"ETH:USDT" - }, - "amount":{ - "type":"string", - "description":"The token amount to be traded. Will be rounded up to 8 decimal places.", - "example":"0.1" - }, - "price":{ - "type":"string", - "description":"The cost per unit. Will be rounded down to 5 significant digits.", - "example":"1000" - }, - "meta":{ - "$ref":"#/x-alt-definitions/submitOrderMeta" - }, - "protocol":{ - "type":"string", - "enum":[ - "stark" - ] - }, - "partnerId":{ - "type":"string" - }, - "feeRate":{ - "type":"string", - "example":0.002 - }, - "isPostOnly":{ - "type":"boolean", - "description":"Flag to indicate if the order is post-only. Mutually exclusive with isFillOrKill" - }, - "isHidden":{ - "type":"boolean", - "description":"Flag to indicate if the order is hidden." - }, - "isFillOrKill":{ - "type":"boolean", - "description":"Flag to indicate if fill or kill order. Mutually exclusive with isPostOnly" - }, - "isSlippageDisabled":{ - "type":"boolean", - "description":"Flag to indicate if slippage protection is disabled." - } - }, - "required":[ - "type", - "symbol", - "amount", - "price", - "meta" - ] - }, - "Model6":{ - "type":"array", - "items":{ - "$ref":"#/x-alt-definitions/submitOrderPayload" - } - }, - "submitOrderResponse":{ - "type":"object", - "properties":{ - "_id":{ - "type":"string", - "description":"Id for the order. This can be used for orderId when calling cancelOrder or getOrder", - "example":"L1tarX5wUem" - }, - "user":{ - "type":"string", - "description":"Ethereum address of the user", - "example":"E0xc1caf2d76c49e4a60635635c329a3ac22ddeb547" - }, - "symbol":{ - "type":"string", - "description":"Trading symbol for the order", - "example":"ETH:USDT" - }, - "tokenSell":{ - "type":"string", - "description":"The token which is being sold", - "example":"ETH" - }, - "tokenBuy":{ - "type":"string", - "description":"The token which is being bought", - "example":"USDT" - }, - "amount":{ - "type":"number", - "description":"Original order size placed being sold or bought.", - "example":"-0.5" - }, - "feeRate":{ - "type":"string", - "description":"Applied fee rate for this order", - "example":0.002 - }, - "meta":{ - "$ref":"#/x-alt-definitions/tokenRegistry" - }, - "cancelRequested":{ - "type":"boolean", - "description":"Whether or not this order was canceled by the user", - "example":true - }, - "pending":{ - "type":"boolean", - "description":"Whether or not this order is still pending to be filled", - "example":true - }, - "tokenSellLockedBalance":{ - "type":"string", - "description":"Amount (quantized) of token being locked to honor the order", - "example":"50000000" - }, - "price":{ - "type":"number", - "description":"Cost per unit.", - "example":"200" - }, - "type":{ - "type":"string", - "description":"Type of the order. Currently, \"EXCHANGE LIMIT\" is the only type that is supported.", - "example":"EXCHANGE LIMIT" - }, - "createdAt":{ - "type":"string", - "description":"The date and time when the order was created.", - "example":"2020-05-09T18:29:56.603Z" - }, - "updatedAt":{ - "type":"string", - "description":"The date and time when the order was last updated.", - "example":"2020-05-09T18:29:56.945Z" - }, - "activatedAt":{ - "type":"string", - "description":"The date and time when the order was activated.", - "example":"2020-05-09T18:29:56.944Z" - }, - "isPostOnly":{ - "type":"boolean", - "description":"Flag to indicate if the order is post-only.", - "example":false - }, - "isHidden":{ - "type":"boolean", - "description":"Flag to indicate if the order is hidden.", - "example":false - }, - "isFillOrKill":{ - "type":"boolean", - "description":"Flag to indicate if fill or kill order.", - "example":false - }, - "isSlippageDisabled":{ - "type":"boolean", - "description":"Flag to indicate if slippage protection is disabled.", - "example":false - }, - "cid":{ - "type":"string", - "description":"An optional user-defined identifier for this order", - "example":"satoshi-order-2083236893" - } - } - }, - "Model7":{ - "type":"array", - "items":{ - "$ref":"#/x-alt-definitions/submitOrderResponse" - } - } -} -} diff --git a/src/ui/Docs/DocsScreen.jsx b/src/ui/Docs/DocsScreen.jsx index 5fc9ec4..f7cc2f6 100644 --- a/src/ui/Docs/DocsScreen.jsx +++ b/src/ui/Docs/DocsScreen.jsx @@ -1,5 +1,5 @@ import React, {useState} from 'react'; -import {loadSpec} from '../../spec'; +import {loadSpecAsync} from '../../spec'; import {Sidebar} from '../common/Sidebar'; import {Breadcrumbs} from '../common/Breadcrumbs'; import {Endpoint} from './Endpoint'; @@ -9,13 +9,18 @@ import {Screen} from '../common/Screen'; import {SidebarLinks} from './SidebarLinks'; import {Content, Header, Main} from '../common/Layout/Layout'; import {TutorialsLink} from './TutorialsLink'; +import { useEffect } from 'react'; export const DocsScreen = () => { - const [spec] = useState(loadSpec); + const [spec, setSpec] = useState(null); const {sidebarLayout} = useLayout(); const [isSidebarExpanded] = sidebarLayout; + useEffect(() => { + loadSpecAsync().then(setSpec); + }, []); + return ( }> diff --git a/src/ui/Tutorials/TutorialsSections/SmartContractsSection.jsx b/src/ui/Tutorials/TutorialsSections/SmartContractsSection.jsx index 0163674..4ebab14 100644 --- a/src/ui/Tutorials/TutorialsSections/SmartContractsSection.jsx +++ b/src/ui/Tutorials/TutorialsSections/SmartContractsSection.jsx @@ -27,7 +27,7 @@ export const SmartContractsSection = () => ( Ropsten Contracts - Exchange Contract - 0x5783323064dDa4A1ebe62defFeF46750BD2C560c
+ Exchange Contract - 0xe73a394ade4d94a073502da8703ea23490dc7b6a
diff --git a/src/ui/common/Tabs.jsx b/src/ui/common/Tabs.jsx index 95e481b..5244353 100644 --- a/src/ui/common/Tabs.jsx +++ b/src/ui/common/Tabs.jsx @@ -25,7 +25,6 @@ export const TabButton = styled.button` background: none; border: none; cursor: pointer; - text-transform: capitalize; &::after { content: ''; From 96a7cc7408995577311af27e022845791051146a Mon Sep 17 00:00:00 2001 From: neozaru Date: Fri, 7 Jan 2022 13:37:18 -0800 Subject: [PATCH 7/8] feat: VEN-54 remove console and some overlay.json --- src/spec/getEndpoints.js | 1 - src/spec/swagger-overlay.json | 117 ---------------------------------- 2 files changed, 118 deletions(-) diff --git a/src/spec/getEndpoints.js b/src/spec/getEndpoints.js index 60dd306..3b674d4 100644 --- a/src/spec/getEndpoints.js +++ b/src/spec/getEndpoints.js @@ -89,7 +89,6 @@ function getCalls(spec, entry, path, method) { } function buildExample(schema) { - console.log('build example', schema) const schemaWideExample = getParamExample(schema) if (schemaWideExample !== undefined) { return schemaWideExample diff --git a/src/spec/swagger-overlay.json b/src/spec/swagger-overlay.json index 6b8541f..80c1cfc 100644 --- a/src/spec/swagger-overlay.json +++ b/src/spec/swagger-overlay.json @@ -996,123 +996,6 @@ } } } -}, -"/v1/trading/fills": { - "get": { - "title": "Fills History", - "operationId": "getV1TradingFills", - "summary": "This method is used to get the history of fills (executed trades) for the authenticated user", - "responses": { - "default": { - "schema": { - "type": "object", - "properties": { - "pagination": { - "type": "object", - "properties": { - "totalItems": { - "type": "number", - "description": "Total number of items matching the query", - "example": 1559, - "minimum": 0 - }, - "limit": { - "type": "number", - "description": "Limit applied on returned items", - "example": 5 - }, - "skip": { - "type": "number", - "description": "Skip applied on returned items", - "example": 2 - } - } - }, - "items": { - "type": "object", - "properties": { - "_id": { - "type": "string", - "description": "Unique identifier representing this transfer", - "example": "MphMkBBZjnS" - }, - "token": { - "type": "string", - "description": "Token transfered", - "example": "ETH" - }, - "amount": { - "type": "number", - "description": "Amount transfered (effective amount received by the recipient)", - "example": 3.14, - "minimum": 0 - }, - "feeAmount": { - "type": "number", - "description": "Transfer fee amount (in transfer token units)", - "example": 3.14, - "minimum": 0 - }, - "source": { - "type": "string", - "description": "Source Ethereum address", - "example": "0x08152c1265dBc218ccc8Ab5C574e6bD52279b3B7" - }, - "recipient": { - "type": "string", - "description": "Recipient Ethereum address", - "example": "0xeb3ea3ea9239577951523cafa9fd3072bc88e50a" - }, - "date": { - "type": "string", - "format": "date", - "description": "Date and time of the transfer", - "example": "1990-04-14T00:20:00.000Z" - } - } - } - } - }, - "examples": { - "application/json": { - "items": [ - { - "price": 190, - "fillAmount": -0.1, - "symbol": "ETH:USDT", - "fillId": "6093ba95ec05a4226816bc3c", - "orderId": "Fy1qTx38JMZ", - "orderType": "EXCHANGE LIMIT", - "orderCreationDate": "2021-05-06T09:44:53.541Z", - "orderAmount": -0.1, - "date": "2021-05-06T09:44:54.833Z", - "orderActive": false, - "orderCanceled": false - }, - { - "price": 190, - "fillAmount": 0.1, - "symbol": "ETH:USDT", - "fillId": "6093ba95ec05a4226816bc3b", - "orderId": "2fh4oeSZQxW", - "orderType": "EXCHANGE LIMIT", - "orderCreationDate": "2021-05-06T09:44:35.020Z", - "orderAmount": 0.3, - "date": "2021-05-06T09:44:54.334Z", - "orderActive": false, - "orderCanceled": true - } - ], - "pagination": { - "totalItems": 13, - "skip": 0, - "limit": 20 - } - } - } - } - } - } }, "/market-data/book/{symbol}/{precision}/{length}": { "get":{ From 34d0ea08f6c59e36c3f1c9e1e997595b2a9af0ce Mon Sep 17 00:00:00 2001 From: mbrjo Date: Thu, 21 Jul 2022 16:35:07 +0200 Subject: [PATCH 8/8] [VEN-54] Exclude from website documentation excluded categories. Fix crash when reading non tagged entries --- src/spec/getEndpoints.js | 5 ++++- src/spec/getSidebar.js | 8 ++------ src/spec/preprocess.js | 9 +++++++-- 3 files changed, 13 insertions(+), 9 deletions(-) diff --git a/src/spec/getEndpoints.js b/src/spec/getEndpoints.js index 3b674d4..747d70f 100644 --- a/src/spec/getEndpoints.js +++ b/src/spec/getEndpoints.js @@ -9,9 +9,12 @@ import {makeWscatCode} from './makeWscatCode'; import { getParamExample } from './getParamExample'; import { sortBy } from 'lodash'; -export function getEndpoints(spec) { +export function getEndpoints(spec, categoriesToExclude) { const endpoints = []; forEachEndpoint(spec, (entry, orgPath, method) => { + if(!entry.tags) return; + const categoryName = entry.tags && entry.tags[0]; + if(categoriesToExclude.includes(categoryName.toLowerCase())) return; // workaround for unique ws socket endpoint const path = orgPath.replace(/{ws-uid-\d+}/g, ''); diff --git a/src/spec/getSidebar.js b/src/spec/getSidebar.js index 0736d40..76475f3 100644 --- a/src/spec/getSidebar.js +++ b/src/spec/getSidebar.js @@ -1,10 +1,5 @@ import {forEachEndpoint} from './forEachEndpoint'; -var categoriesToExclude = [ - 'internal', // Here to stay but for internal use - 'deprecated', // Is meant to disapear in the future / not to be used anymore - 'hidden' // Hidden for other reasons (ex: feature not released yet) -]; var categoriesOrder = [ 'platform', @@ -23,9 +18,10 @@ const getCategoryWeight = (category) => { return categoriesOrder.length - categoriesOrder.indexOf(category.name.toLowerCase()) }; -export function getSidebar(spec) { +export function getSidebar(spec, categoriesToExclude) { const categories = new Map(); forEachEndpoint(spec, (entry, orgPath, method) => { + if(!entry.tags) return; const categoryName = entry.tags && entry.tags[0]; const category = categories.get(categoryName) || {name: categoryName, items: []}; category.items.push({ diff --git a/src/spec/preprocess.js b/src/spec/preprocess.js index 14fdb2c..a784db7 100644 --- a/src/spec/preprocess.js +++ b/src/spec/preprocess.js @@ -2,8 +2,13 @@ import {getSidebar} from './getSidebar'; import {getEndpoints} from './getEndpoints'; export function preprocess(spec) { + var categoriesToExclude = [ + 'internal', // Here to stay but for internal use + 'deprecated', // Is meant to disapear in the future / not to be used anymore + 'hidden' // Hidden for other reasons (ex: feature not released yet) + ]; return { - sidebar: getSidebar(spec), - endpoints: getEndpoints(spec), + sidebar: getSidebar(spec, categoriesToExclude), + endpoints: getEndpoints(spec, categoriesToExclude), }; }