@hashgraphonline/conversational-agent
Version:
Hashgraph Online conversational AI agent implementing HCS-10 communication, HCS-2 registries, and content inscription on Hedera. https://hol.org
26 lines (25 loc) • 673 B
JavaScript
import { EntityFormat } from "./index27.js";
class TopicIdToHrlConverter {
constructor() {
this.sourceFormat = EntityFormat.TOPIC_ID;
this.targetFormat = EntityFormat.HRL;
}
/**
* Check if the source string is a valid topic ID
*/
canConvert(source, _context) {
return /^0\.0\.\d+$/.test(source);
}
/**
* Convert topic ID to HRL format based on network type
*/
async convert(topicId, context) {
const networkType = context.networkType || "testnet";
const networkId = networkType === "mainnet" ? "0" : "1";
return `hcs://${networkId}/${topicId}`;
}
}
export {
TopicIdToHrlConverter
};
//# sourceMappingURL=index28.js.map