From 5df183daba17e7cde24454abc103d292eefd4b7a Mon Sep 17 00:00:00 2001 From: Devin Turner <5410284+l1h3r@users.noreply.github.com> Date: Wed, 2 Jun 2021 10:03:41 -0700 Subject: [PATCH] Use u32 for message delays (#281) * Use u32 for message delays * Update docs * Update version --- bindings/wasm/docs/api-reference.md | 137 ++++------------------------ bindings/wasm/package.json | 2 +- bindings/wasm/src/message/timing.rs | 4 +- bindings/wasm/src/wasm_document.rs | 2 +- identity-comm/src/message/timing.rs | 6 +- 5 files changed, 23 insertions(+), 128 deletions(-) diff --git a/bindings/wasm/docs/api-reference.md b/bindings/wasm/docs/api-reference.md index db76e3c6d1..b601e2ae72 100644 --- a/bindings/wasm/docs/api-reference.md +++ b/bindings/wasm/docs/api-reference.md @@ -75,6 +75,9 @@ ## Functions
Initializes the console error panic hook for better error messages
+any
Publishes a DID Document to the Tangle, params looks like { node: "http://localhost:14265", network: "main" }
any
Validates a presentation with the DID Document from the Tangle, params looks like { node: "http://localhost:14265", network: "main" }
Initializes the console error panic hook for better error messages
-string
- * [.context](#AuthenticationRequest+context)
- * [.thread](#AuthenticationRequest+thread) ⇒ string
- * [.thread](#AuthenticationRequest+thread)
- * [.callbackURL](#AuthenticationRequest+callbackURL) ⇒ string
- * [.callbackURL](#AuthenticationRequest+callbackURL)
- * [.challenge](#AuthenticationRequest+challenge) ⇒ string
- * [.challenge](#AuthenticationRequest+challenge)
- * [.responseRequested](#AuthenticationRequest+responseRequested) ⇒ boolean
\| undefined
- * [.responseRequested](#AuthenticationRequest+responseRequested)
- * [.id](#AuthenticationRequest+id) ⇒ [DID
](#DID) \| undefined
- * [.id](#AuthenticationRequest+id)
- * [.timing](#AuthenticationRequest+timing) ⇒ [Timing
](#Timing) \| undefined
- * [.timing](#AuthenticationRequest+timing)
* [.toJSON()](#AuthenticationRequest+toJSON) ⇒ any
* _static_
* [.fromJSON(value)](#AuthenticationRequest.fromJSON) ⇒ [AuthenticationRequest
](#AuthenticationRequest)
-
-
-### authenticationRequest.context ⇒ string
-**Kind**: instance property of [AuthenticationRequest
](#AuthenticationRequest)
-
-
-### authenticationRequest.context
-**Kind**: instance property of [AuthenticationRequest
](#AuthenticationRequest)
-
-| Param | Type |
-| --- | --- |
-| value | string
|
-
-
-
-### authenticationRequest.thread ⇒ string
-**Kind**: instance property of [AuthenticationRequest
](#AuthenticationRequest)
-
-
-### authenticationRequest.thread
-**Kind**: instance property of [AuthenticationRequest
](#AuthenticationRequest)
-
-| Param | Type |
-| --- | --- |
-| value | string
|
-
-
-
-### authenticationRequest.callbackURL ⇒ string
-**Kind**: instance property of [AuthenticationRequest
](#AuthenticationRequest)
-
-
-### authenticationRequest.callbackURL
-**Kind**: instance property of [AuthenticationRequest
](#AuthenticationRequest)
-
-| Param | Type |
-| --- | --- |
-| value | string
|
-
-
-
-### authenticationRequest.challenge ⇒ string
-**Kind**: instance property of [AuthenticationRequest
](#AuthenticationRequest)
-
-
-### authenticationRequest.challenge
-**Kind**: instance property of [AuthenticationRequest
](#AuthenticationRequest)
-
-| Param | Type |
-| --- | --- |
-| value | string
|
-
-
-
-### authenticationRequest.responseRequested ⇒ boolean
\| undefined
-**Kind**: instance property of [AuthenticationRequest
](#AuthenticationRequest)
-
-
-### authenticationRequest.responseRequested
-**Kind**: instance property of [AuthenticationRequest
](#AuthenticationRequest)
-
-| Param | Type |
-| --- | --- |
-| value | boolean
|
-
-
-
-### authenticationRequest.id ⇒ [DID
](#DID) \| undefined
-**Kind**: instance property of [AuthenticationRequest
](#AuthenticationRequest)
-
-
-### authenticationRequest.id
-**Kind**: instance property of [AuthenticationRequest
](#AuthenticationRequest)
-
-| Param | Type |
-| --- | --- |
-| value | string
|
-
-
-
-### authenticationRequest.timing ⇒ [Timing
](#Timing) \| undefined
-**Kind**: instance property of [AuthenticationRequest
](#AuthenticationRequest)
-
-
-### authenticationRequest.timing
-**Kind**: instance property of [AuthenticationRequest
](#AuthenticationRequest)
-
-| Param | Type |
-| --- | --- |
-| value | [Timing
](#Timing) |
-
### authenticationRequest.toJSON() ⇒ any
@@ -531,7 +426,7 @@ Parses a `DID` from the input string.
* [.merge(diff)](#Document+merge)
* [.toJSON()](#Document+toJSON) ⇒ any
* _static_
- * [.fromKeyPair(key)](#Document.fromKeyPair) ⇒ [Document
](#Document)
+ * [.fromKeyPair(key, network)](#Document.fromKeyPair) ⇒ [Document
](#Document)
* [.fromAuthentication(method)](#Document.fromAuthentication) ⇒ [Document
](#Document)
* [.fromJSON(json)](#Document.fromJSON) ⇒ [Document
](#Document)
@@ -724,10 +619,10 @@ Serializes a `Document` object as a JSON object.
**Kind**: instance method of [Document
](#Document)
-### Document.fromKeyPair(key) ⇒ [Document
](#Document)
+### Document.fromKeyPair(key, network) ⇒ [Document
](#Document)
Creates a new DID Document from the given KeyPair and optional network.
-If unspecified, the network defaults to the mainnet.
+If unspecified, network defaults to the mainnet.
**Kind**: static method of [Document
](#Document)
@@ -1189,7 +1084,7 @@ Serializes a `Service` object as a JSON object.
### Service.fromJSON(value) ⇒ [Service
](#Service)
-Deserializes a `Method` object from a JSON object.
+Deserializes a `Service` object from a JSON object.
**Kind**: static method of [Service
](#Service)
@@ -1214,7 +1109,7 @@ Deserializes a `Method` object from a JSON object.
* [.expiresTime](#Timing+expiresTime)
* [.waitUntilTime](#Timing+waitUntilTime) ⇒ string
\| undefined
* [.waitUntilTime](#Timing+waitUntilTime)
- * [.delayMilli](#Timing+delayMilli) ⇒ BigInt
\| undefined
+ * [.delayMilli](#Timing+delayMilli) ⇒ number
\| undefined
* [.delayMilli](#Timing+delayMilli)
* [.toJSON()](#Timing+toJSON) ⇒ any
* _static_
@@ -1287,7 +1182,7 @@ Deserializes a `Method` object from a JSON object.
-### timing.delayMilli ⇒ BigInt
\| undefined
+### timing.delayMilli ⇒ number
\| undefined
**Kind**: instance property of [Timing
](#Timing)
@@ -1296,7 +1191,7 @@ Deserializes a `Method` object from a JSON object.
| Param | Type |
| --- | --- |
-| value | BigInt
|
+| value | number
|
@@ -1555,6 +1450,12 @@ Deserializes a `VerificationMethod` object from a JSON object.
## KeyType
**Kind**: global variable
+
+
+## start()
+Initializes the console error panic hook for better error messages
+
+**Kind**: global function
## publish(document, params) ⇒ any
@@ -1603,9 +1504,3 @@ Validates a presentation with the DID Document from the Tangle, params looks lik
| data | string
|
| params | any
|
-
-
-## start()
-Initializes the console error panic hook for better error messages
-
-**Kind**: global function
diff --git a/bindings/wasm/package.json b/bindings/wasm/package.json
index 503ed752b2..65abec64f9 100644
--- a/bindings/wasm/package.json
+++ b/bindings/wasm/package.json
@@ -1,6 +1,6 @@
{
"name": "@iota/identity-wasm",
- "version": "0.3.1",
+ "version": "0.3.2",
"description": "WASM bindings for IOTA Identity - A Self Sovereign Identity Framework implementing the DID and VC standards from W3C. To be used in Javascript/Typescript",
"repository": {
"type": "git",
diff --git a/bindings/wasm/src/message/timing.rs b/bindings/wasm/src/message/timing.rs
index b0a6a3035e..5f50ab84b4 100644
--- a/bindings/wasm/src/message/timing.rs
+++ b/bindings/wasm/src/message/timing.rs
@@ -64,12 +64,12 @@ impl Timing {
}
#[wasm_bindgen(getter = delayMilli)]
- pub fn delay_milli(&self) -> Option