Skip to content
This repository was archived by the owner on Mar 10, 2025. It is now read-only.

Latest commit

 

History

History
35 lines (18 loc) · 1.21 KB

File metadata and controls

35 lines (18 loc) · 1.21 KB

@ceramic-sdk/events v0.2.1Docs


Ceramic SDK / @ceramic-sdk/events / eventFromString

Function: eventFromString()

eventFromString<Payload>(decoder, value, base?): SignedEvent | Payload

Decodes an event from a string using the specified decoder and base encoding.

Type Parameters

Payload = unknown

Parameters

decoder: Decoder<unknown, Payload>

The decoder to use for unsigned events.

value: string

The string-encoded CAR containing the event.

base?: "base64url" | "base256emoji" | "base64" | "base64pad" | "base64urlpad" | "base58btc" | "base58flickr" | "base36" | "base36upper" | "base32" | "base32upper" | "base32pad" | "base32padupper" | "base32hex" | "base32hexupper" | "base32hexpad" | "base32hexpadupper" | "base32z" | "base16" | "base16upper" | "base10" | "base8" | "base2" | "identity"

The base encoding used (defaults to Base64).

Returns

SignedEvent | Payload

The decoded event, either a SignedEvent or a custom payload.