From 2180208c48a65daa8bd5adf52b93719aeffd4033 Mon Sep 17 00:00:00 2001 From: vsiskin Date: Tue, 28 May 2024 16:04:28 +0200 Subject: [PATCH 1/5] add set asset prices api to docs --- open_api_spec.yml | 125 ++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 125 insertions(+) diff --git a/open_api_spec.yml b/open_api_spec.yml index 05f23ff..07b74d0 100644 --- a/open_api_spec.yml +++ b/open_api_spec.yml @@ -3612,6 +3612,57 @@ paths: application/json: schema: $ref: "#/components/schemas/RegisterNewAssetRequest" + "/assets/prices/{id}": + post: + operationId: setAssetPrice + summary: Set asset price + description: | + Set asset price for the given asset id. Returns the asset price response. + tags: + - Blockchains & assets + x-readme: + code-samples: + - language: python + code: supportedAssets = fireblocks.set_asset_price(id, currency, price) + name: Fireblocks SDK Python example + - language: javascript + code: const supportedAssets = await fireblocks.setAssetPrice(id, currency, price); + name: Fireblocks SDK Javascript example + parameters: + - name: id + in: path + required: true + description: The ID of the asset + schema: + type: string + example: TST3_ETH + - $ref: "#/components/parameters/X-Idempotency-Key" + requestBody: + content: + application/json: + schema: + $ref: "#/components/schemas/SetAssetPriceRequest" + responses: + "200": + description: Asset price has been set successfully. + content: + application/json: + schema: + $ref: "#/components/schemas/AssetPriceResponse" + "403": + description: | + - Tenant is not allowed to set rate. Error code: 1002. + content: + application/json: + schema: + $ref: "#/components/schemas/AssetPriceForbiddenErrorResponse" + "404": + description: | + - Currency not found. Error code 1001 + content: + application/json: + schema: + $ref: "#/components/schemas/AssetPriceNotFoundErrorResponse" "/estimate_network_fee": get: summary: Estimate the required fee for an asset @@ -9057,6 +9108,80 @@ components: required: - message - code + SetAssetPriceRequest: + type: object + properties: + currency: + type: string + description: Currency (according to ISO 4217 currency codes) + example: 840 + price: + type: string + description: Price in currency + example: 3100 + required: + - currency + - price + AssetPriceResponse: + type: object + properties: + legacyId: + type: string + description: The ID of the asset + example: TST3_ETH + lastUpdateAt: + type: number + description: Time of last price update + example: 1716898542 + currency: + type: number + description: Currency (according to ISO 4217 currency codes) + example: 840 + price: + type: string + description: Price in currency + example: 3500 + source: + type: string + description: Source of the price data + example: PUBLIC + enum: + - PUBLIC + - PRIVATE + required: + - legacyId + - lastUpdateAt + - currency + - price + - source + AssetPriceForbiddenErrorResponse: + type: object + properties: + message: + type: string + description: Forbidden error code + example: Tenant is not allowed to update asset + code: + type: string + description: Error code + example: 3002 + required: + - message + - code + AssetPriceNotFoundErrorResponse: + type: object + properties: + message: + type: string + description: Not found error code + example: Currency not found + code: + type: string + description: Error code + example: 3001 + required: + - message + - code AssetWallet: type: object From 92e7fa4f7f99cb977fc74476cc7addda01fea280 Mon Sep 17 00:00:00 2001 From: vsiskin Date: Mon, 3 Jun 2024 12:36:42 +0200 Subject: [PATCH 2/5] fix param types --- open_api_spec.yml | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/open_api_spec.yml b/open_api_spec.yml index 07b74d0..5bcffd9 100644 --- a/open_api_spec.yml +++ b/open_api_spec.yml @@ -3635,7 +3635,7 @@ paths: description: The ID of the asset schema: type: string - example: TST3_ETH + example: ETH - $ref: "#/components/parameters/X-Idempotency-Key" requestBody: content: @@ -9114,9 +9114,9 @@ components: currency: type: string description: Currency (according to ISO 4217 currency codes) - example: 840 + example: USD price: - type: string + type: number description: Price in currency example: 3100 required: @@ -9128,23 +9128,23 @@ components: legacyId: type: string description: The ID of the asset - example: TST3_ETH + example: ETH lastUpdateAt: type: number description: Time of last price update example: 1716898542 currency: - type: number + type: string description: Currency (according to ISO 4217 currency codes) - example: 840 + example: USD price: - type: string + type: number description: Price in currency example: 3500 source: type: string description: Source of the price data - example: PUBLIC + example: PRIVATE enum: - PUBLIC - PRIVATE From 5b33264fc5419ea3915a1026dda5ce1c7c2e2553 Mon Sep 17 00:00:00 2001 From: vsiskin Date: Thu, 11 Jul 2024 13:07:24 +0200 Subject: [PATCH 3/5] fix error description --- open_api_spec.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/open_api_spec.yml b/open_api_spec.yml index 5bcffd9..333db4f 100644 --- a/open_api_spec.yml +++ b/open_api_spec.yml @@ -9057,7 +9057,7 @@ components: properties: message: type: string - description: Forbidden error code + description: Forbidden error message example: Asset creation quota reached code: type: string @@ -9071,7 +9071,7 @@ components: properties: message: type: string - description: Not found error code + description: Not found error message example: Invalid address, could not get asset information code: type: string From 8316e461f722ea603a4bbdd12804ff238e260017 Mon Sep 17 00:00:00 2001 From: vsiskin Date: Thu, 11 Jul 2024 13:35:19 +0200 Subject: [PATCH 4/5] move api docs to correct file --- api-spec-v2.yaml | 125 ++++++++++++++++++++++++++++++++++++++++++++ open_api_spec.yml | 130 +--------------------------------------------- 2 files changed, 127 insertions(+), 128 deletions(-) diff --git a/api-spec-v2.yaml b/api-spec-v2.yaml index 14da2f9..ff4d47e 100644 --- a/api-spec-v2.yaml +++ b/api-spec-v2.yaml @@ -4288,6 +4288,57 @@ paths: application/json: schema: $ref: '#/components/schemas/RegisterNewAssetRequest' + /assets/prices/{id}: + post: + operationId: setAssetPrice + summary: Set asset price + description: | + Set asset price for the given asset id. Returns the asset price response. + tags: + - Blockchains & Assets + x-readme: + code-samples: + - language: python + code: supportedAssets = fireblocks.set_asset_price(id, currency, price) + name: Fireblocks SDK Python example + - language: javascript + code: const supportedAssets = await fireblocks.setAssetPrice(id, currency, price); + name: Fireblocks SDK Javascript example + parameters: + - name: id + in: path + required: true + description: The ID of the asset + schema: + type: string + example: ETH + - $ref: "#/components/parameters/X-Idempotency-Key" + requestBody: + content: + application/json: + schema: + $ref: "#/components/schemas/SetAssetPriceRequest" + responses: + "200": + description: Asset price has been set successfully. + content: + application/json: + schema: + $ref: "#/components/schemas/AssetPriceResponse" + "403": + description: | + - Tenant is not allowed to set rate. Error code: 1002. + content: + application/json: + schema: + $ref: "#/components/schemas/AssetPriceForbiddenErrorResponse" + "404": + description: | + - Currency not found. Error code 1001 + content: + application/json: + schema: + $ref: "#/components/schemas/AssetPriceNotFoundErrorResponse" /transactions: get: summary: Get transaction history @@ -12691,6 +12742,80 @@ components: required: - message - code + SetAssetPriceRequest: + type: object + properties: + currency: + type: string + description: Currency (according to ISO 4217 currency codes) + example: USD + price: + type: number + description: Price in currency + example: 3100 + required: + - currency + - price + AssetPriceResponse: + type: object + properties: + legacyId: + type: string + description: The ID of the asset + example: ETH + lastUpdateAt: + type: number + description: Time of last price update + example: 1716898542 + currency: + type: string + description: Currency (according to ISO 4217 currency codes) + example: USD + price: + type: number + description: Price in currency + example: 3500 + source: + type: string + description: Source of the price data + example: PRIVATE + enum: + - PUBLIC + - PRIVATE + required: + - legacyId + - lastUpdateAt + - currency + - price + - source + AssetPriceForbiddenErrorResponse: + type: object + properties: + message: + type: string + description: Forbidden error message + example: Tenant is not allowed to update asset + code: + type: string + description: Error code + example: 3002 + required: + - message + - code + AssetPriceNotFoundErrorResponse: + type: object + properties: + message: + type: string + description: Not found error message + example: Currency not found + code: + type: string + description: Error code + example: 3001 + required: + - message + - code TransactionStatus: type: string description: | diff --git a/open_api_spec.yml b/open_api_spec.yml index d220abb..5f028a7 100644 --- a/open_api_spec.yml +++ b/open_api_spec.yml @@ -3623,57 +3623,6 @@ paths: application/json: schema: $ref: "#/components/schemas/RegisterNewAssetRequest" - "/assets/prices/{id}": - post: - operationId: setAssetPrice - summary: Set asset price - description: | - Set asset price for the given asset id. Returns the asset price response. - tags: - - Blockchains & assets - x-readme: - code-samples: - - language: python - code: supportedAssets = fireblocks.set_asset_price(id, currency, price) - name: Fireblocks SDK Python example - - language: javascript - code: const supportedAssets = await fireblocks.setAssetPrice(id, currency, price); - name: Fireblocks SDK Javascript example - parameters: - - name: id - in: path - required: true - description: The ID of the asset - schema: - type: string - example: ETH - - $ref: "#/components/parameters/X-Idempotency-Key" - requestBody: - content: - application/json: - schema: - $ref: "#/components/schemas/SetAssetPriceRequest" - responses: - "200": - description: Asset price has been set successfully. - content: - application/json: - schema: - $ref: "#/components/schemas/AssetPriceResponse" - "403": - description: | - - Tenant is not allowed to set rate. Error code: 1002. - content: - application/json: - schema: - $ref: "#/components/schemas/AssetPriceForbiddenErrorResponse" - "404": - description: | - - Currency not found. Error code 1001 - content: - application/json: - schema: - $ref: "#/components/schemas/AssetPriceNotFoundErrorResponse" "/estimate_network_fee": get: summary: Estimate the required fee for an asset @@ -9072,7 +9021,7 @@ components: properties: message: type: string - description: Forbidden error message + description: Forbidden error code example: Asset creation quota reached code: type: string @@ -9086,7 +9035,7 @@ components: properties: message: type: string - description: Not found error message + description: Not found error code example: Invalid address, could not get asset information code: type: string @@ -9123,81 +9072,6 @@ components: required: - message - code - SetAssetPriceRequest: - type: object - properties: - currency: - type: string - description: Currency (according to ISO 4217 currency codes) - example: USD - price: - type: number - description: Price in currency - example: 3100 - required: - - currency - - price - AssetPriceResponse: - type: object - properties: - legacyId: - type: string - description: The ID of the asset - example: ETH - lastUpdateAt: - type: number - description: Time of last price update - example: 1716898542 - currency: - type: string - description: Currency (according to ISO 4217 currency codes) - example: USD - price: - type: number - description: Price in currency - example: 3500 - source: - type: string - description: Source of the price data - example: PRIVATE - enum: - - PUBLIC - - PRIVATE - required: - - legacyId - - lastUpdateAt - - currency - - price - - source - AssetPriceForbiddenErrorResponse: - type: object - properties: - message: - type: string - description: Forbidden error code - example: Tenant is not allowed to update asset - code: - type: string - description: Error code - example: 3002 - required: - - message - - code - AssetPriceNotFoundErrorResponse: - type: object - properties: - message: - type: string - description: Not found error code - example: Currency not found - code: - type: string - description: Error code - example: 3001 - required: - - message - - code - AssetWallet: type: object properties: From bd138a5120e8b83be4180813b21fb5e510f52c5f Mon Sep 17 00:00:00 2001 From: vsiskin Date: Thu, 11 Jul 2024 13:37:08 +0200 Subject: [PATCH 5/5] add empty line --- open_api_spec.yml | 1 + 1 file changed, 1 insertion(+) diff --git a/open_api_spec.yml b/open_api_spec.yml index 5f028a7..04bf374 100644 --- a/open_api_spec.yml +++ b/open_api_spec.yml @@ -9072,6 +9072,7 @@ components: required: - message - code + AssetWallet: type: object properties: