pshenmic-dpp 1.1.2-dev.7 → 2.0.0-dev.1

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 (324) hide show
  1. package/README.md +14 -99
  2. package/dist/binaries/bindingsTypes.d.ts +1696 -0
  3. package/dist/binaries/bindingsTypes.js +98 -0
  4. package/dist/binaries/pshenmic_dpp.android.node/react-native-node-api-module +0 -0
  5. package/dist/binaries/pshenmic_dpp.android.node/x86_64/libpshenmic_dpp.so +0 -0
  6. package/dist/binaries/pshenmic_dpp.d.ts +166 -0
  7. package/dist/binaries/pshenmic_dpp.js +3 -0
  8. package/dist/binaries/wasm/wasmBytes.d.ts +2 -0
  9. package/dist/binaries/wasm/wasmBytes.js +2 -0
  10. package/dist/binaries/wasm.d.ts +166 -0
  11. package/dist/binaries/wasm.js +44 -0
  12. package/dist/src/dpp/constants.d.ts +4 -0
  13. package/dist/src/dpp/constants.js +19 -0
  14. package/dist/src/dpp/dpp.d.ts +110 -0
  15. package/dist/src/dpp/dpp.js +110 -0
  16. package/dist/src/dpp/enums.d.ts +1 -0
  17. package/dist/src/dpp/enums.js +1 -0
  18. package/dist/src/dpp/provider.d.ts +11 -0
  19. package/dist/src/dpp/provider.js +21 -0
  20. package/dist/src/dpp/structs/Address/AddressWitness.d.ts +12 -0
  21. package/dist/src/dpp/structs/Address/AddressWitness.js +23 -0
  22. package/dist/src/dpp/structs/Address/PlatformAddress.d.ts +14 -0
  23. package/dist/src/dpp/structs/Address/PlatformAddress.js +32 -0
  24. package/dist/src/dpp/structs/AddressTransitions/AddressCreditWithdrawalTransition.d.ts +38 -0
  25. package/dist/src/dpp/structs/AddressTransitions/AddressCreditWithdrawalTransition.js +95 -0
  26. package/dist/src/dpp/structs/AddressTransitions/AddressFundingFromAssetLockTransition.d.ts +35 -0
  27. package/dist/src/dpp/structs/AddressTransitions/AddressFundingFromAssetLockTransition.js +85 -0
  28. package/dist/src/dpp/structs/AddressTransitions/AddressFundsTransferTransition.d.ts +30 -0
  29. package/dist/src/dpp/structs/AddressTransitions/AddressFundsTransferTransition.js +72 -0
  30. package/dist/src/dpp/structs/AddressTransitions/IdentityCreateFromAddressesTransition.d.ts +33 -0
  31. package/dist/src/dpp/structs/AddressTransitions/IdentityCreateFromAddressesTransition.js +82 -0
  32. package/dist/src/dpp/structs/AddressTransitions/IdentityCreditTransferToAddressesTransition.d.ts +31 -0
  33. package/dist/src/dpp/structs/AddressTransitions/IdentityCreditTransferToAddressesTransition.js +77 -0
  34. package/dist/src/dpp/structs/AddressTransitions/IdentityTopUpFromAddressesTransition.d.ts +31 -0
  35. package/dist/src/dpp/structs/AddressTransitions/IdentityTopUpFromAddressesTransition.js +76 -0
  36. package/dist/src/dpp/structs/AddressTransitions/entities/AddressFundsFeeStrategyStep.d.ts +12 -0
  37. package/dist/src/dpp/structs/AddressTransitions/entities/AddressFundsFeeStrategyStep.js +26 -0
  38. package/dist/src/dpp/structs/AddressTransitions/entities/InputAddress.d.ts +14 -0
  39. package/dist/src/dpp/structs/AddressTransitions/entities/InputAddress.js +32 -0
  40. package/dist/src/dpp/structs/AddressTransitions/entities/OutputAddress.d.ts +12 -0
  41. package/dist/src/dpp/structs/AddressTransitions/entities/OutputAddress.js +26 -0
  42. package/dist/src/dpp/structs/AddressTransitions/entities/OutputAddressNullableCredits.d.ts +12 -0
  43. package/dist/src/dpp/structs/AddressTransitions/entities/OutputAddressNullableCredits.js +29 -0
  44. package/dist/src/dpp/structs/AssetLockProof/AssetLockProof.d.ts +19 -0
  45. package/dist/src/dpp/structs/AssetLockProof/AssetLockProof.js +51 -0
  46. package/dist/src/dpp/structs/AssetLockProof/ChainAssetLockProof.d.ts +17 -0
  47. package/dist/src/dpp/structs/AssetLockProof/ChainAssetLockProof.js +36 -0
  48. package/dist/src/dpp/structs/AssetLockProof/InstantAssetLockProof.d.ts +24 -0
  49. package/dist/src/dpp/structs/AssetLockProof/InstantAssetLockProof.js +48 -0
  50. package/dist/src/dpp/structs/AssetLockProof/OutPoint.d.ts +15 -0
  51. package/dist/src/dpp/structs/AssetLockProof/OutPoint.js +40 -0
  52. package/dist/src/dpp/structs/AssetLockProof/Transaction.d.ts +20 -0
  53. package/dist/src/dpp/structs/AssetLockProof/Transaction.js +49 -0
  54. package/dist/src/dpp/structs/AssetLockProof/TxIn.d.ts +17 -0
  55. package/dist/src/dpp/structs/AssetLockProof/TxIn.js +39 -0
  56. package/dist/src/dpp/structs/AssetLockProof/TxOut.d.ts +13 -0
  57. package/dist/src/dpp/structs/AssetLockProof/TxOut.js +34 -0
  58. package/dist/src/dpp/structs/AssetLockProof/Witness.d.ts +11 -0
  59. package/dist/src/dpp/structs/AssetLockProof/Witness.js +25 -0
  60. package/dist/src/dpp/structs/Batch/BatchTransition.d.ts +34 -0
  61. package/dist/src/dpp/structs/Batch/BatchTransition.js +95 -0
  62. package/dist/src/dpp/structs/Batch/BatchedTransition.d.ts +13 -0
  63. package/dist/src/dpp/structs/Batch/BatchedTransition.js +39 -0
  64. package/dist/src/dpp/structs/Batch/DocumentBaseTransition.d.ts +20 -0
  65. package/dist/src/dpp/structs/Batch/DocumentBaseTransition.js +54 -0
  66. package/dist/src/dpp/structs/Batch/DocumentTransition.d.ts +32 -0
  67. package/dist/src/dpp/structs/Batch/DocumentTransition.js +74 -0
  68. package/dist/src/dpp/structs/Batch/DocumentTransitions/DocumentCreateTransition.d.ts +23 -0
  69. package/dist/src/dpp/structs/Batch/DocumentTransitions/DocumentCreateTransition.js +58 -0
  70. package/dist/src/dpp/structs/Batch/DocumentTransitions/DocumentDeleteTransition.d.ts +14 -0
  71. package/dist/src/dpp/structs/Batch/DocumentTransitions/DocumentDeleteTransition.js +26 -0
  72. package/dist/src/dpp/structs/Batch/DocumentTransitions/DocumentPurchaseTransition.d.ts +19 -0
  73. package/dist/src/dpp/structs/Batch/DocumentTransitions/DocumentPurchaseTransition.js +39 -0
  74. package/dist/src/dpp/structs/Batch/DocumentTransitions/DocumentReplaceTransition.d.ts +19 -0
  75. package/dist/src/dpp/structs/Batch/DocumentTransitions/DocumentReplaceTransition.js +40 -0
  76. package/dist/src/dpp/structs/Batch/DocumentTransitions/DocumentTransferTransition.d.ts +19 -0
  77. package/dist/src/dpp/structs/Batch/DocumentTransitions/DocumentTransferTransition.js +35 -0
  78. package/dist/src/dpp/structs/Batch/DocumentTransitions/DocumentUpdatePriceTransition.d.ts +17 -0
  79. package/dist/src/dpp/structs/Batch/DocumentTransitions/DocumentUpdatePriceTransition.js +33 -0
  80. package/dist/src/dpp/structs/Batch/PrefundedVotingBalance.d.ts +9 -0
  81. package/dist/src/dpp/structs/Batch/PrefundedVotingBalance.js +19 -0
  82. package/dist/src/dpp/structs/Batch/TokenBaseTransition.d.ts +20 -0
  83. package/dist/src/dpp/structs/Batch/TokenBaseTransition.js +49 -0
  84. package/dist/src/dpp/structs/Batch/TokenPaymentInfo.d.ts +19 -0
  85. package/dist/src/dpp/structs/Batch/TokenPaymentInfo.js +54 -0
  86. package/dist/src/dpp/structs/Batch/TokenPricingSchedule.d.ts +17 -0
  87. package/dist/src/dpp/structs/Batch/TokenPricingSchedule.js +41 -0
  88. package/dist/src/dpp/structs/Batch/TokenTransition.d.ts +20 -0
  89. package/dist/src/dpp/structs/Batch/TokenTransition.js +92 -0
  90. package/dist/src/dpp/structs/Batch/TokenTransitions/TokenBurnTransition.d.ts +14 -0
  91. package/dist/src/dpp/structs/Batch/TokenTransitions/TokenBurnTransition.js +32 -0
  92. package/dist/src/dpp/structs/Batch/TokenTransitions/TokenClaimTransition.d.ts +15 -0
  93. package/dist/src/dpp/structs/Batch/TokenTransitions/TokenClaimTransition.js +33 -0
  94. package/dist/src/dpp/structs/Batch/TokenTransitions/TokenConfigUpdateTransition.d.ts +15 -0
  95. package/dist/src/dpp/structs/Batch/TokenTransitions/TokenConfigUpdateTransition.js +33 -0
  96. package/dist/src/dpp/structs/Batch/TokenTransitions/TokenDestroyFrozenFundsTransition.d.ts +16 -0
  97. package/dist/src/dpp/structs/Batch/TokenTransitions/TokenDestroyFrozenFundsTransition.js +34 -0
  98. package/dist/src/dpp/structs/Batch/TokenTransitions/TokenDirectPurchaseTransition.d.ts +14 -0
  99. package/dist/src/dpp/structs/Batch/TokenTransitions/TokenDirectPurchaseTransition.js +32 -0
  100. package/dist/src/dpp/structs/Batch/TokenTransitions/TokenEmergencyActionTransition.d.ts +15 -0
  101. package/dist/src/dpp/structs/Batch/TokenTransitions/TokenEmergencyActionTransition.js +33 -0
  102. package/dist/src/dpp/structs/Batch/TokenTransitions/TokenFreezeTransition.d.ts +16 -0
  103. package/dist/src/dpp/structs/Batch/TokenTransitions/TokenFreezeTransition.js +34 -0
  104. package/dist/src/dpp/structs/Batch/TokenTransitions/TokenMintTransition.d.ts +18 -0
  105. package/dist/src/dpp/structs/Batch/TokenTransitions/TokenMintTransition.js +43 -0
  106. package/dist/src/dpp/structs/Batch/TokenTransitions/TokenSetPriceForDirectPurchaseTransition.d.ts +15 -0
  107. package/dist/src/dpp/structs/Batch/TokenTransitions/TokenSetPriceForDirectPurchaseTransition.js +36 -0
  108. package/dist/src/dpp/structs/Batch/TokenTransitions/TokenTransferTransition.d.ts +21 -0
  109. package/dist/src/dpp/structs/Batch/TokenTransitions/TokenTransferTransition.js +53 -0
  110. package/dist/src/dpp/structs/Batch/TokenTransitions/TokenUnFreezeTransition.d.ts +16 -0
  111. package/dist/src/dpp/structs/Batch/TokenTransitions/TokenUnFreezeTransition.js +34 -0
  112. package/dist/src/dpp/structs/ConsensusError.d.ts +8 -0
  113. package/dist/src/dpp/structs/ConsensusError.js +22 -0
  114. package/dist/src/dpp/structs/ContractBounds.d.ts +17 -0
  115. package/dist/src/dpp/structs/ContractBounds.js +39 -0
  116. package/dist/src/dpp/structs/CoreScript.d.ts +15 -0
  117. package/dist/src/dpp/structs/CoreScript.js +37 -0
  118. package/dist/src/dpp/structs/DataContract.d.ts +35 -0
  119. package/dist/src/dpp/structs/DataContract.js +116 -0
  120. package/dist/src/dpp/structs/DataContractTransitions/DataContractCreateTransition.d.ts +23 -0
  121. package/dist/src/dpp/structs/DataContractTransitions/DataContractCreateTransition.js +55 -0
  122. package/dist/src/dpp/structs/DataContractTransitions/DataContractUpdateTransition.d.ts +23 -0
  123. package/dist/src/dpp/structs/DataContractTransitions/DataContractUpdateTransition.js +55 -0
  124. package/dist/src/dpp/structs/Document.d.ts +51 -0
  125. package/dist/src/dpp/structs/Document.js +184 -0
  126. package/dist/src/dpp/structs/EncryptedNote/PrivateEncryptedNote.d.ts +13 -0
  127. package/dist/src/dpp/structs/EncryptedNote/PrivateEncryptedNote.js +31 -0
  128. package/dist/src/dpp/structs/EncryptedNote/SharedEncryptedNote.d.ts +13 -0
  129. package/dist/src/dpp/structs/EncryptedNote/SharedEncryptedNote.js +31 -0
  130. package/dist/src/dpp/structs/GroupStateTransitionInfo.d.ts +15 -0
  131. package/dist/src/dpp/structs/GroupStateTransitionInfo.js +33 -0
  132. package/dist/src/dpp/structs/Identifier.d.ts +17 -0
  133. package/dist/src/dpp/structs/Identifier.js +50 -0
  134. package/dist/src/dpp/structs/Identity.d.ts +26 -0
  135. package/dist/src/dpp/structs/Identity.js +73 -0
  136. package/dist/src/dpp/structs/IdentityPublicKey.d.ts +43 -0
  137. package/dist/src/dpp/structs/IdentityPublicKey.js +126 -0
  138. package/dist/src/dpp/structs/IdentityPublicKeyInCreation.d.ts +30 -0
  139. package/dist/src/dpp/structs/IdentityPublicKeyInCreation.js +77 -0
  140. package/dist/src/dpp/structs/IdentityTransitions/IdentityCreateTransition.d.ts +29 -0
  141. package/dist/src/dpp/structs/IdentityTransitions/IdentityCreateTransition.js +69 -0
  142. package/dist/src/dpp/structs/IdentityTransitions/IdentityCreditTransfer.d.ts +33 -0
  143. package/dist/src/dpp/structs/IdentityTransitions/IdentityCreditTransfer.js +85 -0
  144. package/dist/src/dpp/structs/IdentityTransitions/IdentityCreditWithdrawalTransition.d.ts +42 -0
  145. package/dist/src/dpp/structs/IdentityTransitions/IdentityCreditWithdrawalTransition.js +114 -0
  146. package/dist/src/dpp/structs/IdentityTransitions/IdentityTopUpTransition.d.ts +30 -0
  147. package/dist/src/dpp/structs/IdentityTransitions/IdentityTopUpTransition.js +75 -0
  148. package/dist/src/dpp/structs/IdentityTransitions/IdentityUpdateTransition.d.ts +40 -0
  149. package/dist/src/dpp/structs/IdentityTransitions/IdentityUpdateTransition.js +108 -0
  150. package/dist/src/dpp/structs/InstantLock.d.ts +17 -0
  151. package/dist/src/dpp/structs/InstantLock.js +43 -0
  152. package/dist/src/dpp/structs/MasternodeVote/MasternodeVoteTransition.d.ts +37 -0
  153. package/dist/src/dpp/structs/MasternodeVote/MasternodeVoteTransition.js +96 -0
  154. package/dist/src/dpp/structs/MasternodeVote/ResourceVoteChoice.d.ts +14 -0
  155. package/dist/src/dpp/structs/MasternodeVote/ResourceVoteChoice.js +29 -0
  156. package/dist/src/dpp/structs/MasternodeVote/Vote.d.ts +13 -0
  157. package/dist/src/dpp/structs/MasternodeVote/Vote.js +27 -0
  158. package/dist/src/dpp/structs/MasternodeVote/VotePoll.d.ts +18 -0
  159. package/dist/src/dpp/structs/MasternodeVote/VotePoll.js +42 -0
  160. package/dist/src/dpp/structs/PartialIdentity.d.ts +26 -0
  161. package/dist/src/dpp/structs/PartialIdentity.js +69 -0
  162. package/dist/src/dpp/structs/PrivateKey.d.ts +20 -0
  163. package/dist/src/dpp/structs/PrivateKey.js +48 -0
  164. package/dist/src/dpp/structs/PublicKey.d.ts +15 -0
  165. package/dist/src/dpp/structs/PublicKey.js +37 -0
  166. package/dist/src/dpp/structs/StateTransition.d.ts +38 -0
  167. package/dist/src/dpp/structs/StateTransition.js +100 -0
  168. package/dist/src/dpp/structs/TokenConfiguration/ActionTaker.d.ts +12 -0
  169. package/dist/src/dpp/structs/TokenConfiguration/ActionTaker.js +44 -0
  170. package/dist/src/dpp/structs/TokenConfiguration/AuthorizedActionTakers.d.ts +16 -0
  171. package/dist/src/dpp/structs/TokenConfiguration/AuthorizedActionTakers.js +43 -0
  172. package/dist/src/dpp/structs/TokenConfiguration/ChangeControlRules.d.ts +23 -0
  173. package/dist/src/dpp/structs/TokenConfiguration/ChangeControlRules.js +52 -0
  174. package/dist/src/dpp/structs/TokenConfiguration/DistributionFunction.d.ts +19 -0
  175. package/dist/src/dpp/structs/TokenConfiguration/DistributionFunction.js +57 -0
  176. package/dist/src/dpp/structs/TokenConfiguration/Group.d.ts +19 -0
  177. package/dist/src/dpp/structs/TokenConfiguration/Group.js +44 -0
  178. package/dist/src/dpp/structs/TokenConfiguration/RewardDistributionType.d.ts +13 -0
  179. package/dist/src/dpp/structs/TokenConfiguration/RewardDistributionType.js +40 -0
  180. package/dist/src/dpp/structs/TokenConfiguration/TokenConfiguration.d.ts +54 -0
  181. package/dist/src/dpp/structs/TokenConfiguration/TokenConfiguration.js +139 -0
  182. package/dist/src/dpp/structs/TokenConfiguration/TokenConfigurationChangeItem.d.ts +47 -0
  183. package/dist/src/dpp/structs/TokenConfiguration/TokenConfigurationChangeItem.js +140 -0
  184. package/dist/src/dpp/structs/TokenConfiguration/TokenConfigurationConvention.d.ts +19 -0
  185. package/dist/src/dpp/structs/TokenConfiguration/TokenConfigurationConvention.js +47 -0
  186. package/dist/src/dpp/structs/TokenConfiguration/TokenConfigurationLocalization.d.ts +15 -0
  187. package/dist/src/dpp/structs/TokenConfiguration/TokenConfigurationLocalization.js +34 -0
  188. package/dist/src/dpp/structs/TokenConfiguration/TokenDistributionRecipient.d.ts +14 -0
  189. package/dist/src/dpp/structs/TokenConfiguration/TokenDistributionRecipient.js +31 -0
  190. package/dist/src/dpp/structs/TokenConfiguration/TokenDistributionRules.d.ts +28 -0
  191. package/dist/src/dpp/structs/TokenConfiguration/TokenDistributionRules.js +75 -0
  192. package/dist/src/dpp/structs/TokenConfiguration/TokenKeepsHistoryRules.d.ts +19 -0
  193. package/dist/src/dpp/structs/TokenConfiguration/TokenKeepsHistoryRules.js +49 -0
  194. package/dist/src/dpp/structs/TokenConfiguration/TokenMarketplaceRules.d.ts +13 -0
  195. package/dist/src/dpp/structs/TokenConfiguration/TokenMarketplaceRules.js +27 -0
  196. package/dist/src/dpp/structs/TokenConfiguration/TokenPerpetualDistribution.d.ts +13 -0
  197. package/dist/src/dpp/structs/TokenConfiguration/TokenPerpetualDistribution.js +27 -0
  198. package/dist/src/dpp/structs/TokenConfiguration/TokenPreProgrammedDistribution.d.ts +21 -0
  199. package/dist/src/dpp/structs/TokenConfiguration/TokenPreProgrammedDistribution.js +42 -0
  200. package/dist/src/dpp/structs/TokenConfiguration/TokenTradeMode.d.ts +9 -0
  201. package/dist/src/dpp/structs/TokenConfiguration/TokenTradeMode.js +17 -0
  202. package/dist/src/dpp/types.d.ts +274 -0
  203. package/dist/src/dpp/types.js +1 -0
  204. package/dist/src/dpp/utils.d.ts +5 -0
  205. package/dist/src/dpp/utils.js +64 -0
  206. package/dist/src/dpp/verify/Contested/verifyVotePollVoteStateProof.d.ts +3 -0
  207. package/dist/src/dpp/verify/Contested/verifyVotePollVoteStateProof.js +34 -0
  208. package/dist/src/dpp/verify/Contract/verifyContract.d.ts +2 -0
  209. package/dist/src/dpp/verify/Contract/verifyContract.js +14 -0
  210. package/dist/src/dpp/verify/Document/verifyDocumentsProof.d.ts +3 -0
  211. package/dist/src/dpp/verify/Document/verifyDocumentsProof.js +10 -0
  212. package/dist/src/dpp/verify/Identity/verifyIdentifierByNonUniquePublicKeyHashProof.d.ts +2 -0
  213. package/dist/src/dpp/verify/Identity/verifyIdentifierByNonUniquePublicKeyHashProof.js +10 -0
  214. package/dist/src/dpp/verify/Identity/verifyIdentityBalanceProof.d.ts +2 -0
  215. package/dist/src/dpp/verify/Identity/verifyIdentityBalanceProof.js +9 -0
  216. package/dist/src/dpp/verify/Identity/verifyIdentityByIdentifierProof.d.ts +2 -0
  217. package/dist/src/dpp/verify/Identity/verifyIdentityByIdentifierProof.js +10 -0
  218. package/dist/src/dpp/verify/Identity/verifyIdentityByUniqueKeyHashProof.d.ts +2 -0
  219. package/dist/src/dpp/verify/Identity/verifyIdentityByUniqueKeyHashProof.js +10 -0
  220. package/dist/src/dpp/verify/Identity/verifyIdentityContractNonceProof.d.ts +2 -0
  221. package/dist/src/dpp/verify/Identity/verifyIdentityContractNonceProof.js +9 -0
  222. package/dist/src/dpp/verify/Identity/verifyIdentityKeysByIdentifierProof.d.ts +2 -0
  223. package/dist/src/dpp/verify/Identity/verifyIdentityKeysByIdentifierProof.js +10 -0
  224. package/dist/src/dpp/verify/Identity/verifyIdentityNonceProof.d.ts +2 -0
  225. package/dist/src/dpp/verify/Identity/verifyIdentityNonceProof.js +9 -0
  226. package/dist/src/dpp/verify/StateTransition/utils.d.ts +2 -0
  227. package/dist/src/dpp/verify/StateTransition/utils.js +115 -0
  228. package/dist/src/dpp/verify/StateTransition/verifyStateTransitionResult.d.ts +4 -0
  229. package/dist/src/dpp/verify/StateTransition/verifyStateTransitionResult.js +10 -0
  230. package/dist/src/dpp/verify/System/verifyEpochsInfoProof.d.ts +2 -0
  231. package/dist/src/dpp/verify/System/verifyEpochsInfoProof.js +16 -0
  232. package/dist/src/dpp/verify/System/verifyTotalCreditsProof.d.ts +2 -0
  233. package/dist/src/dpp/verify/System/verifyTotalCreditsProof.js +9 -0
  234. package/dist/src/dpp/verify/Tokens/verifyTokenBalancesForIdentitiesProof.d.ts +2 -0
  235. package/dist/src/dpp/verify/Tokens/verifyTokenBalancesForIdentitiesProof.js +13 -0
  236. package/dist/src/dpp/verify/Tokens/verifyTokenContractInfoProof.d.ts +2 -0
  237. package/dist/src/dpp/verify/Tokens/verifyTokenContractInfoProof.js +15 -0
  238. package/dist/src/dpp/verify/Tokens/verifyTokenDirectPurchasePrices.d.ts +2 -0
  239. package/dist/src/dpp/verify/Tokens/verifyTokenDirectPurchasePrices.js +14 -0
  240. package/dist/src/dpp/verify/Tokens/verifyTokenTotalSupplyProof.d.ts +2 -0
  241. package/dist/src/dpp/verify/Tokens/verifyTokenTotalSupplyProof.js +12 -0
  242. package/dist/src/dpp/verify/Tokens/verifyTokensBalancesForIdentityProof.d.ts +2 -0
  243. package/dist/src/dpp/verify/Tokens/verifyTokensBalancesForIdentityProof.js +13 -0
  244. package/dist/src/dpp/verify/verifySignatureDigest.d.ts +1 -0
  245. package/dist/src/dpp/verify/verifySignatureDigest.js +4 -0
  246. package/dist/src/react-native.d.ts +3 -0
  247. package/dist/src/react-native.js +6 -0
  248. package/dist/src/wasm.d.ts +3 -0
  249. package/dist/src/wasm.js +6 -0
  250. package/dist/utils/base122.d.ts +7 -0
  251. package/dist/utils/base122.js +63 -0
  252. package/package.json +30 -27
  253. package/tests/unit/DynamicValue.spec.ts +86 -0
  254. package/tests/unit/Identifier.spec.ts +105 -0
  255. package/tests/unit/Identity.spec.ts +119 -0
  256. package/tests/unit/IdentityPublicKey.spec.ts +126 -0
  257. package/dist/wasm/base122.d.ts +0 -1
  258. package/dist/wasm/base122.js +0 -67
  259. package/dist/wasm/index.d.ts +0 -128
  260. package/dist/wasm/index.js +0 -13
  261. package/dist/wasm/initAsync.d.ts +0 -4
  262. package/dist/wasm/initAsync.js +0 -20
  263. package/dist/wasm/initInterface.d.ts +0 -3
  264. package/dist/wasm/initInterface.js +0 -46
  265. package/dist/wasm/initWASM.d.ts +0 -1
  266. package/dist/wasm/initWASM.js +0 -28
  267. package/dist/wasm/pshenmic_dpp.d.ts +0 -4789
  268. package/dist/wasm/pshenmic_dpp.js +0 -23182
  269. package/dist/wasm/pshenmic_dpp_bg.d.ts +0 -3
  270. package/dist/wasm/pshenmic_dpp_bg.js +0 -2
  271. package/dist/wasm/pshenmic_dpp_bg.wasm.d.ts +0 -1477
  272. package/dist/wasm/pshenmic_dpp_zipped.d.ts +0 -3
  273. package/dist/wasm/pshenmic_dpp_zipped.js +0 -2
  274. package/dist/wasm/snippets/pshenmic_dpp_utils-23ab7381b198778d/stringify.js +0 -7
  275. package/tests/AssetLockProof.spec.cjs +0 -96
  276. package/tests/AsyncImportTest.spec.cjs +0 -930
  277. package/tests/AuthorizedActionTakers.spec.cjs +0 -75
  278. package/tests/BatchTransition.spec.cjs +0 -141
  279. package/tests/ChainLockProof.spec.cjs +0 -63
  280. package/tests/ChangeControlRules.spec.cjs +0 -184
  281. package/tests/CoreScript.spec.cjs +0 -37
  282. package/tests/DataContract.spec.cjs +0 -170
  283. package/tests/DataContractCreateStateTransition.spec.cjs +0 -102
  284. package/tests/DataContractUpdateStateTransition.spec.cjs +0 -103
  285. package/tests/DistributionFunction.spec.cjs +0 -416
  286. package/tests/Document.spec.cjs +0 -227
  287. package/tests/DocumentTransition.spec.cjs +0 -94
  288. package/tests/DocumentsTransitions.spec.cjs +0 -699
  289. package/tests/Identifier.spec.cjs +0 -82
  290. package/tests/Identity.spec.cjs +0 -107
  291. package/tests/IdentityCreateTransition.spec.cjs +0 -87
  292. package/tests/IdentityCreditTransferTransition.spec.cjs +0 -140
  293. package/tests/IdentityCreditWithdrawalTransition.spec.cjs +0 -186
  294. package/tests/IdentityPublicKey.spec.cjs +0 -166
  295. package/tests/IdentityTopUpTransition.spec.cjs +0 -125
  296. package/tests/IdentityUpdateTransition.spec.cjs +0 -141
  297. package/tests/InstantLockProof.spec.cjs +0 -91
  298. package/tests/OutPoint.spec.cjs +0 -49
  299. package/tests/PrivateKey.spec.cjs +0 -67
  300. package/tests/PublicKeyInCreation.spec.cjs +0 -252
  301. package/tests/RewardDistributionType.spec.cjs +0 -90
  302. package/tests/TokenBaseTransition.spec.cjs +0 -96
  303. package/tests/TokenConfiguration.spec.cjs +0 -188
  304. package/tests/TokenConfigurationConvention.spec.cjs +0 -93
  305. package/tests/TokenConfigurationLocalization.spec.cjs +0 -59
  306. package/tests/TokenDistributionRecipient.spec.cjs +0 -49
  307. package/tests/TokenDistributionRules.spec.cjs +0 -313
  308. package/tests/TokenKeepsHistoryRules.spec.cjs +0 -67
  309. package/tests/TokenPerpetualDistribution.spec.cjs +0 -130
  310. package/tests/TokenPreProgrammedDistribution.spec.cjs +0 -61
  311. package/tests/TokensTransitions.spec.cjs +0 -509
  312. package/tests/TxOut.spec.cjs +0 -70
  313. package/tests/mocks/DataContract/DataContract.json +0 -164
  314. package/tests/mocks/DataContract/index.js +0 -6
  315. package/tests/mocks/Document/DataContract.json +0 -23
  316. package/tests/mocks/Document/document.json +0 -3
  317. package/tests/mocks/Document/document2.json +0 -3
  318. package/tests/mocks/Document/index.js +0 -13
  319. package/tests/mocks/Identity/index.js +0 -13
  320. package/tests/mocks/Locks/index.js +0 -2
  321. package/tests/mocks/PrivateKey/index.js +0 -5
  322. package/tests/mocks/PublicKey/index.js +0 -13
  323. package/tests/mocks/TokenConfiguration/index.js +0 -5
  324. package/tests/utils/hex.js +0 -14
@@ -1,166 +0,0 @@
1
- const assert = require('assert')
2
- const { describe, it } = require('mocha')
3
- const {
4
- keyId, purpose, securityLevel, keyType, binaryData, securityLevelSet, keyIdSet, purposeSet,
5
- keyTypeSet, binaryDataSet
6
- } = require('./mocks/PublicKey')
7
- const { wif } = require('./mocks/PrivateKey')
8
- const { toHexString } = require('./utils/hex')
9
- const { default: wasm } = require('..')
10
-
11
- describe('PublicKey', function () {
12
- describe('serialization / deserialization', function () {
13
- it('should generate public key from values with type ECDSA_SECP256K1', function () {
14
- const pubKey = new wasm.IdentityPublicKeyWASM(
15
- keyId,
16
- purpose,
17
- securityLevel,
18
- keyType,
19
- false,
20
- binaryData)
21
-
22
- assert.notEqual(pubKey.__wbg_ptr, 0)
23
- })
24
-
25
- it('should generate public key from values with type ECDSA_SECP256K1 and generate new from self bytes', function () {
26
- const pubKey = new wasm.IdentityPublicKeyWASM(
27
- keyId,
28
- purpose,
29
- securityLevel,
30
- keyType,
31
- false,
32
- binaryData)
33
-
34
- const bytes = pubKey.bytes()
35
-
36
- const newPubKey = wasm.IdentityPublicKeyWASM.fromBytes(Array.from(bytes))
37
-
38
- assert.notEqual(pubKey.__wbg_ptr, 0)
39
- assert.notEqual(newPubKey.__wbg_ptr, 0)
40
-
41
- assert.equal(pubKey.keyId, newPubKey.keyId)
42
- assert.equal(pubKey.purpose, newPubKey.purpose)
43
- assert.equal(pubKey.securityLevel, newPubKey.securityLevel)
44
- assert.equal(pubKey.keyType, newPubKey.keyType)
45
- assert.equal(pubKey.readOnly, newPubKey.readOnly)
46
- assert.equal(pubKey.data, newPubKey.data)
47
-
48
- assert.deepEqual(pubKey.bytes(), newPubKey.bytes())
49
-
50
- assert.notEqual(pubKey.__wbg_ptr, 0)
51
- assert.notEqual(newPubKey.__wbg_ptr, 0)
52
- })
53
-
54
- it('should return hash of key', function () {
55
- const pubKey = new wasm.IdentityPublicKeyWASM(
56
- keyId,
57
- purpose,
58
- securityLevel,
59
- keyType,
60
- false,
61
- binaryData)
62
-
63
- const hash = pubKey.getPublicKeyHash()
64
-
65
- assert.deepEqual(hash, toHexString([211, 114, 240, 150, 37, 159, 114, 104, 110, 24, 102, 61, 125, 181, 248, 98, 52, 221, 111, 85]))
66
- })
67
- })
68
- describe('getters', function () {
69
- it('should generate public key from values with type ECDSA_SECP256K1 and return all fields', function () {
70
- const pubKey = new wasm.IdentityPublicKeyWASM(
71
- keyId,
72
- purpose,
73
- securityLevel,
74
- keyType,
75
- false,
76
- binaryData)
77
-
78
- assert.equal(pubKey.keyId, keyId)
79
- assert.equal(pubKey.purpose, 'AUTHENTICATION')
80
- assert.equal(pubKey.securityLevel, 'CRITICAL')
81
- assert.equal(pubKey.keyType, 'ECDSA_SECP256K1')
82
- assert.equal(pubKey.readOnly, false)
83
- assert.equal(pubKey.data, binaryData)
84
- })
85
-
86
- it('should allow to validate private key', function () {
87
- const pubKey = new wasm.IdentityPublicKeyWASM(
88
- keyId,
89
- purpose,
90
- securityLevel,
91
- keyType,
92
- false,
93
- binaryData)
94
-
95
- const privateKey = wasm.PrivateKeyWASM.fromWIF(wif)
96
-
97
- assert.equal(pubKey.validatePrivateKey(privateKey), false)
98
- })
99
-
100
- it('should allow to validate private key bytes', function () {
101
- const pubKey = new wasm.IdentityPublicKeyWASM(
102
- keyId,
103
- purpose,
104
- securityLevel,
105
- keyType,
106
- false,
107
- binaryData)
108
-
109
- const privateKey = wasm.PrivateKeyWASM.fromWIF(wif)
110
-
111
- assert.equal(pubKey.validatePrivateKey(privateKey.bytes(), wasm.NetworkWASM.Mainnet), false)
112
- })
113
-
114
- it('should allow to validate private key hex', function () {
115
- const pubKey = new wasm.IdentityPublicKeyWASM(
116
- keyId,
117
- purpose,
118
- securityLevel,
119
- keyType,
120
- false,
121
- binaryData)
122
-
123
- const privateKey = wasm.PrivateKeyWASM.fromWIF(wif)
124
-
125
- assert.equal(pubKey.validatePrivateKey(privateKey.hex(), wasm.NetworkWASM.Mainnet), false)
126
- })
127
-
128
- it('should allow to validate private key wif', function () {
129
- const pubKey = new wasm.IdentityPublicKeyWASM(
130
- keyId,
131
- purpose,
132
- securityLevel,
133
- keyType,
134
- false,
135
- binaryData)
136
-
137
- assert.equal(pubKey.validatePrivateKey(wif), false)
138
- })
139
- })
140
-
141
- describe('setters', function () {
142
- it('should generate public key from values with type ECDSA_SECP256K1 and return all fields and set another fields', function () {
143
- const pubKey = new wasm.IdentityPublicKeyWASM(
144
- keyId,
145
- purpose,
146
- securityLevel,
147
- keyType,
148
- false,
149
- binaryData)
150
-
151
- pubKey.keyId = keyIdSet
152
- pubKey.purpose = purposeSet
153
- pubKey.securityLevel = securityLevelSet
154
- pubKey.keyType = keyTypeSet
155
- pubKey.readOnly = true
156
- pubKey.data = binaryDataSet
157
-
158
- assert.equal(pubKey.keyId, keyIdSet)
159
- assert.equal(pubKey.purpose, 'ENCRYPTION')
160
- assert.equal(pubKey.securityLevel, 'HIGH')
161
- assert.equal(pubKey.keyType, 'ECDSA_HASH160')
162
- assert.equal(pubKey.readOnly, true)
163
- assert.equal(pubKey.data, binaryDataSet)
164
- })
165
- })
166
- })
@@ -1,125 +0,0 @@
1
- const assert = require('assert')
2
- const { describe, it } = require('mocha')
3
- const { default: wasm } = require('..')
4
-
5
- describe('IdentityTopUpTransition', function () {
6
- describe('serialization / deserialization', function () {
7
- it('should allow to create IdentityTopUpTransition', function () {
8
- const assetLockProof = wasm.AssetLockProofWASM.createInstantAssetLockProof(
9
- // instant lock
10
- [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],
11
- // transaction
12
- [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],
13
- // output index
14
- 0
15
- )
16
-
17
- const transition = new wasm.IdentityTopUpTransitionWASM(assetLockProof, 'B7kcE1juMBWEWkuYRJhVdAE2e6RaevrGxRsa1DrLCpQH', 11)
18
-
19
- assert.notEqual(transition.__wbg_ptr, 0)
20
- assert.notEqual(assetLockProof.__wbg_ptr, 0)
21
- })
22
- })
23
-
24
- describe('getters', function () {
25
- it('should allow to return userFeeIncrease', function () {
26
- const assetLockProof = wasm.AssetLockProofWASM.createInstantAssetLockProof(
27
- // instant lock
28
- [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],
29
- // transaction
30
- [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],
31
- // output index
32
- 0
33
- )
34
-
35
- const transition = new wasm.IdentityTopUpTransitionWASM(assetLockProof, 'B7kcE1juMBWEWkuYRJhVdAE2e6RaevrGxRsa1DrLCpQH', 11)
36
-
37
- assert.deepEqual(transition.userFeeIncrease, 11)
38
- })
39
-
40
- it('should allow to return identityIdentifier', function () {
41
- const assetLockProof = wasm.AssetLockProofWASM.createInstantAssetLockProof(
42
- // instant lock
43
- [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],
44
- // transaction
45
- [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],
46
- // output index
47
- 0
48
- )
49
-
50
- const transition = new wasm.IdentityTopUpTransitionWASM(assetLockProof, 'B7kcE1juMBWEWkuYRJhVdAE2e6RaevrGxRsa1DrLCpQH', 11)
51
-
52
- assert.deepEqual(transition.identityIdentifier.base58(), 'B7kcE1juMBWEWkuYRJhVdAE2e6RaevrGxRsa1DrLCpQH')
53
- })
54
-
55
- it('should allow to return signature', function () {
56
- const assetLockProof = wasm.AssetLockProofWASM.createInstantAssetLockProof(
57
- // instant lock
58
- [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],
59
- // transaction
60
- [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],
61
- // output index
62
- 0
63
- )
64
-
65
- const transition = new wasm.IdentityTopUpTransitionWASM(assetLockProof, 'B7kcE1juMBWEWkuYRJhVdAE2e6RaevrGxRsa1DrLCpQH', 11)
66
-
67
- assert.deepEqual(transition.signature, Uint8Array.from([]))
68
- })
69
- })
70
-
71
- describe('setters', function () {
72
- it('should allow to set userFeeIncrease', function () {
73
- const assetLockProof = wasm.AssetLockProofWASM.createInstantAssetLockProof(
74
- // instant lock
75
- [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],
76
- // transaction
77
- [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],
78
- // output index
79
- 0
80
- )
81
-
82
- const transition = new wasm.IdentityTopUpTransitionWASM(assetLockProof, 'B7kcE1juMBWEWkuYRJhVdAE2e6RaevrGxRsa1DrLCpQH', 11)
83
-
84
- transition.userFeeIncrease = 21
85
-
86
- assert.deepEqual(transition.userFeeIncrease, 21)
87
- })
88
-
89
- it('should allow to set identityIdentifier', function () {
90
- const assetLockProof = wasm.AssetLockProofWASM.createInstantAssetLockProof(
91
- // instant lock
92
- [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],
93
- // transaction
94
- [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],
95
- // output index
96
- 0
97
- )
98
-
99
- const transition = new wasm.IdentityTopUpTransitionWASM(assetLockProof, 'B7kcE1juMBWEWkuYRJhVdAE2e6RaevrGxRsa1DrLCpQH', 11)
100
-
101
- const identifier = new wasm.IdentifierWASM('777cE1juMBWEWkuYRJhVdAE2e6RaevrGxRsa1DrLCpQH')
102
-
103
- transition.identityIdentifier = identifier
104
-
105
- assert.deepEqual(transition.identityIdentifier.base58(), '777cE1juMBWEWkuYRJhVdAE2e6RaevrGxRsa1DrLCpQH')
106
- })
107
-
108
- it('should allow to set signature', function () {
109
- const assetLockProof = wasm.AssetLockProofWASM.createInstantAssetLockProof(
110
- // instant lock
111
- [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],
112
- // transaction
113
- [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],
114
- // output index
115
- 0
116
- )
117
-
118
- const transition = new wasm.IdentityTopUpTransitionWASM(assetLockProof, 'B7kcE1juMBWEWkuYRJhVdAE2e6RaevrGxRsa1DrLCpQH', 11)
119
-
120
- transition.signature = Uint8Array.from([1, 1, 1])
121
-
122
- assert.deepEqual(transition.signature, Uint8Array.from([1, 1, 1]))
123
- })
124
- })
125
- })
@@ -1,141 +0,0 @@
1
- const assert = require('assert')
2
- const { describe, it } = require('mocha')
3
- const { default: wasm } = require('..')
4
-
5
- describe('IdentityUpdateTransition', function () {
6
- describe('serialization / deserialization', function () {
7
- it('Should create IdentityUpdateTransition', function () {
8
- const transition = new wasm.IdentityUpdateTransitionWASM('GL2Rq8L3VuBEQfCAZykmUaiXXrsd1Bwub2gcaMmtNbn3', BigInt(1), BigInt(1), 1, [], [])
9
-
10
- assert.notEqual(transition.__wbg_ptr, 0)
11
- })
12
-
13
- it('Should create IdentityUpdateTransition with key', function () {
14
- const key = new wasm.IdentityPublicKeyInCreationWASM(
15
- 1, 'system', 'master', 'ECDSA_SECP256K1', false, [], []
16
- )
17
-
18
- const transition = new wasm.IdentityUpdateTransitionWASM('GL2Rq8L3VuBEQfCAZykmUaiXXrsd1Bwub2gcaMmtNbn3', BigInt(1), BigInt(1), 1, [key], [])
19
-
20
- assert.notEqual(transition.__wbg_ptr, 0)
21
- assert.notEqual(key.__wbg_ptr, 0)
22
- })
23
- })
24
-
25
- describe('getters', function () {
26
- it('Should return revision', function () {
27
- const transition = new wasm.IdentityUpdateTransitionWASM('GL2Rq8L3VuBEQfCAZykmUaiXXrsd1Bwub2gcaMmtNbn3', BigInt(1), BigInt(1), 1, [], [])
28
-
29
- assert.deepEqual(transition.revision, BigInt(1))
30
- })
31
-
32
- it('Should return nonce', function () {
33
- const transition = new wasm.IdentityUpdateTransitionWASM('GL2Rq8L3VuBEQfCAZykmUaiXXrsd1Bwub2gcaMmtNbn3', BigInt(1), BigInt(1), 1, [], [])
34
-
35
- assert.deepEqual(transition.nonce, BigInt(1))
36
- })
37
-
38
- it('Should return identityIdentifier', function () {
39
- const transition = new wasm.IdentityUpdateTransitionWASM('GL2Rq8L3VuBEQfCAZykmUaiXXrsd1Bwub2gcaMmtNbn3', BigInt(1), BigInt(1), 1, [], [])
40
-
41
- assert.deepEqual(transition.identityIdentifier.base58(), 'GL2Rq8L3VuBEQfCAZykmUaiXXrsd1Bwub2gcaMmtNbn3')
42
- })
43
-
44
- it('Should return publicKeyIdsToDisable', function () {
45
- const transition = new wasm.IdentityUpdateTransitionWASM('GL2Rq8L3VuBEQfCAZykmUaiXXrsd1Bwub2gcaMmtNbn3', BigInt(1), BigInt(1), [], [11])
46
-
47
- assert.deepEqual(Array.from(transition.publicKeyIdsToDisable), [11])
48
- })
49
-
50
- it('Should return publicKeyIdsToAdd', function () {
51
- const key = new wasm.IdentityPublicKeyInCreationWASM(
52
- 1, 'system', 'master', 'ECDSA_SECP256K1', false, [], []
53
- )
54
-
55
- const transition = new wasm.IdentityUpdateTransitionWASM('GL2Rq8L3VuBEQfCAZykmUaiXXrsd1Bwub2gcaMmtNbn3', BigInt(1), BigInt(1), [key], [11])
56
-
57
- assert.deepEqual(transition.publicKeyIdsToAdd.length, 1)
58
- })
59
-
60
- it('Should return userFeeIncrease', function () {
61
- const transition = new wasm.IdentityUpdateTransitionWASM('GL2Rq8L3VuBEQfCAZykmUaiXXrsd1Bwub2gcaMmtNbn3', BigInt(1), BigInt(1), [], [11], 1)
62
-
63
- assert.deepEqual(transition.userFeeIncrease, 1)
64
- })
65
-
66
- it('Should return signature', function () {
67
- const transition = new wasm.IdentityUpdateTransitionWASM('GL2Rq8L3VuBEQfCAZykmUaiXXrsd1Bwub2gcaMmtNbn3', BigInt(1), BigInt(1), [], [11], 1)
68
-
69
- assert.deepEqual(transition.signature, Uint8Array.from([]))
70
- })
71
-
72
- it('Should return signature public key id', function () {
73
- const transition = new wasm.IdentityUpdateTransitionWASM('GL2Rq8L3VuBEQfCAZykmUaiXXrsd1Bwub2gcaMmtNbn3', BigInt(1), BigInt(1), [], [11])
74
-
75
- assert.deepEqual(transition.signaturePublicKeyId, 0)
76
- })
77
- })
78
-
79
- describe('setters', function () {
80
- it('Should allow to set identityIdentifier', function () {
81
- const transition = new wasm.IdentityUpdateTransitionWASM('GL2Rq8L3VuBEQfCAZykmUaiXXrsd1Bwub2gcaMmtNbn3', BigInt(1), BigInt(1), [], [11])
82
-
83
- transition.identityIdentifier = '11Rq8L3VuBEQfCAZykmUaiXXrsd1Bwub2gcaMmtNbn3'
84
-
85
- assert.deepEqual(transition.identityIdentifier.base58(), '11Rq8L3VuBEQfCAZykmUaiXXrsd1Bwub2gcaMmtNbn3')
86
- })
87
-
88
- it('Should allow to set revision', function () {
89
- const transition = new wasm.IdentityUpdateTransitionWASM('GL2Rq8L3VuBEQfCAZykmUaiXXrsd1Bwub2gcaMmtNbn3', BigInt(1), BigInt(1), [], [11])
90
-
91
- transition.revision = BigInt(11111)
92
-
93
- assert.deepEqual(transition.revision, BigInt(11111))
94
- })
95
-
96
- it('Should allow to set nonce', function () {
97
- const transition = new wasm.IdentityUpdateTransitionWASM('GL2Rq8L3VuBEQfCAZykmUaiXXrsd1Bwub2gcaMmtNbn3', BigInt(1), BigInt(1), [], [11])
98
-
99
- transition.nonce = BigInt(11111)
100
-
101
- assert.deepEqual(transition.nonce, BigInt(11111))
102
- })
103
-
104
- it('Should allow to set publicKeyIdsToDisable', function () {
105
- const transition = new wasm.IdentityUpdateTransitionWASM('GL2Rq8L3VuBEQfCAZykmUaiXXrsd1Bwub2gcaMmtNbn3', BigInt(1), BigInt(1), [], [11])
106
-
107
- transition.publicKeyIdsToDisable = [1, 2, 3, 4]
108
-
109
- assert.deepEqual(transition.publicKeyIdsToDisable, Uint32Array.from([1, 2, 3, 4]))
110
- })
111
-
112
- it('Should allow to set publicKeyIdsToAdd', function () {
113
- const transition = new wasm.IdentityUpdateTransitionWASM('GL2Rq8L3VuBEQfCAZykmUaiXXrsd1Bwub2gcaMmtNbn3', BigInt(1), BigInt(1), [], [11])
114
-
115
- const key = new wasm.IdentityPublicKeyInCreationWASM(
116
- 1, 'system', 'master', 'ECDSA_SECP256K1', false, [], []
117
- )
118
-
119
- transition.publicKeyIdsToAdd = [key, key]
120
-
121
- assert.deepEqual(transition.publicKeyIdsToAdd.length, 2)
122
- assert.notEqual(key.__wbg_ptr, 0)
123
- })
124
-
125
- it('Should allow to set signature', function () {
126
- const transition = new wasm.IdentityUpdateTransitionWASM('GL2Rq8L3VuBEQfCAZykmUaiXXrsd1Bwub2gcaMmtNbn3', BigInt(1), BigInt(1), [], [11])
127
-
128
- transition.signature = [0, 1, 2, 3, 5]
129
-
130
- assert.deepEqual(transition.signature, Uint8Array.from([0, 1, 2, 3, 5]))
131
- })
132
-
133
- it('Should allow to set signature public key id', function () {
134
- const transition = new wasm.IdentityUpdateTransitionWASM('GL2Rq8L3VuBEQfCAZykmUaiXXrsd1Bwub2gcaMmtNbn3', BigInt(1), BigInt(1), [], [11])
135
-
136
- transition.signaturePublicKeyId = 11
137
-
138
- assert.deepEqual(transition.signaturePublicKeyId, 11)
139
- })
140
- })
141
- })
@@ -1,91 +0,0 @@
1
- const assert = require('assert')
2
- const { describe, it } = require('mocha')
3
- const { instantLockBytes, transactionBytes } = require('./mocks/Locks')
4
- const { default: wasm } = require('..')
5
-
6
- describe('InstantLock', function () {
7
- describe('serialization / deserialization', function () {
8
- it('should allow to create InstantLock from values', () => {
9
- const instantLockProof = new wasm.InstantAssetLockProofWASM(instantLockBytes, transactionBytes, 0)
10
-
11
- assert.notEqual(instantLockProof.__wbg_ptr, 0)
12
- })
13
-
14
- it('should allow to convert to object', () => {
15
- const instantLockProof = new wasm.InstantAssetLockProofWASM(instantLockBytes, transactionBytes, 0)
16
-
17
- const expected = {
18
- instantLock: instantLockBytes,
19
- transaction: transactionBytes,
20
- outputIndex: 0
21
- }
22
-
23
- assert.deepEqual(instantLockProof.toObject(), expected)
24
- })
25
-
26
- it('should allow to create from object', () => {
27
- const lockObject = {
28
- instantLock: instantLockBytes,
29
- transaction: transactionBytes,
30
- outputIndex: 0
31
- }
32
-
33
- const instantLockProof = wasm.InstantAssetLockProofWASM.fromObject(lockObject)
34
-
35
- assert.notEqual(instantLockProof.__wbg_ptr, 0)
36
- })
37
- })
38
-
39
- describe('getters', function () {
40
- it('should allow to get output', () => {
41
- const instantLockProof = new wasm.InstantAssetLockProofWASM(instantLockBytes, transactionBytes, 0)
42
-
43
- assert.deepEqual(instantLockProof.getOutput().constructor.name, 'TxOutWASM')
44
- })
45
-
46
- it('should allow to convert to get OutPoint', () => {
47
- const instantLockProof = new wasm.InstantAssetLockProofWASM(instantLockBytes, transactionBytes, 0)
48
-
49
- assert.deepEqual(instantLockProof.getOutPoint().constructor.name, 'OutPointWASM')
50
- })
51
-
52
- it('should allow to get output index', () => {
53
- const instantLockProof = new wasm.InstantAssetLockProofWASM(instantLockBytes, transactionBytes, 0)
54
-
55
- assert.deepEqual(instantLockProof.outputIndex, 0)
56
- })
57
-
58
- it('should allow to get instant lock', () => {
59
- const instantLockProof = new wasm.InstantAssetLockProofWASM(instantLockBytes, transactionBytes, 0)
60
-
61
- assert.deepEqual(instantLockProof.instantLock.constructor.name, 'InstantLockWASM')
62
- })
63
- })
64
-
65
- describe('setters', function () {
66
- it('should allow to set output index', () => {
67
- const instantLockProof = new wasm.InstantAssetLockProofWASM(instantLockBytes, transactionBytes, 0)
68
-
69
- instantLockProof.outputIndex = 12
70
-
71
- assert.deepEqual(instantLockProof.outputIndex, 12)
72
- })
73
-
74
- it('should allow to set instant lock', () => {
75
- const instantLockProof = new wasm.InstantAssetLockProofWASM(instantLockBytes, transactionBytes, 0)
76
-
77
- const newInstantLockProof = new wasm.InstantLockWASM(
78
- 0,
79
- [],
80
- 'dbdb604952d08184b55d48c915ed78aadc81dbc5cc98e8b4821abe5b4bbcbecb',
81
- '00000000000000151e0fe3ab9a12c57402153c9f476236148364ec4337213101',
82
- 'a9f131626c49a2f183b7a2f563ad1dc50ac8220190dbedb805209b608eb864e01d62f18bc9faa60a8b8a27f5a0c7c8b914fa3a14360a2f25558ee0e0a693b18faccbb59ec39b9b3cae430e0b76eb080752ce103df76537a1a583680a5914529d'
83
- )
84
-
85
- instantLockProof.instantLock = newInstantLockProof
86
-
87
- assert.deepEqual(instantLockProof.instantLock.version, 0)
88
- assert.notEqual(newInstantLockProof.__wbg_ptr, 0)
89
- })
90
- })
91
- })
@@ -1,49 +0,0 @@
1
- const assert = require('assert')
2
- const { describe, it } = require('mocha')
3
- const { default: wasm } = require('..')
4
-
5
- describe('OutPoint', function () {
6
- describe('serialization / deserialization', function () {
7
- it('should allow to create from values', () => {
8
- const outpoint = new wasm.OutPointWASM('e8b43025641eea4fd21190f01bd870ef90f1a8b199d8fc3376c5b62c0b1a179d', 1)
9
-
10
- assert.notEqual(outpoint.__wbg_ptr, 0)
11
- })
12
-
13
- it('should allow to create from bytes', () => {
14
- const txIdBytes = Buffer.from('e8b43025641eea4fd21190f01bd870ef90f1a8b199d8fc3376c5b62c0b1a179d', 'hex')
15
-
16
- // 32 bytes for txId and 4 bytes for vout
17
- const bytes = [...txIdBytes.reverse(), ...[0, 0, 0, 1].reverse()]
18
-
19
- const outpoint = wasm.OutPointWASM.fromBytes(bytes)
20
-
21
- assert.notEqual(outpoint.__wbg_ptr, 0)
22
- })
23
- })
24
-
25
- describe('getters', function () {
26
- it('should allow to get txid', function () {
27
- const outpoint = new wasm.OutPointWASM('e8b43025641eea4fd21190f01bd870ef90f1a8b199d8fc3376c5b62c0b1a179d', 1)
28
-
29
- assert.equal(outpoint.getTXID(), 'e8b43025641eea4fd21190f01bd870ef90f1a8b199d8fc3376c5b62c0b1a179d')
30
- })
31
-
32
- it('should allow to get VOUT', function () {
33
- const outpoint = new wasm.OutPointWASM('e8b43025641eea4fd21190f01bd870ef90f1a8b199d8fc3376c5b62c0b1a179d', 1)
34
-
35
- assert.equal(outpoint.getVOUT(), 1)
36
- })
37
-
38
- it('should allow to get bytes', function () {
39
- const outpoint = new wasm.OutPointWASM('e8b43025641eea4fd21190f01bd870ef90f1a8b199d8fc3376c5b62c0b1a179d', 1)
40
-
41
- const txIdBytes = Buffer.from('e8b43025641eea4fd21190f01bd870ef90f1a8b199d8fc3376c5b62c0b1a179d', 'hex')
42
-
43
- // 32 bytes for txId and 4 bytes for vout
44
- const bytes = [...txIdBytes.reverse(), ...[0, 0, 0, 1].reverse()]
45
-
46
- assert.deepEqual(outpoint.bytes(), Uint8Array.from(bytes))
47
- })
48
- })
49
- })
@@ -1,67 +0,0 @@
1
- const assert = require('assert')
2
- const { describe, it } = require('mocha')
3
- const { wif, bytes, publicKeyHash } = require('./mocks/PrivateKey')
4
- const { fromHexString, toHexString } = require('./utils/hex')
5
- const { default: wasm } = require('..')
6
-
7
- describe('PrivateKey', function () {
8
- describe('serialization / deserialization', function () {
9
- it('should allows to create PrivateKey from wif', function () {
10
- const pkey = wasm.PrivateKeyWASM.fromWIF(wif)
11
-
12
- assert.notEqual(pkey.__wbg_ptr, 0)
13
- })
14
-
15
- it('should allows to create PrivateKey from bytes', function () {
16
- const pkey = wasm.PrivateKeyWASM.fromBytes(fromHexString(bytes), 'Mainnet')
17
-
18
- assert.notEqual(pkey.__wbg_ptr, 0)
19
- })
20
-
21
- it('should allows to create PrivateKey from hex', function () {
22
- const pkey = wasm.PrivateKeyWASM.fromBytes(fromHexString(bytes), 'Mainnet')
23
-
24
- const pkeyFromHex = wasm.PrivateKeyWASM.fromHex(bytes, 'Mainnet')
25
-
26
- assert.deepEqual(pkey.bytes(), pkeyFromHex.bytes())
27
- })
28
-
29
- it('should allow to create PrivateKey from wif and read value in wif', function () {
30
- const pkey = wasm.PrivateKeyWASM.fromWIF(wif)
31
-
32
- assert.equal(pkey.WIF(), wif)
33
- })
34
-
35
- it('should allow to create PrivateKey from wif and write value in bytes', function () {
36
- const pkey = wasm.PrivateKeyWASM.fromWIF(wif)
37
-
38
- assert.deepEqual(pkey.bytes(), fromHexString(bytes))
39
- })
40
- })
41
-
42
- describe('getters', function () {
43
- it('should allow to get key wif', function () {
44
- const pkey = wasm.PrivateKeyWASM.fromWIF(wif)
45
-
46
- assert.equal(pkey.WIF(), wif)
47
- })
48
-
49
- it('should allow to get key bytes', function () {
50
- const pkey = wasm.PrivateKeyWASM.fromWIF(wif)
51
-
52
- assert.equal(toHexString(pkey.bytes()), bytes)
53
- })
54
-
55
- it('should allow to get key hex', function () {
56
- const pkey = wasm.PrivateKeyWASM.fromWIF(wif)
57
-
58
- assert.equal(pkey.hex().toLowerCase(), bytes)
59
- })
60
-
61
- it('should allow to get public key hash', function () {
62
- const pkey = wasm.PrivateKeyWASM.fromWIF(wif)
63
-
64
- assert.deepEqual(pkey.getPublicKeyHash(), publicKeyHash)
65
- })
66
- })
67
- })