From 4e30bc3e16d7e0e8876fab09a61e9446c2c9d93f Mon Sep 17 00:00:00 2001 From: fragosti Date: Tue, 7 Aug 2018 17:58:38 -0700 Subject: Add POST order endpoint --- packages/sra-api/src/api.ts | 22 +++++++++++++++++++++- 1 file changed, 21 insertions(+), 1 deletion(-) (limited to 'packages/sra-api/src/api.ts') diff --git a/packages/sra-api/src/api.ts b/packages/sra-api/src/api.ts index 50e656599..5973e11cd 100644 --- a/packages/sra-api/src/api.ts +++ b/packages/sra-api/src/api.ts @@ -196,7 +196,7 @@ export const api: OpenApiSpec = { }, }, ], - true, + false, ), responses: generateResponses( 'relayerApiOrderSchema', @@ -245,6 +245,7 @@ export const api: OpenApiSpec = { get: { description: `Relayers have full discretion over the orders that they are willing to host on their orderbooks (e.g what fees they charge, etc...). In order for traders to discover their requirements programmatically, they can send an incomplete order to this endpoint and receive the missing fields, specifc to that order. This gives relayers a large amount of flexibility to tailor fees to unique traders, trading pairs and volume amounts. Submit a partial order and receive information required to complete the order: \`senderAddress\`, \`feeRecipientAddress\`, \`makerFee\`, \`takerFee\`. `, operationId: 'getOrderConfig', + parameters: generateParameters([], false), requestBody: { description: 'The fields of a 0x order the relayer may want to decide what configuration to send back.', @@ -276,6 +277,25 @@ export const api: OpenApiSpec = { ), }, }, + '/v2/order': { + post: { + description: `Submit a signed order to the relayer.`, + operationId: 'postOrder', + parameters: generateParameters([], false), + requestBody: { + description: 'A valid signed 0x order based on the schema.', + content: { + 'application/json': { + schema: { + $ref: '#/components/schemas/signedOrderSchema', + }, + example: examples.signedOrder, + }, + }, + }, + responses: generateResponses(), + }, + }, }, components: { schemas: openApiSchemas, -- cgit v1.2.3