postchain-client 1.22.0 → 2.0.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 (398) hide show
  1. package/README.md +16 -0
  2. package/built/cjs/index.js +2205 -3742
  3. package/built/cjs/index.js.map +1 -1
  4. package/built/esm/index.js +10425 -11683
  5. package/built/esm/index.js.map +1 -1
  6. package/built/index.d.ts +3 -8
  7. package/built/index.js +2 -11
  8. package/built/index.js.map +1 -1
  9. package/built/mocks/handlers.d.ts +1 -1
  10. package/built/mocks/handlers.js +62 -21
  11. package/built/mocks/handlers.js.map +1 -1
  12. package/built/src/ICCF/IccfProofTxMaterialBuilder.d.ts +3 -2
  13. package/built/src/ICCF/IccfProofTxMaterialBuilder.js +23 -10
  14. package/built/src/ICCF/IccfProofTxMaterialBuilder.js.map +1 -1
  15. package/built/src/ICCF/types.d.ts +4 -1
  16. package/built/src/ICCF/utils.js +2 -2
  17. package/built/src/ICCF/utils.js.map +1 -1
  18. package/built/src/blockchainClient/blockchainClient.js +56 -53
  19. package/built/src/blockchainClient/blockchainClient.js.map +1 -1
  20. package/built/src/blockchainClient/clientStub.js +18 -16
  21. package/built/src/blockchainClient/clientStub.js.map +1 -1
  22. package/built/src/blockchainClient/enums.d.ts +5 -0
  23. package/built/src/blockchainClient/enums.js +6 -0
  24. package/built/src/blockchainClient/enums.js.map +1 -1
  25. package/built/src/blockchainClient/errors.d.ts +20 -0
  26. package/built/src/blockchainClient/errors.js +41 -0
  27. package/built/src/blockchainClient/errors.js.map +1 -1
  28. package/built/src/{restclient → blockchainClient}/failoverStrategies.d.ts +14 -0
  29. package/built/src/{restclient → blockchainClient}/failoverStrategies.js +104 -24
  30. package/built/src/blockchainClient/failoverStrategies.js.map +1 -0
  31. package/built/src/blockchainClient/httpUtil.d.ts +4 -0
  32. package/built/src/{restclient → blockchainClient}/httpUtil.js +27 -23
  33. package/built/src/blockchainClient/httpUtil.js.map +1 -0
  34. package/built/src/blockchainClient/interface.d.ts +48 -59
  35. package/built/src/{restclient → blockchainClient}/nodeManager.d.ts +3 -0
  36. package/built/src/{restclient → blockchainClient}/nodeManager.js +7 -0
  37. package/built/src/blockchainClient/nodeManager.js.map +1 -0
  38. package/built/src/blockchainClient/requestWithFailoverStrategy.d.ts +4 -0
  39. package/built/src/blockchainClient/requestWithFailoverStrategy.js +31 -0
  40. package/built/src/blockchainClient/requestWithFailoverStrategy.js.map +1 -0
  41. package/built/src/blockchainClient/types.d.ts +64 -20
  42. package/built/src/blockchainClient/utils.d.ts +47 -12
  43. package/built/src/blockchainClient/utils.js +149 -30
  44. package/built/src/blockchainClient/utils.js.map +1 -1
  45. package/built/src/blockchainClient/validation/merkleHash.js +2 -1
  46. package/built/src/blockchainClient/validation/merkleHash.js.map +1 -1
  47. package/built/src/blockchainClient/validation/rawGtx.d.ts +2 -0
  48. package/built/src/blockchainClient/validation/rawGtx.js +22 -0
  49. package/built/src/blockchainClient/validation/rawGtx.js.map +1 -0
  50. package/built/src/blockchainClient/validation/requests.d.ts +5 -2
  51. package/built/src/blockchainClient/validation/requests.js +26 -0
  52. package/built/src/blockchainClient/validation/requests.js.map +1 -1
  53. package/built/src/blockchainClient/validation/transactionStatusReponse.d.ts +2 -0
  54. package/built/src/blockchainClient/validation/transactionStatusReponse.js +24 -0
  55. package/built/src/blockchainClient/validation/transactionStatusReponse.js.map +1 -0
  56. package/built/src/blockchainClient/validation/txRid.js +1 -1
  57. package/built/src/blockchainClient/validation/txRid.js.map +1 -1
  58. package/built/src/encryption/encryption.d.ts +0 -1
  59. package/built/src/encryption/encryption.js +0 -2
  60. package/built/src/encryption/encryption.js.map +1 -1
  61. package/built/src/formatter.d.ts +5 -7
  62. package/built/src/formatter.js +10 -29
  63. package/built/src/formatter.js.map +1 -1
  64. package/built/src/gtv/index.d.ts +3 -2
  65. package/built/src/gtv/index.js +4 -6
  66. package/built/src/gtv/index.js.map +1 -1
  67. package/built/src/gtx/errors.d.ts +2 -1
  68. package/built/src/gtx/errors.js.map +1 -1
  69. package/built/src/gtx/gtx.d.ts +5 -2
  70. package/built/src/gtx/gtx.js +0 -7
  71. package/built/src/gtx/gtx.js.map +1 -1
  72. package/built/src/gtx/serialization.d.ts +0 -1
  73. package/built/src/gtx/serialization.js +0 -1
  74. package/built/src/gtx/serialization.js.map +1 -1
  75. package/built/src/gtx/types.d.ts +0 -8
  76. package/built/src/logger.d.ts +6 -9
  77. package/built/src/logger.js +8 -14
  78. package/built/src/logger.js.map +1 -1
  79. package/built/src/promiEvent/promiEventEmitter.d.ts +1 -8
  80. package/built/src/promiEvent/promiEventEmitter.js.map +1 -1
  81. package/built/src/utils/calculateTransactionRid.d.ts +1 -1
  82. package/built/src/utils/calculateTransactionRid.js +6 -6
  83. package/built/src/utils/calculateTransactionRid.js.map +1 -1
  84. package/built/src/utils/constants.d.ts +4 -0
  85. package/built/src/utils/constants.js +5 -0
  86. package/built/src/utils/constants.js.map +1 -0
  87. package/built/src/utils/decodeTransactionToGtx.d.ts +1 -1
  88. package/built/src/utils/decodeTransactionToGtx.js +4 -3
  89. package/built/src/utils/decodeTransactionToGtx.js.map +1 -1
  90. package/built/src/utils/encodeTransaction.d.ts +1 -1
  91. package/built/src/utils/encodeTransaction.js +4 -4
  92. package/built/src/utils/encodeTransaction.js.map +1 -1
  93. package/built/test/common/mocks.d.ts +118 -0
  94. package/built/test/common/mocks.js +239 -0
  95. package/built/test/common/mocks.js.map +1 -0
  96. package/built/test/{unit/gtx → common}/serializationtestobjects.d.ts +1 -1
  97. package/built/test/common/serializationtestobjects.js.map +1 -0
  98. package/built/test/common/setups.d.ts +27 -0
  99. package/built/test/common/setups.js +137 -0
  100. package/built/test/common/setups.js.map +1 -0
  101. package/built/test/{unit → common}/signatures.d.ts +0 -1
  102. package/built/test/{unit → common}/signatures.js +0 -1
  103. package/built/test/common/signatures.js.map +1 -0
  104. package/built/test/common/testData.js.map +1 -0
  105. package/built/test/{unit/validation → common}/validationMocks.d.ts +22 -2
  106. package/built/test/{unit/validation → common}/validationMocks.js +13 -1
  107. package/built/test/common/validationMocks.js.map +1 -0
  108. package/built/test/integration/clientGetBlockInfo.test.js +51 -0
  109. package/built/test/integration/clientGetBlockInfo.test.js.map +1 -0
  110. package/built/test/integration/clientGetRejectedTransactions.test.js +28 -0
  111. package/built/test/integration/clientGetRejectedTransactions.test.js.map +1 -0
  112. package/built/test/integration/clientGetTransaction.test.js +29 -0
  113. package/built/test/integration/clientGetTransaction.test.js.map +1 -0
  114. package/built/test/integration/clientGetTransactionStatus.test.js +71 -0
  115. package/built/test/integration/clientGetTransactionStatus.test.js.map +1 -0
  116. package/built/test/integration/clientGetWaitingTransaction.test.js +34 -0
  117. package/built/test/integration/clientGetWaitingTransaction.test.js.map +1 -0
  118. package/built/test/integration/clientGetWaitingTransactions.test.js +28 -0
  119. package/built/test/integration/clientGetWaitingTransactions.test.js.map +1 -0
  120. package/built/test/integration/clientIntegration.test.js +95 -0
  121. package/built/test/integration/clientIntegration.test.js.map +1 -0
  122. package/built/test/integration/clientQuery.test.js +380 -0
  123. package/built/test/integration/clientQuery.test.js.map +1 -0
  124. package/built/test/integration/clientSendTransaction.test.js +86 -0
  125. package/built/test/integration/clientSendTransaction.test.js.map +1 -0
  126. package/built/test/integration/clientSignAndSendUniqueTransaction.test.js +75 -0
  127. package/built/test/integration/clientSignAndSendUniqueTransaction.test.js.map +1 -0
  128. package/built/test/integration/clientSignTransaction.test.js +77 -0
  129. package/built/test/integration/clientSignTransaction.test.js.map +1 -0
  130. package/built/test/integration/{blockchainClientUtils.test.js → clientUtils.test.js} +13 -8
  131. package/built/test/integration/clientUtils.test.js.map +1 -0
  132. package/built/test/integration/createClientIntegration.test.js +158 -0
  133. package/built/test/integration/createClientIntegration.test.js.map +1 -0
  134. package/built/test/integration/encodeTransaction.test.js +3 -6
  135. package/built/test/integration/encodeTransaction.test.js.map +1 -1
  136. package/built/test/integration/getTransactionsInfo.test.js +17 -26
  137. package/built/test/integration/getTransactionsInfo.test.js.map +1 -1
  138. package/built/test/integration/signAndSendUniqueTransaction.test.js +26 -19
  139. package/built/test/integration/signAndSendUniqueTransaction.test.js.map +1 -1
  140. package/built/test/integrationChromiaNetwork/createIccfProofTx.test.js +59 -0
  141. package/built/test/integrationChromiaNetwork/createIccfProofTx.test.js.map +1 -0
  142. package/built/test/{integrationDevnet → integrationChromiaNetwork}/getAnchoringStatusForBlockRid.test.js +9 -15
  143. package/built/test/integrationChromiaNetwork/getAnchoringStatusForBlockRid.test.js.map +1 -0
  144. package/built/test/{integrationDevnet → integrationChromiaNetwork}/getTransactionConfirmationLevel.test.js +7 -13
  145. package/built/test/integrationChromiaNetwork/getTransactionConfirmationLevel.test.js.map +1 -0
  146. package/built/test/integrationChromiaNetwork/getTransactionStatus.test.js +45 -0
  147. package/built/test/integrationChromiaNetwork/getTransactionStatus.test.js.map +1 -0
  148. package/built/test/integrationChromiaNetwork/isBlockAnchored.test.js +35 -0
  149. package/built/test/integrationChromiaNetwork/isBlockAnchored.test.js.map +1 -0
  150. package/built/test/integrationChromiaNetwork/merkleHashIntegration.test.d.ts +1 -0
  151. package/built/test/integrationChromiaNetwork/merkleHashIntegration.test.js +134 -0
  152. package/built/test/integrationChromiaNetwork/merkleHashIntegration.test.js.map +1 -0
  153. package/built/test/integrationChromiaNetwork/nodeDiscovery.test.d.ts +1 -0
  154. package/built/test/integrationChromiaNetwork/nodeDiscovery.test.js +26 -0
  155. package/built/test/integrationChromiaNetwork/nodeDiscovery.test.js.map +1 -0
  156. package/built/test/integrationChromiaNetwork/requestWithFailoverStrategy.test.d.ts +1 -0
  157. package/built/test/integrationChromiaNetwork/requestWithFailoverStrategy.test.js +84 -0
  158. package/built/test/integrationChromiaNetwork/requestWithFailoverStrategy.test.js.map +1 -0
  159. package/built/test/integrationChromiaNetwork/signAndSendUniqueTransaction.test.d.ts +1 -0
  160. package/built/test/{integrationDevnet → integrationChromiaNetwork}/signAndSendUniqueTransaction.test.js +27 -44
  161. package/built/test/integrationChromiaNetwork/signAndSendUniqueTransaction.test.js.map +1 -0
  162. package/built/test/manual/iccfManually.test.js +18 -27
  163. package/built/test/manual/iccfManually.test.js.map +1 -1
  164. package/built/test/pcctf/getSuites.test.d.ts +1 -0
  165. package/built/test/pcctf/getSuites.test.js +106 -0
  166. package/built/test/pcctf/getSuites.test.js.map +1 -0
  167. package/built/test/pcctf/helpers.d.ts +92 -0
  168. package/built/test/pcctf/helpers.js +239 -0
  169. package/built/test/pcctf/helpers.js.map +1 -0
  170. package/built/test/unit/ICCF/iccf.test.js +63 -158
  171. package/built/test/unit/ICCF/iccf.test.js.map +1 -1
  172. package/built/test/unit/ICCF/iccfProofMaterialBuilder.test.d.ts +1 -2
  173. package/built/test/unit/ICCF/iccfProofMaterialBuilder.test.js +101 -296
  174. package/built/test/unit/ICCF/iccfProofMaterialBuilder.test.js.map +1 -1
  175. package/built/test/unit/blockchainClient/client.getRejectedTransactions.test.d.ts +1 -0
  176. package/built/test/unit/blockchainClient/client.getRejectedTransactions.test.js +48 -0
  177. package/built/test/unit/blockchainClient/client.getRejectedTransactions.test.js.map +1 -0
  178. package/built/test/unit/blockchainClient/client.getWaitingTransaction.test.d.ts +1 -0
  179. package/built/test/unit/blockchainClient/client.getWaitingTransaction.test.js +38 -0
  180. package/built/test/unit/blockchainClient/client.getWaitingTransaction.test.js.map +1 -0
  181. package/built/test/unit/blockchainClient/client.getWaitingTransactions.test.d.ts +1 -0
  182. package/built/test/unit/blockchainClient/client.getWaitingTransactions.test.js +30 -0
  183. package/built/test/unit/blockchainClient/client.getWaitingTransactions.test.js.map +1 -0
  184. package/built/test/unit/blockchainClient/client.test.d.ts +1 -0
  185. package/built/test/unit/blockchainClient/client.test.js +177 -0
  186. package/built/test/unit/blockchainClient/client.test.js.map +1 -0
  187. package/built/test/unit/blockchainClient/clientCustomStatusCodes.test.js +26 -32
  188. package/built/test/unit/blockchainClient/clientCustomStatusCodes.test.js.map +1 -1
  189. package/built/test/unit/blockchainClient/getAnchoringStatusForBlockRid.test.js +26 -59
  190. package/built/test/unit/blockchainClient/getAnchoringStatusForBlockRid.test.js.map +1 -1
  191. package/built/test/unit/blockchainClient/getSystemAnchoringTransactionConfirmation.test.js +21 -38
  192. package/built/test/unit/blockchainClient/getSystemAnchoringTransactionConfirmation.test.js.map +1 -1
  193. package/built/test/unit/blockchainClient/getTransactionConfirmationLevel.test.js +77 -127
  194. package/built/test/unit/blockchainClient/getTransactionConfirmationLevel.test.js.map +1 -1
  195. package/built/test/unit/blockchainClient/sendTransaction.test.js +352 -675
  196. package/built/test/unit/blockchainClient/sendTransaction.test.js.map +1 -1
  197. package/built/test/unit/blockchainClient/setMerkleVersion.test.js +14 -28
  198. package/built/test/unit/blockchainClient/setMerkleVersion.test.js.map +1 -1
  199. package/built/test/unit/blockchainClient/signAndSendUniqueTransactionPromiEvents.test.js +31 -98
  200. package/built/test/unit/blockchainClient/signAndSendUniqueTransactionPromiEvents.test.js.map +1 -1
  201. package/built/test/unit/blockchainClient/statusPollIntervals.test.js +34 -54
  202. package/built/test/unit/blockchainClient/statusPollIntervals.test.js.map +1 -1
  203. package/built/test/unit/blockchainClient/util.test.js +74 -133
  204. package/built/test/unit/blockchainClient/util.test.js.map +1 -1
  205. package/built/test/unit/decodeTransactionToGtx.test.js +3 -4
  206. package/built/test/unit/decodeTransactionToGtx.test.js.map +1 -1
  207. package/built/test/unit/dump.test.js +2 -3
  208. package/built/test/unit/dump.test.js.map +1 -1
  209. package/built/test/unit/encryption/encryption.test.js +23 -32
  210. package/built/test/unit/encryption/encryption.test.js.map +1 -1
  211. package/built/test/unit/failoverStrategies.test.js +122 -114
  212. package/built/test/unit/failoverStrategies.test.js.map +1 -1
  213. package/built/test/unit/formatter.test.js +38 -42
  214. package/built/test/unit/formatter.test.js.map +1 -1
  215. package/built/test/unit/gtv/gtvHash.test.js +5 -6
  216. package/built/test/unit/gtv/gtvHash.test.js.map +1 -1
  217. package/built/test/unit/gtx/checkGTXSignature.test.js +5 -7
  218. package/built/test/unit/gtx/checkGTXSignature.test.js.map +1 -1
  219. package/built/test/unit/gtx/newSignatureProvider.test.js +9 -10
  220. package/built/test/unit/gtx/newSignatureProvider.test.js.map +1 -1
  221. package/built/test/unit/gtx/serialization.test.js +37 -138
  222. package/built/test/unit/gtx/serialization.test.js.map +1 -1
  223. package/built/test/unit/httpUtil.test.js +27 -18
  224. package/built/test/unit/httpUtil.test.js.map +1 -1
  225. package/built/test/unit/logger.test.js +23 -25
  226. package/built/test/unit/logger.test.js.map +1 -1
  227. package/built/test/unit/nodeMananger.test.js +62 -74
  228. package/built/test/unit/nodeMananger.test.js.map +1 -1
  229. package/built/test/unit/setOrdering.test.js +9 -9
  230. package/built/test/unit/setOrdering.test.js.map +1 -1
  231. package/built/test/unit/stickyNode.test.js +44 -54
  232. package/built/test/unit/stickyNode.test.js.map +1 -1
  233. package/built/test/unit/validation/anchoringTransaction.test.js +7 -8
  234. package/built/test/unit/validation/anchoringTransaction.test.js.map +1 -1
  235. package/built/test/unit/validation/blockIdentifier.test.js +7 -9
  236. package/built/test/unit/validation/blockIdentifier.test.js.map +1 -1
  237. package/built/test/unit/validation/bufferSchema.test.js +4 -5
  238. package/built/test/unit/validation/bufferSchema.test.js.map +1 -1
  239. package/built/test/unit/validation/networkSettings.test.js +11 -13
  240. package/built/test/unit/validation/networkSettings.test.js.map +1 -1
  241. package/built/test/unit/validation/rawGtx.test.d.ts +1 -0
  242. package/built/test/unit/validation/rawGtx.test.js +84 -0
  243. package/built/test/unit/validation/rawGtx.test.js.map +1 -0
  244. package/built/test/unit/validation/requests.test.js +80 -74
  245. package/built/test/unit/validation/requests.test.js.map +1 -1
  246. package/built/test/unit/validation/signMethod.test.js +8 -10
  247. package/built/test/unit/validation/signMethod.test.js.map +1 -1
  248. package/built/test/unit/validation/statusObject.test.d.ts +1 -0
  249. package/built/test/unit/validation/statusObject.test.js +91 -0
  250. package/built/test/unit/validation/statusObject.test.js.map +1 -0
  251. package/built/test/unit/validation/txRid.test.js +7 -9
  252. package/built/test/unit/validation/txRid.test.js.map +1 -1
  253. package/built/umd/index.js +31711 -31107
  254. package/built/umd/index.js.map +1 -1
  255. package/package.json +26 -22
  256. package/built/src/chromia/chromiaClientProvider.d.ts +0 -9
  257. package/built/src/chromia/chromiaClientProvider.js +0 -36
  258. package/built/src/chromia/chromiaClientProvider.js.map +0 -1
  259. package/built/src/chromia/interfaces.d.ts +0 -4
  260. package/built/src/chromia/interfaces.js +0 -2
  261. package/built/src/chromia/interfaces.js.map +0 -1
  262. package/built/src/constants.d.ts +0 -3
  263. package/built/src/constants.js +0 -4
  264. package/built/src/constants.js.map +0 -1
  265. package/built/src/gtx/gtxclient.d.ts +0 -3
  266. package/built/src/gtx/gtxclient.js +0 -96
  267. package/built/src/gtx/gtxclient.js.map +0 -1
  268. package/built/src/gtx/interfaces.d.ts +0 -91
  269. package/built/src/gtx/interfaces.js +0 -2
  270. package/built/src/gtx/interfaces.js.map +0 -1
  271. package/built/src/merkle/binarytree.d.ts +0 -131
  272. package/built/src/merkle/binarytree.js +0 -146
  273. package/built/src/merkle/binarytree.js.map +0 -1
  274. package/built/src/merkle/binarytreefactory.d.ts +0 -86
  275. package/built/src/merkle/binarytreefactory.js +0 -251
  276. package/built/src/merkle/binarytreefactory.js.map +0 -1
  277. package/built/src/merkle/merkleHelper.d.ts +0 -18
  278. package/built/src/merkle/merkleHelper.js +0 -110
  279. package/built/src/merkle/merkleHelper.js.map +0 -1
  280. package/built/src/merkle/merklehashcalculator.d.ts +0 -37
  281. package/built/src/merkle/merklehashcalculator.js +0 -73
  282. package/built/src/merkle/merklehashcalculator.js.map +0 -1
  283. package/built/src/merkle/path.d.ts +0 -151
  284. package/built/src/merkle/path.js +0 -306
  285. package/built/src/merkle/path.js.map +0 -1
  286. package/built/src/merkle/proof/merklehashcarrier.d.ts +0 -17
  287. package/built/src/merkle/proof/merklehashcarrier.js +0 -23
  288. package/built/src/merkle/proof/merklehashcarrier.js.map +0 -1
  289. package/built/src/merkle/proof/merklehashsummaryfactory.d.ts +0 -53
  290. package/built/src/merkle/proof/merklehashsummaryfactory.js +0 -82
  291. package/built/src/merkle/proof/merklehashsummaryfactory.js.map +0 -1
  292. package/built/src/merkle/proof/merkleproof.d.ts +0 -36
  293. package/built/src/merkle/proof/merkleproof.js +0 -61
  294. package/built/src/merkle/proof/merkleproof.js.map +0 -1
  295. package/built/src/merkle/proof/merkleprooftree.d.ts +0 -124
  296. package/built/src/merkle/proof/merkleprooftree.js +0 -117
  297. package/built/src/merkle/proof/merkleprooftree.js.map +0 -1
  298. package/built/src/merkle/proof/merkleprooftreefactory.d.ts +0 -47
  299. package/built/src/merkle/proof/merkleprooftreefactory.js +0 -123
  300. package/built/src/merkle/proof/merkleprooftreefactory.js.map +0 -1
  301. package/built/src/merkle/types.d.ts +0 -11
  302. package/built/src/merkle/types.js +0 -2
  303. package/built/src/merkle/types.js.map +0 -1
  304. package/built/src/restclient/enums.d.ts +0 -4
  305. package/built/src/restclient/enums.js +0 -6
  306. package/built/src/restclient/enums.js.map +0 -1
  307. package/built/src/restclient/errors.d.ts +0 -33
  308. package/built/src/restclient/errors.js +0 -63
  309. package/built/src/restclient/errors.js.map +0 -1
  310. package/built/src/restclient/failoverStrategies.js.map +0 -1
  311. package/built/src/restclient/httpUtil.d.ts +0 -6
  312. package/built/src/restclient/httpUtil.js.map +0 -1
  313. package/built/src/restclient/interfaces.d.ts +0 -68
  314. package/built/src/restclient/interfaces.js +0 -2
  315. package/built/src/restclient/interfaces.js.map +0 -1
  316. package/built/src/restclient/nodeManager.js.map +0 -1
  317. package/built/src/restclient/restclient.d.ts +0 -18
  318. package/built/src/restclient/restclient.js +0 -200
  319. package/built/src/restclient/restclient.js.map +0 -1
  320. package/built/src/restclient/restclientutil.d.ts +0 -32
  321. package/built/src/restclient/restclientutil.js +0 -141
  322. package/built/src/restclient/restclientutil.js.map +0 -1
  323. package/built/src/restclient/types.d.ts +0 -78
  324. package/built/src/restclient/types.js +0 -2
  325. package/built/src/restclient/types.js.map +0 -1
  326. package/built/test/integration/blockchainClientIntegration.test.js +0 -1075
  327. package/built/test/integration/blockchainClientIntegration.test.js.map +0 -1
  328. package/built/test/integration/blockchainClientUtils.test.js.map +0 -1
  329. package/built/test/integration/gtxClientIntegration.test.js +0 -334
  330. package/built/test/integration/gtxClientIntegration.test.js.map +0 -1
  331. package/built/test/integration/merkleIntegration.test.js +0 -138
  332. package/built/test/integration/merkleIntegration.test.js.map +0 -1
  333. package/built/test/integration/objectGenerator.d.ts +0 -3
  334. package/built/test/integration/objectGenerator.js +0 -17
  335. package/built/test/integration/objectGenerator.js.map +0 -1
  336. package/built/test/integration/restClientIntegration.test.js +0 -170
  337. package/built/test/integration/restClientIntegration.test.js.map +0 -1
  338. package/built/test/integration/testData.js.map +0 -1
  339. package/built/test/integrationDevnet/constants.d.ts +0 -1
  340. package/built/test/integrationDevnet/constants.js +0 -2
  341. package/built/test/integrationDevnet/constants.js.map +0 -1
  342. package/built/test/integrationDevnet/getAnchoringStatusForBlockRid.test.js.map +0 -1
  343. package/built/test/integrationDevnet/getTransactionConfirmationLevel.test.js.map +0 -1
  344. package/built/test/integrationDevnet/getTransactionStatus.test.js +0 -53
  345. package/built/test/integrationDevnet/getTransactionStatus.test.js.map +0 -1
  346. package/built/test/integrationDevnet/signAndSendUniqueTransaction.test.js.map +0 -1
  347. package/built/test/manual/chromiaClientProviderManually.test.js +0 -28
  348. package/built/test/manual/chromiaClientProviderManually.test.js.map +0 -1
  349. package/built/test/manual/restClientManually.test.js +0 -52
  350. package/built/test/manual/restClientManually.test.js.map +0 -1
  351. package/built/test/unit/ICCF/util.d.ts +0 -6
  352. package/built/test/unit/ICCF/util.js +0 -21
  353. package/built/test/unit/ICCF/util.js.map +0 -1
  354. package/built/test/unit/blockchainClient/blockchainClient.test.js +0 -287
  355. package/built/test/unit/blockchainClient/blockchainClient.test.js.map +0 -1
  356. package/built/test/unit/blockchainClient/helpers/sendTransaction.d.ts +0 -25
  357. package/built/test/unit/blockchainClient/helpers/sendTransaction.js +0 -56
  358. package/built/test/unit/blockchainClient/helpers/sendTransaction.js.map +0 -1
  359. package/built/test/unit/chromiaClientProvider.test.js +0 -70
  360. package/built/test/unit/chromiaClientProvider.test.js.map +0 -1
  361. package/built/test/unit/common/mocks.d.ts +0 -34
  362. package/built/test/unit/common/mocks.js +0 -69
  363. package/built/test/unit/common/mocks.js.map +0 -1
  364. package/built/test/unit/gtx/gtxClient.test.js +0 -97
  365. package/built/test/unit/gtx/gtxClient.test.js.map +0 -1
  366. package/built/test/unit/gtx/serializationtestobjects.js.map +0 -1
  367. package/built/test/unit/merkle/merkleHelper/merkleHelperTest.js +0 -87
  368. package/built/test/unit/merkle/merkleHelper/merkleHelperTest.js.map +0 -1
  369. package/built/test/unit/requestWithFailoverStrategy.test.js +0 -146
  370. package/built/test/unit/requestWithFailoverStrategy.test.js.map +0 -1
  371. package/built/test/unit/restClient.test.js +0 -389
  372. package/built/test/unit/restClient.test.js.map +0 -1
  373. package/built/test/unit/restClientUtil.test.js +0 -226
  374. package/built/test/unit/restClientUtil.test.js.map +0 -1
  375. package/built/test/unit/signatures.js.map +0 -1
  376. package/built/test/unit/validation/validationMocks.js.map +0 -1
  377. package/changelog.md +0 -586
  378. /package/built/test/{unit/gtx → common}/serializationtestobjects.js +0 -0
  379. /package/built/test/{integration → common}/testData.d.ts +0 -0
  380. /package/built/test/{integration → common}/testData.js +0 -0
  381. /package/built/test/integration/{blockchainClientIntegration.test.d.ts → clientGetBlockInfo.test.d.ts} +0 -0
  382. /package/built/test/integration/{blockchainClientUtils.test.d.ts → clientGetRejectedTransactions.test.d.ts} +0 -0
  383. /package/built/test/integration/{gtxClientIntegration.test.d.ts → clientGetTransaction.test.d.ts} +0 -0
  384. /package/built/test/integration/{merkleIntegration.test.d.ts → clientGetTransactionStatus.test.d.ts} +0 -0
  385. /package/built/test/integration/{restClientIntegration.test.d.ts → clientGetWaitingTransaction.test.d.ts} +0 -0
  386. /package/built/test/{integrationDevnet/getAnchoringStatusForBlockRid.test.d.ts → integration/clientGetWaitingTransactions.test.d.ts} +0 -0
  387. /package/built/test/{integrationDevnet/getTransactionConfirmationLevel.test.d.ts → integration/clientIntegration.test.d.ts} +0 -0
  388. /package/built/test/{integrationDevnet/getTransactionStatus.test.d.ts → integration/clientQuery.test.d.ts} +0 -0
  389. /package/built/test/{integrationDevnet/signAndSendUniqueTransaction.test.d.ts → integration/clientSendTransaction.test.d.ts} +0 -0
  390. /package/built/test/{manual/chromiaClientProviderManually.test.d.ts → integration/clientSignAndSendUniqueTransaction.test.d.ts} +0 -0
  391. /package/built/test/{manual/restClientManually.test.d.ts → integration/clientSignTransaction.test.d.ts} +0 -0
  392. /package/built/test/{unit/blockchainClient/blockchainClient.test.d.ts → integration/clientUtils.test.d.ts} +0 -0
  393. /package/built/test/{unit/chromiaClientProvider.test.d.ts → integration/createClientIntegration.test.d.ts} +0 -0
  394. /package/built/test/{unit/gtx/gtxClient.test.d.ts → integrationChromiaNetwork/createIccfProofTx.test.d.ts} +0 -0
  395. /package/built/test/{unit/merkle/merkleHelper/merkleHelperTest.d.ts → integrationChromiaNetwork/getAnchoringStatusForBlockRid.test.d.ts} +0 -0
  396. /package/built/test/{unit/requestWithFailoverStrategy.test.d.ts → integrationChromiaNetwork/getTransactionConfirmationLevel.test.d.ts} +0 -0
  397. /package/built/test/{unit/restClient.test.d.ts → integrationChromiaNetwork/getTransactionStatus.test.d.ts} +0 -0
  398. /package/built/test/{unit/restClientUtil.test.d.ts → integrationChromiaNetwork/isBlockAnchored.test.d.ts} +0 -0
@@ -1,37 +0,0 @@
1
- /// <reference types="node" />
2
- /**
3
- *
4
- * @param {CryptoSystem} cryptoSystem
5
- */
6
- export function MerkleHashCalculator(cryptoSystem: CryptoSystem): void;
7
- export class MerkleHashCalculator {
8
- /**
9
- *
10
- * @param {CryptoSystem} cryptoSystem
11
- */
12
- constructor(cryptoSystem: CryptoSystem);
13
- cryptoSystem: CryptoSystem;
14
- /**
15
- * @param {number} prefix
16
- * @param {Buffer} hashLeft
17
- * @param {Buffer} hashRight
18
- */
19
- calculateNodeHash(prefix: number, hashLeft: Buffer, hashRight: Buffer): any;
20
- /**
21
- * @param {*} value
22
- */
23
- calculateLeafHash(value: any, merkleHashVersion: any): any;
24
- /**
25
- * @param {number} prefix
26
- * @param {Buffer} hashLeft
27
- * @param {Buffer} hashRight
28
- */
29
- calculateNodeHashInternal(prefix: number, hashLeft: Buffer, hashRight: Buffer, hashFunc: any): any;
30
- calculateHashOfValueInternal(valuetoHash: any, serializeFun: any, hashFunc: any, merkleHashVersion: any): any;
31
- isContainerProofValueLeaf(value: any): boolean;
32
- }
33
- export function CryptoSystem(): void;
34
- export class CryptoSystem {
35
- digest(buffer: any): Buffer;
36
- }
37
- import { Buffer } from "buffer";
@@ -1,73 +0,0 @@
1
- "use strict";
2
- const { Buffer } = require('buffer');
3
- var serialization = require('../gtx/serialization');
4
- var HASH_PREFIX_LEAF = require('./binarytree').HASH_PREFIX_LEAF;
5
- var encryption = require('../../src/encryption/encryption');
6
- function CryptoSystem() { }
7
- CryptoSystem.prototype.digest = function (buffer) {
8
- return encryption.hash256(buffer);
9
- };
10
- /**
11
- *
12
- * @param {Buffer} buffer
13
- * @param {CryptoSystem} cryptoSystem
14
- */
15
- function hashingFun(buffer, cryptoSystem) {
16
- if (cryptoSystem === null) {
17
- throw new Error("In this case we need the CryptoSystem to calculate the hash");
18
- }
19
- else {
20
- return cryptoSystem.digest(buffer);
21
- }
22
- }
23
- /**
24
- *
25
- * @param {CryptoSystem} cryptoSystem
26
- */
27
- function MerkleHashCalculator(cryptoSystem) {
28
- this.cryptoSystem = cryptoSystem;
29
- }
30
- /**
31
- * @param {number} prefix
32
- * @param {Buffer} hashLeft
33
- * @param {Buffer} hashRight
34
- */
35
- MerkleHashCalculator.prototype.calculateNodeHash = function (prefix, hashLeft, hashRight) {
36
- return this.calculateNodeHashInternal(prefix, hashLeft, hashRight, hashingFun);
37
- };
38
- /**
39
- * @param {*} value
40
- */
41
- MerkleHashCalculator.prototype.calculateLeafHash = function (value, merkleHashVersion) {
42
- return this.calculateHashOfValueInternal(value, serialization.encodeValue, hashingFun, merkleHashVersion);
43
- };
44
- /**
45
- * @param {number} prefix
46
- * @param {Buffer} hashLeft
47
- * @param {Buffer} hashRight
48
- */
49
- MerkleHashCalculator.prototype.calculateNodeHashInternal = function (prefix, hashLeft, hashRight, hashFunc) {
50
- var buf = Buffer.alloc(1);
51
- buf.writeInt8(prefix);
52
- var bufferSum = Buffer.concat([buf, hashLeft, hashRight]);
53
- return hashFunc(bufferSum, this.cryptoSystem);
54
- };
55
- MerkleHashCalculator.prototype.calculateHashOfValueInternal = function (valuetoHash, serializeFun, hashFunc, merkleHashVersion) {
56
- var buf = Buffer.alloc(1);
57
- buf.writeInt8(HASH_PREFIX_LEAF);
58
- var bufferSum = Buffer.concat([buf, serializeFun(valuetoHash)]);
59
- return hashFunc(bufferSum, this.cryptoSystem, merkleHashVersion);
60
- };
61
- MerkleHashCalculator.prototype.isContainerProofValueLeaf = function (value) {
62
- if (value == null) {
63
- return false;
64
- }
65
- if (value.constructor === Array || typeof value === 'object') {
66
- return true;
67
- }
68
- else {
69
- return false;
70
- }
71
- };
72
- module.exports = { MerkleHashCalculator, CryptoSystem };
73
- //# sourceMappingURL=merklehashcalculator.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"merklehashcalculator.js","sourceRoot":"","sources":["../../../src/merkle/merklehashcalculator.js"],"names":[],"mappings":";AAAA,MAAM,EAAE,MAAM,EAAE,GAAG,OAAO,CAAC,QAAQ,CAAC,CAAC;AACrC,IAAI,aAAa,GAAG,OAAO,CAAC,sBAAsB,CAAC,CAAA;AACnD,IAAI,gBAAgB,GAAG,OAAO,CAAC,cAAc,CAAC,CAAC,gBAAgB,CAAA;AAC/D,IAAI,UAAU,GAAG,OAAO,CAAC,iCAAiC,CAAC,CAAA;AAE3D,SAAS,YAAY,KAAI,CAAC;AAC1B,YAAY,CAAC,SAAS,CAAC,MAAM,GAAG,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AAY,CAAC,CAAA;AAC/C,CAAC,CAAA;AAED,oBAAoB,CAAC,SAAS,CAAC,4BAA4B,GAAG,UAAS,WAAW,EAAE,YAAY,EAAE,QAAQ,EAAE,iBAAiB;IAC3H,IAAI,GAAG,GAAG,MAAM,CAAC,KAAK,CAAC,CAAC,CAAC,CAAA;IACzB,GAAG,CAAC,SAAS,CAAC,gBAAgB,CAAC,CAAA;IAC/B,IAAI,SAAS,GAAG,MAAM,CAAC,MAAM,CAAC,CAAC,GAAG,EAAE,YAAY,CAAC,WAAW,CAAC,CAAC,CAAC,CAAA;IAC/D,OAAO,QAAQ,CAAC,SAAS,EAAE,IAAI,CAAC,YAAY,EAAE,iBAAiB,CAAC,CAAA;AAClE,CAAC,CAAA;AAED,oBAAoB,CAAC,SAAS,CAAC,yBAAyB,GAAG,UAAS,KAAK;IACvE,IAAI,KAAK,IAAI,IAAI,EAAE,CAAC;QAClB,OAAO,KAAK,CAAA;IACd,CAAC;IACD,IAAI,KAAK,CAAC,WAAW,KAAK,KAAK,IAAI,OAAO,KAAK,KAAK,QAAQ,EAAE,CAAC;QAC7D,OAAO,IAAI,CAAA;IACb,CAAC;SAAM,CAAC;QACN,OAAO,KAAK,CAAA;IACd,CAAC;AACH,CAAC,CAAA;AAED,MAAM,CAAC,OAAO,GAAG,EAAC,oBAAoB,EAAE,YAAY,EAAC,CAAC"}
@@ -1,151 +0,0 @@
1
- /**
2
- *
3
- * @param {Array} pathElements
4
- */
5
- export function Path(pathElements: any[]): void;
6
- export class Path {
7
- /**
8
- *
9
- * @param {Array} pathElements
10
- */
11
- constructor(pathElements: any[]);
12
- pathElements: any[];
13
- /**
14
- *
15
- */
16
- getCurrentPathElement(): any;
17
- /**
18
- *
19
- */
20
- size(): number;
21
- /**
22
- *
23
- */
24
- tail(): Path;
25
- debugString(): string;
26
- /**
27
- * @param {Path} other
28
- */
29
- equals(other: Path): boolean;
30
- }
31
- export function PathElement(previous: any): void;
32
- export class PathElement {
33
- constructor(previous: any);
34
- previous: any;
35
- getSearchKey(): void;
36
- }
37
- export function PathLeafElement(previous: any): void;
38
- export class PathLeafElement {
39
- constructor(previous: any);
40
- equals(other: any): boolean;
41
- }
42
- /**
43
- *
44
- * @param {SearchablePathElement} previous
45
- * @param {number} index
46
- */
47
- export function ArrayPathElement(previous: SearchablePathElement, index: number): void;
48
- export class ArrayPathElement {
49
- /**
50
- *
51
- * @param {SearchablePathElement} previous
52
- * @param {number} index
53
- */
54
- constructor(previous: SearchablePathElement, index: number);
55
- index: number;
56
- getSearchKey(): number;
57
- /**
58
- * @param {ArrayPathElement} other
59
- */
60
- equals(other: ArrayPathElement): boolean;
61
- }
62
- export function SearchablePathElement(previous: any): void;
63
- export class SearchablePathElement {
64
- constructor(previous: any);
65
- getSearchKey(): void;
66
- }
67
- /**
68
- *
69
- * @param {SearchablePathElement} previous
70
- * @param {string} key
71
- */
72
- export function DictPathElement(previous: SearchablePathElement, key: string): void;
73
- export class DictPathElement {
74
- /**
75
- *
76
- * @param {SearchablePathElement} previous
77
- * @param {string} key
78
- */
79
- constructor(previous: SearchablePathElement, key: string);
80
- key: string;
81
- getSearchKey(): string;
82
- /**
83
- * @param {DictPathElement} other
84
- */
85
- equals(other: DictPathElement): boolean;
86
- }
87
- /**
88
- *
89
- * @param {Array} paths
90
- */
91
- export function PathSet(paths: any[]): void;
92
- export class PathSet {
93
- /**
94
- *
95
- * @param {Array} paths
96
- */
97
- constructor(paths: any[]);
98
- paths: any[];
99
- /**
100
- *
101
- */
102
- isEmpty(): boolean;
103
- /**
104
- *
105
- */
106
- getPathLeafOrElseAnyCurrentPathElement(): null;
107
- /**
108
- * Yeah, this might be a completely un-needed check (but it MIGHT save us later on if we forget this rule).
109
- * What we are looking for here is an impossible state where two paths in the same set don't have the same parent.
110
- * (Since we usually only have one path in a path set, this check should be cheap)
111
- *
112
- * @param {Path} currPath
113
- * @param {PathElement} currElem
114
- * @param {Path} prevPath
115
- * @param {PathElement} prevElem
116
- */
117
- errorCheckUnequalParent(currPath: Path, currElem: PathElement, prevPath: Path, prevElem: PathElement): {
118
- path: Path;
119
- elem: PathElement;
120
- };
121
- /**
122
- *
123
- */
124
- keepOnlyArrayPaths(): PathSet;
125
- /**
126
- *
127
- */
128
- keepOnlyDictPaths(): PathSet;
129
- /**
130
- *
131
- */
132
- getTailIfFirstElementIsArrayOfThisIndexFromList(index: any): PathSet;
133
- /**
134
- *
135
- */
136
- getTailIfFirstElementIsDictOfThisKeyFromList(key: any): PathSet;
137
- /**
138
- *
139
- */
140
- getTailFromList(searchKey: any, filterFunc: any): PathSet;
141
- }
142
- /**
143
- * @param {number} index
144
- * @param {Path} path
145
- */
146
- export function getTailIfFirstElementIsArrayOfThisIndex(index: number, path: Path): Path | null;
147
- /**
148
- *
149
- * @param {Array} arr
150
- */
151
- export function buildPathFromArray(arr: any[]): Path;
@@ -1,306 +0,0 @@
1
- "use strict";
2
- var util = require('../formatter');
3
- function PathElement(previous) {
4
- this.previous = previous;
5
- }
6
- PathElement.prototype.getSearchKey = function () { };
7
- function PathLeafElement(previous) {
8
- PathElement.call(this, previous);
9
- }
10
- PathLeafElement.prototype = Object.create(PathElement.prototype);
11
- PathLeafElement.prototype.constructor = PathLeafElement;
12
- PathLeafElement.prototype.equals = function (other) {
13
- if (this === other)
14
- return true;
15
- if (typeof this !== typeof other)
16
- return false;
17
- return true;
18
- };
19
- function SearchablePathElement(previous) {
20
- PathElement.call(this, previous);
21
- }
22
- SearchablePathElement.prototype = Object.create(PathElement.prototype);
23
- SearchablePathElement.prototype.constructor = SearchablePathElement;
24
- SearchablePathElement.prototype.getSearchKey = function () { };
25
- /**
26
- *
27
- * @param {SearchablePathElement} previous
28
- * @param {number} index
29
- */
30
- function ArrayPathElement(previous, index) {
31
- SearchablePathElement.call(this, previous);
32
- this.index = index;
33
- }
34
- ArrayPathElement.prototype = Object.create(SearchablePathElement.prototype);
35
- ArrayPathElement.prototype.constructor = ArrayPathElement;
36
- ArrayPathElement.prototype.getSearchKey = function () {
37
- return this.index;
38
- };
39
- /**
40
- * @param {ArrayPathElement} other
41
- */
42
- ArrayPathElement.prototype.equals = function (other) {
43
- if (this === other)
44
- return true;
45
- if (typeof this !== typeof other)
46
- return false;
47
- if (this.index != other.index)
48
- return false;
49
- return true;
50
- };
51
- /**
52
- *
53
- * @param {SearchablePathElement} previous
54
- * @param {string} key
55
- */
56
- function DictPathElement(previous, key) {
57
- SearchablePathElement.call(this, previous);
58
- this.key = key;
59
- }
60
- DictPathElement.prototype = Object.create(SearchablePathElement.prototype);
61
- DictPathElement.prototype.constructor = DictPathElement;
62
- DictPathElement.prototype.getSearchKey = function () {
63
- return this.key;
64
- };
65
- /**
66
- * @param {DictPathElement} other
67
- */
68
- DictPathElement.prototype.equals = function (other) {
69
- if (this === other)
70
- return true;
71
- if (typeof this !== typeof other)
72
- return false;
73
- if (this.key != other.key)
74
- return false;
75
- return true;
76
- };
77
- /**
78
- *
79
- * @param {Array} pathElements
80
- */
81
- function Path(pathElements) {
82
- this.pathElements = pathElements;
83
- }
84
- /**
85
- *
86
- */
87
- Path.prototype.getCurrentPathElement = function () {
88
- return this.pathElements[0];
89
- };
90
- /**
91
- *
92
- */
93
- Path.prototype.size = function () {
94
- return this.pathElements.length;
95
- };
96
- /**
97
- *
98
- */
99
- Path.prototype.tail = function () {
100
- if (this.pathElements.length == 0) {
101
- throw new Error("Impossible to tail this array");
102
- }
103
- else {
104
- var tail = this.pathElements.slice(1);
105
- return new Path(tail);
106
- }
107
- };
108
- Path.prototype.debugString = function () {
109
- var sb = "";
110
- this.pathElements.forEach(elem => {
111
- if (elem instanceof SearchablePathElement) {
112
- sb = sb + "-> " + elem.getSearchKey();
113
- }
114
- else if (elem instanceof PathLeafElement) {
115
- sb = sb + "-> Leaf";
116
- }
117
- });
118
- return sb;
119
- };
120
- /**
121
- * @param {Path} other
122
- */
123
- Path.prototype.equals = function (other) {
124
- if (this === other)
125
- return true;
126
- if (typeof this != typeof other)
127
- return false;
128
- return this.pathElements == other.pathElements;
129
- };
130
- /**
131
- * @param {number} index
132
- * @param {Path} path
133
- */
134
- var getTailIfFirstElementIsArrayOfThisIndex = function (index, path) {
135
- return getTail(index, path);
136
- };
137
- /**
138
- *
139
- * @param {string} key
140
- * @param {Path} path
141
- */
142
- var getTailIfFirstElementIsDictOfThisKey = function (key, path) {
143
- return getTail(key, path);
144
- };
145
- /**
146
- *
147
- * @param {string|number} searchKey
148
- * @param {Path} path
149
- */
150
- var getTail = function (searchKey, path) {
151
- if (searchKey === null) {
152
- throw new Error("Have to provide a search key");
153
- }
154
- try {
155
- var firstElement = path.pathElements[0];
156
- if (firstElement instanceof SearchablePathElement) {
157
- if (firstElement.getSearchKey() == searchKey) {
158
- return path.tail();
159
- }
160
- }
161
- }
162
- catch (err) {
163
- util.logError("Why are we dropping first element of an empty path? " + err);
164
- return null;
165
- }
166
- return null;
167
- };
168
- /**
169
- *
170
- * @param {Array} paths
171
- */
172
- function PathSet(paths) {
173
- this.paths = paths;
174
- }
175
- /**
176
- *
177
- */
178
- PathSet.prototype.isEmpty = function () {
179
- return this.paths.length == 0;
180
- };
181
- /**
182
- *
183
- */
184
- PathSet.prototype.getPathLeafOrElseAnyCurrentPathElement = function () {
185
- var leafElem = null;
186
- var currElem = null;
187
- var prev = {
188
- "path": null,
189
- "elem": null,
190
- };
191
- this.paths.forEach(path => {
192
- currElem = path.getCurrentPathElement();
193
- if (currElem instanceof PathLeafElement) {
194
- leafElem = currElem;
195
- }
196
- prev = this.errorCheckUnequalParent(path, currElem, prev.path, prev.elem);
197
- });
198
- if (leafElem != null) {
199
- return leafElem;
200
- }
201
- else {
202
- return currElem; // It doesn't matter which one we return (Next step we will get the "previous" from this one)
203
- }
204
- };
205
- /**
206
- * Yeah, this might be a completely un-needed check (but it MIGHT save us later on if we forget this rule).
207
- * What we are looking for here is an impossible state where two paths in the same set don't have the same parent.
208
- * (Since we usually only have one path in a path set, this check should be cheap)
209
- *
210
- * @param {Path} currPath
211
- * @param {PathElement} currElem
212
- * @param {Path} prevPath
213
- * @param {PathElement} prevElem
214
- */
215
- PathSet.prototype.errorCheckUnequalParent = function (currPath, currElem, prevPath, prevElem) {
216
- if (prevElem != null) {
217
- // weird: javascript cannot compare null == null then we have to compare each with null separately :(
218
- if (currElem.previous == null && prevElem.previous == null) {
219
- return {
220
- "path": currPath,
221
- "elem": currElem
222
- };
223
- }
224
- else if ((currElem.previous == null && prevElem.previous != null) || (currElem.previous != null && prevElem.previous == null)) {
225
- throw new Error("Something is wrong, these paths do not have the same parent. (" + currPath + ") (" + prevPath + ")");
226
- }
227
- else if (!currElem.previous.equals(prevElem.previous)) {
228
- throw new Error("Something is wrong, these paths do not have the same parent. (" + currPath + ") (" + prevPath + ")");
229
- }
230
- }
231
- return {
232
- "path": currPath,
233
- "elem": currElem
234
- };
235
- };
236
- /**
237
- *
238
- */
239
- PathSet.prototype.keepOnlyArrayPaths = function () {
240
- var filteredPaths = this.paths.filter(path => {
241
- return path.pathElements[0] instanceof ArrayPathElement;
242
- });
243
- return new PathSet(filteredPaths);
244
- };
245
- /**
246
- *
247
- */
248
- PathSet.prototype.keepOnlyDictPaths = function () {
249
- var filteredPaths = this.paths.filter(path => {
250
- return path.pathElements[0] instanceof DictPathElement;
251
- });
252
- return new PathSet(filteredPaths);
253
- };
254
- /**
255
- *
256
- */
257
- PathSet.prototype.getTailIfFirstElementIsArrayOfThisIndexFromList = function (index) {
258
- return this.getTailFromList(index, getTailIfFirstElementIsArrayOfThisIndex);
259
- };
260
- /**
261
- *
262
- */
263
- PathSet.prototype.getTailIfFirstElementIsDictOfThisKeyFromList = function (key) {
264
- return this.getTailFromList(key, getTailIfFirstElementIsDictOfThisKey);
265
- };
266
- /**
267
- *
268
- */
269
- PathSet.prototype.getTailFromList = function (searchKey, filterFunc) {
270
- var retPaths = new Array();
271
- this.paths.forEach(path => {
272
- var newPath = filterFunc(searchKey, path);
273
- if (newPath != null) {
274
- retPaths.push(newPath);
275
- }
276
- });
277
- return new PathSet(retPaths);
278
- };
279
- /**
280
- *
281
- * @param {Array} arr
282
- */
283
- var buildPathFromArray = function (arr) {
284
- var pathElements = new Array();
285
- var lastPathElem = null;
286
- arr.forEach(item => {
287
- var newElem = null;
288
- if (typeof item === 'number') {
289
- newElem = new ArrayPathElement(lastPathElem, item);
290
- }
291
- else if (typeof item === 'string') {
292
- newElem = new DictPathElement(lastPathElem, item);
293
- }
294
- else {
295
- throw new Error("A path structure must only consist of Ints and Strings, not " + item);
296
- }
297
- pathElements.push(newElem);
298
- lastPathElem = newElem;
299
- });
300
- var lastOne = lastPathElem;
301
- pathElements.push(new PathLeafElement(lastOne));
302
- return new Path(pathElements);
303
- };
304
- module.exports = { Path, PathElement, PathLeafElement, ArrayPathElement, SearchablePathElement, DictPathElement, PathSet,
305
- getTailIfFirstElementIsArrayOfThisIndex, buildPathFromArray };
306
- //# sourceMappingURL=path.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"path.js","sourceRoot":"","sources":["../../../src/merkle/path.js"],"names":[],"mappings":"AAAA,YAAY,CAAA;AAEZ,IAAI,IAAI,GAAG,OAAO,CAAC,cAAc,CAAC,CAAC;AAEnC,SAAS,WAAW,CAAC,QAAQ;IAC3B,IAAI,CAAC,QAAQ,GAAG,QAAQ,CAAA;AAC1B,CAAC;AACD,WAAW,CAAC,SAAS,CAAC,YAAY,GAAG,cAAY,CAAC,CAAA;AAElD,SAAS,eAAe,CAAC,QAAQ;IAC/B,WAAW,CAAC,IAAI,CAAC,IAAI,EAAE,QAAQ,CAAC,CAAA;AAClC,CAAC;AACD,eAAe,CAAC,SAAS,GAAG,MAAM,CAAC,MAAM,CAAC,WAAW,CAAC,SAAS,CAAC,CAAA;AAChE,eAAe,CAAC,SAAS,CAAC,WAAW,GAAG,eAAe,CAAA;AACvD,eAAe,CAAC,SAAS,CAAC,MAAM,GAAG,UAAS,KAAK;IAC/C,IAAI,IAAI,KAAK,KAAK;QAAE,OAAO,IAAI,CAAA;IAC/B,IAAI,OAAO,IAAI,KAAK,OAA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AAI,kBAAkB,GAAG,UAAS,GAAG;IACnC,IAAI,YAAY,GAAG,IAAI,KAAK,EAAE,CAAA;IAC9B,IAAI,YAAY,GAAG,IAAI,CAAA;IAEvB,GAAG,CAAC,OAAO,CAAC,IAAI,CAAC,EAAE;QACjB,IAAI,OAAO,GAAG,IAAI,CAAA;QAClB,IAAI,OAAO,IAAI,KAAK,QAAQ,EAAE,CAAC;YAC7B,OAAO,GAAG,IAAI,gBAAgB,CAAC,YAAY,EAAE,IAAI,CAAC,CAAA;QACpD,CAAC;aAAM,IAAI,OAAO,IAAI,KAAK,QAAQ,EAAE,CAAC;YACpC,OAAO,GAAG,IAAI,eAAe,CAAC,YAAY,EAAE,IAAI,CAAC,CAAA;QACnD,CAAC;aAAM,CAAC;YACN,MAAM,IAAI,KAAK,CAAC,8DAA8D,GAAG,IAAI,CAAC,CAAA;QACxF,CAAC;QACD,YAAY,CAAC,IAAI,CAAC,OAAO,CAAC,CAAA;QAC1B,YAAY,GAAG,OAAO,CAAA;IACxB,CAAC,CAAC,CAAA;IACF,IAAI,OAAO,GAAG,YAAY,CAAA;IAC1B,YAAY,CAAC,IAAI,CAAC,IAAI,eAAe,CAAC,OAAO,CAAC,CAAC,CAAA;IAC/C,OAAO,IAAI,IAAI,CAAC,YAAY,CAAC,CAAA;AAC/B,CAAC,CAAA;AAED,MAAM,CAAC,OAAO,GAAG,EAAC,IAAI,EAAE,WAAW,EAAE,eAAe,EAAE,gBAAgB,EAAE,qBAAqB,EAAE,eAAe,EAAE,OAAO;IACrH,uCAAuC,EAAE,kBAAkB,EAAC,CAAA"}
@@ -1,17 +0,0 @@
1
- /**
2
- *
3
- * @param {Buffer} merkleHash
4
- */
5
- export function MerkleHashSummary(merkleHash: Buffer): void;
6
- export class MerkleHashSummary {
7
- /**
8
- *
9
- * @param {Buffer} merkleHash
10
- */
11
- constructor(merkleHash: Buffer);
12
- merkleHash: Buffer;
13
- /**
14
- * @param {MerkleHashSummary} other
15
- */
16
- equals(other: MerkleHashSummary): boolean;
17
- }
@@ -1,23 +0,0 @@
1
- "use strict";
2
- /**
3
- *
4
- * @param {Buffer} merkleHash
5
- */
6
- function MerkleHashSummary(merkleHash) {
7
- this.merkleHash = merkleHash;
8
- }
9
- /**
10
- * @param {MerkleHashSummary} other
11
- */
12
- MerkleHashSummary.prototype.equals = function (other) {
13
- if (this === other)
14
- return true;
15
- if (typeof this != typeof other)
16
- return false;
17
- if (this.merkleHash.compare(other.merkleHash) === 0) {
18
- return true;
19
- }
20
- return false;
21
- };
22
- module.exports = { MerkleHashSummary };
23
- //# sourceMappingURL=merklehashcarrier.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"merklehashcarrier.js","sourceRoot":"","sources":["../../../../src/merkle/proof/merklehashcarrier.js"],"names":[],"mappings":"AAAA,YAAY,CAAA;AAEZ;;;GAGG;AACH,SAAS,iBAAiB,CAAC,UAAU;IACnC,IAAI,CAAC,UAAU,GAAG,UAAU,CAAA;AAC9B,CAAC;AAED;;GAEG;AACH,iBAAiB,CAAC,SAAS,CAAC,MAAM,GAAG,UAAS,KAAK;IACjD,IAAI,IAAI,KAAK,KAAK;QAAE,OAAO,IAAI,CAAA;IAC/B,IAAI,OAAO,IAAI,IAAI,OAAO,KAAK;QAAE,OAAO,KAAK,CAAA;IAE7C,IAAI,IAAI,CAAC,UAAU,CAAC,OAAO,CAAC,KAAK,CAAC,UAAU,CAAC,KAAK,CAAC,EAAE,CAAC;QACpD,OAAO,IAAI,CAAA;IACb,CAAC;IACD,OAAO,KAAK,CAAA;AACd,CAAC,CAAA;AAGD,MAAM,CAAC,OAAO,GAAG,EAAC,iBAAiB,EAAC,CAAA"}
@@ -1,53 +0,0 @@
1
- /**
2
- *
3
- * @param {BinaryTreeFactory} treeFactory
4
- * @param {MerkleProofTreeFactory} proofFactory
5
- */
6
- export function MerkleHashSummaryFactory(treeFactory: BinaryTreeFactory, proofFactory: MerkleProofTreeFactory): void;
7
- export class MerkleHashSummaryFactory {
8
- /**
9
- *
10
- * @param {BinaryTreeFactory} treeFactory
11
- * @param {MerkleProofTreeFactory} proofFactory
12
- */
13
- constructor(treeFactory: BinaryTreeFactory, proofFactory: MerkleProofTreeFactory);
14
- treeFactory: BinaryTreeFactory;
15
- proofFactory: MerkleProofTreeFactory;
16
- /**
17
- * @param {any} value
18
- * @param {MerkleHashCalculator} calculator
19
- */
20
- calculateMerkleRoot(value: any, calculator: MerkleHashCalculator, merkleHashVersion: any): MerkleHashSummary;
21
- /**
22
- * @param {MerkleProofTree} value
23
- * @param {MerkleHashCalculator} calculator
24
- */
25
- calculateMerkleTreeRoot(tree: any, calculator: MerkleHashCalculator, merkleHashVersion: any): MerkleHashSummary;
26
- /**
27
- * @param {MerkleProofTree} proofTree
28
- * @param {MerkleHashCalculator} calculator
29
- */
30
- calculateMerkleRootOfTree(proofTree: MerkleProofTree, calculator: MerkleHashCalculator, merkleHashVersion: any): MerkleHashSummary;
31
- /**
32
- * @param {MerkleProofElement} currentElement
33
- * @param {MerkleHashCalculator} calculator
34
- */
35
- calculateMerkleRootInternal(currentElement: typeof MerkleProofElement, calculator: MerkleHashCalculator, merkleHashVersion: any): any;
36
- /**
37
- * @param {any} value
38
- * @param {MerkleHashCalculator} calculator
39
- */
40
- buildProofTree(value: any, calculator: MerkleHashCalculator, merkleHashVersion: any): MerkleProofTree;
41
- }
42
- import BinaryTreeFactory_1 = require("../binarytreefactory");
43
- import BinaryTreeFactory = BinaryTreeFactory_1.BinaryTreeFactory;
44
- import MerkleProofTreeFactory_1 = require("./merkleprooftreefactory");
45
- import MerkleProofTreeFactory = MerkleProofTreeFactory_1.MerkleProofTreeFactory;
46
- import MerkleHashCalculator_1 = require("../merklehashcalculator");
47
- import MerkleHashCalculator = MerkleHashCalculator_1.MerkleHashCalculator;
48
- import MerkleHashSummary_1 = require("./merklehashcarrier");
49
- import MerkleHashSummary = MerkleHashSummary_1.MerkleHashSummary;
50
- import MerkleProofTree_1 = require("./merkleprooftree");
51
- import MerkleProofTree = MerkleProofTree_1.MerkleProofTree;
52
- import MerkleProofElement_1 = require("./merkleprooftree");
53
- import MerkleProofElement = MerkleProofElement_1.MerkleProofElement;