@accret/bridge-sdk
Version:
20 lines • 860 B
JavaScript
;
var __importDefault = (this && this.__importDefault) || function (mod) {
return (mod && mod.__esModule) ? mod : { "default": mod };
};
Object.defineProperty(exports, "__esModule", { value: true });
exports.getTokenList = getTokenList;
const axios_1 = __importDefault(require("axios"));
/**
* @description Fetches the token list for a specific Mayan chain
* @param ChainName - The name of the chain for which to fetch the token list
* @returns A promise that resolves to the token list response
*/
async function getTokenList(ChainName) {
const response = await axios_1.default.get(`https://price-api.mayan.finance/v3/tokens?chain=${ChainName}`);
if (response.status !== 200) {
throw new Error(`Failed to fetch token list: ${response.statusText}`);
}
return response.data;
}
//# sourceMappingURL=getTokenList.js.map