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.
Files changed (152) hide show
  1. package/.github/workflows/build.yml +9 -1
  2. package/.github/workflows/publish.yml +9 -1
  3. package/Cargo.lock +222 -76
  4. package/Cargo.toml +28 -19
  5. package/README.md +75 -23
  6. package/babel.config.json +19 -0
  7. package/dist/wasm/index.d.ts +52 -0
  8. package/dist/wasm/pshenmic_dpp.d.ts +962 -0
  9. package/dist/wasm/pshenmic_dpp.js +5565 -966
  10. package/dist/wasm/pshenmic_dpp_bg.js +1 -1
  11. package/dist/wasm/pshenmic_dpp_bg.wasm.d.ts +440 -0
  12. package/docs/AssetLockProof.md +107 -0
  13. package/docs/Building.md +50 -0
  14. package/docs/ChainLockProof.md +63 -0
  15. package/docs/CoreScript.md +17 -0
  16. package/docs/DataContract.md +192 -0
  17. package/docs/DataContractCreateTransition.md +84 -0
  18. package/docs/DataContractUpdateTransition.md +84 -0
  19. package/docs/Document.md +396 -0
  20. package/docs/DocumentBaseTransition.md +111 -0
  21. package/docs/DocumentCreateTransition.md +132 -0
  22. package/docs/DocumentDeleteTransition.md +82 -0
  23. package/docs/DocumentPurchaseTransition.md +109 -0
  24. package/docs/DocumentReplaceTransition.md +112 -0
  25. package/docs/DocumentTransferTransition.md +96 -0
  26. package/docs/DocumentTransition.md +125 -0
  27. package/docs/DocumentUpdatePriceTransition.md +109 -0
  28. package/docs/DocumentsBatch.md +133 -0
  29. package/docs/Enums.md +103 -0
  30. package/docs/Home.md +28 -0
  31. package/docs/Identifier.md +37 -0
  32. package/docs/Identity.md +140 -0
  33. package/docs/IdentityCreateTransition.md +155 -0
  34. package/docs/IdentityCreditTransfer.md +187 -0
  35. package/docs/IdentityCreditWithdrawalTransition.md +244 -0
  36. package/docs/IdentityPublicKey.md +348 -0
  37. package/docs/IdentityPublicKeyInCreation.md +141 -0
  38. package/docs/IdentityTopUpTransition.md +166 -0
  39. package/docs/IdentityUpdateTransition.md +234 -0
  40. package/docs/InstantAssetLockProof.md +117 -0
  41. package/docs/InstantLock.md +100 -0
  42. package/docs/OutPoint.md +80 -0
  43. package/docs/PrefundedVotingBalance.md +48 -0
  44. package/docs/PrivateKey.md +112 -0
  45. package/docs/TxOut.md +93 -0
  46. package/package.json +15 -8
  47. package/packages/asset_lock_proof/Cargo.toml +19 -0
  48. package/packages/asset_lock_proof/src/chain/mod.rs +79 -0
  49. package/packages/asset_lock_proof/src/instant/instant_lock.rs +111 -0
  50. package/packages/asset_lock_proof/src/instant/mod.rs +115 -0
  51. package/packages/asset_lock_proof/src/lib.rs +133 -0
  52. package/packages/asset_lock_proof/src/outpoint/mod.rs +79 -0
  53. package/packages/asset_lock_proof/src/tx_out/mod.rs +80 -0
  54. package/packages/cbor_conversation/Cargo.toml +2 -2
  55. package/packages/core_script/Cargo.toml +13 -0
  56. package/packages/core_script/src/lib.rs +69 -0
  57. package/packages/data_contract/Cargo.toml +4 -3
  58. package/packages/data_contract/src/lib.rs +209 -33
  59. package/packages/data_contract_transitions/Cargo.toml +2 -2
  60. package/packages/data_contract_transitions/src/create/mod.rs +23 -16
  61. package/packages/data_contract_transitions/src/update/mod.rs +21 -12
  62. package/packages/document/Cargo.toml +3 -2
  63. package/packages/document/src/lib.rs +14 -13
  64. package/packages/document/src/methods/mod.rs +373 -2
  65. package/packages/{document_batch → documents_batch}/Cargo.toml +7 -4
  66. package/packages/documents_batch/src/document_base_transition/mod.rs +88 -0
  67. package/packages/documents_batch/src/document_transition/mod.rs +166 -0
  68. package/packages/documents_batch/src/generators.rs +122 -0
  69. package/packages/documents_batch/src/lib.rs +195 -0
  70. package/packages/documents_batch/src/prefunded_voting_balance/mod.rs +45 -0
  71. package/packages/documents_batch/src/transitions/create/mod.rs +126 -0
  72. package/packages/documents_batch/src/transitions/delete/mod.rs +67 -0
  73. package/packages/documents_batch/src/transitions/mod.rs +6 -0
  74. package/packages/documents_batch/src/transitions/purchase/mod.rs +91 -0
  75. package/packages/documents_batch/src/transitions/replace/mod.rs +93 -0
  76. package/packages/documents_batch/src/transitions/transfer/mod.rs +84 -0
  77. package/packages/documents_batch/src/transitions/update_price/mod.rs +75 -0
  78. package/packages/enums/Cargo.toml +4 -4
  79. package/packages/enums/src/batch/batch_enum.rs +75 -10
  80. package/packages/enums/src/keys/key_type.rs +46 -0
  81. package/packages/enums/src/keys/purpose.rs +55 -0
  82. package/packages/enums/src/keys/security_level.rs +46 -0
  83. package/packages/enums/src/lib.rs +3 -0
  84. package/packages/enums/src/lock_types/mod.rs +65 -0
  85. package/packages/enums/src/network/mod.rs +67 -0
  86. package/packages/enums/src/platform/mod.rs +68 -8
  87. package/packages/enums/src/withdrawal/mod.rs +72 -0
  88. package/packages/identifier/Cargo.toml +9 -0
  89. package/packages/identifier/src/lib.rs +105 -0
  90. package/packages/identity/Cargo.toml +5 -5
  91. package/packages/identity/src/lib.rs +31 -25
  92. package/packages/{public_key → identity_public_key}/Cargo.toml +2 -2
  93. package/packages/{public_key → identity_public_key}/src/lib.rs +74 -27
  94. package/packages/identity_transitions/Cargo.toml +8 -4
  95. package/packages/identity_transitions/src/create_transition/mod.rs +102 -37
  96. package/packages/identity_transitions/src/credit_withdrawal_transition/mod.rs +212 -0
  97. package/packages/identity_transitions/src/identity_credit_transfer_transition/mod.rs +169 -0
  98. package/packages/identity_transitions/src/lib.rs +6 -1
  99. package/packages/identity_transitions/src/public_key_in_creation/mod.rs +197 -0
  100. package/packages/identity_transitions/src/top_up_transition/mod.rs +141 -0
  101. package/packages/identity_transitions/src/update_transition/mod.rs +213 -0
  102. package/packages/mock_bls/Cargo.toml +1 -1
  103. package/packages/private_key/Cargo.toml +4 -3
  104. package/packages/private_key/src/lib.rs +44 -6
  105. package/packages/state_transition/Cargo.toml +6 -4
  106. package/packages/state_transition/src/lib.rs +102 -36
  107. package/packages/utils/Cargo.toml +3 -4
  108. package/packages/utils/src/lib.rs +17 -18
  109. package/scripts/build-js.sh +22 -5
  110. package/scripts/build.sh +27 -2
  111. package/src/lib.rs +8 -1
  112. package/tests/AssetLockProof.spec.js +80 -0
  113. package/tests/ChainLockProof.spec.js +69 -0
  114. package/tests/CoreScript.spec.js +37 -0
  115. package/tests/DataContract.spec.js +178 -0
  116. package/tests/DataContractCreateStateTransition.spec.js +109 -0
  117. package/tests/DataContractUpdateStateTransition.spec.js +109 -0
  118. package/tests/Document.spec.js +238 -0
  119. package/tests/DocumentBatchTransition.spec.js +109 -0
  120. package/tests/DocumentTransition.spec.js +97 -0
  121. package/tests/DocumentsTransitions.spec.js +705 -0
  122. package/tests/Identifier.spec.js +84 -0
  123. package/tests/Identity.spec.js +113 -0
  124. package/tests/IdentityCreateTransition.spec.js +93 -0
  125. package/tests/IdentityCreditTransferTransition.spec.js +146 -0
  126. package/tests/IdentityCreditWithdrawalTransition.spec.js +192 -0
  127. package/tests/IdentityPublicKey.spec.js +132 -0
  128. package/tests/IdentityTopUpTransition.spec.js +131 -0
  129. package/tests/IdentityUpdateTransition.spec.js +147 -0
  130. package/tests/InstantLockProof.spec.js +97 -0
  131. package/tests/OutPoint.spec.js +55 -0
  132. package/tests/PrivateKey.spec.js +73 -0
  133. package/tests/PublicKeyInCreation.spec.js +258 -0
  134. package/tests/TxOut.spec.js +76 -0
  135. package/tests/mocks/DataContract/DataContract.json +153 -0
  136. package/tests/mocks/DataContract/index.js +6 -0
  137. package/tests/mocks/Document/DataContract.json +23 -0
  138. package/tests/mocks/Document/document.json +3 -0
  139. package/tests/mocks/Document/document2.json +3 -0
  140. package/tests/mocks/Document/index.js +11 -0
  141. package/tests/mocks/Identity/index.js +7 -0
  142. package/tests/mocks/Locks/index.js +5 -0
  143. package/tests/mocks/PrivateKey/index.js +5 -0
  144. package/tests/mocks/PublicKey/index.js +14 -0
  145. package/tests/utils/hex.js +15 -0
  146. package/tests/utils/wasm.js +14 -0
  147. package/typings/index.d.ts +52 -0
  148. package/packages/document/src/methods/js.rs +0 -260
  149. package/packages/document/src/methods/rust.rs +0 -92
  150. package/packages/document_batch/src/generators.rs +0 -63
  151. package/packages/document_batch/src/lib.rs +0 -228
  152. package/packages/identity_transitions/src/create_transition/public_key_in_creation/mod.rs +0 -146
@@ -0,0 +1,244 @@
1
+ # IdentityCreditWithdrawalTransitionWASM
2
+
3
+ This class allows to create instance of IdentityCreditWithdrawalTransition struct
4
+
5
+ `IdentityCreditWithdrawalTransitionWASM` can be created via constructor, bytes and state transition
6
+
7
+ Constructor params:
8
+
9
+ - `identityId -> IdentifierWASM | String | ArrayLike`
10
+ - `amount -> BigInt`
11
+ - `coreFeePerByte -> Number`
12
+ - `pooling -> PoolingENUM`
13
+ - `outputScript -> OutPutScript`
14
+ - `nonce -> BigInt`
15
+ - `userFeeIncrease -> Number`
16
+
17
+ ___
18
+
19
+ ## Navigation
20
+
21
+ - [Example](#Example)
22
+ - [Fields](#fields)
23
+ - [userFeeIncrease](#userfeeincrease)
24
+ - [identityId](#identityid)
25
+ - [amount](#amount)
26
+ - [nonce](#nonce)
27
+ - [signature](#signature)
28
+ - [signaturePublicKeyId](#signaturepublickeyid)
29
+ - [pooling](#pooling)
30
+ - [outputScript](#outputscript)
31
+ - [Getters](#getters)
32
+ - [getPurposeRequirement](#getpurposerequirement)
33
+ - [getModifiedDataIds](#getmodifieddataids)
34
+ - [getOptionalAssetLockProof](#getoptionalassetlockproof)
35
+ - [getSignableBytes](#getsignablebytes)
36
+ - [toBytes](#tobytes)
37
+ - [toStateTransition](#tostatetransition)
38
+
39
+ ___
40
+
41
+ ### Example
42
+
43
+ ```js
44
+ const identifier = new wasm.IdentifierWASM('GWRSAVFMjXx8HpQFaNJMqBV7MBgMK4br5UESsB4S31Ec')
45
+ const script = wasm.CoreScriptWASM.newP2PKH([1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1])
46
+
47
+ const transition = new wasm.IdentityCreditWithdrawalTransitionWASM(identifier, BigInt(111), 1, 'never', script, BigInt(1), 1)
48
+ ```
49
+
50
+ ___
51
+
52
+ ## Fields
53
+
54
+ All fields are readable and writable.
55
+
56
+ ### `userFeeIncrease`
57
+
58
+ Contains userFeeIncrease in `Number`
59
+
60
+ ```js
61
+ const transition = new wasm.IdentityCreditWithdrawalTransitionWASM(identifier, BigInt(111), 1, 'never', script, BigInt(1), 1)
62
+
63
+ transition.userFeeIncrease = 99
64
+
65
+ transition.userFeeIncrease // -> Number
66
+ ```
67
+
68
+ ___
69
+
70
+ ### `identityId`
71
+
72
+ Contains identity identifier in `IdentifierWASM`
73
+
74
+ ```js
75
+ const transition = new wasm.IdentityCreditWithdrawalTransitionWASM(identifier, BigInt(111), 1, 'never', script, BigInt(1), 1)
76
+
77
+ transition.identityId = '12FRq8L3VuBEQfCAZykmUaiXXrsd1Bwub2gcaMmtNbn3'
78
+
79
+ transition.identityId // -> IdentifierWASM
80
+ ```
81
+
82
+ ___
83
+
84
+ ### `amount`
85
+
86
+ Contains credits amount for transfer in `BigInt`
87
+
88
+ ```js
89
+ const transition = new wasm.IdentityCreditWithdrawalTransitionWASM(identifier, BigInt(111), 1, 'never', script, BigInt(1), 1)
90
+
91
+ transition.amount = BigInt(999999999)
92
+
93
+ transition.amount // -> BigInt
94
+ ```
95
+
96
+ ___
97
+
98
+ ### `nonce`
99
+
100
+ Contains nonce in `BigInt`
101
+
102
+ ```js
103
+ const transition = new wasm.IdentityCreditWithdrawalTransitionWASM(identifier, BigInt(111), 1, 'never', script, BigInt(1), 1)
104
+
105
+ transition.nonce = BigInt(999999999)
106
+
107
+ transition.nonce // -> BigInt
108
+ ```
109
+
110
+ ___
111
+
112
+ ### `signature`
113
+
114
+ Contains signature in `Uint8Array`
115
+
116
+ ```js
117
+ const transition = new wasm.IdentityCreditWithdrawalTransitionWASM(identifier, BigInt(111), 1, 'never', script, BigInt(1), 1)
118
+
119
+ transition.signature = Uint8Array.from([1, 2, 3, 4, 5])
120
+
121
+ transition.signature // -> Uint8Array
122
+ ```
123
+
124
+ ___
125
+
126
+ ### `signaturePublicKeyId`
127
+
128
+ Contains signature public key id in `Number`
129
+
130
+ ```js
131
+ const transition = new wasm.IdentityCreditWithdrawalTransitionWASM(identifier, BigInt(111), 1, 'never', script, BigInt(1), 1)
132
+
133
+ transition.signaturePublicKeyId = 12
134
+
135
+ transition.signaturePublicKeyId // -> Number
136
+ ```
137
+
138
+ ___
139
+
140
+ ### `pooling`
141
+
142
+ Contains pooling enum in `String`
143
+
144
+ ```js
145
+ const transition = new wasm.IdentityCreditWithdrawalTransitionWASM(identifier, BigInt(111), 1, 'never', script, BigInt(1), 1)
146
+
147
+ transition.pooling = "never"
148
+
149
+ transition.pooling // -> Number
150
+ ```
151
+
152
+ ___
153
+
154
+ ### `outputScript`
155
+
156
+ Contains output script in `CoreScriptWASM | undefined`
157
+
158
+ ```js
159
+ const transition = new wasm.IdentityCreditWithdrawalTransitionWASM(identifier, BigInt(111), 1, 'never', script, BigInt(1), 1)
160
+
161
+ transition.outputScript = wasm.CoreScriptWASM.newP2PKH([1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1])
162
+
163
+ transition.outputScript // -> CoreScriptWASM
164
+ ```
165
+
166
+ ___
167
+
168
+ ## Getters
169
+
170
+ ### `getPurposeRequirement`
171
+
172
+ Returns purpose requirement in PurposeENUM `String`
173
+
174
+ ```js
175
+ const transition = new wasm.IdentityCreditWithdrawalTransitionWASM(identifier, BigInt(111), 1, 'never', script, BigInt(1), 1)
176
+
177
+ transition.getPurposeRequirement() // -> String
178
+
179
+ ```
180
+
181
+ ___
182
+
183
+ ### `getModifiedDataIds`
184
+
185
+ Returns modified ids in `[IdentifierWASM]`
186
+
187
+ ```js
188
+ const transition = new wasm.IdentityCreditWithdrawalTransitionWASM(identifier, BigInt(111), 1, 'never', script, BigInt(1), 1)
189
+
190
+ transition.getModifiedDataIds() // -> [IdentifierWASM]
191
+
192
+ ```
193
+
194
+ ___
195
+
196
+ ### `getOptionalAssetLockProof`
197
+
198
+ Returns asset lock proof in `AssetLockProofWASM | undefined`
199
+
200
+ ```js
201
+ const transition = new wasm.IdentityCreditWithdrawalTransitionWASM(identifier, BigInt(111), 1, 'never', script, BigInt(1), 1)
202
+
203
+ transition.getOptionalAssetLockProof() // -> AssetLockProofWASM | undefined
204
+
205
+ ```
206
+
207
+ ___
208
+
209
+ ### `getSignableBytes`
210
+
211
+ Returns bytes for sign in `Uint8Array`
212
+
213
+ ```js
214
+ const transition = new wasm.IdentityCreditWithdrawalTransitionWASM(identifier, BigInt(111), 1, 'never', script, BigInt(1), 1)
215
+
216
+ transition.getSignableBytes() // -> Uint8Array
217
+
218
+ ```
219
+
220
+ ___
221
+
222
+ ### `toBytes`
223
+
224
+ Returns transition in `Uint8Array`
225
+
226
+ ```js
227
+ const transition = new wasm.IdentityCreditWithdrawalTransitionWASM(identifier, BigInt(111), 1, 'never', script, BigInt(1), 1)
228
+
229
+ transition.toBytes() // -> Uint8Array
230
+
231
+ ```
232
+
233
+ ___
234
+
235
+ ### `toStateTransition`
236
+
237
+ Returns `StateTransitionWASM`
238
+
239
+ ```js
240
+ const transition = new wasm.IdentityCreditWithdrawalTransitionWASM(identifier, BigInt(111), 1, 'never', script, BigInt(1), 1)
241
+
242
+ transition.toStateTransition() // -> StateTransitionWASM
243
+
244
+ ```
@@ -0,0 +1,348 @@
1
+ # IdentityPublicKeyWASM
2
+
3
+ This class allows to create IdentityPublicKey instance and interact
4
+
5
+ Arguments in constructor:
6
+
7
+ - `id -> Number`
8
+ - `purpose -> PurposeEnum`
9
+ - `securityLevel -> SecurityLevelEnum`
10
+ - `keyType -> KeyTypeEnum`
11
+ - `readOnly -> Boolean`
12
+ - `binaryData -> Hex String`
13
+ - `disabledAt -> ?BigInt`
14
+
15
+ You can create `IdentityPublicKeyWASM` via constructor and `fromBytes`
16
+
17
+ If you want to create `IdentityPublicKey` from bytes,
18
+ you need to use serialized to bytes `IdentityPublicKey` from `rs-dpp` or `pshenmic-dpp`
19
+ ___
20
+
21
+ ## Navigation
22
+
23
+ - [Example](#example)
24
+ - [Getters methods](#getters-methods)
25
+ - [validatePrivateKey](#validateprivatekey)
26
+ - [getKeyId](#getkeyid)
27
+ - [getPurpose](#getpurpose)
28
+ - [getSecurityLevel](#getsecuritylevel)
29
+ - [getKeyType](#getkeytype)
30
+ - [getReadOnly](#getreadonly)
31
+ - [getData](#getdata)
32
+ - [getDisabledAt](#getdisabledat)
33
+ - [Setters methods](#setters-methods)
34
+ - [setKeyId](#setkeyid)
35
+ - [setPurpose](#setpurpose)
36
+ - [setSecurityLevel](#setsecuritylevel)
37
+ - [setKeyType](#setkeytype)
38
+ - [setReadOnly](#setreadonly)
39
+ - [setData](#setdata)
40
+ - [setDisabledAt](#setdisabledat)
41
+
42
+ ___
43
+
44
+ ## Example
45
+
46
+ ```js
47
+ const publicKey = new IdentityPublicKeyWASM(
48
+ 2,
49
+ 'AUTHENTICATION',
50
+ 'CRITICAL',
51
+ 'ECDSA_SECP256K1',
52
+ false,
53
+ '0300000002e40e81d928fde2bde7880070e4fa9c1d1d9b168da707ea468afa2b48'
54
+ )
55
+ ```
56
+
57
+ ___
58
+
59
+ ## Getters methods
60
+
61
+ ### `validatePrivateKey`
62
+
63
+ Allows to validate private key for selected public key.
64
+
65
+ Returns `Boolean`
66
+
67
+ ```js
68
+ const privateKey = PrivateKeyWASM.fromWIF('cR4EZ2nAvCmn2cFepKn7UgSSQFgFTjkySAchvcoiEVdm48eWjQGn')
69
+
70
+ const publicKey = new IdentityPublicKeyWASM(
71
+ 2,
72
+ 'AUTHENTICATION',
73
+ 'CRITICAL',
74
+ 'ECDSA_SECP256K1',
75
+ false,
76
+ '0300000002e40e81d928fde2bde7880070e4fa9c1d1d9b168da707ea468afa2b48'
77
+ )
78
+
79
+ publicKey.validatePrivateKey(privateKey.getBytes(), 'mainnet')
80
+ ```
81
+
82
+ ___
83
+
84
+ ### `getKeyId`
85
+
86
+ Returns key id in `Number`
87
+
88
+ ```js
89
+ const publicKey = new IdentityPublicKeyWASM(
90
+ 2,
91
+ 'AUTHENTICATION',
92
+ 'CRITICAL',
93
+ 'ECDSA_SECP256K1',
94
+ false,
95
+ '0300000002e40e81d928fde2bde7880070e4fa9c1d1d9b168da707ea468afa2b48'
96
+ )
97
+
98
+ publicKey.getKeyId() // -> Number
99
+ ```
100
+
101
+ ___
102
+
103
+ ### `getPurpose`
104
+
105
+ Returns purpose value for identity public key in `String`
106
+
107
+ ```js
108
+ const publicKey = new IdentityPublicKeyWASM(
109
+ 2,
110
+ 'AUTHENTICATION',
111
+ 'CRITICAL',
112
+ 'ECDSA_SECP256K1',
113
+ false,
114
+ '0300000002e40e81d928fde2bde7880070e4fa9c1d1d9b168da707ea468afa2b48'
115
+ )
116
+
117
+ publicKey.getPurpose() // -> String
118
+ ```
119
+
120
+ ___
121
+
122
+ ### `getSecurityLevel`
123
+
124
+ Returns security level for identity public key in `String`
125
+
126
+ ```js
127
+ const publicKey = new IdentityPublicKeyWASM(
128
+ 2,
129
+ 'AUTHENTICATION',
130
+ 'CRITICAL',
131
+ 'ECDSA_SECP256K1',
132
+ false,
133
+ '0300000002e40e81d928fde2bde7880070e4fa9c1d1d9b168da707ea468afa2b48'
134
+ )
135
+
136
+ publicKey.getSecurityLevel() // -> String
137
+ ```
138
+
139
+ ___
140
+
141
+ ### `getKeyType`
142
+
143
+ Returns key type for identity public key in `String`
144
+
145
+ ```js
146
+ const publicKey = new IdentityPublicKeyWASM(
147
+ 2,
148
+ 'AUTHENTICATION',
149
+ 'CRITICAL',
150
+ 'ECDSA_SECP256K1',
151
+ false,
152
+ '0300000002e40e81d928fde2bde7880070e4fa9c1d1d9b168da707ea468afa2b48'
153
+ )
154
+
155
+ publicKey.getKeyType() // -> String
156
+ ```
157
+
158
+ ___
159
+
160
+ ### `getReadOnly`
161
+
162
+ Returns read only flag for identity public key in `Boolean`
163
+
164
+ ```js
165
+ const publicKey = new IdentityPublicKeyWASM(
166
+ 2,
167
+ 'AUTHENTICATION',
168
+ 'CRITICAL',
169
+ 'ECDSA_SECP256K1',
170
+ false,
171
+ '0300000002e40e81d928fde2bde7880070e4fa9c1d1d9b168da707ea468afa2b48'
172
+ )
173
+
174
+ publicKey.getReadOnly() // -> Boolean
175
+ ```
176
+
177
+ ___
178
+
179
+ ### `getData`
180
+
181
+ Returns identity public key data in Hex `String`
182
+
183
+ ```js
184
+ const publicKey = new IdentityPublicKeyWASM(
185
+ 2,
186
+ 'AUTHENTICATION',
187
+ 'CRITICAL',
188
+ 'ECDSA_SECP256K1',
189
+ false,
190
+ '0300000002e40e81d928fde2bde7880070e4fa9c1d1d9b168da707ea468afa2b48'
191
+ )
192
+
193
+ publicKey.getData() // -> String
194
+ ```
195
+
196
+ ___
197
+
198
+ ### `getDisabledAt`
199
+
200
+ Returns optional disabled at timestamp identity public key `?Number`
201
+
202
+ ```js
203
+ const publicKey = new IdentityPublicKeyWASM(
204
+ 2,
205
+ 'AUTHENTICATION',
206
+ 'CRITICAL',
207
+ 'ECDSA_SECP256K1',
208
+ false,
209
+ '0300000002e40e81d928fde2bde7880070e4fa9c1d1d9b168da707ea468afa2b48'
210
+ )
211
+
212
+ publicKey.getDisabledAt() // -> ?BigInt
213
+ ```
214
+
215
+ ___
216
+
217
+ ## Setters methods
218
+
219
+ ### `setKeyId`
220
+
221
+ Allows to set key id in `Number`
222
+
223
+ ```js
224
+ const publicKey = new IdentityPublicKeyWASM(
225
+ 2,
226
+ 'AUTHENTICATION',
227
+ 'CRITICAL',
228
+ 'ECDSA_SECP256K1',
229
+ false,
230
+ '0300000002e40e81d928fde2bde7880070e4fa9c1d1d9b168da707ea468afa2b48'
231
+ )
232
+
233
+ publicKey.setKeyId(11)
234
+ ```
235
+
236
+ ___
237
+
238
+ ### `setPurpose`
239
+
240
+ Allows to set purpose value for identity public key in `PurposeEnum`
241
+
242
+ ```js
243
+ const publicKey = new IdentityPublicKeyWASM(
244
+ 2,
245
+ 'AUTHENTICATION',
246
+ 'CRITICAL',
247
+ 'ECDSA_SECP256K1',
248
+ false,
249
+ '0300000002e40e81d928fde2bde7880070e4fa9c1d1d9b168da707ea468afa2b48'
250
+ )
251
+
252
+ publicKey.setPurpose('ENCRYPTION')
253
+ ```
254
+
255
+ ___
256
+
257
+ ### `setSecurityLevel`
258
+
259
+ Allows to set security level for identity public key in `SecurityLevelEnum`
260
+
261
+ ```js
262
+ const publicKey = new IdentityPublicKeyWASM(
263
+ 2,
264
+ 'AUTHENTICATION',
265
+ 'CRITICAL',
266
+ 'ECDSA_SECP256K1',
267
+ false,
268
+ '0300000002e40e81d928fde2bde7880070e4fa9c1d1d9b168da707ea468afa2b48'
269
+ )
270
+
271
+ publicKey.setSecurityLevel('HIGH')
272
+ ```
273
+
274
+ ___
275
+
276
+ ### `setKeyType`
277
+
278
+ Allows to set key type for identity public key in `KeyTypeEnum`
279
+
280
+ ```js
281
+ const publicKey = new IdentityPublicKeyWASM(
282
+ 2,
283
+ 'AUTHENTICATION',
284
+ 'CRITICAL',
285
+ 'ECDSA_SECP256K1',
286
+ false,
287
+ '0300000002e40e81d928fde2bde7880070e4fa9c1d1d9b168da707ea468afa2b48'
288
+ )
289
+
290
+ publicKey.setKeyType('ECDSA_HASH160')
291
+ ```
292
+
293
+ ___
294
+
295
+ ### `setReadOnly`
296
+
297
+ Allows to set read only flag for identity public key in `Boolean`
298
+
299
+ ```js
300
+ const publicKey = new IdentityPublicKeyWASM(
301
+ 2,
302
+ 'AUTHENTICATION',
303
+ 'CRITICAL',
304
+ 'ECDSA_SECP256K1',
305
+ false,
306
+ '0300000002e40e81d928fde2bde7880070e4fa9c1d1d9b168da707ea468afa2b48'
307
+ )
308
+
309
+ publicKey.setReadOnly(true)
310
+ ```
311
+
312
+ ___
313
+
314
+ ### `setData`
315
+
316
+ Allows to set identity public key data in Hex `String`
317
+
318
+ ```js
319
+ const publicKey = new IdentityPublicKeyWASM(
320
+ 2,
321
+ 'AUTHENTICATION',
322
+ 'CRITICAL',
323
+ 'ECDSA_SECP256K1',
324
+ false,
325
+ '0300000002e40e81d928fde2bde7880070e4fa9c1d1d9b168da707ea468afa2b48'
326
+ )
327
+
328
+ publicKey.setData('0300000002e40e81d928fde2bde7880070e4fa9c1d1d9b168da707ea468afa2b48')
329
+ ```
330
+
331
+ ___
332
+
333
+ ### `setDisabledAt`
334
+
335
+ Allows to set disabled at timestamp identity public key `BigInt`
336
+
337
+ ```js
338
+ const publicKey = new IdentityPublicKeyWASM(
339
+ 2,
340
+ 'AUTHENTICATION',
341
+ 'CRITICAL',
342
+ 'ECDSA_SECP256K1',
343
+ false,
344
+ '0300000002e40e81d928fde2bde7880070e4fa9c1d1d9b168da707ea468afa2b48'
345
+ )
346
+
347
+ publicKey.setDisabledAt(BigInt(11))
348
+ ```
@@ -0,0 +1,141 @@
1
+ # IdentityPublicKeyInCreationWASM
2
+
3
+ This class allows to create and interact with instance of IdentityPublicKeyInCreation struct
4
+
5
+ `IdentityPublicKeyInCreationWASM` can be created only via constructor
6
+
7
+ Constructor params:
8
+
9
+ - `id -> Number`
10
+ - `purpose -> PurposeEnum`
11
+ - `securityLevel -> SecurityLevelEnum`
12
+ - `keyType -> KeyTypeEnum`
13
+ - `readOnly -> Boolean`
14
+ - `binaryData -> Uint8Array`
15
+ - `signature -> Uint8Array`
16
+
17
+ ___
18
+
19
+ ## Navigation
20
+
21
+ - [Example](#Example)
22
+ - [Fields](#fields)
23
+ - [keyId](#keyid)
24
+ - [purpose](#purpose)
25
+ - [securityLevel](#securitylevel)
26
+ - [keyType](#keytype)
27
+ - [readOnly](#readonly)
28
+ - [data](#data)
29
+ - [signature](#signature)
30
+ - [Getters](#getters)
31
+ - [toIdentityPublicKey](#toIdentityPublicKey)
32
+
33
+ ___
34
+
35
+ ### Example
36
+
37
+ ```js
38
+ const key = new wasm.IdentityPublicKeyInCreationWASM(
39
+ 1, 'system', 'master', 'ECDSA_SECP256K1', false, [], []
40
+ )
41
+ ```
42
+
43
+ ___
44
+
45
+ ## Fields
46
+
47
+ All fields are readable and writable.
48
+
49
+ ### `keyId`
50
+
51
+ Contains id of key in `Number`
52
+
53
+ ```js
54
+ key.keyId = 1
55
+
56
+ key.keyId // -> Number
57
+ ```
58
+
59
+ ___
60
+
61
+ ### `purpose`
62
+
63
+ Contains purpose enum in `String`
64
+
65
+ ```js
66
+ key.purpose = 'system'
67
+
68
+ key.purpose // -> String
69
+ ```
70
+
71
+ ___
72
+
73
+ ### `securityLevel`
74
+
75
+ Contains securityLevel enum in `String`
76
+
77
+ ```js
78
+ key.securityLevel = 'master'
79
+
80
+ key.securityLevel // -> String
81
+ ```
82
+
83
+ ___
84
+
85
+ ### `keyType`
86
+
87
+ Contains keyType enum in `String`
88
+
89
+ ```js
90
+ key.keyType = 'ECDSA_SECP256K1'
91
+
92
+ key.keyType // -> String
93
+ ```
94
+
95
+ ___
96
+
97
+ ### `readOnly`
98
+
99
+ Contains readOnly flag in `Boolean`
100
+
101
+ ```js
102
+ key.readOnly = true
103
+
104
+ key.readOnly // -> Boolean
105
+ ```
106
+
107
+ ___
108
+
109
+ ### `data`
110
+
111
+ Contains data in `Uint8Array`
112
+
113
+ ```js
114
+ key.data = Uint8Array.from([1, 2, 3, 4, 5])
115
+
116
+ key.data // -> Uint8Array
117
+ ```
118
+
119
+ ___
120
+
121
+ ### `signature`
122
+
123
+ Contains signature in `Uint8Array`
124
+
125
+ ```js
126
+ key.signature = Uint8Array.from([1, 2, 3, 4, 5])
127
+
128
+ key.signature // -> Uint8Array
129
+ ```
130
+
131
+ ___
132
+
133
+ ## Getters
134
+
135
+ ### `toIdentityPublicKey`
136
+
137
+ Allows to get `IdentityPublicKeyWASM`
138
+
139
+ ```js
140
+ key.toIdentityPublicKey() // -> IdentityPublicKeyWASM
141
+ ```