From 95b656f360f635447725e00bb90642f1b859477a Mon Sep 17 00:00:00 2001 From: fragosti Date: Tue, 7 Aug 2018 17:42:22 -0700 Subject: Add GET fee_recipients --- .../schemas/relayer_api_fee_recipients_response_schema.ts | 13 +++++++++++++ packages/json-schemas/src/schemas.ts | 2 ++ packages/sra-api/src/api.ts | 12 ++++++++++++ packages/sra-api/src/examples/index.ts | 2 ++ .../sra-api/src/examples/relayerApiFeeRecipientsResponse.ts | 10 ++++++++++ 5 files changed, 39 insertions(+) create mode 100644 packages/json-schemas/schemas/relayer_api_fee_recipients_response_schema.ts create mode 100644 packages/sra-api/src/examples/relayerApiFeeRecipientsResponse.ts diff --git a/packages/json-schemas/schemas/relayer_api_fee_recipients_response_schema.ts b/packages/json-schemas/schemas/relayer_api_fee_recipients_response_schema.ts new file mode 100644 index 000000000..84d39eb20 --- /dev/null +++ b/packages/json-schemas/schemas/relayer_api_fee_recipients_response_schema.ts @@ -0,0 +1,13 @@ +export const relayerApiFeeRecipientsResponseSchema = { + id: '/relayerApiFeeRecipientsResponseSchema', + type: 'object', + allOf: [ + { $ref: '/paginatedCollectionSchema' }, + { + properties: { + records: { $ref: '/addressSchema' }, + }, + required: ['records'], + }, + ], +}; diff --git a/packages/json-schemas/src/schemas.ts b/packages/json-schemas/src/schemas.ts index 61614ebde..002a470be 100644 --- a/packages/json-schemas/src/schemas.ts +++ b/packages/json-schemas/src/schemas.ts @@ -16,6 +16,7 @@ import { relayerApiAssetDataTradeInfoSchema, } from '../schemas/relayer_api_asset_pairs_response_schema'; import { relayerApiErrorResponseSchema } from '../schemas/relayer_api_error_response_schema'; +import { relayerApiFeeRecipientsResponseSchema } from '../schemas/relayer_api_fee_recipients_response_schema'; import { relayerApiOrderConfigPayloadSchema } from '../schemas/relayer_api_order_config_payload_schema'; import { relayerApiOrderConfigResponseSchema } from '../schemas/relayer_api_order_config_response_schema'; import { relayerApiOrderSchema } from '../schemas/relayer_api_order_schema'; @@ -54,6 +55,7 @@ export const schemas = { txDataSchema, paginatedCollectionSchema, relayerApiErrorResponseSchema, + relayerApiFeeRecipientsResponseSchema, relayerApiOrderSchema, relayerApiOrdersSchema, relayerApiOrderConfigPayloadSchema, diff --git a/packages/sra-api/src/api.ts b/packages/sra-api/src/api.ts index 129fd3722..50e656599 100644 --- a/packages/sra-api/src/api.ts +++ b/packages/sra-api/src/api.ts @@ -264,6 +264,18 @@ export const api: OpenApiSpec = { ), }, }, + '/v2/fee_recipients': { + get: { + description: `Retrieves a collection of all fee recipient addresses for a relayer. This endpoint should be [paginated](#section/Pagination).`, + operationId: 'getFeeRecipients', + parameters: generateParameters([], true), + responses: generateResponses( + 'relayerApiFeeRecipientsResponseSchema', + examples.relayerApiFeeRecipientsResponse, + `A collection of all used fee recipient addresses.`, + ), + }, + }, }, components: { schemas: openApiSchemas, diff --git a/packages/sra-api/src/examples/index.ts b/packages/sra-api/src/examples/index.ts index 6581b840f..06560f8ad 100644 --- a/packages/sra-api/src/examples/index.ts +++ b/packages/sra-api/src/examples/index.ts @@ -1,5 +1,6 @@ import { validationError } from './errors'; import { relayerApiAssetDataPairsResponse } from './relayerApiAssetDataPairsResponse'; +import { relayerApiFeeRecipientsResponse } from './relayerApiFeeRecipientsResponse'; import { relayerApiOrder } from './relayerApiOrder'; import { relayerApiOrderBookResponse } from './relayerApiOrderBookResponse'; import { relayerApiOrderConfigPayload } from './relayerApiOrderConfigPayload'; @@ -9,6 +10,7 @@ import { relayerApiOrdersResponse } from './relayerApiOrdersResponse'; export const examples = { validationError, relayerApiAssetDataPairsResponse, + relayerApiFeeRecipientsResponse, relayerApiOrder, relayerApiOrderBookResponse, relayerApiOrderConfigPayload, diff --git a/packages/sra-api/src/examples/relayerApiFeeRecipientsResponse.ts b/packages/sra-api/src/examples/relayerApiFeeRecipientsResponse.ts new file mode 100644 index 000000000..0182af629 --- /dev/null +++ b/packages/sra-api/src/examples/relayerApiFeeRecipientsResponse.ts @@ -0,0 +1,10 @@ +export const relayerApiFeeRecipientsResponse = { + total: 3, + page: 1, + perPage: 10, + records: [ + '0x6eC92694ea172ebC430C30fa31De87620967A082', + '0x9e56625509c2f60af937f23b7b532600390e8c8b', + '0xa2b31dacf30a9c50ca473337c01d8a201ae33e32', + ], +}; -- cgit