pshenmic-dpp 1.0.4 → 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.
- package/.github/workflows/build.yml +9 -1
- package/.github/workflows/publish.yml +9 -1
- package/Cargo.lock +222 -76
- package/Cargo.toml +28 -19
- package/README.md +75 -23
- package/babel.config.json +19 -0
- package/dist/wasm/index.d.ts +52 -0
- package/dist/wasm/pshenmic_dpp.d.ts +962 -0
- package/dist/wasm/pshenmic_dpp.js +5565 -966
- package/dist/wasm/pshenmic_dpp_bg.js +1 -1
- package/dist/wasm/pshenmic_dpp_bg.wasm.d.ts +440 -0
- package/docs/AssetLockProof.md +107 -0
- package/docs/Building.md +50 -0
- package/docs/ChainLockProof.md +63 -0
- package/docs/CoreScript.md +17 -0
- package/docs/DataContract.md +192 -0
- package/docs/DataContractCreateTransition.md +84 -0
- package/docs/DataContractUpdateTransition.md +84 -0
- package/docs/Document.md +396 -0
- package/docs/DocumentBaseTransition.md +111 -0
- package/docs/DocumentCreateTransition.md +132 -0
- package/docs/DocumentDeleteTransition.md +82 -0
- package/docs/DocumentPurchaseTransition.md +109 -0
- package/docs/DocumentReplaceTransition.md +112 -0
- package/docs/DocumentTransferTransition.md +96 -0
- package/docs/DocumentTransition.md +125 -0
- package/docs/DocumentUpdatePriceTransition.md +109 -0
- package/docs/DocumentsBatch.md +133 -0
- package/docs/Enums.md +103 -0
- package/docs/Home.md +28 -0
- package/docs/Identifier.md +37 -0
- package/docs/Identity.md +140 -0
- package/docs/IdentityCreateTransition.md +155 -0
- package/docs/IdentityCreditTransfer.md +187 -0
- package/docs/IdentityCreditWithdrawalTransition.md +244 -0
- package/docs/IdentityPublicKey.md +348 -0
- package/docs/IdentityPublicKeyInCreation.md +141 -0
- package/docs/IdentityTopUpTransition.md +166 -0
- package/docs/IdentityUpdateTransition.md +234 -0
- package/docs/InstantAssetLockProof.md +117 -0
- package/docs/InstantLock.md +100 -0
- package/docs/OutPoint.md +80 -0
- package/docs/PrefundedVotingBalance.md +48 -0
- package/docs/PrivateKey.md +112 -0
- package/docs/TxOut.md +93 -0
- package/package.json +15 -8
- package/packages/asset_lock_proof/Cargo.toml +19 -0
- package/packages/asset_lock_proof/src/chain/mod.rs +79 -0
- package/packages/asset_lock_proof/src/instant/instant_lock.rs +111 -0
- package/packages/asset_lock_proof/src/instant/mod.rs +115 -0
- package/packages/asset_lock_proof/src/lib.rs +133 -0
- package/packages/asset_lock_proof/src/outpoint/mod.rs +79 -0
- package/packages/asset_lock_proof/src/tx_out/mod.rs +80 -0
- package/packages/cbor_conversation/Cargo.toml +2 -2
- package/packages/core_script/Cargo.toml +13 -0
- package/packages/core_script/src/lib.rs +69 -0
- package/packages/data_contract/Cargo.toml +4 -3
- package/packages/data_contract/src/lib.rs +209 -33
- package/packages/data_contract_transitions/Cargo.toml +2 -2
- package/packages/data_contract_transitions/src/create/mod.rs +23 -16
- package/packages/data_contract_transitions/src/update/mod.rs +21 -12
- package/packages/document/Cargo.toml +3 -2
- package/packages/document/src/lib.rs +14 -13
- package/packages/document/src/methods/mod.rs +373 -2
- package/packages/{document_batch → documents_batch}/Cargo.toml +7 -4
- package/packages/documents_batch/src/document_base_transition/mod.rs +88 -0
- package/packages/documents_batch/src/document_transition/mod.rs +166 -0
- package/packages/documents_batch/src/generators.rs +122 -0
- package/packages/documents_batch/src/lib.rs +195 -0
- package/packages/documents_batch/src/prefunded_voting_balance/mod.rs +45 -0
- package/packages/documents_batch/src/transitions/create/mod.rs +126 -0
- package/packages/documents_batch/src/transitions/delete/mod.rs +67 -0
- package/packages/documents_batch/src/transitions/mod.rs +6 -0
- package/packages/documents_batch/src/transitions/purchase/mod.rs +91 -0
- package/packages/documents_batch/src/transitions/replace/mod.rs +93 -0
- package/packages/documents_batch/src/transitions/transfer/mod.rs +84 -0
- package/packages/documents_batch/src/transitions/update_price/mod.rs +75 -0
- package/packages/enums/Cargo.toml +4 -4
- package/packages/enums/src/batch/batch_enum.rs +75 -10
- package/packages/enums/src/keys/key_type.rs +46 -0
- package/packages/enums/src/keys/purpose.rs +55 -0
- package/packages/enums/src/keys/security_level.rs +46 -0
- package/packages/enums/src/lib.rs +3 -0
- package/packages/enums/src/lock_types/mod.rs +65 -0
- package/packages/enums/src/network/mod.rs +67 -0
- package/packages/enums/src/platform/mod.rs +68 -8
- package/packages/enums/src/withdrawal/mod.rs +72 -0
- package/packages/identifier/Cargo.toml +9 -0
- package/packages/identifier/src/lib.rs +105 -0
- package/packages/identity/Cargo.toml +5 -5
- package/packages/identity/src/lib.rs +31 -25
- package/packages/{public_key → identity_public_key}/Cargo.toml +2 -2
- package/packages/{public_key → identity_public_key}/src/lib.rs +74 -27
- package/packages/identity_transitions/Cargo.toml +8 -4
- package/packages/identity_transitions/src/create_transition/mod.rs +102 -37
- package/packages/identity_transitions/src/credit_withdrawal_transition/mod.rs +212 -0
- package/packages/identity_transitions/src/identity_credit_transfer_transition/mod.rs +169 -0
- package/packages/identity_transitions/src/lib.rs +6 -1
- package/packages/identity_transitions/src/public_key_in_creation/mod.rs +197 -0
- package/packages/identity_transitions/src/top_up_transition/mod.rs +141 -0
- package/packages/identity_transitions/src/update_transition/mod.rs +213 -0
- package/packages/mock_bls/Cargo.toml +1 -1
- package/packages/private_key/Cargo.toml +4 -3
- package/packages/private_key/src/lib.rs +44 -6
- package/packages/state_transition/Cargo.toml +6 -4
- package/packages/state_transition/src/lib.rs +102 -36
- package/packages/utils/Cargo.toml +3 -4
- package/packages/utils/src/lib.rs +17 -18
- package/scripts/build-js.sh +22 -5
- package/scripts/build.sh +27 -2
- package/src/lib.rs +8 -1
- package/tests/AssetLockProof.spec.js +80 -0
- package/tests/ChainLockProof.spec.js +69 -0
- package/tests/CoreScript.spec.js +37 -0
- package/tests/DataContract.spec.js +178 -0
- package/tests/DataContractCreateStateTransition.spec.js +109 -0
- package/tests/DataContractUpdateStateTransition.spec.js +109 -0
- package/tests/Document.spec.js +238 -0
- package/tests/DocumentBatchTransition.spec.js +109 -0
- package/tests/DocumentTransition.spec.js +97 -0
- package/tests/DocumentsTransitions.spec.js +705 -0
- package/tests/Identifier.spec.js +84 -0
- package/tests/Identity.spec.js +113 -0
- package/tests/IdentityCreateTransition.spec.js +93 -0
- package/tests/IdentityCreditTransferTransition.spec.js +146 -0
- package/tests/IdentityCreditWithdrawalTransition.spec.js +192 -0
- package/tests/IdentityPublicKey.spec.js +132 -0
- package/tests/IdentityTopUpTransition.spec.js +131 -0
- package/tests/IdentityUpdateTransition.spec.js +147 -0
- package/tests/InstantLockProof.spec.js +97 -0
- package/tests/OutPoint.spec.js +55 -0
- package/tests/PrivateKey.spec.js +73 -0
- package/tests/PublicKeyInCreation.spec.js +258 -0
- package/tests/TxOut.spec.js +76 -0
- package/tests/mocks/DataContract/DataContract.json +153 -0
- package/tests/mocks/DataContract/index.js +6 -0
- package/tests/mocks/Document/DataContract.json +23 -0
- package/tests/mocks/Document/document.json +3 -0
- package/tests/mocks/Document/document2.json +3 -0
- package/tests/mocks/Document/index.js +11 -0
- package/tests/mocks/Identity/index.js +7 -0
- package/tests/mocks/Locks/index.js +5 -0
- package/tests/mocks/PrivateKey/index.js +5 -0
- package/tests/mocks/PublicKey/index.js +14 -0
- package/tests/utils/hex.js +15 -0
- package/tests/utils/wasm.js +14 -0
- package/typings/index.d.ts +52 -0
- package/packages/document/src/methods/js.rs +0 -260
- package/packages/document/src/methods/rust.rs +0 -92
- package/packages/document_batch/src/generators.rs +0 -63
- package/packages/document_batch/src/lib.rs +0 -228
- package/packages/identity_transitions/src/create_transition/public_key_in_creation/mod.rs +0 -146
package/docs/Document.md
ADDED
|
@@ -0,0 +1,396 @@
|
|
|
1
|
+
# DocumentWASM
|
|
2
|
+
|
|
3
|
+
This class allows to create instance of Document and interact with him
|
|
4
|
+
|
|
5
|
+
You can create `DocumentWASM` via constructor and `fromBytes`
|
|
6
|
+
|
|
7
|
+
Arguments in constructor:
|
|
8
|
+
|
|
9
|
+
- `rawDocument -> Object`
|
|
10
|
+
- `documentTypeName -> String`
|
|
11
|
+
- `revision -> BigInt`
|
|
12
|
+
- `dataContractId -> IdentifierWASM | String | ArrayLike`
|
|
13
|
+
- `ownerId -> IdentifierWASM | String | ArrayLike`
|
|
14
|
+
- `documentId -> IdentifierWASM | String | ArrayLike | undefined`
|
|
15
|
+
|
|
16
|
+
If you want to create Document from bytes,
|
|
17
|
+
you need to use serialized to bytes Document from `rs-dpp` or `pshenmic-dpp`
|
|
18
|
+
|
|
19
|
+
This class also contains static method for document id generation:
|
|
20
|
+
|
|
21
|
+
- `generateId`
|
|
22
|
+
- `documentTypeName -> String`
|
|
23
|
+
- `ownerId -> IdentifierWASM | String | ArrayLike`
|
|
24
|
+
- `dataContractId -> IdentifierWASM | String | ArrayLike`
|
|
25
|
+
- `entropy -> ArrayLike | undefined`
|
|
26
|
+
|
|
27
|
+
___
|
|
28
|
+
|
|
29
|
+
## Navigation
|
|
30
|
+
|
|
31
|
+
- [Example](#example)
|
|
32
|
+
- [Getters methods](#getters-methods)
|
|
33
|
+
- [getId](#getid)
|
|
34
|
+
- [getEntropy](#getentropy)
|
|
35
|
+
- [getDataContractId](#getdatacontractid)
|
|
36
|
+
- [getOwnerId](#getownerid)
|
|
37
|
+
- [getProperties](#getproperties)
|
|
38
|
+
- [getRevision](#getrevision)
|
|
39
|
+
- [getCreatedAt](#getcreatedat)
|
|
40
|
+
- [getUpdatedAt](#getupdatedat)
|
|
41
|
+
- [getTransferredAt](#gettransferredat)
|
|
42
|
+
- [getCreatedAtBlockHeight](#getcreatedatblockheight)
|
|
43
|
+
- [getUpdatedAtBlockHeight](#getupdatedatblockheight)
|
|
44
|
+
- [getTransferredAtBlockHeight](#gettransferredatblockheight)
|
|
45
|
+
- [getCreatedAtCoreBlockHeight](#getcreatedatcoreblockheight)
|
|
46
|
+
- [getUpdatedAtCoreBlockHeight](#getupdatedatcoreblockheight)
|
|
47
|
+
- [getTransferredAtCoreBlockHeight](#gettransferredatcoreblockheight)
|
|
48
|
+
- [getDocumentTypeName](#getdocumenttypename)
|
|
49
|
+
- [Setters methods](#setters-methods)
|
|
50
|
+
- [setId](#setid)
|
|
51
|
+
- [setEntropy](#setentropy)
|
|
52
|
+
- [setDataContractId](#setdatacontractid)
|
|
53
|
+
- [setOwnerId](#setownerid)
|
|
54
|
+
- [setProperties](#setproperties)
|
|
55
|
+
- [setRevision](#setrevision)
|
|
56
|
+
- [setCreatedAt](#setcreatedat)
|
|
57
|
+
- [setUpdatedAt](#setupdatedat)
|
|
58
|
+
- [setTransferredAt](#settransferredat)
|
|
59
|
+
- [setCreatedAtBlockHeight](#setcreatedatblockheight)
|
|
60
|
+
- [setUpdatedAtBlockHeight](#setupdatedatblockheight)
|
|
61
|
+
- [setTransferredAtBlockHeight](#settransferredatblockheight)
|
|
62
|
+
- [setCreatedAtCoreBlockHeight](#setcreatedatcoreblockheight)
|
|
63
|
+
- [setUpdatedAtCoreBlockHeight](#setupdatedatcoreblockheight)
|
|
64
|
+
- [setTransferredAtCoreBlockHeight](#settransferredatcoreblockheight)
|
|
65
|
+
- [setDocumentTypeName](#setdocumenttypename)
|
|
66
|
+
|
|
67
|
+
___
|
|
68
|
+
|
|
69
|
+
## Example
|
|
70
|
+
|
|
71
|
+
```js
|
|
72
|
+
const dataContractIdentifier = new IdentifierWASM('GnXgMaiqAwTxh44ccQe8AoCgFvcseHK5CncH3sUorW4X')
|
|
73
|
+
const ownerIdentifier = new IdentifierWASM('CXH2kZCATjvDTnQAPVg28EgPg9WySUvwvnR5ZkmNqY5i')
|
|
74
|
+
|
|
75
|
+
const properties = {"message": "Tutorial CI Test @ Tue, 07 Jan 2025 15:27:50 GMT"}
|
|
76
|
+
|
|
77
|
+
const documentInstance = new DocumentWASM(properties, "note", BigInt(1), dataContractIdentifier, ownerIdentifier)
|
|
78
|
+
```
|
|
79
|
+
|
|
80
|
+
___
|
|
81
|
+
|
|
82
|
+
## Getters methods
|
|
83
|
+
|
|
84
|
+
### `getId`
|
|
85
|
+
|
|
86
|
+
Returns document identifier in `IdentifierWASM`
|
|
87
|
+
|
|
88
|
+
```js
|
|
89
|
+
documentInstance.getId() // -> IdentifierWASM
|
|
90
|
+
```
|
|
91
|
+
|
|
92
|
+
___
|
|
93
|
+
|
|
94
|
+
### `getEntropy`
|
|
95
|
+
|
|
96
|
+
Returns document entropy in `Uint8Array`
|
|
97
|
+
|
|
98
|
+
```js
|
|
99
|
+
documentInstance.getEntropy() // -> Uint8Array <...>
|
|
100
|
+
```
|
|
101
|
+
|
|
102
|
+
___
|
|
103
|
+
|
|
104
|
+
### `getDataContractId`
|
|
105
|
+
|
|
106
|
+
Returns data contract identifier in `IdentifierWASM`
|
|
107
|
+
|
|
108
|
+
```js
|
|
109
|
+
documentInstance.getDataContractId() // -> IdentifierWASM
|
|
110
|
+
```
|
|
111
|
+
|
|
112
|
+
___
|
|
113
|
+
|
|
114
|
+
### `getOwnerId`
|
|
115
|
+
|
|
116
|
+
Returns document owner identifier in `IdentifierWASM`
|
|
117
|
+
|
|
118
|
+
```js
|
|
119
|
+
documentInstance.getOwnerId() // -> IdentifierWASM
|
|
120
|
+
```
|
|
121
|
+
|
|
122
|
+
___
|
|
123
|
+
|
|
124
|
+
### `getProperties`
|
|
125
|
+
|
|
126
|
+
Returns document properties in `Object`
|
|
127
|
+
|
|
128
|
+
```js
|
|
129
|
+
documentInstance.getProperties() // -> Object
|
|
130
|
+
```
|
|
131
|
+
|
|
132
|
+
___
|
|
133
|
+
|
|
134
|
+
### `getRevision`
|
|
135
|
+
|
|
136
|
+
Returns document revision in `BigInt`
|
|
137
|
+
|
|
138
|
+
```js
|
|
139
|
+
documentInstance.getRevision() // -> BigInt
|
|
140
|
+
```
|
|
141
|
+
|
|
142
|
+
___
|
|
143
|
+
|
|
144
|
+
### `getCreatedAt`
|
|
145
|
+
|
|
146
|
+
Returns creation timestamp in `BigInt | undefined`
|
|
147
|
+
|
|
148
|
+
```js
|
|
149
|
+
documentInstance.getCreatedAt() // -> BigInt | undefined
|
|
150
|
+
```
|
|
151
|
+
|
|
152
|
+
___
|
|
153
|
+
|
|
154
|
+
### `getUpdatedAt`
|
|
155
|
+
|
|
156
|
+
Returns update timestamp in `BigInt | undefined`
|
|
157
|
+
|
|
158
|
+
```js
|
|
159
|
+
documentInstance.getUpdatedAt() // -> BigInt | undefined
|
|
160
|
+
```
|
|
161
|
+
|
|
162
|
+
___
|
|
163
|
+
|
|
164
|
+
### `getTransferredAt`
|
|
165
|
+
|
|
166
|
+
Returns transfer timestamp in `BigInt | undefined`
|
|
167
|
+
|
|
168
|
+
```js
|
|
169
|
+
documentInstance.getTransferredAt() // -> BigInt | undefined
|
|
170
|
+
```
|
|
171
|
+
|
|
172
|
+
___
|
|
173
|
+
|
|
174
|
+
### `getCreatedAtBlockHeight`
|
|
175
|
+
|
|
176
|
+
Returns creation block height in `BigInt | undefined`
|
|
177
|
+
|
|
178
|
+
```js
|
|
179
|
+
documentInstance.getCreatedAtBlockHeight() // -> BigInt | undefined
|
|
180
|
+
```
|
|
181
|
+
|
|
182
|
+
___
|
|
183
|
+
|
|
184
|
+
### `getUpdatedAtBlockHeight`
|
|
185
|
+
|
|
186
|
+
Returns update block height in `BigInt | undefined`
|
|
187
|
+
|
|
188
|
+
```js
|
|
189
|
+
documentInstance.getUpdatedAtBlockHeight() // -> BigInt | undefined
|
|
190
|
+
```
|
|
191
|
+
|
|
192
|
+
___
|
|
193
|
+
|
|
194
|
+
### `getTransferredAtBlockHeight`
|
|
195
|
+
|
|
196
|
+
Returns transfer block height in `BigInt | undefined`
|
|
197
|
+
|
|
198
|
+
```js
|
|
199
|
+
documentInstance.getTransferredAtBlockHeight() // -> BigInt | undefined
|
|
200
|
+
```
|
|
201
|
+
|
|
202
|
+
___
|
|
203
|
+
|
|
204
|
+
### `getCreatedAtCoreBlockHeight`
|
|
205
|
+
|
|
206
|
+
Returns creation core block height in `BigInt | undefined`
|
|
207
|
+
|
|
208
|
+
```js
|
|
209
|
+
documentInstance.getCreatedAtCoreBlockHeight() // -> BigInt | undefined
|
|
210
|
+
```
|
|
211
|
+
|
|
212
|
+
___
|
|
213
|
+
|
|
214
|
+
### `getUpdatedAtCoreBlockHeight`
|
|
215
|
+
|
|
216
|
+
Returns update core block height in `BigInt | undefined`
|
|
217
|
+
|
|
218
|
+
```js
|
|
219
|
+
documentInstance.getUpdatedAtCoreBlockHeight() // -> BigInt | undefined
|
|
220
|
+
```
|
|
221
|
+
|
|
222
|
+
___
|
|
223
|
+
|
|
224
|
+
### `getTransferredAtCoreBlockHeight`
|
|
225
|
+
|
|
226
|
+
Returns transfer core block height in `BigInt | undefined`
|
|
227
|
+
|
|
228
|
+
```js
|
|
229
|
+
documentInstance.getTransferredAtCoreBlockHeight() // -> BigInt | undefined
|
|
230
|
+
```
|
|
231
|
+
|
|
232
|
+
### `getDocumentTypeName`
|
|
233
|
+
|
|
234
|
+
Returns document type name in `String`
|
|
235
|
+
|
|
236
|
+
```js
|
|
237
|
+
documentInstance.getDocumentTypeName() // -> String
|
|
238
|
+
```
|
|
239
|
+
|
|
240
|
+
## Setters methods
|
|
241
|
+
|
|
242
|
+
### `setId`
|
|
243
|
+
|
|
244
|
+
Allows to set document identifier
|
|
245
|
+
|
|
246
|
+
```js
|
|
247
|
+
documentInstance.setId('11111111111111111111111111111111')
|
|
248
|
+
```
|
|
249
|
+
|
|
250
|
+
___
|
|
251
|
+
|
|
252
|
+
### `setEntropy`
|
|
253
|
+
|
|
254
|
+
Allows to set entropy from 32 bytes array
|
|
255
|
+
|
|
256
|
+
```js
|
|
257
|
+
documentInstance.setEntropy([1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1])
|
|
258
|
+
```
|
|
259
|
+
|
|
260
|
+
___
|
|
261
|
+
|
|
262
|
+
### `setDataContractId`
|
|
263
|
+
|
|
264
|
+
Allows to set data contract identifier
|
|
265
|
+
|
|
266
|
+
```js
|
|
267
|
+
documentInstance.setDataContractId('11111111111111111111111111111111')
|
|
268
|
+
```
|
|
269
|
+
|
|
270
|
+
___
|
|
271
|
+
|
|
272
|
+
### `setOwnerId`
|
|
273
|
+
|
|
274
|
+
Allows to set owner identifier
|
|
275
|
+
|
|
276
|
+
```js
|
|
277
|
+
documentInstance.setOwnerId('11111111111111111111111111111111')
|
|
278
|
+
```
|
|
279
|
+
|
|
280
|
+
___
|
|
281
|
+
|
|
282
|
+
### `setProperties`
|
|
283
|
+
|
|
284
|
+
Allows to set document properties
|
|
285
|
+
|
|
286
|
+
```js
|
|
287
|
+
documentInstance.setProperties({"message": "Tutorial CI Test @ Tue, 07 Jan 2025 15:27:50 GMT"})
|
|
288
|
+
```
|
|
289
|
+
|
|
290
|
+
___
|
|
291
|
+
|
|
292
|
+
### `setRevision`
|
|
293
|
+
|
|
294
|
+
Allows to set document revision
|
|
295
|
+
|
|
296
|
+
```js
|
|
297
|
+
documentInstance.setRevision(BigInt(11))
|
|
298
|
+
```
|
|
299
|
+
|
|
300
|
+
___
|
|
301
|
+
|
|
302
|
+
### `setCreatedAt`
|
|
303
|
+
|
|
304
|
+
Allow to set creation timestamp
|
|
305
|
+
|
|
306
|
+
```js
|
|
307
|
+
documentInstance.setCreatedAt(BigInt(1745719987))
|
|
308
|
+
```
|
|
309
|
+
|
|
310
|
+
___
|
|
311
|
+
|
|
312
|
+
### `setUpdatedAt`
|
|
313
|
+
|
|
314
|
+
Allows to set update timestamp
|
|
315
|
+
|
|
316
|
+
```js
|
|
317
|
+
documentInstance.setUpdatedAt(BigInt(1745719987))
|
|
318
|
+
```
|
|
319
|
+
|
|
320
|
+
___
|
|
321
|
+
|
|
322
|
+
### `setTransferredAt`
|
|
323
|
+
|
|
324
|
+
Allows to set transfer timestamp
|
|
325
|
+
|
|
326
|
+
```js
|
|
327
|
+
documentInstance.setTransferredAt(BigInt(1745719987))
|
|
328
|
+
```
|
|
329
|
+
|
|
330
|
+
___
|
|
331
|
+
|
|
332
|
+
### `setCreatedAtBlockHeight`
|
|
333
|
+
|
|
334
|
+
Allows to set creation tx block height
|
|
335
|
+
|
|
336
|
+
```js
|
|
337
|
+
documentInstance.setCreatedAtBlockHeight(BigInt(12345))
|
|
338
|
+
```
|
|
339
|
+
|
|
340
|
+
___
|
|
341
|
+
|
|
342
|
+
### `setUpdatedAtBlockHeight`
|
|
343
|
+
|
|
344
|
+
Allows to set update tx block height
|
|
345
|
+
|
|
346
|
+
```js
|
|
347
|
+
documentInstance.setUpdatedAtBlockHeight(BigInt(12345))
|
|
348
|
+
```
|
|
349
|
+
|
|
350
|
+
___
|
|
351
|
+
|
|
352
|
+
### `setTransferredAtBlockHeight`
|
|
353
|
+
|
|
354
|
+
Allows to set transfer tx block height
|
|
355
|
+
|
|
356
|
+
```js
|
|
357
|
+
documentInstance.getTransferredAtBlockHeight(BigInt(12345))
|
|
358
|
+
```
|
|
359
|
+
|
|
360
|
+
___
|
|
361
|
+
|
|
362
|
+
### `setCreatedAtCoreBlockHeight`
|
|
363
|
+
|
|
364
|
+
Allows to set creation tx core block height
|
|
365
|
+
|
|
366
|
+
```js
|
|
367
|
+
documentInstance.setCreatedAtCoreBlockHeight(BigInt(12345))
|
|
368
|
+
```
|
|
369
|
+
|
|
370
|
+
___
|
|
371
|
+
|
|
372
|
+
### `setUpdatedAtCoreBlockHeight`
|
|
373
|
+
|
|
374
|
+
Allows to set update tx core block height
|
|
375
|
+
|
|
376
|
+
```js
|
|
377
|
+
documentInstance.setUpdatedAtCoreBlockHeight(BigInt(12345))
|
|
378
|
+
```
|
|
379
|
+
|
|
380
|
+
___
|
|
381
|
+
|
|
382
|
+
### `setTransferredAtCoreBlockHeight`
|
|
383
|
+
|
|
384
|
+
Allows to set transfer tx core block height
|
|
385
|
+
|
|
386
|
+
```js
|
|
387
|
+
documentInstance.setTransferredAtCoreBlockHeight(BigInt(12345))
|
|
388
|
+
```
|
|
389
|
+
|
|
390
|
+
### `setDocumentTypeName`
|
|
391
|
+
|
|
392
|
+
Allows to set document type name
|
|
393
|
+
|
|
394
|
+
```js
|
|
395
|
+
documentInstance.setDocumentTypeName('name')
|
|
396
|
+
```
|
|
@@ -0,0 +1,111 @@
|
|
|
1
|
+
# DocumentBaseTransitionWASM
|
|
2
|
+
|
|
3
|
+
This class allows to create DocumentBaseTransition and interact.
|
|
4
|
+
|
|
5
|
+
This class used in DocumentTransitions
|
|
6
|
+
|
|
7
|
+
`DocumentBaseTransitionWASM` can be created only via constructor
|
|
8
|
+
|
|
9
|
+
Constructor arguments:
|
|
10
|
+
- `documentId -> IdentifierWASM | String | ArrayLike`
|
|
11
|
+
- `identityContractNonce -> BigInt`
|
|
12
|
+
- `documentTypeName -> String`
|
|
13
|
+
- `dataContractId -> IdentifierWASM | String | ArrayLike`
|
|
14
|
+
|
|
15
|
+
___
|
|
16
|
+
|
|
17
|
+
## Navigation
|
|
18
|
+
- [Example](#example)
|
|
19
|
+
- [Fields](#fields)
|
|
20
|
+
- [id](#id)
|
|
21
|
+
- [identityContractNonce](#identitycontractnonce)
|
|
22
|
+
- [dataContractId](#datacontractid)
|
|
23
|
+
- [documentTypeName](#documenttypename)
|
|
24
|
+
|
|
25
|
+
___
|
|
26
|
+
|
|
27
|
+
## Example
|
|
28
|
+
|
|
29
|
+
```js
|
|
30
|
+
new DocumentBaseTransitionWASM(
|
|
31
|
+
'9tSsCqKHTZ8ro16MydChSxgHBukFW36eMLJKKRtebJEn',
|
|
32
|
+
BigInt(12350),
|
|
33
|
+
'note',
|
|
34
|
+
'CXH2kZCATjvDTnQAPVg28EgPg9WySUvwvnR5ZkmNqY5i'
|
|
35
|
+
)
|
|
36
|
+
```
|
|
37
|
+
|
|
38
|
+
___
|
|
39
|
+
|
|
40
|
+
## Fields
|
|
41
|
+
All fields are readable and writable.
|
|
42
|
+
|
|
43
|
+
### `id`
|
|
44
|
+
Returns document id in `IdentfierWASM`
|
|
45
|
+
|
|
46
|
+
```js
|
|
47
|
+
const base = new DocumentBaseTransitionWASM(
|
|
48
|
+
'9tSsCqKHTZ8ro16MydChSxgHBukFW36eMLJKKRtebJEn',
|
|
49
|
+
BigInt(12350),
|
|
50
|
+
'note',
|
|
51
|
+
'CXH2kZCATjvDTnQAPVg28EgPg9WySUvwvnR5ZkmNqY5i'
|
|
52
|
+
)
|
|
53
|
+
|
|
54
|
+
base.id // -> IdentifierWASM
|
|
55
|
+
|
|
56
|
+
base.id = 'CXH2kZCATjvDTnQAPVg28EgPg9WySUvwvnR5ZkmNqY5i'
|
|
57
|
+
```
|
|
58
|
+
|
|
59
|
+
___
|
|
60
|
+
|
|
61
|
+
### `identityContractNonce`
|
|
62
|
+
Returns identity contract nonce for transition in `BigInt`
|
|
63
|
+
|
|
64
|
+
```js
|
|
65
|
+
const base = new DocumentBaseTransitionWASM(
|
|
66
|
+
'9tSsCqKHTZ8ro16MydChSxgHBukFW36eMLJKKRtebJEn',
|
|
67
|
+
BigInt(12350),
|
|
68
|
+
'note',
|
|
69
|
+
'CXH2kZCATjvDTnQAPVg28EgPg9WySUvwvnR5ZkmNqY5i'
|
|
70
|
+
)
|
|
71
|
+
|
|
72
|
+
base.identityContractNonce // -> BigInt
|
|
73
|
+
|
|
74
|
+
base.identityContractNonce = BigInt(11)
|
|
75
|
+
```
|
|
76
|
+
|
|
77
|
+
___
|
|
78
|
+
|
|
79
|
+
### `dataContractId`
|
|
80
|
+
Returns data contract id in `IdentifierWASM`
|
|
81
|
+
|
|
82
|
+
```js
|
|
83
|
+
const base = new DocumentBaseTransitionWASM(
|
|
84
|
+
'9tSsCqKHTZ8ro16MydChSxgHBukFW36eMLJKKRtebJEn',
|
|
85
|
+
BigInt(12350),
|
|
86
|
+
'note',
|
|
87
|
+
'CXH2kZCATjvDTnQAPVg28EgPg9WySUvwvnR5ZkmNqY5i'
|
|
88
|
+
)
|
|
89
|
+
|
|
90
|
+
base.dataContractId // -> IdentifierWASM
|
|
91
|
+
|
|
92
|
+
base.dataContractId = '9tSsCqKHTZ8ro16MydChSxgHBukFW36eMLJKKRtebJEn'
|
|
93
|
+
```
|
|
94
|
+
|
|
95
|
+
___
|
|
96
|
+
|
|
97
|
+
### `documentTypeName`
|
|
98
|
+
Returns document type name in `String`
|
|
99
|
+
|
|
100
|
+
```js
|
|
101
|
+
const base = new DocumentBaseTransitionWASM(
|
|
102
|
+
'9tSsCqKHTZ8ro16MydChSxgHBukFW36eMLJKKRtebJEn',
|
|
103
|
+
BigInt(12350),
|
|
104
|
+
'note',
|
|
105
|
+
'CXH2kZCATjvDTnQAPVg28EgPg9WySUvwvnR5ZkmNqY5i'
|
|
106
|
+
)
|
|
107
|
+
|
|
108
|
+
base.documentTypeName // -> String
|
|
109
|
+
|
|
110
|
+
base.documentTypeName = 'note2'
|
|
111
|
+
```
|
|
@@ -0,0 +1,132 @@
|
|
|
1
|
+
# DocumentCreateTransitionWASM
|
|
2
|
+
|
|
3
|
+
This class allows to create DocumentCreateTransition and interact
|
|
4
|
+
|
|
5
|
+
`DocumentCreateTransitionWASM` 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
|
+
- [data](#data)
|
|
20
|
+
- [base](#base)
|
|
21
|
+
- [entropy](#entropy)
|
|
22
|
+
- [prefundedVotingBalance](#prefundedvotingbalance)
|
|
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 createTransition = new DocumentCreateTransitionWASM(documentInstance, BigInt(1), 'note')
|
|
39
|
+
```
|
|
40
|
+
|
|
41
|
+
___
|
|
42
|
+
|
|
43
|
+
## Fields
|
|
44
|
+
|
|
45
|
+
All fields are readable and writable.
|
|
46
|
+
|
|
47
|
+
### `data`
|
|
48
|
+
|
|
49
|
+
Contains document data in `Object`
|
|
50
|
+
|
|
51
|
+
```js
|
|
52
|
+
const createTransition = new DocumentCreateTransitionWASM(documentInstance, BigInt(1), 'note')
|
|
53
|
+
|
|
54
|
+
createTransition.data // -> Object
|
|
55
|
+
|
|
56
|
+
createTransition.data = {"message": "Tutorial CI Test @ Tue, 07 Jan 2025 15:27:50 GMT"}
|
|
57
|
+
```
|
|
58
|
+
|
|
59
|
+
___
|
|
60
|
+
|
|
61
|
+
### `base`
|
|
62
|
+
|
|
63
|
+
Contains document base transition `DocumentBaseTransitionWASM`
|
|
64
|
+
|
|
65
|
+
```js
|
|
66
|
+
const createTransition = new DocumentCreateTransitionWASM(documentInstance, BigInt(1), 'note')
|
|
67
|
+
|
|
68
|
+
const base = new DocumentBaseTransitionWASM(
|
|
69
|
+
'9tSsCqKHTZ8ro16MydChSxgHBukFW36eMLJKKRtebJEn',
|
|
70
|
+
BigInt(12350),
|
|
71
|
+
'note',
|
|
72
|
+
'CXH2kZCATjvDTnQAPVg28EgPg9WySUvwvnR5ZkmNqY5i'
|
|
73
|
+
)
|
|
74
|
+
|
|
75
|
+
createTransition.base // -> DocumentBaseTransitionWASM
|
|
76
|
+
|
|
77
|
+
createTransition.base = base
|
|
78
|
+
```
|
|
79
|
+
|
|
80
|
+
___
|
|
81
|
+
|
|
82
|
+
### `entropy`
|
|
83
|
+
|
|
84
|
+
Contains entropy for create transition 32 bytes length in `Uint8Array`
|
|
85
|
+
|
|
86
|
+
```js
|
|
87
|
+
const createTransition = new DocumentCreateTransitionWASM(documentInstance, BigInt(1), 'note')
|
|
88
|
+
|
|
89
|
+
createTransition.entropy // -> Uint8Array
|
|
90
|
+
|
|
91
|
+
createTransition.entropy = [1]
|
|
92
|
+
```
|
|
93
|
+
|
|
94
|
+
___
|
|
95
|
+
|
|
96
|
+
### `prefundedVotingBalance`
|
|
97
|
+
|
|
98
|
+
Contains info about prefunded voting balance in `?PrefundedVotingBalanceWASM`
|
|
99
|
+
|
|
100
|
+
```js
|
|
101
|
+
const createTransition = new DocumentCreateTransitionWASM(documentInstance, BigInt(1), 'note')
|
|
102
|
+
|
|
103
|
+
const prefundedVotingBalance = new PrefundedVotingBalanceWASM('note', BigInt(9999))
|
|
104
|
+
|
|
105
|
+
createTransition.prefundedVotingBalance // -> ?PrefundedVotingBalanceWASM
|
|
106
|
+
|
|
107
|
+
createTransition.prefundedVotingBalance = prefundedVotingBalance
|
|
108
|
+
|
|
109
|
+
createTransition.clearPrefundedVotingBalance() // createTransition.prefundedVotingBalance = undefined
|
|
110
|
+
|
|
111
|
+
```
|
|
112
|
+
|
|
113
|
+
___
|
|
114
|
+
|
|
115
|
+
## Getters methods
|
|
116
|
+
|
|
117
|
+
### `toDocumentTransition`
|
|
118
|
+
|
|
119
|
+
Returns document create transition in `DocumentCreateTransitionWASM`
|
|
120
|
+
|
|
121
|
+
```js
|
|
122
|
+
const dataContractIdentifier = new IdentifierWASM('GnXgMaiqAwTxh44ccQe8AoCgFvcseHK5CncH3sUorW4X')
|
|
123
|
+
const ownerIdentifier = new IdentifierWASM('CXH2kZCATjvDTnQAPVg28EgPg9WySUvwvnR5ZkmNqY5i')
|
|
124
|
+
|
|
125
|
+
const properties = {"message": "Tutorial CI Test @ Tue, 07 Jan 2025 15:27:50 GMT"}
|
|
126
|
+
|
|
127
|
+
const documentInstance = new DocumentWASM(properties, "note", BigInt(1), dataContractIdentifier, ownerIdentifier)
|
|
128
|
+
|
|
129
|
+
const createTransition = new DocumentCreateTransitionWASM(documentInstance, BigInt(1), 'note')
|
|
130
|
+
|
|
131
|
+
createTransition.toDocumentTransition() // -> DocumentTransitionWASM
|
|
132
|
+
```
|
|
@@ -0,0 +1,82 @@
|
|
|
1
|
+
# DocumentDeleteTransitionWASM
|
|
2
|
+
|
|
3
|
+
This class allows to create DocumentDeleteTransition and interact
|
|
4
|
+
|
|
5
|
+
`DocumentDeleteTransitionWASM` 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
|
+
- [Getters methods](#getters-methods)
|
|
21
|
+
- [toDocumentTransition](#todocumenttransition)
|
|
22
|
+
|
|
23
|
+
___
|
|
24
|
+
|
|
25
|
+
## Example
|
|
26
|
+
|
|
27
|
+
```js
|
|
28
|
+
const dataContractIdentifier = new IdentifierWASM('GnXgMaiqAwTxh44ccQe8AoCgFvcseHK5CncH3sUorW4X')
|
|
29
|
+
const ownerIdentifier = new IdentifierWASM('CXH2kZCATjvDTnQAPVg28EgPg9WySUvwvnR5ZkmNqY5i')
|
|
30
|
+
|
|
31
|
+
const properties = {"message": "Tutorial CI Test @ Tue, 07 Jan 2025 15:27:50 GMT"}
|
|
32
|
+
|
|
33
|
+
const documentInstance = new DocumentWASM(properties, "note", BigInt(1), dataContractIdentifier, ownerIdentifier)
|
|
34
|
+
|
|
35
|
+
const deleteTransition = new DocumentDeleteTransitionWASM(documentInstance, BigInt(1), 'preorder')
|
|
36
|
+
```
|
|
37
|
+
|
|
38
|
+
___
|
|
39
|
+
|
|
40
|
+
## Fields
|
|
41
|
+
|
|
42
|
+
All fields are readable and writable.
|
|
43
|
+
|
|
44
|
+
### `base`
|
|
45
|
+
|
|
46
|
+
Contains document base transition `DocumentBaseTransitionWASM`
|
|
47
|
+
|
|
48
|
+
```js
|
|
49
|
+
const deleteTransition = new DocumentDeleteTransitionWASM(documentInstance, BigInt(1), 'preorder')
|
|
50
|
+
|
|
51
|
+
const base = new DocumentBaseTransitionWASM(
|
|
52
|
+
'9tSsCqKHTZ8ro16MydChSxgHBukFW36eMLJKKRtebJEn',
|
|
53
|
+
BigInt(12350),
|
|
54
|
+
'note',
|
|
55
|
+
'CXH2kZCATjvDTnQAPVg28EgPg9WySUvwvnR5ZkmNqY5i'
|
|
56
|
+
)
|
|
57
|
+
|
|
58
|
+
deleteTransition.base // -> DocumentBaseTransitionWASM
|
|
59
|
+
|
|
60
|
+
deleteTransition.base = base
|
|
61
|
+
```
|
|
62
|
+
|
|
63
|
+
___
|
|
64
|
+
|
|
65
|
+
## Getters methods
|
|
66
|
+
|
|
67
|
+
### `toDocumentTransition`
|
|
68
|
+
|
|
69
|
+
Returns document create transition in `DocumentCreateTransitionWASM`
|
|
70
|
+
|
|
71
|
+
```js
|
|
72
|
+
const dataContractIdentifier = new IdentifierWASM('GnXgMaiqAwTxh44ccQe8AoCgFvcseHK5CncH3sUorW4X')
|
|
73
|
+
const ownerIdentifier = new IdentifierWASM('CXH2kZCATjvDTnQAPVg28EgPg9WySUvwvnR5ZkmNqY5i')
|
|
74
|
+
|
|
75
|
+
const properties = {"message": "Tutorial CI Test @ Tue, 07 Jan 2025 15:27:50 GMT"}
|
|
76
|
+
|
|
77
|
+
const documentInstance = new DocumentWASM(properties, "note", BigInt(1), dataContractIdentifier, ownerIdentifier)
|
|
78
|
+
|
|
79
|
+
const deleteTransition = new DocumentDeleteTransitionWASM(documentInstance, BigInt(1), 'preorder')
|
|
80
|
+
|
|
81
|
+
deleteTransition.toDocumentTransition() // -> DocumentTransitionWASM
|
|
82
|
+
```
|