diff --git a/src/index.ts b/src/index.ts index 2395133..8ab31a0 100644 --- a/src/index.ts +++ b/src/index.ts @@ -7,6 +7,7 @@ import { normalizePrice, optInAsset, optOutAsset, + getLockerBoxPrefix, durationToMonths, } from "./utils"; import { SubtopiaClient, SubtopiaRegistryClient } from "./clients"; @@ -18,6 +19,7 @@ export { optInAsset, optOutAsset, durationToMonths, + getLockerBoxPrefix, }; export * from "./interfaces"; diff --git a/src/utils/index.ts b/src/utils/index.ts index c86a578..76a3ff0 100644 --- a/src/utils/index.ts +++ b/src/utils/index.ts @@ -322,6 +322,17 @@ export function calculateLockerCreationMbr(): number { ); } +/** + * Determines the prefix for a locker box based on the provided lockerType. + * + * @param lockerType - The type of locker box. Can be either LockerType.CREATOR or LockerType.USER. + * @returns A buffer representing the prefix for a locker box based on the provided lockerType. + * @throws {Error} If the lockerType is unknown. + * + * @example + * const prefix = getLockerBoxPrefix(LockerType.CREATOR); + * console.log(prefix); // Output: + */ export function getLockerBoxPrefix(lockerType: LockerType): Buffer { if (lockerType === LockerType.CREATOR) { return Buffer.from("cl-");