@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,98 @@
1
+ import { StateVerificationOpts, AuthDataPrepareFunc, BasicMessage, IPacker, ProvingParams, StateVerificationFunc, VerificationParams, ZKPPackerParams } from '../types';
2
+ import { CircuitId } from '../../circuits/index';
3
+ import { DID } from '@mocanetwork/moca-iden3';
4
+ import { MediaType } from '../constants';
5
+ /**
6
+ * Handler to
7
+ *
8
+ * @public
9
+ * @class DataPrepareHandlerFunc
10
+ */
11
+ export declare class DataPrepareHandlerFunc {
12
+ readonly dataPrepareFunc: AuthDataPrepareFunc;
13
+ /**
14
+ * Creates an instance of DataPrepareHandlerFunc.
15
+ * @param {AuthDataPrepareFunc} dataPrepareFunc - function that produces marshaled inputs for auth circuits
16
+ */
17
+ constructor(dataPrepareFunc: AuthDataPrepareFunc);
18
+ /**
19
+ *
20
+ *
21
+ * @param {Uint8Array} hash - challenge that will be signed
22
+ * @param {DID} did - did of identity that will prepare inputs
23
+ * @param {CircuitId} circuitId - circuit id
24
+ * @returns `Promise<Uint8Array>`
25
+ */
26
+ prepare(hash: Uint8Array, did: DID, circuitId: CircuitId): Promise<Uint8Array>;
27
+ }
28
+ /**
29
+ * Handler to verify public signals of authorization circuits
30
+ *
31
+ * @public
32
+ * @class VerificationHandlerFunc
33
+ */
34
+ export declare class VerificationHandlerFunc {
35
+ readonly stateVerificationFunc: StateVerificationFunc;
36
+ /**
37
+ * Creates an instance of VerificationHandlerFunc.
38
+ * @param {StateVerificationFunc} stateVerificationFunc - state verification function
39
+ */
40
+ constructor(stateVerificationFunc: StateVerificationFunc);
41
+ /**
42
+ *
43
+ *
44
+ * @param {string} id - id of circuit
45
+ * @param {Array<string>} pubSignals - signals that must contain user id and state
46
+ * @returns `Promise<boolean>`
47
+ */
48
+ verify(id: string, pubSignals: Array<string>, opts?: StateVerificationOpts): Promise<boolean>;
49
+ }
50
+ /**
51
+ * Packer that can pack message to JWZ token,
52
+ * and unpack and validate JWZ envelope
53
+ * @public
54
+ * @class ZKPPacker
55
+ * @implements implements IPacker interface
56
+ */
57
+ export declare class ZKPPacker implements IPacker {
58
+ readonly provingParamsMap: Map<string, ProvingParams>;
59
+ readonly verificationParamsMap: Map<string, VerificationParams>;
60
+ private readonly _opts;
61
+ private readonly supportedProtocolVersions;
62
+ private readonly supportedAlgorithms;
63
+ private readonly supportedCircuitIds;
64
+ /**
65
+ * Creates an instance of ZKPPacker.
66
+ * @param {Map<string, ProvingParams>} provingParamsMap - string is derived by JSON.parse(ProvingMethodAlg)
67
+ * @param {Map<string, VerificationParams>} verificationParamsMap - string is derived by JSON.parse(ProvingMethodAlg)
68
+ */
69
+ constructor(provingParamsMap: Map<string, ProvingParams>, verificationParamsMap: Map<string, VerificationParams>, _opts?: StateVerificationOpts);
70
+ /**
71
+ * Packs a basic message using the specified parameters.
72
+ * @param msg - The basic message to pack.
73
+ * @param param - The parameters for the ZKPPacker.
74
+ * @returns A promise that resolves to a Uint8Array representing the packed message.
75
+ */
76
+ packMessage(msg: BasicMessage, param: ZKPPackerParams): Promise<Uint8Array>;
77
+ /**
78
+ * creates JSON Web Zeroknowledge token
79
+ *
80
+ * @param {Uint8Array} payload - serialized message
81
+ * @param {ZKPPackerParams} params - sender id and proving alg are required
82
+ * @returns `Promise<Uint8Array>`
83
+ */
84
+ pack(payload: Uint8Array, params: ZKPPackerParams): Promise<Uint8Array>;
85
+ /**
86
+ * validate envelope which is jwz token
87
+ *
88
+ * @param {Uint8Array} envelope
89
+ * @returns `Promise<BasicMessage>`
90
+ */
91
+ unpack(envelope: Uint8Array): Promise<BasicMessage>;
92
+ mediaType(): MediaType;
93
+ /** {@inheritDoc IPacker.getSupportedProfiles} */
94
+ getSupportedProfiles(): string[];
95
+ /** {@inheritDoc IPacker.isProfileSupported} */
96
+ isProfileSupported(profile: string): boolean;
97
+ }
98
+ //# sourceMappingURL=zkp.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"zkp.d.ts","sourceRoot":"","sources":["../../../../src/iden3comm/packers/zkp.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,qBAAqB,EACrB,mBAAmB,EACnB,YAAY,EACZ,OAAO,EACP,aAAa,EACb,qBAAqB,EACrB,kBAAkB,EAClB,eAAe,EAChB,MAAM,UAAU,CAAC;AAElB,OAAO,EAAoB,SAAS,EAAE,MAAM,sBAAsB,CAAC;AACnE,OAAO,EAAe,GAAG,EAAE,MAAM,yBAAyB,CAAC;AAU3D,OAAO,EAA2C,SAAS,EAAmB,MAAM,cAAc,CAAC;AAOnG;;;;;GAKG;AACH,qBAAa,sBAAsB;aAKL,eAAe,EAAE,mBAAmB;IAJhE;;;OAGG;gBACyB,eAAe,EAAE,mBAAmB;IAEhE;;;;;;;OAOG;IACH,OAAO,CAAC,IAAI,EAAE,UAAU,EAAE,GAAG,EAAE,GAAG,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C/C,kBAAkB,CAAC,OAAO,EAAE,MAAM;CAoBnC"}
@@ -0,0 +1,17 @@
1
+ export * from './protocol/auth';
2
+ export * from './protocol/credentials';
3
+ export * from './protocol/messages';
4
+ export * from './protocol/proof';
5
+ export * from './protocol/revocation';
6
+ export * from './protocol/contract-request';
7
+ export * from './protocol/proposal-request';
8
+ export * from './protocol/payment';
9
+ export * from './protocol/accept-profile';
10
+ export * from './protocol/discovery-protocol';
11
+ export * from './protocol/problem-report';
12
+ export * from './protocol/attachment';
13
+ export * from './protocol/common';
14
+ export * from './packer';
15
+ export * from './models';
16
+ export * from './packageManager';
17
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/iden3comm/types/index.ts"],"names":[],"mappings":"AAAA,cAAc,iBAAiB,CAAC;AAChC,cAAc,wBAAwB,CAAC;AACvC,cAAc,qBAAqB,CAAC;AACpC,cAAc,kBAAkB,CAAC;AACjC,cAAc,uBAAuB,CAAC;AACtC,cAAc,6BAA6B,CAAC;AAC5C,cAAc,6BAA6B,CAAC;AAC5C,cAAc,oBAAoB,CAAC;AACnC,cAAc,2BAA2B,CAAC;AAC1C,cAAc,+BAA+B,CAAC;AAC9C,cAAc,2BAA2B,CAAC;AAE1C,cAAc,uBAAuB,CAAC;AACtC,cAAc,mBAAmB,CAAC;AAClC,cAAc,UAAU,CAAC;AACzB,cAAc,UAAU,CAAC;AACzB,cAAc,kBAAkB,CAAC"}
@@ -0,0 +1,7 @@
1
+ /**
2
+ * State verification options
3
+ */
4
+ export type StateVerificationOpts = {
5
+ acceptedStateTransitionDelay?: number;
6
+ };
7
+ //# sourceMappingURL=models.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"models.d.ts","sourceRoot":"","sources":["../../../../src/iden3comm/types/models.ts"],"names":[],"mappings":"AAAA;;GAEG;AACH,MAAM,MAAM,qBAAqB,GAAG;IAElC,4BAA4B,CAAC,EAAE,MAAM,CAAC;CACvC,CAAC"}
@@ -0,0 +1,100 @@
1
+ import { BasicMessage, IPacker, PackerParams } from './packer';
2
+ import { MediaType } from '../constants';
3
+ /**
4
+ * Interface for defining the registry of packers
5
+ *
6
+ * @public
7
+ * @interface IPackageManager
8
+ */
9
+ export interface IPackageManager {
10
+ /**
11
+ * Map of packers key is media type, value is packer implementation
12
+ *
13
+ * @type {Map<MediaType, IPacker>}
14
+ */
15
+ packers: Map<MediaType, IPacker>;
16
+ /**
17
+ * registers new packer in the manager
18
+ *
19
+ * @param {Array<IPacker>} packers
20
+ */
21
+ registerPackers(packers: Array<IPacker>): void;
22
+ /**
23
+ * packs payload with a packer that is assigned to media type
24
+ * forwards packer params to implementation
25
+ *
26
+ * @param {MediaType} mediaType
27
+ * @param {Uint8Array} payload
28
+ * @param {PackerParams} params
29
+ * @returns `Promise<Uint8Array>`
30
+ */
31
+ pack(mediaType: MediaType, payload: Uint8Array, params: PackerParams): Promise<Uint8Array>;
32
+ /**
33
+ * packs payload with a packer that is assigned to media type
34
+ * forwards packer params to implementation
35
+ *
36
+ * @param {MediaType} mediaType
37
+ * @param {BasicMessage} protocolMessage
38
+ * @param {PackerParams} params
39
+ * @returns `Promise<Uint8Array>`
40
+ */
41
+ packMessage(mediaType: MediaType, protocolMessage: BasicMessage, params: PackerParams): Promise<Uint8Array>;
42
+ /**
43
+ * unpacks packed envelope to basic protocol message and returns media type of the envelope
44
+ *
45
+ * @param {Uint8Array} envelope - bytes envelope
46
+ * @returns `Promise<{ unpackedMessage: BasicMessage; unpackedMediaType: MediaType }`
47
+ */
48
+ unpack(envelope: Uint8Array): Promise<{
49
+ unpackedMessage: BasicMessage;
50
+ unpackedMediaType: MediaType;
51
+ }>;
52
+ /**
53
+ * unpacks an envelope with a known media type
54
+ *
55
+ * @param {MediaType} mediaType
56
+ * @param {Uint8Array} envelope
57
+ * @returns `Promise<BasicMessage>`
58
+ */
59
+ unpackWithType(mediaType: MediaType, envelope: Uint8Array): Promise<BasicMessage>;
60
+ /**
61
+ * gets media type from an envelope
62
+ *
63
+ * @param {string} envelope
64
+ * @returns MediaType
65
+ */
66
+ getMediaType(envelope: string): MediaType;
67
+ /**
68
+ * gets supported media types by packer manager
69
+ *
70
+ * @returns MediaType[]
71
+ */
72
+ getSupportedMediaTypes(): MediaType[];
73
+ /**
74
+ * gets supported accept profiles by packer manager
75
+ *
76
+ * @returns string[]
77
+ */
78
+ getSupportedProfiles(): string[];
79
+ /**
80
+ * returns true if media type and algorithms supported by packer manager
81
+ *
82
+ * @param {MediaType} mediaType
83
+ * @param {string} profile
84
+ * @returns {boolean}
85
+ */
86
+ isProfileSupported(mediaType: MediaType, profile: string): boolean;
87
+ }
88
+ /**
89
+ * EnvelopeStub is used to stub the jwt based envelops
90
+ */
91
+ export type EnvelopeStub = {
92
+ protected: string;
93
+ };
94
+ /**
95
+ * HeaderStub is used to stub the jwt based envelops
96
+ */
97
+ export type HeaderStub = {
98
+ typ: MediaType;
99
+ };
100
+ //# sourceMappingURL=packageManager.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"packageManager.d.ts","sourceRoot":"","sources":["../../../../src/iden3comm/types/packageManager.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,YAAY,EAAE,OAAO,EAAE,YAAY,EAAE,MAAM,UAAU,CAAC;AAC/D,OAAO,EAAE,SAAS,EAAE,MAAM,cAAc,CAAC;AAEzC;;;;;GAKG;AACH,MAAM,WAAW,eAAe;IAC9B;;;;OAIG;IACH,OAAO,EAAE,GAAG,CAAC,SAAS,EAAE,OAAO,CAAC,CAAC;IAEjC;;;;OAIG;IACH,eAAe,CAAC,OAAO,EAAE,KAAK,CAAC,OAAO,CAAC,GAAG,IAAI,CAAC;IAE/C;;;;;;;;OAQG;IACH,IAAI,CAAC,SAAS,EAAE,SAAS,EAAE,OAAO,EAAE,UAAU,EAAE,MAAM,EAAE,YAAY,GAAG,OAAO,CAAC,UAAU,CAAC,CAAC;IAE3F;;;;;;;;OAQG;IACH,WAAW,CACT,SAAS,EAAE,SAAS,EACpB,eAAe,EAAE,YAAY,EAC7B,MAAM,EAAE,YAAY,GACnB,OAAO,CAAC,UAAU,CAAC,CAAC;IAEvB;;;;;OAKG;IACH,MAAM,CACJ,QAAQ,EAAE,UAAU,GACnB,OAAO,CAAC;QAAE,eAAe,EAAE,YAAY,CAAC;QAAC,iBAAiB,EAAE,SAAS,CAAA;KAAE,CAAC,CAAC;IAE5E;;;;;;OAMG;IACH,cAAc,CAAC,SAAS,EAAE,SAAS,EAAE,QAAQ,EAAE,UAAU,GAAG,OAAO,CAAC,YAAY,CAAC,CAAC;IAElF;;;;;OAKG;IACH,YAAY,CAAC,QAAQ,EAAE,MAAM,GAAG,SAAS,CAAC;IAE1C;;;;OAIG;IACH,sBAAsB,IAAI,SAAS,EAAE,CAAC;IAEtC;;;;OAIG;IACH,oBAAoB,IAAI,MAAM,EAAE,CAAC;IAEjC;;;;;;OAMG;IACH,kBAAkB,CAAC,SAAS,EAAE,SAAS,EAAE,OAAO,EAAE,MAAM,GAAG,OAAO,CAAC;CACpE;AACD;;GAEG;AACH,MAAM,MAAM,YAAY,GAAG;IACzB,SAAS,EAAE,MAAM,CAAC;CACnB,CAAC;AACF;;GAEG;AACH,MAAM,MAAM,UAAU,GAAG;IACvB,GAAG,EAAE,SAAS,CAAC;CAChB,CAAC"}
@@ -0,0 +1,158 @@
1
+ import { DID } from '@mocanetwork/moca-iden3';
2
+ import { DataPrepareHandlerFunc, VerificationHandlerFunc } from '../packers';
3
+ import { ProvingMethodAlg } from '@iden3/js-jwz';
4
+ import { CircuitId } from '../../circuits';
5
+ import { MediaType, PROTOCOL_MESSAGE_TYPE } from '../constants';
6
+ import { DIDDocument, VerificationMethod } from 'did-resolver';
7
+ import { StateVerificationOpts } from './models';
8
+ import { Attachment } from './protocol/attachment';
9
+ /**
10
+ * Protocol message type
11
+ */
12
+ export type ProtocolMessage = (typeof PROTOCOL_MESSAGE_TYPE)[keyof typeof PROTOCOL_MESSAGE_TYPE];
13
+ /**
14
+ * JSONValue
15
+ */
16
+ export type JSONValue = string | number | boolean | object | Array<object>;
17
+ /**
18
+ * JSON object
19
+ */
20
+ export type JSONObject = {
21
+ [x: string]: JSONValue;
22
+ };
23
+ /**
24
+ * JSON document object
25
+ */
26
+ export type JsonDocumentObject = {
27
+ [key: string]: JsonDocumentObjectValue;
28
+ };
29
+ /**
30
+ * JSON document object allowed values
31
+ */
32
+ export type JsonDocumentObjectValue = string | number | boolean | JsonDocumentObject | JsonDocumentObjectValue[];
33
+ /**
34
+ * Basic message with all possible fields optional
35
+ */
36
+ export type BasicMessage = {
37
+ id: string;
38
+ typ?: MediaType;
39
+ type: ProtocolMessage;
40
+ thid?: string;
41
+ body?: unknown;
42
+ from?: string;
43
+ to?: string;
44
+ created_time?: number;
45
+ expires_time?: number;
46
+ attachments?: Attachment[];
47
+ };
48
+ /**
49
+ * Basic message with all possible fields required
50
+ */
51
+ export type RequiredBasicMessage = Omit<Required<BasicMessage>, 'created_time' | 'expires_time' | 'attachments'> & {
52
+ created_time?: number;
53
+ expires_time?: number;
54
+ attachments?: Attachment[];
55
+ };
56
+ /**
57
+ * parameters for any packer
58
+ */
59
+ export type PackerParams = {
60
+ [key in string]: any;
61
+ };
62
+ /**
63
+ * parameters for zkp packer
64
+ */
65
+ export type ZKPPackerParams = PackerParams & {
66
+ senderDID: DID;
67
+ /** @deprecated */
68
+ profileNonce?: number | string;
69
+ provingMethodAlg: ProvingMethodAlg;
70
+ };
71
+ /**
72
+ * SignerFn Is function to sign data with a verification method
73
+ * @returns Promise of signature bytes;
74
+ */
75
+ export type SignerFn = (vm: VerificationMethod, dataToSign: Uint8Array) => Promise<Uint8Array>;
76
+ /**
77
+ * JWSPackerParams are parameters for JWS packer
78
+ */
79
+ export type JWSPackerParams = PackerParams & {
80
+ alg: string;
81
+ kid?: string;
82
+ didDocument?: DIDDocument;
83
+ signer?: SignerFn;
84
+ };
85
+ /**
86
+ * parameters for plain packer
87
+ */
88
+ export type PlainPackerParams = PackerParams;
89
+ /**
90
+ * signature of auth signals function preparer
91
+ */
92
+ export type AuthDataPrepareFunc = (hash: Uint8Array, did: DID, circuitId: CircuitId) => Promise<Uint8Array>;
93
+ /**
94
+ * signature of state function verifier
95
+ */
96
+ export type StateVerificationFunc = (id: string, pubSignals: Array<string>, opts?: StateVerificationOpts) => Promise<boolean>;
97
+ /**
98
+ * Defines method that must be implemented by any packer
99
+ *
100
+ * @public
101
+ * @interface IPacker
102
+ */
103
+ export interface IPacker {
104
+ /**
105
+ * Packs the given payload and returns a promise that resolves to the packed data.
106
+ * @param payload - The payload to be packed.
107
+ * @param param - The packing parameters.
108
+ * @returns A promise that resolves to the packed data as a Uint8Array.
109
+ */
110
+ pack(payload: Uint8Array, param: PackerParams): Promise<Uint8Array>;
111
+ /**
112
+ * Packs the given message and returns a promise that resolves to the packed data.
113
+ * @param msg - The message to be packed.
114
+ * @param param - The packing parameters.
115
+ * @returns A promise that resolves to the packed data as a Uint8Array.
116
+ */
117
+ packMessage(msg: BasicMessage, param: PackerParams): Promise<Uint8Array>;
118
+ /**
119
+ * Unpacks the given envelope and returns a promise that resolves to the unpacked message.
120
+ * @param envelope - The envelope to be unpacked.
121
+ * @returns A promise that resolves to the unpacked message as a BasicMessage.
122
+ */
123
+ unpack(envelope: Uint8Array): Promise<BasicMessage>;
124
+ /**
125
+ * Returns the media type associated with the packer.
126
+ * @returns The media type as a MediaType.
127
+ */
128
+ mediaType(): MediaType;
129
+ /**
130
+ * gets packer envelope (supported profiles) with options
131
+ *
132
+ * @returns {string}
133
+ */
134
+ getSupportedProfiles(): string[];
135
+ /**
136
+ * returns true if profile is supported by packer
137
+ *
138
+ * @param {string} profile
139
+ * @returns {boolean}
140
+ */
141
+ isProfileSupported(profile: string): boolean;
142
+ }
143
+ /**
144
+ * Params for verification of auth circuit public signals
145
+ */
146
+ export type VerificationParams = {
147
+ key: Uint8Array;
148
+ verificationFn: VerificationHandlerFunc;
149
+ };
150
+ /**
151
+ * Params for generation of proof for auth circuit
152
+ */
153
+ export type ProvingParams = {
154
+ dataPreparer: DataPrepareHandlerFunc;
155
+ provingKey: Uint8Array;
156
+ wasm: Uint8Array;
157
+ };
158
+ //# sourceMappingURL=packer.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"packer.d.ts","sourceRoot":"","sources":["../../../../src/iden3comm/types/packer.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,GAAG,EAAE,MAAM,yBAAyB,CAAC;AAC9C,OAAO,EAAE,sBAAsB,EAAE,uBAAuB,EAAE,MAAM,YAAY,CAAC;AAC7E,OAAO,EAAE,gBAAgB,EAAE,MAAM,eAAe,CAAC;AACjD,OAAO,EAAE,SAAS,EAAE,MAAM,gBAAgB,CAAC;AAC3C,OAAO,EAAE,SAAS,EAAE,qBAAqB,EAAE,MAAM,cAAc,CAAC;AAChE,OAAO,EAAE,WAAW,EAAE,kBAAkB,EAAE,MAAM,cAAc,CAAC;AAC/D,OAAO,EAAE,qBAAqB,EAAE,MAAM,UAAU,CAAC;AACjD,OAAO,EAAE,UAAU,EAAE,MAAM,uBAAuB,CAAC;AAEnD;;GAEG;AACH,MAAM,MAAM,eAAe,GAAG,CAAC,OAAO,qBAAqB,CAAC,CAAC,MAAM,OAAO,qBAAqB,CAAC,CAAC;AAEjG;;GAEG;AACH,MAAM,MAAM,SAAS,GAAG,MAAM,GAAG,MAAM,GAAG,OAAO,GAAG,MAAM,GAAG,KAAK,CAAC,MAAM,CAAC,CAAC;AAE3E;;GAEG;AACH,MAAM,MAAM,UAAU,GAAG;IACvB,CAAC,CAAC,EAAE,MAAM,GAAG,SAAS,CAAC;CACxB,CAAC;AAEF;;GAEG;AACH,MAAM,MAAM,kBAAkB,GAAG;IAAE,CAAC,GAAG,EAAE,MAAM,GAAG,uBAAuB,CAAA;CAAE,CAAC;AAE5E;;GAEG;AACH,MAAM,MAAM,uBAAuB,GAC/B,MAAM,GACN,MAAM,GACN,OAAO,GACP,kBAAkB,G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,IAAI,EAAE,UAAU,CAAC;CAClB,CAAC"}
@@ -0,0 +1,8 @@
1
+ import { AcceptAuthCircuits, AcceptJwsAlgorithms, AcceptJwzAlgorithms, MediaType, ProtocolVersion } from '../../constants';
2
+ export type AcceptProfile = {
3
+ protocolVersion: ProtocolVersion;
4
+ env: MediaType;
5
+ circuits?: AcceptAuthCircuits[];
6
+ alg?: AcceptJwsAlgorithms[] | AcceptJwzAlgorithms[];
7
+ };
8
+ //# sourceMappingURL=accept-profile.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"accept-profile.d.ts","sourceRoot":"","sources":["../../../../../src/iden3comm/types/protocol/accept-profile.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,kBAAkB,EAClB,mBAAmB,EACnB,mBAAmB,EACnB,SAAS,EACT,eAAe,EAChB,MAAM,iBAAiB,CAAC;AAEzB,MAAM,MAAM,aAAa,GAAG;IAC1B,eAAe,EAAE,eAAe,CAAC;IACjC,GAAG,EAAE,SAAS,CAAC;IACf,QAAQ,CAAC,EAAE,kBAAkB,EAAE,CAAC;IAChC,GAAG,CAAC,EAAE,mBAAmB,EAAE,GAAG,mBAAmB,EAAE,CAAC;CACrD,CAAC"}
@@ -0,0 +1,11 @@
1
+ import { JsonDocumentObject } from '../packer';
2
+ export type Attachment = {
3
+ id: string;
4
+ description?: string;
5
+ media_type?: string;
6
+ data: AttachData;
7
+ };
8
+ export type AttachData = {
9
+ json: JsonDocumentObject;
10
+ };
11
+ //# sourceMappingURL=attachment.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"attachment.d.ts","sourceRoot":"","sources":["../../../../../src/iden3comm/types/protocol/attachment.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,kBAAkB,EAAE,MAAM,WAAW,CAAC;AAE/C,MAAM,MAAM,UAAU,GAAG;IACvB,EAAE,EAAE,MAAM,CAAC;IACX,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB,UAAU,CAAC,EAAE,MAAM,CAAC;IACpB,IAAI,EAAE,UAAU,CAAC;CAClB,CAAC;AAEF,MAAM,MAAM,UAAU,GAAG;IACvB,IAAI,EAAE,kBAAkB,CAAC;CAC1B,CAAC"}
@@ -0,0 +1,90 @@
1
+ import { ZKProof } from '@iden3/js-jwz';
2
+ import { BasicMessage, JsonDocumentObject } from '../packer';
3
+ import { PROTOCOL_MESSAGE_TYPE } from '../../constants';
4
+ import { ProofType } from '../../../verifiable';
5
+ import { CircuitId } from '../../../circuits';
6
+ import { DIDDocument as DidResolverDidDocument, VerificationMethod as DidResolverVerificationMethod } from 'did-resolver';
7
+ import { RootInfo, StateInfo } from '../../../storage';
8
+ import { AuthProof, CrossChainProof } from './contract-request';
9
+ /** AuthorizationResponseMessage is struct the represents iden3message authorization response */
10
+ export type AuthorizationResponseMessage = BasicMessage & {
11
+ body: AuthorizationMessageResponseBody;
12
+ from: string;
13
+ to: string;
14
+ type: typeof PROTOCOL_MESSAGE_TYPE.AUTHORIZATION_RESPONSE_MESSAGE_TYPE;
15
+ };
16
+ /** AuthorizationMessageResponseBody is struct the represents authorization response data */
17
+ export type AuthorizationMessageResponseBody = {
18
+ did_doc?: DIDDocument;
19
+ message?: string;
20
+ scope: Array<ZeroKnowledgeProofResponse>;
21
+ };
22
+ /** AuthorizationRequestMessage is struct the represents iden3message authorization request */
23
+ export type AuthorizationRequestMessage = BasicMessage & {
24
+ body: AuthorizationRequestMessageBody;
25
+ from: string;
26
+ type: typeof PROTOCOL_MESSAGE_TYPE.AUTHORIZATION_REQUEST_MESSAGE_TYPE;
27
+ };
28
+ /** AuthorizationRequestMessageBody is body for authorization request */
29
+ export type AuthorizationRequestMessageBody = {
30
+ callbackUrl: string;
31
+ reason?: string;
32
+ message?: string;
33
+ did_doc?: DIDDocument;
34
+ scope: Array<ZeroKnowledgeProofRequest>;
35
+ accept?: string[];
36
+ };
37
+ /** ZeroKnowledgeProofRequest represents structure of zkp request object */
38
+ export type ZeroKnowledgeProofRequest = {
39
+ id: number | string;
40
+ circuitId: CircuitId;
41
+ optional?: boolean;
42
+ query: ZeroKnowledgeProofQuery;
43
+ params?: {
44
+ nullifierSessionId?: string | number;
45
+ };
46
+ };
47
+ /** ZeroKnowledgeProofQuery represents structure of zkp request query object */
48
+ export type ZeroKnowledgeProofQuery = {
49
+ allowedIssuers: string[];
50
+ context: string;
51
+ credentialSubject?: JsonDocumentObject;
52
+ proofType?: ProofType;
53
+ skipClaimRevocationCheck?: boolean;
54
+ groupId?: number;
55
+ type: string;
56
+ };
57
+ export type ZeroKnowledgeInvokeResponse = {
58
+ responses: ZeroKnowledgeProofResponse[];
59
+ crossChainProof?: CrossChainProof;
60
+ authProof?: AuthProof;
61
+ };
62
+ /** ZeroKnowledgeProofResponse represents structure of zkp response */
63
+ export type ZeroKnowledgeProofResponse = {
64
+ id: number | string;
65
+ circuitId: string;
66
+ vp?: VerifiablePresentation;
67
+ } & ZKProof;
68
+ /** ZeroKnowledgeProofAuthResponse represents structure of zkp auth response */
69
+ export type ZeroKnowledgeProofAuthResponse = Omit<ZeroKnowledgeProofResponse, 'id' | 'vp'>;
70
+ /** VerifiablePresentation represents structure of Verifiable Presentation */
71
+ export type VerifiablePresentation = {
72
+ '@context': string | (string | object)[];
73
+ type: string;
74
+ verifiableCredential: {
75
+ '@context': string | string[];
76
+ type: string | string[];
77
+ credentialSubject: JsonDocumentObject;
78
+ };
79
+ };
80
+ /** DIDDocument represents structure of DID Document */
81
+ export type DIDDocument = DidResolverDidDocument & {
82
+ verificationMethod?: VerificationMethod[];
83
+ };
84
+ /** VerificationMethod represents structure of Verification Method */
85
+ export type VerificationMethod = DidResolverVerificationMethod & {
86
+ published?: boolean;
87
+ info?: StateInfo;
88
+ global?: RootInfo;
89
+ };
90
+ //# sourceMappingURL=auth.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"auth.d.ts","sourceRoot":"","sources":["../../../../../src/iden3comm/types/protocol/auth.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,EAAE,M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G,MAAM,CAAC,EAAE,CAAC;IACzC,IAAI,EAAE,MAAM,CAAC;IACb,oBAAoB,EAAE;QACpB,UAAU,EAAE,MAAM,GAAG,MAAM,EAAE,CAAC;QAC9B,IAAI,EAAE,MAAM,GAAG,MAAM,EAAE,CAAC;QACxB,iBAAiB,EAAE,kBAAkB,CAAC;KACvC,CAAC;CACH,CAAC;AAEF,uDAAuD;AACvD,MAAM,MAAM,WAAW,GAAG,sBAAsB,GAAG;IACjD,kBAAkB,CAAC,EAAE,kBAAkB,EAAE,CAAC;CAC3C,CAAC;AAEF,qEAAqE;AACrE,MAAM,MAAM,kBAAkB,GAAG,6BAA6B,GAAG;IAC/D,SAAS,CAAC,EAAE,OAAO,CAAC;IACpB,IAAI,CAAC,EAAE,SAAS,CAAC;IACjB,MAAM,CAAC,EAAE,QAAQ,CAAC;CACnB,CAAC"}
@@ -0,0 +1,11 @@
1
+ /**
2
+ * Represents information about a credential schema.
3
+ *
4
+ * @property {string} type - The type of the credential schema.
5
+ * @property {string} context - The context in which the credential schema is used.
6
+ */
7
+ export type CredentialSchemaInfo = {
8
+ type: string;
9
+ context: string;
10
+ };
11
+ //# sourceMappingURL=common.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"common.d.ts","sourceRoot":"","sources":["../../../../../src/iden3comm/types/protocol/common.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AACH,MAAM,MAAM,oBAAoB,GAAG;IACjC,IAAI,EAAE,MAAM,CAAC;IACb,OAAO,EAAE,MAAM,CAAC;CACjB,CAAC"}
@@ -0,0 +1,62 @@
1
+ import { GlobalStateUpdate, IdentityStateUpdate } from '../../../storage/entities/state';
2
+ import { PROTOCOL_MESSAGE_TYPE } from '../../constants';
3
+ import { BasicMessage } from '../packer';
4
+ import { DIDDocument, ZeroKnowledgeProofAuthResponse, ZeroKnowledgeProofRequest, ZeroKnowledgeProofResponse } from './auth';
5
+ import { DID } from '@mocanetwork/moca-iden3';
6
+ /** ContractInvokeRequest represents structure of contract invoke request object */
7
+ export type ContractInvokeRequest = BasicMessage & {
8
+ body: ContractInvokeRequestBody;
9
+ type: typeof PROTOCOL_MESSAGE_TYPE.CONTRACT_INVOKE_REQUEST_MESSAGE_TYPE;
10
+ };
11
+ /** ContractInvokeRequestBody represents structure of contract invoke request body object */
12
+ export type ContractInvokeRequestBody = {
13
+ reason?: string;
14
+ transaction_data: ContractInvokeTransactionData;
15
+ scope: Array<ZeroKnowledgeProofRequest>;
16
+ did_doc?: DIDDocument;
17
+ accept?: string[];
18
+ };
19
+ /** ContractInvokeResponse represents structure of contract invoke response object */
20
+ export type ContractInvokeResponse = BasicMessage & {
21
+ body: ContractInvokeResponseBody;
22
+ type: typeof PROTOCOL_MESSAGE_TYPE.CONTRACT_INVOKE_RESPONSE_MESSAGE_TYPE;
23
+ };
24
+ /** ContractInvokeResponseBody represents structure of contract invoke response body object */
25
+ export type ContractInvokeResponseBody = {
26
+ scope: Array<OnChainZeroKnowledgeProofResponse>;
27
+ transaction_data: ContractInvokeTransactionData;
28
+ did_doc?: DIDDocument;
29
+ crossChainProof?: CrossChainProof;
30
+ authProof?: AuthProof;
31
+ };
32
+ /** OnChainZeroKnowledgeProofResponse represents structure of onchain zero knowledge proof response */
33
+ export type OnChainZeroKnowledgeProofResponse = ZeroKnowledgeProofResponse & {
34
+ txHash?: string;
35
+ };
36
+ /** ContractInvokeTransactionData represents structure of contract invoke transaction data object */
37
+ export type ContractInvokeTransactionData = {
38
+ contract_address: string;
39
+ method_id: string;
40
+ chain_id: number;
41
+ network?: string;
42
+ txHash?: string;
43
+ };
44
+ export type AuthProofEthIdentity = {
45
+ userDid: DID;
46
+ };
47
+ export type AuthProofZKP = {
48
+ zkp: ZeroKnowledgeProofAuthResponse;
49
+ };
50
+ /** AuthProofResponse represents structure of zkp response */
51
+ export type AuthProof = {
52
+ authMethod: AuthMethod;
53
+ } & (AuthProofEthIdentity | AuthProofZKP);
54
+ export type CrossChainProof = {
55
+ globalStateProofs: GlobalStateUpdate[];
56
+ identityStateProofs: IdentityStateUpdate[];
57
+ };
58
+ export declare enum AuthMethod {
59
+ AUTHV2 = "authV2",
60
+ ETH_IDENTITY = "ethIdentity"
61
+ }
62
+ //# sourceMappingURL=contract-request.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"contract-request.d.ts","sourceRoot":"","sources":["../../../../../src/iden3comm/types/protocol/contract-request.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,iBAAiB,EAAE,mBAAmB,EAAE,MAAM,iCAAiC,CAAC;AACzF,OAAO,EAAE,qBAAqB,EAAE,MAAM,iBAAiB,CAAC;AACxD,OAAO,EAAE,YAAY,EAAE,MAAM,WAAW,CAAC;AACzC,OAAO,EACL,WAAW,EACX,8BAA8B,EAC9B,yBAAyB,EACzB,0BAA0B,EAC3B,MAAM,QAAQ,CAAC;AAChB,OAAO,EAAE,GAAG,EAAE,MAAM,yBAAyB,CAAC;AAE9C,mFAAmF;AACnF,MAAM,MAAM,qBAAqB,GAAG,YAAY,GAAG;IACjD,IAAI,EAAE,yBAAyB,CAAC;IAChC,IAAI,EAAE,OAAO,qBAAqB,CAAC,oCAAoC,CAAC;CACzE,CAAC;AAEF,4FAA4F;AAC5F,MAAM,MAAM,yBAAyB,GAAG;IACtC,MAAM,CAAC,EAAE,MAAM,CAAC;IAChB,gBAAgB,EAAE,6BAA6B,CAAC;IAChD,KAAK,EAAE,KAAK,CAAC,yBAAyB,CAAC,CAAC;IACxC,OAAO,CAAC,EAAE,WAAW,CAAC;IACtB,MAAM,CAAC,EAAE,MAAM,EAAE,CAAC;CACnB,CAAC;AAEF,qFAAqF;AACrF,MAAM,MAAM,sBAAsB,GAAG,YAAY,GAAG;IAClD,IAAI,EAAE,0BAA0B,CAAC;IACjC,IAAI,EAAE,OAAO,qBAAqB,CAAC,qCAAqC,CAAC;CAC1E,CAAC;AAEF,8FAA8F;AAC9F,MAAM,MAAM,0BAA0B,GAAG;IACvC,KAAK,EAAE,KAAK,CAAC,iC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