aboutsummaryrefslogtreecommitdiffstats
path: root/packages/sra-api
diff options
context:
space:
mode:
authorfragosti <francesco.agosti93@gmail.com>2018-08-08 07:51:47 +0800
committerfragosti <francesco.agosti93@gmail.com>2018-08-08 07:52:34 +0800
commitb0a7db81cb2bde774f410938578476200d1dc694 (patch)
tree18a9fb425050938b47f1d2b8d618d81b73f46745 /packages/sra-api
parente6c91493f2f99dea2e7e0ef6aa1365552f100fa4 (diff)
downloaddexon-0x-contracts-b0a7db81cb2bde774f410938578476200d1dc694.tar.gz
dexon-0x-contracts-b0a7db81cb2bde774f410938578476200d1dc694.tar.zst
dexon-0x-contracts-b0a7db81cb2bde774f410938578476200d1dc694.zip
Add GET order_config
Diffstat (limited to 'packages/sra-api')
-rw-r--r--packages/sra-api/src/api.ts23
-rw-r--r--packages/sra-api/src/examples/index.ts4
-rw-r--r--packages/sra-api/src/examples/relayerApiOrderConfig0
-rw-r--r--packages/sra-api/src/examples/relayerApiOrderConfigPayload.ts10
-rw-r--r--packages/sra-api/src/examples/relayerApiOrderConfigResponse.ts6
5 files changed, 43 insertions, 0 deletions
diff --git a/packages/sra-api/src/api.ts b/packages/sra-api/src/api.ts
index 5289a31f3..129fd3722 100644
--- a/packages/sra-api/src/api.ts
+++ b/packages/sra-api/src/api.ts
@@ -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,
diff --git a/packages/sra-api/src/examples/index.ts b/packages/sra-api/src/examples/index.ts
index 51d979fe4..6581b840f 100644
--- a/packages/sra-api/src/examples/index.ts
+++ b/packages/sra-api/src/examples/index.ts
@@ -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,
};
diff --git a/packages/sra-api/src/examples/relayerApiOrderConfig b/packages/sra-api/src/examples/relayerApiOrderConfig
new file mode 100644
index 000000000..e69de29bb
--- /dev/null
+++ b/packages/sra-api/src/examples/relayerApiOrderConfig
diff --git a/packages/sra-api/src/examples/relayerApiOrderConfigPayload.ts b/packages/sra-api/src/examples/relayerApiOrderConfigPayload.ts
new file mode 100644
index 000000000..5251d5b4d
--- /dev/null
+++ b/packages/sra-api/src/examples/relayerApiOrderConfigPayload.ts
@@ -0,0 +1,10 @@
+export const relayerApiOrderConfigPayload = {
+ makerAddress: '0x9e56625509c2f60af937f23b7b532600390e8c8b',
+ takerAddress: '0xa2b31dacf30a9c50ca473337c01d8a201ae33e32',
+ makerAssetAmount: '10000000000000000',
+ takerAssetAmount: '20000000000000000',
+ makerAssetData: '0xf47261b04c32345ced77393b3530b1eed0f346429d',
+ takerAssetData: '0x0257179264389b814a946f3e92105513705ca6b990',
+ exchangeAddress: '0x12459c951127e0c374ff9105dda097662a027093',
+ expirationTimeSeconds: '1532560590',
+};
diff --git a/packages/sra-api/src/examples/relayerApiOrderConfigResponse.ts b/packages/sra-api/src/examples/relayerApiOrderConfigResponse.ts
new file mode 100644
index 000000000..a3c531c0a
--- /dev/null
+++ b/packages/sra-api/src/examples/relayerApiOrderConfigResponse.ts
@@ -0,0 +1,6 @@
+export const relayerApiOrderConfigResponse = {
+ senderAddress: '0xa2b31dacf30a9c50ca473337c01d8a201ae33e32',
+ feeRecipientAddress: '0xb046140686d052fff581f63f8136cce132e857da',
+ makerFee: '100000000000000',
+ takerFee: '200000000000000',
+};