nme-library 2.0.0-RC4

Sign up to get free protection for your applications and to get access to all the features.
Files changed (388) hide show
  1. package/4xhj3q2e.cjs +1 -0
  2. package/LICENSE +21 -0
  3. package/README.md +30 -0
  4. package/dist/index.d.ts +4 -0
  5. package/dist/index.js +38 -0
  6. package/dist/index.js.map +1 -0
  7. package/dist/src/NEMLibrary.d.ts +25 -0
  8. package/dist/src/NEMLibrary.js +69 -0
  9. package/dist/src/NEMLibrary.js.map +1 -0
  10. package/dist/src/infrastrcture.d.ts +13 -0
  11. package/dist/src/infrastrcture.js +44 -0
  12. package/dist/src/infrastrcture.js.map +1 -0
  13. package/dist/src/infrastructure/AccountHttp.d.ts +204 -0
  14. package/dist/src/infrastructure/AccountHttp.js +415 -0
  15. package/dist/src/infrastructure/AccountHttp.js.map +1 -0
  16. package/dist/src/infrastructure/AccountListener.d.ts +20 -0
  17. package/dist/src/infrastructure/AccountListener.js +71 -0
  18. package/dist/src/infrastructure/AccountListener.js.map +1 -0
  19. package/dist/src/infrastructure/AllTransactionsPageable.d.ts +1 -0
  20. package/dist/src/infrastructure/AllTransactionsPageable.js +35 -0
  21. package/dist/src/infrastructure/AllTransactionsPageable.js.map +1 -0
  22. package/dist/src/infrastructure/AssetHttp.d.ts +36 -0
  23. package/dist/src/infrastructure/AssetHttp.js +85 -0
  24. package/dist/src/infrastructure/AssetHttp.js.map +1 -0
  25. package/dist/src/infrastructure/BlockHttp.d.ts +14 -0
  26. package/dist/src/infrastructure/BlockHttp.js +54 -0
  27. package/dist/src/infrastructure/BlockHttp.js.map +1 -0
  28. package/dist/src/infrastructure/BlockchainListener.d.ts +24 -0
  29. package/dist/src/infrastructure/BlockchainListener.js +93 -0
  30. package/dist/src/infrastructure/BlockchainListener.js.map +1 -0
  31. package/dist/src/infrastructure/ChainHttp.d.ts +23 -0
  32. package/dist/src/infrastructure/ChainHttp.js +68 -0
  33. package/dist/src/infrastructure/ChainHttp.js.map +1 -0
  34. package/dist/src/infrastructure/ConfirmedTransactionListener.d.ts +20 -0
  35. package/dist/src/infrastructure/ConfirmedTransactionListener.js +76 -0
  36. package/dist/src/infrastructure/ConfirmedTransactionListener.js.map +1 -0
  37. package/dist/src/infrastructure/HarvestInfoPageable.d.ts +1 -0
  38. package/dist/src/infrastructure/HarvestInfoPageable.js +52 -0
  39. package/dist/src/infrastructure/HarvestInfoPageable.js.map +1 -0
  40. package/dist/src/infrastructure/HttpEndpoint.d.ts +15 -0
  41. package/dist/src/infrastructure/HttpEndpoint.js +132 -0
  42. package/dist/src/infrastructure/HttpEndpoint.js.map +1 -0
  43. package/dist/src/infrastructure/IncomingTransactionsPageable.d.ts +1 -0
  44. package/dist/src/infrastructure/IncomingTransactionsPageable.js +29 -0
  45. package/dist/src/infrastructure/IncomingTransactionsPageable.js.map +1 -0
  46. package/dist/src/infrastructure/Listener.d.ts +14 -0
  47. package/dist/src/infrastructure/Listener.js +101 -0
  48. package/dist/src/infrastructure/Listener.js.map +1 -0
  49. package/dist/src/infrastructure/NamespaceHttp.d.ts +27 -0
  50. package/dist/src/infrastructure/NamespaceHttp.js +78 -0
  51. package/dist/src/infrastructure/NamespaceHttp.js.map +1 -0
  52. package/dist/src/infrastructure/NamespacesPageable.d.ts +1 -0
  53. package/dist/src/infrastructure/NamespacesPageable.js +28 -0
  54. package/dist/src/infrastructure/NamespacesPageable.js.map +1 -0
  55. package/dist/src/infrastructure/NodeHttp.d.ts +45 -0
  56. package/dist/src/infrastructure/NodeHttp.js +116 -0
  57. package/dist/src/infrastructure/NodeHttp.js.map +1 -0
  58. package/dist/src/infrastructure/OutgoingTransactionsPageable.d.ts +1 -0
  59. package/dist/src/infrastructure/OutgoingTransactionsPageable.js +59 -0
  60. package/dist/src/infrastructure/OutgoingTransactionsPageable.js.map +1 -0
  61. package/dist/src/infrastructure/Pageable.d.ts +10 -0
  62. package/dist/src/infrastructure/Pageable.js +55 -0
  63. package/dist/src/infrastructure/Pageable.js.map +1 -0
  64. package/dist/src/infrastructure/TransactionHttp.d.ts +20 -0
  65. package/dist/src/infrastructure/TransactionHttp.js +68 -0
  66. package/dist/src/infrastructure/TransactionHttp.js.map +1 -0
  67. package/dist/src/infrastructure/UnconfirmedTransactionListener.d.ts +20 -0
  68. package/dist/src/infrastructure/UnconfirmedTransactionListener.js +76 -0
  69. package/dist/src/infrastructure/UnconfirmedTransactionListener.js.map +1 -0
  70. package/dist/src/infrastructure/account/AccountHistoricalDataViewModelDTO.d.ts +1 -0
  71. package/dist/src/infrastructure/account/AccountHistoricalDataViewModelDTO.js +26 -0
  72. package/dist/src/infrastructure/account/AccountHistoricalDataViewModelDTO.js.map +1 -0
  73. package/dist/src/infrastructure/account/AccountImportanceViewModelDTO.d.ts +1 -0
  74. package/dist/src/infrastructure/account/AccountImportanceViewModelDTO.js +26 -0
  75. package/dist/src/infrastructure/account/AccountImportanceViewModelDTO.js.map +1 -0
  76. package/dist/src/infrastructure/account/AccountInfoDTO.d.ts +10 -0
  77. package/dist/src/infrastructure/account/AccountInfoDTO.js +26 -0
  78. package/dist/src/infrastructure/account/AccountInfoDTO.js.map +1 -0
  79. package/dist/src/infrastructure/account/AccountMetaDataDTO.d.ts +1 -0
  80. package/dist/src/infrastructure/account/AccountMetaDataDTO.js +26 -0
  81. package/dist/src/infrastructure/account/AccountMetaDataDTO.js.map +1 -0
  82. package/dist/src/infrastructure/account/AccountMetaDataPairDTO.d.ts +1 -0
  83. package/dist/src/infrastructure/account/AccountMetaDataPairDTO.js +26 -0
  84. package/dist/src/infrastructure/account/AccountMetaDataPairDTO.js.map +1 -0
  85. package/dist/src/infrastructure/account/AccountPrivateKeyTransactionsPageDTO.d.ts +1 -0
  86. package/dist/src/infrastructure/account/AccountPrivateKeyTransactionsPageDTO.js +26 -0
  87. package/dist/src/infrastructure/account/AccountPrivateKeyTransactionsPageDTO.js.map +1 -0
  88. package/dist/src/infrastructure/account/HarvestInfoDTO.d.ts +1 -0
  89. package/dist/src/infrastructure/account/HarvestInfoDTO.js +26 -0
  90. package/dist/src/infrastructure/account/HarvestInfoDTO.js.map +1 -0
  91. package/dist/src/infrastructure/account/KeyPairViewModelDTO.d.ts +1 -0
  92. package/dist/src/infrastructure/account/KeyPairViewModelDTO.js +26 -0
  93. package/dist/src/infrastructure/account/KeyPairViewModelDTO.js.map +1 -0
  94. package/dist/src/infrastructure/account/PrivateKeyDTO.d.ts +1 -0
  95. package/dist/src/infrastructure/account/PrivateKeyDTO.js +26 -0
  96. package/dist/src/infrastructure/account/PrivateKeyDTO.js.map +1 -0
  97. package/dist/src/infrastructure/asset/MosaicDTO.d.ts +1 -0
  98. package/dist/src/infrastructure/asset/MosaicDTO.js +26 -0
  99. package/dist/src/infrastructure/asset/MosaicDTO.js.map +1 -0
  100. package/dist/src/infrastructure/asset/MosaicDefinitionDTO.d.ts +1 -0
  101. package/dist/src/infrastructure/asset/MosaicDefinitionDTO.js +26 -0
  102. package/dist/src/infrastructure/asset/MosaicDefinitionDTO.js.map +1 -0
  103. package/dist/src/infrastructure/asset/MosaicDefinitionMetaDataPairDTO.d.ts +1 -0
  104. package/dist/src/infrastructure/asset/MosaicDefinitionMetaDataPairDTO.js +26 -0
  105. package/dist/src/infrastructure/asset/MosaicDefinitionMetaDataPairDTO.js.map +1 -0
  106. package/dist/src/infrastructure/asset/MosaicIdDTO.d.ts +1 -0
  107. package/dist/src/infrastructure/asset/MosaicIdDTO.js +26 -0
  108. package/dist/src/infrastructure/asset/MosaicIdDTO.js.map +1 -0
  109. package/dist/src/infrastructure/asset/MosaicLevyDTO.d.ts +1 -0
  110. package/dist/src/infrastructure/asset/MosaicLevyDTO.js +26 -0
  111. package/dist/src/infrastructure/asset/MosaicLevyDTO.js.map +1 -0
  112. package/dist/src/infrastructure/asset/MosaicPropertyDTO.d.ts +8 -0
  113. package/dist/src/infrastructure/asset/MosaicPropertyDTO.js +26 -0
  114. package/dist/src/infrastructure/asset/MosaicPropertyDTO.js.map +1 -0
  115. package/dist/src/infrastructure/blockchain/BlockChainScoreDTO.d.ts +1 -0
  116. package/dist/src/infrastructure/blockchain/BlockChainScoreDTO.js +26 -0
  117. package/dist/src/infrastructure/blockchain/BlockChainScoreDTO.js.map +1 -0
  118. package/dist/src/infrastructure/blockchain/BlockDTO.d.ts +6 -0
  119. package/dist/src/infrastructure/blockchain/BlockDTO.js +26 -0
  120. package/dist/src/infrastructure/blockchain/BlockDTO.js.map +1 -0
  121. package/dist/src/infrastructure/blockchain/BlockHeightDTO.d.ts +1 -0
  122. package/dist/src/infrastructure/blockchain/BlockHeightDTO.js +26 -0
  123. package/dist/src/infrastructure/blockchain/BlockHeightDTO.js.map +1 -0
  124. package/dist/src/infrastructure/blockchain/ExplorerBlockViewModelDTO.d.ts +1 -0
  125. package/dist/src/infrastructure/blockchain/ExplorerBlockViewModelDTO.js +26 -0
  126. package/dist/src/infrastructure/blockchain/ExplorerBlockViewModelDTO.js.map +1 -0
  127. package/dist/src/infrastructure/debug/AuditCollectionDTO.d.ts +22 -0
  128. package/dist/src/infrastructure/debug/AuditCollectionDTO.js +26 -0
  129. package/dist/src/infrastructure/debug/AuditCollectionDTO.js.map +1 -0
  130. package/dist/src/infrastructure/debug/NemAsyncTimerVisitorDTO.d.ts +1 -0
  131. package/dist/src/infrastructure/debug/NemAsyncTimerVisitorDTO.js +26 -0
  132. package/dist/src/infrastructure/debug/NemAsyncTimerVisitorDTO.js.map +1 -0
  133. package/dist/src/infrastructure/debug/NisNodeInfoDTO.d.ts +1 -0
  134. package/dist/src/infrastructure/debug/NisNodeInfoDTO.js +26 -0
  135. package/dist/src/infrastructure/debug/NisNodeInfoDTO.js.map +1 -0
  136. package/dist/src/infrastructure/debug/TimeSynchronizationResultDTO.d.ts +1 -0
  137. package/dist/src/infrastructure/debug/TimeSynchronizationResultDTO.js +26 -0
  138. package/dist/src/infrastructure/debug/TimeSynchronizationResultDTO.js.map +1 -0
  139. package/dist/src/infrastructure/namespace/NamespaceDTO.d.ts +1 -0
  140. package/dist/src/infrastructure/namespace/NamespaceDTO.js +26 -0
  141. package/dist/src/infrastructure/namespace/NamespaceDTO.js.map +1 -0
  142. package/dist/src/infrastructure/namespace/NamespaceMetaDataPairDTO.d.ts +1 -0
  143. package/dist/src/infrastructure/namespace/NamespaceMetaDataPairDTO.js +26 -0
  144. package/dist/src/infrastructure/namespace/NamespaceMetaDataPairDTO.js.map +1 -0
  145. package/dist/src/infrastructure/node/ApplicationMetaDataDTO.d.ts +1 -0
  146. package/dist/src/infrastructure/node/ApplicationMetaDataDTO.js +26 -0
  147. package/dist/src/infrastructure/node/ApplicationMetaDataDTO.js.map +1 -0
  148. package/dist/src/infrastructure/node/BootNodeRequestDTO.d.ts +1 -0
  149. package/dist/src/infrastructure/node/BootNodeRequestDTO.js +26 -0
  150. package/dist/src/infrastructure/node/BootNodeRequestDTO.js.map +1 -0
  151. package/dist/src/infrastructure/node/CommunicationTimeStampsDTO.d.ts +1 -0
  152. package/dist/src/infrastructure/node/CommunicationTimeStampsDTO.js +26 -0
  153. package/dist/src/infrastructure/node/CommunicationTimeStampsDTO.js.map +1 -0
  154. package/dist/src/infrastructure/node/ExtendedNodeExperiencePairDTO.d.ts +1 -0
  155. package/dist/src/infrastructure/node/ExtendedNodeExperiencePairDTO.js +26 -0
  156. package/dist/src/infrastructure/node/ExtendedNodeExperiencePairDTO.js.map +1 -0
  157. package/dist/src/infrastructure/node/NodeCollectionDTO.d.ts +1 -0
  158. package/dist/src/infrastructure/node/NodeCollectionDTO.js +26 -0
  159. package/dist/src/infrastructure/node/NodeCollectionDTO.js.map +1 -0
  160. package/dist/src/infrastructure/node/NodeDTO.d.ts +19 -0
  161. package/dist/src/infrastructure/node/NodeDTO.js +26 -0
  162. package/dist/src/infrastructure/node/NodeDTO.js.map +1 -0
  163. package/dist/src/infrastructure/transaction/CreateTransactionFromDTO.d.ts +1 -0
  164. package/dist/src/infrastructure/transaction/CreateTransactionFromDTO.js +162 -0
  165. package/dist/src/infrastructure/transaction/CreateTransactionFromDTO.js.map +1 -0
  166. package/dist/src/infrastructure/transaction/CreateUnconfirmedTransactionFromDTO.d.ts +1 -0
  167. package/dist/src/infrastructure/transaction/CreateUnconfirmedTransactionFromDTO.js +104 -0
  168. package/dist/src/infrastructure/transaction/CreateUnconfirmedTransactionFromDTO.js.map +1 -0
  169. package/dist/src/infrastructure/transaction/ErrorObjectDTO.d.ts +1 -0
  170. package/dist/src/infrastructure/transaction/ErrorObjectDTO.js +26 -0
  171. package/dist/src/infrastructure/transaction/ErrorObjectDTO.js.map +1 -0
  172. package/dist/src/infrastructure/transaction/HashData.d.ts +10 -0
  173. package/dist/src/infrastructure/transaction/HashData.js +26 -0
  174. package/dist/src/infrastructure/transaction/HashData.js.map +1 -0
  175. package/dist/src/infrastructure/transaction/ImportanceTransferTransactionDTO.d.ts +1 -0
  176. package/dist/src/infrastructure/transaction/ImportanceTransferTransactionDTO.js +26 -0
  177. package/dist/src/infrastructure/transaction/ImportanceTransferTransactionDTO.js.map +1 -0
  178. package/dist/src/infrastructure/transaction/Message.d.ts +1 -0
  179. package/dist/src/infrastructure/transaction/Message.js +26 -0
  180. package/dist/src/infrastructure/transaction/Message.js.map +1 -0
  181. package/dist/src/infrastructure/transaction/MosaicDefinitionCreationTransactionDTO.d.ts +1 -0
  182. package/dist/src/infrastructure/transaction/MosaicDefinitionCreationTransactionDTO.js +26 -0
  183. package/dist/src/infrastructure/transaction/MosaicDefinitionCreationTransactionDTO.js.map +1 -0
  184. package/dist/src/infrastructure/transaction/MosaicSupplyChangeTransactionDTO.d.ts +1 -0
  185. package/dist/src/infrastructure/transaction/MosaicSupplyChangeTransactionDTO.js +26 -0
  186. package/dist/src/infrastructure/transaction/MosaicSupplyChangeTransactionDTO.js.map +1 -0
  187. package/dist/src/infrastructure/transaction/MultisigAggregateModificationTransactionDTO.d.ts +1 -0
  188. package/dist/src/infrastructure/transaction/MultisigAggregateModificationTransactionDTO.js +26 -0
  189. package/dist/src/infrastructure/transaction/MultisigAggregateModificationTransactionDTO.js.map +1 -0
  190. package/dist/src/infrastructure/transaction/MultisigCosignatoryModificationDTO.d.ts +1 -0
  191. package/dist/src/infrastructure/transaction/MultisigCosignatoryModificationDTO.js +26 -0
  192. package/dist/src/infrastructure/transaction/MultisigCosignatoryModificationDTO.js.map +1 -0
  193. package/dist/src/infrastructure/transaction/MultisigSignatureTransactionDTO.d.ts +1 -0
  194. package/dist/src/infrastructure/transaction/MultisigSignatureTransactionDTO.js +26 -0
  195. package/dist/src/infrastructure/transaction/MultisigSignatureTransactionDTO.js.map +1 -0
  196. package/dist/src/infrastructure/transaction/MultisigTransactionDTO.d.ts +1 -0
  197. package/dist/src/infrastructure/transaction/MultisigTransactionDTO.js +26 -0
  198. package/dist/src/infrastructure/transaction/MultisigTransactionDTO.js.map +1 -0
  199. package/dist/src/infrastructure/transaction/NemAnnounceResultDTO.d.ts +1 -0
  200. package/dist/src/infrastructure/transaction/NemAnnounceResultDTO.js +26 -0
  201. package/dist/src/infrastructure/transaction/NemAnnounceResultDTO.js.map +1 -0
  202. package/dist/src/infrastructure/transaction/NemRequestResultDTO.d.ts +10 -0
  203. package/dist/src/infrastructure/transaction/NemRequestResultDTO.js +26 -0
  204. package/dist/src/infrastructure/transaction/NemRequestResultDTO.js.map +1 -0
  205. package/dist/src/infrastructure/transaction/ProvisionNamespaceTransactionDTO.d.ts +1 -0
  206. package/dist/src/infrastructure/transaction/ProvisionNamespaceTransactionDTO.js +26 -0
  207. package/dist/src/infrastructure/transaction/ProvisionNamespaceTransactionDTO.js.map +1 -0
  208. package/dist/src/infrastructure/transaction/RequestPrepareAnnonceDTO.d.ts +1 -0
  209. package/dist/src/infrastructure/transaction/RequestPrepareAnnonceDTO.js +26 -0
  210. package/dist/src/infrastructure/transaction/RequestPrepareAnnonceDTO.js.map +1 -0
  211. package/dist/src/infrastructure/transaction/TransactionDTO.d.ts +31 -0
  212. package/dist/src/infrastructure/transaction/TransactionDTO.js +26 -0
  213. package/dist/src/infrastructure/transaction/TransactionDTO.js.map +1 -0
  214. package/dist/src/infrastructure/transaction/TransactionMetaDataDTO.d.ts +1 -0
  215. package/dist/src/infrastructure/transaction/TransactionMetaDataDTO.js +26 -0
  216. package/dist/src/infrastructure/transaction/TransactionMetaDataDTO.js.map +1 -0
  217. package/dist/src/infrastructure/transaction/TransactionMetaDataPairDTO.d.ts +1 -0
  218. package/dist/src/infrastructure/transaction/TransactionMetaDataPairDTO.js +26 -0
  219. package/dist/src/infrastructure/transaction/TransactionMetaDataPairDTO.js.map +1 -0
  220. package/dist/src/infrastructure/transaction/TransferTransactionDTO.d.ts +1 -0
  221. package/dist/src/infrastructure/transaction/TransferTransactionDTO.js +26 -0
  222. package/dist/src/infrastructure/transaction/TransferTransactionDTO.js.map +1 -0
  223. package/dist/src/infrastructure/transaction/UnconfirmedTransactionMetaDataDTO.d.ts +1 -0
  224. package/dist/src/infrastructure/transaction/UnconfirmedTransactionMetaDataDTO.js +26 -0
  225. package/dist/src/infrastructure/transaction/UnconfirmedTransactionMetaDataDTO.js.map +1 -0
  226. package/dist/src/infrastructure/transaction/UnconfirmedTransactionMetaDataPairDTO.d.ts +1 -0
  227. package/dist/src/infrastructure/transaction/UnconfirmedTransactionMetaDataPairDTO.js +26 -0
  228. package/dist/src/infrastructure/transaction/UnconfirmedTransactionMetaDataPairDTO.js.map +1 -0
  229. package/dist/src/infrastructure/transaction/UnconfirmedTransactionsDTO.d.ts +1 -0
  230. package/dist/src/infrastructure/transaction/UnconfirmedTransactionsDTO.js +26 -0
  231. package/dist/src/infrastructure/transaction/UnconfirmedTransactionsDTO.js.map +1 -0
  232. package/dist/src/models/account/Account.d.ts +52 -0
  233. package/dist/src/models/account/Account.js +136 -0
  234. package/dist/src/models/account/Account.js.map +1 -0
  235. package/dist/src/models/account/AccountHarvestInfo.d.ts +25 -0
  236. package/dist/src/models/account/AccountHarvestInfo.js +55 -0
  237. package/dist/src/models/account/AccountHarvestInfo.js.map +1 -0
  238. package/dist/src/models/account/AccountHistoricalInfo.d.ts +25 -0
  239. package/dist/src/models/account/AccountHistoricalInfo.js +58 -0
  240. package/dist/src/models/account/AccountHistoricalInfo.js.map +1 -0
  241. package/dist/src/models/account/AccountImportanceInfo.d.ts +35 -0
  242. package/dist/src/models/account/AccountImportanceInfo.js +77 -0
  243. package/dist/src/models/account/AccountImportanceInfo.js.map +1 -0
  244. package/dist/src/models/account/AccountInfo.d.ts +79 -0
  245. package/dist/src/models/account/AccountInfo.js +129 -0
  246. package/dist/src/models/account/AccountInfo.js.map +1 -0
  247. package/dist/src/models/account/Address.d.ts +25 -0
  248. package/dist/src/models/account/Address.js +80 -0
  249. package/dist/src/models/account/Address.js.map +1 -0
  250. package/dist/src/models/account/Balance.d.ts +17 -0
  251. package/dist/src/models/account/Balance.js +42 -0
  252. package/dist/src/models/account/Balance.js.map +1 -0
  253. package/dist/src/models/account/NodeHarvestInfo.d.ts +10 -0
  254. package/dist/src/models/account/NodeHarvestInfo.js +38 -0
  255. package/dist/src/models/account/NodeHarvestInfo.js.map +1 -0
  256. package/dist/src/models/account/PublicAccount.d.ts +25 -0
  257. package/dist/src/models/account/PublicAccount.js +82 -0
  258. package/dist/src/models/account/PublicAccount.js.map +1 -0
  259. package/dist/src/models/asset/Asset.d.ts +20 -0
  260. package/dist/src/models/asset/Asset.js +59 -0
  261. package/dist/src/models/asset/Asset.js.map +1 -0
  262. package/dist/src/models/asset/AssetDefinition.d.ts +83 -0
  263. package/dist/src/models/asset/AssetDefinition.js +136 -0
  264. package/dist/src/models/asset/AssetDefinition.js.map +1 -0
  265. package/dist/src/models/asset/AssetId.d.ts +31 -0
  266. package/dist/src/models/asset/AssetId.js +77 -0
  267. package/dist/src/models/asset/AssetId.js.map +1 -0
  268. package/dist/src/models/asset/AssetLevy.d.ts +40 -0
  269. package/dist/src/models/asset/AssetLevy.js +76 -0
  270. package/dist/src/models/asset/AssetLevy.js.map +1 -0
  271. package/dist/src/models/asset/AssetTransferable.d.ts +65 -0
  272. package/dist/src/models/asset/AssetTransferable.js +88 -0
  273. package/dist/src/models/asset/AssetTransferable.js.map +1 -0
  274. package/dist/src/models/asset/XEM.d.ts +49 -0
  275. package/dist/src/models/asset/XEM.js +83 -0
  276. package/dist/src/models/asset/XEM.js.map +1 -0
  277. package/dist/src/models/blockchain/Block.d.ts +57 -0
  278. package/dist/src/models/blockchain/Block.js +81 -0
  279. package/dist/src/models/blockchain/Block.js.map +1 -0
  280. package/dist/src/models/namespace/Namespace.d.ts +23 -0
  281. package/dist/src/models/namespace/Namespace.js +64 -0
  282. package/dist/src/models/namespace/Namespace.js.map +1 -0
  283. package/dist/src/models/node/ExtendedNodeExperience.d.ts +34 -0
  284. package/dist/src/models/node/ExtendedNodeExperience.js +79 -0
  285. package/dist/src/models/node/ExtendedNodeExperience.js.map +1 -0
  286. package/dist/src/models/node/NetworkTypes.d.ts +17 -0
  287. package/dist/src/models/node/NetworkTypes.js +44 -0
  288. package/dist/src/models/node/NetworkTypes.js.map +1 -0
  289. package/dist/src/models/node/NisNodeInfo.d.ts +39 -0
  290. package/dist/src/models/node/NisNodeInfo.js +79 -0
  291. package/dist/src/models/node/NisNodeInfo.js.map +1 -0
  292. package/dist/src/models/node/Node.d.ts +76 -0
  293. package/dist/src/models/node/Node.js +131 -0
  294. package/dist/src/models/node/Node.js.map +1 -0
  295. package/dist/src/models/node/NodeCollection.d.ts +22 -0
  296. package/dist/src/models/node/NodeCollection.js +54 -0
  297. package/dist/src/models/node/NodeCollection.js.map +1 -0
  298. package/dist/src/models/transaction/AssetDefinitionCreationTransaction.d.ts +39 -0
  299. package/dist/src/models/transaction/AssetDefinitionCreationTransaction.js +94 -0
  300. package/dist/src/models/transaction/AssetDefinitionCreationTransaction.js.map +1 -0
  301. package/dist/src/models/transaction/AssetSupplyChangeTransaction.d.ts +48 -0
  302. package/dist/src/models/transaction/AssetSupplyChangeTransaction.js +94 -0
  303. package/dist/src/models/transaction/AssetSupplyChangeTransaction.js.map +1 -0
  304. package/dist/src/models/transaction/EncryptedMessage.d.ts +8 -0
  305. package/dist/src/models/transaction/EncryptedMessage.js +86 -0
  306. package/dist/src/models/transaction/EncryptedMessage.js.map +1 -0
  307. package/dist/src/models/transaction/HexMessage.d.ts +10 -0
  308. package/dist/src/models/transaction/HexMessage.js +37 -0
  309. package/dist/src/models/transaction/HexMessage.js.map +1 -0
  310. package/dist/src/models/transaction/ImportanceTransferTransaction.d.ts +45 -0
  311. package/dist/src/models/transaction/ImportanceTransferTransaction.js +92 -0
  312. package/dist/src/models/transaction/ImportanceTransferTransaction.js.map +1 -0
  313. package/dist/src/models/transaction/Message.d.ts +12 -0
  314. package/dist/src/models/transaction/Message.js +110 -0
  315. package/dist/src/models/transaction/Message.js.map +1 -0
  316. package/dist/src/models/transaction/MultisigAggregateModificationTransaction.d.ts +55 -0
  317. package/dist/src/models/transaction/MultisigAggregateModificationTransaction.js +112 -0
  318. package/dist/src/models/transaction/MultisigAggregateModificationTransaction.js.map +1 -0
  319. package/dist/src/models/transaction/MultisigSignatureTransaction.d.ts +35 -0
  320. package/dist/src/models/transaction/MultisigSignatureTransaction.js +92 -0
  321. package/dist/src/models/transaction/MultisigSignatureTransaction.js.map +1 -0
  322. package/dist/src/models/transaction/MultisigTransaction.d.ts +49 -0
  323. package/dist/src/models/transaction/MultisigTransaction.js +102 -0
  324. package/dist/src/models/transaction/MultisigTransaction.js.map +1 -0
  325. package/dist/src/models/transaction/NemAnnounceResult.d.ts +77 -0
  326. package/dist/src/models/transaction/NemAnnounceResult.js +66 -0
  327. package/dist/src/models/transaction/NemAnnounceResult.js.map +1 -0
  328. package/dist/src/models/transaction/PlainMessage.d.ts +19 -0
  329. package/dist/src/models/transaction/PlainMessage.js +77 -0
  330. package/dist/src/models/transaction/PlainMessage.js.map +1 -0
  331. package/dist/src/models/transaction/ProvisionNamespaceTransaction.d.ts +57 -0
  332. package/dist/src/models/transaction/ProvisionNamespaceTransaction.js +117 -0
  333. package/dist/src/models/transaction/ProvisionNamespaceTransaction.js.map +1 -0
  334. package/dist/src/models/transaction/SignedTransaction.d.ts +13 -0
  335. package/dist/src/models/transaction/SignedTransaction.js +26 -0
  336. package/dist/src/models/transaction/SignedTransaction.js.map +1 -0
  337. package/dist/src/models/transaction/TimeWindow.d.ts +24 -0
  338. package/dist/src/models/transaction/TimeWindow.js +84 -0
  339. package/dist/src/models/transaction/TimeWindow.js.map +1 -0
  340. package/dist/src/models/transaction/Transaction.d.ts +56 -0
  341. package/dist/src/models/transaction/Transaction.js +98 -0
  342. package/dist/src/models/transaction/Transaction.js.map +1 -0
  343. package/dist/src/models/transaction/TransactionInfo.d.ts +39 -0
  344. package/dist/src/models/transaction/TransactionInfo.js +60 -0
  345. package/dist/src/models/transaction/TransactionInfo.js.map +1 -0
  346. package/dist/src/models/transaction/TransactionTypes.d.ts +80 -0
  347. package/dist/src/models/transaction/TransactionTypes.js +159 -0
  348. package/dist/src/models/transaction/TransactionTypes.js.map +1 -0
  349. package/dist/src/models/transaction/TransferTransaction.d.ts +78 -0
  350. package/dist/src/models/transaction/TransferTransaction.js +176 -0
  351. package/dist/src/models/transaction/TransferTransaction.js.map +1 -0
  352. package/dist/src/models/wallet/BrainPassword.d.ts +11 -0
  353. package/dist/src/models/wallet/BrainPassword.js +42 -0
  354. package/dist/src/models/wallet/BrainPassword.js.map +1 -0
  355. package/dist/src/models/wallet/BrainWallet.d.ts +34 -0
  356. package/dist/src/models/wallet/BrainWallet.js +101 -0
  357. package/dist/src/models/wallet/BrainWallet.js.map +1 -0
  358. package/dist/src/models/wallet/EncryptedPrivateKey.d.ts +13 -0
  359. package/dist/src/models/wallet/EncryptedPrivateKey.js +56 -0
  360. package/dist/src/models/wallet/EncryptedPrivateKey.js.map +1 -0
  361. package/dist/src/models/wallet/Password.d.ts +14 -0
  362. package/dist/src/models/wallet/Password.js +41 -0
  363. package/dist/src/models/wallet/Password.js.map +1 -0
  364. package/dist/src/models/wallet/SimpleWallet.d.ts +47 -0
  365. package/dist/src/models/wallet/SimpleWallet.js +143 -0
  366. package/dist/src/models/wallet/SimpleWallet.js.map +1 -0
  367. package/dist/src/models/wallet/Wallet.d.ts +51 -0
  368. package/dist/src/models/wallet/Wallet.js +81 -0
  369. package/dist/src/models/wallet/Wallet.js.map +1 -0
  370. package/dist/src/models.d.ts +46 -0
  371. package/dist/src/models.js +74 -0
  372. package/dist/src/models.js.map +1 -0
  373. package/dist/src/services/AccountOwnedAssetService.d.ts +30 -0
  374. package/dist/src/services/AccountOwnedAssetService.js +63 -0
  375. package/dist/src/services/AccountOwnedAssetService.js.map +1 -0
  376. package/dist/src/services/AssetService.d.ts +23 -0
  377. package/dist/src/services/AssetService.js +87 -0
  378. package/dist/src/services/AssetService.js.map +1 -0
  379. package/dist/src/services/QRService.d.ts +66 -0
  380. package/dist/src/services/QRService.js +155 -0
  381. package/dist/src/services/QRService.js.map +1 -0
  382. package/dist/src/services.d.ts +3 -0
  383. package/dist/src/services.js +32 -0
  384. package/dist/src/services.js.map +1 -0
  385. package/dist/src/vendor/sockjs-0.3.4.d.ts +25 -0
  386. package/dist/src/vendor/sockjs-0.3.4.js +2516 -0
  387. package/dist/src/vendor/sockjs-0.3.4.min.js +27 -0
  388. package/package.json +87 -0
@@ -0,0 +1,132 @@
1
+ "use strict";
2
+ /*
3
+ * The MIT License (MIT)
4
+ *
5
+ * Copyright (c) 2017 NEM
6
+ *
7
+ * Permission is hereby granted, free of charge, to any person obtaining a copy
8
+ * of this software and associated documentation files (the "Software"), to deal
9
+ * in the Software without restriction, including without limitation the rights
10
+ * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
11
+ * copies of the Software, and to permit persons to whom the Software is
12
+ * furnished to do so, subject to the following conditions:
13
+ *
14
+ * The above copyright notice and this permission notice shall be included in all
15
+ * copies or substantial portions of the Software.
16
+ *
17
+ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
18
+ * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
19
+ * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
20
+ * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
21
+ * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
22
+ * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
23
+ * SOFTWARE.
24
+ */
25
+ Object.defineProperty(exports, "__esModule", { value: true });
26
+ const errors_1 = require("request-promise-native/errors");
27
+ const NetworkTypes_1 = require("../models/node/NetworkTypes");
28
+ const NEMLibrary_1 = require("../NEMLibrary");
29
+ const operators_1 = require("rxjs/operators");
30
+ class HttpEndpoint {
31
+ constructor(resource, nodes, preferProtocol) {
32
+ this.resource = resource;
33
+ this.pointer = 0;
34
+ this.historicalPointer = 0;
35
+ this.replyWhenRequestError = (errors) => {
36
+ return errors.pipe(operators_1.tap((x) => {
37
+ if (!(x instanceof errors_1.RequestError)) {
38
+ throw (x);
39
+ }
40
+ }));
41
+ };
42
+ if (nodes) {
43
+ this.nodes = nodes.map((_) => {
44
+ return {
45
+ protocol: _.protocol ? _.protocol : "http",
46
+ domain: _.domain,
47
+ port: _.port ? _.port : 7890,
48
+ };
49
+ });
50
+ }
51
+ else if (NEMLibrary_1.NEMLibrary.getNetworkType() == NetworkTypes_1.NetworkTypes.TEST_NET) {
52
+ this.nodes = [
53
+ { protocol: "http", domain: "bigalice2.nem.ninja", port: 7890 },
54
+ { protocol: "http", domain: "192.3.61.243", port: 7890 },
55
+ { protocol: "http", domain: "23.228.67.85", port: 7890 },
56
+ { protocol: "http", domain: "50.3.87.123", port: 7890 },
57
+ ];
58
+ }
59
+ else if (NEMLibrary_1.NEMLibrary.getNetworkType() == NetworkTypes_1.NetworkTypes.MAIN_NET) {
60
+ this.nodes = [
61
+ { protocol: "http", domain: "alice6.nem.ninja", port: 7890 },
62
+ { protocol: "http", domain: "62.75.171.41", port: 7890 },
63
+ { protocol: "http", domain: "san.nem.ninja", port: 7890 },
64
+ { protocol: "http", domain: "go.nem.ninja", port: 7890 },
65
+ { protocol: "http", domain: "hachi.nem.ninja", port: 7890 },
66
+ { protocol: "http", domain: "jusan.nem.ninja", port: 7890 },
67
+ { protocol: "http", domain: "nijuichi.nem.ninja", port: 7890 },
68
+ { protocol: "http", domain: "alice2.nem.ninja", port: 7890 },
69
+ { protocol: "http", domain: "alice3.nem.ninja", port: 7890 },
70
+ { protocol: "http", domain: "alice4.nem.ninja", port: 7890 },
71
+ { protocol: "http", domain: "alice5.nem.ninja", port: 7890 },
72
+ { protocol: "http", domain: "alice6.nem.ninja", port: 7890 },
73
+ { protocol: "http", domain: "alice7.nem.ninja", port: 7890 },
74
+ { protocol: "https", domain: "nis2.wnsl.biz", port: 7779 },
75
+ ];
76
+ }
77
+ else {
78
+ throw new Error("Nodes uninitialized");
79
+ }
80
+ if (preferProtocol) {
81
+ this.nodes = this.nodes.filter((_) => _.protocol == preferProtocol);
82
+ }
83
+ if (NEMLibrary_1.NEMLibrary.getNetworkType() === NetworkTypes_1.NetworkTypes.TEST_NET) {
84
+ this.historicalNodes = [
85
+ { protocol: "http", domain: "104.128.226.60", port: 7890 },
86
+ ];
87
+ }
88
+ else if (NEMLibrary_1.NEMLibrary.getNetworkType() === NetworkTypes_1.NetworkTypes.MAIN_NET) {
89
+ this.historicalNodes = [
90
+ { protocol: "http", domain: "88.99.192.82", port: 7890 },
91
+ ];
92
+ }
93
+ else if (NEMLibrary_1.NEMLibrary.getNetworkType() === NetworkTypes_1.NetworkTypes.MIJIN_NET) {
94
+ this.historicalNodes = this.nodes;
95
+ }
96
+ else {
97
+ throw new Error("Nodes uninitialized");
98
+ }
99
+ }
100
+ /**
101
+ * @internal
102
+ * @returns {string}
103
+ */
104
+ nextNode() {
105
+ if (this.pointer == this.nodes.length) {
106
+ this.pointer = 0;
107
+ }
108
+ const protocol = this.nodes[this.pointer].protocol;
109
+ const domain = this.nodes[this.pointer].domain;
110
+ const port = this.nodes[this.pointer].port;
111
+ const URL = protocol + "://" + domain + ":" + port + "/" + this.resource + "/";
112
+ this.pointer++;
113
+ return URL;
114
+ }
115
+ /**
116
+ * @internal
117
+ * @returns {string}
118
+ */
119
+ nextHistoricalNode() {
120
+ if (this.historicalPointer >= this.historicalNodes.length) {
121
+ this.historicalPointer = 0;
122
+ }
123
+ const protocol = this.historicalNodes[this.historicalPointer].protocol;
124
+ const domain = this.historicalNodes[this.historicalPointer].domain;
125
+ const port = this.historicalNodes[this.historicalPointer].port;
126
+ const URL = protocol + "://" + domain + ":" + port + "/" + this.resource + "/";
127
+ this.historicalPointer++;
128
+ return URL;
129
+ }
130
+ }
131
+ exports.HttpEndpoint = HttpEndpoint;
132
+ //# sourceMappingURL=HttpEndpoint.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"HttpEndpoint.js","sourceRoot":"","sources":["../../../src/infrastructure/HttpEndpoint.ts"],"names":[],"mappings":";AAAA;;;;;;;;;;;;;;;;;;;;;;GAsBG;;AAEH,0DAA2D;AAC3D,8DAAyD;AACzD,8CAAyC;AACzC,8CAAmC;AAUnC;IAME,YAAoB,QAAgB,EAAE,KAAsB,EAAE,cAAyB;QAAnE,aAAQ,GAAR,QAAQ,CAAQ;QAH5B,YAAO,GAAG,CAAC,CAAC;QACZ,sBAAiB,GAAG,CAAC,CAAC;QAyFpB,0BAAqB,GAAG,CAAC,MAAM,EAAE,EAAE;YAC3C,OAAO,MAAM,CAAC,IAAI,CAChB,eAAG,CAAC,CAAC,CAAC,EAAE,EAAE;gBACR,IAAI,CAAC,CAAC,CAAC,YAAY,qBAAY,CAAC,EAAE;oBAChC,MAAM,CAAC,CAAC,CAAC,CAAC;iBACX;YACH,CAAC,CAAC,CACH,CAAC;QACJ,CAAC,CAAA;QA9FC,IAAI,KAAK,EAAE;YACT,IAAI,CAAC,KAAK,GAAG,KAAK,CAAC,GAAG,CAAC,CAAC,CAAC,EAAE,EAAE;gBAC3B,OAAO;oBACL,QAAQ,EAAE,CAAC,CAAC,QAAQ,CAAC,CA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,GAAG,IAAI,CAAC,eAAe,CAAC,IAAI,CAAC,iBAAiB,CAAC,CAAC,QAAQ,CAAC;QACvE,MAAM,MAAM,GAAG,IAAI,CAAC,eAAe,CAAC,IAAI,CAAC,iBAAiB,CAAC,CAAC,MAAM,CAAC;QACnE,MAAM,IAAI,GAAG,IAAI,CAAC,eAAe,CAAC,IAAI,CAAC,iBAAiB,CAAC,CAAC,IAAI,CAAC;QAC/D,MAAM,GAAG,GAAG,QAAQ,GAAG,KAAK,GAAG,MAAM,GAAG,GAAG,GAAG,IAAI,GAAG,GAAG,GAAG,IAAI,CAAC,QAAQ,GAAG,GAAG,CAAC;QAC/E,IAAI,CAAC,iBAAiB,EAAE,CAAC;QACzB,OAAO,GAAG,CAAC;IACb,CAAC;CAWF;AAtGD,oCAsGC"}
@@ -0,0 +1,29 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ const Pageable_1 = require("./Pageable");
4
+ /**
5
+ * @internal
6
+ */
7
+ class IncomingTransactionsPageable extends Pageable_1.Pageable {
8
+ constructor(source, address, params) {
9
+ super();
10
+ this.resource = source;
11
+ this.address = address;
12
+ this.params = params;
13
+ }
14
+ nextPage() {
15
+ this.resource.incomingTransactions(this.address, this.params).subscribe((next) => {
16
+ if (next.length != 0) {
17
+ this.params.id = next[next.length - 1].getTransactionInfo().id;
18
+ this.next(next);
19
+ }
20
+ else {
21
+ this.complete();
22
+ }
23
+ }, (err) => {
24
+ this.error(err);
25
+ });
26
+ }
27
+ }
28
+ exports.IncomingTransactionsPageable = IncomingTransactionsPageable;
29
+ //# sourceMappingURL=IncomingTransactionsPageable.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"IncomingTransactionsPageable.js","sourceRoot":"","sources":["../../../src/infrastructure/IncomingTransactionsPageable.ts"],"names":[],"mappings":";;AA0BA,yCAAoC;AAEpC;;GAEG;AACH,kCAA0C,SAAQ,mBAAuB;IAKvE,YAAY,MAAmB,EAAE,OAAgB,EAAE,MAAmB;QACpE,KAAK,EAAE,CAAC;QACR,IAAI,CAAC,QAAQ,GAAG,MAAM,CAAC;QACvB,IAAI,CAAC,OAAO,GAAG,OAAO,CAAC;QACvB,IAAI,CAAC,MAAM,GAAG,MAAM,CAAC;IACvB,CAAC;IAEM,QAAQ;QACb,IAAI,CAAC,QAAQ,CAAC,oBAAoB,CAAC,IAAI,CAAC,OAAO,EAAE,IAAI,CAAC,MAAM,CAAC,CAAC,SAAS,CAAC,CAAC,IAAI,EAAE,EAAE;YAC/E,IAAI,IAAI,CAAC,MAAM,IAAI,CAAC,EAAE;gBACpB,IAAI,CAAC,MAAM,CAAC,EAAE,GAAG,IAAI,CAAC,IAAI,CAAC,MAAM,GAAG,CAAC,CAAC,CAAC,kBAAkB,EAAE,CAAC,EAAE,CAAC;gBAC/D,IAAI,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC;aACjB;iBAAM;gBACL,IAAI,CAAC,QAAQ,EAAE,CAAC;aACjB;QACH,CAAC,EAAE,CAAC,GAAG,EAAE,EAAE;YACT,IAAI,CAAC,KAAK,CAAC,GAAG,CAAC,CAAC;QAClB,CAAC,CAAC,CAAC;IACL,CAAC;CACF;AAxBD,oEAwBC"}
@@ -0,0 +1,14 @@
1
+ import { Client } from "@stomp/stompjs";
2
+ import { Protocol } from "./HttpEndpoint";
3
+ export interface WebSocketConfig {
4
+ readonly protocol?: Protocol;
5
+ readonly domain?: string;
6
+ readonly port?: number;
7
+ }
8
+ export declare abstract class Listener {
9
+ private readonly nodes;
10
+ private pointer;
11
+ constructor(nodes?: WebSocketConfig[]);
12
+ protected createClient(): Client;
13
+ protected nextNode(): string;
14
+ }
@@ -0,0 +1,101 @@
1
+ "use strict";
2
+ /*
3
+ * The MIT License (MIT)
4
+ *
5
+ * Copyright (c) 2017 NEM
6
+ *
7
+ * Permission is hereby granted, free of charge, to any person obtaining a copy
8
+ * of this software and associated documentation files (the "Software"), to deal
9
+ * in the Software without restriction, including without limitation the rights
10
+ * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
11
+ * copies of the Software, and to permit persons to whom the Software is
12
+ * furnished to do so, subject to the following conditions:
13
+ *
14
+ * The above copyright notice and this permission notice shall be included in all
15
+ * copies or substantial portions of the Software.
16
+ *
17
+ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
18
+ * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
19
+ * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
20
+ * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
21
+ * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
22
+ * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
23
+ * SOFTWARE.
24
+ */
25
+ Object.defineProperty(exports, "__esModule", { value: true });
26
+ const Stomp = require("@stomp/stompjs");
27
+ const SockJS = require("sockjs-client");
28
+ const NetworkTypes_1 = require("../models/node/NetworkTypes");
29
+ const NEMLibrary_1 = require("../NEMLibrary");
30
+ class Listener {
31
+ constructor(nodes) {
32
+ this.pointer = 0;
33
+ if (nodes) {
34
+ this.nodes = nodes.map((_) => {
35
+ return {
36
+ protocol: _.protocol ? _.protocol : "http",
37
+ domain: _.domain,
38
+ port: _.port ? _.port : 7778,
39
+ };
40
+ });
41
+ }
42
+ else if (NEMLibrary_1.NEMLibrary.getNetworkType() == NetworkTypes_1.NetworkTypes.TEST_NET) {
43
+ this.nodes = [
44
+ { protocol: "http", domain: "bigalice2.nem.ninja", port: 7778 },
45
+ { protocol: "https", domain: "pretestnet1.nem.ninja", port: 7779 },
46
+ { protocol: "http", domain: "192.3.61.243", port: 7778 },
47
+ { protocol: "http", domain: "23.228.67.85", port: 7778 },
48
+ { protocol: "http", domain: "50.3.87.123", port: 7778 },
49
+ ];
50
+ }
51
+ else if (NEMLibrary_1.NEMLibrary.getNetworkType() == NetworkTypes_1.NetworkTypes.MAIN_NET) {
52
+ this.nodes = [
53
+ { protocol: "http", domain: "alice6.nem.ninja", port: 7778 },
54
+ { protocol: "http", domain: "62.75.171.41", port: 7778 },
55
+ { protocol: "http", domain: "san.nem.ninja", port: 7778 },
56
+ { protocol: "http", domain: "go.nem.ninja", port: 7778 },
57
+ { protocol: "http", domain: "hachi.nem.ninja", port: 7778 },
58
+ { protocol: "http", domain: "jusan.nem.ninja", port: 7778 },
59
+ { protocol: "http", domain: "nijuichi.nem.ninja", port: 7778 },
60
+ { protocol: "http", domain: "alice2.nem.ninja", port: 7778 },
61
+ { protocol: "http", domain: "alice3.nem.ninja", port: 7778 },
62
+ { protocol: "http", domain: "alice4.nem.ninja", port: 7778 },
63
+ { protocol: "http", domain: "alice5.nem.ninja", port: 7778 },
64
+ { protocol: "http", domain: "alice6.nem.ninja", port: 7778 },
65
+ { protocol: "http", domain: "alice7.nem.ninja", port: 7778 },
66
+ ];
67
+ }
68
+ else {
69
+ throw new Error("Nodes uninitialized");
70
+ }
71
+ }
72
+ createClient() {
73
+ let client;
74
+ let sockJS;
75
+ if (NEMLibrary_1.NEMLibrary.getEnvironment() == NEMLibrary_1.Environment.Node) {
76
+ sockJS = new SockJS(this.nextNode());
77
+ }
78
+ else {
79
+ const SockJSBrowser = require("../vendor/sockjs-0.3.4");
80
+ sockJS = SockJSBrowser(this.nextNode());
81
+ }
82
+ client = Stomp.over(sockJS);
83
+ client.heartbeat.outgoing = 20000; // client will send heartbeats every 20000ms
84
+ client.heartbeat.incoming = 10000;
85
+ client.reconnect_delay = 5000;
86
+ return client;
87
+ }
88
+ nextNode() {
89
+ if (this.pointer == this.nodes.length) {
90
+ this.pointer = 0;
91
+ }
92
+ const protocol = this.nodes[this.pointer].protocol;
93
+ const domain = this.nodes[this.pointer].domain;
94
+ const port = this.nodes[this.pointer].port;
95
+ const URL = protocol + "://" + domain + ":" + port + "/w/messages";
96
+ this.pointer++;
97
+ return URL;
98
+ }
99
+ }
100
+ exports.Listener = Listener;
101
+ //# sourceMappingURL=Listener.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"Listener.js","sourceRoot":"","sources":["../../../src/infrastructure/Listener.ts"],"names":[],"mappings":";AAAA;;;;;;;;;;;;;;;;;;;;;;GAsBG;;AAEH,wCAAwC;AAExC,wCAAwC;AACxC,8DAAyD;AACzD,8CAAsD;AAStD;IAIE,YAAY,KAAyB;QAF7B,YAAO,GAAG,CAAC,CAAC;QAGlB,IAAI,KAAK,EAAE;YACT,IAAI,CAAC,KAAK,GAAG,KAAK,CAAC,GAAG,CAAC,CAAC,CAAC,EAAE,EAAE;gBAC3B,OAAO;oBACL,QAAQ,EAAE,CAAC,CAAC,QAAQ,CAAC,CAAC,CAAC,CAAC,CAAC,QAAQ,CAAC,CAAC,CAAC,MAAM;oBAC1C,MAAM,EAAE,CAAC,CAAC,MAAM;oBAChB,IAAI,EAAE,CAAC,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC,CAAC,IAAI,CAAC,CAAC,CAAC,IAAI;iBAC7B,CAAC;YACJ,CAAC,CAAC,CAAC;SACJ;aACI,IAAI,uBAAU,CAAC,cAAc,EAAE,IAAI,2BAAY,CAAC,QAAQ,EAAE;YAC7D,IAAI,CAAC,KAAK,GAAG;gBACX,EAAC,QAAQ,EAAE,MAAM,EAAE,MAAM,EAAE,qBAAqB,EAAE,IAAI,EAAE,IAAI,EAAC;gBAC7D,EAAC,QAAQ,EAAE,OAAO,EAAE,MAAM,EAAE,uBAAuB,EAAE,IAAI,EAAE,IAAI,EAAC;gBAChE,EAAC,QAAQ,EAAE,MAAM,EAAE,MAAM,EAAE,cAAc,EAAE,IAAI,EAAE,IAAI,EAAC;gBACtD,EAAC,QAAQ,EAAE,MAAM,EAAE,MAAM,EAAE,cAAc,EAAE,IAAI,EAAE,IAAI,EAAC;gBACtD,EAAC,QAAQ,EAAE,MAAM,EAAE,MAAM,E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,GAAG,MAAM,GAAG,GAAG,GAAG,IAAI,GAAG,aAAa,CAAC;QACnE,IAAI,CAAC,OAAO,EAAE,CAAC;QACf,OAAO,GAAG,CAAC;IACb,CAAC;CAEF;AA3ED,4BA2EC"}
@@ -0,0 +1,27 @@
1
+ import { Observable } from "rxjs";
2
+ import { QueryParams } from "./AccountHttp";
3
+ import { Namespace } from "../models/namespace/Namespace";
4
+ import { HttpEndpoint, ServerConfig } from "./HttpEndpoint";
5
+ import { Pageable } from "./Pageable";
6
+ export declare class NamespaceHttp extends HttpEndpoint {
7
+ constructor(nodes?: ServerConfig[]);
8
+ /**
9
+ * Paginaged version of incomingTransactions request
10
+ * @param address
11
+ * @param params
12
+ */
13
+ getRootNamespacesPaginated(params?: QueryParams): Pageable<Namespace[]>;
14
+ /**
15
+ * Gets the root namespaces. The requests supports paging, i.e. retrieving the root namespaces in batches of a specified size.
16
+ * @param id - The topmost namespace database id up to which root namespaces are returned. The parameter is optional. If not supplied the most recent rented root namespaces are returned.
17
+ * @param pageSize - (Optional) The number of namespace objects to be returned for each request. The parameter is optional. The default value is 25, the minimum value is 5 and the maximum value is 100.
18
+ * @returns Observable<Namespace[]>
19
+ */
20
+ getRootNamespaces(id?: number, pageSize?: number): Observable<Namespace[]>;
21
+ /**
22
+ * Gets the namespace with given id.
23
+ * @param namespace - The namespace id.
24
+ * @returns Observable<Namespace>
25
+ */
26
+ getNamespace(namespace: string): Observable<Namespace>;
27
+ }
@@ -0,0 +1,78 @@
1
+ "use strict";
2
+ /*
3
+ * The MIT License (MIT)
4
+ *
5
+ * Copyright (c) 2017 NEM
6
+ *
7
+ * Permission is hereby granted, free of charge, to any person obtaining a copy
8
+ * of this software and associated documentation files (the "Software"), to deal
9
+ * in the Software without restriction, including without limitation the rights
10
+ * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
11
+ * copies of the Software, and to permit persons to whom the Software is
12
+ * furnished to do so, subject to the following conditions:
13
+ *
14
+ * The above copyright notice and this permission notice shall be included in all
15
+ * copies or substantial portions of the Software.
16
+ *
17
+ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
18
+ * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
19
+ * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
20
+ * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
21
+ * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
22
+ * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
23
+ * SOFTWARE.
24
+ */
25
+ Object.defineProperty(exports, "__esModule", { value: true });
26
+ const requestPromise = require("request-promise-native");
27
+ const rxjs_1 = require("rxjs");
28
+ const Namespace_1 = require("../models/namespace/Namespace");
29
+ const HttpEndpoint_1 = require("./HttpEndpoint");
30
+ const NamespacesPageable_1 = require("./NamespacesPageable");
31
+ const operators_1 = require("rxjs/operators");
32
+ class NamespaceHttp extends HttpEndpoint_1.HttpEndpoint {
33
+ constructor(nodes) {
34
+ super("namespace", nodes);
35
+ }
36
+ /**
37
+ * Paginaged version of incomingTransactions request
38
+ * @param address
39
+ * @param params
40
+ */
41
+ getRootNamespacesPaginated(params) {
42
+ if (params === undefined)
43
+ params = {};
44
+ return new NamespacesPageable_1.NamespacesPageable(this, params);
45
+ }
46
+ /**
47
+ * Gets the root namespaces. The requests supports paging, i.e. retrieving the root namespaces in batches of a specified size.
48
+ * @param id - The topmost namespace database id up to which root namespaces are returned. The parameter is optional. If not supplied the most recent rented root namespaces are returned.
49
+ * @param pageSize - (Optional) The number of namespace objects to be returned for each request. The parameter is optional. The default value is 25, the minimum value is 5 and the maximum value is 100.
50
+ * @returns Observable<Namespace[]>
51
+ */
52
+ getRootNamespaces(id, pageSize) {
53
+ const query = [
54
+ id ? "id=" + id : null,
55
+ pageSize ? "pageSize=" + pageSize : null
56
+ ].filter(_ => _).join("&");
57
+ const url = "root/page" + (query.length > 0 ? "?" + query : "");
58
+ return rxjs_1.of(url)
59
+ .pipe(operators_1.flatMap((url) => requestPromise.get(this.nextNode() + url, { json: true })), operators_1.retryWhen(this.replyWhenRequestError), operators_1.map((namespacesData) => {
60
+ return namespacesData.data.map((namespace) => {
61
+ return Namespace_1.Namespace.createFromNamespaceMetaDataPairDTO(namespace);
62
+ });
63
+ }));
64
+ }
65
+ /**
66
+ * Gets the namespace with given id.
67
+ * @param namespace - The namespace id.
68
+ * @returns Observable<Namespace>
69
+ */
70
+ getNamespace(namespace) {
71
+ return rxjs_1.of("?namespace=" + namespace)
72
+ .pipe(operators_1.flatMap((url) => requestPromise.get(this.nextNode() + url, { json: true })), operators_1.retryWhen(this.replyWhenRequestError), operators_1.map((namespace) => {
73
+ return Namespace_1.Namespace.createFromNamespaceDTO(namespace);
74
+ }));
75
+ }
76
+ }
77
+ exports.NamespaceHttp = NamespaceHttp;
78
+ //# sourceMappingURL=NamespaceHttp.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"NamespaceHttp.js","sourceRoot":"","sources":["../../../src/infrastructure/NamespaceHttp.ts"],"names":[],"mappings":";AAAA;;;;;;;;;;;;;;;;;;;;;;GAsBG;;AAEH,yDAAyD;AACzD,+BAAoC;AAEpC,6DAAwD;AACxD,iDAA0D;AAI1D,6DAAwD;AACxD,8CAAuD;AAEvD,mBAA2B,SAAQ,2BAAY;IAE7C,YAAY,KAAsB;QAChC,KAAK,CAAC,WAAW,EAAE,KAAK,CAAC,CAAC;IAC5B,CAAC;IAED;;;;OAIG;IACI,0BAA0B,CAAC,MAAoB;QACpD,IAAI,MAAM,KAAK,SAAS;YAAE,MAAM,GAAG,EAAE,CAAC;QACtC,OAAO,IAAI,uCAAkB,CAAC,IAAI,EAAE,MAAM,CAAC,CAAC;IAC9C,CAAC;IAED;;;;;OAKG;IACI,iBAAiB,CAAC,EAAW,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C,CAAC,SAAuB,EAAE,EAAE;YAC9B,OAAO,qBAAS,CAAC,sBAAsB,CAAC,SAAS,CAAC,CAAC;QACrD,CAAC,CAAC,CACH,CAAA;IACL,CAAC;CAEF;AAxDD,sCAwDC"}
@@ -0,0 +1 @@
1
+ export {};
@@ -0,0 +1,28 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ const Pageable_1 = require("./Pageable");
4
+ /**
5
+ * @internal
6
+ */
7
+ class NamespacesPageable extends Pageable_1.Pageable {
8
+ constructor(source, params) {
9
+ super();
10
+ this.resource = source;
11
+ this.params = params;
12
+ }
13
+ nextPage() {
14
+ this.resource.getRootNamespaces(this.params.id, this.params.pageSize).subscribe((next) => {
15
+ if (next.length != 0) {
16
+ this.params.id = next[next.length - 1].id;
17
+ this.next(next);
18
+ }
19
+ else {
20
+ this.complete();
21
+ }
22
+ }, (err) => {
23
+ this.error(err);
24
+ });
25
+ }
26
+ }
27
+ exports.NamespacesPageable = NamespacesPageable;
28
+ //# sourceMappingURL=NamespacesPageable.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"NamespacesPageable.js","sourceRoot":"","sources":["../../../src/infrastructure/NamespacesPageable.ts"],"names":[],"mappings":";;AA0BA,yCAAoC;AAEpC;;GAEG;AACH,wBAAgC,SAAQ,mBAAqB;IAI3D,YAAY,MAAqB,EAAE,MAAmB;QACpD,KAAK,EAAE,CAAC;QACR,IAAI,CAAC,QAAQ,GAAG,MAAM,CAAC;QACvB,IAAI,CAAC,MAAM,GAAG,MAAM,CAAC;IACvB,CAAC;IAEM,QAAQ;QACb,IAAI,CAAC,QAAQ,CAAC,iBAAiB,CAAC,IAAI,CAAC,MAAM,CAAC,EAAE,EAAE,IAAI,CAAC,MAAM,CAAC,QAAQ,CAAC,CAAC,SAAS,CAAC,CAAC,IAAI,EAAE,EAAE;YACvF,IAAI,IAAI,CAAC,MAAM,IAAI,CAAC,EAAE;gBACpB,IAAI,CAAC,MAAM,CAAC,EAAE,GAAG,IAAI,CAAC,IAAI,CAAC,MAAM,GAAG,CAAC,CAAC,CAAC,EAAE,CAAC;gBAC1C,IAAI,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC;aACjB;iBAAM;gBACL,IAAI,CAAC,QAAQ,EAAE,CAAC;aACjB;QACH,CAAC,EAAE,CAAC,GAAG,EAAE,EAAE;YACT,IAAI,CAAC,KAAK,CAAC,GAAG,CAAC,CAAC;QAClB,CAAC,CAAC,CAAC;IACL,CAAC;CACF;AAtBD,gDAsBC"}
@@ -0,0 +1,45 @@
1
+ import { Observable } from "rxjs";
2
+ import { ExtendedNodeExperience } from "../models/node/ExtendedNodeExperience";
3
+ import { NisNodeInfo } from "../models/node/NisNodeInfo";
4
+ import { Node } from "../models/node/Node";
5
+ import { NodeCollection } from "../models/node/NodeCollection";
6
+ import { BlockHeight } from "./BlockHttp";
7
+ import { HttpEndpoint, ServerConfig } from "./HttpEndpoint";
8
+ export declare class NodeHttp extends HttpEndpoint {
9
+ constructor(nodes?: ServerConfig[]);
10
+ /**
11
+ * Gets basic information about a node
12
+ * @returns Observable<Node>
13
+ */
14
+ getNodeInfo(): Observable<Node>;
15
+ /**
16
+ * Gets extended information about a node
17
+ * @returns Observable<NisNodeInfo>
18
+ */
19
+ getNisNodeInfo(): Observable<NisNodeInfo>;
20
+ /**
21
+ * Gets an array of all known nodes in the neighborhood.
22
+ * @returns Observable<NodeCollection>
23
+ */
24
+ getAllNodes(): Observable<NodeCollection>;
25
+ /**
26
+ * Gets an array of all nodes with status 'active' in the neighborhood.
27
+ * @returns Observable<Node[]>
28
+ */
29
+ getActiveNodes(): Observable<Node[]>;
30
+ /**
31
+ * Gets an array of active nodes in the neighborhood that are selected for broadcasts.
32
+ * @returns Observable<Node[]>
33
+ */
34
+ getActiveNeighbourNodes(): Observable<Node[]>;
35
+ /**
36
+ * Requests the chain height from every node in the active node list and returns the maximum height seen.
37
+ * @returns Observable<BlockHeight>
38
+ */
39
+ getMaximumChainHeightInActiveNeighborhood(): Observable<BlockHeight>;
40
+ /**
41
+ * Requests the chain height from every node in the active node list and returns the maximum height seen.
42
+ * @returns Observable<ExtendedNodeExperience[]>
43
+ */
44
+ getNodeExperiences(): Observable<ExtendedNodeExperience[]>;
45
+ }
@@ -0,0 +1,116 @@
1
+ "use strict";
2
+ /*
3
+ * The MIT License (MIT)
4
+ *
5
+ * Copyright (c) 2017 NEM
6
+ *
7
+ * Permission is hereby granted, free of charge, to any person obtaining a copy
8
+ * of this software and associated documentation files (the "Software"), to deal
9
+ * in the Software without restriction, including without limitation the rights
10
+ * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
11
+ * copies of the Software, and to permit persons to whom the Software is
12
+ * furnished to do so, subject to the following conditions:
13
+ *
14
+ * The above copyright notice and this permission notice shall be included in all
15
+ * copies or substantial portions of the Software.
16
+ *
17
+ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
18
+ * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
19
+ * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
20
+ * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
21
+ * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
22
+ * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
23
+ * SOFTWARE.
24
+ */
25
+ Object.defineProperty(exports, "__esModule", { value: true });
26
+ const requestPromise = require("request-promise-native");
27
+ const rxjs_1 = require("rxjs");
28
+ const ExtendedNodeExperience_1 = require("../models/node/ExtendedNodeExperience");
29
+ const NisNodeInfo_1 = require("../models/node/NisNodeInfo");
30
+ const Node_1 = require("../models/node/Node");
31
+ const NodeCollection_1 = require("../models/node/NodeCollection");
32
+ const HttpEndpoint_1 = require("./HttpEndpoint");
33
+ const operators_1 = require("rxjs/operators");
34
+ class NodeHttp extends HttpEndpoint_1.HttpEndpoint {
35
+ constructor(nodes) {
36
+ super("node", nodes);
37
+ }
38
+ /**
39
+ * Gets basic information about a node
40
+ * @returns Observable<Node>
41
+ */
42
+ getNodeInfo() {
43
+ return rxjs_1.of("info")
44
+ .pipe(operators_1.flatMap((url) => requestPromise.get(this.nextNode() + url, { json: true })), operators_1.retryWhen(this.replyWhenRequestError), operators_1.map((nodeDTO) => {
45
+ return Node_1.Node.createFromNodeDTO(nodeDTO);
46
+ }));
47
+ }
48
+ /**
49
+ * Gets extended information about a node
50
+ * @returns Observable<NisNodeInfo>
51
+ */
52
+ getNisNodeInfo() {
53
+ return rxjs_1.of("extended-info")
54
+ .pipe(operators_1.flatMap((url) => requestPromise.get(this.nextNode() + url, { json: true })), operators_1.retryWhen(this.replyWhenRequestError), operators_1.map((nisNodeInfoDTO) => {
55
+ return NisNodeInfo_1.NisNodeInfo.createFromNisNodeInfoDTO(nisNodeInfoDTO);
56
+ }));
57
+ }
58
+ /**
59
+ * Gets an array of all known nodes in the neighborhood.
60
+ * @returns Observable<NodeCollection>
61
+ */
62
+ getAllNodes() {
63
+ return rxjs_1.of("peer-list/all")
64
+ .pipe(operators_1.flatMap((url) => requestPromise.get(this.nextNode() + url, { json: true })), operators_1.retryWhen(this.replyWhenRequestError), operators_1.map((nodeCollectionDTO) => {
65
+ return NodeCollection_1.NodeCollection.createFromNodeCollectionDTO(nodeCollectionDTO);
66
+ }));
67
+ }
68
+ /**
69
+ * Gets an array of all nodes with status 'active' in the neighborhood.
70
+ * @returns Observable<Node[]>
71
+ */
72
+ getActiveNodes() {
73
+ return rxjs_1.of("peer-list/reachable")
74
+ .pipe(operators_1.flatMap((url) => requestPromise.get(this.nextNode() + url, { json: true })), operators_1.retryWhen(this.replyWhenRequestError), operators_1.map((nodeCollectionData) => {
75
+ return nodeCollectionData.data.map((nodeDTO) => {
76
+ return Node_1.Node.createFromNodeDTO(nodeDTO);
77
+ });
78
+ }));
79
+ }
80
+ /**
81
+ * Gets an array of active nodes in the neighborhood that are selected for broadcasts.
82
+ * @returns Observable<Node[]>
83
+ */
84
+ getActiveNeighbourNodes() {
85
+ return rxjs_1.of("peer-list/active")
86
+ .pipe(operators_1.flatMap((url) => requestPromise.get(this.nextNode() + url, { json: true })), operators_1.retryWhen(this.replyWhenRequestError), operators_1.map((nodeCollectionData) => {
87
+ return nodeCollectionData.data.map((nodeDTO) => {
88
+ return Node_1.Node.createFromNodeDTO(nodeDTO);
89
+ });
90
+ }));
91
+ }
92
+ /**
93
+ * Requests the chain height from every node in the active node list and returns the maximum height seen.
94
+ * @returns Observable<BlockHeight>
95
+ */
96
+ getMaximumChainHeightInActiveNeighborhood() {
97
+ return rxjs_1.of("active-peers/max-chain-height")
98
+ .pipe(operators_1.flatMap((url) => requestPromise.get(this.nextNode() + url, { json: true })), operators_1.retryWhen(this.replyWhenRequestError), operators_1.map((blockHeight) => {
99
+ return blockHeight.height;
100
+ }));
101
+ }
102
+ /**
103
+ * Requests the chain height from every node in the active node list and returns the maximum height seen.
104
+ * @returns Observable<ExtendedNodeExperience[]>
105
+ */
106
+ getNodeExperiences() {
107
+ return rxjs_1.of("experiences")
108
+ .pipe(operators_1.flatMap((url) => requestPromise.get(this.nextNode() + url, { json: true })), operators_1.retryWhen(this.replyWhenRequestError), operators_1.map((extendedNodeExperiencePairData) => {
109
+ return extendedNodeExperiencePairData.data.map((extendedNodeExperiencePairDTO) => {
110
+ return ExtendedNodeExperience_1.ExtendedNodeExperience.createFromExtendedNodeExperiencePairDTO(extendedNodeExperiencePairDTO);
111
+ });
112
+ }));
113
+ }
114
+ }
115
+ exports.NodeHttp = NodeHttp;
116
+ //# sourceMappingURL=NodeHttp.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"NodeHttp.js","sourceRoot":"","sources":["../../../src/infrastructure/NodeHttp.ts"],"names":[],"mappings":";AAAA;;;;;;;;;;;;;;;;;;;;;;GAsBG;;AAEH,yD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