diff --git a/bindings/wasm/docs/api-reference.md b/bindings/wasm/docs/api-reference.md index e9e3a65a85..e83bbc81b6 100644 --- a/bindings/wasm/docs/api-reference.md +++ b/bindings/wasm/docs/api-reference.md @@ -187,10 +187,6 @@ working with storage backed DID documents.
## MembersThe holder is not required to have any kind of relationship to any credential subject.
Purpose of a StatusList2021.
+Declares when validation should return if an error occurs.
Return after the first error occurs.
Purpose of a StatusList2021.
-Controls validation behaviour when checking whether or not a credential has been revoked by its
credentialStatus
.
Skip all status checks.
string
Encode the given bytes in url-safe base64.
-Uint8Array
Decode the given url-safe base64-encoded slice into its raw bytes.
+Initializes the console error panic hook for better error messages
Verify a JWS signature secured with the EdDSA
algorithm and curve Ed25519
.
This function does not check whether alg = EdDSA
in the protected header. Callers are expected to assert this
prior to calling the function.
Initializes the console error panic hook for better error messages
+string
Encode the given bytes in url-safe base64.
+Uint8Array
Decode the given url-safe base64-encoded slice into its raw bytes.
IotaDID
](#IotaDID)
* [.controller()](#IotaDocument+controller) ⇒ [Array.<IotaDID>
](#IotaDID)
+ * [.setController(controllers)](#IotaDocument+setController)
* [.alsoKnownAs()](#IotaDocument+alsoKnownAs) ⇒ Array.<string>
* [.setAlsoKnownAs(urls)](#IotaDocument+setAlsoKnownAs)
* [.properties()](#IotaDocument+properties) ⇒ Map.<string, any>
@@ -2039,6 +2040,20 @@ NOTE: controllers are determined by the `state_controller` unlock condition of t
during resolution and are omitted when publishing.
**Kind**: instance method of [IotaDocument
](#IotaDocument)
+
+
+### iotaDocument.setController(controllers)
+Sets the controllers of the document.
+
+Note: Duplicates will be ignored.
+Use `null` to remove all controllers.
+
+**Kind**: instance method of [IotaDocument
](#IotaDocument)
+
+| Param | Type |
+| --- | --- |
+| controllers | [CoreDID
](#CoreDID) \| [Array.<CoreDID>
](#CoreDID) \| null
|
+
### iotaDocument.alsoKnownAs() ⇒ Array.<string>
@@ -6104,14 +6119,6 @@ Deserializes an instance from a JSON object.
| --- | --- |
| json | any
|
-
-
-## StateMetadataEncoding
-**Kind**: global variable
-
-
-## MethodRelationship
-**Kind**: global variable
## CredentialStatus
@@ -6142,6 +6149,12 @@ The holder must match the subject only for credentials where the [`nonTransferab
## Any
The holder is not required to have any kind of relationship to any credential subject.
+**Kind**: global variable
+
+
+## StatusPurpose
+Purpose of a [StatusList2021](#StatusList2021).
+
**Kind**: global variable
@@ -6160,12 +6173,6 @@ Return all errors that occur during validation.
## FirstError
Return after the first error occurs.
-**Kind**: global variable
-
-
-## StatusPurpose
-Purpose of a [StatusList2021](#StatusList2021).
-
**Kind**: global variable
@@ -6198,28 +6205,20 @@ Validate the status if supported, skip any unsupported
Skip all status checks.
**Kind**: global variable
-
-
-## encodeB64(data) ⇒ string
-Encode the given bytes in url-safe base64.
-
-**Kind**: global function
+
-| Param | Type |
-| --- | --- |
-| data | Uint8Array
|
+## StateMetadataEncoding
+**Kind**: global variable
+
-
+## MethodRelationship
+**Kind**: global variable
+
-## decodeB64(data) ⇒ Uint8Array
-Decode the given url-safe base64-encoded slice into its raw bytes.
+## start()
+Initializes the console error panic hook for better error messages
**Kind**: global function
-
-| Param | Type |
-| --- | --- |
-| data | Uint8Array
|
-
## verifyEd25519(alg, signingInput, decodedSignature, publicKey)
@@ -6242,9 +6241,25 @@ prior to calling the function.
| decodedSignature | Uint8Array
|
| publicKey | [Jwk
](#Jwk) |
-
+
-## start()
-Initializes the console error panic hook for better error messages
+## encodeB64(data) ⇒ string
+Encode the given bytes in url-safe base64.
+
+**Kind**: global function
+
+| Param | Type |
+| --- | --- |
+| data | Uint8Array
|
+
+
+
+## decodeB64(data) ⇒ Uint8Array
+Decode the given url-safe base64-encoded slice into its raw bytes.
**Kind**: global function
+
+| Param | Type |
+| --- | --- |
+| data | Uint8Array
|
+
diff --git a/bindings/wasm/src/iota/iota_document.rs b/bindings/wasm/src/iota/iota_document.rs
index 8f8cbe6823..8d004422ad 100644
--- a/bindings/wasm/src/iota/iota_document.rs
+++ b/bindings/wasm/src/iota/iota_document.rs
@@ -5,12 +5,14 @@ use std::rc::Rc;
use identity_iota::core::Object;
use identity_iota::core::OneOrMany;
+
use identity_iota::core::OrderedSet;
use identity_iota::core::Timestamp;
use identity_iota::core::Url;
use identity_iota::credential::Credential;
use identity_iota::credential::JwtPresentationOptions;
use identity_iota::credential::Presentation;
+
use identity_iota::did::DIDUrl;
use identity_iota::iota::block::output::dto::AliasOutputDto;
use identity_iota::iota::block::output::AliasOutput;
@@ -48,6 +50,7 @@ use crate::credential::WasmJws;
use crate::credential::WasmJwt;
use crate::credential::WasmPresentation;
use crate::did::CoreDocumentLock;
+
use crate::did::PromiseJws;
use crate::did::PromiseJwt;
use crate::did::WasmCoreDocument;
@@ -156,6 +159,20 @@ impl WasmIotaDocument {
)
}
+ /// Sets the controllers of the document.
+ ///
+ /// Note: Duplicates will be ignored.
+ /// Use `null` to remove all controllers.
+ #[wasm_bindgen(js_name = setController)]
+ pub fn set_controller(&mut self, controller: &OptionArrayIotaDID) -> Result<()> {
+ let controller: Option