aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorfragosti <francesco.agosti93@gmail.com>2018-08-08 07:10:59 +0800
committerfragosti <francesco.agosti93@gmail.com>2018-08-08 07:10:59 +0800
commitf6dbc239958e37a585d3f89b98eb6cd473895335 (patch)
tree5cd42d9904f4c43cef75d1afd3b062554315811e
parentf36a43a83f6c8ae32d36768da8c97858ef051446 (diff)
downloaddexon-0x-contracts-f6dbc239958e37a585d3f89b98eb6cd473895335.tar.gz
dexon-0x-contracts-f6dbc239958e37a585d3f89b98eb6cd473895335.tar.zst
dexon-0x-contracts-f6dbc239958e37a585d3f89b98eb6cd473895335.zip
Add GET order endpoint spec
-rw-r--r--packages/sra-api/src/api.ts27
-rw-r--r--packages/sra-api/src/examples/index.ts2
-rw-r--r--packages/sra-api/src/examples/relayerApiOrder.ts19
3 files changed, 47 insertions, 1 deletions
diff --git a/packages/sra-api/src/api.ts b/packages/sra-api/src/api.ts
index d80fb9b41..2cc15b297 100644
--- a/packages/sra-api/src/api.ts
+++ b/packages/sra-api/src/api.ts
@@ -176,7 +176,32 @@ export const api: OpenApiSpec = {
responses: generateResponses(
'relayerApiOrdersResponseSchema',
examples.relayerApiOrdersResponse,
- `Returns a collection of 0x orders with meta-data as specified by query params`,
+ `A collection of 0x orders with meta-data as specified by query params`,
+ ),
+ },
+ },
+ '/v2/order/{orderHash}': {
+ get: {
+ description: 'Retrieves the 0x order with meta info that is associated with the hash.',
+ operationId: 'getOrder',
+ parameters: generateParameters(
+ [
+ {
+ name: 'orderHash',
+ in: 'path',
+ description: 'The hash of the desired 0x order.',
+ example: '0xd4b103c42d2512eef3fee775e097f044291615d25f5d71e0ac70dbd49d223591',
+ schema: {
+ $ref: '#/components/schemas/orderHashSchema',
+ },
+ },
+ ],
+ true,
+ ),
+ responses: generateResponses(
+ 'relayerApiOrderSchema',
+ examples.relayerApiOrder,
+ `The order and meta info associated with the orderHash`,
),
},
},
diff --git a/packages/sra-api/src/examples/index.ts b/packages/sra-api/src/examples/index.ts
index 0ae8a22a7..d99c0469b 100644
--- a/packages/sra-api/src/examples/index.ts
+++ b/packages/sra-api/src/examples/index.ts
@@ -1,9 +1,11 @@
import { validationError } from './errors';
import { relayerApiAssetDataPairsResponse } from './relayerApiAssetDataPairsResponse';
+import { relayerApiOrder } from './relayerApiOrder';
import { relayerApiOrdersResponse } from './relayerApiOrdersResponse';
export const examples = {
validationError,
relayerApiAssetDataPairsResponse,
+ relayerApiOrder,
relayerApiOrdersResponse,
};
diff --git a/packages/sra-api/src/examples/relayerApiOrder.ts b/packages/sra-api/src/examples/relayerApiOrder.ts
new file mode 100644
index 000000000..31181d677
--- /dev/null
+++ b/packages/sra-api/src/examples/relayerApiOrder.ts
@@ -0,0 +1,19 @@
+export const relayerApiOrder = {
+ order: {
+ makerAddress: '0x9e56625509c2f60af937f23b7b532600390e8c8b',
+ takerAddress: '0xa2b31dacf30a9c50ca473337c01d8a201ae33e32',
+ feeRecipientAddress: '0xb046140686d052fff581f63f8136cce132e857da',
+ senderAddress: '0xa2b31dacf30a9c50ca473337c01d8a201ae33e32',
+ makerAssetAmount: '10000000000000000',
+ takerAssetAmount: '20000000000000000',
+ makerFee: '100000000000000',
+ takerFee: '200000000000000',
+ expirationTimeSeconds: '1532560590',
+ salt: '1532559225',
+ makerAssetData: '0xf47261b04c32345ced77393b3530b1eed0f346429d',
+ takerAssetData: '0x0257179264389b814a946f3e92105513705ca6b990',
+ exchangeAddress: '0x12459c951127e0c374ff9105dda097662a027093',
+ signature: '0x012761a3ed31b43c8780e905a260a35faefcc527be7516aa11c0256729b5b351bc33',
+ },
+ metaData: {},
+};