Skip to main content

Class: SimpleTokenizer

Simple Tokenizer client for calling the Simple Tokenizer Backend running in your express app. Does not interoperate with the rest of LunaSec's modules, just a bare bones implementation of tokenization.

Constructors

constructor

โ€ข new SimpleTokenizer(config)

Parameters

NameTypeDescription
configSimpleTokenizerClientConfigA configuration object. You most likely only want to use the host parameter to point to your express backend.

Defined in

simple-tokenizer.ts:37

Methods

tokenize

โ–ธ tokenize(input): SuccessOrFailOutput<TokenizerTokenizeResponse>

Parameters

NameType
inputstring | Buffer

Returns

SuccessOrFailOutput<TokenizerTokenizeResponse>

Defined in

simple-tokenizer.ts:45


detokenize

โ–ธ detokenize(tokenId): SuccessOrFailOutput<TokenizerDetokenizeResponse>

Parameters

NameType
tokenIdstring

Returns

SuccessOrFailOutput<TokenizerDetokenizeResponse>

Defined in

simple-tokenizer.ts:49