Query a Single Yield Farm
Within the wallet API, yield farms are identified by a unique numeric ID.
Endpoint
GET https://wallets.nodefinance.org/farms/{id}
Query Parameters
- wallet (optional): A string representing the wallet address to filter the results by.
Response
The response will be a JSON object with the following shape:
{
_type: "SNX" | "LG3";
category: "stable" | "volatile" | "basket";
name: string;
id: number;
depositToken: Token;
receiptToken: Token;
chainId: number;
protocol: number;
apr: number;
totalDeposited: {
amount: number;
valueInLocalCurrency: number;
}
}
Example
Here is an example of how you can query this endpoint using curl:
curl "https://wallets.nodefinance.org/farms/12345?wallet=0x1234567890abcdef"
This will send a GET request to the endpoint with the wallet query parameter set to 0x1234567890abcdef. If the request is successful, the response will be a JSON object with information about the farm with ID 12345 and the specified wallet address.
Error Handling
If the request is unsuccessful, the endpoint will return a JSON object with an error field containing a description of the error. Some possible error messages are:
- Farm not found: The farm with the specified ID does not exist.
- Invalid wallet address: The wallet address provided is not a valid Ethereum address.
- Internal server error: An internal server error occurred while processing the request.
Notes
- The wallet query parameter is optional and can be omitted if you do not want to filter the results by wallet address.
- The depositToken and receiptToken fields contain information about the tokens used for deposits and receipts, respectively. These fields are objects with the following shape:
{
symbol: string;
name: string;
decimals: number;
address: string;
}