Constructor
new DockDidOrDidMethodKey()
Members
asDid
Extracts raw underlying value if it's `did:dock:*`, throws an error otherwise.
asDidMethodKey
Extracts raw underlying value if it's `did:key:*`, throws an error otherwise.
DidMethodKey :Class.<this>
Type:
- Class.<this>
DockDid :Class.<this>
Type:
- Class.<this>
isDid
Returns `true` if the underlying value is a `did:dock:*`.
isDidMethodKey
Returns `true` if the underlying value is a `did:key:* `.
Qualifier :string
Prefix to form the fully qualified string.
Type:
- string
Methods
(static) from(did) → {DockDid|DidMethodKey}
Attempts to parse provided DID as an object or string.
Parameters:
Name | Type | Description |
---|---|---|
did |
string | DockDid | DidMethodKey | object |
Returns:
- Type
- DockDid | DidMethodKey
(static) fromQualifiedString(did) → {DockDid|DidMethodKey}
Instantiates `DockDid` or `DidMethodKey` from a fully qualified did string.
Parameters:
Name | Type | Description |
---|---|---|
did |
string | fully qualified `dock:did: |
Returns:
- Type
- DockDid | DidMethodKey
(static) fromString(did) → {DockDid|DidMethodKey}
Instantiates `DockDid` or `DidMethodKey` from a fully qualified did string or a raw hex did.
Parameters:
Name | Type | Description |
---|---|---|
did |
string | fully qualified `dock:did: |
Returns:
- Type
- DockDid | DidMethodKey
(static) fromSubstrateValue(did) → {DockDid|DidMethodKey}
Instantiates `DockDid` or `DidMethodKey` from a did or did method key object received from the substrate side.
Parameters:
Name | Type | Description |
---|---|---|
did |
object | substrate did or did method key |
Returns:
- Type
- DockDid | DidMethodKey
changeState(api, method, name, payload, keyRef)
Creates a transaction that will modify the chain state.
Parameters:
Name | Type | Description |
---|---|---|
api |
||
method |
||
name |
||
payload |
||
keyRef |
signStateChange(api, name, payload, keyRef) → {object}
Creates signature for the state change with supplied arguments.
Parameters:
Name | Type | Description |
---|---|---|
api |
||
name |
||
payload |
||
keyRef |
Returns:
- Type
- object
toEncodedString()
Returns underlying value encoded according to the specification.
toJSON()
Converts underlying object to the `JSON` representation suitable for substrate JSON-RPC.
toQualifiedEncodedString()
Returns fully qualified `did:dock:*` encoded in SS58 or `did:key:*` encoded in BS58.