@decaf-ts/for-fabric 0.9.0 → 0.10.0

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 (623) hide show
  1. package/lib/cjs/bin/cli.cjs +3 -2
  2. package/lib/cjs/bin/cli.cjs.map +1 -0
  3. package/lib/cjs/cli-module.cjs +26 -25
  4. package/lib/cjs/cli-module.cjs.map +1 -0
  5. package/lib/cjs/cli-utils.cjs +5 -5
  6. package/lib/cjs/cli-utils.cjs.map +1 -0
  7. package/lib/cjs/client/FabricClientAdapter.cjs +46 -40
  8. package/lib/cjs/client/FabricClientAdapter.cjs.map +1 -0
  9. package/lib/cjs/client/FabricClientDispatch.cjs +8 -7
  10. package/lib/cjs/client/FabricClientDispatch.cjs.map +1 -0
  11. package/lib/cjs/client/FabricClientPaginator.cjs +1 -0
  12. package/lib/cjs/client/FabricClientPaginator.cjs.map +1 -0
  13. package/lib/cjs/client/FabricClientRepository.cjs +4 -3
  14. package/lib/cjs/client/FabricClientRepository.cjs.map +1 -0
  15. package/lib/cjs/client/FabricClientStatement.cjs +1 -0
  16. package/lib/cjs/client/FabricClientStatement.cjs.map +1 -0
  17. package/lib/cjs/client/collections/generation.cjs +3 -2
  18. package/lib/cjs/client/collections/generation.cjs.map +1 -0
  19. package/lib/cjs/client/collections/index.cjs +1 -0
  20. package/lib/cjs/client/collections/index.cjs.map +1 -0
  21. package/lib/cjs/client/constants.cjs +1 -0
  22. package/lib/cjs/client/constants.cjs.map +1 -0
  23. package/lib/cjs/client/crypto.cjs +12 -13
  24. package/lib/cjs/client/crypto.cjs.map +1 -0
  25. package/lib/cjs/client/erc20/FabricERC20ClientRepository.cjs +7 -6
  26. package/lib/cjs/client/erc20/FabricERC20ClientRepository.cjs.map +1 -0
  27. package/lib/cjs/client/erc20/index.cjs +1 -0
  28. package/lib/cjs/client/erc20/index.cjs.map +1 -0
  29. package/lib/cjs/client/fabric-fs.cjs +1 -0
  30. package/lib/cjs/client/fabric-fs.cjs.map +1 -0
  31. package/lib/cjs/client/fabric-hsm.cjs +3 -2
  32. package/lib/cjs/client/fabric-hsm.cjs.map +1 -0
  33. package/lib/cjs/client/ids/id-extraction.cjs +1 -0
  34. package/lib/cjs/client/ids/id-extraction.cjs.map +1 -0
  35. package/lib/cjs/client/ids/index.cjs +1 -0
  36. package/lib/cjs/client/ids/index.cjs.map +1 -0
  37. package/lib/cjs/client/index.cjs +10 -9
  38. package/lib/cjs/client/index.cjs.map +1 -0
  39. package/lib/cjs/client/indexes/generation.cjs +1 -0
  40. package/lib/cjs/client/indexes/generation.cjs.map +1 -0
  41. package/lib/cjs/client/indexes/index.cjs +1 -0
  42. package/lib/cjs/client/indexes/index.cjs.map +1 -0
  43. package/lib/cjs/client/logging.cjs +1 -0
  44. package/lib/cjs/client/logging.cjs.map +1 -0
  45. package/lib/cjs/client/services/FabricEnrollmentService.cjs +17 -32
  46. package/lib/cjs/client/services/FabricEnrollmentService.cjs.map +1 -0
  47. package/lib/cjs/client/services/FabricIdentityService.cjs +15 -14
  48. package/lib/cjs/client/services/FabricIdentityService.cjs.map +1 -0
  49. package/lib/cjs/client/services/RegistrationRequestBuilder.cjs +11 -5
  50. package/lib/cjs/client/services/RegistrationRequestBuilder.cjs.map +1 -0
  51. package/lib/cjs/client/services/constants.cjs +2 -9
  52. package/lib/cjs/client/services/constants.cjs.map +1 -0
  53. package/lib/cjs/client/services/index.cjs +1 -0
  54. package/lib/cjs/client/services/index.cjs.map +1 -0
  55. package/lib/cjs/client/types.cjs +1 -0
  56. package/lib/cjs/client/types.cjs.map +1 -0
  57. package/lib/cjs/client/utils.cjs +1 -0
  58. package/lib/cjs/client/utils.cjs.map +1 -0
  59. package/lib/cjs/contract/Address.cjs +14 -8
  60. package/lib/cjs/contract/Address.cjs.map +1 -0
  61. package/lib/cjs/contract/AddressContract.cjs +15 -9
  62. package/lib/cjs/contract/AddressContract.cjs.map +1 -0
  63. package/lib/cjs/contract/AuditContract.cjs +15 -9
  64. package/lib/cjs/contract/AuditContract.cjs.map +1 -0
  65. package/lib/cjs/contract/BatchContract.cjs +15 -9
  66. package/lib/cjs/contract/BatchContract.cjs.map +1 -0
  67. package/lib/cjs/contract/MarketContract.cjs +15 -9
  68. package/lib/cjs/contract/MarketContract.cjs.map +1 -0
  69. package/lib/cjs/contract/OtherAuditContract.cjs +15 -9
  70. package/lib/cjs/contract/OtherAuditContract.cjs.map +1 -0
  71. package/lib/cjs/contract/OtherBatchContract.cjs +15 -9
  72. package/lib/cjs/contract/OtherBatchContract.cjs.map +1 -0
  73. package/lib/cjs/contract/OtherMarketContract.cjs +15 -9
  74. package/lib/cjs/contract/OtherMarketContract.cjs.map +1 -0
  75. package/lib/cjs/contract/OtherProductContract.cjs +15 -9
  76. package/lib/cjs/contract/OtherProductContract.cjs.map +1 -0
  77. package/lib/cjs/contract/OtherProductImageContract.cjs +15 -9
  78. package/lib/cjs/contract/OtherProductImageContract.cjs.map +1 -0
  79. package/lib/cjs/contract/OtherProductSharedContract.cjs +15 -9
  80. package/lib/cjs/contract/OtherProductSharedContract.cjs.map +1 -0
  81. package/lib/cjs/contract/OtherProductStrengthContract.cjs +15 -9
  82. package/lib/cjs/contract/OtherProductStrengthContract.cjs.map +1 -0
  83. package/lib/cjs/contract/Product.cjs +15 -9
  84. package/lib/cjs/contract/Product.cjs.map +1 -0
  85. package/lib/cjs/contract/ProductContract.cjs +15 -9
  86. package/lib/cjs/contract/ProductContract.cjs.map +1 -0
  87. package/lib/cjs/contract/ProductStrengthContract.cjs +15 -9
  88. package/lib/cjs/contract/ProductStrengthContract.cjs.map +1 -0
  89. package/lib/cjs/contract/SegregatedPrivateDocumentContract.cjs +15 -9
  90. package/lib/cjs/contract/SegregatedPrivateDocumentContract.cjs.map +1 -0
  91. package/lib/cjs/contract/SegregatedSharedDocumentContract.cjs +15 -9
  92. package/lib/cjs/contract/SegregatedSharedDocumentContract.cjs.map +1 -0
  93. package/lib/cjs/contract/User.cjs +13 -7
  94. package/lib/cjs/contract/User.cjs.map +1 -0
  95. package/lib/cjs/contract/UserContract.cjs +15 -9
  96. package/lib/cjs/contract/UserContract.cjs.map +1 -0
  97. package/lib/cjs/contract/index.cjs +31 -30
  98. package/lib/cjs/contract/index.cjs.map +1 -0
  99. package/lib/cjs/contract/logging-context.cjs +1 -0
  100. package/lib/cjs/contract/logging-context.cjs.map +1 -0
  101. package/lib/cjs/contract/models/Audit.cjs +17 -11
  102. package/lib/cjs/contract/models/Audit.cjs.map +1 -0
  103. package/lib/cjs/contract/models/BaseIdentifiedModel.cjs +15 -9
  104. package/lib/cjs/contract/models/BaseIdentifiedModel.cjs.map +1 -0
  105. package/lib/cjs/contract/models/BaseModel.cjs +13 -7
  106. package/lib/cjs/contract/models/BaseModel.cjs.map +1 -0
  107. package/lib/cjs/contract/models/Batch.cjs +24 -18
  108. package/lib/cjs/contract/models/Batch.cjs.map +1 -0
  109. package/lib/cjs/contract/models/GtinOwner.cjs +18 -12
  110. package/lib/cjs/contract/models/GtinOwner.cjs.map +1 -0
  111. package/lib/cjs/contract/models/History.cjs +15 -9
  112. package/lib/cjs/contract/models/History.cjs.map +1 -0
  113. package/lib/cjs/contract/models/Leaflet.cjs +25 -19
  114. package/lib/cjs/contract/models/Leaflet.cjs.map +1 -0
  115. package/lib/cjs/contract/models/LeafletFile.cjs +19 -13
  116. package/lib/cjs/contract/models/LeafletFile.cjs.map +1 -0
  117. package/lib/cjs/contract/models/Market.cjs +19 -13
  118. package/lib/cjs/contract/models/Market.cjs.map +1 -0
  119. package/lib/cjs/contract/models/OtherAudit.cjs +20 -14
  120. package/lib/cjs/contract/models/OtherAudit.cjs.map +1 -0
  121. package/lib/cjs/contract/models/OtherBatchShared.cjs +27 -21
  122. package/lib/cjs/contract/models/OtherBatchShared.cjs.map +1 -0
  123. package/lib/cjs/contract/models/OtherLeaflet.cjs +27 -21
  124. package/lib/cjs/contract/models/OtherLeaflet.cjs.map +1 -0
  125. package/lib/cjs/contract/models/OtherLeafletFile.cjs +18 -12
  126. package/lib/cjs/contract/models/OtherLeafletFile.cjs.map +1 -0
  127. package/lib/cjs/contract/models/OtherMarket.cjs +21 -15
  128. package/lib/cjs/contract/models/OtherMarket.cjs.map +1 -0
  129. package/lib/cjs/contract/models/OtherProduct.cjs +24 -18
  130. package/lib/cjs/contract/models/OtherProduct.cjs.map +1 -0
  131. package/lib/cjs/contract/models/OtherProductImage.cjs +22 -16
  132. package/lib/cjs/contract/models/OtherProductImage.cjs.map +1 -0
  133. package/lib/cjs/contract/models/OtherProductShared.cjs +32 -26
  134. package/lib/cjs/contract/models/OtherProductShared.cjs.map +1 -0
  135. package/lib/cjs/contract/models/OtherProductStrength.cjs +21 -15
  136. package/lib/cjs/contract/models/OtherProductStrength.cjs.map +1 -0
  137. package/lib/cjs/contract/models/Product.cjs +24 -18
  138. package/lib/cjs/contract/models/Product.cjs.map +1 -0
  139. package/lib/cjs/contract/models/ProductStrength.cjs +19 -13
  140. package/lib/cjs/contract/models/ProductStrength.cjs.map +1 -0
  141. package/lib/cjs/contract/models/SegregatedDocument.cjs +23 -17
  142. package/lib/cjs/contract/models/SegregatedDocument.cjs.map +1 -0
  143. package/lib/cjs/contract/models/constants.cjs +3 -4
  144. package/lib/cjs/contract/models/constants.cjs.map +1 -0
  145. package/lib/cjs/contract/models/decorators-private.cjs +11 -10
  146. package/lib/cjs/contract/models/decorators-private.cjs.map +1 -0
  147. package/lib/cjs/contract/models/decorators.cjs +13 -12
  148. package/lib/cjs/contract/models/decorators.cjs.map +1 -0
  149. package/lib/cjs/contract/models/gtin.cjs +13 -7
  150. package/lib/cjs/contract/models/gtin.cjs.map +1 -0
  151. package/lib/cjs/contract/models/history-dec.cjs +11 -10
  152. package/lib/cjs/contract/models/history-dec.cjs.map +1 -0
  153. package/lib/cjs/contracts/ContractAdapter.cjs +27 -26
  154. package/lib/cjs/contracts/ContractAdapter.cjs.map +1 -0
  155. package/lib/cjs/contracts/ContractContext.cjs +1 -0
  156. package/lib/cjs/contracts/ContractContext.cjs.map +1 -0
  157. package/lib/cjs/contracts/FabricContractDispatch.cjs +1 -0
  158. package/lib/cjs/contracts/FabricContractDispatch.cjs.map +1 -0
  159. package/lib/cjs/contracts/FabricContractPaginator.cjs +5 -4
  160. package/lib/cjs/contracts/FabricContractPaginator.cjs.map +1 -0
  161. package/lib/cjs/contracts/FabricContractRepository.cjs +8 -7
  162. package/lib/cjs/contracts/FabricContractRepository.cjs.map +1 -0
  163. package/lib/cjs/contracts/FabricContractRepositoryObservableHandler.cjs +3 -2
  164. package/lib/cjs/contracts/FabricContractRepositoryObservableHandler.cjs.map +1 -0
  165. package/lib/cjs/contracts/FabricContractSequence.cjs +1 -0
  166. package/lib/cjs/contracts/FabricContractSequence.cjs.map +1 -0
  167. package/lib/cjs/contracts/FabricContractStatement.cjs +5 -4
  168. package/lib/cjs/contracts/FabricContractStatement.cjs.map +1 -0
  169. package/lib/cjs/contracts/MigrationContract.cjs +20 -14
  170. package/lib/cjs/contracts/MigrationContract.cjs.map +1 -0
  171. package/lib/cjs/contracts/PrivateSequence.cjs +11 -5
  172. package/lib/cjs/contracts/PrivateSequence.cjs.map +1 -0
  173. package/lib/cjs/contracts/auth/decorators.cjs +3 -2
  174. package/lib/cjs/contracts/auth/decorators.cjs.map +1 -0
  175. package/lib/cjs/contracts/auth/index.cjs +1 -0
  176. package/lib/cjs/contracts/auth/index.cjs.map +1 -0
  177. package/lib/cjs/contracts/crud/crud-contract.cjs +12 -11
  178. package/lib/cjs/contracts/crud/crud-contract.cjs.map +1 -0
  179. package/lib/cjs/contracts/crud/index.cjs +1 -0
  180. package/lib/cjs/contracts/crud/index.cjs.map +1 -0
  181. package/lib/cjs/contracts/crud/serialized-crud-contract.cjs +13 -7
  182. package/lib/cjs/contracts/crud/serialized-crud-contract.cjs.map +1 -0
  183. package/lib/cjs/contracts/erc20/erc20contract.cjs +53 -47
  184. package/lib/cjs/contracts/erc20/erc20contract.cjs.map +1 -0
  185. package/lib/cjs/contracts/erc20/index.cjs +3 -2
  186. package/lib/cjs/contracts/erc20/index.cjs.map +1 -0
  187. package/lib/cjs/contracts/erc20/models.cjs +11 -5
  188. package/lib/cjs/contracts/erc20/models.cjs.map +1 -0
  189. package/lib/cjs/contracts/index.cjs +1 -0
  190. package/lib/cjs/contracts/index.cjs.map +1 -0
  191. package/lib/cjs/contracts/logging.cjs +4 -3
  192. package/lib/cjs/contracts/logging.cjs.map +1 -0
  193. package/lib/cjs/contracts/overrides.cjs +3 -2
  194. package/lib/cjs/contracts/overrides.cjs.map +1 -0
  195. package/lib/cjs/contracts/types.cjs +1 -0
  196. package/lib/cjs/contracts/types.cjs.map +1 -0
  197. package/lib/cjs/contracts/uuid.cjs +1 -0
  198. package/lib/cjs/contracts/uuid.cjs.map +1 -0
  199. package/lib/cjs/index.cjs +6 -5
  200. package/lib/cjs/index.cjs.map +1 -0
  201. package/lib/cjs/shared/ClientSerializer.cjs +1 -0
  202. package/lib/cjs/shared/ClientSerializer.cjs.map +1 -0
  203. package/lib/cjs/shared/DeterministicSerializer.cjs +1 -0
  204. package/lib/cjs/shared/DeterministicSerializer.cjs.map +1 -0
  205. package/lib/cjs/shared/SimpleDeterministicSerializer.cjs +3 -2
  206. package/lib/cjs/shared/SimpleDeterministicSerializer.cjs.map +1 -0
  207. package/lib/cjs/shared/constants.cjs +3 -18
  208. package/lib/cjs/shared/constants.cjs.map +1 -0
  209. package/lib/cjs/shared/decorators.cjs +14 -13
  210. package/lib/cjs/shared/decorators.cjs.map +1 -0
  211. package/lib/cjs/shared/erc20/erc20-constants.cjs +2 -9
  212. package/lib/cjs/shared/erc20/erc20-constants.cjs.map +1 -0
  213. package/lib/cjs/shared/erc20/index.cjs +1 -0
  214. package/lib/cjs/shared/erc20/index.cjs.map +1 -0
  215. package/lib/cjs/shared/errors.cjs +1 -0
  216. package/lib/cjs/shared/errors.cjs.map +1 -0
  217. package/lib/cjs/shared/events.cjs +1 -0
  218. package/lib/cjs/shared/events.cjs.map +1 -0
  219. package/lib/cjs/shared/fabric-types.cjs +1 -0
  220. package/lib/cjs/shared/fabric-types.cjs.map +1 -0
  221. package/lib/cjs/shared/index.cjs +1 -0
  222. package/lib/cjs/shared/index.cjs.map +1 -0
  223. package/lib/cjs/shared/interfaces/Checkable.cjs +1 -0
  224. package/lib/cjs/shared/interfaces/Checkable.cjs.map +1 -0
  225. package/lib/cjs/shared/interfaces/index.cjs +1 -0
  226. package/lib/cjs/shared/interfaces/index.cjs.map +1 -0
  227. package/lib/cjs/shared/math.cjs +4 -3
  228. package/lib/cjs/shared/math.cjs.map +1 -0
  229. package/lib/cjs/shared/model/FabricBaseModel.cjs +13 -7
  230. package/lib/cjs/shared/model/FabricBaseModel.cjs.map +1 -0
  231. package/lib/cjs/shared/model/FabricIdentifiedBaseModel.cjs +15 -9
  232. package/lib/cjs/shared/model/FabricIdentifiedBaseModel.cjs.map +1 -0
  233. package/lib/cjs/shared/model/Identity.cjs +16 -10
  234. package/lib/cjs/shared/model/Identity.cjs.map +1 -0
  235. package/lib/cjs/shared/model/IdentityCredentials.cjs +11 -5
  236. package/lib/cjs/shared/model/IdentityCredentials.cjs.map +1 -0
  237. package/lib/cjs/shared/model/index.cjs +1 -0
  238. package/lib/cjs/shared/model/index.cjs.map +1 -0
  239. package/lib/cjs/shared/overrides/Model.cjs +1 -0
  240. package/lib/cjs/shared/overrides/Model.cjs.map +1 -0
  241. package/lib/cjs/shared/overrides/index.cjs +1 -0
  242. package/lib/cjs/shared/overrides/index.cjs.map +1 -0
  243. package/lib/cjs/shared/overrides/overrides.cjs +11 -10
  244. package/lib/cjs/shared/overrides/overrides.cjs.map +1 -0
  245. package/lib/cjs/shared/types.cjs +1 -0
  246. package/lib/cjs/shared/types.cjs.map +1 -0
  247. package/lib/cjs/version.cjs +2 -1
  248. package/lib/cjs/version.cjs.map +1 -0
  249. package/lib/esm/version.js +1 -1
  250. package/lib/types/bin/cli.d.cts +1 -0
  251. package/lib/types/bin/cli.d.mts +1 -0
  252. package/lib/types/cli-module.d.cts +3 -0
  253. package/lib/types/cli-module.d.mts +3 -0
  254. package/lib/types/cli-utils.d.cts +21 -0
  255. package/lib/types/cli-utils.d.mts +21 -0
  256. package/lib/types/client/FabricClientAdapter.d.cts +404 -0
  257. package/lib/types/client/FabricClientAdapter.d.mts +404 -0
  258. package/lib/types/client/FabricClientDispatch.d.cts +133 -0
  259. package/lib/types/client/FabricClientDispatch.d.mts +133 -0
  260. package/lib/types/client/FabricClientPaginator.d.cts +12 -0
  261. package/lib/types/client/FabricClientPaginator.d.mts +12 -0
  262. package/lib/types/client/FabricClientRepository.d.cts +71 -0
  263. package/lib/types/client/FabricClientRepository.d.mts +71 -0
  264. package/lib/types/client/FabricClientStatement.d.cts +64 -0
  265. package/lib/types/client/FabricClientStatement.d.mts +64 -0
  266. package/lib/types/client/collections/generation.d.cts +46 -0
  267. package/lib/types/client/collections/generation.d.mts +46 -0
  268. package/lib/types/client/collections/index.d.cts +1 -0
  269. package/lib/types/client/collections/index.d.mts +1 -0
  270. package/lib/types/client/constants.d.cts +2 -0
  271. package/lib/types/client/constants.d.mts +2 -0
  272. package/lib/types/client/crypto.d.cts +107 -0
  273. package/lib/types/client/crypto.d.mts +107 -0
  274. package/lib/types/client/erc20/FabricERC20ClientRepository.d.cts +254 -0
  275. package/lib/types/client/erc20/FabricERC20ClientRepository.d.mts +254 -0
  276. package/lib/types/client/erc20/index.d.cts +1 -0
  277. package/lib/types/client/erc20/index.d.mts +1 -0
  278. package/lib/types/client/fabric-fs.d.cts +92 -0
  279. package/lib/types/client/fabric-fs.d.mts +92 -0
  280. package/lib/types/client/fabric-hsm.d.cts +24 -0
  281. package/lib/types/client/fabric-hsm.d.mts +24 -0
  282. package/lib/types/client/ids/id-extraction.d.cts +4 -0
  283. package/lib/types/client/ids/id-extraction.d.mts +4 -0
  284. package/lib/types/client/ids/index.d.cts +1 -0
  285. package/lib/types/client/ids/index.d.mts +1 -0
  286. package/lib/types/client/index.d.cts +23 -0
  287. package/lib/types/client/index.d.mts +23 -0
  288. package/lib/types/client/indexes/generation.d.cts +10 -0
  289. package/lib/types/client/indexes/generation.d.mts +10 -0
  290. package/lib/types/client/indexes/index.d.cts +1 -0
  291. package/lib/types/client/indexes/index.d.mts +1 -0
  292. package/lib/types/client/logging.d.cts +60 -0
  293. package/lib/types/client/logging.d.mts +60 -0
  294. package/lib/types/client/services/FabricEnrollmentService.d.cts +176 -0
  295. package/lib/types/client/services/FabricEnrollmentService.d.mts +176 -0
  296. package/lib/types/client/services/FabricIdentityService.d.cts +98 -0
  297. package/lib/types/client/services/FabricIdentityService.d.mts +98 -0
  298. package/lib/types/client/services/RegistrationRequestBuilder.d.cts +19 -0
  299. package/lib/types/client/services/RegistrationRequestBuilder.d.mts +19 -0
  300. package/lib/types/client/services/constants.d.cts +15 -0
  301. package/lib/types/client/services/constants.d.mts +15 -0
  302. package/lib/types/client/services/index.d.cts +4 -0
  303. package/lib/types/client/services/index.d.mts +4 -0
  304. package/lib/types/client/types.d.cts +20 -0
  305. package/lib/types/client/types.d.mts +20 -0
  306. package/lib/types/client/utils.d.cts +71 -0
  307. package/lib/types/client/utils.d.mts +71 -0
  308. package/lib/types/contract/Address.d.cts +13 -0
  309. package/lib/types/contract/Address.d.mts +13 -0
  310. package/lib/types/contract/AddressContract.d.cts +5 -0
  311. package/lib/types/contract/AddressContract.d.mts +5 -0
  312. package/lib/types/contract/AuditContract.d.cts +5 -0
  313. package/lib/types/contract/AuditContract.d.mts +5 -0
  314. package/lib/types/contract/BatchContract.d.cts +5 -0
  315. package/lib/types/contract/BatchContract.d.mts +5 -0
  316. package/lib/types/contract/MarketContract.d.cts +5 -0
  317. package/lib/types/contract/MarketContract.d.mts +5 -0
  318. package/lib/types/contract/OtherAuditContract.d.cts +5 -0
  319. package/lib/types/contract/OtherAuditContract.d.mts +5 -0
  320. package/lib/types/contract/OtherBatchContract.d.cts +5 -0
  321. package/lib/types/contract/OtherBatchContract.d.mts +5 -0
  322. package/lib/types/contract/OtherMarketContract.d.cts +5 -0
  323. package/lib/types/contract/OtherMarketContract.d.mts +5 -0
  324. package/lib/types/contract/OtherProductContract.d.cts +5 -0
  325. package/lib/types/contract/OtherProductContract.d.mts +5 -0
  326. package/lib/types/contract/OtherProductImageContract.d.cts +5 -0
  327. package/lib/types/contract/OtherProductImageContract.d.mts +5 -0
  328. package/lib/types/contract/OtherProductSharedContract.d.cts +5 -0
  329. package/lib/types/contract/OtherProductSharedContract.d.mts +5 -0
  330. package/lib/types/contract/OtherProductStrengthContract.d.cts +5 -0
  331. package/lib/types/contract/OtherProductStrengthContract.d.mts +5 -0
  332. package/lib/types/contract/Product.d.cts +7 -0
  333. package/lib/types/contract/Product.d.mts +7 -0
  334. package/lib/types/contract/ProductContract.d.cts +5 -0
  335. package/lib/types/contract/ProductContract.d.mts +5 -0
  336. package/lib/types/contract/ProductStrengthContract.d.cts +5 -0
  337. package/lib/types/contract/ProductStrengthContract.d.mts +5 -0
  338. package/lib/types/contract/SegregatedPrivateDocumentContract.d.cts +5 -0
  339. package/lib/types/contract/SegregatedPrivateDocumentContract.d.mts +5 -0
  340. package/lib/types/contract/SegregatedSharedDocumentContract.d.cts +5 -0
  341. package/lib/types/contract/SegregatedSharedDocumentContract.d.mts +5 -0
  342. package/lib/types/contract/User.d.cts +7 -0
  343. package/lib/types/contract/User.d.mts +7 -0
  344. package/lib/types/contract/UserContract.d.cts +5 -0
  345. package/lib/types/contract/UserContract.d.mts +5 -0
  346. package/lib/types/contract/index.d.cts +2 -0
  347. package/lib/types/contract/index.d.mts +2 -0
  348. package/lib/types/contract/logging-context.d.cts +8 -0
  349. package/lib/types/contract/logging-context.d.mts +8 -0
  350. package/lib/types/contract/models/Audit.d.cts +13 -0
  351. package/lib/types/contract/models/Audit.d.mts +13 -0
  352. package/lib/types/contract/models/BaseIdentifiedModel.d.cts +7 -0
  353. package/lib/types/contract/models/BaseIdentifiedModel.d.mts +7 -0
  354. package/lib/types/contract/models/BaseModel.d.cts +7 -0
  355. package/lib/types/contract/models/BaseModel.d.mts +7 -0
  356. package/lib/types/contract/models/Batch.d.cts +18 -0
  357. package/lib/types/contract/models/Batch.d.mts +18 -0
  358. package/lib/types/contract/models/GtinOwner.d.cts +8 -0
  359. package/lib/types/contract/models/GtinOwner.d.mts +8 -0
  360. package/lib/types/contract/models/History.d.cts +9 -0
  361. package/lib/types/contract/models/History.d.mts +9 -0
  362. package/lib/types/contract/models/Leaflet.d.cts +12 -0
  363. package/lib/types/contract/models/Leaflet.d.mts +12 -0
  364. package/lib/types/contract/models/LeafletFile.d.cts +9 -0
  365. package/lib/types/contract/models/LeafletFile.d.mts +9 -0
  366. package/lib/types/contract/models/Market.d.cts +12 -0
  367. package/lib/types/contract/models/Market.d.mts +12 -0
  368. package/lib/types/contract/models/OtherAudit.d.cts +15 -0
  369. package/lib/types/contract/models/OtherAudit.d.mts +15 -0
  370. package/lib/types/contract/models/OtherBatchShared.d.cts +18 -0
  371. package/lib/types/contract/models/OtherBatchShared.d.mts +18 -0
  372. package/lib/types/contract/models/OtherLeaflet.d.cts +16 -0
  373. package/lib/types/contract/models/OtherLeaflet.d.mts +16 -0
  374. package/lib/types/contract/models/OtherLeafletFile.d.cts +10 -0
  375. package/lib/types/contract/models/OtherLeafletFile.d.mts +10 -0
  376. package/lib/types/contract/models/OtherMarket.d.cts +13 -0
  377. package/lib/types/contract/models/OtherMarket.d.mts +13 -0
  378. package/lib/types/contract/models/OtherProduct.d.cts +12 -0
  379. package/lib/types/contract/models/OtherProduct.d.mts +12 -0
  380. package/lib/types/contract/models/OtherProductImage.d.cts +9 -0
  381. package/lib/types/contract/models/OtherProductImage.d.mts +9 -0
  382. package/lib/types/contract/models/OtherProductShared.d.cts +18 -0
  383. package/lib/types/contract/models/OtherProductShared.d.mts +18 -0
  384. package/lib/types/contract/models/OtherProductStrength.d.cts +12 -0
  385. package/lib/types/contract/models/OtherProductStrength.d.mts +12 -0
  386. package/lib/types/contract/models/Product.d.cts +15 -0
  387. package/lib/types/contract/models/Product.d.mts +15 -0
  388. package/lib/types/contract/models/ProductStrength.d.cts +11 -0
  389. package/lib/types/contract/models/ProductStrength.d.mts +11 -0
  390. package/lib/types/contract/models/SegregatedDocument.d.cts +18 -0
  391. package/lib/types/contract/models/SegregatedDocument.d.mts +18 -0
  392. package/lib/types/contract/models/constants.d.cts +24 -0
  393. package/lib/types/contract/models/constants.d.mts +24 -0
  394. package/lib/types/contract/models/decorators-private.d.cts +16 -0
  395. package/lib/types/contract/models/decorators-private.d.mts +16 -0
  396. package/lib/types/contract/models/decorators.d.cts +28 -0
  397. package/lib/types/contract/models/decorators.d.mts +28 -0
  398. package/lib/types/contract/models/gtin.d.cts +8 -0
  399. package/lib/types/contract/models/gtin.d.mts +8 -0
  400. package/lib/types/contract/models/history-dec.d.cts +6 -0
  401. package/lib/types/contract/models/history-dec.d.mts +6 -0
  402. package/lib/types/contracts/ContractAdapter.d.cts +287 -0
  403. package/lib/types/contracts/ContractAdapter.d.mts +287 -0
  404. package/lib/types/contracts/ContractContext.d.cts +89 -0
  405. package/lib/types/contracts/ContractContext.d.mts +89 -0
  406. package/lib/types/contracts/FabricContractDispatch.d.cts +7 -0
  407. package/lib/types/contracts/FabricContractDispatch.d.mts +7 -0
  408. package/lib/types/contracts/FabricContractPaginator.d.cts +105 -0
  409. package/lib/types/contracts/FabricContractPaginator.d.mts +105 -0
  410. package/lib/types/contracts/FabricContractRepository.d.cts +119 -0
  411. package/lib/types/contracts/FabricContractRepository.d.mts +119 -0
  412. package/lib/types/contracts/FabricContractRepositoryObservableHandler.d.cts +62 -0
  413. package/lib/types/contracts/FabricContractRepositoryObservableHandler.d.mts +62 -0
  414. package/lib/types/contracts/FabricContractSequence.d.cts +87 -0
  415. package/lib/types/contracts/FabricContractSequence.d.mts +87 -0
  416. package/lib/types/contracts/FabricContractStatement.d.cts +36 -0
  417. package/lib/types/contracts/FabricContractStatement.d.mts +36 -0
  418. package/lib/types/contracts/MigrationContract.d.cts +22 -0
  419. package/lib/types/contracts/MigrationContract.d.mts +22 -0
  420. package/lib/types/contracts/PrivateSequence.d.cts +15 -0
  421. package/lib/types/contracts/PrivateSequence.d.mts +15 -0
  422. package/lib/types/contracts/auth/decorators.d.cts +6 -0
  423. package/lib/types/contracts/auth/decorators.d.mts +6 -0
  424. package/lib/types/contracts/auth/index.d.cts +1 -0
  425. package/lib/types/contracts/auth/index.d.mts +1 -0
  426. package/lib/types/contracts/crud/crud-contract.d.cts +199 -0
  427. package/lib/types/contracts/crud/crud-contract.d.mts +199 -0
  428. package/lib/types/contracts/crud/index.d.cts +2 -0
  429. package/lib/types/contracts/crud/index.d.mts +2 -0
  430. package/lib/types/contracts/crud/serialized-crud-contract.d.cts +42 -0
  431. package/lib/types/contracts/crud/serialized-crud-contract.d.mts +42 -0
  432. package/lib/types/contracts/erc20/erc20contract.d.cts +152 -0
  433. package/lib/types/contracts/erc20/erc20contract.d.mts +152 -0
  434. package/lib/types/contracts/erc20/index.d.cts +2 -0
  435. package/lib/types/contracts/erc20/index.d.mts +2 -0
  436. package/lib/types/contracts/erc20/models.d.cts +114 -0
  437. package/lib/types/contracts/erc20/models.d.mts +114 -0
  438. package/lib/types/contracts/index.d.cts +20 -0
  439. package/lib/types/contracts/index.d.mts +20 -0
  440. package/lib/types/contracts/logging.d.cts +54 -0
  441. package/lib/types/contracts/logging.d.mts +54 -0
  442. package/lib/types/contracts/overrides.d.cts +1 -0
  443. package/lib/types/contracts/overrides.d.mts +1 -0
  444. package/lib/types/contracts/types.d.cts +38 -0
  445. package/lib/types/contracts/types.d.mts +38 -0
  446. package/lib/types/contracts/uuid.d.cts +2 -0
  447. package/lib/types/contracts/uuid.d.mts +2 -0
  448. package/lib/types/index.d.cts +8 -0
  449. package/lib/types/index.d.mts +8 -0
  450. package/lib/types/shared/ClientSerializer.d.cts +52 -0
  451. package/lib/types/shared/ClientSerializer.d.mts +52 -0
  452. package/lib/types/shared/DeterministicSerializer.d.cts +47 -0
  453. package/lib/types/shared/DeterministicSerializer.d.mts +47 -0
  454. package/lib/types/shared/SimpleDeterministicSerializer.d.cts +7 -0
  455. package/lib/types/shared/SimpleDeterministicSerializer.d.mts +7 -0
  456. package/lib/types/shared/constants.d.cts +35 -0
  457. package/lib/types/shared/constants.d.mts +35 -0
  458. package/lib/types/shared/decorators.d.cts +81 -0
  459. package/lib/types/shared/decorators.d.mts +81 -0
  460. package/lib/types/shared/erc20/erc20-constants.d.cts +25 -0
  461. package/lib/types/shared/erc20/erc20-constants.d.mts +25 -0
  462. package/lib/types/shared/erc20/index.d.cts +1 -0
  463. package/lib/types/shared/erc20/index.d.mts +1 -0
  464. package/lib/types/shared/errors.d.cts +140 -0
  465. package/lib/types/shared/errors.d.mts +140 -0
  466. package/lib/types/shared/events.d.cts +37 -0
  467. package/lib/types/shared/events.d.mts +37 -0
  468. package/lib/types/shared/fabric-types.d.cts +32 -0
  469. package/lib/types/shared/fabric-types.d.mts +32 -0
  470. package/lib/types/shared/index.d.cts +21 -0
  471. package/lib/types/shared/index.d.mts +21 -0
  472. package/lib/types/shared/interfaces/Checkable.d.cts +23 -0
  473. package/lib/types/shared/interfaces/Checkable.d.mts +23 -0
  474. package/lib/types/shared/interfaces/index.d.cts +1 -0
  475. package/lib/types/shared/interfaces/index.d.mts +1 -0
  476. package/lib/types/shared/math.d.cts +34 -0
  477. package/lib/types/shared/math.d.mts +34 -0
  478. package/lib/types/shared/model/FabricBaseModel.d.cts +7 -0
  479. package/lib/types/shared/model/FabricBaseModel.d.mts +7 -0
  480. package/lib/types/shared/model/FabricIdentifiedBaseModel.d.cts +7 -0
  481. package/lib/types/shared/model/FabricIdentifiedBaseModel.d.mts +7 -0
  482. package/lib/types/shared/model/Identity.d.cts +42 -0
  483. package/lib/types/shared/model/Identity.d.mts +42 -0
  484. package/lib/types/shared/model/IdentityCredentials.d.cts +41 -0
  485. package/lib/types/shared/model/IdentityCredentials.d.mts +41 -0
  486. package/lib/types/shared/model/index.d.cts +4 -0
  487. package/lib/types/shared/model/index.d.mts +4 -0
  488. package/lib/types/shared/overrides/Model.d.cts +22 -0
  489. package/lib/types/shared/overrides/Model.d.mts +22 -0
  490. package/lib/types/shared/overrides/index.d.cts +2 -0
  491. package/lib/types/shared/overrides/index.d.mts +2 -0
  492. package/lib/types/shared/overrides/overrides.d.cts +1 -0
  493. package/lib/types/shared/overrides/overrides.d.mts +1 -0
  494. package/lib/types/shared/types.d.cts +125 -0
  495. package/lib/types/shared/types.d.mts +125 -0
  496. package/lib/types/version.d.cts +2 -0
  497. package/lib/types/version.d.mts +2 -0
  498. package/lib/types/version.d.ts +1 -1
  499. package/package.json +10 -10
  500. package/lib/cjs/bin/cli.js.map +0 -1
  501. package/lib/cjs/cli-module.js.map +0 -1
  502. package/lib/cjs/cli-utils.js.map +0 -1
  503. package/lib/cjs/client/FabricClientAdapter.js.map +0 -1
  504. package/lib/cjs/client/FabricClientDispatch.js.map +0 -1
  505. package/lib/cjs/client/FabricClientPaginator.js.map +0 -1
  506. package/lib/cjs/client/FabricClientRepository.js.map +0 -1
  507. package/lib/cjs/client/FabricClientStatement.js.map +0 -1
  508. package/lib/cjs/client/collections/generation.js.map +0 -1
  509. package/lib/cjs/client/collections/index.js.map +0 -1
  510. package/lib/cjs/client/constants.js.map +0 -1
  511. package/lib/cjs/client/crypto.js.map +0 -1
  512. package/lib/cjs/client/erc20/FabricERC20ClientRepository.js.map +0 -1
  513. package/lib/cjs/client/erc20/index.js.map +0 -1
  514. package/lib/cjs/client/fabric-fs.js.map +0 -1
  515. package/lib/cjs/client/fabric-hsm.js.map +0 -1
  516. package/lib/cjs/client/ids/id-extraction.js.map +0 -1
  517. package/lib/cjs/client/ids/index.js.map +0 -1
  518. package/lib/cjs/client/index.js.map +0 -1
  519. package/lib/cjs/client/indexes/generation.js.map +0 -1
  520. package/lib/cjs/client/indexes/index.js.map +0 -1
  521. package/lib/cjs/client/logging.js.map +0 -1
  522. package/lib/cjs/client/services/FabricEnrollmentService.js.map +0 -1
  523. package/lib/cjs/client/services/FabricIdentityService.js.map +0 -1
  524. package/lib/cjs/client/services/RegistrationRequestBuilder.js.map +0 -1
  525. package/lib/cjs/client/services/constants.js.map +0 -1
  526. package/lib/cjs/client/services/index.js.map +0 -1
  527. package/lib/cjs/client/types.js.map +0 -1
  528. package/lib/cjs/client/utils.js.map +0 -1
  529. package/lib/cjs/contract/Address.js.map +0 -1
  530. package/lib/cjs/contract/AddressContract.js.map +0 -1
  531. package/lib/cjs/contract/AuditContract.js.map +0 -1
  532. package/lib/cjs/contract/BatchContract.js.map +0 -1
  533. package/lib/cjs/contract/MarketContract.js.map +0 -1
  534. package/lib/cjs/contract/OtherAuditContract.js.map +0 -1
  535. package/lib/cjs/contract/OtherBatchContract.js.map +0 -1
  536. package/lib/cjs/contract/OtherMarketContract.js.map +0 -1
  537. package/lib/cjs/contract/OtherProductContract.js.map +0 -1
  538. package/lib/cjs/contract/OtherProductImageContract.js.map +0 -1
  539. package/lib/cjs/contract/OtherProductSharedContract.js.map +0 -1
  540. package/lib/cjs/contract/OtherProductStrengthContract.js.map +0 -1
  541. package/lib/cjs/contract/Product.js.map +0 -1
  542. package/lib/cjs/contract/ProductContract.js.map +0 -1
  543. package/lib/cjs/contract/ProductStrengthContract.js.map +0 -1
  544. package/lib/cjs/contract/SegregatedPrivateDocumentContract.js.map +0 -1
  545. package/lib/cjs/contract/SegregatedSharedDocumentContract.js.map +0 -1
  546. package/lib/cjs/contract/User.js.map +0 -1
  547. package/lib/cjs/contract/UserContract.js.map +0 -1
  548. package/lib/cjs/contract/index.js.map +0 -1
  549. package/lib/cjs/contract/logging-context.js.map +0 -1
  550. package/lib/cjs/contract/models/Audit.js.map +0 -1
  551. package/lib/cjs/contract/models/BaseIdentifiedModel.js.map +0 -1
  552. package/lib/cjs/contract/models/BaseModel.js.map +0 -1
  553. package/lib/cjs/contract/models/Batch.js.map +0 -1
  554. package/lib/cjs/contract/models/GtinOwner.js.map +0 -1
  555. package/lib/cjs/contract/models/History.js.map +0 -1
  556. package/lib/cjs/contract/models/Leaflet.js.map +0 -1
  557. package/lib/cjs/contract/models/LeafletFile.js.map +0 -1
  558. package/lib/cjs/contract/models/Market.js.map +0 -1
  559. package/lib/cjs/contract/models/OtherAudit.js.map +0 -1
  560. package/lib/cjs/contract/models/OtherBatchShared.js.map +0 -1
  561. package/lib/cjs/contract/models/OtherLeaflet.js.map +0 -1
  562. package/lib/cjs/contract/models/OtherLeafletFile.js.map +0 -1
  563. package/lib/cjs/contract/models/OtherMarket.js.map +0 -1
  564. package/lib/cjs/contract/models/OtherProduct.js.map +0 -1
  565. package/lib/cjs/contract/models/OtherProductImage.js.map +0 -1
  566. package/lib/cjs/contract/models/OtherProductShared.js.map +0 -1
  567. package/lib/cjs/contract/models/OtherProductStrength.js.map +0 -1
  568. package/lib/cjs/contract/models/Product.js.map +0 -1
  569. package/lib/cjs/contract/models/ProductStrength.js.map +0 -1
  570. package/lib/cjs/contract/models/SegregatedDocument.js.map +0 -1
  571. package/lib/cjs/contract/models/constants.js.map +0 -1
  572. package/lib/cjs/contract/models/decorators-private.js.map +0 -1
  573. package/lib/cjs/contract/models/decorators.js.map +0 -1
  574. package/lib/cjs/contract/models/gtin.js.map +0 -1
  575. package/lib/cjs/contract/models/history-dec.js.map +0 -1
  576. package/lib/cjs/contracts/ContractAdapter.js.map +0 -1
  577. package/lib/cjs/contracts/ContractContext.js.map +0 -1
  578. package/lib/cjs/contracts/FabricContractDispatch.js.map +0 -1
  579. package/lib/cjs/contracts/FabricContractPaginator.js.map +0 -1
  580. package/lib/cjs/contracts/FabricContractRepository.js.map +0 -1
  581. package/lib/cjs/contracts/FabricContractRepositoryObservableHandler.js.map +0 -1
  582. package/lib/cjs/contracts/FabricContractSequence.js.map +0 -1
  583. package/lib/cjs/contracts/FabricContractStatement.js.map +0 -1
  584. package/lib/cjs/contracts/MigrationContract.js.map +0 -1
  585. package/lib/cjs/contracts/PrivateSequence.js.map +0 -1
  586. package/lib/cjs/contracts/auth/decorators.js.map +0 -1
  587. package/lib/cjs/contracts/auth/index.js.map +0 -1
  588. package/lib/cjs/contracts/crud/crud-contract.js.map +0 -1
  589. package/lib/cjs/contracts/crud/index.js.map +0 -1
  590. package/lib/cjs/contracts/crud/serialized-crud-contract.js.map +0 -1
  591. package/lib/cjs/contracts/erc20/erc20contract.js.map +0 -1
  592. package/lib/cjs/contracts/erc20/index.js.map +0 -1
  593. package/lib/cjs/contracts/erc20/models.js.map +0 -1
  594. package/lib/cjs/contracts/index.js.map +0 -1
  595. package/lib/cjs/contracts/logging.js.map +0 -1
  596. package/lib/cjs/contracts/overrides.js.map +0 -1
  597. package/lib/cjs/contracts/types.js.map +0 -1
  598. package/lib/cjs/contracts/uuid.js.map +0 -1
  599. package/lib/cjs/index.js.map +0 -1
  600. package/lib/cjs/shared/ClientSerializer.js.map +0 -1
  601. package/lib/cjs/shared/DeterministicSerializer.js.map +0 -1
  602. package/lib/cjs/shared/SimpleDeterministicSerializer.js.map +0 -1
  603. package/lib/cjs/shared/constants.js.map +0 -1
  604. package/lib/cjs/shared/decorators.js.map +0 -1
  605. package/lib/cjs/shared/erc20/erc20-constants.js.map +0 -1
  606. package/lib/cjs/shared/erc20/index.js.map +0 -1
  607. package/lib/cjs/shared/errors.js.map +0 -1
  608. package/lib/cjs/shared/events.js.map +0 -1
  609. package/lib/cjs/shared/fabric-types.js.map +0 -1
  610. package/lib/cjs/shared/index.js.map +0 -1
  611. package/lib/cjs/shared/interfaces/Checkable.js.map +0 -1
  612. package/lib/cjs/shared/interfaces/index.js.map +0 -1
  613. package/lib/cjs/shared/math.js.map +0 -1
  614. package/lib/cjs/shared/model/FabricBaseModel.js.map +0 -1
  615. package/lib/cjs/shared/model/FabricIdentifiedBaseModel.js.map +0 -1
  616. package/lib/cjs/shared/model/Identity.js.map +0 -1
  617. package/lib/cjs/shared/model/IdentityCredentials.js.map +0 -1
  618. package/lib/cjs/shared/model/index.js.map +0 -1
  619. package/lib/cjs/shared/overrides/Model.js.map +0 -1
  620. package/lib/cjs/shared/overrides/index.js.map +0 -1
  621. package/lib/cjs/shared/overrides/overrides.js.map +0 -1
  622. package/lib/cjs/shared/types.js.map +0 -1
  623. package/lib/cjs/version.js.map +0 -1
@@ -0,0 +1,254 @@
1
+ import { FabricClientRepository } from "../FabricClientRepository.cjs";
2
+ import { ERC20Token, ERC20Wallet } from "../../contracts/erc20/models.cjs";
3
+ import { Model, Serializer } from "@decaf-ts/decorator-validation";
4
+ import { FabricClientAdapter } from "../FabricClientAdapter.cjs";
5
+ import { ContextOf, ContextualArgs, EventIds, MaybeContextualArg } from "@decaf-ts/core";
6
+ import { BulkCrudOperationKeys, OperationKeys } from "@decaf-ts/db-decorators";
7
+ import { Constructor } from "@decaf-ts/decoration";
8
+ /**
9
+ * Repository for interacting with ERC20 contracts on a Hyperledger Fabric network.
10
+ * Extends the base FabricClientRepository class and utilizes the ClientSerializer for data serialization.
11
+ */
12
+ export declare class FabricERC20ClientRepository<A extends FabricClientAdapter> extends FabricClientRepository<ERC20Wallet, A> {
13
+ private static serializer;
14
+ protected readonly serializer: Serializer<any>;
15
+ private static decoder;
16
+ /**
17
+ * @description Notifies all observers of an event.
18
+ * @summary Updates all registered observers with information about a database event.
19
+ * @param {string} table - The table name where the event occurred.
20
+ * @param {OperationKeys|BulkCrudOperationKeys|string} event - The type of event that occurred.
21
+ * @param {EventIds} id - The ID or IDs of the affected records.
22
+ * @param {...any[]} args - Additional arguments.
23
+ * @return {Promise<void>} A promise that resolves when all observers have been notified.
24
+ * @throws {InternalError} If the observer handler is not initialized.
25
+ */
26
+ updateObservers<M extends Model>(table: Constructor<M> | string, event: OperationKeys | BulkCrudOperationKeys | string, id: EventIds, ...args: ContextualArgs<ContextOf<A>>): Promise<void>;
27
+ /**
28
+ * Decodes a Uint8Array into a string using the TextDecoder.
29
+ *
30
+ * @param data - The Uint8Array to decode.
31
+ * @returns The decoded string.
32
+ */
33
+ decode(data: Uint8Array): string;
34
+ constructor(adapter?: A);
35
+ /**
36
+ * Retrieves the name of the ERC20 token.
37
+ *
38
+ * @description
39
+ * This function interacts with the blockchain network to fetch the name of the ERC20 token.
40
+ * It calls the "TokenName" transaction on the smart contract and decodes the returned data.
41
+ *
42
+ * @returns {Promise<string>} A promise that resolves with the name of the ERC20 token.
43
+ *
44
+ * @throws {Error} If the transaction fails or the decoding process fails.
45
+ */
46
+ tokenName(...args: MaybeContextualArg<ContextOf<A>>): Promise<string>;
47
+ /**
48
+ * Retrieves the symbol of the ERC20 token.
49
+ *
50
+ * This function interacts with the blockchain network to fetch the symbol of the ERC20 token.
51
+ * It calls the "Symbol" transaction on the smart contract and decodes the returned data.
52
+ *
53
+ * @returns {Promise<string>} A promise that resolves with the symbol of the ERC20 token.
54
+ *
55
+ * @throws {Error} If the transaction fails or the decoding process fails.
56
+ */
57
+ symbol(...args: MaybeContextualArg<ContextOf<A>>): Promise<string>;
58
+ /**
59
+ * Retrieves the number of decimal places for the ERC20 token.
60
+ *
61
+ * This function interacts with the blockchain network to fetch the number of decimal places for the ERC20 token.
62
+ * It calls the "Decimals" transaction on the smart contract and decodes the returned data.
63
+ *
64
+ * @returns {Promise<number>} A promise that resolves with the number of decimal places for the ERC20 token.
65
+ *
66
+ * @throws {Error} If the transaction fails or the decoding process fails.
67
+ */
68
+ decimals(...args: MaybeContextualArg<ContextOf<A>>): Promise<number>;
69
+ /**
70
+ * Retrieves the total supply of the ERC20 token.
71
+ *
72
+ * This function interacts with the blockchain network to fetch the total supply of the ERC20 token.
73
+ * It calls the "TotalSupply" transaction on the smart contract and decodes the returned data.
74
+ *
75
+ * @returns {Promise<number>} A promise that resolves with the total supply of the ERC20 token.
76
+ *
77
+ * @throws {Error} If the transaction fails or the decoding process fails.
78
+ */
79
+ totalSupply(...args: MaybeContextualArg<ContextOf<A>>): Promise<number>;
80
+ /**
81
+ * Retrieves the balance of the ERC20 token for a specified owner.
82
+ *
83
+ * @description
84
+ * This function interacts with the blockchain network to fetch the balance of the ERC20 token for a given owner.
85
+ * It calls the "BalanceOf" transaction on the smart contract with the provided owner's address as a parameter.
86
+ * The returned data is then decoded and converted to a number.
87
+ *
88
+ * @param owner - The address of the ERC20 token owner.
89
+ *
90
+ * @returns {Promise<number>} A promise that resolves with the balance of the ERC20 token for the specified owner.
91
+ *
92
+ * @throws {Error} If the transaction fails or the decoding process fails.
93
+ */
94
+ balanceOf(owner: string, ...args: MaybeContextualArg<ContextOf<A>>): Promise<number>;
95
+ /**
96
+ * Transfers a specified amount of ERC20 tokens to a recipient.
97
+ *
98
+ * @description
99
+ * This function interacts with the blockchain network to transfer a specified amount of ERC20 tokens to a recipient.
100
+ * It calls the "Transfer" transaction on the smart contract with the recipient's address and the transfer amount as parameters.
101
+ * The returned data is then decoded and checked to determine if the transfer was successful.
102
+ *
103
+ * @param to - The address of the recipient.
104
+ * @param value - The amount of ERC20 tokens to transfer.
105
+ *
106
+ * @returns {Promise<boolean>} A promise that resolves with `true` if the transfer was successful, and `false` otherwise.
107
+ *
108
+ * @throws {Error} If the transaction fails or the decoding process fails.
109
+ */
110
+ transfer(to: string, value: number, ...args: MaybeContextualArg<ContextOf<A>>): Promise<boolean>;
111
+ /**
112
+ * Transfers a specified amount of ERC20 tokens from one account to another.
113
+ *
114
+ * @description
115
+ * This function interacts with the blockchain network to transfer a specified amount of ERC20 tokens from one account to another.
116
+ * For this transfer to work the spender ( account that will trigger this function ) need to have the value approved as an allowance by the sender.
117
+ * It calls the "TransferFrom" transaction on the smart contract with the sender's address, recipient's address, and the transfer amount as parameters.
118
+ * The returned data is then decoded and checked to determine if the transfer was successful.
119
+ *
120
+ * @param from - The address of the sender.
121
+ * @param to - The address of the recipient.
122
+ * @param value - The amount of ERC20 tokens to transfer.
123
+ *
124
+ * @returns {Promise<boolean>} A promise that resolves with `true` if the transfer was successful, and `false` otherwise.
125
+ *
126
+ * @throws {Error} If the transaction fails or the decoding process fails.
127
+ */
128
+ transferFrom(from: string, to: string, value: number): Promise<boolean>;
129
+ /**
130
+ * Approves a specified amount of ERC20 tokens to be spent by a specified spender.
131
+ *
132
+ * This function interacts with the blockchain network to approve a specified amount of ERC20 tokens to be spent by a specified spender.
133
+ * It calls the "Approve" transaction on the smart contract with the spender's address and the approval amount as parameters.
134
+ * The returned data is then decoded and checked to determine if the approval was successful.
135
+ *
136
+ * @param spender - The address of the spender.
137
+ * @param value - The amount of ERC20 tokens to approve for the spender.
138
+ *
139
+ * @returns {Promise<boolean>} A promise that resolves with `true` if the approval was successful, and `false` otherwise.
140
+ *
141
+ * @throws {Error} If the transaction fails or the decoding process fails.
142
+ */
143
+ approve(spender: string, value: number): Promise<boolean>;
144
+ /**
145
+ * Retrieves the allowance of ERC20 tokens that the specified owner has approved for a spender.
146
+ *
147
+ * @description
148
+ * This function interacts with the blockchain network to fetch the allowance of ERC20 tokens that the specified owner has approved for a spender.
149
+ * It calls the "Allowance" transaction on the smart contract with the owner's address and the spender's address as parameters.
150
+ * The returned data is then decoded and converted to a number.
151
+ *
152
+ * @param owner - The address of the ERC20 token owner.
153
+ * @param spender - The address of the spender.
154
+ *
155
+ * @returns {Promise<number>} A promise that resolves with the allowance of ERC20 tokens that the specified owner has approved for the spender.
156
+ *
157
+ * @throws {Error} If the transaction fails or the decoding process fails.
158
+ */
159
+ allowance(owner: string, spender: string): Promise<number>;
160
+ /**
161
+ * Initializes the ERC20 contract with the provided token information.
162
+ *
163
+ * @description
164
+ * This function interacts with the blockchain network to initialize the ERC20 contract with the given token information.
165
+ * It calls the "Initialize" transaction on the smart contract with the serialized token data as a parameter.
166
+ * The returned data is then decoded and checked to determine if the initialization was successful.
167
+ *
168
+ * @param token - The ERC20 token information to initialize the contract with.
169
+ *
170
+ * @returns {Promise<boolean>} A promise that resolves with `true` if the initialization was successful, and `false` otherwise.
171
+ *
172
+ * @throws {Error} If the transaction fails or the decoding process fails.
173
+ */
174
+ initialize(token: ERC20Token): Promise<boolean>;
175
+ /**
176
+ * Checks if the ERC20 contract has been initialized.
177
+ *
178
+ * This function interacts with the blockchain network to verify if the ERC20 contract has been initialized.
179
+ * It calls the "CheckInitialized" transaction on the smart contract, which does not require any parameters.
180
+ *
181
+ * @returns {Promise<void>} A promise that resolves when the initialization check is completed.
182
+ *
183
+ * @throws {Error} If the transaction fails.
184
+ */
185
+ checkInitialized(): Promise<void>;
186
+ /**
187
+ * Mints a specified amount of ERC20 tokens.
188
+ *
189
+ * @description
190
+ * This function interacts with the blockchain network to mint a specified amount of ERC20 tokens.
191
+ * It calls the "Mint" transaction on the smart contract with the minting amount as a parameter.
192
+ * The function does not return any value, but it updates the minter's number of tokens.
193
+ *
194
+ * @param amount - The amount of ERC20 tokens to mint.
195
+ *
196
+ * @returns {Promise<void>} A promise that resolves when the minting process is completed.
197
+ *
198
+ * @throws {Error} If the transaction fails.
199
+ */
200
+ mint(amount: number): Promise<void>;
201
+ /**
202
+ * Burns a specified amount of ERC20 tokens from the minter's account.
203
+ *
204
+ * This function interacts with the blockchain network to burn a specified amount of ERC20 tokens.
205
+ * It calls the "Burn" transaction on the smart contract with the burning amount as a parameter.
206
+ * The function does not return any value, but it decreases the minter's number of tokens.
207
+ *
208
+ * @param amount - The amount of ERC20 tokens to burn.
209
+ *
210
+ * @returns {Promise<void>} A promise that resolves when the burning process is completed.
211
+ *
212
+ * @throws {Error} If the transaction fails.
213
+ */
214
+ burn(amount: number): Promise<void>;
215
+ /**
216
+ * Burns a specified amount of ERC20 tokens from a specified account.
217
+ *
218
+ * This function interacts with the blockchain network to burn a specified amount of ERC20 tokens from a given account.
219
+ * It calls the "BurnFrom" transaction on the smart contract with the account's address and the burning amount as parameters.
220
+ * The function does not return any value, but it decreases the specified account's number of tokens.
221
+ *
222
+ * @param account - The address of the account from which to burn the ERC20 tokens.
223
+ * @param amount - The amount of ERC20 tokens to burn.
224
+ *
225
+ * @returns {Promise<void>} A promise that resolves when the burning process is completed.
226
+ *
227
+ * @throws {Error} If the transaction fails.
228
+ */
229
+ burnFrom(account: string, amount: number): Promise<void>;
230
+ /**
231
+ * Retrieves the balance of ERC20 tokens associated with the client's account.
232
+ *
233
+ * This function interacts with the blockchain network to fetch the balance of ERC20 tokens associated with the client's account.
234
+ * It calls the "ClientAccountBalance" transaction on the smart contract, which does not require any parameters.
235
+ * The returned data is then decoded and converted to a number.
236
+ *
237
+ * @returns {Promise<number>} A promise that resolves with the balance of ERC20 tokens associated with the client's account.
238
+ *
239
+ * @throws {Error} If the transaction fails or the decoding process fails.
240
+ */
241
+ clientAccountBalance(): Promise<number>;
242
+ /**
243
+ * Retrieves the client's account ID from the blockchain network.
244
+ *
245
+ * This function interacts with the blockchain network to fetch the client's account ID.
246
+ * It calls the "ClientAccountID" transaction on the smart contract, which does not require any parameters.
247
+ * The returned data is then decoded and returned as a string.
248
+ *
249
+ * @returns {Promise<string>} A promise that resolves with the client's account ID.
250
+ *
251
+ * @throws {Error} If the transaction fails or the decoding process fails.
252
+ */
253
+ clientAccountID(): Promise<string>;
254
+ }
@@ -0,0 +1,254 @@
1
+ import { FabricClientRepository } from "../FabricClientRepository.js";
2
+ import { ERC20Token, ERC20Wallet } from "../../contracts/erc20/models.js";
3
+ import { Model, Serializer } from "@decaf-ts/decorator-validation";
4
+ import { FabricClientAdapter } from "../FabricClientAdapter.js";
5
+ import { ContextOf, ContextualArgs, EventIds, MaybeContextualArg } from "@decaf-ts/core";
6
+ import { BulkCrudOperationKeys, OperationKeys } from "@decaf-ts/db-decorators";
7
+ import { Constructor } from "@decaf-ts/decoration";
8
+ /**
9
+ * Repository for interacting with ERC20 contracts on a Hyperledger Fabric network.
10
+ * Extends the base FabricClientRepository class and utilizes the ClientSerializer for data serialization.
11
+ */
12
+ export declare class FabricERC20ClientRepository<A extends FabricClientAdapter> extends FabricClientRepository<ERC20Wallet, A> {
13
+ private static serializer;
14
+ protected readonly serializer: Serializer<any>;
15
+ private static decoder;
16
+ /**
17
+ * @description Notifies all observers of an event.
18
+ * @summary Updates all registered observers with information about a database event.
19
+ * @param {string} table - The table name where the event occurred.
20
+ * @param {OperationKeys|BulkCrudOperationKeys|string} event - The type of event that occurred.
21
+ * @param {EventIds} id - The ID or IDs of the affected records.
22
+ * @param {...any[]} args - Additional arguments.
23
+ * @return {Promise<void>} A promise that resolves when all observers have been notified.
24
+ * @throws {InternalError} If the observer handler is not initialized.
25
+ */
26
+ updateObservers<M extends Model>(table: Constructor<M> | string, event: OperationKeys | BulkCrudOperationKeys | string, id: EventIds, ...args: ContextualArgs<ContextOf<A>>): Promise<void>;
27
+ /**
28
+ * Decodes a Uint8Array into a string using the TextDecoder.
29
+ *
30
+ * @param data - The Uint8Array to decode.
31
+ * @returns The decoded string.
32
+ */
33
+ decode(data: Uint8Array): string;
34
+ constructor(adapter?: A);
35
+ /**
36
+ * Retrieves the name of the ERC20 token.
37
+ *
38
+ * @description
39
+ * This function interacts with the blockchain network to fetch the name of the ERC20 token.
40
+ * It calls the "TokenName" transaction on the smart contract and decodes the returned data.
41
+ *
42
+ * @returns {Promise<string>} A promise that resolves with the name of the ERC20 token.
43
+ *
44
+ * @throws {Error} If the transaction fails or the decoding process fails.
45
+ */
46
+ tokenName(...args: MaybeContextualArg<ContextOf<A>>): Promise<string>;
47
+ /**
48
+ * Retrieves the symbol of the ERC20 token.
49
+ *
50
+ * This function interacts with the blockchain network to fetch the symbol of the ERC20 token.
51
+ * It calls the "Symbol" transaction on the smart contract and decodes the returned data.
52
+ *
53
+ * @returns {Promise<string>} A promise that resolves with the symbol of the ERC20 token.
54
+ *
55
+ * @throws {Error} If the transaction fails or the decoding process fails.
56
+ */
57
+ symbol(...args: MaybeContextualArg<ContextOf<A>>): Promise<string>;
58
+ /**
59
+ * Retrieves the number of decimal places for the ERC20 token.
60
+ *
61
+ * This function interacts with the blockchain network to fetch the number of decimal places for the ERC20 token.
62
+ * It calls the "Decimals" transaction on the smart contract and decodes the returned data.
63
+ *
64
+ * @returns {Promise<number>} A promise that resolves with the number of decimal places for the ERC20 token.
65
+ *
66
+ * @throws {Error} If the transaction fails or the decoding process fails.
67
+ */
68
+ decimals(...args: MaybeContextualArg<ContextOf<A>>): Promise<number>;
69
+ /**
70
+ * Retrieves the total supply of the ERC20 token.
71
+ *
72
+ * This function interacts with the blockchain network to fetch the total supply of the ERC20 token.
73
+ * It calls the "TotalSupply" transaction on the smart contract and decodes the returned data.
74
+ *
75
+ * @returns {Promise<number>} A promise that resolves with the total supply of the ERC20 token.
76
+ *
77
+ * @throws {Error} If the transaction fails or the decoding process fails.
78
+ */
79
+ totalSupply(...args: MaybeContextualArg<ContextOf<A>>): Promise<number>;
80
+ /**
81
+ * Retrieves the balance of the ERC20 token for a specified owner.
82
+ *
83
+ * @description
84
+ * This function interacts with the blockchain network to fetch the balance of the ERC20 token for a given owner.
85
+ * It calls the "BalanceOf" transaction on the smart contract with the provided owner's address as a parameter.
86
+ * The returned data is then decoded and converted to a number.
87
+ *
88
+ * @param owner - The address of the ERC20 token owner.
89
+ *
90
+ * @returns {Promise<number>} A promise that resolves with the balance of the ERC20 token for the specified owner.
91
+ *
92
+ * @throws {Error} If the transaction fails or the decoding process fails.
93
+ */
94
+ balanceOf(owner: string, ...args: MaybeContextualArg<ContextOf<A>>): Promise<number>;
95
+ /**
96
+ * Transfers a specified amount of ERC20 tokens to a recipient.
97
+ *
98
+ * @description
99
+ * This function interacts with the blockchain network to transfer a specified amount of ERC20 tokens to a recipient.
100
+ * It calls the "Transfer" transaction on the smart contract with the recipient's address and the transfer amount as parameters.
101
+ * The returned data is then decoded and checked to determine if the transfer was successful.
102
+ *
103
+ * @param to - The address of the recipient.
104
+ * @param value - The amount of ERC20 tokens to transfer.
105
+ *
106
+ * @returns {Promise<boolean>} A promise that resolves with `true` if the transfer was successful, and `false` otherwise.
107
+ *
108
+ * @throws {Error} If the transaction fails or the decoding process fails.
109
+ */
110
+ transfer(to: string, value: number, ...args: MaybeContextualArg<ContextOf<A>>): Promise<boolean>;
111
+ /**
112
+ * Transfers a specified amount of ERC20 tokens from one account to another.
113
+ *
114
+ * @description
115
+ * This function interacts with the blockchain network to transfer a specified amount of ERC20 tokens from one account to another.
116
+ * For this transfer to work the spender ( account that will trigger this function ) need to have the value approved as an allowance by the sender.
117
+ * It calls the "TransferFrom" transaction on the smart contract with the sender's address, recipient's address, and the transfer amount as parameters.
118
+ * The returned data is then decoded and checked to determine if the transfer was successful.
119
+ *
120
+ * @param from - The address of the sender.
121
+ * @param to - The address of the recipient.
122
+ * @param value - The amount of ERC20 tokens to transfer.
123
+ *
124
+ * @returns {Promise<boolean>} A promise that resolves with `true` if the transfer was successful, and `false` otherwise.
125
+ *
126
+ * @throws {Error} If the transaction fails or the decoding process fails.
127
+ */
128
+ transferFrom(from: string, to: string, value: number): Promise<boolean>;
129
+ /**
130
+ * Approves a specified amount of ERC20 tokens to be spent by a specified spender.
131
+ *
132
+ * This function interacts with the blockchain network to approve a specified amount of ERC20 tokens to be spent by a specified spender.
133
+ * It calls the "Approve" transaction on the smart contract with the spender's address and the approval amount as parameters.
134
+ * The returned data is then decoded and checked to determine if the approval was successful.
135
+ *
136
+ * @param spender - The address of the spender.
137
+ * @param value - The amount of ERC20 tokens to approve for the spender.
138
+ *
139
+ * @returns {Promise<boolean>} A promise that resolves with `true` if the approval was successful, and `false` otherwise.
140
+ *
141
+ * @throws {Error} If the transaction fails or the decoding process fails.
142
+ */
143
+ approve(spender: string, value: number): Promise<boolean>;
144
+ /**
145
+ * Retrieves the allowance of ERC20 tokens that the specified owner has approved for a spender.
146
+ *
147
+ * @description
148
+ * This function interacts with the blockchain network to fetch the allowance of ERC20 tokens that the specified owner has approved for a spender.
149
+ * It calls the "Allowance" transaction on the smart contract with the owner's address and the spender's address as parameters.
150
+ * The returned data is then decoded and converted to a number.
151
+ *
152
+ * @param owner - The address of the ERC20 token owner.
153
+ * @param spender - The address of the spender.
154
+ *
155
+ * @returns {Promise<number>} A promise that resolves with the allowance of ERC20 tokens that the specified owner has approved for the spender.
156
+ *
157
+ * @throws {Error} If the transaction fails or the decoding process fails.
158
+ */
159
+ allowance(owner: string, spender: string): Promise<number>;
160
+ /**
161
+ * Initializes the ERC20 contract with the provided token information.
162
+ *
163
+ * @description
164
+ * This function interacts with the blockchain network to initialize the ERC20 contract with the given token information.
165
+ * It calls the "Initialize" transaction on the smart contract with the serialized token data as a parameter.
166
+ * The returned data is then decoded and checked to determine if the initialization was successful.
167
+ *
168
+ * @param token - The ERC20 token information to initialize the contract with.
169
+ *
170
+ * @returns {Promise<boolean>} A promise that resolves with `true` if the initialization was successful, and `false` otherwise.
171
+ *
172
+ * @throws {Error} If the transaction fails or the decoding process fails.
173
+ */
174
+ initialize(token: ERC20Token): Promise<boolean>;
175
+ /**
176
+ * Checks if the ERC20 contract has been initialized.
177
+ *
178
+ * This function interacts with the blockchain network to verify if the ERC20 contract has been initialized.
179
+ * It calls the "CheckInitialized" transaction on the smart contract, which does not require any parameters.
180
+ *
181
+ * @returns {Promise<void>} A promise that resolves when the initialization check is completed.
182
+ *
183
+ * @throws {Error} If the transaction fails.
184
+ */
185
+ checkInitialized(): Promise<void>;
186
+ /**
187
+ * Mints a specified amount of ERC20 tokens.
188
+ *
189
+ * @description
190
+ * This function interacts with the blockchain network to mint a specified amount of ERC20 tokens.
191
+ * It calls the "Mint" transaction on the smart contract with the minting amount as a parameter.
192
+ * The function does not return any value, but it updates the minter's number of tokens.
193
+ *
194
+ * @param amount - The amount of ERC20 tokens to mint.
195
+ *
196
+ * @returns {Promise<void>} A promise that resolves when the minting process is completed.
197
+ *
198
+ * @throws {Error} If the transaction fails.
199
+ */
200
+ mint(amount: number): Promise<void>;
201
+ /**
202
+ * Burns a specified amount of ERC20 tokens from the minter's account.
203
+ *
204
+ * This function interacts with the blockchain network to burn a specified amount of ERC20 tokens.
205
+ * It calls the "Burn" transaction on the smart contract with the burning amount as a parameter.
206
+ * The function does not return any value, but it decreases the minter's number of tokens.
207
+ *
208
+ * @param amount - The amount of ERC20 tokens to burn.
209
+ *
210
+ * @returns {Promise<void>} A promise that resolves when the burning process is completed.
211
+ *
212
+ * @throws {Error} If the transaction fails.
213
+ */
214
+ burn(amount: number): Promise<void>;
215
+ /**
216
+ * Burns a specified amount of ERC20 tokens from a specified account.
217
+ *
218
+ * This function interacts with the blockchain network to burn a specified amount of ERC20 tokens from a given account.
219
+ * It calls the "BurnFrom" transaction on the smart contract with the account's address and the burning amount as parameters.
220
+ * The function does not return any value, but it decreases the specified account's number of tokens.
221
+ *
222
+ * @param account - The address of the account from which to burn the ERC20 tokens.
223
+ * @param amount - The amount of ERC20 tokens to burn.
224
+ *
225
+ * @returns {Promise<void>} A promise that resolves when the burning process is completed.
226
+ *
227
+ * @throws {Error} If the transaction fails.
228
+ */
229
+ burnFrom(account: string, amount: number): Promise<void>;
230
+ /**
231
+ * Retrieves the balance of ERC20 tokens associated with the client's account.
232
+ *
233
+ * This function interacts with the blockchain network to fetch the balance of ERC20 tokens associated with the client's account.
234
+ * It calls the "ClientAccountBalance" transaction on the smart contract, which does not require any parameters.
235
+ * The returned data is then decoded and converted to a number.
236
+ *
237
+ * @returns {Promise<number>} A promise that resolves with the balance of ERC20 tokens associated with the client's account.
238
+ *
239
+ * @throws {Error} If the transaction fails or the decoding process fails.
240
+ */
241
+ clientAccountBalance(): Promise<number>;
242
+ /**
243
+ * Retrieves the client's account ID from the blockchain network.
244
+ *
245
+ * This function interacts with the blockchain network to fetch the client's account ID.
246
+ * It calls the "ClientAccountID" transaction on the smart contract, which does not require any parameters.
247
+ * The returned data is then decoded and returned as a string.
248
+ *
249
+ * @returns {Promise<string>} A promise that resolves with the client's account ID.
250
+ *
251
+ * @throws {Error} If the transaction fails or the decoding process fails.
252
+ */
253
+ clientAccountID(): Promise<string>;
254
+ }
@@ -0,0 +1 @@
1
+ export * from "./FabricERC20ClientRepository.cjs";
@@ -0,0 +1 @@
1
+ export * from "./FabricERC20ClientRepository.js";
@@ -0,0 +1,92 @@
1
+ import { User } from "fabric-common";
2
+ import { Identity, Signer } from "@hyperledger/fabric-gateway";
3
+ /**
4
+ * @description Loads content from a file or returns the content if already loaded
5
+ * @summary Determines if the input is already content or a path to a file, and loads the file if needed
6
+ * @param {string | Uint8Array} contentOrPath - The content or path to load
7
+ * @param {Function} fileReader - Function to read the file if contentOrPath is a path
8
+ * @return {Promise<string | Uint8Array | Buffer>} The content
9
+ * @function contentOfLoadFile
10
+ * @memberOf module:for-fabric.client
11
+ */
12
+ export declare function contentOfLoadFile(contentOrPath: string | Uint8Array, fileReader: (path: string) => Promise<string | Uint8Array | Buffer>): Promise<string | Uint8Array<ArrayBufferLike> | Buffer<ArrayBufferLike>>;
13
+ /**
14
+ * @description Reads a file from the file system
15
+ * @summary Loads a file using the Node.js file system module
16
+ * @param {string | Buffer} contentOrPath - The content or path to load
17
+ * @return {Promise<Buffer>} The file content as a Buffer
18
+ * @function readFile
19
+ * @memberOf module:for-fabric.client
20
+ */
21
+ export declare function readFile(contentOrPath: string | Buffer): Promise<Buffer<ArrayBufferLike>>;
22
+ /**
23
+ * @description Creates a Certificate Authority user
24
+ * @summary Initializes a user with the given credentials for interacting with a Fabric CA
25
+ * @param {string} userName - The user name
26
+ * @param {string} privateKey - The private key as a string
27
+ * @param {string} certificate - The certificate as a string
28
+ * @param {string} mspId - The Membership Service Provider ID
29
+ * @return {Promise<User>} Promise resolving to the created user
30
+ * @function getCAUser
31
+ * @memberOf module:for-fabric.client
32
+ */
33
+ export declare function getCAUser(userName: string, privateKey: string, certificate: string, mspId: string): Promise<User>;
34
+ /**
35
+ * @description Gets an identity from a certificate directory
36
+ * @summary Loads a certificate from a directory and creates an Identity object
37
+ * @param {string} mspId - The Membership Service Provider ID
38
+ * @param {string} certDirectoryPath - Path to the directory containing the certificate
39
+ * @return {Promise<Identity>} Promise resolving to the identity
40
+ * @function getIdentity
41
+ * @memberOf module:for-fabric.client
42
+ */
43
+ export declare function getIdentity(mspId: string, certDirectoryPath: string): Promise<Identity>;
44
+ /**
45
+ * @description Gets the full path of the first file in a directory
46
+ * @summary Reads a directory and returns the path to the first file found
47
+ * @param {string} dirPath - Path to the directory
48
+ * @return {Promise<string>} Promise resolving to the full path of the first file
49
+ * @function getFirstDirFileName
50
+ * @memberOf module:for-fabric.client
51
+ */
52
+ export declare function getFirstDirFileName(dirPath: string): Promise<string>;
53
+ /**
54
+ * @description Gets the content of the first file in a directory
55
+ * @summary Reads a directory, finds the first file, and returns its content as a string
56
+ * @param {string} dirPath - Path to the directory
57
+ * @return {Promise<string>} Promise resolving to the content of the first file
58
+ * @function getFirstDirFileNameContent
59
+ * @memberOf module:for-fabric.client
60
+ */
61
+ export declare function getFirstDirFileNameContent(dirPath: string): Promise<string>;
62
+ /**
63
+ * @description Gets a signer from a key directory
64
+ * @summary Loads a private key from a directory and creates a Signer for Fabric transactions
65
+ * @param {string} keyDirectoryPath - Path to the directory containing the private key
66
+ * @return {Promise<Signer>} Promise resolving to the signer
67
+ * @function getSigner
68
+ * @memberOf module:for-fabric.client
69
+ */
70
+ export declare function getSigner(keyDirectoryPath: string): Promise<Signer>;
71
+ /**
72
+ * @description Extracts a private key from a PEM buffer
73
+ * @summary Converts a PEM-encoded private key to a CryptoKey object
74
+ * @param {Buffer} pem - The PEM-encoded private key
75
+ * @return {Promise<CryptoKey>} Promise resolving to the CryptoKey
76
+ * @function extractPrivateKey
77
+ * @memberOf module:for-fabric.client
78
+ * @mermaid
79
+ * sequenceDiagram
80
+ * participant Caller
81
+ * participant ExtractPrivateKey
82
+ * participant SubtleCrypto
83
+ *
84
+ * Caller->>ExtractPrivateKey: extractPrivateKey(pem)
85
+ * ExtractPrivateKey->>ExtractPrivateKey: Get SubtleCrypto implementation
86
+ * ExtractPrivateKey->>ExtractPrivateKey: Parse PEM format
87
+ * ExtractPrivateKey->>ExtractPrivateKey: Convert to binary DER
88
+ * ExtractPrivateKey->>SubtleCrypto: importKey(pkcs8, binaryDer, options)
89
+ * SubtleCrypto-->>ExtractPrivateKey: CryptoKey
90
+ * ExtractPrivateKey-->>Caller: CryptoKey
91
+ */
92
+ export declare function extractPrivateKey(pem: Buffer): Promise<any>;