From d3b1fbfd558999016c72b5d30e4e7d6844eb2c44 Mon Sep 17 00:00:00 2001 From: David Garcia Date: Mon, 9 Mar 2020 16:53:19 +0000 Subject: [PATCH] Proposal rental fees endpoint (#88) * Added rental fees endpoint * Changed multipliers to integer --- spec/core/network/routes/getNetworkFees.yml | 14 -------------- spec/core/network/routes/getRentalFees.yml | 17 +++++++++++++++++ .../core/network/routes/getTransactionFees.yml | 14 ++++++++++++++ spec/core/network/schemas/RentalFeesDTO.yml | 18 ++++++++++++++++++ ...tworkFeesDTO.yml => TransactionFeesDTO.yml} | 6 ++---- spec/parameters/limit.yml | 2 +- spec/routes.yml | 7 +++++-- spec/schemas/_index.yml | 6 ++++-- 8 files changed, 61 insertions(+), 23 deletions(-) delete mode 100644 spec/core/network/routes/getNetworkFees.yml create mode 100644 spec/core/network/routes/getRentalFees.yml create mode 100644 spec/core/network/routes/getTransactionFees.yml create mode 100644 spec/core/network/schemas/RentalFeesDTO.yml rename spec/core/network/schemas/{NetworkFeesDTO.yml => TransactionFeesDTO.yml} (91%) diff --git a/spec/core/network/routes/getNetworkFees.yml b/spec/core/network/routes/getNetworkFees.yml deleted file mode 100644 index 277c26d4..00000000 --- a/spec/core/network/routes/getNetworkFees.yml +++ /dev/null @@ -1,14 +0,0 @@ -tags: - - Network routes -summary: Get transaction fees information -description: | - Returns information about the average, median, highest and lower fee multiplier over the last "numBlocksTransactionFeeStats". - The setting "numBlocksTransactionFeeStats" is adjustable via a configuration file (rest/resources/rest.json) per REST instance. -operationId: getNetworkFees -responses: - "200": - description: success - content: - application/json: - schema: - $ref: "../schemas/NetworkFeesDTO.yml" diff --git a/spec/core/network/routes/getRentalFees.yml b/spec/core/network/routes/getRentalFees.yml new file mode 100644 index 00000000..827f7eac --- /dev/null +++ b/spec/core/network/routes/getRentalFees.yml @@ -0,0 +1,17 @@ +tags: + - Network routes +summary: Get rental fees information +description: | + Returns the estimated effective rental fees for namespaces and mosaics. + This endpoint is only available if the REST instance has access to catapult-server ``resources/config-network.properties`` file. + To activate this feature, add the setting "network.propertiesFilePath" in the configuration file (rest/resources/rest.json). +operationId: getRentalFees +responses: + "200": + description: success + content: + application/json: + schema: + $ref: "../schemas/RentalFeesDTO.yml" + "409": + $ref: "../../../responses/InvalidArgument.yml" diff --git a/spec/core/network/routes/getTransactionFees.yml b/spec/core/network/routes/getTransactionFees.yml new file mode 100644 index 00000000..fd3950c0 --- /dev/null +++ b/spec/core/network/routes/getTransactionFees.yml @@ -0,0 +1,14 @@ +tags: + - Network routes +summary: Get transaction fees information +description: | + Returns the average, median, highest and lower fee multiplier over the last "numBlocksTransactionFeeStats". + The setting "numBlocksTransactionFeeStats" is adjustable via the configuration file (rest/resources/rest.json) per REST instance. +operationId: getTransactionFees +responses: + "200": + description: success + content: + application/json: + schema: + $ref: "../schemas/TransactionFeesDTO.yml" diff --git a/spec/core/network/schemas/RentalFeesDTO.yml b/spec/core/network/schemas/RentalFeesDTO.yml new file mode 100644 index 00000000..b4b2afb7 --- /dev/null +++ b/spec/core/network/schemas/RentalFeesDTO.yml @@ -0,0 +1,18 @@ +type: object +required: + - effectiveRootNamespaceRentalFeePerBlock + - effectiveChildNamespaceRentalFee + - effectiveMosaicRentalFee +properties: + effectiveRootNamespaceRentalFeePerBlock: + $ref: "../../../schemas/Amount.yml" + description: Estimated effective rental fee to register/extend a namespace per block. + example: 0 + effectiveChildNamespaceRentalFee: + $ref: "../../../schemas/Amount.yml" + description: Estimated effective rental fee to create a subnamespace. + example: 0 + effectiveMosaicRentalFee: + $ref: "../../../schemas/Amount.yml" + description: Estimated effective rental fee to create a mosaic. + example: 0 diff --git a/spec/core/network/schemas/NetworkFeesDTO.yml b/spec/core/network/schemas/TransactionFeesDTO.yml similarity index 91% rename from spec/core/network/schemas/NetworkFeesDTO.yml rename to spec/core/network/schemas/TransactionFeesDTO.yml index 481ba79a..1ad1b7d2 100644 --- a/spec/core/network/schemas/NetworkFeesDTO.yml +++ b/spec/core/network/schemas/TransactionFeesDTO.yml @@ -6,13 +6,11 @@ required: - lowestFeeMultiplier properties: averageFeeMultiplier: - type: number - format: double + type: integer description: Average fee multiplier over the last "numBlocksTransactionFeeStats". example: 1 medianFeeMultiplier: - type: number - format: double + type: integer description: Median fee multiplier over the last "numBlocksTransactionFeeStats". example: 1 highestFeeMultiplier: diff --git a/spec/parameters/limit.yml b/spec/parameters/limit.yml index f8679a34..96e71b25 100644 --- a/spec/parameters/limit.yml +++ b/spec/parameters/limit.yml @@ -3,7 +3,7 @@ in: path description: | Number of elements to be returned. The limit should be greater than or equal to "db.pageSizeMin" and not higher than "db.pageSizeMax". - The settings are adjustable via a configuration file (rest/resources/rest.json) per REST instance. + The settings are adjustable via the configuration file (rest/resources/rest.json) per REST instance. required: true schema: type: integer diff --git a/spec/routes.yml b/spec/routes.yml index 07c33e9b..98d5b22a 100644 --- a/spec/routes.yml +++ b/spec/routes.yml @@ -47,9 +47,12 @@ /network: get: $ref: "./core/network/routes/getNetworkType.yml" -/network/fees: +/network/fees/rental: get: - $ref: "./core/network/routes/getNetworkFees.yml" + $ref: "./core/network/routes/getRentalFees.yml" +/network/fees/transaction: + get: + $ref: "./core/network/routes/getTransactionFees.yml" /network/properties: get: diff --git a/spec/schemas/_index.yml b/spec/schemas/_index.yml index 1f897ed4..85cf6423 100644 --- a/spec/schemas/_index.yml +++ b/spec/schemas/_index.yml @@ -77,10 +77,12 @@ HeightInfoDTO: "$ref": "../core/chain/schemas/HeightInfoDTO.yml" # Core - Entity +RentalFeesDTO: + "$ref": "../core/network/schemas/RentalFeesDTO.yml" +TransactionFeesDTO: + "$ref": "../core/network/schemas/TransactionFeesDTO.yml" NetworkTypeEnum: "$ref": "../core/entity/schemas/NetworkTypeEnum.yml" -NetworkFeesDTO: - "$ref": "../core/network/schemas/NetworkFeesDTO.yml" EntityDTO: "$ref": "../core/entity/schemas/EntityDTO.yml" VerifiableEntityDTO: