Skip to content

Commit cc911a1

Browse files
committed
docs: reorganize
1 parent cd59996 commit cc911a1

File tree

3 files changed

+19
-18
lines changed

3 files changed

+19
-18
lines changed

docs/explanations/platform-protocol-document.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@ Dash Platform Protocol (DPP) defines a set of base fields that must be present i
2727
| $updatedAt | Time (in milliseconds) the document was last updated |
2828

2929
:::{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).
3131
:::
3232

3333
### Data Contract Fields

docs/protocol-ref/data-contract.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -239,7 +239,7 @@ property must be incremented if the contract is updated.
239239

240240
### Data Contract Documents
241241

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.
243243

244244
The following example shows a minimal `documents` object defining a single document (`note`) that has one property (`message`).
245245

docs/reference/data-contracts.md

Lines changed: 17 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -51,7 +51,7 @@ The default values for these configuration options are defined in the [Rust DPP
5151

5252
## Documents
5353

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.
5555

5656
The following example shows a minimal `documents` object defining a single document (`note`) with one property (`message`).
5757

@@ -80,7 +80,7 @@ Documents support the following configuration options to provide flexibility in
8080
| `canBeDeleted` | boolean | If true, documents can be deleted. Default: true. |
8181
| `transferable` | integer | Transferable without a marketplace sell:<br>`0` - Never<br>`1` - Always |
8282
| `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). |
8484

8585
| Security option | Type | Description |
8686
|-----------------|------|-------------|
@@ -104,7 +104,7 @@ Documents support the following configuration options to provide flexibility in
104104
| `canBeDeleted` | boolean | If true, documents can be deleted. Default: true. |
105105
| `transferable` | integer | Transferable without a marketplace sell:<br>`0` - Never<br>`1` - Always |
106106
| `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). |
108108
| `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 |
109109
| `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 |
110110
| [`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
134134

135135
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.
136136

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) |
147+
| Property name characters | Alphanumeric (`A-Z`, `a-z`, `0-9`)<br>Hyphen (`-`) <br>Underscore (`_`) |
148+
137149
#### Assigning property `position`
138150

139151
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 = {
168180
};
169181
```
170182

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) |
181-
| Property name characters | Alphanumeric (`A-Z`, `a-z`, `0-9`)<br>Hyphen (`-`) <br>Underscore (`_`) |
182-
183-
#### Required Properties (Optional)
183+
#### Required Properties
184184

185185
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+
186187
**Example**
187188
The following example (excerpt from the DPNS contract's `domain` document) demonstrates a document that has 6 required fields:
188189

0 commit comments

Comments
 (0)