Token

Token Form requires basic details such as issuer name, issuer email, website, including token addess(required for Blocksscan API) and data api field.

Data API field

The Data API on Token Form is required as investment capacity of the token is expected, while rewards consists of object of rate and reward token, in case reward is not available then pass empty object.

GET https://api.myapi.com/get-rewards-details-by-token-address/:token-address

Gets investment capacity and rewards from the token address

Request Body

NameTypeDescription

rewards*

Object

Object containing rate and reward token

investment_capacity*

float/int

Investment Capacity for the token

rate

Float

APY rate of reward token

reward_token

String

Reward token name

Example

{
    "investment_capacity": 100000,
    "reward": [
        {
            "reward_rate": 0.2,
            "reward_token": "stable fiat/WSP"
        }
    ]
}

Blocksscan Api's rendered from token address provided in the Token Form.

Please check that API are rendering data properly, else validation error is thrown.

To fetch the token symbol, price and total supply

GET https://xdc.blocksscan.io/api/tokens/token_address

You can check your api data from blockscsan https://xdc.blocksscan.io/docs/#/Tokens/get_api_tokens__hash_

Request Body

NameTypeDescription

symbol*

float

The token symbol

totalSupplyNumber*

String

The total supply of the token

priceUSD*

float

The price of token in USD

CoinGeko ID feild

Provide the string id of the token available on coinGecko. This API is to fetch the price history of the token from the range of token launched till upto date. The API is called on platform, hence user is only expected to provide valid CoinGecko ID. Please check below if the API are rendering data properly.

GET https://api.coingecko.com/api/v3/coins/${coingecko_id}/market_chart/range?vs_currency=usd&from=${startDate}&to=${today}

https://www.coingecko.com/en/api/documentation

Headers

NameTypeDescription

id*

String

token id aailable on Coingecko

from*

String

From date in UNIX timestamp

to*

String

to date in UNIX timestamp

vs_currency*

String

The target currency of the market data. In Tradefinex it is always set to USD

Price API field

When Token Form is submitted, blocksscan api is called using the provided token address and stored in database. Incase, price is not fetched from Blocksscan, user is required to submit a separate API, as shown below in Price API field in request Token form.

GET https://api.myapi.com/get-token-details-by-token-address/:token-address

Gets price from the token address

All parameters are required, send 0 incase if it is Not Applicable

Request Body

NameTypeDescription

priceUSD*

float/int

The token price in USD

{
    "priceUSD":150000
}

Last updated