Skip to content

Commit

Permalink
chore: exporting missing helper util
Browse files Browse the repository at this point in the history
  • Loading branch information
aorumbayev committed Oct 23, 2023
1 parent dbdbc3a commit b91b102
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 0 deletions.
2 changes: 2 additions & 0 deletions src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ import {
normalizePrice,
optInAsset,
optOutAsset,
getLockerBoxPrefix,
durationToMonths,
} from "./utils";
import { SubtopiaClient, SubtopiaRegistryClient } from "./clients";
Expand All @@ -18,6 +19,7 @@ export {
optInAsset,
optOutAsset,
durationToMonths,
getLockerBoxPrefix,
};

export * from "./interfaces";
Expand Down
11 changes: 11 additions & 0 deletions src/utils/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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: <Buffer 63 6c 2d>
*/
export function getLockerBoxPrefix(lockerType: LockerType): Buffer {
if (lockerType === LockerType.CREATOR) {
return Buffer.from("cl-");
Expand Down

0 comments on commit b91b102

Please sign in to comment.