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.
- package/.github/workflows/build.yml +1 -1
- package/.github/workflows/publish.yml +1 -1
- package/Cargo.lock +147 -49
- package/Cargo.toml +13 -7
- package/README.md +10 -1
- package/dist/wasm/index.d.ts +52 -0
- package/dist/wasm/pshenmic_dpp.d.ts +962 -0
- package/dist/wasm/pshenmic_dpp.js +3342 -875
- 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 +3 -3
- 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 +1 -1
- package/packages/core_script/Cargo.toml +13 -0
- package/packages/core_script/src/lib.rs +69 -0
- package/packages/data_contract/Cargo.toml +2 -1
- package/packages/data_contract/src/lib.rs +34 -30
- package/packages/data_contract_transitions/Cargo.toml +1 -1
- package/packages/data_contract_transitions/src/create/mod.rs +3 -3
- package/packages/data_contract_transitions/src/update/mod.rs +3 -3
- package/packages/document/Cargo.toml +2 -1
- package/packages/document/src/lib.rs +13 -12
- package/packages/document/src/methods/mod.rs +41 -38
- package/packages/documents_batch/Cargo.toml +2 -1
- package/packages/documents_batch/src/document_base_transition/mod.rs +16 -20
- package/packages/documents_batch/src/document_transition/mod.rs +9 -9
- package/packages/documents_batch/src/lib.rs +23 -16
- package/packages/documents_batch/src/transitions/create/mod.rs +5 -2
- package/packages/documents_batch/src/transitions/transfer/mod.rs +9 -11
- package/packages/enums/Cargo.toml +1 -1
- package/packages/enums/src/batch/batch_enum.rs +2 -2
- package/packages/enums/src/lib.rs +2 -0
- package/packages/enums/src/lock_types/mod.rs +65 -0
- package/packages/enums/src/platform/mod.rs +2 -0
- 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 +2 -1
- package/packages/identity/src/lib.rs +13 -18
- package/packages/identity_public_key/Cargo.toml +1 -1
- package/packages/identity_transitions/Cargo.toml +7 -3
- package/packages/identity_transitions/src/create_transition/mod.rs +99 -36
- 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/{create_transition/public_key_in_creation → public_key_in_creation}/mod.rs +67 -20
- 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/private_key/Cargo.toml +1 -1
- package/packages/state_transition/Cargo.toml +2 -1
- package/packages/state_transition/src/lib.rs +3 -2
- package/packages/utils/Cargo.toml +2 -2
- package/packages/utils/src/lib.rs +0 -3
- package/scripts/build-js.sh +16 -0
- package/scripts/build.sh +5 -1
- package/src/lib.rs +1 -0
- 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 +17 -14
- package/tests/Document.spec.js +14 -8
- package/tests/DocumentBatchTransition.spec.js +11 -11
- package/tests/DocumentTransition.spec.js +4 -4
- package/tests/DocumentsTransitions.spec.js +22 -22
- package/tests/Identifier.spec.js +84 -0
- package/tests/Identity.spec.js +1 -1
- package/tests/IdentityCreateTransition.spec.js +93 -0
- package/tests/IdentityCreditTransferTransition.spec.js +146 -0
- package/tests/IdentityCreditWithdrawalTransition.spec.js +192 -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/PublicKeyInCreation.spec.js +258 -0
- package/tests/TxOut.spec.js +76 -0
- package/tests/mocks/Locks/index.js +5 -0
- package/tests/mocks/PublicKey/index.js +1 -1
- package/typings/index.d.ts +52 -0
|
@@ -0,0 +1,166 @@
|
|
|
1
|
+
# IdentityTopUpTransitionWASM
|
|
2
|
+
|
|
3
|
+
This class allows to create instance of IdentityTopUpTransition struct
|
|
4
|
+
|
|
5
|
+
`IdentityTopUpTransitionWASM` can be created via constructor, bytes and state transition
|
|
6
|
+
|
|
7
|
+
Constructor params:
|
|
8
|
+
|
|
9
|
+
- `assetLockProof -> AssetLockProofWASM`
|
|
10
|
+
- `identityId -> IdentifierWASM | String | ArrayLike`
|
|
11
|
+
- `userFeeIncrease -> ?Number`
|
|
12
|
+
|
|
13
|
+
___
|
|
14
|
+
|
|
15
|
+
## Navigation
|
|
16
|
+
|
|
17
|
+
- [Example](#Example)
|
|
18
|
+
- [Fields](#fields)
|
|
19
|
+
- [identityIdentifier](#identityidentifier)
|
|
20
|
+
- [userFeeIncrease](#userfeeincrease)
|
|
21
|
+
- [assetLockProof](#assetlockproof)
|
|
22
|
+
- [Getters](#getters)
|
|
23
|
+
- [getModifiedDataIds](#getmodifieddataids)
|
|
24
|
+
- [getOptionalAssetLockProof](#getoptionalassetlockproof)
|
|
25
|
+
- [getSignableBytes](#getsignablebytes)
|
|
26
|
+
- [toBytes](#tobytes)
|
|
27
|
+
- [toStateTransition](#tostatetransition)
|
|
28
|
+
|
|
29
|
+
___
|
|
30
|
+
|
|
31
|
+
### Example
|
|
32
|
+
|
|
33
|
+
```js
|
|
34
|
+
const assetLockProof = wasm.AssetLockProofWASM.createInstantAssetLockProof(
|
|
35
|
+
// instant lock
|
|
36
|
+
[1, 1, 193, 219, 244, 102, 77, 20, 251, 187, 201, 109, 168, 125, 7, 244, 118, 119, 210, 53, 238, 105, 138, 31, 7, 73, 30, 128, 131, 175, 114, 76, 187, 37, 0, 0, 0, 0, 177, 215, 65, 96, 204, 228, 86, 13, 14, 185, 46, 65, 241, 38, 226, 172, 59, 96, 158, 15, 126, 90, 225, 3, 140, 221, 96, 131, 254, 12, 236, 26, 48, 124, 31, 23, 184, 202, 122, 231, 123, 59, 43, 118, 27, 214, 225, 58, 44, 191, 232, 10, 33, 35, 8, 113, 145, 159, 158, 88, 80, 0, 0, 0, 173, 103, 128, 160, 29, 226, 161, 219, 167, 194, 158, 38, 19, 51, 143, 248, 161, 87, 126, 32, 143, 209, 152, 44, 174, 6, 25, 210, 101, 127, 131, 65, 202, 241, 47, 166, 132, 10, 199, 15, 187, 136, 11, 217, 237, 13, 173, 64, 11, 6, 112, 188, 234, 239, 204, 29, 3, 6, 35, 154, 44, 106, 44, 183, 171, 126, 146, 240, 153, 210, 187, 56, 133, 161, 11, 4, 151, 63, 89, 20, 44, 66, 153, 242, 97, 207, 44, 110, 208, 51, 198, 113, 104, 79, 154, 19],
|
|
37
|
+
// transaction
|
|
38
|
+
[3, 0, 8, 0, 1, 193, 219, 244, 102, 77, 20, 251, 187, 201, 109, 168, 125, 7, 244, 118, 119, 210, 53, 238, 105, 138, 31, 7, 73, 30, 128, 131, 175, 114, 76, 187, 37, 0, 0, 0, 0, 106, 71, 48, 68, 2, 32, 2, 146, 73, 163, 223, 124, 140, 225, 109, 126, 239, 87, 105, 184, 118, 87, 182, 100, 182, 6, 15, 200, 26, 44, 33, 215, 165, 110, 211, 232, 245, 233, 2, 32, 69, 161, 168, 128, 101, 26, 171, 20, 63, 30, 219, 87, 23, 4, 142, 115, 73, 73, 170, 203, 46, 187, 149, 32, 210, 171, 46, 136, 253, 188, 36, 12, 1, 33, 2, 144, 231, 28, 153, 30, 92, 52, 10, 111, 47, 107, 74, 225, 237, 151, 33, 188, 184, 247, 121, 70, 135, 174, 31, 160, 16, 216, 239, 225, 103, 88, 112, 255, 255, 255, 255, 2, 64, 66, 15, 0, 0, 0, 0, 0, 2, 106, 0, 216, 154, 230, 5, 0, 0, 0, 0, 25, 118, 169, 20, 229, 154, 45, 140, 145, 114, 18, 52, 205, 13, 179, 84, 94, 174, 149, 207, 101, 115, 51, 240, 136, 172, 0, 0, 0, 0, 36, 1, 1, 64, 66, 15, 0, 0, 0, 0, 0, 25, 118, 169, 20, 176, 213, 107, 82, 203, 147, 209, 128, 255, 63, 69, 219, 41, 250, 232, 254, 185, 168, 85, 184, 136, 172],
|
|
39
|
+
// output index
|
|
40
|
+
0
|
|
41
|
+
)
|
|
42
|
+
|
|
43
|
+
const transition = new wasm.IdentityTopUpTransitionWASM(assetLockProof, 'B7kcE1juMBWEWkuYRJhVdAE2e6RaevrGxRsa1DrLCpQH', 11)
|
|
44
|
+
```
|
|
45
|
+
|
|
46
|
+
___
|
|
47
|
+
|
|
48
|
+
## Fields
|
|
49
|
+
|
|
50
|
+
All fields are readable and writable.
|
|
51
|
+
|
|
52
|
+
### `identityIdentifier`
|
|
53
|
+
|
|
54
|
+
Contains identity identifier in `IdentifierWASM`
|
|
55
|
+
|
|
56
|
+
```js
|
|
57
|
+
const transition = new wasm.IdentityTopUpTransitionWASM(assetLockProof, 'B7kcE1juMBWEWkuYRJhVdAE2e6RaevrGxRsa1DrLCpQH', 11)
|
|
58
|
+
|
|
59
|
+
transition.identityIdentifier = '12FRq8L3VuBEQfCAZykmUaiXXrsd1Bwub2gcaMmtNbn3'
|
|
60
|
+
|
|
61
|
+
transition.identityIdentifier // -> IdentifierWASM
|
|
62
|
+
```
|
|
63
|
+
|
|
64
|
+
___
|
|
65
|
+
|
|
66
|
+
### `userFeeIncrease`
|
|
67
|
+
|
|
68
|
+
Contains userFeeIncrease in `Number`
|
|
69
|
+
|
|
70
|
+
```js
|
|
71
|
+
const transition = new wasm.IdentityTopUpTransitionWASM(assetLockProof, 'B7kcE1juMBWEWkuYRJhVdAE2e6RaevrGxRsa1DrLCpQH', 11)
|
|
72
|
+
|
|
73
|
+
transition.userFeeIncrease = 99
|
|
74
|
+
|
|
75
|
+
transition.userFeeIncrease // -> Number
|
|
76
|
+
```
|
|
77
|
+
|
|
78
|
+
___
|
|
79
|
+
|
|
80
|
+
### `assetLockProof`
|
|
81
|
+
|
|
82
|
+
Contains asset lock proof in `AssetLockProofWASM`
|
|
83
|
+
|
|
84
|
+
```js
|
|
85
|
+
const transition = new wasm.IdentityTopUpTransitionWASM(assetLockProof, 'B7kcE1juMBWEWkuYRJhVdAE2e6RaevrGxRsa1DrLCpQH', 11)
|
|
86
|
+
|
|
87
|
+
const anotherAssetLockProof = wasm.AssetLockProofWASM.createInstantAssetLockProof(
|
|
88
|
+
// instant lock
|
|
89
|
+
[1, 1, 193, 219, 244, 102, 77, 20, 251, 187, 201, 109, 168, 125, 7, 244, 118, 119, 210, 53, 238, 105, 138, 31, 7, 73, 30, 128, 131, 175, 114, 76, 187, 37, 0, 0, 0, 0, 177, 215, 65, 96, 204, 228, 86, 13, 14, 185, 46, 65, 241, 38, 226, 172, 59, 96, 158, 15, 126, 90, 225, 3, 140, 221, 96, 131, 254, 12, 236, 26, 48, 124, 31, 23, 184, 202, 122, 231, 123, 59, 43, 118, 27, 214, 225, 58, 44, 191, 232, 10, 33, 35, 8, 113, 145, 159, 158, 88, 80, 0, 0, 0, 173, 103, 128, 160, 29, 226, 161, 219, 167, 194, 158, 38, 19, 51, 143, 248, 161, 87, 126, 32, 143, 209, 152, 44, 174, 6, 25, 210, 101, 127, 131, 65, 202, 241, 47, 166, 132, 10, 199, 15, 187, 136, 11, 217, 237, 13, 173, 64, 11, 6, 112, 188, 234, 239, 204, 29, 3, 6, 35, 154, 44, 106, 44, 183, 171, 126, 146, 240, 153, 210, 187, 56, 133, 161, 11, 4, 151, 63, 89, 20, 44, 66, 153, 242, 97, 207, 44, 110, 208, 51, 198, 113, 104, 79, 154, 19],
|
|
90
|
+
// transaction
|
|
91
|
+
[3, 0, 8, 0, 1, 193, 219, 244, 102, 77, 20, 251, 187, 201, 109, 168, 125, 7, 244, 118, 119, 210, 53, 238, 105, 138, 31, 7, 73, 30, 128, 131, 175, 114, 76, 187, 37, 0, 0, 0, 0, 106, 71, 48, 68, 2, 32, 2, 146, 73, 163, 223, 124, 140, 225, 109, 126, 239, 87, 105, 184, 118, 87, 182, 100, 182, 6, 15, 200, 26, 44, 33, 215, 165, 110, 211, 232, 245, 233, 2, 32, 69, 161, 168, 128, 101, 26, 171, 20, 63, 30, 219, 87, 23, 4, 142, 115, 73, 73, 170, 203, 46, 187, 149, 32, 210, 171, 46, 136, 253, 188, 36, 12, 1, 33, 2, 144, 231, 28, 153, 30, 92, 52, 10, 111, 47, 107, 74, 225, 237, 151, 33, 188, 184, 247, 121, 70, 135, 174, 31, 160, 16, 216, 239, 225, 103, 88, 112, 255, 255, 255, 255, 2, 64, 66, 15, 0, 0, 0, 0, 0, 2, 106, 0, 216, 154, 230, 5, 0, 0, 0, 0, 25, 118, 169, 20, 229, 154, 45, 140, 145, 114, 18, 52, 205, 13, 179, 84, 94, 174, 149, 207, 101, 115, 51, 240, 136, 172, 0, 0, 0, 0, 36, 1, 1, 64, 66, 15, 0, 0, 0, 0, 0, 25, 118, 169, 20, 176, 213, 107, 82, 203, 147, 209, 128, 255, 63, 69, 219, 41, 250, 232, 254, 185, 168, 85, 184, 136, 172],
|
|
92
|
+
// output index
|
|
93
|
+
0
|
|
94
|
+
)
|
|
95
|
+
|
|
96
|
+
transition.assetLockProof = anotherAssetLockProof
|
|
97
|
+
|
|
98
|
+
transition.assetLockProof // -> AssetLockProofWASM
|
|
99
|
+
```
|
|
100
|
+
|
|
101
|
+
___
|
|
102
|
+
|
|
103
|
+
## Getters
|
|
104
|
+
|
|
105
|
+
### `getModifiedDataIds`
|
|
106
|
+
|
|
107
|
+
Returns modified ids in `[IdentifierWASM]`
|
|
108
|
+
|
|
109
|
+
```js
|
|
110
|
+
const transition = new wasm.IdentityTopUpTransitionWASM(assetLockProof, 'B7kcE1juMBWEWkuYRJhVdAE2e6RaevrGxRsa1DrLCpQH', 11)
|
|
111
|
+
|
|
112
|
+
transition.getModifiedDataIds() // -> [IdentifierWASM]
|
|
113
|
+
|
|
114
|
+
```
|
|
115
|
+
|
|
116
|
+
___
|
|
117
|
+
|
|
118
|
+
### `getOptionalAssetLockProof`
|
|
119
|
+
|
|
120
|
+
Returns asset lock proof in `AssetLockProofWASM | undefined`
|
|
121
|
+
|
|
122
|
+
```js
|
|
123
|
+
const transition = new wasm.IdentityTopUpTransitionWASM(assetLockProof, 'B7kcE1juMBWEWkuYRJhVdAE2e6RaevrGxRsa1DrLCpQH', 11)
|
|
124
|
+
|
|
125
|
+
transition.getOptionalAssetLockProof() // -> AssetLockProofWASM | undefined
|
|
126
|
+
|
|
127
|
+
```
|
|
128
|
+
|
|
129
|
+
___
|
|
130
|
+
|
|
131
|
+
### `getSignableBytes`
|
|
132
|
+
|
|
133
|
+
Returns bytes for sign in `Uint8Array`
|
|
134
|
+
|
|
135
|
+
```js
|
|
136
|
+
const transition = new wasm.IdentityTopUpTransitionWASM(assetLockProof, 'B7kcE1juMBWEWkuYRJhVdAE2e6RaevrGxRsa1DrLCpQH', 11)
|
|
137
|
+
|
|
138
|
+
transition.getSignableBytes() // -> Uint8Array
|
|
139
|
+
|
|
140
|
+
```
|
|
141
|
+
|
|
142
|
+
___
|
|
143
|
+
|
|
144
|
+
### `toBytes`
|
|
145
|
+
|
|
146
|
+
Returns transition in `Uint8Array`
|
|
147
|
+
|
|
148
|
+
```js
|
|
149
|
+
const transition = new wasm.IdentityTopUpTransitionWASM(assetLockProof, 'B7kcE1juMBWEWkuYRJhVdAE2e6RaevrGxRsa1DrLCpQH', 11)
|
|
150
|
+
|
|
151
|
+
transition.toBytes() // -> Uint8Array
|
|
152
|
+
|
|
153
|
+
```
|
|
154
|
+
|
|
155
|
+
___
|
|
156
|
+
|
|
157
|
+
### `toStateTransition`
|
|
158
|
+
|
|
159
|
+
Returns `StateTransitionWASM`
|
|
160
|
+
|
|
161
|
+
```js
|
|
162
|
+
const transition = new wasm.IdentityTopUpTransitionWASM(assetLockProof, 'B7kcE1juMBWEWkuYRJhVdAE2e6RaevrGxRsa1DrLCpQH', 11)
|
|
163
|
+
|
|
164
|
+
transition.toStateTransition() // -> StateTransitionWASM
|
|
165
|
+
|
|
166
|
+
```
|
|
@@ -0,0 +1,234 @@
|
|
|
1
|
+
# IdentityUpdateTransitionWASM
|
|
2
|
+
|
|
3
|
+
This class allows to create instance of IdentityUpdateTransition struct
|
|
4
|
+
|
|
5
|
+
`IdentityUpdateTransitionWASM` can be created via constructor, bytes and state transition
|
|
6
|
+
|
|
7
|
+
Constructor params:
|
|
8
|
+
|
|
9
|
+
- `identityId -> IdentifierWASM | String | ArrayLike`
|
|
10
|
+
- `revision -> BigInt`
|
|
11
|
+
- `nonce -> BigInt`
|
|
12
|
+
- `userFeeIncrease -> ?Number`
|
|
13
|
+
- `addPublicKeys -> [IdentityPublicKeyInCreationWASM]`
|
|
14
|
+
- `disablePublicKeys -> [Number]`
|
|
15
|
+
|
|
16
|
+
___
|
|
17
|
+
|
|
18
|
+
## Navigation
|
|
19
|
+
|
|
20
|
+
- [Example](#Example)
|
|
21
|
+
- [Fields](#fields)
|
|
22
|
+
- [revision](#revision)
|
|
23
|
+
- [nonce](#nonce)
|
|
24
|
+
- [identityIdentifier](#identityidentifier)
|
|
25
|
+
- [publicKeyIdsToAdd](#publickeyidstoadd)
|
|
26
|
+
- [publicKeyIdsToDisable](#publickeyidstodisable)
|
|
27
|
+
- [userFeeIncrease](#userfeeincrease)
|
|
28
|
+
- [signature](#signature)
|
|
29
|
+
- [Getters](#getters)
|
|
30
|
+
- [getPurposeRequirement](#getpurposerequirement)
|
|
31
|
+
- [getModifiedDataIds](#getmodifieddataids)
|
|
32
|
+
- [getOptionalAssetLockProof](#getoptionalassetlockproof)
|
|
33
|
+
- [getSignableBytes](#getsignablebytes)
|
|
34
|
+
- [toBytes](#tobytes)
|
|
35
|
+
- [toStateTransition](#tostatetransition)
|
|
36
|
+
|
|
37
|
+
___
|
|
38
|
+
|
|
39
|
+
### Example
|
|
40
|
+
|
|
41
|
+
```js
|
|
42
|
+
const transition = new wasm.IdentityUpdateTransitionWASM(
|
|
43
|
+
'GL2Rq8L3VuBEQfCAZykmUaiXXrsd1Bwub2gcaMmtNbn3',
|
|
44
|
+
BigInt(1),
|
|
45
|
+
BigInt(1),
|
|
46
|
+
1,
|
|
47
|
+
[],
|
|
48
|
+
[]
|
|
49
|
+
)
|
|
50
|
+
```
|
|
51
|
+
|
|
52
|
+
___
|
|
53
|
+
|
|
54
|
+
## Fields
|
|
55
|
+
|
|
56
|
+
All fields are readable and writable.
|
|
57
|
+
|
|
58
|
+
### `revision`
|
|
59
|
+
|
|
60
|
+
Contains identity revision in `BigInt`
|
|
61
|
+
|
|
62
|
+
```js
|
|
63
|
+
const transition = new wasm.IdentityUpdateTransitionWASM('GL2Rq8L3VuBEQfCAZykmUaiXXrsd1Bwub2gcaMmtNbn3', BigInt(1), BigInt(1), 1, [], [])
|
|
64
|
+
|
|
65
|
+
transition.revision = BigInt(1231)
|
|
66
|
+
|
|
67
|
+
transition.revision // -> BigInt
|
|
68
|
+
```
|
|
69
|
+
|
|
70
|
+
___
|
|
71
|
+
|
|
72
|
+
### `nonce`
|
|
73
|
+
|
|
74
|
+
Contains nonce in `BigInt`
|
|
75
|
+
|
|
76
|
+
```js
|
|
77
|
+
const transition = new wasm.IdentityUpdateTransitionWASM('GL2Rq8L3VuBEQfCAZykmUaiXXrsd1Bwub2gcaMmtNbn3', BigInt(1), BigInt(1), 1, [], [])
|
|
78
|
+
|
|
79
|
+
transition.nonce = BigInt(1231)
|
|
80
|
+
|
|
81
|
+
transition.nonce // -> BigInt
|
|
82
|
+
```
|
|
83
|
+
|
|
84
|
+
___
|
|
85
|
+
|
|
86
|
+
### `identityIdentifier`
|
|
87
|
+
|
|
88
|
+
Contains identity identifier in `IdentifierWASM`
|
|
89
|
+
|
|
90
|
+
```js
|
|
91
|
+
const transition = new wasm.IdentityUpdateTransitionWASM('GL2Rq8L3VuBEQfCAZykmUaiXXrsd1Bwub2gcaMmtNbn3', BigInt(1), BigInt(1), 1, [], [])
|
|
92
|
+
|
|
93
|
+
transition.identityIdentifier = '12FRq8L3VuBEQfCAZykmUaiXXrsd1Bwub2gcaMmtNbn3'
|
|
94
|
+
|
|
95
|
+
transition.identityIdentifier // -> IdentifierWASM
|
|
96
|
+
```
|
|
97
|
+
|
|
98
|
+
___
|
|
99
|
+
|
|
100
|
+
### `publicKeyIdsToAdd`
|
|
101
|
+
|
|
102
|
+
Contains public keys for adding in `[IdentityPublicKeyInCreationWASM]`
|
|
103
|
+
|
|
104
|
+
```js
|
|
105
|
+
const transition = new wasm.IdentityUpdateTransitionWASM('GL2Rq8L3VuBEQfCAZykmUaiXXrsd1Bwub2gcaMmtNbn3', BigInt(1), BigInt(1), 1, [], [])
|
|
106
|
+
|
|
107
|
+
transition.publicKeyIdsToAdd = [new wasm.IdentityPublicKeyInCreationWASM(1, 'system', 'master', 'ECDSA_SECP256K1', false, [], [])]
|
|
108
|
+
|
|
109
|
+
transition.publicKeyIdsToAdd // -> [IdentityPublicKeyInCreationWASM]
|
|
110
|
+
```
|
|
111
|
+
|
|
112
|
+
___
|
|
113
|
+
|
|
114
|
+
### `publicKeyIdsToDisable`
|
|
115
|
+
|
|
116
|
+
Contains public keys id's for disabling in `[Number]`
|
|
117
|
+
|
|
118
|
+
```js
|
|
119
|
+
const transition = new wasm.IdentityUpdateTransitionWASM('GL2Rq8L3VuBEQfCAZykmUaiXXrsd1Bwub2gcaMmtNbn3', BigInt(1), BigInt(1), 1, [], [])
|
|
120
|
+
|
|
121
|
+
transition.publicKeyIdsToDisable = [0, 1, 2]
|
|
122
|
+
|
|
123
|
+
transition.publicKeyIdsToDisable // -> [Number]
|
|
124
|
+
```
|
|
125
|
+
|
|
126
|
+
___
|
|
127
|
+
|
|
128
|
+
### `userFeeIncrease`
|
|
129
|
+
|
|
130
|
+
Contains userFeeIncrease in `Number`
|
|
131
|
+
|
|
132
|
+
```js
|
|
133
|
+
const transition = new wasm.IdentityUpdateTransitionWASM('GL2Rq8L3VuBEQfCAZykmUaiXXrsd1Bwub2gcaMmtNbn3', BigInt(1), BigInt(1), 1, [], [])
|
|
134
|
+
|
|
135
|
+
transition.userFeeIncrease = 99
|
|
136
|
+
|
|
137
|
+
transition.userFeeIncrease // -> Number
|
|
138
|
+
```
|
|
139
|
+
|
|
140
|
+
___
|
|
141
|
+
|
|
142
|
+
### `signature`
|
|
143
|
+
|
|
144
|
+
Contains transition signature in `Uint8Array`
|
|
145
|
+
|
|
146
|
+
```js
|
|
147
|
+
const transition = new wasm.IdentityUpdateTransitionWASM('GL2Rq8L3VuBEQfCAZykmUaiXXrsd1Bwub2gcaMmtNbn3', BigInt(1), BigInt(1), 1, [], [])
|
|
148
|
+
|
|
149
|
+
transition.signature = Uint8Array.from([12, 3, 4, 1])
|
|
150
|
+
|
|
151
|
+
transition.signature // -> Uint8Array
|
|
152
|
+
```
|
|
153
|
+
|
|
154
|
+
___
|
|
155
|
+
|
|
156
|
+
## Getters
|
|
157
|
+
|
|
158
|
+
### `getPurposeRequirement`
|
|
159
|
+
|
|
160
|
+
Returns purpose requirement in PurposeENUM `String`
|
|
161
|
+
|
|
162
|
+
```js
|
|
163
|
+
const transition = new wasm.IdentityUpdateTransitionWASM('GL2Rq8L3VuBEQfCAZykmUaiXXrsd1Bwub2gcaMmtNbn3', BigInt(1), BigInt(1), 1, [], [])
|
|
164
|
+
|
|
165
|
+
transition.getPurposeRequirement() // -> String
|
|
166
|
+
|
|
167
|
+
```
|
|
168
|
+
|
|
169
|
+
___
|
|
170
|
+
|
|
171
|
+
### `getModifiedDataIds`
|
|
172
|
+
|
|
173
|
+
Returns modified ids in `[IdentifierWASM]`
|
|
174
|
+
|
|
175
|
+
```js
|
|
176
|
+
const transition = new wasm.IdentityUpdateTransitionWASM('GL2Rq8L3VuBEQfCAZykmUaiXXrsd1Bwub2gcaMmtNbn3', BigInt(1), BigInt(1), 1, [], [])
|
|
177
|
+
|
|
178
|
+
transition.getModifiedDataIds() // -> [IdentifierWASM]
|
|
179
|
+
|
|
180
|
+
```
|
|
181
|
+
|
|
182
|
+
___
|
|
183
|
+
|
|
184
|
+
### `getOptionalAssetLockProof`
|
|
185
|
+
|
|
186
|
+
Returns asset lock proof in `AssetLockProofWASM | undefined`
|
|
187
|
+
|
|
188
|
+
```js
|
|
189
|
+
const transition = new wasm.IdentityUpdateTransitionWASM('GL2Rq8L3VuBEQfCAZykmUaiXXrsd1Bwub2gcaMmtNbn3', BigInt(1), BigInt(1), 1, [], [])
|
|
190
|
+
|
|
191
|
+
transition.getOptionalAssetLockProof() // -> AssetLockProofWASM | undefined
|
|
192
|
+
|
|
193
|
+
```
|
|
194
|
+
|
|
195
|
+
___
|
|
196
|
+
|
|
197
|
+
### `getSignableBytes`
|
|
198
|
+
|
|
199
|
+
Returns bytes for sign in `Uint8Array`
|
|
200
|
+
|
|
201
|
+
```js
|
|
202
|
+
const transition = new wasm.IdentityUpdateTransitionWASM('GL2Rq8L3VuBEQfCAZykmUaiXXrsd1Bwub2gcaMmtNbn3', BigInt(1), BigInt(1), 1, [], [])
|
|
203
|
+
|
|
204
|
+
transition.getSignableBytes() // -> Uint8Array
|
|
205
|
+
|
|
206
|
+
```
|
|
207
|
+
|
|
208
|
+
___
|
|
209
|
+
|
|
210
|
+
### `toBytes`
|
|
211
|
+
|
|
212
|
+
Returns transition in `Uint8Array`
|
|
213
|
+
|
|
214
|
+
```js
|
|
215
|
+
const transition = new wasm.IdentityUpdateTransitionWASM('GL2Rq8L3VuBEQfCAZykmUaiXXrsd1Bwub2gcaMmtNbn3', BigInt(1), BigInt(1), 1, [], [])
|
|
216
|
+
|
|
217
|
+
transition.toBytes() // -> Uint8Array
|
|
218
|
+
|
|
219
|
+
```
|
|
220
|
+
|
|
221
|
+
___
|
|
222
|
+
|
|
223
|
+
### `toStateTransition`
|
|
224
|
+
|
|
225
|
+
Returns `StateTransitionWASM`
|
|
226
|
+
|
|
227
|
+
```js
|
|
228
|
+
const transition = new wasm.IdentityUpdateTransitionWASM('GL2Rq8L3VuBEQfCAZykmUaiXXrsd1Bwub2gcaMmtNbn3', BigInt(1), BigInt(1), 1, [], [])
|
|
229
|
+
|
|
230
|
+
transition.toStateTransition() // -> StateTransitionWASM
|
|
231
|
+
|
|
232
|
+
```
|
|
233
|
+
|
|
234
|
+
___
|
|
@@ -0,0 +1,117 @@
|
|
|
1
|
+
# InstantAssetLockProofWASM
|
|
2
|
+
|
|
3
|
+
This class allows to create and interact with InstantAssetLockProof struct
|
|
4
|
+
|
|
5
|
+
`InstantAssetLockProofWASM` can be created via constructor and `fromObject`
|
|
6
|
+
|
|
7
|
+
Constructor arguments:
|
|
8
|
+
|
|
9
|
+
- `instantLock -> ArrayLike`
|
|
10
|
+
- `transaction -> ArrayLike`
|
|
11
|
+
- `outputIndex -> Number`
|
|
12
|
+
|
|
13
|
+
___
|
|
14
|
+
|
|
15
|
+
## Navigation
|
|
16
|
+
|
|
17
|
+
- [Example](#Example)
|
|
18
|
+
- [Getters](#getters)
|
|
19
|
+
- [toObject](#toobject)
|
|
20
|
+
- [getOutput](#getOutput)
|
|
21
|
+
- [Fields](#fields)
|
|
22
|
+
- [outputIndex](#outputindex)
|
|
23
|
+
- [instantLock](#instantLock)
|
|
24
|
+
- [Static](#static)
|
|
25
|
+
- [fromObject](#fromobject)
|
|
26
|
+
|
|
27
|
+
___
|
|
28
|
+
|
|
29
|
+
### Example
|
|
30
|
+
|
|
31
|
+
```js
|
|
32
|
+
const lockObject = {
|
|
33
|
+
instantLock: instantLockBytes,
|
|
34
|
+
transaction: transactionBytes,
|
|
35
|
+
outputIndex: 0
|
|
36
|
+
}
|
|
37
|
+
|
|
38
|
+
const instantLockProof = InstantAssetLockProofWASM.fromObject(lockObject)
|
|
39
|
+
// or
|
|
40
|
+
const instantLockProof = new InstantAssetLockProofWASM(instantLockBytes, transactionBytes, 0)
|
|
41
|
+
```
|
|
42
|
+
|
|
43
|
+
___
|
|
44
|
+
|
|
45
|
+
## Getters
|
|
46
|
+
|
|
47
|
+
### `toObject`
|
|
48
|
+
|
|
49
|
+
Allows to convert instance to `Object`
|
|
50
|
+
|
|
51
|
+
```js
|
|
52
|
+
instantLockProof.toObject() // -> Object
|
|
53
|
+
```
|
|
54
|
+
|
|
55
|
+
___
|
|
56
|
+
|
|
57
|
+
### `getOutput`
|
|
58
|
+
|
|
59
|
+
Allows to get outputs in `TxOutWASM`
|
|
60
|
+
|
|
61
|
+
```js
|
|
62
|
+
instantLockProof.getOutput() // -> TxOutWASM
|
|
63
|
+
```
|
|
64
|
+
|
|
65
|
+
___
|
|
66
|
+
|
|
67
|
+
## Fields
|
|
68
|
+
|
|
69
|
+
All fields are readable and writable.
|
|
70
|
+
|
|
71
|
+
### `outputIndex`
|
|
72
|
+
|
|
73
|
+
Contains output index in `Number`
|
|
74
|
+
|
|
75
|
+
```js
|
|
76
|
+
instantLockProof.outputIndex = 1
|
|
77
|
+
|
|
78
|
+
instantLockProof.outputIndex // -> Number
|
|
79
|
+
```
|
|
80
|
+
|
|
81
|
+
___
|
|
82
|
+
|
|
83
|
+
### `instantLock`
|
|
84
|
+
|
|
85
|
+
Contains instant lock in `InstantLockWASM`
|
|
86
|
+
|
|
87
|
+
```js
|
|
88
|
+
const instantLock = new InstantLockWASM(
|
|
89
|
+
0,
|
|
90
|
+
[],
|
|
91
|
+
'dbdb604952d08184b55d48c915ed78aadc81dbc5cc98e8b4821abe5b4bbcbecb',
|
|
92
|
+
'00000000000000151e0fe3ab9a12c57402153c9f476236148364ec4337213101',
|
|
93
|
+
'a9f131626c49a2f183b7a2f563ad1dc50ac8220190dbedb805209b608eb864e01d62f18bc9faa60a8b8a27f5a0c7c8b914fa3a14360a2f25558ee0e0a693b18faccbb59ec39b9b3cae430e0b76eb080752ce103df76537a1a583680a5914529d'
|
|
94
|
+
)
|
|
95
|
+
|
|
96
|
+
instantLockProof.instantLock = instantLock
|
|
97
|
+
|
|
98
|
+
instantLockProof.instantLock // -> InstantLockWASM
|
|
99
|
+
```
|
|
100
|
+
|
|
101
|
+
___
|
|
102
|
+
|
|
103
|
+
## Static
|
|
104
|
+
|
|
105
|
+
### `fromObject`
|
|
106
|
+
|
|
107
|
+
Allows to create `InstantAssetLockProofWASM` from `Object`
|
|
108
|
+
|
|
109
|
+
```js
|
|
110
|
+
const lockObject = {
|
|
111
|
+
instantLock: instantLockBytes,
|
|
112
|
+
transaction: transactionBytes,
|
|
113
|
+
outputIndex: 0
|
|
114
|
+
}
|
|
115
|
+
|
|
116
|
+
const instantLockProof = InstantAssetLockProofWASM.fromObject(lockObject) // -> InstantAssetLockProofWASM
|
|
117
|
+
```
|
|
@@ -0,0 +1,100 @@
|
|
|
1
|
+
# InstantLockWASM
|
|
2
|
+
|
|
3
|
+
This class allows to create InstantLock and interact with him.
|
|
4
|
+
|
|
5
|
+
`InstantLockWASM` can be created only via constructor
|
|
6
|
+
|
|
7
|
+
Constructor arguments:
|
|
8
|
+
|
|
9
|
+
- `version -> Number`
|
|
10
|
+
- `input -> [OutPointWASM]`
|
|
11
|
+
- `txid -> String`
|
|
12
|
+
- `cycleHash -> String`
|
|
13
|
+
- `blsSignature -> String`
|
|
14
|
+
|
|
15
|
+
___
|
|
16
|
+
|
|
17
|
+
## Navigation
|
|
18
|
+
|
|
19
|
+
- [Example](#Example)
|
|
20
|
+
- [Fields](#fields)
|
|
21
|
+
- [version](#version)
|
|
22
|
+
- [inputs](#inputs)
|
|
23
|
+
- [txid](#txid)
|
|
24
|
+
- [cyclehash](#cyclehash)
|
|
25
|
+
- [blsSignature](#blssignature)
|
|
26
|
+
___
|
|
27
|
+
|
|
28
|
+
### Example
|
|
29
|
+
|
|
30
|
+
```js
|
|
31
|
+
const instantLock = new InstantLockWASM(
|
|
32
|
+
0,
|
|
33
|
+
[],
|
|
34
|
+
'dbdb604952d08184b55d48c915ed78aadc81dbc5cc98e8b4821abe5b4bbcbecb',
|
|
35
|
+
'00000000000000151e0fe3ab9a12c57402153c9f476236148364ec4337213101',
|
|
36
|
+
'a9f131626c49a2f183b7a2f563ad1dc50ac8220190dbedb805209b608eb864e01d62f18bc9faa60a8b8a27f5a0c7c8b914fa3a14360a2f25558ee0e0a693b18faccbb59ec39b9b3cae430e0b76eb080752ce103df76537a1a583680a5914529d'
|
|
37
|
+
)
|
|
38
|
+
```
|
|
39
|
+
|
|
40
|
+
___
|
|
41
|
+
|
|
42
|
+
## Fields
|
|
43
|
+
|
|
44
|
+
All fields are readable and writable.
|
|
45
|
+
|
|
46
|
+
### `version`
|
|
47
|
+
This field contains version of instant lock in `Number`
|
|
48
|
+
|
|
49
|
+
```js
|
|
50
|
+
instantLock.version = 12
|
|
51
|
+
|
|
52
|
+
instantLock.version // -> Number
|
|
53
|
+
```
|
|
54
|
+
___
|
|
55
|
+
|
|
56
|
+
### `inputs`
|
|
57
|
+
This fields contains input for instant lock in array of `OutPointWASM`
|
|
58
|
+
|
|
59
|
+
```js
|
|
60
|
+
instantLock.inputs = [
|
|
61
|
+
new OutPointWASM(
|
|
62
|
+
'e8b43025641eea4fd21190f01bd870ef90f1a8b199d8fc3376c5b62c0b1a179d',
|
|
63
|
+
1
|
|
64
|
+
)
|
|
65
|
+
]
|
|
66
|
+
|
|
67
|
+
instantLock.inputs // -> [OutPointWASM]
|
|
68
|
+
```
|
|
69
|
+
|
|
70
|
+
___
|
|
71
|
+
|
|
72
|
+
### `txid`
|
|
73
|
+
|
|
74
|
+
Contains id of transaction in `String`
|
|
75
|
+
|
|
76
|
+
```js
|
|
77
|
+
instantLock.txid = 'e8b43025641eea4fd21190f01bd870ef90f1a8b199d8fc3376c5b62c0b1a179d'
|
|
78
|
+
|
|
79
|
+
instantLock.txid // -> String
|
|
80
|
+
```
|
|
81
|
+
|
|
82
|
+
___
|
|
83
|
+
|
|
84
|
+
### `cyclehash`
|
|
85
|
+
contains hash to figure out which quorum was used to sign this IS lock in `String`
|
|
86
|
+
|
|
87
|
+
```js
|
|
88
|
+
instantLock.cyclehash = '00000000000000151e0fe3ab9a12c57402153c9f476236148364ec4337213101'
|
|
89
|
+
|
|
90
|
+
instantLock.cyclehash // -> String
|
|
91
|
+
```
|
|
92
|
+
|
|
93
|
+
### `blsSignature`
|
|
94
|
+
contains BLS signature in `String`
|
|
95
|
+
|
|
96
|
+
```js
|
|
97
|
+
instantLock.blsSignature = 'a9f131626c49a2f183b7a2f563ad1dc50ac8220190dbedb805209b608eb864e01d62f18bc9faa60a8b8a27f5a0c7c8b914fa3a14360a2f25558ee0e0a693b18faccbb59ec39b9b3cae430e0b76eb080752ce103df76537a1a583680a5914529d'
|
|
98
|
+
|
|
99
|
+
instantLock.blsSignature // -> String
|
|
100
|
+
```
|
package/docs/OutPoint.md
ADDED
|
@@ -0,0 +1,80 @@
|
|
|
1
|
+
# OutPointWASM
|
|
2
|
+
|
|
3
|
+
This class allows to create and interact with OutPoint struct
|
|
4
|
+
|
|
5
|
+
You can create `OutPointWASM` via constructor and `fromBytes`
|
|
6
|
+
|
|
7
|
+
If you want to create `OutPoint` from bytes,
|
|
8
|
+
you need to use serialized to bytes `OutPoint` from `rs-dpp` or `pshenmic-dpp`
|
|
9
|
+
|
|
10
|
+
Constructor arguments:
|
|
11
|
+
|
|
12
|
+
- `txid -> HEX String`
|
|
13
|
+
- `vout -> Number`
|
|
14
|
+
|
|
15
|
+
___
|
|
16
|
+
|
|
17
|
+
## Navigation
|
|
18
|
+
|
|
19
|
+
- [Example](#Example)
|
|
20
|
+
- [Getters](#getters)
|
|
21
|
+
- [getVOUT](#getvout)
|
|
22
|
+
- [getTXID](#gettxid)
|
|
23
|
+
- [toBytes](#tobytes)
|
|
24
|
+
- [Static](#static)
|
|
25
|
+
- [fromBytes](#frombytes)
|
|
26
|
+
|
|
27
|
+
___
|
|
28
|
+
|
|
29
|
+
### Example
|
|
30
|
+
|
|
31
|
+
```js
|
|
32
|
+
const outpoint = new OutPointWASM(
|
|
33
|
+
'e8b43025641eea4fd21190f01bd870ef90f1a8b199d8fc3376c5b62c0b1a179d',
|
|
34
|
+
1
|
|
35
|
+
)
|
|
36
|
+
```
|
|
37
|
+
|
|
38
|
+
___
|
|
39
|
+
|
|
40
|
+
## Getters
|
|
41
|
+
|
|
42
|
+
### `getVOUT`
|
|
43
|
+
|
|
44
|
+
Allows to get vout in `Number`
|
|
45
|
+
|
|
46
|
+
```js
|
|
47
|
+
outpoint.getVOUT() // -> Number
|
|
48
|
+
```
|
|
49
|
+
|
|
50
|
+
___
|
|
51
|
+
|
|
52
|
+
### `getTXID`
|
|
53
|
+
|
|
54
|
+
Allows to get tx id in `String`
|
|
55
|
+
|
|
56
|
+
```js
|
|
57
|
+
outpoint.getTXID() // -> String
|
|
58
|
+
```
|
|
59
|
+
|
|
60
|
+
___
|
|
61
|
+
|
|
62
|
+
### `toBytes`
|
|
63
|
+
|
|
64
|
+
Allows to get OutPoint in `Uint8Array`
|
|
65
|
+
|
|
66
|
+
```js
|
|
67
|
+
outpoint.toBytes() // -> Uint8Array
|
|
68
|
+
```
|
|
69
|
+
|
|
70
|
+
___
|
|
71
|
+
|
|
72
|
+
## Static
|
|
73
|
+
|
|
74
|
+
### `fromBytes`
|
|
75
|
+
|
|
76
|
+
Allows to create `OutPointWASM` from bytes in `ArrayLike`
|
|
77
|
+
|
|
78
|
+
```js
|
|
79
|
+
const outpoint = OutpointWASM.fromBytes([]) // -> OutPointWASM
|
|
80
|
+
```
|