From 9120be279b2e6defa1105edf2a0a74d3afc59b38 Mon Sep 17 00:00:00 2001 From: thephez Date: Thu, 17 Aug 2023 13:44:53 -0400 Subject: [PATCH] fix: correct some json formatting --- .../dapi-endpoints-core-grpc-endpoints.md | 8 +- .../dapi-endpoints-platform-endpoints.md | 310 +++++++++--------- .../register-a-data-contract.md | 26 +- .../retrieve-documents.md | 16 +- .../identities-and-names/retrieve-a-name.md | 26 +- .../retrieve-an-accounts-identities.md | 8 +- 6 files changed, 197 insertions(+), 197 deletions(-) diff --git a/docs/reference/dapi-endpoints-core-grpc-endpoints.md b/docs/reference/dapi-endpoints-core-grpc-endpoints.md index d153fec27..2db204d3b 100644 --- a/docs/reference/dapi-endpoints-core-grpc-endpoints.md +++ b/docs/reference/dapi-endpoints-core-grpc-endpoints.md @@ -53,7 +53,7 @@ corePromiseClient.client.broadcastTransaction({ transaction: tx.toBuffer() }) ```json { - transactionId: '552eaf24a60014edcbbb253dbc4dd68766532cab3854b44face051cedcfd578f' + "transactionId": "552eaf24a60014edcbbb253dbc4dd68766532cab3854b44face051cedcfd578f" } ``` @@ -119,15 +119,15 @@ grpcurl -proto protos/core/v0/core.proto \ "name":"test", "headersCount":892412, "blocksCount":892412, - "bestBlockHash":, + "bestBlockHash":"", "difficulty":0.003254173843543036, - "chainWork":, + "chainWork":"", "isSynced":true, "syncProgress":0.9999992137956843 }, "masternode":{ "status":"READY", - "proTxHash":, + "proTxHash":"", "posePenalty":0, "isSynced":true, "syncProgress":1 diff --git a/docs/reference/dapi-endpoints-platform-endpoints.md b/docs/reference/dapi-endpoints-platform-endpoints.md index 4993737df..5f3fa4947 100644 --- a/docs/reference/dapi-endpoints-platform-endpoints.md +++ b/docs/reference/dapi-endpoints-platform-endpoints.md @@ -122,25 +122,25 @@ grpcurl -proto protos/platform/v0/platform.proto \ ```json Response (JavaScript) { - id: , - balance: 5255234422, - revision: 0, - publicKeys: [ + "id": "", + "balance": 5255234422, + "revision": 0, + "publicKeys": [ { - id: 0, - data: , - type: 0, - purpose: 0, - readOnly: false, - securityLevel: 0 + "id": 0, + "data": "", + "type": 0, + "purpose": 0, + "readOnly": false, + "securityLevel": 0 }, { - id: 1, - data: , - type: 0, - purpose: 0, - readOnly: false, - securityLevel: 2 + "id": 1, + "data": "", + "type": 0, + "purpose": 0, + "readOnly": false, + "securityLevel": 2 } ] } @@ -177,12 +177,12 @@ grpcurl -proto protos/platform/v0/platform.proto \ > > ```json > { -> id: 0, -> type: 0, -> purpose: 0, -> securityLevel: 0, -> data: 'A2GTAJk9eAWkMXVCb+rRKXH99POtR5OaW6zqZl7/yozp', -> readOnly: false +> "id": 0, +> "type": 0, +> "purpose": 0, +> "securityLevel": 0, +> "data": "A2GTAJk9eAWkMXVCb+rRKXH99POtR5OaW6zqZl7/yozp", +> "readOnly": false > } > ``` > @@ -248,28 +248,28 @@ grpcurl -proto protos/platform/v0/platform.proto \ ```json Response (JavaScript) { - protocolVersion: 1, - id: '4EfA9Jrvv3nnCFdSf7fad59851iiTRZ6Wcu6YVJ4iSeF', - publicKeys: [ + "protocolVersion": 1, + "id": "4EfA9Jrvv3nnCFdSf7fad59851iiTRZ6Wcu6YVJ4iSeF", + "publicKeys": [ { - id: 0, - type: 0, - purpose: 0, - securityLevel: 0, - data: 'Asi0dHtSjKxf3femzGNwLuBO19EzKQTghRA0PqANzlRq', - readOnly: false + "id": 0, + "type": 0, + "purpose": 0, + "securityLevel": 0, + "data": "Asi0dHtSjKxf3femzGNwLuBO19EzKQTghRA0PqANzlRq", + "readOnly": false }, { - id: 1, - type: 0, - purpose: 0, - securityLevel: 2, - data: 'AgHuKPhPVIU5BWfpOcK1hgELY6aeySyrU13JaoxxkTYC', - readOnly: false + "id": 1, + "type": 0, + "purpose": 0, + "securityLevel": 2, + "data": "AgHuKPhPVIU5BWfpOcK1hgELY6aeySyrU13JaoxxkTYC", + "readOnly": false } ], - balance: 5255234422, - revision: 0 + "balance": 5255234422, + "revision": 0 } ``` ```json Response (gRPCurl) @@ -362,145 +362,145 @@ grpcurl -proto protos/platform/v0/platform.proto \ ```json Response (JavaScript) { - '$id': Buffer(32) [Uint8Array] [ + "$id": "Buffer(32) [Uint8Array] [ 230, 104, 198, 89, 175, 102, 174, 225, 231, 44, 24, 109, 222, 123, 91, 126, 10, 29, 113, 42, 9, 196, 13, 87, 33, 246, 34, 191, 83, 197, 49, 85 - ], - '$schema': 'https://schema.dash.org/dpp-0-4-0/meta/data-contract', - ownerId: Buffer(32) [Uint8Array] [ + ]", + "$schema": "https://schema.dash.org/dpp-0-4-0/meta/data-contract", + "ownerId": "Buffer(32) [Uint8Array] [ 48, 18, 193, 155, 152, 236, 0, 51, 173, 219, 54, 205, 100, 183, 245, 16, 103, 15, 42, 53, 26, 67, 4, 181, 246, 153, 65, 68, 40, 110, 253, 172 - ], - version: 1, - documents: { - domain: { - type: 'object', - indices: [ + ]", + "version": 1, + "documents": { + "domain": { + "type": "object", + "indices": [ { - name: 'parentNameAndLabel', - unique: true, - properties: [ - { normalizedParentDomainName: 'asc' }, - { normalizedLabel: 'asc' } + "name": "parentNameAndLabel", + "unique": true, + "properties": [ + { "normalizedParentDomainName": "asc" }, + { "normalizedLabel": "asc" } ] }, { - name: 'dashIdentityId', - unique: true, - properties: [ { 'records.dashUniqueIdentityId': 'asc' } ] + "name": "dashIdentityId", + "unique": true, + "properties": [ { "records.dashUniqueIdentityId": "asc" } ] }, { - name: 'dashAlias', - properties: [ { 'records.dashAliasIdentityId': 'asc' } ] + "name": "dashAlias", + "properties": [ { "records.dashAliasIdentityId": "asc" } ] } ], - '$comment': "In order to register a domain you need to create a preorder. The preorder step is needed to prevent man-in-the-middle attacks. normalizedLabel + '.' + normalizedParentDomain must not be longer than 253 chars length as defined by RFC 1035. Domain documents are immutable: modification and deletion are restricted", - required: [ - 'label', - 'normalizedLabel', - 'normalizedParentDomainName', - 'preorderSalt', - 'records', - 'subdomainRules' + "$comment": "In order to register a domain you need to create a preorder. The preorder step is needed to prevent man-in-the-middle attacks. normalizedLabel + '.' + normalizedParentDomain must not be longer than 253 chars length as defined by RFC 1035. Domain documents are immutable: modification and deletion are restricted", + "required": [ + "label", + "normalizedLabel", + "normalizedParentDomainName", + "preorderSalt", + "records", + "subdomainRules" ], - properties: { - label: { - type: 'string', - pattern: '^[a-zA-Z0-9][a-zA-Z0-9-]{0,61}[a-zA-Z0-9]$', - maxLength: 63, - minLength: 3, - description: "Domain label. e.g. 'Bob'." + "properties": { + "label": { + "type": "string", + "pattern": "^[a-zA-Z0-9][a-zA-Z0-9-]{0,61}[a-zA-Z0-9]$", + "maxLength": 63, + "minLength": 3, + "description": "Domain label. e.g. 'Bob'." }, - records: { - type: 'object', - '$comment': 'Constraint with max and min properties ensure that only one identity record is used - either a `dashUniqueIdentityId` or a `dashAliasIdentityId`', - properties: { - dashAliasIdentityId: { - type: 'array', - '$comment': 'Must be equal to the document owner', - maxItems: 32, - minItems: 32, - byteArray: true, - description: 'Identity ID to be used to create alias names for the Identity', - contentMediaType: 'application/x.dash.dpp.identifier' + "records": { + "type": "object", + "$comment": "Constraint with max and min properties ensure that only one identity record is used - either a `dashUniqueIdentityId` or a `dashAliasIdentityId`", + "properties": { + "dashAliasIdentityId": { + "type": "array", + "$comment": "Must be equal to the document owner", + "maxItems": 32, + "minItems": 32, + "byteArray": true, + "description": "Identity ID to be used to create alias names for the Identity", + "contentMediaType": "application/x.dash.dpp.identifier" }, - dashUniqueIdentityId: { - type: 'array', - '$comment': 'Must be equal to the document owner', - maxItems: 32, - minItems: 32, - byteArray: true, - description: 'Identity ID to be used to create the primary name the Identity', - contentMediaType: 'application/x.dash.dpp.identifier' + "dashUniqueIdentityId": { + "type": "array", + "$comment": "Must be equal to the document owner", + "maxItems": 32, + "minItems": 32, + "byteArray": true, + "description": "Identity ID to be used to create the primary name the Identity", + "contentMediaType": "application/x.dash.dpp.identifier" } }, - maxProperties: 1, - minProperties: 1, - additionalProperties: false + "maxProperties": 1, + "minProperties": 1, + "additionalProperties": false }, - preorderSalt: { - type: 'array', - maxItems: 32, - minItems: 32, - byteArray: true, - description: 'Salt used in the preorder document' + "preorderSalt": { + "type": "array", + "maxItems": 32, + "minItems": 32, + "byteArray": true, + "description": "Salt used in the preorder document" }, - subdomainRules: { - type: 'object', - required: [ 'allowSubdomains' ], - properties: { - allowSubdomains: { - type: 'boolean', - '$comment': 'Only the domain owner is allowed to create subdomains for non top-level domains', - description: 'This option defines who can create subdomains: true - anyone; false - only the domain owner' + "subdomainRules": { + "type": "object", + "required": [ "allowSubdomains" ], + "properties": { + "allowSubdomains": { + "type": "boolean", + "$comment": "Only the domain owner is allowed to create subdomains for non top-level domains", + "description": "This option defines who can create subdomains: true - anyone; false - only the domain owner" } }, - description: 'Subdomain rules allow domain owners to define rules for subdomains', - additionalProperties: false + "description": "Subdomain rules allow domain owners to define rules for subdomains", + "additionalProperties": false }, - normalizedLabel: { - type: 'string', - pattern: '^[a-z0-9][a-z0-9-]{0,61}[a-z0-9]$', - '$comment': 'Must be equal to the label in lowercase. This property will be deprecated due to case insensitive indices', - maxLength: 63, - description: "Domain label in lowercase for case-insensitive uniqueness validation. e.g. 'bob'" + "normalizedLabel": { + "type": "string", + "pattern": "^[a-z0-9][a-z0-9-]{0,61}[a-z0-9]$", + "$comment": "Must be equal to the label in lowercase. This property will be deprecated due to case insensitive indices", + "maxLength": 63, + "description": "Domain label in lowercase for case-insensitive uniqueness validation. e.g. 'bob'" }, - normalizedParentDomainName: { - type: 'string', - pattern: '^$|^[a-z0-9][a-z0-9-\\.]{0,61}[a-z0-9]$', - '$comment': 'Must either be equal to an existing domain or empty to create a top level domain. Only the data contract owner can create top level domains.', - maxLength: 63, - minLength: 0, - description: "A full parent domain name in lowercase for case-insensitive uniqueness validation. e.g. 'dash'" + "normalizedParentDomainName": { + "type": "string", + "pattern": "^$|^[a-z0-9][a-z0-9-\\.]{0,61}[a-z0-9]$", + "$comment": "Must either be equal to an existing domain or empty to create a top level domain. Only the data contract owner can create top level domains.", + "maxLength": 63, + "minLength": 0, + "description": "A full parent domain name in lowercase for case-insensitive uniqueness validation. e.g. 'dash'" } }, - additionalProperties: false + "additionalProperties": false }, - preorder: { - type: 'object', - indices: [ + "preorder": { + "type": "object", + "indices": [ { - name: 'saltedHash', - unique: true, - properties: [ { saltedDomainHash: 'asc' } ] + "name": "saltedHash", + "unique": true, + "properties": [ { "saltedDomainHash": "asc" } ] } ], - '$comment': 'Preorder documents are immutable: modification and deletion are restricted', - required: [ 'saltedDomainHash' ], - properties: { - saltedDomainHash: { - type: 'array', - maxItems: 32, - minItems: 32, - byteArray: true, - description: 'Double sha-256 of the concatenation of a 32 byte random salt and a normalized domain name' + "$comment": "Preorder documents are immutable: modification and deletion are restricted", + "required": [ "saltedDomainHash" ], + "properties": { + "saltedDomainHash": { + "type": "array", + "maxItems": 32, + "minItems": 32, + "byteArray": true, + "description": "Double sha-256 of the concatenation of a 32 byte random salt and a normalized domain name" } }, - additionalProperties: false + "additionalProperties": false } } } @@ -624,19 +624,19 @@ grpcurl -proto protos/platform/v0/platform.proto \ ```json Response (JavaScript) { - '$id': , - '$type': 'domain', - label: 'Dash01', - records: { - dashUniqueIdentityId: + "$id": "", + "$type": "domain", + "label": "Dash01", + "records": { + "dashUniqueIdentityId": "" }, - '$ownerId': , - '$revision': 1, - preorderSalt: , - subdomainRules: { allowSubdomains: false }, - '$dataContractId': , - normalizedLabel: 'dash01', - normalizedParentDomainName: 'dash' + "$ownerId": "", + "$revision": 1, + "preorderSalt": "", + "subdomainRules": { "allowSubdomains": false }, + "$dataContractId": "", + "normalizedLabel": "dash01", + "normalizedParentDomainName": "dash" } ``` ```json Response (gRPCurl) diff --git a/docs/tutorials/contracts-and-documents/register-a-data-contract.md b/docs/tutorials/contracts-and-documents/register-a-data-contract.md index e85634437..884db9a2e 100644 --- a/docs/tutorials/contracts-and-documents/register-a-data-contract.md +++ b/docs/tutorials/contracts-and-documents/register-a-data-contract.md @@ -67,15 +67,15 @@ An identity's documents are accessible via a query including a where clause like ```json 3. References ($ref) // NOTE: The `$ref` keyword is temporarily disabled for Platform v0.22. { - customer: { - type: "object", - properties: { - name: { type: "string" }, - billing_address: { $ref: "#/$defs/address" }, - shipping_address: { $ref: "#/$defs/address" } + "customer": { + "type": "object", + "properties": { + "name": { "type": "string" }, + "billing_address": { "$ref": "#/$defs/address" }, + "shipping_address": { "$ref": "#/$defs/address" } }, - additionalProperties: false - }, + "additionalProperties": false + } } /* @@ -124,14 +124,14 @@ This information will be returned when the document is retrieved. "type": "object", "properties": { "hash": { - "type": 'array', + "type": "array", "byteArray": true, "maxItems": 64, - "description": 'Store block hashes', - }, + "description": "Store block hashes" + } }, - "additionalProperties": false, - }, + "additionalProperties": false + } } /* diff --git a/docs/tutorials/contracts-and-documents/retrieve-documents.md b/docs/tutorials/contracts-and-documents/retrieve-documents.md index 672ed596e..39023f0fc 100644 --- a/docs/tutorials/contracts-and-documents/retrieve-documents.md +++ b/docs/tutorials/contracts-and-documents/retrieve-documents.md @@ -59,18 +59,18 @@ The values returned by `.getData()` (and also shown in the console.dir() `data` ```json .toJSON() { - '$protocolVersion': 0, - '$id': '6LpCQhkXYV2vqkv1UWByew4xQ6BaxxnGkhfMZsN3SV9u', - '$type': 'note', - '$dataContractId': '3iaEhdyAVbmSjd59CT6SCrqPjfAfMdPTc8ksydgqSaWE', - '$ownerId': 'CEPMcuBgAWeaCXiP2gJJaStANRHW6b158UPvL1C8zw2W', - '$revision': 1, - message: 'Tutorial CI Test @ Fri, 23 Jul 2021 13:12:13 GMT' + "$protocolVersion": 0, + "$id": "6LpCQhkXYV2vqkv1UWByew4xQ6BaxxnGkhfMZsN3SV9u", + "$type": "note", + "$dataContractId": "3iaEhdyAVbmSjd59CT6SCrqPjfAfMdPTc8ksydgqSaWE", + "$ownerId": "CEPMcuBgAWeaCXiP2gJJaStANRHW6b158UPvL1C8zw2W", + "$revision": 1, + "message": "Tutorial CI Test @ Fri, 23 Jul 2021 13:12:13 GMT" } ``` ```json .getData() { - 'Tutorial CI Test @ Fri, 23 Jul 2021 13:12:13 GMT' + "Tutorial CI Test @ Fri, 23 Jul 2021 13:12:13 GMT" } ``` ```text .data.message diff --git a/docs/tutorials/identities-and-names/retrieve-a-name.md b/docs/tutorials/identities-and-names/retrieve-a-name.md index 8a8156f03..586e935e8 100644 --- a/docs/tutorials/identities-and-names/retrieve-a-name.md +++ b/docs/tutorials/identities-and-names/retrieve-a-name.md @@ -66,20 +66,20 @@ The following example response shows a retrieved name (`user-9999.dash`): ```json { - '$protocolVersion': 0, - '$id': '4veLBZPHDkaCPF9LfZ8fX3JZiS5q5iUVGhdBbaa9ga5E', - '$type': 'domain', - '$dataContractId': '566vcJkmebVCAb2Dkj2yVMSgGFcsshupnQqtsz1RFbcy', - '$ownerId': 'HBNMY5QWuBVKNFLhgBTC1VmpEnscrmqKPMXpnYSHwhfn', - '$revision': 1, - label: 'user-9999', - records: { - dashUniqueIdentityId: 'HBNMY5QWuBVKNFLhgBTC1VmpEnscrmqKPMXpnYSHwhfn' + "$protocolVersion": 0, + "$id": "4veLBZPHDkaCPF9LfZ8fX3JZiS5q5iUVGhdBbaa9ga5E", + "$type": "domain", + "$dataContractId": "566vcJkmebVCAb2Dkj2yVMSgGFcsshupnQqtsz1RFbcy", + "$ownerId": "HBNMY5QWuBVKNFLhgBTC1VmpEnscrmqKPMXpnYSHwhfn", + "$revision": 1, + "label": "user-9999", + "records": { + "dashUniqueIdentityId": "HBNMY5QWuBVKNFLhgBTC1VmpEnscrmqKPMXpnYSHwhfn" }, - preorderSalt: 'BzQi567XVqc8wYiVHS887sJtL6MDbxLHNnp+UpTFSB0', - subdomainRules: { allowSubdomains: false }, - normalizedLabel: 'user-9999', - normalizedParentDomainName: 'dash' + "preorderSalt": "BzQi567XVqc8wYiVHS887sJtL6MDbxLHNnp+UpTFSB0", + "subdomainRules": { "allowSubdomains": false }, + "normalizedLabel": "user-9999", + "normalizedParentDomainName": "dash" } ``` diff --git a/docs/tutorials/identities-and-names/retrieve-an-accounts-identities.md b/docs/tutorials/identities-and-names/retrieve-an-accounts-identities.md index 6eb4874ca..5a780c4b5 100644 --- a/docs/tutorials/identities-and-names/retrieve-an-accounts-identities.md +++ b/docs/tutorials/identities-and-names/retrieve-an-accounts-identities.md @@ -37,10 +37,10 @@ Example Response ```json [ - '6Jz8pFZFhssKSTacgQmZP14zGZNnFYZFKSbx4WVAJFy3', - '8XoJHG96Vfm3eGh1A7HiDpMb1Jw2B9opRJe8Z38urapt', - 'CEPMcuBgAWeaCXiP2gJJaStANRHW6b158UPvL1C8zw2W', - 'GTGZrkPC72tWeBaqopSCKgiBkVVQR3s3yBsVeMyUrmiY' + "6Jz8pFZFhssKSTacgQmZP14zGZNnFYZFKSbx4WVAJFy3", + "8XoJHG96Vfm3eGh1A7HiDpMb1Jw2B9opRJe8Z38urapt", + "CEPMcuBgAWeaCXiP2gJJaStANRHW6b158UPvL1C8zw2W", + "GTGZrkPC72tWeBaqopSCKgiBkVVQR3s3yBsVeMyUrmiY" ] ```