@mocanetwork/privado-js-sdk 1.0.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 (517) hide show
  1. package/README.md +75 -0
  2. package/dist/browser/esm/index.js +14901 -0
  3. package/dist/browser/esm/index.js.map +1 -0
  4. package/dist/browser/umd/index.global.js +678 -0
  5. package/dist/browser/umd/index.global.js.map +1 -0
  6. package/dist/node/cjs/index.cjs +15418 -0
  7. package/dist/node/cjs/index.cjs.map +1 -0
  8. package/dist/node/esm/index.js +14901 -0
  9. package/dist/node/esm/index.js.map +1 -0
  10. package/dist/types/blockchain/index.d.ts +2 -0
  11. package/dist/types/blockchain/index.d.ts.map +1 -0
  12. package/dist/types/blockchain/transaction-service.d.ts +81 -0
  13. package/dist/types/blockchain/transaction-service.d.ts.map +1 -0
  14. package/dist/types/circuits/atomic-query-mtp-v2-on-chain.d.ts +70 -0
  15. package/dist/types/circuits/atomic-query-mtp-v2-on-chain.d.ts.map +1 -0
  16. package/dist/types/circuits/atomic-query-mtp-v2.d.ts +63 -0
  17. package/dist/types/circuits/atomic-query-mtp-v2.d.ts.map +1 -0
  18. package/dist/types/circuits/atomic-query-sig-v2-on-chain.d.ts +137 -0
  19. package/dist/types/circuits/atomic-query-sig-v2-on-chain.d.ts.map +1 -0
  20. package/dist/types/circuits/atomic-query-sig-v2.d.ts +64 -0
  21. package/dist/types/circuits/atomic-query-sig-v2.d.ts.map +1 -0
  22. package/dist/types/circuits/atomic-query-v3-on-chain.d.ts +141 -0
  23. package/dist/types/circuits/atomic-query-v3-on-chain.d.ts.map +1 -0
  24. package/dist/types/circuits/atomic-query-v3.d.ts +121 -0
  25. package/dist/types/circuits/atomic-query-v3.d.ts.map +1 -0
  26. package/dist/types/circuits/auth-v2.d.ts +46 -0
  27. package/dist/types/circuits/auth-v2.d.ts.map +1 -0
  28. package/dist/types/circuits/common.d.ts +153 -0
  29. package/dist/types/circuits/common.d.ts.map +1 -0
  30. package/dist/types/circuits/comparer.d.ts +122 -0
  31. package/dist/types/circuits/comparer.d.ts.map +1 -0
  32. package/dist/types/circuits/index.d.ts +13 -0
  33. package/dist/types/circuits/index.d.ts.map +1 -0
  34. package/dist/types/circuits/linked-multi-query.d.ts +38 -0
  35. package/dist/types/circuits/linked-multi-query.d.ts.map +1 -0
  36. package/dist/types/circuits/models.d.ts +189 -0
  37. package/dist/types/circuits/models.d.ts.map +1 -0
  38. package/dist/types/circuits/state-transition.d.ts +49 -0
  39. package/dist/types/circuits/state-transition.d.ts.map +1 -0
  40. package/dist/types/credentials/credential-wallet.d.ts +200 -0
  41. package/dist/types/credentials/credential-wallet.d.ts.map +1 -0
  42. package/dist/types/credentials/index.d.ts +12 -0
  43. package/dist/types/credentials/index.d.ts.map +1 -0
  44. package/dist/types/credentials/models.d.ts +84 -0
  45. package/dist/types/credentials/models.d.ts.map +1 -0
  46. package/dist/types/credentials/rhs.d.ts +38 -0
  47. package/dist/types/credentials/rhs.d.ts.map +1 -0
  48. package/dist/types/credentials/status/agent-revocation.d.ts +20 -0
  49. package/dist/types/credentials/status/agent-revocation.d.ts.map +1 -0
  50. package/dist/types/credentials/status/credential-status-publisher.d.ts +73 -0
  51. package/dist/types/credentials/status/credential-status-publisher.d.ts.map +1 -0
  52. package/dist/types/credentials/status/did-resolver-revocation.d.ts +8 -0
  53. package/dist/types/credentials/status/did-resolver-revocation.d.ts.map +1 -0
  54. package/dist/types/credentials/status/on-chain-revocation.d.ts +58 -0
  55. package/dist/types/credentials/status/on-chain-revocation.d.ts.map +1 -0
  56. package/dist/types/credentials/status/resolver.d.ts +69 -0
  57. package/dist/types/credentials/status/resolver.d.ts.map +1 -0
  58. package/dist/types/credentials/status/reverse-sparse-merkle-tree.d.ts +126 -0
  59. package/dist/types/credentials/status/reverse-sparse-merkle-tree.d.ts.map +1 -0
  60. package/dist/types/credentials/status/sparse-merkle-tree.d.ts +38 -0
  61. package/dist/types/credentials/status/sparse-merkle-tree.d.ts.map +1 -0
  62. package/dist/types/credentials/utils.d.ts +15 -0
  63. package/dist/types/credentials/utils.d.ts.map +1 -0
  64. package/dist/types/iden3comm/constants.d.ts +61 -0
  65. package/dist/types/iden3comm/constants.d.ts.map +1 -0
  66. package/dist/types/iden3comm/errors.d.ts +10 -0
  67. package/dist/types/iden3comm/errors.d.ts.map +1 -0
  68. package/dist/types/iden3comm/handlers/auth.d.ts +157 -0
  69. package/dist/types/iden3comm/handlers/auth.d.ts.map +1 -0
  70. package/dist/types/iden3comm/handlers/common.d.ts +72 -0
  71. package/dist/types/iden3comm/handlers/common.d.ts.map +1 -0
  72. package/dist/types/iden3comm/handlers/contract-request.d.ts +96 -0
  73. package/dist/types/iden3comm/handlers/contract-request.d.ts.map +1 -0
  74. package/dist/types/iden3comm/handlers/credential-proposal.d.ts +120 -0
  75. package/dist/types/iden3comm/handlers/credential-proposal.d.ts.map +1 -0
  76. package/dist/types/iden3comm/handlers/discovery-protocol.d.ts +101 -0
  77. package/dist/types/iden3comm/handlers/discovery-protocol.d.ts.map +1 -0
  78. package/dist/types/iden3comm/handlers/fetch.d.ts +130 -0
  79. package/dist/types/iden3comm/handlers/fetch.d.ts.map +1 -0
  80. package/dist/types/iden3comm/handlers/index.d.ts +12 -0
  81. package/dist/types/iden3comm/handlers/index.d.ts.map +1 -0
  82. package/dist/types/iden3comm/handlers/message-handler.d.ts +93 -0
  83. package/dist/types/iden3comm/handlers/message-handler.d.ts.map +1 -0
  84. package/dist/types/iden3comm/handlers/payment.d.ts +167 -0
  85. package/dist/types/iden3comm/handlers/payment.d.ts.map +1 -0
  86. package/dist/types/iden3comm/handlers/problem-report.d.ts +18 -0
  87. package/dist/types/iden3comm/handlers/problem-report.d.ts.map +1 -0
  88. package/dist/types/iden3comm/handlers/refresh.d.ts +57 -0
  89. package/dist/types/iden3comm/handlers/refresh.d.ts.map +1 -0
  90. package/dist/types/iden3comm/handlers/revocation-status.d.ts +76 -0
  91. package/dist/types/iden3comm/handlers/revocation-status.d.ts.map +1 -0
  92. package/dist/types/iden3comm/index.d.ts +9 -0
  93. package/dist/types/iden3comm/index.d.ts.map +1 -0
  94. package/dist/types/iden3comm/packageManager.d.ts +47 -0
  95. package/dist/types/iden3comm/packageManager.d.ts.map +1 -0
  96. package/dist/types/iden3comm/packers/index.d.ts +4 -0
  97. package/dist/types/iden3comm/packers/index.d.ts.map +1 -0
  98. package/dist/types/iden3comm/packers/jws.d.ts +56 -0
  99. package/dist/types/iden3comm/packers/jws.d.ts.map +1 -0
  100. package/dist/types/iden3comm/packers/plain.d.ts +47 -0
  101. package/dist/types/iden3comm/packers/plain.d.ts.map +1 -0
  102. package/dist/types/iden3comm/packers/zkp.d.ts +98 -0
  103. package/dist/types/iden3comm/packers/zkp.d.ts.map +1 -0
  104. package/dist/types/iden3comm/types/index.d.ts +17 -0
  105. package/dist/types/iden3comm/types/index.d.ts.map +1 -0
  106. package/dist/types/iden3comm/types/models.d.ts +7 -0
  107. package/dist/types/iden3comm/types/models.d.ts.map +1 -0
  108. package/dist/types/iden3comm/types/packageManager.d.ts +100 -0
  109. package/dist/types/iden3comm/types/packageManager.d.ts.map +1 -0
  110. package/dist/types/iden3comm/types/packer.d.ts +158 -0
  111. package/dist/types/iden3comm/types/packer.d.ts.map +1 -0
  112. package/dist/types/iden3comm/types/protocol/accept-profile.d.ts +8 -0
  113. package/dist/types/iden3comm/types/protocol/accept-profile.d.ts.map +1 -0
  114. package/dist/types/iden3comm/types/protocol/attachment.d.ts +11 -0
  115. package/dist/types/iden3comm/types/protocol/attachment.d.ts.map +1 -0
  116. package/dist/types/iden3comm/types/protocol/auth.d.ts +90 -0
  117. package/dist/types/iden3comm/types/protocol/auth.d.ts.map +1 -0
  118. package/dist/types/iden3comm/types/protocol/common.d.ts +11 -0
  119. package/dist/types/iden3comm/types/protocol/common.d.ts.map +1 -0
  120. package/dist/types/iden3comm/types/protocol/contract-request.d.ts +62 -0
  121. package/dist/types/iden3comm/types/protocol/contract-request.d.ts.map +1 -0
  122. package/dist/types/iden3comm/types/protocol/credentials.d.ts +82 -0
  123. package/dist/types/iden3comm/types/protocol/credentials.d.ts.map +1 -0
  124. package/dist/types/iden3comm/types/protocol/discovery-protocol.d.ts +42 -0
  125. package/dist/types/iden3comm/types/protocol/discovery-protocol.d.ts.map +1 -0
  126. package/dist/types/iden3comm/types/protocol/messages.d.ts +12 -0
  127. package/dist/types/iden3comm/types/protocol/messages.d.ts.map +1 -0
  128. package/dist/types/iden3comm/types/protocol/payment.d.ts +178 -0
  129. package/dist/types/iden3comm/types/protocol/payment.d.ts.map +1 -0
  130. package/dist/types/iden3comm/types/protocol/problem-report.d.ts +17 -0
  131. package/dist/types/iden3comm/types/protocol/problem-report.d.ts.map +1 -0
  132. package/dist/types/iden3comm/types/protocol/proof.d.ts +22 -0
  133. package/dist/types/iden3comm/types/protocol/proof.d.ts.map +1 -0
  134. package/dist/types/iden3comm/types/protocol/proposal-request.d.ts +33 -0
  135. package/dist/types/iden3comm/types/protocol/proposal-request.d.ts.map +1 -0
  136. package/dist/types/iden3comm/types/protocol/revocation.d.ts +20 -0
  137. package/dist/types/iden3comm/types/protocol/revocation.d.ts.map +1 -0
  138. package/dist/types/iden3comm/utils/accept-profile.d.ts +4 -0
  139. package/dist/types/iden3comm/utils/accept-profile.d.ts.map +1 -0
  140. package/dist/types/iden3comm/utils/did.d.ts +8 -0
  141. package/dist/types/iden3comm/utils/did.d.ts.map +1 -0
  142. package/dist/types/iden3comm/utils/envelope.d.ts +32 -0
  143. package/dist/types/iden3comm/utils/envelope.d.ts.map +1 -0
  144. package/dist/types/iden3comm/utils/index.d.ts +5 -0
  145. package/dist/types/iden3comm/utils/index.d.ts.map +1 -0
  146. package/dist/types/iden3comm/utils/message.d.ts +20 -0
  147. package/dist/types/iden3comm/utils/message.d.ts.map +1 -0
  148. package/dist/types/identity/common.d.ts +27 -0
  149. package/dist/types/identity/common.d.ts.map +1 -0
  150. package/dist/types/identity/identity-wallet.d.ts +472 -0
  151. package/dist/types/identity/identity-wallet.d.ts.map +1 -0
  152. package/dist/types/identity/index.d.ts +3 -0
  153. package/dist/types/identity/index.d.ts.map +1 -0
  154. package/dist/types/index.d.ts +17 -0
  155. package/dist/types/index.d.ts.map +1 -0
  156. package/dist/types/kms/index.d.ts +5 -0
  157. package/dist/types/kms/index.d.ts.map +1 -0
  158. package/dist/types/kms/key-providers/bjj-provider.d.ts +54 -0
  159. package/dist/types/kms/key-providers/bjj-provider.d.ts.map +1 -0
  160. package/dist/types/kms/key-providers/ed25519-provider.d.ts +61 -0
  161. package/dist/types/kms/key-providers/ed25519-provider.d.ts.map +1 -0
  162. package/dist/types/kms/key-providers/index.d.ts +4 -0
  163. package/dist/types/kms/key-providers/index.d.ts.map +1 -0
  164. package/dist/types/kms/key-providers/secp256k1-provider.d.ts +62 -0
  165. package/dist/types/kms/key-providers/secp256k1-provider.d.ts.map +1 -0
  166. package/dist/types/kms/kms.d.ts +120 -0
  167. package/dist/types/kms/kms.d.ts.map +1 -0
  168. package/dist/types/kms/provider-helpers.d.ts +10 -0
  169. package/dist/types/kms/provider-helpers.d.ts.map +1 -0
  170. package/dist/types/kms/store/abstract-key-store.d.ts +41 -0
  171. package/dist/types/kms/store/abstract-key-store.d.ts.map +1 -0
  172. package/dist/types/kms/store/index.d.ts +6 -0
  173. package/dist/types/kms/store/index.d.ts.map +1 -0
  174. package/dist/types/kms/store/indexed-db-key-store.d.ts +44 -0
  175. package/dist/types/kms/store/indexed-db-key-store.d.ts.map +1 -0
  176. package/dist/types/kms/store/local-storage-key-store.d.ts +42 -0
  177. package/dist/types/kms/store/local-storage-key-store.d.ts.map +1 -0
  178. package/dist/types/kms/store/memory-key-store.d.ts +24 -0
  179. package/dist/types/kms/store/memory-key-store.d.ts.map +1 -0
  180. package/dist/types/kms/store/types.d.ts +21 -0
  181. package/dist/types/kms/store/types.d.ts.map +1 -0
  182. package/dist/types/proof/common.d.ts +49 -0
  183. package/dist/types/proof/common.d.ts.map +1 -0
  184. package/dist/types/proof/index.d.ts +5 -0
  185. package/dist/types/proof/index.d.ts.map +1 -0
  186. package/dist/types/proof/proof-service.d.ts +169 -0
  187. package/dist/types/proof/proof-service.d.ts.map +1 -0
  188. package/dist/types/proof/provers/index.d.ts +4 -0
  189. package/dist/types/proof/provers/index.d.ts.map +1 -0
  190. package/dist/types/proof/provers/inputs-generator.d.ts +57 -0
  191. package/dist/types/proof/provers/inputs-generator.d.ts.map +1 -0
  192. package/dist/types/proof/provers/prover.d.ts +56 -0
  193. package/dist/types/proof/provers/prover.d.ts.map +1 -0
  194. package/dist/types/proof/provers/witness_calculator.d.ts +17 -0
  195. package/dist/types/proof/provers/witness_calculator.d.ts.map +1 -0
  196. package/dist/types/proof/verifiers/index.d.ts +4 -0
  197. package/dist/types/proof/verifiers/index.d.ts.map +1 -0
  198. package/dist/types/proof/verifiers/pub-signals-verifier.d.ts +60 -0
  199. package/dist/types/proof/verifiers/pub-signals-verifier.d.ts.map +1 -0
  200. package/dist/types/proof/verifiers/query-hash.d.ts +4 -0
  201. package/dist/types/proof/verifiers/query-hash.d.ts.map +1 -0
  202. package/dist/types/proof/verifiers/query.d.ts +43 -0
  203. package/dist/types/proof/verifiers/query.d.ts.map +1 -0
  204. package/dist/types/schema-processor/index.d.ts +4 -0
  205. package/dist/types/schema-processor/index.d.ts.map +1 -0
  206. package/dist/types/schema-processor/json/index.d.ts +3 -0
  207. package/dist/types/schema-processor/json/index.d.ts.map +1 -0
  208. package/dist/types/schema-processor/json/parser.d.ts +141 -0
  209. package/dist/types/schema-processor/json/parser.d.ts.map +1 -0
  210. package/dist/types/schema-processor/json/validator.d.ts +26 -0
  211. package/dist/types/schema-processor/json/validator.d.ts.map +1 -0
  212. package/dist/types/schema-processor/jsonld/cache.d.ts +3 -0
  213. package/dist/types/schema-processor/jsonld/cache.d.ts.map +1 -0
  214. package/dist/types/schema-processor/jsonld/index.d.ts +3 -0
  215. package/dist/types/schema-processor/jsonld/index.d.ts.map +1 -0
  216. package/dist/types/schema-processor/jsonld/parser.d.ts +30 -0
  217. package/dist/types/schema-processor/jsonld/parser.d.ts.map +1 -0
  218. package/dist/types/schema-processor/utils.d.ts +54 -0
  219. package/dist/types/schema-processor/utils.d.ts.map +1 -0
  220. package/dist/types/storage/blockchain/common.d.ts +8 -0
  221. package/dist/types/storage/blockchain/common.d.ts.map +1 -0
  222. package/dist/types/storage/blockchain/did-resolver-readonly-storage.d.ts +17 -0
  223. package/dist/types/storage/blockchain/did-resolver-readonly-storage.d.ts.map +1 -0
  224. package/dist/types/storage/blockchain/erc20-helper.d.ts +20 -0
  225. package/dist/types/storage/blockchain/erc20-helper.d.ts.map +1 -0
  226. package/dist/types/storage/blockchain/errors.d.ts +4 -0
  227. package/dist/types/storage/blockchain/errors.d.ts.map +1 -0
  228. package/dist/types/storage/blockchain/index.d.ts +8 -0
  229. package/dist/types/storage/blockchain/index.d.ts.map +1 -0
  230. package/dist/types/storage/blockchain/onchain-issuer-adapter/non-merklized/version/v0.0.1/onchain-non-merklized-issuer-adapter.d.ts +67 -0
  231. package/dist/types/storage/blockchain/onchain-issuer-adapter/non-merklized/version/v0.0.1/onchain-non-merklized-issuer-adapter.d.ts.map +1 -0
  232. package/dist/types/storage/blockchain/onchain-issuer.d.ts +41 -0
  233. package/dist/types/storage/blockchain/onchain-issuer.d.ts.map +1 -0
  234. package/dist/types/storage/blockchain/onchain-revocation.d.ts +41 -0
  235. package/dist/types/storage/blockchain/onchain-revocation.d.ts.map +1 -0
  236. package/dist/types/storage/blockchain/onchain-zkp-verifier.d.ts +116 -0
  237. package/dist/types/storage/blockchain/onchain-zkp-verifier.d.ts.map +1 -0
  238. package/dist/types/storage/blockchain/state.d.ts +127 -0
  239. package/dist/types/storage/blockchain/state.d.ts.map +1 -0
  240. package/dist/types/storage/entities/circuitData.d.ts +8 -0
  241. package/dist/types/storage/entities/circuitData.d.ts.map +1 -0
  242. package/dist/types/storage/entities/identity.d.ts +17 -0
  243. package/dist/types/storage/entities/identity.d.ts.map +1 -0
  244. package/dist/types/storage/entities/index.d.ts +5 -0
  245. package/dist/types/storage/entities/index.d.ts.map +1 -0
  246. package/dist/types/storage/entities/mt.d.ts +22 -0
  247. package/dist/types/storage/entities/mt.d.ts.map +1 -0
  248. package/dist/types/storage/entities/state.d.ts +92 -0
  249. package/dist/types/storage/entities/state.d.ts.map +1 -0
  250. package/dist/types/storage/errors.d.ts +9 -0
  251. package/dist/types/storage/errors.d.ts.map +1 -0
  252. package/dist/types/storage/filters/index.d.ts +2 -0
  253. package/dist/types/storage/filters/index.d.ts.map +1 -0
  254. package/dist/types/storage/filters/jsonQuery.d.ts +83 -0
  255. package/dist/types/storage/filters/jsonQuery.d.ts.map +1 -0
  256. package/dist/types/storage/fs/circuits-storage.d.ts +64 -0
  257. package/dist/types/storage/fs/circuits-storage.d.ts.map +1 -0
  258. package/dist/types/storage/fs/index.d.ts +2 -0
  259. package/dist/types/storage/fs/index.d.ts.map +1 -0
  260. package/dist/types/storage/index.d.ts +10 -0
  261. package/dist/types/storage/index.d.ts.map +1 -0
  262. package/dist/types/storage/indexed-db/data-source.d.ts +44 -0
  263. package/dist/types/storage/indexed-db/data-source.d.ts.map +1 -0
  264. package/dist/types/storage/indexed-db/index.d.ts +3 -0
  265. package/dist/types/storage/indexed-db/index.d.ts.map +1 -0
  266. package/dist/types/storage/indexed-db/merkletree.d.ts +43 -0
  267. package/dist/types/storage/indexed-db/merkletree.d.ts.map +1 -0
  268. package/dist/types/storage/interfaces/circuits.d.ts +26 -0
  269. package/dist/types/storage/interfaces/circuits.d.ts.map +1 -0
  270. package/dist/types/storage/interfaces/credentials.d.ts +53 -0
  271. package/dist/types/storage/interfaces/credentials.d.ts.map +1 -0
  272. package/dist/types/storage/interfaces/data-source.d.ts +39 -0
  273. package/dist/types/storage/interfaces/data-source.d.ts.map +1 -0
  274. package/dist/types/storage/interfaces/data-storage.d.ts +17 -0
  275. package/dist/types/storage/interfaces/data-storage.d.ts.map +1 -0
  276. package/dist/types/storage/interfaces/identity.d.ts +70 -0
  277. package/dist/types/storage/interfaces/identity.d.ts.map +1 -0
  278. package/dist/types/storage/interfaces/index.d.ts +11 -0
  279. package/dist/types/storage/interfaces/index.d.ts.map +1 -0
  280. package/dist/types/storage/interfaces/merkletree.d.ts +44 -0
  281. package/dist/types/storage/interfaces/merkletree.d.ts.map +1 -0
  282. package/dist/types/storage/interfaces/onchain-issuer.d.ts +13 -0
  283. package/dist/types/storage/interfaces/onchain-issuer.d.ts.map +1 -0
  284. package/dist/types/storage/interfaces/onchain-revocation.d.ts +19 -0
  285. package/dist/types/storage/interfaces/onchain-revocation.d.ts.map +1 -0
  286. package/dist/types/storage/interfaces/onchain-zkp-verifier.d.ts +63 -0
  287. package/dist/types/storage/interfaces/onchain-zkp-verifier.d.ts.map +1 -0
  288. package/dist/types/storage/interfaces/state.d.ts +74 -0
  289. package/dist/types/storage/interfaces/state.d.ts.map +1 -0
  290. package/dist/types/storage/local-storage/data-source.d.ts +41 -0
  291. package/dist/types/storage/local-storage/data-source.d.ts.map +1 -0
  292. package/dist/types/storage/local-storage/index.d.ts +3 -0
  293. package/dist/types/storage/local-storage/index.d.ts.map +1 -0
  294. package/dist/types/storage/local-storage/merkletree.d.ts +41 -0
  295. package/dist/types/storage/local-storage/merkletree.d.ts.map +1 -0
  296. package/dist/types/storage/memory/cache-lru.d.ts +11 -0
  297. package/dist/types/storage/memory/cache-lru.d.ts.map +1 -0
  298. package/dist/types/storage/memory/data-source.d.ts +20 -0
  299. package/dist/types/storage/memory/data-source.d.ts.map +1 -0
  300. package/dist/types/storage/memory/index.d.ts +4 -0
  301. package/dist/types/storage/memory/index.d.ts.map +1 -0
  302. package/dist/types/storage/memory/merkletree.d.ts +48 -0
  303. package/dist/types/storage/memory/merkletree.d.ts.map +1 -0
  304. package/dist/types/storage/shared/circuit-storage.d.ts +39 -0
  305. package/dist/types/storage/shared/circuit-storage.d.ts.map +1 -0
  306. package/dist/types/storage/shared/credential-storage.d.ts +39 -0
  307. package/dist/types/storage/shared/credential-storage.d.ts.map +1 -0
  308. package/dist/types/storage/shared/identity-storage.d.ts +45 -0
  309. package/dist/types/storage/shared/identity-storage.d.ts.map +1 -0
  310. package/dist/types/storage/shared/index.d.ts +4 -0
  311. package/dist/types/storage/shared/index.d.ts.map +1 -0
  312. package/dist/types/storage/utils.d.ts +4 -0
  313. package/dist/types/storage/utils.d.ts.map +1 -0
  314. package/dist/types/utils/compare-func.d.ts +2 -0
  315. package/dist/types/utils/compare-func.d.ts.map +1 -0
  316. package/dist/types/utils/did-helper.d.ts +38 -0
  317. package/dist/types/utils/did-helper.d.ts.map +1 -0
  318. package/dist/types/utils/encoding.d.ts +25 -0
  319. package/dist/types/utils/encoding.d.ts.map +1 -0
  320. package/dist/types/utils/index.d.ts +8 -0
  321. package/dist/types/utils/index.d.ts.map +1 -0
  322. package/dist/types/utils/message-bus.d.ts +63 -0
  323. package/dist/types/utils/message-bus.d.ts.map +1 -0
  324. package/dist/types/utils/object.d.ts +10 -0
  325. package/dist/types/utils/object.d.ts.map +1 -0
  326. package/dist/types/utils/payments/evm.d.ts +19 -0
  327. package/dist/types/utils/payments/evm.d.ts.map +1 -0
  328. package/dist/types/utils/payments/solana.d.ts +88 -0
  329. package/dist/types/utils/payments/solana.d.ts.map +1 -0
  330. package/dist/types/verifiable/constants.d.ts +188 -0
  331. package/dist/types/verifiable/constants.d.ts.map +1 -0
  332. package/dist/types/verifiable/core-utils.d.ts +87 -0
  333. package/dist/types/verifiable/core-utils.d.ts.map +1 -0
  334. package/dist/types/verifiable/credential.d.ts +150 -0
  335. package/dist/types/verifiable/credential.d.ts.map +1 -0
  336. package/dist/types/verifiable/index.d.ts +7 -0
  337. package/dist/types/verifiable/index.d.ts.map +1 -0
  338. package/dist/types/verifiable/presentation.d.ts +11 -0
  339. package/dist/types/verifiable/presentation.d.ts.map +1 -0
  340. package/dist/types/verifiable/proof.d.ts +211 -0
  341. package/dist/types/verifiable/proof.d.ts.map +1 -0
  342. package/dist/types/verifiable/schema.d.ts +3 -0
  343. package/dist/types/verifiable/schema.d.ts.map +1 -0
  344. package/package.json +104 -0
  345. package/src/blockchain/index.ts +1 -0
  346. package/src/blockchain/transaction-service.ts +121 -0
  347. package/src/circuits/atomic-query-mtp-v2-on-chain.ts +338 -0
  348. package/src/circuits/atomic-query-mtp-v2.ts +283 -0
  349. package/src/circuits/atomic-query-sig-v2-on-chain.ts +411 -0
  350. package/src/circuits/atomic-query-sig-v2.ts +340 -0
  351. package/src/circuits/atomic-query-v3-on-chain.ts +531 -0
  352. package/src/circuits/atomic-query-v3.ts +461 -0
  353. package/src/circuits/auth-v2.ts +159 -0
  354. package/src/circuits/common.ts +261 -0
  355. package/src/circuits/comparer.ts +227 -0
  356. package/src/circuits/index.ts +12 -0
  357. package/src/circuits/linked-multi-query.ts +180 -0
  358. package/src/circuits/models.ts +263 -0
  359. package/src/circuits/state-transition.ts +139 -0
  360. package/src/credentials/credential-wallet.ts +353 -0
  361. package/src/credentials/index.ts +11 -0
  362. package/src/credentials/models.ts +93 -0
  363. package/src/credentials/rhs.ts +176 -0
  364. package/src/credentials/status/agent-revocation.ts +69 -0
  365. package/src/credentials/status/credential-status-publisher.ts +143 -0
  366. package/src/credentials/status/did-resolver-revocation.ts +24 -0
  367. package/src/credentials/status/on-chain-revocation.ts +174 -0
  368. package/src/credentials/status/resolver.ts +81 -0
  369. package/src/credentials/status/reverse-sparse-merkle-tree.ts +366 -0
  370. package/src/credentials/status/sparse-merkle-tree.ts +50 -0
  371. package/src/credentials/utils.ts +36 -0
  372. package/src/iden3comm/constants.ts +119 -0
  373. package/src/iden3comm/errors.ts +14 -0
  374. package/src/iden3comm/handlers/auth.ts +520 -0
  375. package/src/iden3comm/handlers/common.ts +324 -0
  376. package/src/iden3comm/handlers/contract-request.ts +367 -0
  377. package/src/iden3comm/handlers/credential-proposal.ts +371 -0
  378. package/src/iden3comm/handlers/discovery-protocol.ts +277 -0
  379. package/src/iden3comm/handlers/fetch.ts +450 -0
  380. package/src/iden3comm/handlers/index.ts +11 -0
  381. package/src/iden3comm/handlers/message-handler.ts +165 -0
  382. package/src/iden3comm/handlers/payment.ts +698 -0
  383. package/src/iden3comm/handlers/problem-report.ts +41 -0
  384. package/src/iden3comm/handlers/refresh.ts +138 -0
  385. package/src/iden3comm/handlers/revocation-status.ts +228 -0
  386. package/src/iden3comm/index.ts +9 -0
  387. package/src/iden3comm/packageManager.ts +143 -0
  388. package/src/iden3comm/packers/index.ts +3 -0
  389. package/src/iden3comm/packers/jws.ts +225 -0
  390. package/src/iden3comm/packers/plain.ts +86 -0
  391. package/src/iden3comm/packers/zkp.ts +243 -0
  392. package/src/iden3comm/types/index.ts +17 -0
  393. package/src/iden3comm/types/models.ts +7 -0
  394. package/src/iden3comm/types/packageManager.ts +112 -0
  395. package/src/iden3comm/types/packer.ts +190 -0
  396. package/src/iden3comm/types/protocol/accept-profile.ts +14 -0
  397. package/src/iden3comm/types/protocol/attachment.ts +12 -0
  398. package/src/iden3comm/types/protocol/auth.ts +104 -0
  399. package/src/iden3comm/types/protocol/common.ts +10 -0
  400. package/src/iden3comm/types/protocol/contract-request.ts +76 -0
  401. package/src/iden3comm/types/protocol/credentials.ts +96 -0
  402. package/src/iden3comm/types/protocol/discovery-protocol.ts +49 -0
  403. package/src/iden3comm/types/protocol/messages.ts +13 -0
  404. package/src/iden3comm/types/protocol/payment.ts +231 -0
  405. package/src/iden3comm/types/protocol/problem-report.ts +18 -0
  406. package/src/iden3comm/types/protocol/proof.ts +25 -0
  407. package/src/iden3comm/types/protocol/proposal-request.ts +38 -0
  408. package/src/iden3comm/types/protocol/revocation.ts +23 -0
  409. package/src/iden3comm/utils/accept-profile.ts +121 -0
  410. package/src/iden3comm/utils/did.ts +71 -0
  411. package/src/iden3comm/utils/envelope.ts +101 -0
  412. package/src/iden3comm/utils/index.ts +4 -0
  413. package/src/iden3comm/utils/message.ts +41 -0
  414. package/src/identity/common.ts +69 -0
  415. package/src/identity/identity-wallet.ts +1592 -0
  416. package/src/identity/index.ts +2 -0
  417. package/src/index.ts +16 -0
  418. package/src/kms/index.ts +4 -0
  419. package/src/kms/key-providers/bjj-provider.ts +118 -0
  420. package/src/kms/key-providers/ed25519-provider.ts +105 -0
  421. package/src/kms/key-providers/index.ts +3 -0
  422. package/src/kms/key-providers/secp256k1-provider.ts +125 -0
  423. package/src/kms/kms.ts +173 -0
  424. package/src/kms/provider-helpers.ts +13 -0
  425. package/src/kms/store/abstract-key-store.ts +34 -0
  426. package/src/kms/store/index.ts +5 -0
  427. package/src/kms/store/indexed-db-key-store.ts +60 -0
  428. package/src/kms/store/local-storage-key-store.ts +69 -0
  429. package/src/kms/store/memory-key-store.ts +29 -0
  430. package/src/kms/store/types.ts +21 -0
  431. package/src/proof/common.ts +273 -0
  432. package/src/proof/index.ts +4 -0
  433. package/src/proof/proof-service.ts +623 -0
  434. package/src/proof/provers/index.ts +3 -0
  435. package/src/proof/provers/inputs-generator.ts +627 -0
  436. package/src/proof/provers/prover.ts +104 -0
  437. package/src/proof/provers/witness_calculator.ts +315 -0
  438. package/src/proof/verifiers/index.ts +3 -0
  439. package/src/proof/verifiers/pub-signals-verifier.ts +730 -0
  440. package/src/proof/verifiers/query-hash.ts +57 -0
  441. package/src/proof/verifiers/query.ts +340 -0
  442. package/src/schema-processor/index.ts +3 -0
  443. package/src/schema-processor/json/index.ts +2 -0
  444. package/src/schema-processor/json/parser.ts +256 -0
  445. package/src/schema-processor/json/validator.ts +67 -0
  446. package/src/schema-processor/jsonld/cache.ts +49 -0
  447. package/src/schema-processor/jsonld/index.ts +2 -0
  448. package/src/schema-processor/jsonld/parser.ts +93 -0
  449. package/src/schema-processor/utils.ts +84 -0
  450. package/src/storage/blockchain/abi/CredentialStatusResolver.json +1 -0
  451. package/src/storage/blockchain/abi/ERC20.json +1 -0
  452. package/src/storage/blockchain/abi/ERC20Permit.json +1 -0
  453. package/src/storage/blockchain/abi/IdentityBase.json +1 -0
  454. package/src/storage/blockchain/abi/State.json +1 -0
  455. package/src/storage/blockchain/abi/ZkpVerifier.json +789 -0
  456. package/src/storage/blockchain/common.ts +20 -0
  457. package/src/storage/blockchain/did-resolver-readonly-storage.ts +90 -0
  458. package/src/storage/blockchain/erc20-helper.ts +66 -0
  459. package/src/storage/blockchain/errors.ts +46 -0
  460. package/src/storage/blockchain/index.ts +7 -0
  461. package/src/storage/blockchain/onchain-issuer-adapter/non-merklized/version/v0.0.1/onchain-non-merklized-issuer-adapter.ts +327 -0
  462. package/src/storage/blockchain/onchain-issuer.ts +104 -0
  463. package/src/storage/blockchain/onchain-revocation.ts +143 -0
  464. package/src/storage/blockchain/onchain-zkp-verifier.ts +704 -0
  465. package/src/storage/blockchain/state.ts +471 -0
  466. package/src/storage/entities/circuitData.ts +7 -0
  467. package/src/storage/entities/identity.ts +18 -0
  468. package/src/storage/entities/index.ts +4 -0
  469. package/src/storage/entities/mt.ts +25 -0
  470. package/src/storage/entities/state.ts +97 -0
  471. package/src/storage/errors.ts +8 -0
  472. package/src/storage/filters/index.ts +1 -0
  473. package/src/storage/filters/jsonQuery.ts +368 -0
  474. package/src/storage/fs/circuits-storage.ts +149 -0
  475. package/src/storage/fs/index.ts +1 -0
  476. package/src/storage/index.ts +9 -0
  477. package/src/storage/indexed-db/data-source.ts +58 -0
  478. package/src/storage/indexed-db/index.ts +2 -0
  479. package/src/storage/indexed-db/merkletree.ts +140 -0
  480. package/src/storage/interfaces/circuits.ts +27 -0
  481. package/src/storage/interfaces/credentials.ts +53 -0
  482. package/src/storage/interfaces/data-source.ts +41 -0
  483. package/src/storage/interfaces/data-storage.ts +17 -0
  484. package/src/storage/interfaces/identity.ts +73 -0
  485. package/src/storage/interfaces/index.ts +10 -0
  486. package/src/storage/interfaces/merkletree.ts +52 -0
  487. package/src/storage/interfaces/onchain-issuer.ts +13 -0
  488. package/src/storage/interfaces/onchain-revocation.ts +22 -0
  489. package/src/storage/interfaces/onchain-zkp-verifier.ts +94 -0
  490. package/src/storage/interfaces/state.ts +81 -0
  491. package/src/storage/local-storage/data-source.ts +87 -0
  492. package/src/storage/local-storage/index.ts +2 -0
  493. package/src/storage/local-storage/merkletree.ts +137 -0
  494. package/src/storage/memory/cache-lru.ts +30 -0
  495. package/src/storage/memory/data-source.ts +45 -0
  496. package/src/storage/memory/index.ts +3 -0
  497. package/src/storage/memory/merkletree.ts +116 -0
  498. package/src/storage/shared/circuit-storage.ts +49 -0
  499. package/src/storage/shared/credential-storage.ts +70 -0
  500. package/src/storage/shared/identity-storage.ts +82 -0
  501. package/src/storage/shared/index.ts +3 -0
  502. package/src/storage/utils.ts +19 -0
  503. package/src/utils/compare-func.ts +5 -0
  504. package/src/utils/did-helper.ts +157 -0
  505. package/src/utils/encoding.ts +47 -0
  506. package/src/utils/index.ts +7 -0
  507. package/src/utils/message-bus.ts +88 -0
  508. package/src/utils/object.ts +52 -0
  509. package/src/utils/payments/evm.ts +152 -0
  510. package/src/utils/payments/solana.ts +360 -0
  511. package/src/verifiable/constants.ts +239 -0
  512. package/src/verifiable/core-utils.ts +307 -0
  513. package/src/verifiable/credential.ts +649 -0
  514. package/src/verifiable/index.ts +6 -0
  515. package/src/verifiable/presentation.ts +97 -0
  516. package/src/verifiable/proof.ts +277 -0
  517. package/src/verifiable/schema.ts +241 -0
@@ -0,0 +1,92 @@
1
+ import { ProofJSON } from '@iden3/js-merkletree';
2
+ /**
3
+ * state information of identity from chain.
4
+ *
5
+ * @public
6
+ * @interface StateInfo
7
+ */
8
+ export interface StateInfo {
9
+ id?: bigint;
10
+ state?: bigint;
11
+ replacedByState?: bigint;
12
+ createdAtTimestamp?: bigint;
13
+ replacedAtTimestamp?: bigint;
14
+ createdAtBlock?: bigint;
15
+ replacedAtBlock?: bigint;
16
+ }
17
+ /**
18
+ * state proof of identity from chain
19
+ *
20
+ * @public
21
+ * @interface StateProof
22
+ */
23
+ export interface StateProof {
24
+ root: bigint;
25
+ existence: boolean;
26
+ siblings: bigint[];
27
+ index: bigint;
28
+ value: bigint;
29
+ auxExistence: boolean;
30
+ auxIndex: bigint;
31
+ auxValue: bigint;
32
+ }
33
+ /**
34
+ * global identity state root info from chain
35
+ *
36
+ * @public
37
+ * @interface RootInfo
38
+ */
39
+ export interface RootInfo {
40
+ root: bigint;
41
+ replacedByRoot: bigint;
42
+ createdAtTimestamp: bigint;
43
+ replacedAtTimestamp: bigint;
44
+ createdAtBlock: bigint;
45
+ replacedAtBlock: bigint;
46
+ proof?: ProofJSON;
47
+ }
48
+ /**
49
+ * identity state message
50
+ *
51
+ * @public
52
+ * @interface IdentityStateMsg
53
+ */
54
+ export interface IdentityStateMsg {
55
+ timestamp: number;
56
+ id: bigint;
57
+ state: bigint;
58
+ replacedAtTimestamp: number;
59
+ }
60
+ /**
61
+ * global state message
62
+ *
63
+ * @public
64
+ * @interface GlobalStateMsg
65
+ */
66
+ export interface GlobalStateMsg {
67
+ timestamp: number;
68
+ idType: string;
69
+ root: bigint;
70
+ replacedAtTimestamp: number;
71
+ }
72
+ /**
73
+ * identity state update
74
+ *
75
+ * @public
76
+ * @interface IdentityStateUpdate
77
+ */
78
+ export interface IdentityStateUpdate {
79
+ idStateMsg: IdentityStateMsg;
80
+ signature: string;
81
+ }
82
+ /**
83
+ * global state update
84
+ *
85
+ * @public
86
+ * @interface GlobalStateUpdate
87
+ */
88
+ export interface GlobalStateUpdate {
89
+ globalStateMsg: GlobalStateMsg;
90
+ signature: string;
91
+ }
92
+ //# sourceMappingURL=state.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"state.d.ts","sourceRoot":"","sources":["../../../../src/storage/entities/state.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAAE,MAAM,sBAAsB,CAAC;AACjD;;;;;GAKG;AACH,MAAM,WAAW,SAAS;IACxB,EAAE,CAAC,EAAE,MAAM,CAAC;IACZ,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,eAAe,CAAC,EAAE,MAAM,CAAC;IACzB,kBAAkB,CAAC,EAAE,MAAM,CAAC;IAC5B,mBAAmB,CAAC,EAAE,MAAM,CAAC;IAC7B,cAAc,CAAC,EAAE,MAAM,CAAC;IACxB,eAAe,CAAC,EAAE,MAAM,CAAC;CAC1B;AAED;;;;;GAKG;AACH,MAAM,WAAW,UAAU;IACzB,IAAI,EAAE,MAAM,CAAC;IACb,SAAS,EAAE,OAAO,CAAC;IACnB,QAAQ,EAAE,MAAM,EAAE,CAAC;IACnB,KAAK,EAAE,MAAM,CAAC;IACd,KAAK,EAAE,MAAM,CAAC;IACd,YAAY,EAAE,OAAO,CAAC;IACtB,QAAQ,EAAE,MAAM,CAAC;IACjB,QAAQ,EAAE,MAAM,CAAC;CAClB;AAED;;;;;GAKG;AACH,MAAM,WAAW,QAAQ;IACvB,IAAI,EAAE,MAAM,CAAC;IACb,cAAc,EAAE,MAAM,CAAC;IACvB,kBAAkB,EAAE,MAAM,CAAC;IAC3B,mBAAmB,EAAE,MAAM,CAAC;IAC5B,cAAc,EAAE,MAAM,CAAC;IACvB,eAAe,EAAE,MAAM,CAAC;IACxB,KAAK,CAAC,EAAE,SAAS,CAAC;CACnB;AAED;;;;;GAKG;AACH,MAAM,WAAW,gBAAgB;IAC/B,SAAS,EAAE,MAAM,CAAC;IAClB,EAAE,EAAE,MAAM,CAAC;IACX,KAAK,EAAE,MAAM,CAAC;IACd,mBAAmB,EAAE,MAAM,CAAC;CAC7B;AAED;;;;;GAKG;AACH,MAAM,WAAW,cAAc;IAC7B,SAAS,EAAE,MAAM,CAAC;IAClB,MAAM,EAAE,MAAM,CAAC;IACf,IAAI,EAAE,MAAM,CAAC;IACb,mBAAmB,EAAE,MAAM,CAAC;CAC7B;AAED;;;;;GAKG;AACH,MAAM,WAAW,mBAAmB;IAClC,UAAU,EAAE,gBAAgB,CAAC;IAC7B,SAAS,EAAE,MAAM,CAAC;CACnB;AAED;;;;;GAKG;AACH,MAAM,WAAW,iBAAiB;IAChC,cAAc,EAAE,cAAc,CAAC;IAC/B,SAAS,EAAE,MAAM,CAAC;CACnB"}
@@ -0,0 +1,9 @@
1
+ /**
2
+ * Storage Errors definition
3
+ *
4
+ * @enum {number}
5
+ */
6
+ export declare enum StorageErrors {
7
+ ItemNotFound = "item not found"
8
+ }
9
+ //# sourceMappingURL=errors.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"errors.d.ts","sourceRoot":"","sources":["../../../src/storage/errors.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AACH,oBAAY,aAAa;IACvB,YAAY,mBAAmB;CAChC"}
@@ -0,0 +1,2 @@
1
+ export * from './jsonQuery';
2
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/storage/filters/index.ts"],"names":[],"mappings":"AAAA,cAAc,aAAa,CAAC"}
@@ -0,0 +1,83 @@
1
+ import { W3CCredential, ProofQuery } from '../../verifiable';
2
+ /**
3
+ * search errors
4
+ *
5
+ * @enum {number}
6
+ */
7
+ export declare enum SearchError {
8
+ NotDefinedQueryKey = "not defined query key",
9
+ NotDefinedComparator = "not defined comparator"
10
+ }
11
+ /**
12
+ * supported data formats
13
+ *
14
+ * @enum {number}
15
+ */
16
+ export declare enum SupportedDataFormat {
17
+ BigInt = 0,
18
+ Boolean = 1,
19
+ Double = 2,
20
+ DateTime = 3,
21
+ String = 4
22
+ }
23
+ /** allowed operators to search */
24
+ export type FilterOperatorMethod = '$noop' | '$eq' | '$in' | '$nin' | '$gt' | '$lt' | '$ne' | '$gte' | '$lte' | '$sd' | '$exists' | '$between' | '$nonbetween';
25
+ /** filter function type */
26
+ export type FilterOperatorFunction = (a: any, b: any) => boolean;
27
+ /**
28
+ * query filter interface that allows to query Verifiable Credential
29
+ *
30
+ * @public
31
+ * @interface IFilterQuery
32
+ */
33
+ export interface IFilterQuery {
34
+ /**
35
+ * applies filter to verifiable credential
36
+ *
37
+ * @param {W3CCredential} credential - credential to query
38
+ * @returns boolean
39
+ */
40
+ execute(credential: W3CCredential): boolean;
41
+ }
42
+ export declare const comparatorOptions: {
43
+ [v in FilterOperatorMethod]: FilterOperatorFunction;
44
+ };
45
+ /**
46
+ * credential search path resolver
47
+ *
48
+ * @param {object} object - object to query
49
+ * @param {string} path - given path
50
+ * @param {*} [defaultValue=null]
51
+ */
52
+ export declare const resolvePath: (object: object, path: string, defaultValue?: null) => object | null;
53
+ /**
54
+ * Filter for queries of credentialSubject with a json path e.g birthday.date
55
+ *
56
+ *
57
+ * @public
58
+ * @class FilterQuery
59
+ * @implements implements IFilterQuery interface
60
+ */
61
+ export declare class FilterQuery implements IFilterQuery {
62
+ path: string;
63
+ operatorFunc: FilterOperatorFunction;
64
+ value: any;
65
+ isReverseParams: boolean;
66
+ /**
67
+ * Creates an instance of FilterQuery.
68
+ * @param {string} path
69
+ * @param {FilterOperatorFunction} operatorFunc
70
+ * @param {*} value
71
+ * @param {boolean} [isReverseParams=false]
72
+ */
73
+ constructor(path: string, operatorFunc: FilterOperatorFunction, value: any, isReverseParams?: boolean);
74
+ /** {@inheritdoc IFilterQuery} */
75
+ execute(credential: W3CCredential): boolean;
76
+ }
77
+ /**
78
+ * creates filters based on proof query
79
+ * @param {ProofQuery} query - proof query
80
+ * @returns {*} {FilterQuery[]} - array of filters to apply
81
+ */
82
+ export declare const StandardJSONCredentialsQueryFilter: (query: ProofQuery) => FilterQuery[];
83
+ //# sourceMappingURL=jsonQuery.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"jsonQuery.d.ts","sourceRoot":"","sources":["../../../../src/storage/filters/jsonQuery.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,aAAa,EAAE,UAAU,EAAE,MAAM,kBAAkB,CAAC;AAE7D;;;;GAIG;AACH,oBAAY,WAAW;IACrB,kBAAkB,0BAA0B;IAC5C,oBAAoB,2BAA2B;CAChD;AACD;;;;GAIG;AACH,oBAAY,mBAAmB;IAC7B,MAAM,IAAA;IACN,OAAO,IAAA;IACP,MAAM,IAAA;IACN,QAAQ,IAAA;IACR,MAAM,IAAA;CACP;AACD,kCAAkC;AAClC,MAAM,MAAM,oBAAoB,GAC5B,OAAO,GACP,KAAK,GACL,KAAK,GACL,MAAM,GACN,KAAK,GACL,KAAK,GACL,KAAK,GACL,MAAM,GACN,MAAM,GACN,KAAK,GACL,SAAS,GACT,UAAU,GACV,aAAa,CAAC;AAElB,2BAA2B;AAC3B,MAAM,MAAM,sBAAsB,GAAG,CAAC,CAAC,EAAE,GAAG,EAAE,CAAC,EAAE,GAAG,KAAK,OAAO,CAAC;AAEjE;;;;;GAKG;AACH,MAAM,WAAW,YAAY;IAC3B;;;;;OAKG;IACH,OAAO,CAAC,UAAU,EAAE,aAAa,GAAG,OAAO,CAAC;CAC7C;AA+HD,eAAO,MAAM,iBAAiB,EAAE;KAAG,CAAC,IAAI,oBAAoB,GAAG,sBAAsB;CAsBpF,CAAC;AAEF;;;;;;GAMG;AACH,eAAO,MAAM,WAAW,GAAI,QAAQ,MAAM,EAAE,MAAM,MAAM,EAAE,mBAAmB,kBAU5E,CAAC;AAEF;;;;;;;GAOG;AACH,qBAAa,WAAY,YAAW,YAAY;IASrC,IAAI,EAAE,MAAM;IACZ,YAAY,EAAE,sBAAsB;IACpC,KAAK,EAAE,GAAG;IACV,eAAe;IAXxB;;;;;;OAMG;gBAEM,IAAI,EAAE,MAAM,EACZ,YAAY,EAAE,sBAAsB,EACpC,KAAK,EAAE,GAAG,EACV,eAAe,UAAQ;IAEhC,iCAAiC;IACjC,OAAO,CAAC,UAAU,EAAE,aAAa,GAAG,OAAO;CAgB5C;AAED;;;;GAIG;AACH,eAAO,MAAM,kCAAkC,GAAI,OAAO,UAAU,KAAG,WAAW,EAyDjF,CAAC"}
@@ -0,0 +1,64 @@
1
+ import { CircuitId } from '../../circuits';
2
+ import { CircuitData } from '../entities/circuitData';
3
+ import { ICircuitStorage } from '../interfaces/circuits';
4
+ /**
5
+ * Options for FSCircuitStorage,
6
+ * Path to the circuit file is constructed from `${this._dirname}/${circuitId}/${filename}`,
7
+ * by default values for keys are:
8
+ * - verification key : verification_key.json
9
+ * - proving key : circuit_final.zkey
10
+ * - wasm file : circuit.wasm
11
+ * you can customize filename by passing the corresponding option.
12
+ * dirname is mandatory.
13
+ * hierarchical structure for files is mandatory
14
+ * e.g. --circuits
15
+ * -----circuitId
16
+ * ---------file
17
+ * @public
18
+ * @interface FSCircuitStorageOptions
19
+ */
20
+ export interface FSCircuitStorageOptions {
21
+ dirname: string;
22
+ verificationFileName?: string;
23
+ provingFileName?: string;
24
+ wasmFileName?: string;
25
+ }
26
+ /**
27
+ * Implementation of ICircuitStorage to store keys data in file system
28
+ *
29
+ * @public
30
+ * @class FSCircuitStorage
31
+ * @implements implements ICircuitStorage interface
32
+ */
33
+ export declare class FSCircuitStorage implements ICircuitStorage {
34
+ private readonly opts;
35
+ private readonly _verificationKeyPath;
36
+ private readonly _provingKeyPath;
37
+ private readonly _wasmFilePath;
38
+ private _fs;
39
+ private readonly _browserNotSupportedError;
40
+ private getFs;
41
+ /**
42
+ * Creates an instance of FSCircuitStorage.
43
+ * @param {string} opts - options to read / save files
44
+ */
45
+ constructor(opts: FSCircuitStorageOptions);
46
+ /**
47
+ * loads circuit data by id from file storage
48
+ * {@inheritdoc ICircuitStorage.loadCircuitData}
49
+ * @param {CircuitId} circuitId - id of the circuit
50
+ * @returns `Promise<CircuitData>`
51
+ */
52
+ loadCircuitData(circuitId: CircuitId): Promise<CircuitData>;
53
+ private loadCircuitFile;
54
+ private writeCircuitFile;
55
+ /**
56
+ * {@inheritdoc ICircuitStorage.loadCircuitData}
57
+ * saves circuit data for circuit id to the file storage
58
+ * @param {CircuitId} circuitId - id of the circuit
59
+ * @param {CircuitData} circuitData - circuit keys
60
+ * @returns `Promise<void>`
61
+ */
62
+ saveCircuitData(circuitId: CircuitId, circuitData: CircuitData): Promise<void>;
63
+ }
64
+ //# sourceMappingURL=circuits-storage.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"circuits-storage.d.ts","sourceRoot":"","sources":["../../../../src/storage/fs/circuits-storage.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAAE,MAAM,gBAAgB,CAAC;AAC3C,OAAO,EAAE,WAAW,EAAE,MAAM,yBAAyB,CAAC;AACtD,OAAO,EAAE,eAAe,EAAE,MAAM,wBAAwB,CAAC;AAEzD;;;;;;;;;;;;;;;GAeG;AACH,MAAM,WAAW,uBAAuB;IACtC,OAAO,EAAE,MAAM,CAAC;IAChB,oBAAoB,CAAC,EAAE,MAAM,CAAC;IAC9B,eAAe,CAAC,EAAE,MAAM,CAAC;IACzB,YAAY,CAAC,EAAE,MAAM,CAAC;CACvB;AACD;;;;;;GAMG;AACH,qBAAa,gBAAiB,YAAW,eAAe;IAyC1C,OAAO,CAAC,QAAQ,CAAC,IAAI;IAxCjC,OAAO,CAAC,QAAQ,CAAC,oBAAoB,CAAmC;IACxE,OAAO,CAAC,QAAQ,CAAC,eAAe,CAAgC;IAChE,OAAO,CAAC,QAAQ,CAAC,aAAa,CAA0B;IAExD,OAAO,CAAC,GAAG,CAAoC;IAE/C,OAAO,CAAC,QAAQ,CAAC,yBAAyB,CAExC;YAEY,KAAK;IA0BnB;;;OAGG;gBAC0B,IAAI,EAAE,uBAAuB;IAM1D;;;;;OAKG;IACG,eAAe,CAAC,SAAS,EAAE,SAAS,GAAG,OAAO,CAAC,WAAW,CAAC;YAanD,eAAe;YAYf,gBAAgB;IAa9B;;;;;;OAMG;IACG,eAAe,CAAC,SAAS,EAAE,SAAS,EAAE,WAAW,EAAE,WAAW,GAAG,OAAO,CAAC,IAAI,CAAC;CAiBrF"}
@@ -0,0 +1,2 @@
1
+ export * from './circuits-storage';
2
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/storage/fs/index.ts"],"names":[],"mappings":"AAAA,cAAc,oBAAoB,CAAC"}
@@ -0,0 +1,10 @@
1
+ export * from './interfaces';
2
+ export * from './blockchain';
3
+ export * from './entities';
4
+ export * from './filters';
5
+ export * from './memory';
6
+ export * from './local-storage';
7
+ export * from './indexed-db';
8
+ export * from './shared';
9
+ export * from './fs';
10
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/storage/index.ts"],"names":[],"mappings":"AAAA,cAAc,cAAc,CAAC;AAC7B,cAAc,cAAc,CAAC;AAC7B,cAAc,YAAY,CAAC;AAC3B,cAAc,WAAW,CAAC;AAC1B,cAAc,UAAU,CAAC;AACzB,cAAc,iBAAiB,CAAC;AAChC,cAAc,cAAc,CAAC;AAC7B,cAAc,UAAU,CAAC;AACzB,cAAc,MAAM,CAAC"}
@@ -0,0 +1,44 @@
1
+ import { IDataSource } from '../interfaces/data-source';
2
+ /**
3
+ * Storage in the browser, uses indexed db storage
4
+ *
5
+ * @public
6
+ * @class IndexedDBDataSource
7
+ * @template Type
8
+ */
9
+ export declare class IndexedDBDataSource<Type> implements IDataSource<Type> {
10
+ private _storageKey;
11
+ /**
12
+ * Creates an instance of IndexedDBDataSource.
13
+ *
14
+ * @param {string} _storageKey - key string to put storage name
15
+ */
16
+ private readonly _store;
17
+ constructor(_storageKey: string);
18
+ /**
19
+ * Saves value to the indexed db storage
20
+ *
21
+ * @param {string} key - key value
22
+ * @param {Type} value - value to store
23
+ * @param {string} [keyName='id'] - key name
24
+ */
25
+ save(key: string, value: Type, keyName?: string): Promise<void>;
26
+ /**
27
+ * Gets value from the indexed db storage by given key
28
+ *
29
+ * @param {string} key - key value
30
+ * @param {string} [keyName='id'] - key name
31
+ */
32
+ get(key: string, keyName?: string): Promise<Type | undefined>;
33
+ /**
34
+ * loads all from the indexed db storage
35
+ */
36
+ load(): Promise<Type[]>;
37
+ /**
38
+ * deletes item from the indexed db storage
39
+ * @param {string} key - key value
40
+ * @param {string} [keyName='id'] - key name
41
+ */
42
+ delete(key: string, keyName?: string): Promise<void>;
43
+ }
44
+ //# sourceMappingURL=data-source.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"data-source.d.ts","sourceRoot":"","sources":["../../../../src/storage/indexed-db/data-source.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,WAAW,EAAE,MAAM,2BAA2B,CAAC;AAGxD;;;;;;GAMG;AACH,qBAAa,mBAAmB,CAAC,IAAI,CAAE,YAAW,WAAW,CAAC,IAAI,CAAC;IAOrD,OAAO,CAAC,WAAW;IAN/B;;;;OAIG;IACH,OAAO,CAAC,QAAQ,CAAC,MAAM,CAAW;gBACd,WAAW,EAAE,MAAM;IAIvC;;;;;;OAMG;IACG,IAAI,CAAC,GAAG,EAAE,MAAM,EAAE,KAAK,EAAE,IAAI,EAAE,OAAO,SAAO,GAAG,OAAO,CAAC,IAAI,CAAC;IAInE;;;;;OAKG;IACG,GAAG,CAAC,GAAG,EAAE,MAAM,EAAE,OAAO,SAAO,GAAG,OAAO,CAAC,IAAI,GAAG,SAAS,CAAC;IAIjE;;OAEG;IACG,IAAI,IAAI,OAAO,CAAC,IAAI,EAAE,CAAC;IAG7B;;;;OAIG;IACG,MAAM,CAAC,GAAG,EAAE,MAAM,EAAE,OAAO,SAAO,GAAG,OAAO,CAAC,IAAI,CAAC;CAGzD"}
@@ -0,0 +1,3 @@
1
+ export * from './data-source';
2
+ export * from './merkletree';
3
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/storage/indexed-db/index.ts"],"names":[],"mappings":"AAAA,cAAc,eAAe,CAAC;AAC9B,cAAc,cAAc,CAAC"}
@@ -0,0 +1,43 @@
1
+ import { Merkletree } from '@iden3/js-merkletree';
2
+ import { IdentityMerkleTreeMetaInformation, MerkleTreeType } from '../entities/mt';
3
+ import { IMerkleTreeStorage } from '../interfaces/merkletree';
4
+ /**
5
+ * Merkle tree storage that uses browser indexed db storage
6
+ *
7
+ * @public
8
+ * @class MerkleTreeIndexedDBStorage
9
+ * @implements implements IMerkleTreeStorage interface
10
+ */
11
+ export declare class MerkleTreeIndexedDBStorage implements IMerkleTreeStorage {
12
+ private readonly _mtDepth;
13
+ /**
14
+ * key for the storage key metadata
15
+ *
16
+ * @static
17
+ */
18
+ static readonly storageKeyMeta = "merkle-tree-meta";
19
+ static readonly storageBindingKeyMeta = "binding-did";
20
+ private readonly _merkleTreeMetaStore;
21
+ private readonly _bindingStore;
22
+ /**
23
+ * Creates an instance of MerkleTreeIndexedDBStorage.
24
+ * @param {number} _mtDepth
25
+ */
26
+ constructor(_mtDepth: number);
27
+ /** creates a tree in the indexed db storage */
28
+ createIdentityMerkleTrees(identifier: string): Promise<IdentityMerkleTreeMetaInformation[]>;
29
+ /**
30
+ *
31
+ * getIdentityMerkleTreesInfo from the indexed db storage
32
+ * @param {string} identifier
33
+ * @returns `{Promise<IdentityMerkleTreeMetaInformation[]>}`
34
+ */
35
+ getIdentityMerkleTreesInfo(identifier: string): Promise<IdentityMerkleTreeMetaInformation[]>;
36
+ /** get merkle tree from the indexed db storage */
37
+ getMerkleTreeByIdentifierAndType(identifier: string, mtType: MerkleTreeType): Promise<Merkletree>;
38
+ /** adds to merkle tree in the indexed db storage */
39
+ addToMerkleTree(identifier: string, mtType: MerkleTreeType, hindex: bigint, hvalue: bigint): Promise<void>;
40
+ /** binds merkle tree in the indexed db storage to the new identifiers */
41
+ bindMerkleTreeToNewIdentifier(oldIdentifier: string, newIdentifier: string): Promise<void>;
42
+ }
43
+ //# sourceMappingURL=merkletree.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"merkletree.d.ts","sourceRoot":"","sources":["../../../../src/storage/indexed-db/merkletree.ts"],"names":[],"mappings":"AACA,OAAO,EAAoB,UAAU,EAAa,MAAM,sBAAsB,CAAC;AAC/E,OAAO,EAAE,iCAAiC,EAAE,cAAc,EAAE,MAAM,gBAAgB,CAAC;AAGnF,OAAO,EAAE,kBAAkB,EAAE,MAAM,0BAA0B,CAAC;AAG9D;;;;;;GAMG;AACH,qBAAa,0BAA2B,YAAW,kBAAkB;IAgBvD,OAAO,CAAC,QAAQ,CAAC,QAAQ;IAfrC;;;;OAIG;IACH,MAAM,CAAC,QAAQ,CAAC,cAAc,sBAAsB;IACpD,MAAM,CAAC,QAAQ,CAAC,qBAAqB,iBAAiB;IAEtD,OAAO,CAAC,QAAQ,CAAC,oBAAoB,CAAW;IAChD,OAAO,CAAC,QAAQ,CAAC,aAAa,CAAW;IAEzC;;;OAGG;gBAC0B,QAAQ,EAAE,MAAM;IAW7C,+CAA+C;IACzC,yBAAyB,CAC7B,UAAU,EAAE,MAAM,GACjB,OAAO,CAAC,iCAAiC,EAAE,CAAC;IAc/C;;;;;OAKG;IACG,0BAA0B,CAC9B,UAAU,EAAE,MAAM,GACjB,OAAO,CAAC,iCAAiC,EAAE,CAAC;IAQ/C,kDAAkD;IAC5C,gCAAgC,CACpC,UAAU,EAAE,MAAM,EAClB,MAAM,EAAE,cAAc,GACrB,OAAO,CAAC,UAAU,CAAC;IAgBtB,oDAAoD;IAC9C,eAAe,CACnB,UAAU,EAAE,MAAM,EAClB,MAAM,EAAE,cAAc,EACtB,MAAM,EAAE,MAAM,EACd,MAAM,EAAE,MAAM,GACb,OAAO,CAAC,IAAI,CAAC;IAsBhB,yEAAyE;IACnE,6BAA6B,CAAC,aAAa,EAAE,MAAM,EAAE,aAAa,EAAE,MAAM,GAAG,OAAO,CAAC,IAAI,CAAC;CAejG"}
@@ -0,0 +1,26 @@
1
+ import { CircuitId } from '../../circuits';
2
+ import { CircuitData } from '../entities/circuitData';
3
+ /**
4
+ * Interface to work with circuit files
5
+ *
6
+ * @public
7
+ * @interface ICircuitStorage
8
+ */
9
+ export interface ICircuitStorage {
10
+ /**
11
+ * load circuit keys by id
12
+ *
13
+ * @param {CircuitId} circuitId - circuit id
14
+ * @returns `{Promise<CircuitData>}`
15
+ */
16
+ loadCircuitData(circuitId: CircuitId): Promise<CircuitData>;
17
+ /**
18
+ * saves circuit files by circuit id
19
+ *
20
+ * @param {CircuitId} circuitId - circuit id
21
+ * @param {CircuitData} circuitData - circuit keys
22
+ * @returns `Promise<void>`
23
+ */
24
+ saveCircuitData(circuitId: CircuitId, circuitData: CircuitData): Promise<void>;
25
+ }
26
+ //# sourceMappingURL=circuits.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"circuits.d.ts","sourceRoot":"","sources":["../../../../src/storage/interfaces/circuits.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAAE,MAAM,gBAAgB,CAAC;AAC3C,OAAO,EAAE,WAAW,EAAE,MAAM,yBAAyB,CAAC;AAEtD;;;;;GAKG;AACH,MAAM,WAAW,eAAe;IAC9B;;;;;OAKG;IACH,eAAe,CAAC,SAAS,EAAE,SAAS,GAAG,OAAO,CAAC,WAAW,CAAC,CAAC;IAE5D;;;;;;OAMG;IACH,eAAe,CAAC,SAAS,EAAE,SAAS,EAAE,WAAW,EAAE,WAAW,GAAG,OAAO,CAAC,IAAI,CAAC,CAAC;CAChF"}
@@ -0,0 +1,53 @@
1
+ import { ProofQuery, W3CCredential } from '../../verifiable';
2
+ /**
3
+ * Interface for credential storages
4
+ *
5
+ * @public
6
+ * @interface ICredentialStorage
7
+ */
8
+ export interface ICredentialStorage {
9
+ /**
10
+ *
11
+ * save credential to the storage
12
+ *
13
+ * @param {W3CCredential} credential - credential to save
14
+ * @returns `{Promise<void>}`
15
+ */
16
+ saveCredential(credential: W3CCredential): Promise<void>;
17
+ /**
18
+ *
19
+ * save all credential (upsert) to the storage
20
+ *
21
+ * @param {W3CCredential[]} credentials - credentials to save
22
+ * @returns `Promise<void>`
23
+ */
24
+ saveAllCredentials(credentials: W3CCredential[]): Promise<void>;
25
+ /**
26
+ * returns all credentials in the storage
27
+ *
28
+ * @returns `Promise<W3CCredential[]>`
29
+ */
30
+ listCredentials(): Promise<W3CCredential[]>;
31
+ /**
32
+ * Removes credential from storage
33
+ *
34
+ * @param {string} id - id of credential
35
+ * @returns `Promise<void>`
36
+ */
37
+ removeCredential(id: string): Promise<void>;
38
+ /**
39
+ * finds credential in the storage for given query
40
+ *
41
+ * @param {ProofQuery} query - query to apply
42
+ * @returns `{Promise<W3CCredential[]>}`
43
+ */
44
+ findCredentialsByQuery(query: ProofQuery): Promise<W3CCredential[]>;
45
+ /**
46
+ * finds credential by identifier
47
+ *
48
+ * @param {string} id - id of credential
49
+ * @returns `{(Promise<W3CCredential | undefined>)}`
50
+ */
51
+ findCredentialById(id: string): Promise<W3CCredential | undefined>;
52
+ }
53
+ //# sourceMappingURL=credentials.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"credentials.d.ts","sourceRoot":"","sources":["../../../../src/storage/interfaces/credentials.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,UAAU,EAAE,aAAa,EAAE,MAAM,kBAAkB,CAAC;AAE7D;;;;;GAKG;AACH,MAAM,WAAW,kBAAkB;IACjC;;;;;;OAMG;IACH,cAAc,CAAC,UAAU,EAAE,aAAa,GAAG,OAAO,CAAC,IAAI,CAAC,CAAC;IACzD;;;;;;OAMG;IACH,kBAAkB,CAAC,WAAW,EAAE,aAAa,EAAE,GAAG,OAAO,CAAC,IAAI,CAAC,CAAC;IAChE;;;;OAIG;IACH,eAAe,IAAI,OAAO,CAAC,aAAa,EAAE,CAAC,CAAC;IAC5C;;;;;OAKG;IACH,gBAAgB,CAAC,EAAE,EAAE,MAAM,GAAG,OAAO,CAAC,IAAI,CAAC,CAAC;IAC5C;;;;;OAKG;IACH,sBAAsB,CAAC,KAAK,EAAE,UAAU,GAAG,OAAO,CAAC,aAAa,EAAE,CAAC,CAAC;IACpE;;;;;OAKG;IACH,kBAAkB,CAAC,EAAE,EAAE,MAAM,GAAG,OAAO,CAAC,aAAa,GAAG,SAAS,CAAC,CAAC;CACpE"}
@@ -0,0 +1,39 @@
1
+ /**
2
+ * Generic Key/Value Data Source for crud operation
3
+ *
4
+ * @public
5
+ * @interface IDataSource
6
+ * @template Type - generic type
7
+ */
8
+ export interface IDataSource<Type> {
9
+ /**
10
+ * load all object with Type from data source
11
+ *
12
+ * @returns `{Type[]}`
13
+ */
14
+ load(): Promise<Type[]>;
15
+ /**
16
+ * Save value under the key with optional key name
17
+ *
18
+ * @param {string} key - key value
19
+ * @param {Type} value - value to store
20
+ * @param {string} [keyName] - key name
21
+ */
22
+ save(key: string, value: Type, keyName?: string): Promise<void>;
23
+ /**
24
+ * returns data value for key value and optional key name
25
+ *
26
+ * @param {string} key - key value
27
+ * @param {string} [keyName] - key name
28
+ * @returns ` {(Type | undefined)}`
29
+ */
30
+ get(key: string, keyName?: string): Promise<Type | undefined>;
31
+ /**
32
+ * deletes data value for given key with an optional key name
33
+ *
34
+ * @param {string} key - key value
35
+ * @param {string} [keyName] - key name
36
+ */
37
+ delete(key: string, keyName?: string): Promise<void>;
38
+ }
39
+ //# sourceMappingURL=data-source.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"data-source.d.ts","sourceRoot":"","sources":["../../../../src/storage/interfaces/data-source.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;AACH,MAAM,WAAW,WAAW,CAAC,IAAI;IAC/B;;;;OAIG;IACH,IAAI,IAAI,OAAO,CAAC,IAAI,EAAE,CAAC,CAAC;IAExB;;;;;;OAMG;IACH,IAAI,CAAC,GAAG,EAAE,MAAM,EAAE,KAAK,EAAE,IAAI,EAAE,OAAO,CAAC,EAAE,MAAM,GAAG,OAAO,CAAC,IAAI,CAAC,CAAC;IAEhE;;;;;;OAMG;IACH,GAAG,CAAC,GAAG,EAAE,MAAM,EAAE,OAAO,CAAC,EAAE,MAAM,GAAG,OAAO,CAAC,IAAI,GAAG,SAAS,CAAC,CAAC;IAE9D;;;;;OAKG;IACH,MAAM,CAAC,GAAG,EAAE,MAAM,EAAE,OAAO,CAAC,EAAE,MAAM,GAAG,OAAO,CAAC,IAAI,CAAC,CAAC;CACtD"}
@@ -0,0 +1,17 @@
1
+ import { ICredentialStorage } from './credentials';
2
+ import { IIdentityStorage } from './identity';
3
+ import { IMerkleTreeStorage } from './merkletree';
4
+ import { IStateStorage } from './state';
5
+ /**
6
+ * General Data storage interface that union identity, credential, merkletree and states storage.
7
+ *
8
+ * @public
9
+ * @interface IDataStorage
10
+ */
11
+ export interface IDataStorage {
12
+ credential: ICredentialStorage;
13
+ identity: IIdentityStorage;
14
+ mt: IMerkleTreeStorage;
15
+ states: IStateStorage;
16
+ }
17
+ //# sourceMappingURL=data-storage.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"data-storage.d.ts","sourceRoot":"","sources":["../../../../src/storage/interfaces/data-storage.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,kBAAkB,EAAE,MAAM,eAAe,CAAC;AACnD,OAAO,EAAE,gBAAgB,EAAE,MAAM,YAAY,CAAC;AAC9C,OAAO,EAAE,kBAAkB,EAAE,MAAM,cAAc,CAAC;AAClD,OAAO,EAAE,aAAa,EAAE,MAAM,SAAS,CAAC;AAExC;;;;;GAKG;AACH,MAAM,WAAW,YAAY;IAC3B,UAAU,EAAE,kBAAkB,CAAC;IAC/B,QAAQ,EAAE,gBAAgB,CAAC;IAC3B,EAAE,EAAE,kBAAkB,CAAC;IACvB,MAAM,EAAE,aAAa,CAAC;CACvB"}
@@ -0,0 +1,70 @@
1
+ import { Identity } from '../entities';
2
+ import { Profile } from '../entities';
3
+ /**
4
+ * storage for identities and profiles
5
+ *
6
+ * @public
7
+ * @interface IIdentityStorage
8
+ */
9
+ export interface IIdentityStorage {
10
+ /**
11
+ * saves identity to the data source
12
+ *
13
+ * @param {Identity} identity
14
+ * @returns `{Promise<void>}`
15
+ */
16
+ saveIdentity(identity: Identity): Promise<void>;
17
+ /**
18
+ * gets identity from the the data source
19
+ *
20
+ *
21
+ * @param {string} identifier - id of identity
22
+ * @returns `{(Promise<Identity | undefined>)}`
23
+ */
24
+ getIdentity(identifier: string): Promise<Identity | undefined>;
25
+ /**
26
+ *
27
+ * gets all identity from the data source
28
+ *
29
+ * @returns `{Promise<Identity[]>}`
30
+ */
31
+ getAllIdentities(): Promise<Identity[]>;
32
+ /**
33
+ *
34
+ * saves profile identity to data
35
+ *
36
+ * @param {Profile} profile - identity profile
37
+ * @returns `{Promise<void>}`
38
+ */
39
+ saveProfile(profile: Profile): Promise<void>;
40
+ /**
41
+ * gets profile by verifier
42
+ * @deprecated The method should not be used. It returns only one profile per verifier, which can potentially restrict business use cases
43
+ * @param {string} verifier - verifier to which profile has been shared
44
+ * @returns `{Promise<Profile>}`
45
+ */
46
+ getProfileByVerifier(verifier: string): Promise<Profile | undefined>;
47
+ /**
48
+ * gets profile by verifiers
49
+ * @param {string} verifier - verifier to which profile has been shared
50
+ * @param {string[]} tags - optional tag to filter profile entry
51
+ * @returns `{Promise<Profile[]>}`
52
+ */
53
+ getProfilesByVerifier(verifier: string, tags?: string[]): Promise<Profile[]>;
54
+ /**
55
+ * gets profile by identifier
56
+ *
57
+ * @param {string} identifier - profile id
58
+ * @returns `{Promise<Profile>}`
59
+ */
60
+ getProfileById(identifier: string): Promise<Profile | undefined>;
61
+ /**
62
+ *
63
+ * gets profile identity by genesis identifiers
64
+ *
65
+ * @param {string} genesisIdentifier - genesis identifier from which profile has been derived
66
+ * @returns `{Promise<Profile[]>}`
67
+ */
68
+ getProfilesByGenesisIdentifier(genesisIdentifier: string): Promise<Profile[]>;
69
+ }
70
+ //# sourceMappingURL=identity.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"identity.d.ts","sourceRoot":"","sources":["../../../../src/storage/interfaces/identity.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,QAAQ,EAAE,MAAM,aAAa,CAAC;AACvC,OAAO,EAAE,OAAO,EAAE,MAAM,aAAa,CAAC;AAEtC;;;;;GAKG;AACH,MAAM,WAAW,gBAAgB;IAC/B;;;;;OAKG;IACH,YAAY,CAAC,QAAQ,EAAE,QAAQ,GAAG,OAAO,CAAC,IAAI,CAAC,CAAC;IAChD;;;;;;OAMG;IACH,WAAW,CAAC,UAAU,EAAE,MAAM,GAAG,OAAO,CAAC,QAAQ,GAAG,SAAS,CAAC,CAAC;IAC/D;;;;;OAKG;IACH,gBAAgB,IAAI,OAAO,CAAC,QAAQ,EAAE,CAAC,CAAC;IAExC;;;;;;OAMG;IACH,WAAW,CAAC,OAAO,EAAE,OAAO,GAAG,OAAO,CAAC,IAAI,CAAC,CAAC;IAC7C;;;;;OAKG;IACH,oBAAoB,CAAC,QAAQ,EAAE,MAAM,GAAG,OAAO,CAAC,OAAO,GAAG,SAAS,CAAC,CAAC;IAErE;;;;;OAKG;IACH,qBAAqB,CAAC,QAAQ,EAAE,MAAM,EAAE,IAAI,CAAC,EAAE,MAAM,EAAE,GAAG,OAAO,CAAC,OAAO,EAAE,CAAC,CAAC;IAE7E;;;;;OAKG;IACH,cAAc,CAAC,UAAU,EAAE,MAAM,GAAG,OAAO,CAAC,OAAO,GAAG,SAAS,CAAC,CAAC;IACjE;;;;;;OAMG;IACH,8BAA8B,CAAC,iBAAiB,EAAE,MAAM,GAAG,OAAO,CAAC,OAAO,EAAE,CAAC,CAAC;CAC/E"}
@@ -0,0 +1,11 @@
1
+ export * from './credentials';
2
+ export * from './identity';
3
+ export * from './merkletree';
4
+ export * from './state';
5
+ export * from './data-storage';
6
+ export * from './data-source';
7
+ export * from './circuits';
8
+ export * from './onchain-zkp-verifier';
9
+ export * from './onchain-revocation';
10
+ export * from './onchain-issuer';
11
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/storage/interfaces/index.ts"],"names":[],"mappings":"AAAA,cAAc,eAAe,CAAC;AAC9B,cAAc,YAAY,CAAC;AAC3B,cAAc,cAAc,CAAC;AAC7B,cAAc,SAAS,CAAC;AACxB,cAAc,gBAAgB,CAAC;AAC/B,cAAc,eAAe,CAAC;AAC9B,cAAc,YAAY,CAAC;AAC3B,cAAc,wBAAwB,CAAC;AACvC,cAAc,sBAAsB,CAAC;AACrC,cAAc,kBAAkB,CAAC"}