pshenmic-dpp 1.0.6 → 1.0.7-rc.10

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 (163) hide show
  1. package/README.md +46 -1
  2. package/dist/wasm/index.d.ts +50 -2
  3. package/dist/wasm/index.js +14 -0
  4. package/dist/wasm/pshenmic_dpp.d.ts +1329 -126
  5. package/dist/wasm/pshenmic_dpp.js +11353 -3088
  6. package/dist/wasm/pshenmic_dpp_bg.js +1 -1
  7. package/dist/wasm/pshenmic_dpp_bg.wasm.d.ts +683 -86
  8. package/package.json +11 -4
  9. package/tests/AssetLockProof.spec.js +3 -8
  10. package/tests/AuthorizedActionTakers.spec.js +75 -0
  11. package/tests/BatchTransition.spec.js +141 -0
  12. package/tests/ChainLockProof.spec.js +3 -9
  13. package/tests/ChangeControlRules.spec.js +184 -0
  14. package/tests/CoreScript.spec.js +3 -9
  15. package/tests/DataContract.spec.js +5 -9
  16. package/tests/DataContractCreateStateTransition.spec.js +11 -17
  17. package/tests/DataContractUpdateStateTransition.spec.js +11 -17
  18. package/tests/DistributionFunction.spec.js +416 -0
  19. package/tests/Document.spec.js +4 -9
  20. package/tests/DocumentTransition.spec.js +2 -5
  21. package/tests/DocumentsTransitions.spec.js +85 -91
  22. package/tests/Identifier.spec.js +1 -3
  23. package/tests/Identity.spec.js +5 -11
  24. package/tests/IdentityCreateTransition.spec.js +3 -9
  25. package/tests/IdentityCreditTransferTransition.spec.js +2 -8
  26. package/tests/IdentityCreditWithdrawalTransition.spec.js +2 -8
  27. package/tests/IdentityPublicKey.spec.js +5 -11
  28. package/tests/IdentityTopUpTransition.spec.js +2 -8
  29. package/tests/IdentityUpdateTransition.spec.js +2 -8
  30. package/tests/InstantLockProof.spec.js +2 -8
  31. package/tests/OutPoint.spec.js +3 -9
  32. package/tests/PrivateKey.spec.js +8 -14
  33. package/tests/PublicKeyInCreation.spec.js +2 -8
  34. package/tests/RewardDistributionType.spec.js +90 -0
  35. package/tests/TokenBaseTransition.spec.js +96 -0
  36. package/tests/TokenConfiguration.spec.js +110 -0
  37. package/tests/TokenConfigurationConvention.spec.js +93 -0
  38. package/tests/TokenConfigurationLocalization.spec.js +59 -0
  39. package/tests/TokenDistributionRecipient.spec.js +49 -0
  40. package/tests/TokenDistributionRules.spec.js +313 -0
  41. package/tests/TokenKeepsHistoryRules.spec.js +67 -0
  42. package/tests/TokenPerpetualDistribution.spec.js +130 -0
  43. package/tests/TokenPreProgrammedDistribution.spec.js +61 -0
  44. package/tests/TokensTransitions.spec.js +509 -0
  45. package/tests/TxOut.spec.js +2 -8
  46. package/tests/mocks/PublicKey/index.js +1 -1
  47. package/tests/mocks/TokenConfiguration/index.js +7 -0
  48. package/.editorconfig +0 -10
  49. package/.gitattributes +0 -4
  50. package/.github/workflows/build.yml +0 -54
  51. package/.github/workflows/publish.yml +0 -50
  52. package/Cargo.lock +0 -2452
  53. package/Cargo.toml +0 -52
  54. package/babel.config.json +0 -19
  55. package/docs/AssetLockProof.md +0 -107
  56. package/docs/Building.md +0 -50
  57. package/docs/ChainLockProof.md +0 -63
  58. package/docs/CoreScript.md +0 -17
  59. package/docs/DataContract.md +0 -192
  60. package/docs/DataContractCreateTransition.md +0 -84
  61. package/docs/DataContractUpdateTransition.md +0 -84
  62. package/docs/Document.md +0 -396
  63. package/docs/DocumentBaseTransition.md +0 -111
  64. package/docs/DocumentCreateTransition.md +0 -132
  65. package/docs/DocumentDeleteTransition.md +0 -82
  66. package/docs/DocumentPurchaseTransition.md +0 -109
  67. package/docs/DocumentReplaceTransition.md +0 -112
  68. package/docs/DocumentTransferTransition.md +0 -96
  69. package/docs/DocumentTransition.md +0 -125
  70. package/docs/DocumentUpdatePriceTransition.md +0 -109
  71. package/docs/DocumentsBatch.md +0 -133
  72. package/docs/Enums.md +0 -103
  73. package/docs/Home.md +0 -28
  74. package/docs/Identifier.md +0 -37
  75. package/docs/Identity.md +0 -140
  76. package/docs/IdentityCreateTransition.md +0 -155
  77. package/docs/IdentityCreditTransfer.md +0 -187
  78. package/docs/IdentityCreditWithdrawalTransition.md +0 -244
  79. package/docs/IdentityPublicKey.md +0 -348
  80. package/docs/IdentityPublicKeyInCreation.md +0 -141
  81. package/docs/IdentityTopUpTransition.md +0 -166
  82. package/docs/IdentityUpdateTransition.md +0 -234
  83. package/docs/InstantAssetLockProof.md +0 -117
  84. package/docs/InstantLock.md +0 -100
  85. package/docs/OutPoint.md +0 -80
  86. package/docs/PrefundedVotingBalance.md +0 -48
  87. package/docs/PrivateKey.md +0 -112
  88. package/docs/TxOut.md +0 -93
  89. package/packages/asset_lock_proof/Cargo.toml +0 -19
  90. package/packages/asset_lock_proof/src/chain/mod.rs +0 -79
  91. package/packages/asset_lock_proof/src/instant/instant_lock.rs +0 -111
  92. package/packages/asset_lock_proof/src/instant/mod.rs +0 -115
  93. package/packages/asset_lock_proof/src/lib.rs +0 -133
  94. package/packages/asset_lock_proof/src/outpoint/mod.rs +0 -79
  95. package/packages/asset_lock_proof/src/tx_out/mod.rs +0 -80
  96. package/packages/cbor_conversation/Cargo.toml +0 -17
  97. package/packages/cbor_conversation/src/lib.rs +0 -24
  98. package/packages/core_script/Cargo.toml +0 -13
  99. package/packages/core_script/src/lib.rs +0 -69
  100. package/packages/data_contract/Cargo.toml +0 -18
  101. package/packages/data_contract/src/lib.rs +0 -338
  102. package/packages/data_contract_transitions/Cargo.toml +0 -14
  103. package/packages/data_contract_transitions/src/create/mod.rs +0 -161
  104. package/packages/data_contract_transitions/src/lib.rs +0 -2
  105. package/packages/data_contract_transitions/src/update/mod.rs +0 -144
  106. package/packages/document/Cargo.toml +0 -18
  107. package/packages/document/src/lib.rs +0 -102
  108. package/packages/document/src/methods/mod.rs +0 -373
  109. package/packages/documents_batch/Cargo.toml +0 -20
  110. package/packages/documents_batch/src/document_base_transition/mod.rs +0 -88
  111. package/packages/documents_batch/src/document_transition/mod.rs +0 -166
  112. package/packages/documents_batch/src/generators.rs +0 -122
  113. package/packages/documents_batch/src/lib.rs +0 -195
  114. package/packages/documents_batch/src/prefunded_voting_balance/mod.rs +0 -45
  115. package/packages/documents_batch/src/transitions/create/mod.rs +0 -126
  116. package/packages/documents_batch/src/transitions/delete/mod.rs +0 -67
  117. package/packages/documents_batch/src/transitions/mod.rs +0 -6
  118. package/packages/documents_batch/src/transitions/purchase/mod.rs +0 -91
  119. package/packages/documents_batch/src/transitions/replace/mod.rs +0 -93
  120. package/packages/documents_batch/src/transitions/transfer/mod.rs +0 -84
  121. package/packages/documents_batch/src/transitions/update_price/mod.rs +0 -75
  122. package/packages/enums/Cargo.toml +0 -13
  123. package/packages/enums/src/batch/batch_enum.rs +0 -84
  124. package/packages/enums/src/batch/mod.rs +0 -1
  125. package/packages/enums/src/keys/key_type.rs +0 -82
  126. package/packages/enums/src/keys/mod.rs +0 -3
  127. package/packages/enums/src/keys/purpose.rs +0 -96
  128. package/packages/enums/src/keys/security_level.rs +0 -78
  129. package/packages/enums/src/lib.rs +0 -6
  130. package/packages/enums/src/lock_types/mod.rs +0 -65
  131. package/packages/enums/src/network/mod.rs +0 -67
  132. package/packages/enums/src/platform/mod.rs +0 -98
  133. package/packages/enums/src/withdrawal/mod.rs +0 -72
  134. package/packages/identifier/Cargo.toml +0 -9
  135. package/packages/identifier/src/lib.rs +0 -105
  136. package/packages/identity/Cargo.toml +0 -16
  137. package/packages/identity/src/lib.rs +0 -103
  138. package/packages/identity_public_key/Cargo.toml +0 -15
  139. package/packages/identity_public_key/src/lib.rs +0 -190
  140. package/packages/identity_transitions/Cargo.toml +0 -21
  141. package/packages/identity_transitions/src/create_transition/mod.rs +0 -164
  142. package/packages/identity_transitions/src/credit_withdrawal_transition/mod.rs +0 -212
  143. package/packages/identity_transitions/src/identity_credit_transfer_transition/mod.rs +0 -169
  144. package/packages/identity_transitions/src/lib.rs +0 -6
  145. package/packages/identity_transitions/src/public_key_in_creation/mod.rs +0 -197
  146. package/packages/identity_transitions/src/top_up_transition/mod.rs +0 -141
  147. package/packages/identity_transitions/src/update_transition/mod.rs +0 -213
  148. package/packages/mock_bls/Cargo.toml +0 -12
  149. package/packages/mock_bls/src/lib.rs +0 -26
  150. package/packages/private_key/Cargo.toml +0 -14
  151. package/packages/private_key/src/lib.rs +0 -70
  152. package/packages/state_transition/Cargo.toml +0 -20
  153. package/packages/state_transition/src/lib.rs +0 -163
  154. package/packages/utils/Cargo.toml +0 -19
  155. package/packages/utils/src/buffer.rs +0 -29
  156. package/packages/utils/src/lib.rs +0 -350
  157. package/scripts/build-js.sh +0 -56
  158. package/scripts/build.sh +0 -59
  159. package/src/lib.rs +0 -18
  160. package/tests/DocumentBatchTransition.spec.js +0 -109
  161. package/tests/utils/wasm.js +0 -14
  162. package/tsconfig.json +0 -18
  163. package/typings/index.d.ts +0 -52
package/README.md CHANGED
@@ -37,10 +37,43 @@ ___
37
37
 
38
38
  **At this moment available structs:**
39
39
  - `Document`
40
- - `DocumentsBatch`
40
+ - `Batch`
41
41
  - `DocumentsBaseTransition`
42
+ - `TokenBaseTransitionWASM`
43
+ - `TokenPricingScheduleWASM`
44
+ - `TokenTransitionWASM`
45
+ - `BatchedTransitionWASM`
46
+ - `TokenConfigurationChangeItemWASM`
47
+ - `TokenConfigurationWASM`
48
+ - `ActionTakerWASM`
49
+ - `AuthorizedActionTakersWASM`
50
+ - `ChangeControlRulesWASM`
51
+ - `TokenConfigurationConventionWASM`
52
+ - `DistributionFunctionWASM`
53
+ - `TokenDistributionRecipientWASM`
54
+ - `TokenDistributionRulesWASM`
55
+ - distribution structs:
56
+ - `DistributionFixedAmountWASM`
57
+ - `DistributionRandomWASM`
58
+ - `DistributionStepDecreasingAmountWASM`
59
+ - `DistributionLinearWASM`
60
+ - `DistributionPolynomialWASM`
61
+ - `DistributionExponentialWASM`
62
+ - `DistributionLogarithmicWASM`
63
+ - `DistributionInvertedLogarithmicWASM`
64
+ - `GroupWASM`
65
+ - `TokenKeepsHistoryRulesWASM`
66
+ - `TokenConfigurationLocalizationWASM`
67
+ - `TokenMarketplaceRulesWASM`
68
+ - `TokenPerpetualDistributionWASM`
69
+ - `TokenPreProgrammedDistributionWASM`
70
+ - `RewardDistributionTypeWASM`
71
+ - `TokenTradeModeWASM`
72
+ - `GroupStateTransitionInfoWASM`
42
73
  - `DocumentsTransition`
43
74
  - `PrefundedVotingBalance`
75
+ - `PrivateEncryptedNoteWASM`
76
+ - `SharedEncryptedNoteWASM`
44
77
  - DocumentsTransitions:
45
78
  - `DocuemntCreateTransition`
46
79
  - `DocuemntDeleteTransition`
@@ -48,6 +81,18 @@ ___
48
81
  - `DocuemntReplaceTransition`
49
82
  - `DocumentTransferTransition`
50
83
  - `DocumentUpdatePriceTransition`
84
+ - Tokens Transitions:
85
+ - `TokenConfigUpdateTransitionWASM`
86
+ - `TokenDirectPurchaseTransitionWASM`
87
+ - `TokenSetPriceForDirectPurchaseTransitionWASM`
88
+ - `TokenBurnTransitionWASM`
89
+ - `TokenClaimTransitionWASM`
90
+ - `TokenDestroyFrozenFundsTransitionWASM`
91
+ - `TokenEmergencyActionTransitionWASM`
92
+ - `TokenFreezeTransitionWASM`
93
+ - `TokenMintTransitionWASM`
94
+ - `TokenTransferTransitionWASM`
95
+ - `TokenUnFreezeTransitionWASM`
51
96
  - `IdentityPublicKey`
52
97
  - IdentityTransitions:
53
98
  - `IdentityCreateTransition`
@@ -1,6 +1,10 @@
1
1
  import * as DPP from './pshenmic_dpp';
2
2
 
3
- export * from './pshenmic_dpp';
3
+ export * from './pshenmic_dpp'
4
+
5
+ export default dpp;
6
+
7
+ declare const dpp: DashPlatformProtocolWASM;
4
8
 
5
9
  export class DashPlatformProtocolWASM {
6
10
  // CLASSES
@@ -19,7 +23,50 @@ export class DashPlatformProtocolWASM {
19
23
  DocumentTransitionWASM: typeof DPP.DocumentTransitionWASM
20
24
  DocumentUpdatePriceTransitionWASM: typeof DPP.DocumentUpdatePriceTransitionWASM
21
25
  DocumentWASM: typeof DPP.DocumentWASM
22
- DocumentsBatchWASM: typeof DPP.DocumentsBatchWASM
26
+ BatchTransitionWASM: typeof DPP.BatchTransitionWASM
27
+ BatchedTransitionWASM: typeof DPP.BatchedTransitionWASM
28
+ TokenTransitionWASM: typeof DPP.TokenTransitionWASM
29
+ TokenBaseTransitionWASM: typeof DPP.TokenBaseTransitionWASM
30
+ TokenPricingScheduleWASM: typeof DPP.TokenPricingScheduleWASM
31
+ TokenConfigUpdateTransitionWASM: typeof DPP.TokenConfigUpdateTransitionWASM
32
+ TokenDirectPurchaseTransitionWASM: typeof DPP.TokenDirectPurchaseTransitionWASM
33
+ TokenSetPriceForDirectPurchaseTransitionWASM: typeof DPP.TokenSetPriceForDirectPurchaseTransitionWASM
34
+ TokenBurnTransitionWASM: typeof DPP.TokenBurnTransitionWASM
35
+ TokenClaimTransitionWASM: typeof DPP.TokenClaimTransitionWASM
36
+ TokenDestroyFrozenFundsTransitionWASM: typeof DPP.TokenDestroyFrozenFundsTransitionWASM
37
+ TokenEmergencyActionTransitionWASM: typeof DPP.TokenEmergencyActionTransitionWASM
38
+ TokenFreezeTransitionWASM: typeof DPP.TokenFreezeTransitionWASM
39
+ TokenMintTransitionWASM: typeof DPP.TokenMintTransitionWASM
40
+ TokenTransferTransitionWASM: typeof DPP.TokenTransferTransitionWASM
41
+ TokenUnFreezeTransitionWASM: typeof DPP.TokenUnFreezeTransitionWASM
42
+ GroupStateTransitionInfoWASM: typeof DPP.GroupStateTransitionInfoWASM
43
+ PrivateEncryptedNoteWASM: typeof DPP.PrivateEncryptedNoteWASM
44
+ SharedEncryptedNoteWASM: typeof DPP.SharedEncryptedNoteWASM
45
+ TokenConfigurationChangeItemWASM: typeof DPP.TokenConfigurationChangeItemWASM
46
+ AuthorizedActionTakersWASM: typeof DPP.AuthorizedActionTakersWASM
47
+ DistributionFunctionWASM: typeof DPP.DistributionFunctionWASM
48
+ TokenDistributionRecipientWASM: typeof DPP.TokenDistributionRecipientWASM
49
+ DistributionFixedAmountWASM: typeof DPP.DistributionFixedAmountWASM
50
+ DistributionRandomWASM: typeof DPP.DistributionRandomWASM
51
+ DistributionStepDecreasingAmountWASM: typeof DPP.DistributionStepDecreasingAmountWASM
52
+ DistributionLinearWASM: typeof DPP.DistributionLinearWASM
53
+ DistributionPolynomialWASM: typeof DPP.DistributionPolynomialWASM
54
+ DistributionExponentialWASM: typeof DPP.DistributionExponentialWASM
55
+ DistributionLogarithmicWASM: typeof DPP.DistributionLogarithmicWASM
56
+ DistributionInvertedLogarithmicWASM: typeof DPP.DistributionInvertedLogarithmicWASM
57
+ TokenConfigurationLocalizationWASM: typeof DPP.TokenConfigurationLocalizationWASM
58
+ TokenPerpetualDistributionWASM: typeof DPP.TokenPerpetualDistributionWASM
59
+ RewardDistributionTypeWASM: typeof DPP.RewardDistributionTypeWASM
60
+ TokenConfigurationConventionWASM: typeof DPP.TokenConfigurationConventionWASM
61
+ TokenTradeModeWASM: typeof DPP.TokenTradeModeWASM
62
+ TokenConfigurationWASM: typeof DPP.TokenConfigurationWASM
63
+ ActionTakerWASM: typeof DPP.ActionTakerWASM
64
+ ChangeControlRulesWASM: typeof DPP.ChangeControlRulesWASM
65
+ TokenDistributionRulesWASM: typeof DPP.TokenDistributionRulesWASM
66
+ GroupWASM: typeof DPP.GroupWASM
67
+ TokenKeepsHistoryRulesWASM: typeof DPP.TokenKeepsHistoryRulesWASM
68
+ TokenMarketplaceRulesWASM: typeof DPP.TokenMarketplaceRulesWASM
69
+ TokenPreProgrammedDistributionWASM: typeof DPP.TokenPreProgrammedDistributionWASM
23
70
  IdentifierWASM: typeof DPP.IdentifierWASM
24
71
  IdentityCreateTransitionWASM: typeof DPP.IdentityCreateTransitionWASM
25
72
  IdentityCreditTransferWASM: typeof DPP.IdentityCreditTransferWASM
@@ -45,6 +92,7 @@ export class DashPlatformProtocolWASM {
45
92
  PoolingWASM: typeof DPP.PoolingWASM
46
93
  Purpose: typeof DPP.Purpose
47
94
  SecurityLevel: typeof DPP.SecurityLevel
95
+ ActionGoalWASM: typeof DPP.ActionGoalWASM
48
96
  // METHODS
49
97
  cborToObject: typeof DPP.cborToObject
50
98
  objectToCbor: typeof DPP.objectToCbor
@@ -0,0 +1,14 @@
1
+ import * as DPP from './pshenmic_dpp.js';
2
+ import {default as wasmBytes} from "./pshenmic_dpp_bg.js";
3
+
4
+ export * from './pshenmic_dpp.js'
5
+
6
+ const binaryString = atob(wasmBytes);
7
+ const bytes = new Uint8Array(binaryString.length);
8
+ for (let i = 0; i < binaryString.length; i++) {
9
+ bytes[i] = binaryString.charCodeAt(i);
10
+ }
11
+
12
+ const dppInstance = DPP.initSync({ module: bytes.buffer });
13
+
14
+ export default DPP;