Skip to main content
Version: 1.3

Class: MethodData

identity_wasm.MethodData

Supported verification method data formats.

Table of contents

Methods

Methods

toJSON

toJSON(): Object

  • Return copy of self without private attributes.

Returns

Object

toJSON(): any

Serializes this to a JSON object.

Returns

any


toString

toString(): string

Return stringified version of self.

Returns

string


newBase58

Static newBase58(data): MethodData

Creates a new MethodData variant with Base58-BTC encoded content.

Parameters

NameType
dataUint8Array

Returns

MethodData


newMultibase

Static newMultibase(data): MethodData

Creates a new MethodData variant with Multibase-encoded content.

Parameters

NameType
dataUint8Array

Returns

MethodData


newJwk

Static newJwk(key): MethodData

Creates a new MethodData variant consisting of the given key.

Errors

An error is thrown if the given key contains any private components.

Parameters

NameType
keyJwk

Returns

MethodData


newCustom

Static newCustom(name, data): MethodData

Creates a new custom MethodData.

Parameters

NameType
namestring
dataany

Returns

MethodData


tryCustom

tryCustom(): CustomMethodData

Returns the wrapped custom method data format is Custom.

Returns

CustomMethodData


tryDecode

tryDecode(): Uint8Array

Returns a Uint8Array containing the decoded bytes of the MethodData.

This is generally a public key identified by a MethodData value.

Errors

Decoding can fail if MethodData has invalid content or cannot be represented as a vector of bytes.

Returns

Uint8Array


tryPublicKeyJwk

tryPublicKeyJwk(): Jwk

Returns the wrapped Jwk if the format is PublicKeyJwk.

Returns

Jwk


fromJSON

Static fromJSON(json): MethodData

Deserializes an instance from a JSON object.

Parameters

NameType
jsonany

Returns

MethodData


clone

clone(): MethodData

Deep clones the object.

Returns

MethodData