30 lines
758 B
TypeScript
30 lines
758 B
TypeScript
import type { ClaimKey } from '@coinweb/contract-kit';
|
|
|
|
import { Key } from './constants';
|
|
|
|
/* FirstPart */
|
|
export const createWordFirstPart = () => [Key.WORD];
|
|
|
|
export const createByLetterFirstPart = (letter: string) => [Key.BY_LETTER, letter];
|
|
|
|
export const createSetFirstPart = () => [Key.SET];
|
|
|
|
/* Key */
|
|
export const createWordKey = (id: string) =>
|
|
({
|
|
first_part: createWordFirstPart(),
|
|
second_part: [id],
|
|
}) satisfies ClaimKey;
|
|
|
|
export const createByLetterKey = (letter: string, id: string) =>
|
|
({
|
|
first_part: createByLetterFirstPart(letter),
|
|
second_part: [id],
|
|
}) satisfies ClaimKey;
|
|
|
|
export const createSetKey = (letter: string) =>
|
|
({
|
|
first_part: createSetFirstPart(),
|
|
second_part: [letter],
|
|
}) satisfies ClaimKey;
|