Add GET order_config

This commit is contained in:
fragosti
2018-08-07 16:51:47 -07:00
parent e6c91493f2
commit b0a7db81cb
5 changed files with 43 additions and 0 deletions

View File

@@ -241,6 +241,29 @@ export const api: OpenApiSpec = {
),
},
},
'/v2/order_config': {
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',
requestBody: {
description:
'The fields of a 0x order the relayer may want to decide what configuration to send back.',
content: {
'application/json': {
schema: {
$ref: '#/components/schemas/relayerApiOrderConfigPayloadSchema',
},
example: examples.relayerApiOrderConfigPayload,
},
},
},
responses: generateResponses(
'relayerApiOrderConfigResponseSchema',
examples.relayerApiOrderConfigResponse,
`The additional fields necessary in order to submit an order to the relayer.`,
),
},
},
},
components: {
schemas: openApiSchemas,

View File

@@ -2,6 +2,8 @@ import { validationError } from './errors';
import { relayerApiAssetDataPairsResponse } from './relayerApiAssetDataPairsResponse';
import { relayerApiOrder } from './relayerApiOrder';
import { relayerApiOrderBookResponse } from './relayerApiOrderBookResponse';
import { relayerApiOrderConfigPayload } from './relayerApiOrderConfigPayload';
import { relayerApiOrderConfigResponse } from './relayerApiOrderConfigResponse';
import { relayerApiOrdersResponse } from './relayerApiOrdersResponse';
export const examples = {
@@ -9,5 +11,7 @@ export const examples = {
relayerApiAssetDataPairsResponse,
relayerApiOrder,
relayerApiOrderBookResponse,
relayerApiOrderConfigPayload,
relayerApiOrderConfigResponse,
relayerApiOrdersResponse,
};

View File

@@ -0,0 +1,10 @@
export const relayerApiOrderConfigPayload = {
makerAddress: '0x9e56625509c2f60af937f23b7b532600390e8c8b',
takerAddress: '0xa2b31dacf30a9c50ca473337c01d8a201ae33e32',
makerAssetAmount: '10000000000000000',
takerAssetAmount: '20000000000000000',
makerAssetData: '0xf47261b04c32345ced77393b3530b1eed0f346429d',
takerAssetData: '0x0257179264389b814a946f3e92105513705ca6b990',
exchangeAddress: '0x12459c951127e0c374ff9105dda097662a027093',
expirationTimeSeconds: '1532560590',
};

View File

@@ -0,0 +1,6 @@
export const relayerApiOrderConfigResponse = {
senderAddress: '0xa2b31dacf30a9c50ca473337c01d8a201ae33e32',
feeRecipientAddress: '0xb046140686d052fff581f63f8136cce132e857da',
makerFee: '100000000000000',
takerFee: '200000000000000',
};