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

Latest commit

 

History

History
36 lines (20 loc) · 723 Bytes

File metadata and controls

36 lines (20 loc) · 723 Bytes

@ceramic-sdk/events v0.2.1Docs


Ceramic SDK / @ceramic-sdk/events / decodeMultibaseToJSON

Function: decodeMultibaseToJSON()

decodeMultibaseToJSON<T>(value): T

Decodes a multibase-encoded string into a JSON object.

Type Parameters

T = Record<string, unknown>

The expected shape of the returned JSON object (defaults to Record<string, unknown>).

Parameters

value: string

The multibase-encoded string to decode.

Returns

T

The decoded JSON object.

Example

const json = decodeMultibaseToJSON<{ key: string }>('z1a2b3c...');
console.log(json.key); // Output: "value"