@dashevo/dpns-contract 0.25.0-dev.2 → 0.25.0-dev.20

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (3) hide show
  1. package/Cargo.toml +1 -0
  2. package/package.json +2 -2
  3. package/src/lib.rs +21 -0
package/Cargo.toml CHANGED
@@ -7,3 +7,4 @@ license = "MIT"
7
7
 
8
8
  [dependencies]
9
9
  serde_json = { version = "1.0" }
10
+ platform-value = { path = "../rs-platform-value" }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@dashevo/dpns-contract",
3
- "version": "0.25.0-dev.2",
3
+ "version": "0.25.0-dev.20",
4
4
  "description": "A contract and helper scripts for DPNS DApp",
5
5
  "scripts": {
6
6
  "lint": "eslint .",
@@ -31,7 +31,7 @@
31
31
  ],
32
32
  "license": "MIT",
33
33
  "devDependencies": {
34
- "@dashevo/dpp": "0.25.0-dev.2",
34
+ "@dashevo/dpp": "0.25.0-dev.20",
35
35
  "chai": "^4.3.4",
36
36
  "dirty-chai": "^2.0.1",
37
37
  "eslint": "^7.32.0",
package/src/lib.rs CHANGED
@@ -1,3 +1,4 @@
1
+ use platform_value::{Identifier, IdentifierBytes32};
1
2
  use serde_json::{Error, Value};
2
3
 
3
4
  pub const ID_BYTES: [u8; 32] = [
@@ -10,6 +11,26 @@ pub const OWNER_ID_BYTES: [u8; 32] = [
10
11
  67, 4, 181, 246, 153, 65, 68, 40, 110, 253, 172,
11
12
  ];
12
13
 
14
+ pub mod document_types {
15
+ pub mod domain {
16
+ pub const NAME: &str = "domain";
17
+
18
+ pub mod properties {
19
+ pub const LABEL: &str = "label";
20
+ pub const NORMALIZED_LABEL: &str = "normalizedLabel";
21
+ pub const NORMALIZED_PARENT_DOMAIN_NAME: &str = "normalizedParentDomainName";
22
+ pub const PREORDER_SALT: &str = "preorderSalt";
23
+ pub const ALLOW_SUBDOMAINS: &str = "subdomainRules.allowSubdomains";
24
+ pub const RECORDS: &str = "records";
25
+ pub const DASH_UNIQUE_IDENTITY_ID: &str = "dashUniqueIdentityId";
26
+ pub const DASH_ALIAS_IDENTITY_ID: &str = "dashAliasIdentityId";
27
+ }
28
+ }
29
+ }
30
+
31
+ pub const ID: Identifier = Identifier(IdentifierBytes32(ID_BYTES));
32
+ pub const OWNER_ID: Identifier = Identifier(IdentifierBytes32(OWNER_ID_BYTES));
33
+
13
34
  pub fn load_documents_schemas() -> Result<Value, Error> {
14
35
  serde_json::from_str(include_str!("../schema/dpns-contract-documents.json"))
15
36
  }