pshenmic-dpp 1.0.5 → 1.0.6

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 (118) hide show
  1. package/.github/workflows/build.yml +1 -1
  2. package/.github/workflows/publish.yml +1 -1
  3. package/Cargo.lock +147 -49
  4. package/Cargo.toml +13 -7
  5. package/README.md +10 -1
  6. package/dist/wasm/index.d.ts +52 -0
  7. package/dist/wasm/pshenmic_dpp.d.ts +962 -0
  8. package/dist/wasm/pshenmic_dpp.js +3342 -875
  9. package/dist/wasm/pshenmic_dpp_bg.js +1 -1
  10. package/dist/wasm/pshenmic_dpp_bg.wasm.d.ts +440 -0
  11. package/docs/AssetLockProof.md +107 -0
  12. package/docs/Building.md +50 -0
  13. package/docs/ChainLockProof.md +63 -0
  14. package/docs/CoreScript.md +17 -0
  15. package/docs/DataContract.md +192 -0
  16. package/docs/DataContractCreateTransition.md +84 -0
  17. package/docs/DataContractUpdateTransition.md +84 -0
  18. package/docs/Document.md +396 -0
  19. package/docs/DocumentBaseTransition.md +111 -0
  20. package/docs/DocumentCreateTransition.md +132 -0
  21. package/docs/DocumentDeleteTransition.md +82 -0
  22. package/docs/DocumentPurchaseTransition.md +109 -0
  23. package/docs/DocumentReplaceTransition.md +112 -0
  24. package/docs/DocumentTransferTransition.md +96 -0
  25. package/docs/DocumentTransition.md +125 -0
  26. package/docs/DocumentUpdatePriceTransition.md +109 -0
  27. package/docs/DocumentsBatch.md +133 -0
  28. package/docs/Enums.md +103 -0
  29. package/docs/Home.md +28 -0
  30. package/docs/Identifier.md +37 -0
  31. package/docs/Identity.md +140 -0
  32. package/docs/IdentityCreateTransition.md +155 -0
  33. package/docs/IdentityCreditTransfer.md +187 -0
  34. package/docs/IdentityCreditWithdrawalTransition.md +244 -0
  35. package/docs/IdentityPublicKey.md +348 -0
  36. package/docs/IdentityPublicKeyInCreation.md +141 -0
  37. package/docs/IdentityTopUpTransition.md +166 -0
  38. package/docs/IdentityUpdateTransition.md +234 -0
  39. package/docs/InstantAssetLockProof.md +117 -0
  40. package/docs/InstantLock.md +100 -0
  41. package/docs/OutPoint.md +80 -0
  42. package/docs/PrefundedVotingBalance.md +48 -0
  43. package/docs/PrivateKey.md +112 -0
  44. package/docs/TxOut.md +93 -0
  45. package/package.json +3 -3
  46. package/packages/asset_lock_proof/Cargo.toml +19 -0
  47. package/packages/asset_lock_proof/src/chain/mod.rs +79 -0
  48. package/packages/asset_lock_proof/src/instant/instant_lock.rs +111 -0
  49. package/packages/asset_lock_proof/src/instant/mod.rs +115 -0
  50. package/packages/asset_lock_proof/src/lib.rs +133 -0
  51. package/packages/asset_lock_proof/src/outpoint/mod.rs +79 -0
  52. package/packages/asset_lock_proof/src/tx_out/mod.rs +80 -0
  53. package/packages/cbor_conversation/Cargo.toml +1 -1
  54. package/packages/core_script/Cargo.toml +13 -0
  55. package/packages/core_script/src/lib.rs +69 -0
  56. package/packages/data_contract/Cargo.toml +2 -1
  57. package/packages/data_contract/src/lib.rs +34 -30
  58. package/packages/data_contract_transitions/Cargo.toml +1 -1
  59. package/packages/data_contract_transitions/src/create/mod.rs +3 -3
  60. package/packages/data_contract_transitions/src/update/mod.rs +3 -3
  61. package/packages/document/Cargo.toml +2 -1
  62. package/packages/document/src/lib.rs +13 -12
  63. package/packages/document/src/methods/mod.rs +41 -38
  64. package/packages/documents_batch/Cargo.toml +2 -1
  65. package/packages/documents_batch/src/document_base_transition/mod.rs +16 -20
  66. package/packages/documents_batch/src/document_transition/mod.rs +9 -9
  67. package/packages/documents_batch/src/lib.rs +23 -16
  68. package/packages/documents_batch/src/transitions/create/mod.rs +5 -2
  69. package/packages/documents_batch/src/transitions/transfer/mod.rs +9 -11
  70. package/packages/enums/Cargo.toml +1 -1
  71. package/packages/enums/src/batch/batch_enum.rs +2 -2
  72. package/packages/enums/src/lib.rs +2 -0
  73. package/packages/enums/src/lock_types/mod.rs +65 -0
  74. package/packages/enums/src/platform/mod.rs +2 -0
  75. package/packages/enums/src/withdrawal/mod.rs +72 -0
  76. package/packages/identifier/Cargo.toml +9 -0
  77. package/packages/identifier/src/lib.rs +105 -0
  78. package/packages/identity/Cargo.toml +2 -1
  79. package/packages/identity/src/lib.rs +13 -18
  80. package/packages/identity_public_key/Cargo.toml +1 -1
  81. package/packages/identity_transitions/Cargo.toml +7 -3
  82. package/packages/identity_transitions/src/create_transition/mod.rs +99 -36
  83. package/packages/identity_transitions/src/credit_withdrawal_transition/mod.rs +212 -0
  84. package/packages/identity_transitions/src/identity_credit_transfer_transition/mod.rs +169 -0
  85. package/packages/identity_transitions/src/lib.rs +6 -1
  86. package/packages/identity_transitions/src/{create_transition/public_key_in_creation → public_key_in_creation}/mod.rs +67 -20
  87. package/packages/identity_transitions/src/top_up_transition/mod.rs +141 -0
  88. package/packages/identity_transitions/src/update_transition/mod.rs +213 -0
  89. package/packages/private_key/Cargo.toml +1 -1
  90. package/packages/state_transition/Cargo.toml +2 -1
  91. package/packages/state_transition/src/lib.rs +3 -2
  92. package/packages/utils/Cargo.toml +2 -2
  93. package/packages/utils/src/lib.rs +0 -3
  94. package/scripts/build-js.sh +16 -0
  95. package/scripts/build.sh +5 -1
  96. package/src/lib.rs +1 -0
  97. package/tests/AssetLockProof.spec.js +80 -0
  98. package/tests/ChainLockProof.spec.js +69 -0
  99. package/tests/CoreScript.spec.js +37 -0
  100. package/tests/DataContract.spec.js +17 -14
  101. package/tests/Document.spec.js +14 -8
  102. package/tests/DocumentBatchTransition.spec.js +11 -11
  103. package/tests/DocumentTransition.spec.js +4 -4
  104. package/tests/DocumentsTransitions.spec.js +22 -22
  105. package/tests/Identifier.spec.js +84 -0
  106. package/tests/Identity.spec.js +1 -1
  107. package/tests/IdentityCreateTransition.spec.js +93 -0
  108. package/tests/IdentityCreditTransferTransition.spec.js +146 -0
  109. package/tests/IdentityCreditWithdrawalTransition.spec.js +192 -0
  110. package/tests/IdentityTopUpTransition.spec.js +131 -0
  111. package/tests/IdentityUpdateTransition.spec.js +147 -0
  112. package/tests/InstantLockProof.spec.js +97 -0
  113. package/tests/OutPoint.spec.js +55 -0
  114. package/tests/PublicKeyInCreation.spec.js +258 -0
  115. package/tests/TxOut.spec.js +76 -0
  116. package/tests/mocks/Locks/index.js +5 -0
  117. package/tests/mocks/PublicKey/index.js +1 -1
  118. package/typings/index.d.ts +52 -0
@@ -0,0 +1,109 @@
1
+ # DocumentPurchaseTransitionWASM
2
+
3
+ This class allows to create DocumentPurchaseTransition and interact
4
+
5
+ `DocumentPurchaseTransitionWASM` can be created via constructor and document transition `fromDocumentTransition()`
6
+
7
+ Constructor arguments:
8
+
9
+ - `document -> DocumentWASM`
10
+ - `identityContractNonce -> BigInt`
11
+ - `documentTypeName -> String`
12
+ - `price -> BigInt`
13
+
14
+ ___
15
+
16
+ ## Navigation
17
+
18
+ - [Example](#example)
19
+ - [Fields](#fields)
20
+ - [base](#base)
21
+ - [price](#price)
22
+ - [revision](#revision)
23
+ - [Getters methods](#getters-methods)
24
+ - [toDocumentTransition](#todocumenttransition)
25
+
26
+ ___
27
+
28
+ ## Example
29
+
30
+ ```js
31
+ const dataContractIdentifier = new IdentifierWASM('GnXgMaiqAwTxh44ccQe8AoCgFvcseHK5CncH3sUorW4X')
32
+ const ownerIdentifier = new IdentifierWASM('CXH2kZCATjvDTnQAPVg28EgPg9WySUvwvnR5ZkmNqY5i')
33
+
34
+ const properties = {"message": "Tutorial CI Test @ Tue, 07 Jan 2025 15:27:50 GMT"}
35
+
36
+ const documentInstance = new DocumentWASM(properties, "note", BigInt(1), dataContractIdentifier, ownerIdentifier)
37
+
38
+ const purchaseTransition = new DocumentPurchaseTransitionWASM(documentInstance, BigInt(1), 'preorder', BigInt(100))
39
+ ```
40
+
41
+ ___
42
+
43
+ ## Fields
44
+
45
+ All fields are readable and writable.
46
+
47
+ ### `base`
48
+
49
+ Contains document base transition `DocumentBaseTransitionWASM`
50
+
51
+ ```js
52
+ const purchaseTransition = new DocumentPurchaseTransitionWASM(documentInstance, BigInt(1), 'preorder', BigInt(100))
53
+
54
+ const base = new DocumentBaseTransitionWASM(
55
+ '9tSsCqKHTZ8ro16MydChSxgHBukFW36eMLJKKRtebJEn',
56
+ BigInt(12350),
57
+ 'note',
58
+ 'CXH2kZCATjvDTnQAPVg28EgPg9WySUvwvnR5ZkmNqY5i'
59
+ )
60
+
61
+ purchaseTransition.base // -> DocumentBaseTransitionWASM
62
+
63
+ purchaseTransition.base = base
64
+ ```
65
+
66
+ ___
67
+
68
+ ### `price`
69
+
70
+ Contains price for purchase in `BigInt`
71
+
72
+ ```js
73
+ purchaseTransition.price // -> BigInt
74
+
75
+ purchaseTransition.price = BigInt(213)
76
+ ```
77
+
78
+ ___
79
+
80
+ ### `revision`
81
+
82
+ Contains document revision in `BigInt`
83
+
84
+ ```js
85
+ purchaseTransition.revision // -> BigInt
86
+
87
+ purchaseTransition.revision = BigInt(213)
88
+ ```
89
+
90
+ ___
91
+
92
+ ## Getters methods
93
+
94
+ ### `toDocumentTransition`
95
+
96
+ Returns document create transition in `DocumentCreateTransitionWASM`
97
+
98
+ ```js
99
+ const dataContractIdentifier = new IdentifierWASM('GnXgMaiqAwTxh44ccQe8AoCgFvcseHK5CncH3sUorW4X')
100
+ const ownerIdentifier = new IdentifierWASM('CXH2kZCATjvDTnQAPVg28EgPg9WySUvwvnR5ZkmNqY5i')
101
+
102
+ const properties = {"message": "Tutorial CI Test @ Tue, 07 Jan 2025 15:27:50 GMT"}
103
+
104
+ const documentInstance = new DocumentWASM(properties, "note", BigInt(1), dataContractIdentifier, ownerIdentifier)
105
+
106
+ const purchaseTransition = new DocumentPurchaseTransitionWASM(documentInstance, BigInt(1), 'preorder', BigInt(100))
107
+
108
+ purchaseTransition.toDocumentTransition() // -> DocumentTransitionWASM
109
+ ```
@@ -0,0 +1,112 @@
1
+ # DocumentReplaceTransitionWASM
2
+
3
+ This class allows to create DocumentReplaceTransition and interact
4
+
5
+ `DocumentReplaceTransitionWASM` can be created via constructor and document transition `fromDocumentTransition()`
6
+
7
+ Constructor arguments:
8
+
9
+ - `document -> DocumentWASM`
10
+ - `identityContractNonce -> BigInt`
11
+ - `documentTypeName -> String`
12
+
13
+ ___
14
+
15
+ ## Navigation
16
+
17
+ - [Example](#example)
18
+ - [Fields](#fields)
19
+ - [base](#base)
20
+ - [data](#data)
21
+ - [revision](#revision)
22
+ - [Getters methods](#getters-methods)
23
+ - [toDocumentTransition](#todocumenttransition)
24
+
25
+ ___
26
+
27
+ ## Example
28
+
29
+ ```js
30
+ const dataContractIdentifier = new IdentifierWASM('GnXgMaiqAwTxh44ccQe8AoCgFvcseHK5CncH3sUorW4X')
31
+ const ownerIdentifier = new IdentifierWASM('CXH2kZCATjvDTnQAPVg28EgPg9WySUvwvnR5ZkmNqY5i')
32
+
33
+ const properties = {"message": "Tutorial CI Test @ Tue, 07 Jan 2025 15:27:50 GMT"}
34
+
35
+ const documentInstance = new DocumentWASM(properties, "note", BigInt(1), dataContractIdentifier, ownerIdentifier)
36
+
37
+ const replaceTransition = new DocumentReplaceTransitionWASM(documentInstance, BigInt(1), 'preorder')
38
+ ```
39
+
40
+ ___
41
+
42
+ ## Fields
43
+
44
+ All fields are readable and writable.
45
+
46
+ ### `base`
47
+
48
+ Contains document base transition `DocumentBaseTransitionWASM`
49
+
50
+ ```js
51
+ const replaceTransition = new DocumentReplaceTransitionWASM(documentInstance, BigInt(1), 'preorder')
52
+
53
+ const base = new DocumentBaseTransitionWASM(
54
+ '9tSsCqKHTZ8ro16MydChSxgHBukFW36eMLJKKRtebJEn',
55
+ BigInt(12350),
56
+ 'note',
57
+ 'CXH2kZCATjvDTnQAPVg28EgPg9WySUvwvnR5ZkmNqY5i'
58
+ )
59
+
60
+ replaceTransition.base // -> DocumentBaseTransitionWASM
61
+
62
+ replaceTransition.base = base
63
+ ```
64
+
65
+ ___
66
+
67
+ ### `data`
68
+
69
+ Contains document data in `Object`
70
+
71
+ ```js
72
+ const replaceTransition = new DocumentReplaceTransitionWASM(documentInstance, BigInt(1), 'preorder')
73
+
74
+ replaceTransition.data // -> Object
75
+
76
+ replaceTransition.data = {"message": "Tutorial CI Test @ Tue, 07 Jan 2025 15:27:50 GMT"}
77
+ ```
78
+
79
+ ___
80
+
81
+ ### `revision`
82
+
83
+ Contains document revision in `BigInt`
84
+
85
+ ```js
86
+ const replaceTransition = new DocumentReplaceTransitionWASM(documentInstance, BigInt(1), 'preorder')
87
+
88
+ replaceTransition.revision // -> BigInt
89
+
90
+ replaceTransition.revision = BigInt(213)
91
+ ```
92
+
93
+ ___
94
+
95
+ ## Getters methods
96
+
97
+ ### `toDocumentTransition`
98
+
99
+ Returns document create transition in `DocumentCreateTransitionWASM`
100
+
101
+ ```js
102
+ const dataContractIdentifier = new IdentifierWASM('GnXgMaiqAwTxh44ccQe8AoCgFvcseHK5CncH3sUorW4X')
103
+ const ownerIdentifier = new IdentifierWASM('CXH2kZCATjvDTnQAPVg28EgPg9WySUvwvnR5ZkmNqY5i')
104
+
105
+ const properties = {"message": "Tutorial CI Test @ Tue, 07 Jan 2025 15:27:50 GMT"}
106
+
107
+ const documentInstance = new DocumentWASM(properties, "note", BigInt(1), dataContractIdentifier, ownerIdentifier)
108
+
109
+ const deleteTransition = new DocumentDeleteTransitionWASM(documentInstance, BigInt(1), 'preorder')
110
+
111
+ deleteTransition.toDocumentTransition() // -> DocumentTransitionWASM
112
+ ```
@@ -0,0 +1,96 @@
1
+ # DocumentTransferTransitionWASM
2
+
3
+ This class allows to create DocumentTransferTransition and interact
4
+
5
+ `DocumentTransferTransitionWASM` can be created via constructor and document transition `fromDocumentTransition()`
6
+
7
+ Constructor arguments:
8
+
9
+ - `document -> DocumentWASM`
10
+ - `identityContractNonce -> BigInt`
11
+ - `documentTypeName -> String`
12
+ - `recipientId -> IdentifierWASM | String | ArrayLike`
13
+ ___
14
+
15
+ ## Navigation
16
+
17
+ - [Example](#example)
18
+ - [Fields](#fields)
19
+ - [base](#base)
20
+ - [recipientId](#recipientid)
21
+ - [Getters methods](#getters-methods)
22
+ - [toDocumentTransition](#todocumenttransition)
23
+
24
+ ___
25
+
26
+ ## Example
27
+
28
+ ```js
29
+ const dataContractIdentifier = new IdentifierWASM('GnXgMaiqAwTxh44ccQe8AoCgFvcseHK5CncH3sUorW4X')
30
+ const ownerIdentifier = new IdentifierWASM('CXH2kZCATjvDTnQAPVg28EgPg9WySUvwvnR5ZkmNqY5i')
31
+ const recipientIdentifier = new IdentifierWASM('HzHXSQcBkU9Ve5YAxhGd8NgA72xFcG9nCZKKxhayn1NW')
32
+
33
+ const properties = {"message": "Tutorial CI Test @ Tue, 07 Jan 2025 15:27:50 GMT"}
34
+
35
+ const documentInstance = new DocumentWASM(properties, "note", BigInt(1), dataContractIdentifier, ownerIdentifier)
36
+
37
+ const transferTransition = new DocumentTransferTransitionWASM(documentInstance, BigInt(1), 'preorder', recipientIdentifier)
38
+ ```
39
+ ___
40
+ ## Fields
41
+ All fields are readable and writable.
42
+
43
+ ### `base`
44
+
45
+ Contains document base transition `DocumentBaseTransitionWASM`
46
+
47
+ ```js
48
+ const transferTransition = new DocumentTransferTransitionWASM(documentInstance, BigInt(1), 'preorder', recipientIdentifier)
49
+
50
+ const base = new DocumentBaseTransitionWASM(
51
+ '9tSsCqKHTZ8ro16MydChSxgHBukFW36eMLJKKRtebJEn',
52
+ BigInt(12350),
53
+ 'note',
54
+ 'CXH2kZCATjvDTnQAPVg28EgPg9WySUvwvnR5ZkmNqY5i'
55
+ )
56
+
57
+ transferTransition.base // -> DocumentBaseTransitionWASM
58
+
59
+ transferTransition.base = base
60
+ ```
61
+
62
+ ___
63
+
64
+ ### `recipientId`
65
+
66
+ Contains recipient identifier in `IdentifierWASM`
67
+
68
+ ```js
69
+ const transferTransition = new DocumentTransferTransitionWASM(documentInstance, BigInt(1), 'preorder', recipientIdentifier)
70
+
71
+ transferTransition.recipientId // -> IdentifierWASM
72
+
73
+ transferTransition.recipientId = 'CXH2kZCATjvDTnQAPVg28EgPg9WySUvwvnR5ZkmNqY5i'
74
+ ```
75
+
76
+ ___
77
+
78
+ ## Getters methods
79
+
80
+ ### `toDocumentTransition`
81
+
82
+ Returns document create transition in `DocumentCreateTransitionWASM`
83
+
84
+ ```js
85
+ const dataContractIdentifier = new IdentifierWASM('GnXgMaiqAwTxh44ccQe8AoCgFvcseHK5CncH3sUorW4X')
86
+ const ownerIdentifier = new IdentifierWASM('CXH2kZCATjvDTnQAPVg28EgPg9WySUvwvnR5ZkmNqY5i')
87
+ const recipientIdentifier = new IdentifierWASM('HzHXSQcBkU9Ve5YAxhGd8NgA72xFcG9nCZKKxhayn1NW')
88
+
89
+ const properties = {"message": "Tutorial CI Test @ Tue, 07 Jan 2025 15:27:50 GMT"}
90
+
91
+ const documentInstance = new DocumentWASM(properties, "note", BigInt(1), dataContractIdentifier, ownerIdentifier)
92
+
93
+ const transferTransition = new DocumentTransferTransitionWASM(documentInstance, BigInt(1), 'preorder', recipientIdentifier)
94
+
95
+ transferTransition.toDocumentTransition() // -> DocumentTransitionWASM
96
+ ```
@@ -0,0 +1,125 @@
1
+ # DocumentTransitionWASM
2
+
3
+ This class allows to crate DocumentTransitions and interact
4
+
5
+ `DocumentTransitionWASM` can't be created via constructor
6
+ or any other methods for deserialization
7
+
8
+ Instance of `DocumentTransitionWASM` can be returned from getters
9
+ of other instances, like `DocumentBatchWASM` or any DocumentTransition
10
+ ___
11
+
12
+ ## Navigation
13
+
14
+ - [Fields](#fields)
15
+ - [actionType](#actiontype)
16
+ - [dataContractId](#datacontractid)
17
+ - [revision](#revision)
18
+ - [identityContractNonce](#identitycontractnonce)
19
+ - [id](#id)
20
+ - [documentTypeName](#documenttypename)
21
+ - [entropy](#entropy)
22
+ - [Transition conversions](#transition-conversions)
23
+
24
+ ___
25
+
26
+ ## Fields
27
+
28
+ All fields are read-only, exception: `dataContractId`, `revision`, `identityContractNonce`
29
+
30
+ ### `actionType`
31
+
32
+ Contains action `String` from `BatchTypeEnum`
33
+
34
+ ````js
35
+ transitionInstance.actionType // -> String
36
+ ````
37
+
38
+ ___
39
+
40
+ ### `dataContractId`
41
+
42
+ Contains DataContract identifier in `IdentifierWASM`
43
+
44
+ ```js
45
+ transitionInstance.dataContractId // -> IdentifierWASM
46
+
47
+ transitionInstance.dataContractId = 'GgZekwh38XcWQTyWWWvmw6CEYFnLU7yiZFPWZEjqKHit'
48
+ ```
49
+
50
+ ___
51
+
52
+ ### `revision`
53
+
54
+ Contains revision in `BigInt`
55
+
56
+ ```js
57
+ transitionInstance.revision // -> BigInt
58
+
59
+ transitionInstance.revision = BigInt(1)
60
+ ```
61
+
62
+ ___
63
+
64
+ ### `identityContractNonce`
65
+
66
+ Contains identity contract nonce in `BigInt`
67
+
68
+ ```js
69
+ transitionInstance.identityContractNonce // -> BigInt
70
+
71
+ transitionInstance.identityContractNonce = BigInt(12)
72
+ ```
73
+
74
+ ___
75
+
76
+ ### `id`
77
+
78
+ Contains document identity in `IdentifierWASM`
79
+
80
+ ```js
81
+ transitionInstance.id // -> IdentifierWASM
82
+ ```
83
+
84
+ ___
85
+
86
+ ### `documentTypeName`
87
+
88
+ Contains document type name in `String`
89
+
90
+ ```js
91
+ transitionInstance.documentTypeName // -> String
92
+ ```
93
+
94
+ ___
95
+
96
+ ### `entropy`
97
+
98
+ Contains entropy in `Uint8Array` for transition with entropy
99
+
100
+ ```js
101
+ transitionInstance.entropy // -> Uint8Array
102
+ ```
103
+
104
+ ___
105
+
106
+ ### Transition conversions
107
+
108
+ Every DocumentTransition contains one of available Document Transition.
109
+ You can get one of they by these fields:
110
+
111
+ - `createTransition`
112
+ - `replaceTransition`
113
+ - `deleteTransition`
114
+ - `purchaseTransition`
115
+ - `transferTransition`
116
+ - `updatePriceTransition`
117
+
118
+ ```js
119
+ transitionInstance.createTransition // -> DocumentCreateTransitionWASM
120
+ transitionInstance.replaceTransition // -> DocumentReplaceTransitionWASM
121
+ transitionInstance.deleteTransition // -> DocumentDeleteTransitionWASM
122
+ transitionInstance.purchaseTransition // -> DocumentPurchaseTransitionWASM
123
+ transitionInstance.transferTransition // -> DocumentTransferTransitionWASM
124
+ transitionInstance.updatePriceTransition // -> DocumentUpdatePriceTransitionWASM
125
+ ```
@@ -0,0 +1,109 @@
1
+ # DocumentUpdatePriceTransitionWASM
2
+
3
+ This class allows to create DocumentUpdatePriceTransition and interact
4
+
5
+ `DocumentUpdatePriceTransitionWASM` can be created via constructor and document transition `fromDocumentTransition()`
6
+
7
+ Constructor arguments:
8
+
9
+ - `document -> DocumentWASM`
10
+ - `identityContractNonce -> BigInt`
11
+ - `documentTypeName -> String`
12
+ - `price -> BigInt`
13
+
14
+ ___
15
+
16
+ ## Navigation
17
+
18
+ - [Example](#example)
19
+ - [Fields](#fields)
20
+ - [base](#base)
21
+ - [price](#price)
22
+ - [revision](#revision)
23
+ - [Getters methods](#getters-methods)
24
+ - [toDocumentTransition](#todocumenttransition)
25
+
26
+ ___
27
+
28
+ ## Example
29
+
30
+ ```js
31
+ const dataContractIdentifier = new IdentifierWASM('GnXgMaiqAwTxh44ccQe8AoCgFvcseHK5CncH3sUorW4X')
32
+ const ownerIdentifier = new IdentifierWASM('CXH2kZCATjvDTnQAPVg28EgPg9WySUvwvnR5ZkmNqY5i')
33
+
34
+ const properties = {"message": "Tutorial CI Test @ Tue, 07 Jan 2025 15:27:50 GMT"}
35
+
36
+ const documentInstance = new DocumentWASM(properties, "note", BigInt(1), dataContractIdentifier, ownerIdentifier)
37
+
38
+ const updatePriceTransition = new DocumentUpdatePriceTransitionWASM(documentInstance, BigInt(1), 'preorder', BigInt(100))
39
+ ```
40
+
41
+ ___
42
+
43
+ ## Fields
44
+
45
+ All fields are readable and writable.
46
+
47
+ ### `base`
48
+
49
+ Contains document base transition `DocumentBaseTransitionWASM`
50
+
51
+ ```js
52
+ const updatePriceTransition = new DocumentUpdatePriceTransitionWASM(documentInstance, BigInt(1), 'preorder', BigInt(100))
53
+
54
+ const base = new DocumentBaseTransitionWASM(
55
+ '9tSsCqKHTZ8ro16MydChSxgHBukFW36eMLJKKRtebJEn',
56
+ BigInt(12350),
57
+ 'note',
58
+ 'CXH2kZCATjvDTnQAPVg28EgPg9WySUvwvnR5ZkmNqY5i'
59
+ )
60
+
61
+ updatePriceTransition.base // -> DocumentBaseTransitionWASM
62
+
63
+ updatePriceTransition.base = base
64
+ ```
65
+
66
+ ___
67
+
68
+ ### `price`
69
+
70
+ Contains price for purchase in `BigInt`
71
+
72
+ ```js
73
+ updatePriceTransition.price // -> BigInt
74
+
75
+ updatePriceTransition.price = BigInt(213)
76
+ ```
77
+
78
+ ___
79
+
80
+ ### `revision`
81
+
82
+ Contains document revision in `BigInt`
83
+
84
+ ```js
85
+ updatePriceTransition.revision // -> BigInt
86
+
87
+ updatePriceTransition.revision = BigInt(213)
88
+ ```
89
+
90
+ ___
91
+
92
+ ## Getters methods
93
+
94
+ ### `toDocumentTransition`
95
+
96
+ Returns document create transition in `DocumentCreateTransitionWASM`
97
+
98
+ ```js
99
+ const dataContractIdentifier = new IdentifierWASM('GnXgMaiqAwTxh44ccQe8AoCgFvcseHK5CncH3sUorW4X')
100
+ const ownerIdentifier = new IdentifierWASM('CXH2kZCATjvDTnQAPVg28EgPg9WySUvwvnR5ZkmNqY5i')
101
+
102
+ const properties = {"message": "Tutorial CI Test @ Tue, 07 Jan 2025 15:27:50 GMT"}
103
+
104
+ const documentInstance = new DocumentWASM(properties, "note", BigInt(1), dataContractIdentifier, ownerIdentifier)
105
+
106
+ const updatePriceTransition = new DocumentUpdatePriceTransitionWASM(documentInstance, BigInt(1), 'preorder', BigInt(100))
107
+
108
+ updatePriceTransition.toDocumentTransition() // -> DocumentTransitionWASM
109
+ ```
@@ -0,0 +1,133 @@
1
+ # DocumentsBatchWASM
2
+
3
+ This class allows to create DocumentBatch from transitions and interact
4
+
5
+ `DocumentsBatchWASM` can be created from constructor, bytes and state transition
6
+
7
+ Constructor arguments:
8
+
9
+ - `documentTransitions -> [DocumentTransitionWASM]`
10
+ - `ownerId -> IdentifierWASM | String | ArrayLike`
11
+ - `userFeeIncrease -> Number`
12
+ - `publicKeyId -> ?Number`
13
+ - `signature -> ?ArrayLike`
14
+
15
+ If you want to create instance from bytes,
16
+ use `fromBytes()` with `ArrayLike` as argument.
17
+ Also, you can use `fromStateTransition` with
18
+ `StateTransitionWASM` instance as argument
19
+
20
+ ___
21
+
22
+ ## Navigation
23
+
24
+ - [Example](#example)
25
+ - [Fields](#fields)
26
+ - [transitions](#transitions)
27
+ - [signature](#signature)
28
+ - [signaturePublicKeyId](#signaturepublickeyid)
29
+ - [allPurchasesAmount](#allpurchasesamount)
30
+ - [ownerId](#ownerid)
31
+ - [modifiedDataIds](#modifieddataids)
32
+ - [allConflictingIndexCollateralVotingFunds](#allconflictingindexcollateralvotingfunds)
33
+
34
+ ___
35
+
36
+ ## Example
37
+
38
+ ```js
39
+ const documentInstance = new DocumentWASM(document, documentTypeName, revision, dataContractId, ownerId, id)
40
+ const createTransition = new DocumentCreateTransitionWASM(documentInstance, BigInt(1), 'preorder')
41
+
42
+ const documentTransition = createTransition.toDocumentTransition()
43
+
44
+ const batchTransition = new DocumentsBatchWASM([documentTransition], documentInstance.getOwnerId(), 1)
45
+ ```
46
+
47
+ ___
48
+
49
+ ## Fields
50
+
51
+ Not all fields are readable and writable.
52
+
53
+ ### `transitions`
54
+
55
+ Contains array of `DocumentTransitionWASM` in `[DocumentTransitionWASM]`
56
+
57
+ ```js
58
+ batchTransition.transitions // -> [DocumentTransitionWASM]
59
+
60
+ batchTransition.transitions = [documentTransition1, documentTransition2]
61
+ ```
62
+
63
+ ___
64
+
65
+ ### `signature`
66
+
67
+ Contains array of bytes in `Uint8Array`
68
+
69
+ ```js
70
+ batchTransition.signature // -> Uint8Array
71
+
72
+ batchTransition.signature = [1, 2, 3]
73
+ ```
74
+
75
+ ___
76
+
77
+ ### `signaturePublicKeyId`
78
+
79
+ Contains key id for signature in `Number`
80
+
81
+ ```js
82
+ batchTransition.signaturePublicKeyId // -> Number
83
+
84
+ batchTransition.signaturePublicKeyId = 3
85
+ ```
86
+
87
+ ___
88
+
89
+ ### `allPurchasesAmount`
90
+
91
+ Contains amount of credits for purchase in `BigInt`
92
+
93
+ **ONLY READ**
94
+
95
+ ```js
96
+ batchTransition.allPurchasesAmount // -> BigInt
97
+ ```
98
+
99
+ ___
100
+
101
+ ### `ownerId`
102
+
103
+ Contains owner id in `IdentifierWASM`
104
+
105
+ **ONLY READ**
106
+
107
+ ```js
108
+ batchTransition.ownerId // -> IdentifierWASM
109
+ ```
110
+
111
+ ___
112
+
113
+ ### `modifiedDataIds`
114
+
115
+ Contains array of ids for modifier data in `[IdentifierWASM]`
116
+
117
+ **ONLY READ**
118
+
119
+ ```js
120
+ batchTransition.ownerId // -> IdentifierWASM
121
+ ```
122
+
123
+ ___
124
+
125
+ ### `allConflictingIndexCollateralVotingFunds`
126
+
127
+ Contains array conflicting funds in `BigInt`
128
+
129
+ **ONLY READ**
130
+
131
+ ```js
132
+ batchTransition.allConflictingIndexCollateralVotingFunds // -> BigInt
133
+ ```