Skip to content

Latest commit

 

History

History
63 lines (48 loc) · 2.06 KB

File metadata and controls

63 lines (48 loc) · 2.06 KB

Purpose

Retrieve the fee required for creating a token based on the token amount and decimals.

Request Description

  • Method: GET
  • URL: /tokens/fee

Request Parameters

Parameter Required Location Data Type Constraints Description
token_amount Yes Query Integer Positive value The total supply of tokens
decimals Yes Query Integer 0-8 The number of decimals for the token

Example Request

GET /tokens/fee?token_amount=1000&decimals=2

Response Parameters

Successful Response

  • HTTP Status Code: 200 OK
Parameter Required Data Type Description
fee Yes Integer The fee for creating the token

Example Successful Response

{
  "fee": 10
}

Error Response

Common Error Response Structure

Parameter Required Data Type Description
error Yes String Error code
message Yes String Error description

Error Codes

Error Code HTTP Status Code Error Description
VALIDATION_FAILED 400 Bad Request Invalid decimals value
VALIDATION_FAILED 400 Bad Request Invalid amount value

Example Error Response

{
  "error": "VALIDATION_FAILED",
  "message": "invalid decimals value"
}

Workflow

  1. The user sends a request specifying the token amount and decimals.
  2. The server calculates the fee and returns it.
  3. If the request is invalid (e.g., incorrect decimals or amount), the server returns an error.