@lighthouse-web3/sdk
Version:
NPM package and CLI tool to interact with lighthouse protocol
17 lines (16 loc) • 604 B
JavaScript
;
Object.defineProperty(exports, "__esModule", { value: true });
const lighthouse_config_1 = require("../../lighthouse.config");
exports.default = async (cid) => {
try {
const response = await fetch(`${lighthouse_config_1.lighthouseConfig.lighthouseAPI}/api/lighthouse/deal_status?cid=${cid}`);
if (!response.ok) {
throw new Error(`Request failed with status code ${response.status}`);
}
const dealStatus = (await response.json());
return { data: dealStatus };
}
catch (error) {
throw new Error(error.message);
}
};