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 +0,0 @@
1
- {"version":3,"file":"signatures.js","sourceRoot":"","sources":["../../../test/unit/signatures.ts"],"names":[],"mappings":";;;;;;;;;AAAA,OAAO,KAAK,SAAS,MAAM,WAAW,CAAC;AACvC,OAAO,EAAE,MAAM,EAAE,MAAM,QAAQ,CAAC;AAChC,OAAO,EAAE,IAAI,EAAE,UAAU,EAAE,MAAM,iCAAiC,CAAC;AAEnE,OAAO,EAAE,6BAA6B,EAAE,MAAM,mBAAmB,CAAC;AAElE,MAAM,OAAO,GAAG,CAAC,GAAW,EAAE,EAAE;IAC9B,MAAM,CAAC,GAAG,GAAG,CAAC,GAAG,CAAC,CAAC;IACnB,OAAO;QACL,MAAM,EAAE,CAAC,CAAC,MAAM;QAChB,IAAI,EAAE,CAAO,UAAsB,EAAE,EAAE;YACrC,MAAM,MAAM,GAAG,6BAA6B,CAAC,UAAU,EAAE,CAAC,CAAC,CAAC;YAC5D,OAAO,UAAU,CAAC,MAAM,EAAE,CAAC,CAAC,OAAO,CAAC,CAAC;QACvC,CAAC,CAAA;QACD,SAAS,EAAE,CAAC,CAAC,SAAS;KACvB,CAAC;AACJ,CAAC,CAAC;AAEF,MAAM,GAAG,GAAG,CAAC,GAAW,EAAE,EAAE;IAC1B,MAAM,OAAO,GAAG,MAAM,CAAC,IAAI,CAAC,kCAAkC,GAAG,EAAE,CAAC,CAAC;IACrE,MAAM,MAAM,GAAG,MAAM,CAAC,IAAI,CAAC,SAAS,CAAC,eAAe,CAAC,OAAO,CAAC,CAAC,CAAC;IAC/D,MAAM,SAAS,GAAG,MAAM,CAAC,IAAI,CAAC,IAAI,CAAC,MAAM,CAAC,IAAI,CAAC,OAAO,EAAE,MAAM,CAAC,EAAE,OAAO,CAAC,CAAC,CAAC;IAC3E,OAAO,EAAE,MAAM,EAAE,MAAM,EAAE,SAAS,EAAE,SAAS,EAAE,OAAO,EAAE,OAAO,EAAE,CAAC;AACpE,CAAC,CAAC;AAEF,MAAM,UAAU,GAAG,CAAC,KAAa,EAAE,EAAE;IACnC,MAAM,MAAM,GAAa,EAAE,CAAC;IAC5B,KAAK,IAAI,CAAC,GAAG,CAAC,EAAE,CAAC,GAAG,KAAK,EAAE,CAAC,EAAE,EAAE,CAAC;QAC/B,MAAM,CAAC,IAAI,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC,SAAS,CAAC,CAAC;IAChC,CAAC;IACD,OAAO,MAAM,CAAC;AAChB,CAAC,CAAC;AAEF,MAAM,OAAO,GAAG,CAAC,KAAa,EAAE,EAAE;IAChC,MAAM,MAAM,GAAa,EAAE,CAAC;IAC5B,KAAK,IAAI,CAAC,GAAG,CAAC,EAAE,CAAC,GAAG,KAAK,EAAE,CAAC,EAAE,EAAE,CAAC;QAC/B,MAAM,CAAC,IAAI,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC,MAAM,CAAC,CAAC;IAC7B,CAAC;IACD,OAAO,MAAM,CAAC;AAChB,CAAC,CAAC;AAEF,MAAM,OAAO,GAAG,CAAC,KAAa,EAAE,EAAE;IAChC,OAAO,GAAG,CAAC,KAAK,CAAC,CAAC,OAAO,CAAC;AAC5B,CAAC,CAAC;AACF,OAAO,EAAE,OAAO,EAAE,GAAG,EAAE,OAAO,EAAE,OAAO,EAAE,UAAU,EAAE,CAAC"}
@@ -1 +0,0 @@
1
- {"version":3,"file":"validationMocks.js","sourceRoot":"","sources":["../../../../test/unit/validation/validationMocks.ts"],"names":[],"mappings":"AAWA,OAAO,EAAE,UAAU,EAAE,MAAM,iBAAiB,CAAC;AAE7C,MAAM,CAAC,MAAM,WAAW,GAAG,QAAQ,CAAC;AACpC,MAAM,CAAC,MAAM,WAAW,GAAG,EAAE,GAAG,EAAE,OAAO,EAAE,CAAC;AAC5C,MAAM,CAAC,MAAM,mCAAmC,GAAmC;IACjF,GAAG,EAAE,WAAW;IAChB,IAAI,EAAE,WAAW;IACjB,IAAI,EAAE,WAAW;CAClB,CAAC;AACF,MAAM,CAAC,MAAM,wCAAwC,GAAqC;IACxF,mCAAmC;CACpC,CAAC;AACF,MAAM,CAAC,MAAM,sBAAsB,GAAsB;IACvD,GAAG,EAAE,WAAW;IAChB,YAAY,EAAE,WAAW;IACzB,MAAM,EAAE,WAAW;IACnB,MAAM,EAAE,CAAC;IACT,YAAY,EAAE,wCAAwC;IACtD,OAAO,EAAE,WAAW;IACpB,SAAS,EAAE,CAAC,WAAW,CAAC;IACxB,SAAS,EAAE,CAAC;CACb,CAAC;AACF,MAAM,CAAC,MAAM,2BAA2B,GAAwB,CAAC,sBAAsB,CAAC,CAAC;AACzF,MAAM,CAAC,MAAM,sBAAsB,GAAsB,EAAE,EAAE,EAAE,WAAW,EAAE,CAAC;AAC7E,MAAM,CAAC,MAAM,sBAAsB,GAAsB,EAAE,iBAAiB,EAAE,CAAC,EAAE,CAAC;AAClF,MAAM,CAAC,MAAM,iCAAiC,GAAiC;IAC7E,KAAK,EAAE,WAAW;CACnB,CAAC;AACF,MAAM,CAAC,MAAM,sBAAsB,GAAsB;IACvD,IAAI,EAAE,UAAU;IAChB,WAAW,EAAE,UAAU;IACvB,OAAO,EAAE,UAAU;IACnB,eAAe,EAAE,WAAqB;IACtC,OAAO,EAAE,CAAC;CACX,CAAC;AACF,MAAM,CAAC,MAAM,4BAA4B,GAA4B;IACnE,QAAQ,EAAE,WAAW;IACrB,WAAW,EAAE,CAAC;IACd,WAAW,EAAE,WAAW;IACxB,OAAO,EAAE,WAAW;IACpB,SAAS,EAAE,CAAC;IACZ,KAAK,EAAE,WAAW;IAClB,MAAM,EAAE,WAAW;IACnB,MAAM,EAAE,WAAW;CACpB,CAAC;AACF,MAAM,CAAC,MAAM,iCAAiC,GAA8B;IAC1E,4BAA4B;CAC7B,CAAC;AAEF,MAAM,CAAC,MAAM,oBAAoB,GAAoB;IACnD,QAAQ,EAAE,UAAU;IACpB,WAAW,EAAE,CAAC;IACd,WAAW,EAAE,UAAU;IACvB,OAAO,EAAE,UAAU;IACnB,SAAS,EAAE,CAAC;IACZ,KAAK,EAAE,UAAU;IACjB,MAAM,EAAE,UAAU;IAClB,MAAM,EAAE,UAAU;CACnB,CAAC;AAEF,MAAM,CAAC,MAAM,yBAAyB,GAAsB,CAAC,oBAAoB,CAAC,CAAC"}
package/changelog.md DELETED
@@ -1,586 +0,0 @@
1
- Version 1.22.0
2
-
3
- # Changelog
4
-
5
- All notable changes to this project will be documented in this file.
6
-
7
- The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/),
8
- and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).
9
-
10
- ## [x.x.x]
11
-
12
- ### Added
13
-
14
- - The validation functions `isTransactionInfo` and `isTransactionInfoArray`
15
- - The optional input arguments `afterTime` and `signerPubKey` to the client function `getTransactionsInfo`. These input arguments are used as query parameters for the GET api `/transactions/{blockchainRid}/`
16
-
17
- ### Fixed
18
-
19
- - Merkle hash calculation corrected for big arrays
20
- - Changed logging to warn instead of error when the feature endpoint `/config/{blockchainRid}/features` is not available
21
-
22
- ## [1.21.1]
23
-
24
- ### Fixed
25
-
26
- - An issue of the `createClient` functions `sendTransaction` and `signAndSendUniqueTransaction` that did performed a directory chain query to `cm_get_blockchain_api_urls` and that was causing local integration tests to fail, as well as local development (when running local nodes)
27
-
28
- ### Added
29
-
30
- - The type `ClientConfig` to have a new parameter `merkleHashVersion` that can be used to specify the merkle hash version to be used. If not provided, the function will try to get the merkle hash version from the dapp, by using the feature endpoint `/config/{blockchainRid}/features`.
31
-
32
- ## [1.21.0]
33
-
34
- ### Changed
35
-
36
- - Various input types of `Buffer` or `string` to `BufferId` (`Buffer | string`) for function parameters that expected transaction RIDs or blockchain RIDs. The following functions are affected:
37
- - `getTransaction` parameter `transactionRid`
38
- - `getTransactionStatus` parameter `transactionRid`
39
- - `getTransactionInfo` parameter `transactionRid`
40
- - `getTransactionConfirmationLevel` parameter `transactionRid`
41
- - `getConfirmationProof` parameter `txRID`
42
- - `getClusterAnchoringTransactionConfirmation` parameter `transactionRid`
43
- - `getSystemAnchoringTransactionConfirmation` parameter `anchoredTxRid`
44
- - `getGTXFromBufferOrTransactionOrOperation` parameter `blockchainRid`
45
- - `ConfirmationProofException` constructor parameter `transactionRid`
46
- - `createIccfProofTx` parameters `txToProveRid`, `sourceBlockchainRid` and `targetBlockchainRid`
47
- - `getBlockAnchoringTransaction` parameter `txRid`
48
- - `isBlockAnchored` parameter `txRid`
49
- - `getAnchoringClient` parameter `dappBlockchainRid`
50
- - `fetchAndVerifyTransaction` parameter `txToProveRID`
51
- - `composeProofTransactionObject` parameter `sourceBlockchainRid`
52
- - The `client` function `getClusterAnchoringTransactionConfirmation` now takes an additional input argument of `anchoringClient`
53
- - The `client` function `getSystemAnchoringTransactionConfirmation` now takes two additional input arguments of `anchoringClient` and `systemAnchoringChainRid`
54
- - Changed the response type of the function `getSystemAnchoringChain` to now return `Buffer` instead of `Buffer | null`. The function will instead
55
- throw a `SystemChainException` instead if `null` is returned from the query, informing the user an invalid client was provided.
56
- - The `client` function `getClusterAnchoringTransactionConfirmation` now takes an additional input argument of `anchoringClient`
57
- - The `client` function `getSystemAnchoringTransactionConfirmation` now takes two additional input arguments of `anchoringClient` and `systemAnchoringChainRid`
58
- - Changed the response type of the function `getSystemAnchoringChain` to now return `Buffer` instead of `Buffer | null`. The function will instead
59
- throw a `SystemChainException` instead if `null` is returned from the query, informing the user an invalid client was provided.
60
- - Updated the types `ClientConfig` and `NetworkSettings` to contain separate status polling configurations (interval and count),
61
- allowing for different polling setups for dapp, cluster and system requests
62
- - Updated the polling functions `getBlockAnchoringTransaction` and `awaitGetAnchoringTransactionForBlockRid` to receive the correct status polling properties
63
- - The function `checkDigestSignature` to expect a `Buffer` signature instead of `Buffer` or `undefined`.
64
-
65
- ### Added
66
-
67
- - The function `ensureString` that receives a `BufferId` and returns a hex string in upper case
68
- - Updated the interface `TransactionReceipt` to contain the optional parameters `clusterAnchoringClientBrid` and `systemAnchoringClientBrid` that are populated
69
- once a transaction is anchored in Cluster Anchoring Chain and System Anchoring Chain
70
- - The utility function `getAnchoringClientAndSystemChainRid` that returns the type `AnchoringClientAndSystemBrid` providing it with a dapp `client`.
71
- This utility function should be used to provide the correct inputs for the client functions `clusterAnchoringClientBrid` and `systemAnchoringClientBrid`
72
- - The type `AnchoringClientAndSystemBrid` that returns an `anchoringClient` and the `systemAnchoringChainBridString`
73
- - The types `TransactionsCount` and `TransactionConfirmationProof`
74
- - Several zod validation functions, to be used for the api responses under the type `ResponseObject` and property `rspBody`
75
- - The function `getSystemAnchoringTransaction` that returns a system anchored transaction or null if the cluster anchoring transaction is not anchored in the system anchoring chain
76
- - The client function `getAnchoringStatusForBlockRid` that returns `BlockAnchoringState`
77
- - The type `BlockAnchoringState` to be used as return type for `getAnchoringStatusForBlockRid`
78
- - Created the utility function `setStatusPolling` that can be used to initialize default status polling properties if not specified
79
- - The type `StatusPolling` to be used for the dapp, cluster and system polling config in the types `ClientConfig` and `NetworkSettings`
80
- - Promi event enums `TransactionEvent` with values `ClusterAnchorConfirmed`, `SystemAnchorConfirmed`, `DappConfirmed`, `DappReceived`, `Signed`
81
- - Promi events are emitted in the order of the transaction lifecycle/confirmation steps
82
-
83
- ### Fixed
84
-
85
- - The `client` function `getClusterAnchoringTransactionConfirmation` now takes an additional input argument of `anchoringClient`
86
- - The `client` function `getSystemAnchoringTransactionConfirmation` now takes two additional input arguments of `anchoringClient` and `systemAnchoringChainRid`
87
- - Changed the response type of the function `getSystemAnchoringChain` to now return `Buffer` instead of `Buffer | null`. The function will instead
88
- throw a `SystemChainException` instead if `null` is returned from the query, informing the user an invalid client was provided.
89
- - Changed the generic `ResponseObject` to a strict type. The property `rspBody` is of type `unknown` and it is validated for each different case
90
- using zod validation functions for the expected type
91
- - An issue in the function `checkGTXSignatures` that will now return `false` if the `gtx.signatures` array is empty or not an array
92
-
93
- ### Removed
94
-
95
- - The types `GetBlocksResponse` and `GetBlockResponse`
96
- - The promi event "sent" is no longer emitted
97
-
98
- ## [1.20.2]
99
-
100
- ### Fixed
101
-
102
- - Resolved an issue where retrieving an anchoring transaction and its ICCF proof could result in mismatch if the queries were made against unsynchronized nodes
103
-
104
- ## [1.20.1]
105
-
106
- ### Fixed
107
-
108
- - An issue with the escaping of characters in the generated package.json content of the esm build
109
- - Added @types/bn.js as runtime dependencies to fix the missing decleration one gets after installing postchain-client and trying to transpile from typescript to javascript
110
-
111
- ## [1.20.0]
112
-
113
- ### Added
114
-
115
- - The function nullable `getTransactionConfirmationLevel` in `createClient` that expects a `transactionRid` and returns a `TransactionReceipt`
116
- that indicates the last successful confirmation of a transaction, as well as an anchoring transaction if the transaction is added in a block (Cluster Anchoring Confirmation).
117
- - The function `getClusterAnchoringTransactionConfirmation` in `createClient`, that given a `transactionRid` will return an anchoring transaction
118
- - Added `rollup-plugin-visualizer` to the Rollup configuration for bundle analysis.
119
- - Added tests coverage scripts in package.json
120
- - Created the client function `getSystemAnchoringTransactionConfirmation` that returns a system anchored transaction based on the provided anchored transaction rid
121
- - Added the util function `getSystemAnchoringChain` that queries the directory client and returns the system anchoring chain rid
122
- - Extended the logic of the function `sendTransaction`, `signAndSendUniqueTransaction` and `getTransactionConfirmationLevel` to also include system anchoring cluster confirmation
123
- - Added the type `BufferId = string | Buffer` that also supports `ensureBuffer`
124
-
125
- ### Fixed
126
-
127
- - A bug in the function `getAnchoringTransactionForBlockRid` that was not handling nullable response, given the query
128
- `get_anchoring_transaction_for_block_rid` can return null
129
- - Moved validation tests from the `src/blockchainClient/validation` to `test/unit/validation`
130
- - Fixed a bug in the function `getAnchoringClient` that did not set the created client network settings to the one provided as input argument to the function
131
-
132
- ### Changed
133
-
134
- - Extended the `createClient` functions `sendTransaction` and `signAndSendUniqueTransaction` to accept a new input parameter `confirmationLevel`
135
- that will resolve the promise based on the configurable confirmation selection and will emit a “sent” promiEvent with the confirmation status in each confirmation step
136
- - Extended the parameters of the types `ClientConfig` and `NetworkSettings` to contain `directoryChainRid`
137
- - Extended the function `getBlockAnchoringTransaction` to retrieve an anchoring transaction with polling
138
- - Updated the callback type of `getTransactionStatus` to `RestClientCallback<TransactionReceipt> | RestClientCallback<StatusObject>`
139
- - Updated the callback type of `getTransactionConfirmationLevel` to `RestClientCallback<StatusObject | TransactionReceipt>`
140
- - Updated the callback type of `getClusterAnchoringTransactionConfirmation` to `RestClientCallback<TransactionReceipt>`
141
- - Updated the rest client `postTransaction` function, to support binary formatted transactions
142
-
143
- ## [1.19.1]
144
-
145
- ### Fixed
146
-
147
- - bumped secp256k1 dependency to 4.0.4, to fix vulnerability
148
-
149
- ## [1.19.0]
150
-
151
- ### Added
152
-
153
- - added new request strategy `Query Majority`. (See README for more information)
154
- - new `getBlocks` method that has additional query params to search for blocks
155
-
156
- ### Fixed
157
-
158
- - bug in decodeTransactionToGtx that occurs when data has Bigint values
159
-
160
- ### Deprecated
161
-
162
- - `getBlocksInfo` method in `IClient` interface. Use `getBlocks` instead.
163
-
164
- ## [1.18.0]
165
-
166
- ### Changed
167
-
168
- - release pipeline
169
- - replace node.js server with MSW in iccf unit tests
170
- - replace node.js server with MSW in restClient unit tests
171
- - replace node.js server with MSW in blockChainClient utils' unit tests
172
-
173
- ### Added
174
-
175
- - the possibliity to set `useStickyNode` in the config of `blockchainClient` and `restClient`.
176
- - release guideline
177
- - dumpGtx and dumpGtv util functions for debugging purposes. This functions transforms a GTX or GTV object into a human-readable string.
178
-
179
- ## [1.17.0]
180
-
181
- ### Added
182
-
183
- - `getAppStructure` method to `IClient` interface that returns app structure in JSON format
184
-
185
- ### Changed
186
-
187
- - Husky will no longer install in CI
188
- - Added deprecation annotation as a function signature overload for `setLogLevel`
189
- - pipelines for version release
190
- - rework ResponseObject and add generic types TData, TErorr to it
191
- - add RetryRequestProps type to RetryRequest and singleEndpoint methods
192
-
193
- ### Fixed
194
-
195
- - typos across all app
196
- - Updates wrong types for nodeUrl and nodeUrlPool in MissingNodeUrlError
197
-
198
- ## [1.16.1]
199
-
200
- ### Added
201
-
202
- - `convertToRellOperation` is now part of pcl public API
203
-
204
- ## [1.16.0]
205
-
206
- ### Changed
207
-
208
- - Separated non-backend dependent functions from interface `IClient`. Functions `getTransactionRid`, `encodeTransaction`, and `decodeTransactionToGtx` have been extracted and are now separate utility functions.
209
- - Renamed `getTransactionRid` to `calculateTransactionRid` for clarity. Its input type has been changed to `RawGtxBody`. Conversion functions have been introduced to facilitate this transition.
210
- - Modified the input type of `encodeTransaction` to `GTX`.
211
-
212
- - Use PascalCase for types and class names:
213
- - `getTransactionRidException` -> `GetTransactionRidException`.
214
- - `transactionInfoInBlockResponse`-> `TransactionInfoInBlockResponse`.
215
- - `transactionInfoInBlock` -> `TransactionInfoInBlock`.
216
- - change `npm install` to `npm ci` command
217
-
218
- - split unit tests for `sendTransaction` to separate file. Replace Express mock server with MSW.
219
- - rework validation for client and server errors. Now it covers all 4xx and status codes.
220
- - Replace node server with MSW for unit tests in blockchainClient.test.ts.
221
-
222
- ### Added
223
-
224
- - function for fetching information about the latest block for a chain. The funcition is added to the `IClient` interface and is called `getLatestBlock`.
225
- - verify if changelog changed in pipeline to prevent merging branch without updating it
226
- - create a custom error which include the http status code. Exported as `CustomError`.
227
- - automate integration tests to get BRID from running test node.
228
- - strictNullChecks in tsconfig.json to provide better type checking
229
-
230
- ### Fixed
231
-
232
- - bug in retryRequest function which in some cases treated https errors as a successfull request.
233
-
234
- ## [1.15.2]
235
-
236
- ### Fixed
237
-
238
- - promiEvent ts error in npm package
239
-
240
- ## [1.15.1]
241
-
242
- ### Changed
243
-
244
- - Removed library dependency: `web3-core-promievent`.
245
- - The type `Web3PromiEvent` is now exported publicly.
246
-
247
- ## [1.15.0]
248
-
249
- ### Changed
250
-
251
- - The types `RawGtxBody` and `RawGtxOp`are now exported publicly.
252
- - function `getDigestToSignFromRawGtxBody`is now exported publicly.
253
- - Changes `SignatureProvider` type callback method `sign()` to provide a paramater of type `rawGtxBody` instead of a `digest`. This change is implemented to make it possible to review the content of a transaction before signing.
254
-
255
- ## [1.14.0]
256
-
257
- ### Added
258
-
259
- - better input validation for blockChainClient
260
-
261
- ### Fixed
262
-
263
- - logLevel=ERROR will now only logs errors
264
- - getConfirmationProof will now properly retrieve the transaction index
265
-
266
- ## [1.13.0]
267
-
268
- ### Added
269
-
270
- - Both `sendTransaction` and `signAndSendUniqueTransaction` now takes a new flag parameter `doStatusPolling` which can be set to either `true` or `false`. Setting the flag to `false` will prevent any further automatic status polling requests from being sent for the transaction. The method will in this case return with a final transaction status of `waiting`.
271
- - logLevel can be enum with values: [DEBUG, INFO, WARNING, ERROR]
272
- - logger can be configured through node env i.e. LOG_LEVEL=DEBUG
273
- - add `disable` method to logger
274
- - Adds a `createStubClient` function returning an `IClient`. All methods returning a `Promise` return a rejected `Promise`, all methods which return `Web3PromiEvent` return a rejected `Web3PromiEvent` and other methods just throw an `Error`.
275
-
276
- ### Fixed
277
-
278
- - bug in return type of `getAnchoringTransactionForBlockRid`.
279
- - enhanced the README by providing a more detailed guide on creating a client, including an expanded description of its configuration settings.
280
-
281
- ## [1.12.0]
282
-
283
- ### Added
284
-
285
- - Node URLs in the pool will be marked as 'unreachable' if a request returns a 50\* status. This feature, part of FailoverConfig, suspends a node's usage for a default duration of 30,000 milliseconds (5 minutes). Clients can be configure during initialization for tailored duration.
286
-
287
- ## [1.11.0]
288
-
289
- ### Added
290
-
291
- - Adds client method `getBlockInfo` to enable the user to fetch the data for a single block by providing either `height` or `txRid`.
292
-
293
- ## [1.10.0]
294
-
295
- ### Changed
296
-
297
- - `pollingInterval` has changed name to `statusPollInterval` in `NetworkSettings`. The reason is to easier understand what the polling interval is used for.
298
- - `sendTransaction` and `signAndSendUniqueTransaction` continue polling the status of the transaction if the last returned status was `unknown`. Previously only status `waiting` triggered new fetching. To avoid polling infinitely, a maximum number has been added. It is configurable when creating a client, see section Added.
299
- - remove index signature in exported type `GTX`.
300
-
301
- ```
302
- export type GTX = {
303
- [x: string]: unknown; // <---- removed
304
- blockchainRid: Buffer;
305
- operations: RellOperation[];
306
- signers: Buffer[];
307
- signatures?: Buffer[];
308
- };
309
- ```
310
-
311
- ### Added
312
-
313
- - possibility to configure the maximum number of times `sendTransaction` and`signAndSendUniqueTransaction` should poll for the status before quitting. It is included in `NetworkSettings` and is called `statusPollCount`. Default value is 20.
314
-
315
- ### Fixed
316
-
317
- - `@types/node` as `devDependencies` instead of `dependencies`.
318
-
319
- ## [1.9.0]
320
-
321
- ### Added
322
-
323
- - add the package `events` as peer-dependency. Solves users issue of missing `events` when using the lib in a non Node environment.
324
- - function in IClient for fetching blocks info for a chain. It is called `getBlocksInfo`.
325
-
326
- ### Fixed
327
-
328
- - correct small mistakes in README.
329
- - fix bug in function `getDigestToSignFromBody`. It should take an input as type `RawGtxBody` instead of `GtxBody`. The function is renamed to `getDigestToSignFromRawGtxBody`.
330
- - correct mistake in README in the instructions of a function called `askUserBToSign`.
331
-
332
- ## [1.8.1]
333
-
334
- ### Fixed
335
-
336
- - export enum `FailoverStrategy`.
337
-
338
- ## [1.8.0]
339
-
340
- ### Changed
341
-
342
- - Type called `KeyPair` changed from having `pubKey`as optional to being mandatory.
343
- - `signTransaction` and `signAndSendUniqueTransaction` no longer accept `signMethod` as type `PrivKey`, instead it have to be a `KeyPair` or `SignatureProvider`.
344
- - Changed plugin `commonJS()` of ESM build-step in `Rollup.config.mjs` to transform mixed modules to ESM modules.
345
- - Moved up plugin `resolve()` of ESM build-step in `Rollup.config.mjs` to top of plugin list.
346
-
347
- ### Fixed
348
-
349
- - randomly pick node from `directoryNodeUrlPool` when querying for the brid of directory chain.
350
- - `txRejectedError` to have public properties.
351
-
352
- ## [1.7.1] - 2023-09-28
353
-
354
- ### Fixed
355
-
356
- - When using `QueryObject`, you must specify return type.
357
- - Use type `DictPair` instead of `QueryArguments` alias.
358
-
359
- ## [1.7.0] - 2023-09-27
360
-
361
- ### Fixed
362
-
363
- - Change order of generic types of `query` to `query<TReturn, TArgs>`.
364
-
365
- ### Added
366
-
367
- - Generic type of QueryObject, `QueryObject<TReturn, TArgs>`.
368
-
369
- ## [1.6.0] - 2023-09-22
370
-
371
- ### Added
372
-
373
- - `BlockchainUrlUndefinedException` exported.
374
- - in IClient, `getTransactionsInfo` which fetch info about transactions on the chain.
375
- - in IClient, `getTransactionInfo` which fetch info about a transaction.
376
- - in IClient, `getTransactionCount` which fetch number of successful transactions on the chain.
377
-
378
- ### Fixed
379
-
380
- - bug in `TxRejectedError`, the error will print the rejection reason if it exist. From the error it is possible to get `shortReason`, `rellLine`, and `operation` (used like `error.operation`).
381
- - updating to camelCase for the abbreviations. blockchainRID -> blockchainRid.
382
-
383
- ## [1.5.10] - 2023-09-15
384
-
385
- ### Added
386
-
387
- - Ability to choose a failover strategy for a client. The following three are available: `AbortOnError`, `TryNextOnError`, `SingleEndpoint`. A description can be found in the README.
388
-
389
- ### Fixed
390
-
391
- - encode txProof and anchroingProof that are included as arguments in iccf_proof operation
392
- - remove check for only blockchainRid when initialize client, new flow either blockchainRid or blockchainIid need to exist.
393
-
394
- ## [1.5.9] - 2023-08-30
395
-
396
- ### Fixed
397
-
398
- - Set content-type to octet-stream when making post requests
399
-
400
- ## [1.5.8] - 2023-08-25
401
-
402
- ### Added
403
-
404
- - Abillity to check if transaction is anchored, `isBlockAnchored`, `getBlockAnchoringTransaction`,
405
- - create client configured to anchoring chain, `getAnchoringClient`
406
- - export ICCF types and errors
407
- - improved error handling in get requests. When status code is not 200, it returns error
408
- containing information from servers error message.
409
-
410
- ## [1.5.7] - 2023-08-15
411
-
412
- ### Added
413
-
414
- - Export custom errors
415
- - ICCF experimental feature, exported function called `createIccfProofTx`
416
-
417
- ## [1.5.6] - 2023-07-07
418
-
419
- ### Fixed
420
-
421
- - Add type `ReadonlyArray<RawGtv>` to union of `RawGtv`
422
- - uncought promise in send transaction
423
-
424
- ## [1.5.5] - 2023-07-03
425
-
426
- ### Fixed
427
-
428
- - Sort string maps before encoding
429
- - Because of postchain update, add HTTP header to accept response as binary instead of JSON
430
-
431
- ## [1.5.4] - 2023-06-28
432
-
433
- ### Fixed
434
-
435
- - Explicit import of Buffer
436
- - Export type IClient
437
- - Fix bug when using client initialized with blockchainID
438
-
439
- ## [1.5.3] - 2023-06-22
440
-
441
- ### Fixed
442
-
443
- - Buffer as peer dependency
444
-
445
- ## [1.5.2] - 2023-06-20
446
-
447
- ### Fixed
448
-
449
- - Export commonly used types
450
-
451
- ## [1.5.1] - 2023-06-20
452
-
453
- ### Fixed
454
-
455
- - Move lodash from devDependency to dependency
456
-
457
- ## [1.5.0] - 2023-06-14
458
-
459
- ### Added
460
-
461
- - support for negative numbers
462
-
463
- ## [1.4.0] - 2023-06-14
464
-
465
- ### Added
466
-
467
- - simplifyed API, exported as `createClient` from `index.js`, simplifies usage by reducing boilerplate code for users. Its design focuses on streamlining the API and minimizing setup complexities, resulting in a more user-friendly experience.
468
-
469
- ## [1.3.2] - 2023-04-28
470
-
471
- ### Fixed
472
-
473
- - bug when logger prints a bigInt
474
-
475
- ## [1.3.1] - 2023-04-26
476
-
477
- ### Fixed
478
-
479
- - bug when sending big integer in transaction
480
-
481
- ## [1.3.0] - 2023-04-19
482
-
483
- ### Added
484
-
485
- - bigInt support
486
-
487
- ## [1.2.0] - 2023-03-27
488
-
489
- ### Added
490
-
491
- - integration tests for merkle root calculation
492
-
493
- ### Changed
494
-
495
- - `newSignatureProvider()` now has keyPair as optional argument. If no keyPair is provided it will instead be generated.
496
-
497
- ## [1.1.0] - 2023-02-17
498
-
499
- ### Added
500
-
501
- - signatureProvider interface and newSignatureProvider()
502
-
503
- ### Removed
504
-
505
- - `RestClient.getConfirmationProof` function
506
-
507
- ### Changed
508
-
509
- - `ITransaction.sign` now can be used with a single argument, which can implement the signatureProvider interface or be the privKey. This function is now async
510
- - `GTX.sign` now has two overloads, both of which are async. The GTX is now passed as first parameter.
511
- - `RestClient.query`and `GtxClient.query` now has two overloads, the new signature takes the query name and query arguments as separate inputs. The old signature is marked as depricated an will be removed in the future.
512
-
513
- ### Fixed
514
-
515
- - `gtx` is now correctly typed in both `GTX.sign` and `GTX.addSignature`
516
-
517
- ## [1.0.3] - 2023-02-03
518
-
519
- ### Added
520
-
521
- - Compatible with ESM, CommonJS and UMD
522
- - Boolean support
523
-
524
- ### Changed
525
-
526
- - A query uses postchain endpoint called `query_gtv` which means that data is sent and recieved in GTV-encoded format.
527
- - Release notes now in changelog file.
528
- - Node 18 required when using this library in a Node environment.
529
-
530
- ## [1.0.2] - 2022-12-23
531
-
532
- ### Added
533
-
534
- - DecodeValueGtx ensures type of RawGtx before return. (commit missed in last release)
535
-
536
- ### Changed
537
-
538
- - Rename export from chromiaClientProvider to chromiaClient.
539
-
540
- ## [1.0.1] - 2022-12-21
541
-
542
- ### Changed
543
-
544
- - Update types of input parameters and return types of the following functions:
545
-
546
- - encodeValue (serialization.ts)
547
- - decodeValue (serialization.ts)
548
- - gtvHash (src/gtv/index.ts)
549
-
550
- - Set default logging to be less verbose
551
-
552
- ### Fixed
553
-
554
- - Bug in function blockchainConnection (chromiaClientProvider.ts)
555
-
556
- ## [1.0.0] - 2022-12-09
557
-
558
- ### Added
559
-
560
- - New logger accessible in index.ts.
561
- - Enable the client to connect to a blockchain through multiple nodes running the blockchain.
562
- - Load balancing by randomly distributing transactions and queries between nodes.
563
- - Retry policy added for request to the blockchain.
564
- - Enables you to discover the nodes running your blockchain by querying D1 with your dapp´s blockchain RID. Read more in the Chromia client providers [Readme](./src/chromia/README.md).
565
-
566
- ### Changed
567
-
568
- - Previously a rest client was initialized with one string containing the address of the node running your blockchain. Now an instance of the rest client is initiated with a list of strings representing the addresses of the nodes where your dapp is running.
569
- - Previously a rest client query was called with two parameters; queryName and queryObject. Now this call only takes one parameter called queryObject, which is defined as:
570
-
571
- ```javascript
572
- {
573
- type: string;
574
- [Arg
575
- :
576
- string
577
- ]:
578
- RawGtv;
579
- }
580
- ```
581
-
582
- where type is what previously was called query name.
583
-
584
- ## [0.\*.*]
585
-
586
- Early version of the postchain-client written in javascript.
File without changes