blub-sdk
Version:
A modular SDK for interacting with the BLUB ecosystem on the Sui blockchain.
27 lines (26 loc) • 837 B
JavaScript
;
Object.defineProperty(exports, "__esModule", { value: true });
exports.getBlubPrice = getBlubPrice;
exports.getSuiPrice = getSuiPrice;
const sdk_ts_1 = require("@7kprotocol/sdk-ts");
const constants_1 = require("../../utils/constants");
/**
* Returns the current BLUB token price in USD.
*/
async function getBlubPrice() {
const price = await (0, sdk_ts_1.getTokenPrice)(constants_1.BLUB_COINTYPE);
if (!price || isNaN(price) || price <= 0) {
throw new Error("❌ Failed to fetch valid BLUB price.");
}
return price;
}
/**
* Returns the current SUI token price in USD.
*/
async function getSuiPrice() {
const price = await (0, sdk_ts_1.getSuiPrice)();
if (!price || isNaN(price) || price <= 0) {
throw new Error("❌ Failed to fetch valid SUI price.");
}
return price;
}