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
Name | Type |
---|---|
data | Uint8Array |
Returns
newMultibase
▸ Static
newMultibase(data
): MethodData
Creates a new MethodData variant with Multibase-encoded content.
Parameters
Name | Type |
---|---|
data | Uint8Array |
Returns
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
Name | Type |
---|---|
key | Jwk |
Returns
newCustom
▸ Static
newCustom(name
, data
): MethodData
Creates a new custom MethodData.
Parameters
Name | Type |
---|---|
name | string |
data | any |
Returns
tryCustom
▸ tryCustom(): CustomMethodData
Returns the wrapped custom method data format is Custom
.
Returns
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
fromJSON
▸ Static
fromJSON(json
): MethodData
Deserializes an instance from a JSON object.
Parameters
Name | Type |
---|---|
json | any |
Returns
clone
▸ clone(): MethodData
Deep clones the object.