You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: docs/explanations/platform-protocol-document.md
+1-1Lines changed: 1 addition & 1 deletion
Original file line number
Diff line number
Diff line change
@@ -27,7 +27,7 @@ Dash Platform Protocol (DPP) defines a set of base fields that must be present i
27
27
| $updatedAt | Time (in milliseconds) the document was last updated |
28
28
29
29
:::{attention}
30
-
The `$createdAt` and `$updatedAt` fields will only be present in documents that add them to the list of [required properties](../reference/data-contracts.md#required-properties-optional).
30
+
The `$createdAt` and `$updatedAt` fields will only be present in documents that add them to the list of [required properties](../reference/data-contracts.md#required-properties).
Copy file name to clipboardExpand all lines: docs/protocol-ref/data-contract.md
+1-1Lines changed: 1 addition & 1 deletion
Original file line number
Diff line number
Diff line change
@@ -239,7 +239,7 @@ property must be incremented if the contract is updated.
239
239
240
240
### Data Contract Documents
241
241
242
-
The `documents` object defines each type of document required by the data contract. At a minimum, a document must consist of 1 or more properties. Documents may also define [indices](#document-indices) and a list of [required properties](#required-properties-optional). The `additionalProperties` properties keyword must be included as described in the [constraints](#additional-properties) section.
242
+
The `documents` object defines each type of document required by the data contract. At a minimum, a document must consist of 1 or more properties. Documents may also define [indices](#document-indices) and a list of [required properties](#required-properties). The `additionalProperties` properties keyword must be included as described in the [constraints](#additional-properties) section.
243
243
244
244
The following example shows a minimal `documents` object defining a single document (`note`) that has one property (`message`).
Copy file name to clipboardExpand all lines: docs/reference/data-contracts.md
+17-16Lines changed: 17 additions & 16 deletions
Original file line number
Diff line number
Diff line change
@@ -51,7 +51,7 @@ The default values for these configuration options are defined in the [Rust DPP
51
51
52
52
## Documents
53
53
54
-
The `documents` object defines each type of document required by the data contract. At a minimum, a document must consist of 1 or more [properties](#document-properties). Documents may also define [indices](#document-indices) and a list of [required properties](#required-properties-optional). The `additionalProperties` properties keyword must be included as described in the [constraints](#additional-properties) section.
54
+
The `documents` object defines each type of document required by the data contract. At a minimum, a document must consist of 1 or more [properties](#document-properties). Documents may also define [indices](#document-indices) and a list of [required properties](#required-properties). The `additionalProperties` properties keyword must be included as described in the [constraints](#additional-properties) section.
55
55
56
56
The following example shows a minimal `documents` object defining a single document (`note`) with one property (`message`).
57
57
@@ -80,7 +80,7 @@ Documents support the following configuration options to provide flexibility in
80
80
|`canBeDeleted`| boolean | If true, documents can be deleted. Default: true. |
81
81
|`transferable`| integer | Transferable without a marketplace sell:<br>`0` - Never<br>`1` - Always |
82
82
|`tradeMode`| integer | Built-in marketplace system:<br>`0` - None<br>`1` - Direct purchase (the purchaser can buy the item without requiring approval) |
83
-
|`creationRestrictionMode`| integer | Restriction of document creation:`0` - No restrictions<br>`1` - Contract owner only<br>`2` - No creation (System Only). |
83
+
|`creationRestrictionMode`| integer | Restriction of document creation:<br>`0` - No restrictions<br>`1` - Contract owner only<br>`2` - No creation (System Only). |
84
84
85
85
| Security option | Type | Description |
86
86
|-----------------|------|-------------|
@@ -104,7 +104,7 @@ Documents support the following configuration options to provide flexibility in
104
104
|`canBeDeleted`| boolean | If true, documents can be deleted. Default: true. |
105
105
|`transferable`| integer | Transferable without a marketplace sell:<br>`0` - Never<br>`1` - Always |
106
106
|`tradeMode`| integer | Built-in marketplace system:<br>`0` - None<br>`1` - Direct purchase (the purchaser can buy the item without requiring approval) |
107
-
|`creationRestrictionMode`| integer | Restriction of document creation:`0` - No restrictions<br>`1` - Contract owner only<br>`2` - No creation (System Only). |
107
+
|`creationRestrictionMode`| integer | Restriction of document creation:<br>`0` - No restrictions<br>`1` - Contract owner only<br>`2` - No creation (System Only). |
108
108
|`requiresIdentity`<br>`EncryptionBoundedKey`| integer | Key requirements for identity encryption:<br>`0` - Unique non-replaceable<br>`1` - Multiple<br>`2` - Multiple with reference to latest key |
109
109
|`requiresIdentity`<br>`DecryptionBoundedKey`| integer | Key requirements for identity decryption:<br>`0` - Unique non-replaceable<br>`1` - Multiple<br>`2` - Multiple with reference to latest key |
110
110
|[`properties`](#document-properties)| object | Defines the properties of the document. |
@@ -134,6 +134,18 @@ The `properties` object defines each field that a document will use. Each field
134
134
135
135
Fields may also apply a variety of optional JSON Schema constraints related to the format, range, length, etc. of the data. A full explanation of JSON Schema capabilities is beyond the scope of this document. For more information regarding its data types and the constraints that can be applied, please refer to the [JSON Schema reference](https://json-schema.org/understanding-json-schema/reference/index.html) documentation.
136
136
137
+
#### Property Constraints
138
+
139
+
There are a variety of constraints currently defined for performance and security reasons.
140
+
141
+
| Description | Value |
142
+
| ----------- | ----- |
143
+
| Minimum number of properties |[1](https://github.com/dashpay/platform/blob/master/packages/rs-dpp/schema/meta_schemas/document/v0/document-meta.json#L22)|
144
+
| Maximum number of properties |[100](https://github.com/dashpay/platform/blob/master/packages/rs-dpp/schema/meta_schemas/document/v0/document-meta.json#L23)|
145
+
| Minimum property name length |[1](https://github.com/dashpay/platform/blob/master/packages/rs-dpp/schema/meta_schemas/document/v0/document-meta.json#L9)|
146
+
| Maximum property name length |[64](https://github.com/dashpay/platform/blob/master/packages/rs-dpp/schema/meta_schemas/document/v0/document-meta.json#L9)|
Each property in a level must be assigned a unique `position` value, with ordering starting at zero and incrementing with each property. When using nested objects, position counting resets to zero for each level. This structure supports backward compatibility in data contracts by [ensuring consistent ordering](https://github.com/dashpay/platform/pull/1594) for serialization and deserialization processes.
@@ -168,21 +180,10 @@ const contractDocuments = {
168
180
};
169
181
```
170
182
171
-
#### Property Constraints
172
-
173
-
There are a variety of constraints currently defined for performance and security reasons.
174
-
175
-
| Description | Value |
176
-
| ----------- | ----- |
177
-
| Minimum number of properties |[1](https://github.com/dashpay/platform/blob/master/packages/rs-dpp/schema/meta_schemas/document/v0/document-meta.json#L22)|
178
-
| Maximum number of properties |[100](https://github.com/dashpay/platform/blob/master/packages/rs-dpp/schema/meta_schemas/document/v0/document-meta.json#L23)|
179
-
| Minimum property name length |[1](https://github.com/dashpay/platform/blob/master/packages/rs-dpp/schema/meta_schemas/document/v0/document-meta.json#L9)|
180
-
| Maximum property name length |[64](https://github.com/dashpay/platform/blob/master/packages/rs-dpp/schema/meta_schemas/document/v0/document-meta.json#L9)|
Each document may have some fields that are required for the document to be valid and other optional fields. Required fields are defined via the `required` array, which contains a list of the field names that must be present in the document. The `required` object should only be included for documents with at least one required property.
186
+
186
187
**Example**
187
188
The following example (excerpt from the DPNS contract's `domain` document) demonstrates a document that has 6 required fields:
0 commit comments