@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,472 @@
1
+ import { KMS, KmsKeyId, KmsKeyType } from '../kms';
2
+ import { Claim, DID } from '@mocanetwork/moca-iden3';
3
+ import { Signature } from '@iden3/js-crypto';
4
+ import { IDataStorage, Profile } from '../storage';
5
+ import { W3CCredential, MerkleTreeProofWithTreeState, CredentialStatusType, ProofQuery, CoreClaimCreationOptions } from '../verifiable';
6
+ import { CredentialRequest, ICredentialWallet, PublishMode, TreesModel } from '../credentials';
7
+ import { TreeState } from '../circuits';
8
+ import { Options } from '@iden3/js-jsonld-merklization';
9
+ import { Signer, TransactionReceipt } from 'ethers';
10
+ import { CredentialStatusPublisherRegistry } from '../credentials/status/credential-status-publisher';
11
+ import { IZKProver } from '../proof';
12
+ /**
13
+ * DID creation options
14
+ * seed - seed to generate BJJ key pair
15
+ * revocationOpts -
16
+
17
+ * @type IdentityCreationOptions
18
+ */
19
+ export type IdentityCreationOptions = {
20
+ method?: string;
21
+ blockchain?: string;
22
+ networkId?: string;
23
+ } & AuthBJJCredentialCreationOptions;
24
+ /**
25
+ * Options for creating Auth BJJ credential
26
+ * seed - seed to generate BJJ key pair
27
+ * revocationOpts
28
+ * nonce - explicit revocation nonce to use
29
+ * onChain - onchain status related option
30
+ * txCallback - defines how the TransactionReceipt is handled
31
+ * publishMode - specifies the work of transaction polling type: sync / async / callback
32
+ * genesisPublishingDisabled - genesis is publishing by default. Set `true` to prevent genesis publishing
33
+ */
34
+ export type AuthBJJCredentialCreationOptions = {
35
+ revocationOpts: {
36
+ id: string;
37
+ type: CredentialStatusType;
38
+ nonce?: number;
39
+ genesisPublishingDisabled?: boolean;
40
+ onChain?: {
41
+ txCallback?: (tx: TransactionReceipt) => Promise<void>;
42
+ publishMode?: PublishMode;
43
+ };
44
+ };
45
+ seed?: Uint8Array;
46
+ };
47
+ /**
48
+ * Options for creating Ethereum based identity
49
+ */
50
+ export type EthereumBasedIdentityCreationOptions = IdentityCreationOptions & {
51
+ ethSigner?: Signer;
52
+ createBjjCredential?: boolean;
53
+ };
54
+ /**
55
+ * Options for RevocationInfoOptions.
56
+ */
57
+ export type RevocationInfoOptions = {
58
+ revokedNonces?: number[];
59
+ treeModel?: TreesModel;
60
+ rhsUrl?: string;
61
+ onChain?: {
62
+ txCallback?: (tx: TransactionReceipt) => Promise<void>;
63
+ publishMode?: PublishMode;
64
+ };
65
+ };
66
+ /**
67
+ * Proof creation result
68
+ *
69
+ * @public
70
+ * @interface Iden3ProofCreationResult
71
+ */
72
+ export interface Iden3ProofCreationResult {
73
+ credentials: W3CCredential[];
74
+ oldTreeState: TreeState;
75
+ newTreeState: TreeState;
76
+ }
77
+ /**
78
+ * Interface for IdentityWallet
79
+ * @public
80
+ */
81
+ export interface IIdentityWallet {
82
+ /**
83
+ * Create Identity creates Auth BJJ credential,
84
+ * Merkle trees for claims, revocations and root of roots,
85
+ * adds auth BJJ credential to claims tree and generates mtp of inclusion
86
+ * based on the resulting state it provides an identifier in DID form.
87
+ *
88
+ * @param {IdentityCreationOptions} opts - default is did:iden3:polygon:amoy** with generated key.
89
+ * @returns `Promise<{ did: DID; credential: W3CCredential }>` - returns did and Auth BJJ credential
90
+ * @public
91
+ */
92
+ createIdentity(opts: IdentityCreationOptions): Promise<{
93
+ did: DID;
94
+ credential: W3CCredential;
95
+ }>;
96
+ /**
97
+ * Credential wallet getter
98
+ *
99
+ * @returns {ICredentialWallet}
100
+ * @memberof IIdentityWallet
101
+ */
102
+ get credentialWallet(): ICredentialWallet;
103
+ /**
104
+ * Create Identity based in Ethereum address and it provides an identifier in DID form.
105
+ *
106
+ * @param {IdentityCreationOptions} opts - default is did:iden3:polygon:amoy** with generated key.
107
+ * @returns `Promise<{ did: DID; credential: W3CCredential | undefined }>` - returns did and Auth BJJ credential
108
+ * @public
109
+ */
110
+ createEthereumBasedIdentity(opts: EthereumBasedIdentityCreationOptions): Promise<{
111
+ did: DID;
112
+ credential: W3CCredential | undefined;
113
+ }>;
114
+ /**
115
+ * Creates profile based on genesis identifier
116
+ *
117
+ * @param {DID} did - identity to derive profile from
118
+ * @param {number |string} nonce - unique integer number to generate a profile
119
+ * @param {string} verifier - verifier identity/alias in a string from
120
+ * @param {string[]} tags - optional tag that can be assigned to profile by client
121
+ * @returns `Promise<DID>` - profile did
122
+ */
123
+ createProfile(did: DID, nonce: number | string, verifier: string, tags?: string[]): Promise<DID>;
124
+ /**
125
+ * Generates a new key
126
+ *
127
+ * @param {KmsKeyType} keyType - supported key type by KMS
128
+ * @returns `Promise<KmsKeyId>` - creates a new key BJJ or ECDSA
129
+ */
130
+ generateKey(keyType: KmsKeyType): Promise<KmsKeyId>;
131
+ /**
132
+ * Issues new credential from issuer according to the claim request
133
+ *
134
+ * @param {DID} issuerDID - issuer identity
135
+ * @param {CredentialRequest} req - claim request
136
+ * @returns `Promise<W3CCredential>` - returns created W3CCredential
137
+ */
138
+ issueCredential(issuerDID: DID, req: CredentialRequest, opts?: Options): Promise<W3CCredential>;
139
+ /**
140
+ * Gets a tree model for given did that includes claims tree, revocation tree, the root of roots tree and calculated state hash
141
+ *
142
+ * @param {DID} did - did which trees info we need to receive
143
+ * @returns `Promise<TreesModel>`
144
+ * */
145
+ getDIDTreeModel(did: DID): Promise<TreesModel>;
146
+ /**
147
+ * Generates proof of credential inclusion / non-inclusion to the given claims tree
148
+ * and its root or to the current root of the Claims tree in the given Merkle tree storage.
149
+ *
150
+ * @param {DID} did - issuer did
151
+ * @param {W3CCredential} credential - credential to generate mtp
152
+ * @param {TreeState} [treeState] - tree state when to generate a proof
153
+ * @returns `Promise<MerkleTreeProofWithTreeState>` - MerkleTreeProof and TreeState on which proof has been generated
154
+ */
155
+ generateCredentialMtp(did: DID, credential: W3CCredential, treeState?: TreeState): Promise<MerkleTreeProofWithTreeState>;
156
+ /**
157
+ * Generates proof of core claim inclusion / non-inclusion to the given claims tree
158
+ * and its root or to the current root of the Claims tree in the given Merkle tree storage.
159
+ *
160
+ * @param {DID} did - issuer did
161
+ * @param {core.Claim} core - core claim to generate mtp
162
+ * @param {TreeState} [treeState] - tree state when to generate a proof
163
+ * @returns `Promise<MerkleTreeProofWithTreeState>` - MerkleTreeProof and TreeState on which proof has been generated
164
+ */
165
+ generateCoreClaimMtp(did: DID, coreClaim: Claim, treeState?: TreeState): Promise<MerkleTreeProofWithTreeState>;
166
+ /**
167
+ * Generates proof of credential revocation nonce (with credential as a param) inclusion / non-inclusion to the given revocation tree
168
+ * and its root or to the current root of the Revocation tree in the given Merkle tree storage.
169
+ *
170
+ * @param {DID} did
171
+ * @param {W3CCredential} credential
172
+ * @param {TreeState} [treeState]
173
+ * @returns `Promise<MerkleTreeProofWithTreeState>` - MerkleTreeProof and TreeState on which proof has been generated
174
+ */
175
+ generateNonRevocationMtp(did: DID, credential: W3CCredential, treeState?: TreeState): Promise<MerkleTreeProofWithTreeState>;
176
+ /**
177
+ * Generates proof of credential revocation nonce (with revNonce as a param) inclusion / non-inclusion to the given revocation tree
178
+ * and its root or to the current root of the Revocation tree in the given Merkle tree storage.
179
+ *
180
+ * @param {DID} did
181
+ * @param {bigint} revNonce
182
+ * @param {TreeState} [treeState]
183
+ * @returns `Promise<MerkleTreeProofWithTreeState>` - MerkleTreeProof and TreeState on which proof has been generated
184
+ */
185
+ generateNonRevocationMtpWithNonce(did: DID, revNonce: bigint, treeState?: TreeState): Promise<MerkleTreeProofWithTreeState>;
186
+ /**
187
+ * Signs a payload of arbitrary size with an Auth BJJ Credential that identifies a key for signing.
188
+ *
189
+ * @param {Uint8Array} payload
190
+ * @param {W3CCredential} credential - Auth BJJ Credential
191
+ * @returns `Promise<Signature>`- the signature object with R8 and S params
192
+ */
193
+ sign(payload: Uint8Array, credential: W3CCredential): Promise<Signature>;
194
+ /**
195
+ * Signs a big integer with an Auth BJJ Credential that identifies a key for signing.
196
+ *
197
+ *
198
+ * @param {bigint} payload - big number in Field
199
+ * @param {W3CCredential} credential - Auth BJJ credential
200
+ * @returns `Promise<Signature>` - the signature object with R8 and S params
201
+ */
202
+ signChallenge(payload: bigint, credential: W3CCredential): Promise<Signature>;
203
+ /**
204
+ *
205
+ *
206
+ * @param {DID} issuerDID - identifier of the issuer
207
+ * @param {W3CCredential} credential - credential to revoke
208
+ * @returns `Promise<number>` a revocation nonce of credential
209
+ */
210
+ revokeCredential(issuerDID: DID, credential: W3CCredential): Promise<number>;
211
+ /**
212
+ * Generate Iden3SparseMerkleTree proof of inclusion to issuer state of specific credentials
213
+ *
214
+ * @param {DID} issuerDID - issuer did
215
+ * @param {W3CCredential[]} credentials - list of verifiable credentials to generate a proof
216
+ * @param {string} txId - transaction hash in which state transition has been done
217
+ * @param {number} [blockNumber] - block number in which state transition has been done
218
+ * @param {number} [blockTimestamp] - block timestamp in which state transition has been done
219
+ * @returns `Promise<W3CCredential[]>` credentials with an Iden3SparseMerkleTreeProof
220
+ */
221
+ generateIden3SparseMerkleTreeProof(issuerDID: DID, credentials: W3CCredential[], txId: string, blockNumber?: number, blockTimestamp?: number): Promise<W3CCredential[]>;
222
+ /**
223
+ * Adds verifiable credentials to issuer Claims Merkle tree
224
+ *
225
+ * @param {W3CCredential[]} credentials - credentials to include in the claims tree
226
+ * @param {DID} issuerDID - issuer did
227
+ * @returns `Promise<Iden3ProofCreationResult>`- old tree state and tree state with included credentials
228
+ */
229
+ addCredentialsToMerkleTree(credentials: W3CCredential[], issuerDID: DID): Promise<Iden3ProofCreationResult>;
230
+ /**
231
+ * Publishes issuer state to the reverse hash service by given URL
232
+ *
233
+ * @deprecated use publishRevocationInfoByCredentialStatusType instead with the same arguments in opts
234
+ * @param {DID} issuerDID - issuer did
235
+ * @param {string} rhsURL - reverse hash service URL
236
+ * @param {number[]} [revokedNonces] - revoked nonces for the period from the last published
237
+ * @returns `Promise<void>`
238
+ */
239
+ publishStateToRHS(issuerDID: DID, rhsURL: string, revokedNonces?: number[], opts?: object): Promise<void>;
240
+ /**
241
+ * Publishes specific state to the reverse hash service by given URL
242
+ * @deprecated use publishRevocationInfoByCredentialStatusType instead with the same arguments in opts
243
+ * @param {TreesModel} treeModel - trees model to publish
244
+ * @param {string} rhsURL - reverse hash service URL
245
+ * @param {number[]} [revokedNonces] - revoked nonces for the period from the last published
246
+ * @returns `Promise<void>`
247
+ */
248
+ publishSpecificStateToRHS(treeModel: TreesModel, rhsURL: string, revokedNonces?: number[], opts?: object): Promise<void>;
249
+ /**
250
+ * Publishes revocation info by credential status predefined publishers
251
+ *
252
+ * @param {(RevocationInfoOptions)} opts
253
+ * @returns {Promise<void>}
254
+ * @memberof IIdentityWallet
255
+ */
256
+ publishRevocationInfoByCredentialStatusType(issuerDID: DID, credentialStatusType: CredentialStatusType, opts?: RevocationInfoOptions): Promise<void>;
257
+ /**
258
+ * Extracts core claim from signature or merkle tree proof. If both proof persists core claim must be the same
259
+ *
260
+ * @public
261
+ * @param {W3CCredential} credential - credential to extract core claim
262
+ * @returns `{Promise<Claim>}`
263
+ */
264
+ getCoreClaimFromCredential(credential: W3CCredential): Promise<Claim>;
265
+ /**
266
+ *
267
+ * gets profile identity by genesis identifiers
268
+ *
269
+ * @param {DID} did - genesis identifier from which profile has been derived
270
+ * @returns `{Promise<Profile[]>}`
271
+ */
272
+ getProfilesByDID(did: DID): Promise<Profile[]>;
273
+ /**
274
+ *
275
+ * gets profile nonce by it's id. if profile is genesis identifier - 0 is returned
276
+ *
277
+ * @param {DID} did - profile that has been derived or genesis identity
278
+ * @returns `{Promise<{nonce:number, genesisIdentifier: DID}>}`
279
+ */
280
+ getGenesisDIDMetadata(did: DID): Promise<{
281
+ nonce: number | string;
282
+ genesisDID: DID;
283
+ }>;
284
+ /**
285
+ *
286
+ * find all credentials that belong to any profile or genesis identity for the given did
287
+ *
288
+ * @param {DID} did - profile that has been derived or genesis identity
289
+ * @returns `{Promise<W3CCredential[]>}`
290
+ */
291
+ findOwnedCredentialsByDID(did: DID, query: ProofQuery): Promise<W3CCredential[]>;
292
+ /**
293
+ *
294
+ * gets profile identity by verifier
295
+ * @deprecated The method should not be used. It returns only one profile per verifier, which can potentially restrict business use cases
296
+ * @param {string} verifier - identifier of the verifier
297
+ * @returns `{Promise<Profile>}`
298
+ */
299
+ getProfileByVerifier(verifier: string): Promise<Profile | undefined>;
300
+ /**
301
+ * gets profile by verifiers
302
+ *
303
+ * @param {string} verifier - verifier to which profile has been shared
304
+ * @param {string} tags - optional, tags to filter profile entry
305
+ * @returns `{Promise<Profile[]>}`
306
+ */
307
+ getProfilesByVerifier(verifier: string, tags?: string[]): Promise<Profile[]>;
308
+ /**
309
+ *
310
+ * updates latest identity state in storage with given state or latest from the trees.
311
+ *
312
+ * @param {DID} issuerDID - identifier of the issuer
313
+ * @param {boolean} published - if states is published onchain
314
+ * @param {TreeState} treeState - contains state to upgrade
315
+ * @returns `{Promise<void>}`
316
+ */
317
+ updateIdentityState(issuerDID: DID, published: boolean, treeState?: TreeState): Promise<void>;
318
+ /**
319
+ *
320
+ * gets actual auth credential with proofs for provided tree state or latest from the trees.
321
+ *
322
+ * @param {DID} issuerDID - identifier of the issuer
323
+ * @param {TreeState} treeStateInfo - optional, state for retrieval
324
+ * @returns `{Promise<{
325
+ authCredential: W3CCredential;
326
+ incProof: MerkleTreeProofWithTreeState;
327
+ nonRevProof: MerkleTreeProofWithTreeState;
328
+ }>}`
329
+ */
330
+ getActualAuthCredential(did: DID, treeStateInfo?: TreeState): Promise<{
331
+ authCredential: W3CCredential;
332
+ incProof: MerkleTreeProofWithTreeState;
333
+ nonRevProof: MerkleTreeProofWithTreeState;
334
+ }>;
335
+ /**
336
+ * Transit state for the identity with the given DID
337
+ *
338
+ * @param {DID} did - identifier of the user
339
+ * @param {TreeState} oldTreeState - old state of the user
340
+ * @param {boolean} isOldStateGenesis - if the old state is genesis
341
+ * @param {IStateStorage} stateStorage - storage to save the new state
342
+ * @param {Signer} ethSigner - signer to sign the transaction
343
+ */
344
+ transitState(did: DID, oldTreeState: TreeState, isOldStateGenesis: boolean, ethSigner: Signer, prover?: IZKProver): Promise<string>;
345
+ /**
346
+ * Add BJJ credential and transit state
347
+ *
348
+ * @param {DID} did - identifier of the user
349
+ * @param {TreeState} oldTreeState - old tree state of the user
350
+ * @param {boolean} isOldTreeState - if the old state is genesis
351
+ * @param {Signer} ethSigner - signer to sign the transaction
352
+ * @param {AuthBJJCredentialCreationOptions} opts - additional options
353
+ */
354
+ addBJJAuthCredential(did: DID, oldTreeState: TreeState, isOldTreeStateGenesis: boolean, ethSigner: Signer, opts?: AuthBJJCredentialCreationOptions): Promise<W3CCredential>;
355
+ }
356
+ /**
357
+ * @public
358
+ * Wallet instance to manage the digital identity based on iden3 protocol
359
+ * allows to: create identity/profile, sign payloads (bigint / bytes), generate keys,
360
+ * generate Merkle tree proofs of inclusion / non-inclusion to Merkle trees, issue credentials with a BJJSignature and Iden3SparseMerkleTree Proofs,
361
+ * revoke credentials, add credentials to Merkle trees, push states to reverse hash service
362
+ *
363
+ *
364
+ * @class IdentityWallet - class
365
+ * @implements implements IIdentityWallet interface
366
+ */
367
+ export declare class IdentityWallet implements IIdentityWallet {
368
+ private readonly _kms;
369
+ private readonly _storage;
370
+ private readonly _credentialWallet;
371
+ private readonly _opts?;
372
+ private readonly _credentialStatusPublisherRegistry;
373
+ private readonly _inputsGenerator;
374
+ private readonly _transactionService;
375
+ /**
376
+ * Constructs a new instance of the `IdentityWallet` class
377
+ *
378
+ * @param {KMS} _kms - Key Management System that allows signing data with BJJ key
379
+ * @param {IDataStorage} _storage - data storage to access credential / identity / Merkle tree data
380
+ * @param {ICredentialWallet} _credentialWallet - credential wallet instance to quickly access credential CRUD functionality
381
+ * @public
382
+ */
383
+ constructor(_kms: KMS, _storage: IDataStorage, _credentialWallet: ICredentialWallet, _opts?: {
384
+ credentialStatusPublisherRegistry?: CredentialStatusPublisherRegistry;
385
+ } | undefined);
386
+ get credentialWallet(): ICredentialWallet;
387
+ private getCredentialStatusPublisherRegistry;
388
+ private createAuthCoreClaim;
389
+ private createAuthBJJCredential;
390
+ /**
391
+ * {@inheritDoc IIdentityWallet.createIdentity}
392
+ */
393
+ createIdentity(opts: IdentityCreationOptions): Promise<{
394
+ did: DID;
395
+ credential: W3CCredential;
396
+ }>;
397
+ /**
398
+ * {@inheritDoc IIdentityWallet.createEthereumBasedIdentity}
399
+ */
400
+ createEthereumBasedIdentity(opts: EthereumBasedIdentityCreationOptions): Promise<{
401
+ did: DID;
402
+ credential: W3CCredential | undefined;
403
+ }>;
404
+ /** {@inheritDoc IIdentityWallet.getGenesisDIDMetadata} */
405
+ getGenesisDIDMetadata(did: DID): Promise<{
406
+ nonce: number | string;
407
+ genesisDID: DID;
408
+ }>;
409
+ /** {@inheritDoc IIdentityWallet.createProfile} */
410
+ createProfile(did: DID, nonce: number | string, verifier: string, tags?: string[]): Promise<DID>;
411
+ /**
412
+ *
413
+ * gets profile identity by genesis identifiers
414
+ *
415
+ * @param {string} genesisIdentifier - genesis identifier from which profile has been derived
416
+ * @returns `{Promise<Profile[]>}`
417
+ */
418
+ getProfilesByDID(did: DID): Promise<Profile[]>;
419
+ /** {@inheritDoc IIdentityWallet.generateKey} */
420
+ generateKey(keyType: KmsKeyType): Promise<KmsKeyId>;
421
+ /**
422
+ * @deprecated The method should not be used. It returns only one profile per verifier, which can potentially restrict business use cases
423
+ * {@inheritDoc IIdentityWallet.getProfileByVerifier}
424
+ */
425
+ getProfileByVerifier(verifier: string): Promise<Profile | undefined>;
426
+ /** {@inheritDoc IIdentityWallet.getProfilesByVerifier} */
427
+ getProfilesByVerifier(verifier: string, tags?: string[]): Promise<Profile[]>;
428
+ /** {@inheritDoc IIdentityWallet.getDIDTreeModel} */
429
+ getDIDTreeModel(did: DID): Promise<TreesModel>;
430
+ /** {@inheritDoc IIdentityWallet.generateClaimMtp} */
431
+ generateCredentialMtp(did: DID, credential: W3CCredential, treeState?: TreeState): Promise<MerkleTreeProofWithTreeState>;
432
+ /** {@inheritDoc IIdentityWallet.generateClaimMtp} */
433
+ generateCoreClaimMtp(did: DID, coreClaim: Claim, treeState?: TreeState): Promise<MerkleTreeProofWithTreeState>;
434
+ /** {@inheritDoc IIdentityWallet.generateNonRevocationMtp} */
435
+ generateNonRevocationMtp(did: DID, credential: W3CCredential, treeState?: TreeState): Promise<MerkleTreeProofWithTreeState>;
436
+ /** {@inheritDoc IIdentityWallet.generateNonRevocationMtpWithNonce} */
437
+ generateNonRevocationMtpWithNonce(did: DID, revNonce: bigint, treeState?: TreeState): Promise<MerkleTreeProofWithTreeState>;
438
+ /** {@inheritDoc IIdentityWallet.sign} */
439
+ sign(message: Uint8Array, credential: W3CCredential): Promise<Signature>;
440
+ /** {@inheritDoc IIdentityWallet.signChallenge} */
441
+ signChallenge(challenge: bigint, credential: W3CCredential): Promise<Signature>;
442
+ /** {@inheritDoc IIdentityWallet.issueCredential} */
443
+ issueCredential(issuerDID: DID, req: CredentialRequest, opts?: Options): Promise<W3CCredential>;
444
+ /** {@inheritDoc IIdentityWallet.getActualAuthCredential} */
445
+ getActualAuthCredential(did: DID, treeStateInfo?: TreeState): Promise<{
446
+ authCredential: W3CCredential;
447
+ incProof: MerkleTreeProofWithTreeState;
448
+ nonRevProof: MerkleTreeProofWithTreeState;
449
+ }>;
450
+ /** {@inheritDoc IIdentityWallet.revokeCredential} */
451
+ revokeCredential(issuerDID: DID, credential: W3CCredential): Promise<number>;
452
+ /** {@inheritDoc IIdentityWallet.addCredentialsToMerkleTree} */
453
+ addCredentialsToMerkleTree(credentials: W3CCredential[], issuerDID: DID): Promise<Iden3ProofCreationResult>;
454
+ /** {@inheritDoc IIdentityWallet.generateIden3SparseMerkleTreeProof} */
455
+ generateIden3SparseMerkleTreeProof(issuerDID: DID, credentials: W3CCredential[], txId: string, blockNumber?: number, blockTimestamp?: number, treeState?: TreeState, opts?: CoreClaimCreationOptions): Promise<W3CCredential[]>;
456
+ /** {@inheritDoc IIdentityWallet.publishSpecificStateToRHS} */
457
+ publishSpecificStateToRHS(treeModel: TreesModel, rhsURL: string, revokedNonces?: number[]): Promise<void>;
458
+ /** {@inheritDoc IIdentityWallet.publishStateToRHS} */
459
+ publishStateToRHS(issuerDID: DID, rhsURL: string, revokedNonces?: number[]): Promise<void>;
460
+ /** {@inheritDoc IIdentityWallet.publishRevocationInfoByCredentialStatusType} */
461
+ publishRevocationInfoByCredentialStatusType(issuerDID: DID, credentialStatusType: CredentialStatusType, opts?: RevocationInfoOptions): Promise<void>;
462
+ getCoreClaimFromCredential(credential: W3CCredential): Promise<Claim>;
463
+ findOwnedCredentialsByDID(did: DID, query: ProofQuery): Promise<W3CCredential[]>;
464
+ /** {@inheritDoc IIdentityWallet.updateIdentityState} */
465
+ updateIdentityState(issuerDID: DID, published: boolean, treeState?: TreeState): Promise<void>;
466
+ /** {@inheritdoc IIdentityWallet.transitState} */
467
+ transitState(did: DID, oldTreeState: TreeState, isOldStateGenesis: boolean, ethSigner: Signer, prover?: IZKProver): Promise<string>;
468
+ private getAuthBJJCredential;
469
+ /** {@inheritdoc IIdentityWallet.addBJJAuthCredential} */
470
+ addBJJAuthCredential(did: DID, oldTreeState: TreeState, isOldStateGenesis: boolean, ethSigner: Signer, opts: AuthBJJCredentialCreationOptions, prover?: IZKProver): Promise<W3CCredential>;
471
+ }
472
+ //# sourceMappingURL=identity-wallet.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"identity-wallet.d.ts","sourceRoot":"","sources":["../../../src/identity/identity-wallet.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,GAAG,EAAE,QAAQ,EAAE,UAAU,EAAE,MAAM,QAAQ,CAAC;AACnD,OAAO,EAIL,KAAK,EAEL,GAAG,EAMJ,MAAM,yBAAyB,CAAC;AACjC,OAAO,EAIL,SAAS,EAIV,MAAM,kBAAkB,CAAC;AAK1B,OAAO,EAAE,YAAY,EAAkB,OAAO,EAA2B,MAAM,YAAY,CAAC;AAC5F,OAAO,EAKL,aAAa,EACb,4BAA4B,EAG5B,oBAAoB,EACpB,UAAU,EACV,wBAAwB,EACzB,MAAM,eAAe,CAAC;AACvB,OAAO,EACL,iBAAiB,EAGjB,iBAAiB,EAEjB,WAAW,EAEX,UAAU,EACX,MAAM,gBAAgB,CAAC;AACxB,OAAO,EAAoC,SAAS,EAAE,MAAM,aAAa,CAAC;AAE1E,OAAO,EAAE,OAAO,EAAE,MAAM,+BAA+B,CAAC;AACxD,OAAO,EAAE,MAAM,EAAE,kBAAkB,EAAE,MAAM,QAAQ,CAAC;AACpD,OAAO,EACL,iCAAiC,EAElC,MAAM,mDAAmD,CAAC;AAC3D,OAAO,EAAkB,SAAS,EAAE,MAAM,UAAU,CAAC;AAGrD;;;;;;GAMG;AACH,MAAM,MAAM,uBAAuB,GAAG;IACpC,MAAM,CAAC,EAAE,MAAM,CAAC;IAChB,UAAU,CAAC,EAAE,MAAM,CAAC;IACpB,SAAS,CAAC,EAAE,MAAM,CAAC;CACpB,GAAG,gCAAgC,CAAC;AAErC;;;;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export * from './identity-wallet';
2
+ export * from './common';
3
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/identity/index.ts"],"names":[],"mappings":"AAAA,cAAc,mBAAmB,CAAC;AAClC,cAAc,UAAU,CAAC"}
@@ -0,0 +1,17 @@
1
+ export * from './identity';
2
+ export * from './credentials';
3
+ export * from './kms';
4
+ export * from './storage';
5
+ export * from './verifiable';
6
+ export * from './schema-processor';
7
+ export * from './proof';
8
+ export * from './iden3comm';
9
+ export * from './circuits';
10
+ export * from './iden3comm';
11
+ export * from './utils';
12
+ export * from './blockchain';
13
+ import * as core from '@mocanetwork/moca-iden3';
14
+ import * as jsonLDMerklizer from '@iden3/js-jsonld-merklization';
15
+ export { core };
16
+ export { jsonLDMerklizer };
17
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/index.ts"],"names":[],"mappings":"AAAA,cAAc,YAAY,CAAC;AAC3B,cAAc,eAAe,CAAC;AAC9B,cAAc,OAAO,CAAC;AACtB,cAAc,WAAW,CAAC;AAC1B,cAAc,cAAc,CAAC;AAC7B,cAAc,oBAAoB,CAAC;AACnC,cAAc,SAAS,CAAC;AACxB,cAAc,aAAa,CAAC;AAC5B,cAAc,YAAY,CAAC;AAC3B,cAAc,aAAa,CAAC;AAC5B,cAAc,SAAS,CAAC;AACxB,cAAc,cAAc,CAAC;AAC7B,OAAO,KAAK,IAAI,MAAM,yBAAyB,CAAC;AAChD,OAAO,KAAK,eAAe,MAAM,+BAA+B,CAAC;AACjE,OAAO,EAAE,IAAI,EAAE,CAAC;AAChB,OAAO,EAAE,eAAe,EAAE,CAAC"}
@@ -0,0 +1,5 @@
1
+ export * from './kms';
2
+ export * from './key-providers';
3
+ export * from './store';
4
+ export * from './provider-helpers';
5
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/kms/index.ts"],"names":[],"mappings":"AAAA,cAAc,OAAO,CAAC;AACtB,cAAc,iBAAiB,CAAC;AAChC,cAAc,SAAS,CAAC;AACxB,cAAc,oBAAoB,CAAC"}
@@ -0,0 +1,54 @@
1
+ import { IKeyProvider } from '../kms';
2
+ import { AbstractPrivateKeyStore, KmsKeyId, KmsKeyType } from '../store';
3
+ /**
4
+ * Provider for Baby Jub Jub keys
5
+ * @public
6
+ * @class BjjProvider
7
+ * @implements implements IKeyProvider interface
8
+ */
9
+ export declare class BjjProvider implements IKeyProvider {
10
+ /**
11
+ * key type that is handled by BJJ Provider
12
+ * @type {KmsKeyType}
13
+ */
14
+ keyType: KmsKeyType;
15
+ private keyStore;
16
+ /**
17
+ * Creates an instance of BjjProvider.
18
+ * @param {KmsKeyType} keyType - kms key type
19
+ * @param {AbstractPrivateKeyStore} keyStore - key store for kms
20
+ */
21
+ constructor(keyType: KmsKeyType, keyStore: AbstractPrivateKeyStore);
22
+ /**
23
+ * get all keys
24
+ * @returns list of keys
25
+ */
26
+ list(): Promise<{
27
+ alias: string;
28
+ key: string;
29
+ }[]>;
30
+ /**
31
+ * generates a baby jub jub key from a seed phrase
32
+ * @param {Uint8Array} seed - byte array seed
33
+ * @returns kms key identifier
34
+ */
35
+ newPrivateKeyFromSeed(seed: Uint8Array): Promise<KmsKeyId>;
36
+ /**
37
+ * Gets public key by kmsKeyId
38
+ *
39
+ * @param {KmsKeyId} keyId - key identifier
40
+ */
41
+ publicKey(keyId: KmsKeyId): Promise<string>;
42
+ /**
43
+ * signs prepared payload of size,
44
+ * with a key id
45
+ *
46
+ * @param {KmsKeyId} keyId - key identifier
47
+ * @param {Uint8Array} data - data to sign (32 bytes)
48
+ * @returns Uint8Array signature
49
+ */
50
+ sign(keyId: KmsKeyId, data: Uint8Array): Promise<Uint8Array>;
51
+ private privateKey;
52
+ verify(message: Uint8Array, signatureHex: string, keyId: KmsKeyId): Promise<boolean>;
53
+ }
54
+ //# sourceMappingURL=bjj-provider.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"bjj-provider.d.ts","sourceRoot":"","sources":["../../../../src/kms/key-providers/bjj-provider.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,YAAY,EAAE,MAAM,QAAQ,CAAC;AACtC,OAAO,EAAE,uBAAuB,EAAE,QAAQ,EAAE,UAAU,EAAE,MAAM,UAAU,CAAC;AAKzE;;;;;GAKG;AACH,qBAAa,WAAY,YAAW,YAAY;IAC9C;;;OAGG;IACH,OAAO,EAAE,UAAU,CAAC;IACpB,OAAO,CAAC,QAAQ,CAA0B;IAC1C;;;;OAIG;gBACS,OAAO,EAAE,UAAU,EAAE,QAAQ,EAAE,uBAAuB;IAOlE;;;OAGG;IACG,IAAI,IAAI,OAAO,CACnB;QACE,KAAK,EAAE,MAAM,CAAC;QACd,GAAG,EAAE,MAAM,CAAC;KACb,EAAE,CACJ;IAKD;;;;OAIG;IACG,qBAAqB,CAAC,IAAI,EAAE,UAAU,GAAG,OAAO,CAAC,QAAQ,CAAC;IAiBhE;;;;OAIG;IACG,SAAS,CAAC,KAAK,EAAE,QAAQ,GAAG,OAAO,CAAC,MAAM,CAAC;IAKjD;;;;;;;OAOG;IACG,IAAI,CAAC,KAAK,EAAE,QAAQ,EAAE,IAAI,EAAE,UAAU,GAAG,OAAO,CAAC,UAAU,CAAC;YAgBpD,UAAU;IAMlB,MAAM,CAAC,OAAO,EAAE,UAAU,EAAE,YAAY,EAAE,MAAM,EAAE,KAAK,EAAE,QAAQ,GAAG,OAAO,CAAC,OAAO,CAAC;CAQ3F"}
@@ -0,0 +1,61 @@
1
+ import { IKeyProvider } from '../kms';
2
+ import { AbstractPrivateKeyStore, KmsKeyId, KmsKeyType } from '../store';
3
+ /**
4
+ * Provider for Ed25519 keys
5
+ * @public
6
+ * @class Ed25519Provider
7
+ * @implements IKeyProvider interface
8
+ */
9
+ export declare class Ed25519Provider implements IKeyProvider {
10
+ readonly keyType: KmsKeyType;
11
+ private readonly _keyStore;
12
+ /**
13
+ * Creates an instance of Ed25519Provider.
14
+ * @param {KmsKeyType} keyType - kms key type
15
+ * @param {AbstractPrivateKeyStore} keyStore - key store for kms
16
+ */
17
+ constructor(keyType: KmsKeyType, _keyStore: AbstractPrivateKeyStore);
18
+ /**
19
+ * get all keys
20
+ * @returns list of keys
21
+ */
22
+ list(): Promise<{
23
+ alias: string;
24
+ key: string;
25
+ }[]>;
26
+ /**
27
+ * generates a ed25519 key from a seed phrase
28
+ * @param {Uint8Array} seed - byte array seed
29
+ * @returns {Promise<KmsKeyId>} kms key identifier
30
+ */
31
+ newPrivateKeyFromSeed(seed: Uint8Array): Promise<KmsKeyId>;
32
+ /**
33
+ * Gets public key by kmsKeyId
34
+ * @param {KmsKeyId} keyId - key identifier
35
+ * @returns {Promise<string>} Public key as a hex string
36
+ */
37
+ publicKey(keyId: KmsKeyId): Promise<string>;
38
+ /**
39
+ * signs prepared payload of size,
40
+ * with a key id
41
+ * @param {KmsKeyId} keyId - key identifier
42
+ * @param {Uint8Array} digest - data to sign (32 bytes)
43
+ * @returns {Promise<Uint8Array>} signature
44
+ */
45
+ sign(keyId: KmsKeyId, digest: Uint8Array): Promise<Uint8Array>;
46
+ /**
47
+ * Verifies a signature for the given message and key identifier.
48
+ * @param digest - The message to verify the signature against.
49
+ * @param signatureHex - The signature to verify, as a hexadecimal string.
50
+ * @param keyId - The key identifier to use for verification.
51
+ * @returns A Promise that resolves to a boolean indicating whether the signature is valid.
52
+ */
53
+ verify(digest: Uint8Array, signatureHex: string, keyId: KmsKeyId): Promise<boolean>;
54
+ /**
55
+ * Retrieves the private key for a given keyId from the key store.
56
+ * @param {KmsKeyId} keyId - The identifier of the key to retrieve.
57
+ * @returns {Promise<string>} The private key associated with the keyId.
58
+ */
59
+ private privateKey;
60
+ }
61
+ //# sourceMappingURL=ed25519-provider.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"ed25519-provider.d.ts","sourceRoot":"","sources":["../../../../src/kms/key-providers/ed25519-provider.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,YAAY,EAAE,MAAM,QAAQ,CAAC;AACtC,OAAO,EAAE,uBAAuB,EAAE,QAAQ,EAAE,UAAU,EAAE,MAAM,UAAU,CAAC;AAKzE;;;;;GAKG;AACH,qBAAa,eAAgB,YAAW,YAAY;aAOhC,OAAO,EAAE,UAAU;IACnC,OAAO,CAAC,QAAQ,CAAC,SAAS;IAP5B;;;;OAIG;gBAEe,OAAO,EAAE,UAAU,EAClB,SAAS,EAAE,uBAAuB;IAGrD;;;OAGG;IACG,IAAI,IAAI,OAAO,CACnB;QACE,KAAK,EAAE,MAAM,CAAC;QACd,GAAG,EAAE,MAAM,CAAC;KACb,EAAE,CACJ;IAKD;;;;OAIG;IACG,qBAAqB,CAAC,IAAI,EAAE,UAAU,GAAG,OAAO,CAAC,QAAQ,CAAC;IAmBhE;;;;OAIG;IACG,SAAS,CAAC,KAAK,EAAE,QAAQ,GAAG,OAAO,CAAC,MAAM,CAAC;IAMjD;;;;;;OAMG;IACG,IAAI,CAAC,KAAK,EAAE,QAAQ,EAAE,MAAM,EAAE,UAAU,GAAG,OAAO,CAAC,UAAU,CAAC;IAKpE;;;;;;OAMG;IACG,MAAM,CAAC,MAAM,EAAE,UAAU,EAAE,YAAY,EAAE,MAAM,EAAE,KAAK,EAAE,QAAQ,GAAG,OAAO,CAAC,OAAO,CAAC;IAKzF;;;;OAIG;YACW,UAAU;CAGzB"}
@@ -0,0 +1,4 @@
1
+ export * from './bjj-provider';
2
+ export * from './ed25519-provider';
3
+ export * from './secp256k1-provider';
4
+ //# sourceMappingURL=index.d.ts.map