⛏️getRecommendedTokens
Description
The getRecommendedTokens
function retrieves an array of recommended tokens for a specified blockchain by making an HTTP GET request to a server.
If the server returns a successful response, the function returns the recommendedTokens
array from the response data.
In case of an unsuccessful response, the function returns an object with a code
property set to 0 and a msg
property set to the error message from the response data.
Parameters
blockchain
string
The name of the blockchain for which to retrieve recommended tokens
Response
recommendedTokens
array
An array of recommended tokens for the specified blockchain
Example Request and Response
Prerequisites
Before making requests with Nest SDK, you must have it installed.
You can install Nest SDK using either npm
or yarn
. Use the following commands to install Nest SDK:
Request
Here is an example of how to make a getRecommendedTokens
request using the Nest SDK:
Response
Use Cases
Token trading: The
getRecommendedTokens
function can be used by decentralized exchanges to retrieve a list of recommended tokens for a specific blockchain network. This enables users to easily trade a variety of tokens on the decentralized exchange.Token staking: Some blockchain networks allow users to stake their tokens to earn rewards. The
getRecommendedTokens
function can be used to retrieve a list of recommended tokens for staking on a specific blockchain network.Wallet integration: Wallet applications can use the
getRecommendedTokens
function to suggest new tokens to their users for addition to their wallet. This enhances the user experience by providing easy access to popular tokens.
Last updated