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