@hashgraphonline/standards-agent-kit
Version:
A modular SDK for building on-chain autonomous agents using Hashgraph Online Standards, including HCS-10 for agent discovery and communication. https://hol.org
25 lines (24 loc) • 1.02 kB
JavaScript
function getStringProp(obj, key) {
if (!obj || typeof obj !== "object") return void 0;
const val = obj[key];
return typeof val === "string" && val.trim() ? val : void 0;
}
function extractTopicIds(inscription, result) {
const jsonTopicId = inscription?.jsonTopicId || getStringProp(inscription, "json_topic_id");
const imageTopicId = getStringProp(inscription, "topic_id") || getStringProp(inscription, "topicId") || getStringProp(result, "topicId") || getStringProp(result, "topic_id");
return {
jsonTopicId,
topicId: imageTopicId
};
}
function buildInscriptionLinks(ids, network, fileStandard = "1") {
const chosen = ids.jsonTopicId || ids.topicId;
const hrl = chosen ? `hcs://${fileStandard}/${chosen}` : void 0;
const cdnUrl = ids.jsonTopicId ? `https://kiloscribe.com/api/inscription-cdn/${ids.jsonTopicId}?network=${network}` : void 0;
return { hrl, cdnUrl, topicId: chosen };
}
export {
buildInscriptionLinks,
extractTopicIds
};
//# sourceMappingURL=standards-agent-kit.es51.js.map