tensaikit
Version:
An autonomous DeFi AI Agent Kit on Katana enabling AI agents to plan and execute on-chain financial operations.
23 lines (22 loc) • 909 B
JavaScript
;
Object.defineProperty(exports, "__esModule", { value: true });
exports.fetchLiquidityProviders = void 0;
const errors_1 = require("../../../common/errors");
const utils_1 = require("../../../common/utils");
const utlis_1 = require("../utlis");
/**
* Fetches the list of liquidity providers from the SushiSwap API for the given chain.
*
* @param chainId - The chain ID representing the target blockchain network.
* @returns A promise resolving to the fetched liquidity provider data.
* @throws Throws a formatted error if the API request fails.
*/
const fetchLiquidityProviders = async (chainId) => {
try {
return await (0, utils_1.fetchFromApi)(`${utlis_1.SUSHI_LIQUIDITY_ENDPOINT}/${chainId}`);
}
catch (error) {
throw (0, errors_1.handleError)("Failed to fetch liquidity providers", error);
}
};
exports.fetchLiquidityProviders = fetchLiquidityProviders;