@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.
- package/README.md +75 -0
- package/dist/browser/esm/index.js +14901 -0
- package/dist/browser/esm/index.js.map +1 -0
- package/dist/browser/umd/index.global.js +678 -0
- package/dist/browser/umd/index.global.js.map +1 -0
- package/dist/node/cjs/index.cjs +15418 -0
- package/dist/node/cjs/index.cjs.map +1 -0
- package/dist/node/esm/index.js +14901 -0
- package/dist/node/esm/index.js.map +1 -0
- package/dist/types/blockchain/index.d.ts +2 -0
- package/dist/types/blockchain/index.d.ts.map +1 -0
- package/dist/types/blockchain/transaction-service.d.ts +81 -0
- package/dist/types/blockchain/transaction-service.d.ts.map +1 -0
- package/dist/types/circuits/atomic-query-mtp-v2-on-chain.d.ts +70 -0
- package/dist/types/circuits/atomic-query-mtp-v2-on-chain.d.ts.map +1 -0
- package/dist/types/circuits/atomic-query-mtp-v2.d.ts +63 -0
- package/dist/types/circuits/atomic-query-mtp-v2.d.ts.map +1 -0
- package/dist/types/circuits/atomic-query-sig-v2-on-chain.d.ts +137 -0
- package/dist/types/circuits/atomic-query-sig-v2-on-chain.d.ts.map +1 -0
- package/dist/types/circuits/atomic-query-sig-v2.d.ts +64 -0
- package/dist/types/circuits/atomic-query-sig-v2.d.ts.map +1 -0
- package/dist/types/circuits/atomic-query-v3-on-chain.d.ts +141 -0
- package/dist/types/circuits/atomic-query-v3-on-chain.d.ts.map +1 -0
- package/dist/types/circuits/atomic-query-v3.d.ts +121 -0
- package/dist/types/circuits/atomic-query-v3.d.ts.map +1 -0
- package/dist/types/circuits/auth-v2.d.ts +46 -0
- package/dist/types/circuits/auth-v2.d.ts.map +1 -0
- package/dist/types/circuits/common.d.ts +153 -0
- package/dist/types/circuits/common.d.ts.map +1 -0
- package/dist/types/circuits/comparer.d.ts +122 -0
- package/dist/types/circuits/comparer.d.ts.map +1 -0
- package/dist/types/circuits/index.d.ts +13 -0
- package/dist/types/circuits/index.d.ts.map +1 -0
- package/dist/types/circuits/linked-multi-query.d.ts +38 -0
- package/dist/types/circuits/linked-multi-query.d.ts.map +1 -0
- package/dist/types/circuits/models.d.ts +189 -0
- package/dist/types/circuits/models.d.ts.map +1 -0
- package/dist/types/circuits/state-transition.d.ts +49 -0
- package/dist/types/circuits/state-transition.d.ts.map +1 -0
- package/dist/types/credentials/credential-wallet.d.ts +200 -0
- package/dist/types/credentials/credential-wallet.d.ts.map +1 -0
- package/dist/types/credentials/index.d.ts +12 -0
- package/dist/types/credentials/index.d.ts.map +1 -0
- package/dist/types/credentials/models.d.ts +84 -0
- package/dist/types/credentials/models.d.ts.map +1 -0
- package/dist/types/credentials/rhs.d.ts +38 -0
- package/dist/types/credentials/rhs.d.ts.map +1 -0
- package/dist/types/credentials/status/agent-revocation.d.ts +20 -0
- package/dist/types/credentials/status/agent-revocation.d.ts.map +1 -0
- package/dist/types/credentials/status/credential-status-publisher.d.ts +73 -0
- package/dist/types/credentials/status/credential-status-publisher.d.ts.map +1 -0
- package/dist/types/credentials/status/did-resolver-revocation.d.ts +8 -0
- package/dist/types/credentials/status/did-resolver-revocation.d.ts.map +1 -0
- package/dist/types/credentials/status/on-chain-revocation.d.ts +58 -0
- package/dist/types/credentials/status/on-chain-revocation.d.ts.map +1 -0
- package/dist/types/credentials/status/resolver.d.ts +69 -0
- package/dist/types/credentials/status/resolver.d.ts.map +1 -0
- package/dist/types/credentials/status/reverse-sparse-merkle-tree.d.ts +126 -0
- package/dist/types/credentials/status/reverse-sparse-merkle-tree.d.ts.map +1 -0
- package/dist/types/credentials/status/sparse-merkle-tree.d.ts +38 -0
- package/dist/types/credentials/status/sparse-merkle-tree.d.ts.map +1 -0
- package/dist/types/credentials/utils.d.ts +15 -0
- package/dist/types/credentials/utils.d.ts.map +1 -0
- package/dist/types/iden3comm/constants.d.ts +61 -0
- package/dist/types/iden3comm/constants.d.ts.map +1 -0
- package/dist/types/iden3comm/errors.d.ts +10 -0
- package/dist/types/iden3comm/errors.d.ts.map +1 -0
- package/dist/types/iden3comm/handlers/auth.d.ts +157 -0
- package/dist/types/iden3comm/handlers/auth.d.ts.map +1 -0
- package/dist/types/iden3comm/handlers/common.d.ts +72 -0
- package/dist/types/iden3comm/handlers/common.d.ts.map +1 -0
- package/dist/types/iden3comm/handlers/contract-request.d.ts +96 -0
- package/dist/types/iden3comm/handlers/contract-request.d.ts.map +1 -0
- package/dist/types/iden3comm/handlers/credential-proposal.d.ts +120 -0
- package/dist/types/iden3comm/handlers/credential-proposal.d.ts.map +1 -0
- package/dist/types/iden3comm/handlers/discovery-protocol.d.ts +101 -0
- package/dist/types/iden3comm/handlers/discovery-protocol.d.ts.map +1 -0
- package/dist/types/iden3comm/handlers/fetch.d.ts +130 -0
- package/dist/types/iden3comm/handlers/fetch.d.ts.map +1 -0
- package/dist/types/iden3comm/handlers/index.d.ts +12 -0
- package/dist/types/iden3comm/handlers/index.d.ts.map +1 -0
- package/dist/types/iden3comm/handlers/message-handler.d.ts +93 -0
- package/dist/types/iden3comm/handlers/message-handler.d.ts.map +1 -0
- package/dist/types/iden3comm/handlers/payment.d.ts +167 -0
- package/dist/types/iden3comm/handlers/payment.d.ts.map +1 -0
- package/dist/types/iden3comm/handlers/problem-report.d.ts +18 -0
- package/dist/types/iden3comm/handlers/problem-report.d.ts.map +1 -0
- package/dist/types/iden3comm/handlers/refresh.d.ts +57 -0
- package/dist/types/iden3comm/handlers/refresh.d.ts.map +1 -0
- package/dist/types/iden3comm/handlers/revocation-status.d.ts +76 -0
- package/dist/types/iden3comm/handlers/revocation-status.d.ts.map +1 -0
- package/dist/types/iden3comm/index.d.ts +9 -0
- package/dist/types/iden3comm/index.d.ts.map +1 -0
- package/dist/types/iden3comm/packageManager.d.ts +47 -0
- package/dist/types/iden3comm/packageManager.d.ts.map +1 -0
- package/dist/types/iden3comm/packers/index.d.ts +4 -0
- package/dist/types/iden3comm/packers/index.d.ts.map +1 -0
- package/dist/types/iden3comm/packers/jws.d.ts +56 -0
- package/dist/types/iden3comm/packers/jws.d.ts.map +1 -0
- package/dist/types/iden3comm/packers/plain.d.ts +47 -0
- package/dist/types/iden3comm/packers/plain.d.ts.map +1 -0
- package/dist/types/iden3comm/packers/zkp.d.ts +98 -0
- package/dist/types/iden3comm/packers/zkp.d.ts.map +1 -0
- package/dist/types/iden3comm/types/index.d.ts +17 -0
- package/dist/types/iden3comm/types/index.d.ts.map +1 -0
- package/dist/types/iden3comm/types/models.d.ts +7 -0
- package/dist/types/iden3comm/types/models.d.ts.map +1 -0
- package/dist/types/iden3comm/types/packageManager.d.ts +100 -0
- package/dist/types/iden3comm/types/packageManager.d.ts.map +1 -0
- package/dist/types/iden3comm/types/packer.d.ts +158 -0
- package/dist/types/iden3comm/types/packer.d.ts.map +1 -0
- package/dist/types/iden3comm/types/protocol/accept-profile.d.ts +8 -0
- package/dist/types/iden3comm/types/protocol/accept-profile.d.ts.map +1 -0
- package/dist/types/iden3comm/types/protocol/attachment.d.ts +11 -0
- package/dist/types/iden3comm/types/protocol/attachment.d.ts.map +1 -0
- package/dist/types/iden3comm/types/protocol/auth.d.ts +90 -0
- package/dist/types/iden3comm/types/protocol/auth.d.ts.map +1 -0
- package/dist/types/iden3comm/types/protocol/common.d.ts +11 -0
- package/dist/types/iden3comm/types/protocol/common.d.ts.map +1 -0
- package/dist/types/iden3comm/types/protocol/contract-request.d.ts +62 -0
- package/dist/types/iden3comm/types/protocol/contract-request.d.ts.map +1 -0
- package/dist/types/iden3comm/types/protocol/credentials.d.ts +82 -0
- package/dist/types/iden3comm/types/protocol/credentials.d.ts.map +1 -0
- package/dist/types/iden3comm/types/protocol/discovery-protocol.d.ts +42 -0
- package/dist/types/iden3comm/types/protocol/discovery-protocol.d.ts.map +1 -0
- package/dist/types/iden3comm/types/protocol/messages.d.ts +12 -0
- package/dist/types/iden3comm/types/protocol/messages.d.ts.map +1 -0
- package/dist/types/iden3comm/types/protocol/payment.d.ts +178 -0
- package/dist/types/iden3comm/types/protocol/payment.d.ts.map +1 -0
- package/dist/types/iden3comm/types/protocol/problem-report.d.ts +17 -0
- package/dist/types/iden3comm/types/protocol/problem-report.d.ts.map +1 -0
- package/dist/types/iden3comm/types/protocol/proof.d.ts +22 -0
- package/dist/types/iden3comm/types/protocol/proof.d.ts.map +1 -0
- package/dist/types/iden3comm/types/protocol/proposal-request.d.ts +33 -0
- package/dist/types/iden3comm/types/protocol/proposal-request.d.ts.map +1 -0
- package/dist/types/iden3comm/types/protocol/revocation.d.ts +20 -0
- package/dist/types/iden3comm/types/protocol/revocation.d.ts.map +1 -0
- package/dist/types/iden3comm/utils/accept-profile.d.ts +4 -0
- package/dist/types/iden3comm/utils/accept-profile.d.ts.map +1 -0
- package/dist/types/iden3comm/utils/did.d.ts +8 -0
- package/dist/types/iden3comm/utils/did.d.ts.map +1 -0
- package/dist/types/iden3comm/utils/envelope.d.ts +32 -0
- package/dist/types/iden3comm/utils/envelope.d.ts.map +1 -0
- package/dist/types/iden3comm/utils/index.d.ts +5 -0
- package/dist/types/iden3comm/utils/index.d.ts.map +1 -0
- package/dist/types/iden3comm/utils/message.d.ts +20 -0
- package/dist/types/iden3comm/utils/message.d.ts.map +1 -0
- package/dist/types/identity/common.d.ts +27 -0
- package/dist/types/identity/common.d.ts.map +1 -0
- package/dist/types/identity/identity-wallet.d.ts +472 -0
- package/dist/types/identity/identity-wallet.d.ts.map +1 -0
- package/dist/types/identity/index.d.ts +3 -0
- package/dist/types/identity/index.d.ts.map +1 -0
- package/dist/types/index.d.ts +17 -0
- package/dist/types/index.d.ts.map +1 -0
- package/dist/types/kms/index.d.ts +5 -0
- package/dist/types/kms/index.d.ts.map +1 -0
- package/dist/types/kms/key-providers/bjj-provider.d.ts +54 -0
- package/dist/types/kms/key-providers/bjj-provider.d.ts.map +1 -0
- package/dist/types/kms/key-providers/ed25519-provider.d.ts +61 -0
- package/dist/types/kms/key-providers/ed25519-provider.d.ts.map +1 -0
- package/dist/types/kms/key-providers/index.d.ts +4 -0
- package/dist/types/kms/key-providers/index.d.ts.map +1 -0
- package/dist/types/kms/key-providers/secp256k1-provider.d.ts +62 -0
- package/dist/types/kms/key-providers/secp256k1-provider.d.ts.map +1 -0
- package/dist/types/kms/kms.d.ts +120 -0
- package/dist/types/kms/kms.d.ts.map +1 -0
- package/dist/types/kms/provider-helpers.d.ts +10 -0
- package/dist/types/kms/provider-helpers.d.ts.map +1 -0
- package/dist/types/kms/store/abstract-key-store.d.ts +41 -0
- package/dist/types/kms/store/abstract-key-store.d.ts.map +1 -0
- package/dist/types/kms/store/index.d.ts +6 -0
- package/dist/types/kms/store/index.d.ts.map +1 -0
- package/dist/types/kms/store/indexed-db-key-store.d.ts +44 -0
- package/dist/types/kms/store/indexed-db-key-store.d.ts.map +1 -0
- package/dist/types/kms/store/local-storage-key-store.d.ts +42 -0
- package/dist/types/kms/store/local-storage-key-store.d.ts.map +1 -0
- package/dist/types/kms/store/memory-key-store.d.ts +24 -0
- package/dist/types/kms/store/memory-key-store.d.ts.map +1 -0
- package/dist/types/kms/store/types.d.ts +21 -0
- package/dist/types/kms/store/types.d.ts.map +1 -0
- package/dist/types/proof/common.d.ts +49 -0
- package/dist/types/proof/common.d.ts.map +1 -0
- package/dist/types/proof/index.d.ts +5 -0
- package/dist/types/proof/index.d.ts.map +1 -0
- package/dist/types/proof/proof-service.d.ts +169 -0
- package/dist/types/proof/proof-service.d.ts.map +1 -0
- package/dist/types/proof/provers/index.d.ts +4 -0
- package/dist/types/proof/provers/index.d.ts.map +1 -0
- package/dist/types/proof/provers/inputs-generator.d.ts +57 -0
- package/dist/types/proof/provers/inputs-generator.d.ts.map +1 -0
- package/dist/types/proof/provers/prover.d.ts +56 -0
- package/dist/types/proof/provers/prover.d.ts.map +1 -0
- package/dist/types/proof/provers/witness_calculator.d.ts +17 -0
- package/dist/types/proof/provers/witness_calculator.d.ts.map +1 -0
- package/dist/types/proof/verifiers/index.d.ts +4 -0
- package/dist/types/proof/verifiers/index.d.ts.map +1 -0
- package/dist/types/proof/verifiers/pub-signals-verifier.d.ts +60 -0
- package/dist/types/proof/verifiers/pub-signals-verifier.d.ts.map +1 -0
- package/dist/types/proof/verifiers/query-hash.d.ts +4 -0
- package/dist/types/proof/verifiers/query-hash.d.ts.map +1 -0
- package/dist/types/proof/verifiers/query.d.ts +43 -0
- package/dist/types/proof/verifiers/query.d.ts.map +1 -0
- package/dist/types/schema-processor/index.d.ts +4 -0
- package/dist/types/schema-processor/index.d.ts.map +1 -0
- package/dist/types/schema-processor/json/index.d.ts +3 -0
- package/dist/types/schema-processor/json/index.d.ts.map +1 -0
- package/dist/types/schema-processor/json/parser.d.ts +141 -0
- package/dist/types/schema-processor/json/parser.d.ts.map +1 -0
- package/dist/types/schema-processor/json/validator.d.ts +26 -0
- package/dist/types/schema-processor/json/validator.d.ts.map +1 -0
- package/dist/types/schema-processor/jsonld/cache.d.ts +3 -0
- package/dist/types/schema-processor/jsonld/cache.d.ts.map +1 -0
- package/dist/types/schema-processor/jsonld/index.d.ts +3 -0
- package/dist/types/schema-processor/jsonld/index.d.ts.map +1 -0
- package/dist/types/schema-processor/jsonld/parser.d.ts +30 -0
- package/dist/types/schema-processor/jsonld/parser.d.ts.map +1 -0
- package/dist/types/schema-processor/utils.d.ts +54 -0
- package/dist/types/schema-processor/utils.d.ts.map +1 -0
- package/dist/types/storage/blockchain/common.d.ts +8 -0
- package/dist/types/storage/blockchain/common.d.ts.map +1 -0
- package/dist/types/storage/blockchain/did-resolver-readonly-storage.d.ts +17 -0
- package/dist/types/storage/blockchain/did-resolver-readonly-storage.d.ts.map +1 -0
- package/dist/types/storage/blockchain/erc20-helper.d.ts +20 -0
- package/dist/types/storage/blockchain/erc20-helper.d.ts.map +1 -0
- package/dist/types/storage/blockchain/errors.d.ts +4 -0
- package/dist/types/storage/blockchain/errors.d.ts.map +1 -0
- package/dist/types/storage/blockchain/index.d.ts +8 -0
- package/dist/types/storage/blockchain/index.d.ts.map +1 -0
- package/dist/types/storage/blockchain/onchain-issuer-adapter/non-merklized/version/v0.0.1/onchain-non-merklized-issuer-adapter.d.ts +67 -0
- package/dist/types/storage/blockchain/onchain-issuer-adapter/non-merklized/version/v0.0.1/onchain-non-merklized-issuer-adapter.d.ts.map +1 -0
- package/dist/types/storage/blockchain/onchain-issuer.d.ts +41 -0
- package/dist/types/storage/blockchain/onchain-issuer.d.ts.map +1 -0
- package/dist/types/storage/blockchain/onchain-revocation.d.ts +41 -0
- package/dist/types/storage/blockchain/onchain-revocation.d.ts.map +1 -0
- package/dist/types/storage/blockchain/onchain-zkp-verifier.d.ts +116 -0
- package/dist/types/storage/blockchain/onchain-zkp-verifier.d.ts.map +1 -0
- package/dist/types/storage/blockchain/state.d.ts +127 -0
- package/dist/types/storage/blockchain/state.d.ts.map +1 -0
- package/dist/types/storage/entities/circuitData.d.ts +8 -0
- package/dist/types/storage/entities/circuitData.d.ts.map +1 -0
- package/dist/types/storage/entities/identity.d.ts +17 -0
- package/dist/types/storage/entities/identity.d.ts.map +1 -0
- package/dist/types/storage/entities/index.d.ts +5 -0
- package/dist/types/storage/entities/index.d.ts.map +1 -0
- package/dist/types/storage/entities/mt.d.ts +22 -0
- package/dist/types/storage/entities/mt.d.ts.map +1 -0
- package/dist/types/storage/entities/state.d.ts +92 -0
- package/dist/types/storage/entities/state.d.ts.map +1 -0
- package/dist/types/storage/errors.d.ts +9 -0
- package/dist/types/storage/errors.d.ts.map +1 -0
- package/dist/types/storage/filters/index.d.ts +2 -0
- package/dist/types/storage/filters/index.d.ts.map +1 -0
- package/dist/types/storage/filters/jsonQuery.d.ts +83 -0
- package/dist/types/storage/filters/jsonQuery.d.ts.map +1 -0
- package/dist/types/storage/fs/circuits-storage.d.ts +64 -0
- package/dist/types/storage/fs/circuits-storage.d.ts.map +1 -0
- package/dist/types/storage/fs/index.d.ts +2 -0
- package/dist/types/storage/fs/index.d.ts.map +1 -0
- package/dist/types/storage/index.d.ts +10 -0
- package/dist/types/storage/index.d.ts.map +1 -0
- package/dist/types/storage/indexed-db/data-source.d.ts +44 -0
- package/dist/types/storage/indexed-db/data-source.d.ts.map +1 -0
- package/dist/types/storage/indexed-db/index.d.ts +3 -0
- package/dist/types/storage/indexed-db/index.d.ts.map +1 -0
- package/dist/types/storage/indexed-db/merkletree.d.ts +43 -0
- package/dist/types/storage/indexed-db/merkletree.d.ts.map +1 -0
- package/dist/types/storage/interfaces/circuits.d.ts +26 -0
- package/dist/types/storage/interfaces/circuits.d.ts.map +1 -0
- package/dist/types/storage/interfaces/credentials.d.ts +53 -0
- package/dist/types/storage/interfaces/credentials.d.ts.map +1 -0
- package/dist/types/storage/interfaces/data-source.d.ts +39 -0
- package/dist/types/storage/interfaces/data-source.d.ts.map +1 -0
- package/dist/types/storage/interfaces/data-storage.d.ts +17 -0
- package/dist/types/storage/interfaces/data-storage.d.ts.map +1 -0
- package/dist/types/storage/interfaces/identity.d.ts +70 -0
- package/dist/types/storage/interfaces/identity.d.ts.map +1 -0
- package/dist/types/storage/interfaces/index.d.ts +11 -0
- package/dist/types/storage/interfaces/index.d.ts.map +1 -0
- package/dist/types/storage/interfaces/merkletree.d.ts +44 -0
- package/dist/types/storage/interfaces/merkletree.d.ts.map +1 -0
- package/dist/types/storage/interfaces/onchain-issuer.d.ts +13 -0
- package/dist/types/storage/interfaces/onchain-issuer.d.ts.map +1 -0
- package/dist/types/storage/interfaces/onchain-revocation.d.ts +19 -0
- package/dist/types/storage/interfaces/onchain-revocation.d.ts.map +1 -0
- package/dist/types/storage/interfaces/onchain-zkp-verifier.d.ts +63 -0
- package/dist/types/storage/interfaces/onchain-zkp-verifier.d.ts.map +1 -0
- package/dist/types/storage/interfaces/state.d.ts +74 -0
- package/dist/types/storage/interfaces/state.d.ts.map +1 -0
- package/dist/types/storage/local-storage/data-source.d.ts +41 -0
- package/dist/types/storage/local-storage/data-source.d.ts.map +1 -0
- package/dist/types/storage/local-storage/index.d.ts +3 -0
- package/dist/types/storage/local-storage/index.d.ts.map +1 -0
- package/dist/types/storage/local-storage/merkletree.d.ts +41 -0
- package/dist/types/storage/local-storage/merkletree.d.ts.map +1 -0
- package/dist/types/storage/memory/cache-lru.d.ts +11 -0
- package/dist/types/storage/memory/cache-lru.d.ts.map +1 -0
- package/dist/types/storage/memory/data-source.d.ts +20 -0
- package/dist/types/storage/memory/data-source.d.ts.map +1 -0
- package/dist/types/storage/memory/index.d.ts +4 -0
- package/dist/types/storage/memory/index.d.ts.map +1 -0
- package/dist/types/storage/memory/merkletree.d.ts +48 -0
- package/dist/types/storage/memory/merkletree.d.ts.map +1 -0
- package/dist/types/storage/shared/circuit-storage.d.ts +39 -0
- package/dist/types/storage/shared/circuit-storage.d.ts.map +1 -0
- package/dist/types/storage/shared/credential-storage.d.ts +39 -0
- package/dist/types/storage/shared/credential-storage.d.ts.map +1 -0
- package/dist/types/storage/shared/identity-storage.d.ts +45 -0
- package/dist/types/storage/shared/identity-storage.d.ts.map +1 -0
- package/dist/types/storage/shared/index.d.ts +4 -0
- package/dist/types/storage/shared/index.d.ts.map +1 -0
- package/dist/types/storage/utils.d.ts +4 -0
- package/dist/types/storage/utils.d.ts.map +1 -0
- package/dist/types/utils/compare-func.d.ts +2 -0
- package/dist/types/utils/compare-func.d.ts.map +1 -0
- package/dist/types/utils/did-helper.d.ts +38 -0
- package/dist/types/utils/did-helper.d.ts.map +1 -0
- package/dist/types/utils/encoding.d.ts +25 -0
- package/dist/types/utils/encoding.d.ts.map +1 -0
- package/dist/types/utils/index.d.ts +8 -0
- package/dist/types/utils/index.d.ts.map +1 -0
- package/dist/types/utils/message-bus.d.ts +63 -0
- package/dist/types/utils/message-bus.d.ts.map +1 -0
- package/dist/types/utils/object.d.ts +10 -0
- package/dist/types/utils/object.d.ts.map +1 -0
- package/dist/types/utils/payments/evm.d.ts +19 -0
- package/dist/types/utils/payments/evm.d.ts.map +1 -0
- package/dist/types/utils/payments/solana.d.ts +88 -0
- package/dist/types/utils/payments/solana.d.ts.map +1 -0
- package/dist/types/verifiable/constants.d.ts +188 -0
- package/dist/types/verifiable/constants.d.ts.map +1 -0
- package/dist/types/verifiable/core-utils.d.ts +87 -0
- package/dist/types/verifiable/core-utils.d.ts.map +1 -0
- package/dist/types/verifiable/credential.d.ts +150 -0
- package/dist/types/verifiable/credential.d.ts.map +1 -0
- package/dist/types/verifiable/index.d.ts +7 -0
- package/dist/types/verifiable/index.d.ts.map +1 -0
- package/dist/types/verifiable/presentation.d.ts +11 -0
- package/dist/types/verifiable/presentation.d.ts.map +1 -0
- package/dist/types/verifiable/proof.d.ts +211 -0
- package/dist/types/verifiable/proof.d.ts.map +1 -0
- package/dist/types/verifiable/schema.d.ts +3 -0
- package/dist/types/verifiable/schema.d.ts.map +1 -0
- package/package.json +104 -0
- package/src/blockchain/index.ts +1 -0
- package/src/blockchain/transaction-service.ts +121 -0
- package/src/circuits/atomic-query-mtp-v2-on-chain.ts +338 -0
- package/src/circuits/atomic-query-mtp-v2.ts +283 -0
- package/src/circuits/atomic-query-sig-v2-on-chain.ts +411 -0
- package/src/circuits/atomic-query-sig-v2.ts +340 -0
- package/src/circuits/atomic-query-v3-on-chain.ts +531 -0
- package/src/circuits/atomic-query-v3.ts +461 -0
- package/src/circuits/auth-v2.ts +159 -0
- package/src/circuits/common.ts +261 -0
- package/src/circuits/comparer.ts +227 -0
- package/src/circuits/index.ts +12 -0
- package/src/circuits/linked-multi-query.ts +180 -0
- package/src/circuits/models.ts +263 -0
- package/src/circuits/state-transition.ts +139 -0
- package/src/credentials/credential-wallet.ts +353 -0
- package/src/credentials/index.ts +11 -0
- package/src/credentials/models.ts +93 -0
- package/src/credentials/rhs.ts +176 -0
- package/src/credentials/status/agent-revocation.ts +69 -0
- package/src/credentials/status/credential-status-publisher.ts +143 -0
- package/src/credentials/status/did-resolver-revocation.ts +24 -0
- package/src/credentials/status/on-chain-revocation.ts +174 -0
- package/src/credentials/status/resolver.ts +81 -0
- package/src/credentials/status/reverse-sparse-merkle-tree.ts +366 -0
- package/src/credentials/status/sparse-merkle-tree.ts +50 -0
- package/src/credentials/utils.ts +36 -0
- package/src/iden3comm/constants.ts +119 -0
- package/src/iden3comm/errors.ts +14 -0
- package/src/iden3comm/handlers/auth.ts +520 -0
- package/src/iden3comm/handlers/common.ts +324 -0
- package/src/iden3comm/handlers/contract-request.ts +367 -0
- package/src/iden3comm/handlers/credential-proposal.ts +371 -0
- package/src/iden3comm/handlers/discovery-protocol.ts +277 -0
- package/src/iden3comm/handlers/fetch.ts +450 -0
- package/src/iden3comm/handlers/index.ts +11 -0
- package/src/iden3comm/handlers/message-handler.ts +165 -0
- package/src/iden3comm/handlers/payment.ts +698 -0
- package/src/iden3comm/handlers/problem-report.ts +41 -0
- package/src/iden3comm/handlers/refresh.ts +138 -0
- package/src/iden3comm/handlers/revocation-status.ts +228 -0
- package/src/iden3comm/index.ts +9 -0
- package/src/iden3comm/packageManager.ts +143 -0
- package/src/iden3comm/packers/index.ts +3 -0
- package/src/iden3comm/packers/jws.ts +225 -0
- package/src/iden3comm/packers/plain.ts +86 -0
- package/src/iden3comm/packers/zkp.ts +243 -0
- package/src/iden3comm/types/index.ts +17 -0
- package/src/iden3comm/types/models.ts +7 -0
- package/src/iden3comm/types/packageManager.ts +112 -0
- package/src/iden3comm/types/packer.ts +190 -0
- package/src/iden3comm/types/protocol/accept-profile.ts +14 -0
- package/src/iden3comm/types/protocol/attachment.ts +12 -0
- package/src/iden3comm/types/protocol/auth.ts +104 -0
- package/src/iden3comm/types/protocol/common.ts +10 -0
- package/src/iden3comm/types/protocol/contract-request.ts +76 -0
- package/src/iden3comm/types/protocol/credentials.ts +96 -0
- package/src/iden3comm/types/protocol/discovery-protocol.ts +49 -0
- package/src/iden3comm/types/protocol/messages.ts +13 -0
- package/src/iden3comm/types/protocol/payment.ts +231 -0
- package/src/iden3comm/types/protocol/problem-report.ts +18 -0
- package/src/iden3comm/types/protocol/proof.ts +25 -0
- package/src/iden3comm/types/protocol/proposal-request.ts +38 -0
- package/src/iden3comm/types/protocol/revocation.ts +23 -0
- package/src/iden3comm/utils/accept-profile.ts +121 -0
- package/src/iden3comm/utils/did.ts +71 -0
- package/src/iden3comm/utils/envelope.ts +101 -0
- package/src/iden3comm/utils/index.ts +4 -0
- package/src/iden3comm/utils/message.ts +41 -0
- package/src/identity/common.ts +69 -0
- package/src/identity/identity-wallet.ts +1592 -0
- package/src/identity/index.ts +2 -0
- package/src/index.ts +16 -0
- package/src/kms/index.ts +4 -0
- package/src/kms/key-providers/bjj-provider.ts +118 -0
- package/src/kms/key-providers/ed25519-provider.ts +105 -0
- package/src/kms/key-providers/index.ts +3 -0
- package/src/kms/key-providers/secp256k1-provider.ts +125 -0
- package/src/kms/kms.ts +173 -0
- package/src/kms/provider-helpers.ts +13 -0
- package/src/kms/store/abstract-key-store.ts +34 -0
- package/src/kms/store/index.ts +5 -0
- package/src/kms/store/indexed-db-key-store.ts +60 -0
- package/src/kms/store/local-storage-key-store.ts +69 -0
- package/src/kms/store/memory-key-store.ts +29 -0
- package/src/kms/store/types.ts +21 -0
- package/src/proof/common.ts +273 -0
- package/src/proof/index.ts +4 -0
- package/src/proof/proof-service.ts +623 -0
- package/src/proof/provers/index.ts +3 -0
- package/src/proof/provers/inputs-generator.ts +627 -0
- package/src/proof/provers/prover.ts +104 -0
- package/src/proof/provers/witness_calculator.ts +315 -0
- package/src/proof/verifiers/index.ts +3 -0
- package/src/proof/verifiers/pub-signals-verifier.ts +730 -0
- package/src/proof/verifiers/query-hash.ts +57 -0
- package/src/proof/verifiers/query.ts +340 -0
- package/src/schema-processor/index.ts +3 -0
- package/src/schema-processor/json/index.ts +2 -0
- package/src/schema-processor/json/parser.ts +256 -0
- package/src/schema-processor/json/validator.ts +67 -0
- package/src/schema-processor/jsonld/cache.ts +49 -0
- package/src/schema-processor/jsonld/index.ts +2 -0
- package/src/schema-processor/jsonld/parser.ts +93 -0
- package/src/schema-processor/utils.ts +84 -0
- package/src/storage/blockchain/abi/CredentialStatusResolver.json +1 -0
- package/src/storage/blockchain/abi/ERC20.json +1 -0
- package/src/storage/blockchain/abi/ERC20Permit.json +1 -0
- package/src/storage/blockchain/abi/IdentityBase.json +1 -0
- package/src/storage/blockchain/abi/State.json +1 -0
- package/src/storage/blockchain/abi/ZkpVerifier.json +789 -0
- package/src/storage/blockchain/common.ts +20 -0
- package/src/storage/blockchain/did-resolver-readonly-storage.ts +90 -0
- package/src/storage/blockchain/erc20-helper.ts +66 -0
- package/src/storage/blockchain/errors.ts +46 -0
- package/src/storage/blockchain/index.ts +7 -0
- package/src/storage/blockchain/onchain-issuer-adapter/non-merklized/version/v0.0.1/onchain-non-merklized-issuer-adapter.ts +327 -0
- package/src/storage/blockchain/onchain-issuer.ts +104 -0
- package/src/storage/blockchain/onchain-revocation.ts +143 -0
- package/src/storage/blockchain/onchain-zkp-verifier.ts +704 -0
- package/src/storage/blockchain/state.ts +471 -0
- package/src/storage/entities/circuitData.ts +7 -0
- package/src/storage/entities/identity.ts +18 -0
- package/src/storage/entities/index.ts +4 -0
- package/src/storage/entities/mt.ts +25 -0
- package/src/storage/entities/state.ts +97 -0
- package/src/storage/errors.ts +8 -0
- package/src/storage/filters/index.ts +1 -0
- package/src/storage/filters/jsonQuery.ts +368 -0
- package/src/storage/fs/circuits-storage.ts +149 -0
- package/src/storage/fs/index.ts +1 -0
- package/src/storage/index.ts +9 -0
- package/src/storage/indexed-db/data-source.ts +58 -0
- package/src/storage/indexed-db/index.ts +2 -0
- package/src/storage/indexed-db/merkletree.ts +140 -0
- package/src/storage/interfaces/circuits.ts +27 -0
- package/src/storage/interfaces/credentials.ts +53 -0
- package/src/storage/interfaces/data-source.ts +41 -0
- package/src/storage/interfaces/data-storage.ts +17 -0
- package/src/storage/interfaces/identity.ts +73 -0
- package/src/storage/interfaces/index.ts +10 -0
- package/src/storage/interfaces/merkletree.ts +52 -0
- package/src/storage/interfaces/onchain-issuer.ts +13 -0
- package/src/storage/interfaces/onchain-revocation.ts +22 -0
- package/src/storage/interfaces/onchain-zkp-verifier.ts +94 -0
- package/src/storage/interfaces/state.ts +81 -0
- package/src/storage/local-storage/data-source.ts +87 -0
- package/src/storage/local-storage/index.ts +2 -0
- package/src/storage/local-storage/merkletree.ts +137 -0
- package/src/storage/memory/cache-lru.ts +30 -0
- package/src/storage/memory/data-source.ts +45 -0
- package/src/storage/memory/index.ts +3 -0
- package/src/storage/memory/merkletree.ts +116 -0
- package/src/storage/shared/circuit-storage.ts +49 -0
- package/src/storage/shared/credential-storage.ts +70 -0
- package/src/storage/shared/identity-storage.ts +82 -0
- package/src/storage/shared/index.ts +3 -0
- package/src/storage/utils.ts +19 -0
- package/src/utils/compare-func.ts +5 -0
- package/src/utils/did-helper.ts +157 -0
- package/src/utils/encoding.ts +47 -0
- package/src/utils/index.ts +7 -0
- package/src/utils/message-bus.ts +88 -0
- package/src/utils/object.ts +52 -0
- package/src/utils/payments/evm.ts +152 -0
- package/src/utils/payments/solana.ts +360 -0
- package/src/verifiable/constants.ts +239 -0
- package/src/verifiable/core-utils.ts +307 -0
- package/src/verifiable/credential.ts +649 -0
- package/src/verifiable/index.ts +6 -0
- package/src/verifiable/presentation.ts +97 -0
- package/src/verifiable/proof.ts +277 -0
- package/src/verifiable/schema.ts +241 -0
|
@@ -0,0 +1,73 @@
|
|
|
1
|
+
import { TransactionReceipt } from 'ethers';
|
|
2
|
+
import { JSONObject } from '../../iden3comm';
|
|
3
|
+
import { OnChainRevocationStorage } from '../../storage';
|
|
4
|
+
import { CredentialStatusType } from '../../verifiable';
|
|
5
|
+
import { ProofNode } from './reverse-sparse-merkle-tree';
|
|
6
|
+
import { PublishMode } from '../models';
|
|
7
|
+
/**
|
|
8
|
+
* Represents a credential status publisher.
|
|
9
|
+
*/
|
|
10
|
+
export interface ICredentialStatusPublisher {
|
|
11
|
+
/**
|
|
12
|
+
* Publishes the credential status.
|
|
13
|
+
* @param params - The parameters for publishing the status.
|
|
14
|
+
* @returns A promise that resolves when the status is published.
|
|
15
|
+
*/
|
|
16
|
+
publish(params: JSONObject): Promise<void>;
|
|
17
|
+
}
|
|
18
|
+
/**
|
|
19
|
+
* Registry for managing credential status publishers.
|
|
20
|
+
*/
|
|
21
|
+
export declare class CredentialStatusPublisherRegistry {
|
|
22
|
+
private _publishers;
|
|
23
|
+
/**
|
|
24
|
+
* Registers one or more credential status publishers for a given type.
|
|
25
|
+
* @param type - The credential status type.
|
|
26
|
+
* @param publisher - One or more credential status publishers.
|
|
27
|
+
*/
|
|
28
|
+
register(type: CredentialStatusType, ...publisher: ICredentialStatusPublisher[]): void;
|
|
29
|
+
/**
|
|
30
|
+
* Retrieves the credential status publishers for a given type.
|
|
31
|
+
* @param type - The credential status type.
|
|
32
|
+
* @returns An array of credential status publishers or undefined if none are registered for the given type.
|
|
33
|
+
*/
|
|
34
|
+
get(type: CredentialStatusType): ICredentialStatusPublisher[] | undefined;
|
|
35
|
+
}
|
|
36
|
+
/**
|
|
37
|
+
* Implementation of the ICredentialStatusPublisher interface for publishing on-chain credential status.
|
|
38
|
+
*/
|
|
39
|
+
export declare class Iden3OnchainSmtCredentialStatusPublisher implements ICredentialStatusPublisher {
|
|
40
|
+
private readonly _storage;
|
|
41
|
+
constructor(_storage: OnChainRevocationStorage);
|
|
42
|
+
/**
|
|
43
|
+
* Publishes the credential status to the blockchain.
|
|
44
|
+
* @param params - The parameters for publishing the credential status.
|
|
45
|
+
*/
|
|
46
|
+
publish(params: {
|
|
47
|
+
nodes: ProofNode[];
|
|
48
|
+
credentialStatusType: CredentialStatusType;
|
|
49
|
+
onChain?: {
|
|
50
|
+
txCallback?: (tx: TransactionReceipt) => Promise<void>;
|
|
51
|
+
publishMode?: PublishMode;
|
|
52
|
+
};
|
|
53
|
+
}): Promise<void>;
|
|
54
|
+
}
|
|
55
|
+
/**
|
|
56
|
+
* Implementation of the ICredentialStatusPublisher interface for publishing off-chain credential status.
|
|
57
|
+
*/
|
|
58
|
+
export declare class Iden3SmtRhsCredentialStatusPublisher implements ICredentialStatusPublisher {
|
|
59
|
+
/**
|
|
60
|
+
* Publishes the credential status to a specified node URL.
|
|
61
|
+
* @param params - The parameters for publishing the credential status.
|
|
62
|
+
* @param params.nodes - The proof nodes to be published.
|
|
63
|
+
* @param params.rhsUrl - The URL of the node to publish the credential status to.
|
|
64
|
+
* @returns A promise that resolves when the credential status is successfully published.
|
|
65
|
+
* @throws An error if the publishing fails.
|
|
66
|
+
*/
|
|
67
|
+
publish(params: {
|
|
68
|
+
nodes: ProofNode[];
|
|
69
|
+
credentialStatusType: CredentialStatusType;
|
|
70
|
+
rhsUrl: string;
|
|
71
|
+
}): Promise<void>;
|
|
72
|
+
}
|
|
73
|
+
//# sourceMappingURL=credential-status-publisher.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"credential-status-publisher.d.ts","sourceRoot":"","sources":["../../../../src/credentials/status/credential-status-publisher.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,kBAAkB,EAAE,MAAM,QAAQ,CAAC;AAC5C,OAAO,EAAE,UAAU,EAAE,MAAM,iBAAiB,CAAC;AAC7C,OAAO,EAAE,wBAAwB,EAAE,MAAM,eAAe,CAAC;AACzD,OAAO,EAAE,oBAAoB,EAAE,MAAM,kBAAkB,CAAC;AACxD,OAAO,EAAE,SAAS,EAAE,MAAM,8BAA8B,CAAC;AAEzD,OAAO,EAAE,WAAW,EAAE,MAAM,WAAW,CAAC;AAExC;;GAEG;AACH,MAAM,WAAW,0BAA0B;IACzC;;;;OAIG;IACH,OAAO,CAAC,MAAM,EAAE,UAAU,GAAG,OAAO,CAAC,IAAI,CAAC,CAAC;CAC5C;AAED;;GAEG;AACH,qBAAa,iCAAiC;IAC5C,OAAO,CAAC,WAAW,CAAsE;IAEzF;;;;OAIG;IACI,QAAQ,CAAC,IAAI,EAAE,oBAAoB,EAAE,GAAG,SAAS,EAAE,0BAA0B,EAAE,GAAG,IAAI;IAM7F;;;;OAIG;IACI,GAAG,CAAC,IAAI,EAAE,oBAAoB,GAAG,0BAA0B,EAAE,GAAG,SAAS;CAGjF;AAED;;GAEG;AACH,qBAAa,wCAAyC,YAAW,0BAA0B;IAC7E,OAAO,CAAC,QAAQ,CAAC,QAAQ;gBAAR,QAAQ,EAAE,wBAAwB;IAE/D;;;OAGG;IACU,OAAO,CAAC,MAAM,EAAE;QAC3B,KAAK,EAAE,SAAS,EAAE,CAAC;QACnB,oBAAoB,EAAE,oBAAoB,CAAC;QAC3C,OAAO,CAAC,EAAE;YACR,UAAU,CAAC,EAAE,CAAC,EAAE,EAAE,kBAAkB,KAAK,OAAO,CAAC,IAAI,CAAC,CAAC;YACvD,WAAW,CAAC,EAAE,WAAW,CAAC;SAC3B,CAAC;KACH,GAAG,OAAO,CAAC,IAAI,CAAC;CAwClB;AAED;;GAEG;AACH,qBAAa,oCAAqC,YAAW,0BAA0B;IACrF;;;;;;;OAOG;IACU,OAAO,CAAC,MAAM,EAAE;QAC3B,KAAK,EAAE,SAAS,EAAE,CAAC;QACnB,oBAAoB,EAAE,oBAAoB,CAAC;QAE3C,MAAM,EAAE,MAAM,CAAC;KAChB,GAAG,OAAO,CAAC,IAAI,CAAC;CAmBlB"}
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import { CredentialStatus, RevocationStatus } from '../../verifiable';
|
|
2
|
+
import { CredentialStatusResolveOptions, CredentialStatusResolver } from './resolver';
|
|
3
|
+
export declare class DidDocumentCredentialStatusResolver implements CredentialStatusResolver {
|
|
4
|
+
private readonly didResolverUrl;
|
|
5
|
+
constructor(didResolverUrl: string);
|
|
6
|
+
resolve(credentialStatus: CredentialStatus, opts?: CredentialStatusResolveOptions | undefined): Promise<RevocationStatus>;
|
|
7
|
+
}
|
|
8
|
+
//# sourceMappingURL=did-resolver-revocation.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"did-resolver-revocation.d.ts","sourceRoot":"","sources":["../../../../src/credentials/status/did-resolver-revocation.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,gBAAgB,EAAE,gBAAgB,EAAE,MAAM,kBAAkB,CAAC;AACtE,OAAO,EAAE,8BAA8B,EAAE,wBAAwB,EAAE,MAAM,YAAY,CAAC;AAEtF,qBAAa,mCAAoC,YAAW,wBAAwB;IACtE,OAAO,CAAC,QAAQ,CAAC,cAAc;gBAAd,cAAc,EAAE,MAAM;IAC7C,OAAO,CACX,gBAAgB,EAAE,gBAAgB,EAClC,IAAI,CAAC,EAAE,8BAA8B,GAAG,SAAS,GAChD,OAAO,CAAC,gBAAgB,CAAC;CAe7B"}
|
|
@@ -0,0 +1,58 @@
|
|
|
1
|
+
import { RevocationStatus, CredentialStatus } from '../../verifiable';
|
|
2
|
+
import { EthConnectionConfig } from '../../storage/blockchain';
|
|
3
|
+
import { CredentialStatusResolver, CredentialStatusResolveOptions } from './resolver';
|
|
4
|
+
import { DID } from '@mocanetwork/moca-iden3';
|
|
5
|
+
import { EthStateStorageOptions } from '../../storage/blockchain/state';
|
|
6
|
+
export type OnChainResolverOptions = {
|
|
7
|
+
stateStorageOptions?: EthStateStorageOptions;
|
|
8
|
+
};
|
|
9
|
+
/**
|
|
10
|
+
* OnChainIssuer is a class that allows to interact with the onchain contract
|
|
11
|
+
* and build the revocation status.
|
|
12
|
+
*
|
|
13
|
+
* @public
|
|
14
|
+
* @class OnChainIssuer
|
|
15
|
+
*/
|
|
16
|
+
export declare class OnChainResolver implements CredentialStatusResolver {
|
|
17
|
+
private readonly _configs;
|
|
18
|
+
private readonly _stateStorage;
|
|
19
|
+
/**
|
|
20
|
+
*
|
|
21
|
+
* Creates an instance of OnChainIssuer.
|
|
22
|
+
* @public
|
|
23
|
+
* @param {Array<EthConnectionConfig>} _configs - list of ethereum network connections
|
|
24
|
+
*/
|
|
25
|
+
constructor(_configs: EthConnectionConfig[], _opts?: OnChainResolverOptions);
|
|
26
|
+
/**
|
|
27
|
+
* resolve is a method to resolve a credential status from the blockchain.
|
|
28
|
+
*
|
|
29
|
+
* @public
|
|
30
|
+
* @param {CredentialStatus} credentialStatus - credential status to resolve
|
|
31
|
+
* @param {CredentialStatusResolveOptions} credentialStatusResolveOptions - options for resolver
|
|
32
|
+
* @returns `{Promise<RevocationStatus>}`
|
|
33
|
+
*/
|
|
34
|
+
resolve(credentialStatus: CredentialStatus, credentialStatusResolveOptions?: CredentialStatusResolveOptions): Promise<RevocationStatus>;
|
|
35
|
+
/**
|
|
36
|
+
* Gets partial revocation status info from onchain issuer contract.
|
|
37
|
+
*
|
|
38
|
+
* @param {CredentialStatus} credentialStatus - credential status section of credential
|
|
39
|
+
* @param {DID} issuerDid - issuer did
|
|
40
|
+
* @returns `{Promise<RevocationStatus>}`
|
|
41
|
+
*/
|
|
42
|
+
getRevocationOnChain(credentialStatus: CredentialStatus, issuer: DID): Promise<RevocationStatus>;
|
|
43
|
+
/**
|
|
44
|
+
* Extract information about credential status
|
|
45
|
+
*
|
|
46
|
+
* @param {credentialStatus} CredentialStatus - credential status
|
|
47
|
+
* @returns {{contractAddress: string, chainId: number, revocationNonce: number, issuer: string;}}
|
|
48
|
+
*/
|
|
49
|
+
extractCredentialStatusInfo(credentialStatus: CredentialStatus): {
|
|
50
|
+
contractAddress: string;
|
|
51
|
+
chainId: number;
|
|
52
|
+
revocationNonce: number;
|
|
53
|
+
stateHex: string;
|
|
54
|
+
};
|
|
55
|
+
networkByChainId(chainId: number): EthConnectionConfig;
|
|
56
|
+
private _getOnChainRevocationStorageForIssuer;
|
|
57
|
+
}
|
|
58
|
+
//# sourceMappingURL=on-chain-revocation.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"on-chain-revocation.d.ts","sourceRoot":"","sources":["../../../../src/credentials/status/on-chain-revocation.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,gBAAgB,EAAE,gBAAgB,EAAE,MAAM,kBAAkB,CAAC;AACtE,OAAO,EAAE,mBAAmB,EAAE,MAAM,0BAA0B,CAAC;AAC/D,OAAO,EAAE,wBAAwB,EAAE,8BAA8B,EAAE,MAAM,YAAY,CAAC;AAEtF,OAAO,EAAE,GAAG,EAAE,MAAM,yBAAyB,CAAC;AAE9C,OAAO,EAAmB,sBAAsB,EAAE,MAAM,gCAAgC,CAAC;AAYzF,MAAM,MAAM,sBAAsB,GAAG;IACnC,mBAAmB,CAAC,EAAE,sBAAsB,CAAC;CAC9C,CAAC;AAEF;;;;;;GAMG;AACH,qBAAa,eAAgB,YAAW,wBAAwB;IAQlD,OAAO,CAAC,QAAQ,CAAC,QAAQ;IAPrC,OAAO,CAAC,QAAQ,CAAC,aAAa,CAAgB;IAC9C;;;;;OAKG;gBAC0B,QAAQ,EAAE,mBAAmB,EAAE,EAAE,KAAK,CAAC,EAAE,sBAAsB;IAI5F;;;;;;;OAOG;IACG,OAAO,CACX,gBAAgB,EAAE,gBAAgB,EAClC,8BAA8B,CAAC,EAAE,8BAA8B,GAC9D,OAAO,CAAC,gBAAgB,CAAC;IAO5B;;;;;;OAMG;IACG,oBAAoB,CACxB,gBAAgB,EAAE,gBAAgB,EAClC,MAAM,EAAE,GAAG,GACV,OAAO,CAAC,gBAAgB,CAAC;IA4C5B;;;;;OAKG;IACH,2BAA2B,CAAC,gBAAgB,EAAE,gBAAgB,GAAG;QAC/D,eAAe,EAAE,MAAM,CAAC;QACxB,OAAO,EAAE,MAAM,CAAC;QAChB,eAAe,EAAE,MAAM,CAAC;QACxB,QAAQ,EAAE,MAAM,CAAC;KAClB;IAiCD,gBAAgB,CAAC,OAAO,EAAE,MAAM,GAAG,mBAAmB;IAQtD,OAAO,CAAC,qCAAqC;CAQ9C"}
|
|
@@ -0,0 +1,69 @@
|
|
|
1
|
+
import { DID } from '@mocanetwork/moca-iden3';
|
|
2
|
+
import { State, RevocationStatus, CredentialStatus, CredentialStatusType } from '../../verifiable';
|
|
3
|
+
/**
|
|
4
|
+
* CredentialStatusResolveOptions is a set of options that can be passed to CredentialStatusResolver
|
|
5
|
+
*
|
|
6
|
+
* @public
|
|
7
|
+
* @interface CredentialStatusResolveOptions
|
|
8
|
+
*/
|
|
9
|
+
export interface CredentialStatusResolveOptions {
|
|
10
|
+
/**
|
|
11
|
+
@deprecated it was used only for state in case issuer has a issuerGenesisState state
|
|
12
|
+
*/
|
|
13
|
+
issuerData?: {
|
|
14
|
+
state: {
|
|
15
|
+
rootOfRoots: string;
|
|
16
|
+
claimsTreeRoot: string;
|
|
17
|
+
revocationTreeRoot: string;
|
|
18
|
+
value: string;
|
|
19
|
+
};
|
|
20
|
+
};
|
|
21
|
+
issuerGenesisState?: State;
|
|
22
|
+
issuerDID?: DID;
|
|
23
|
+
userDID?: DID;
|
|
24
|
+
}
|
|
25
|
+
/**
|
|
26
|
+
* CredentialStatusResolver is an interface that allows to interact with different types of credential status
|
|
27
|
+
* to resolve revocation status
|
|
28
|
+
*
|
|
29
|
+
* @public
|
|
30
|
+
* @interface CredentialStatusResolver
|
|
31
|
+
*/
|
|
32
|
+
export interface CredentialStatusResolver {
|
|
33
|
+
/**
|
|
34
|
+
* resolve is a method to resolve a credential status from the the specific source.
|
|
35
|
+
*
|
|
36
|
+
* @public
|
|
37
|
+
* @param {CredentialStatus} credentialStatus - credential status to resolve
|
|
38
|
+
* @param {CredentialStatusResolveOptions} credentialStatusResolveOptions - options for resolver
|
|
39
|
+
* @returns `{Promise<RevocationStatus>}`
|
|
40
|
+
*/
|
|
41
|
+
resolve(credentialStatus: CredentialStatus, opts?: CredentialStatusResolveOptions): Promise<RevocationStatus>;
|
|
42
|
+
}
|
|
43
|
+
/**
|
|
44
|
+
* CredentialStatusResolverRegistry is a registry of CredentialStatusResolver
|
|
45
|
+
*
|
|
46
|
+
* @public
|
|
47
|
+
* @interface CredentialStatusResolverRegistry
|
|
48
|
+
*/
|
|
49
|
+
export declare class CredentialStatusResolverRegistry {
|
|
50
|
+
private resolvers;
|
|
51
|
+
/**
|
|
52
|
+
* register is a method to add a credential status resolver for specific credential status type
|
|
53
|
+
*
|
|
54
|
+
* @public
|
|
55
|
+
* @param {CredentialStatusType} type - one of the credential status types
|
|
56
|
+
* @param {CredentialStatusResolver} resolver - resolver
|
|
57
|
+
*/
|
|
58
|
+
register(type: CredentialStatusType, resolver: CredentialStatusResolver): void;
|
|
59
|
+
/**
|
|
60
|
+
* resolve is a method to resolve a credential status from the the specific source.
|
|
61
|
+
*
|
|
62
|
+
* @public
|
|
63
|
+
* @param {CredentialStatus} credentialStatus - credential status to resolve
|
|
64
|
+
* @param {CredentialStatusResolveOptions} credentialStatusResolveOptions - options for resolver
|
|
65
|
+
* @returns `{Promise<RevocationStatus>}`
|
|
66
|
+
*/
|
|
67
|
+
get(type: CredentialStatusType): CredentialStatusResolver | undefined;
|
|
68
|
+
}
|
|
69
|
+
//# sourceMappingURL=resolver.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"resolver.d.ts","sourceRoot":"","sources":["../../../../src/credentials/status/resolver.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,GAAG,EAAE,MAAM,yBAAyB,CAAC;AAC9C,OAAO,EAAE,KAAK,EAAE,gBAAgB,EAAE,gBAAgB,EAAE,oBAAoB,EAAE,MAAM,kBAAkB,CAAC;AAEnG;;;;;GAKG;AACH,MAAM,WAAW,8BAA8B;IAC7C;;MAEE;IACF,UAAU,CAAC,EAAE;QACX,KAAK,EAAE;YACL,WAAW,EAAE,MAAM,CAAC;YACpB,cAAc,EAAE,MAAM,CAAC;YACvB,kBAAkB,EAAE,MAAM,CAAC;YAC3B,KAAK,EAAE,MAAM,CAAC;SACf,CAAC;KACH,CAAC;IAEF,kBAAkB,CAAC,EAAE,KAAK,CAAC;IAC3B,SAAS,CAAC,EAAE,GAAG,CAAC;IAChB,OAAO,CAAC,EAAE,GAAG,CAAC;CACf;AAED;;;;;;GAMG;AACH,MAAM,WAAW,wBAAwB;IACvC;;;;;;;OAOG;IACH,OAAO,CACL,gBAAgB,EAAE,gBAAgB,EAClC,IAAI,CAAC,EAAE,8BAA8B,GACpC,OAAO,CAAC,gBAAgB,CAAC,CAAC;CAC9B;AAED;;;;;GAKG;AACH,qBAAa,gCAAgC;IAC3C,OAAO,CAAC,SAAS,CAAkE;IAEnF;;;;;;OAMG;IACH,QAAQ,CAAC,IAAI,EAAE,oBAAoB,EAAE,QAAQ,EAAE,wBAAwB;IAIvE;;;;;;;OAOG;IACH,GAAG,CAAC,IAAI,EAAE,oBAAoB,GAAG,wBAAwB,GAAG,SAAS;CAGtE"}
|
|
@@ -0,0 +1,126 @@
|
|
|
1
|
+
import { Hash, Proof } from '@iden3/js-merkletree';
|
|
2
|
+
import { IStateStorage } from '../../storage';
|
|
3
|
+
import { CredentialStatusResolver, CredentialStatusResolveOptions } from './resolver';
|
|
4
|
+
import { CredentialStatus, RevocationStatus } from '../../verifiable';
|
|
5
|
+
/**
|
|
6
|
+
* ProofNode is a partial Reverse Hash Service result
|
|
7
|
+
* it contains the current node hash and its children
|
|
8
|
+
*
|
|
9
|
+
* @public
|
|
10
|
+
* @class ProofNode
|
|
11
|
+
*/
|
|
12
|
+
export declare class ProofNode {
|
|
13
|
+
hash: Hash;
|
|
14
|
+
children: Hash[];
|
|
15
|
+
/**
|
|
16
|
+
*
|
|
17
|
+
* Creates an instance of ProofNode.
|
|
18
|
+
* @param {Hash} [hash=ZERO_HASH] - current node hash
|
|
19
|
+
* @param {Hash[]} [children=[]] - children of the node
|
|
20
|
+
*/
|
|
21
|
+
constructor(hash?: Hash, children?: Hash[]);
|
|
22
|
+
/**
|
|
23
|
+
* Determination of Node type
|
|
24
|
+
* Can be: Leaf, Middle or State node
|
|
25
|
+
*
|
|
26
|
+
* @returns NodeType
|
|
27
|
+
*/
|
|
28
|
+
nodeType(): NodeType;
|
|
29
|
+
/**
|
|
30
|
+
* JSON Representation of ProofNode with a hex values
|
|
31
|
+
*
|
|
32
|
+
* @returns {*} - ProofNode with hexes
|
|
33
|
+
*/
|
|
34
|
+
toJSON(): {
|
|
35
|
+
hash: string;
|
|
36
|
+
children: string[];
|
|
37
|
+
};
|
|
38
|
+
/**
|
|
39
|
+
* Creates ProofNode Hashes from hex values
|
|
40
|
+
*
|
|
41
|
+
* @static
|
|
42
|
+
* @param {ProofNodeHex} hexNode
|
|
43
|
+
* @returns ProofNode
|
|
44
|
+
*/
|
|
45
|
+
static fromHex(hexNode: ProofNodeHex): ProofNode;
|
|
46
|
+
}
|
|
47
|
+
interface ProofNodeHex {
|
|
48
|
+
hash: string;
|
|
49
|
+
children: string[];
|
|
50
|
+
}
|
|
51
|
+
declare enum NodeType {
|
|
52
|
+
Unknown = 0,
|
|
53
|
+
Middle = 1,
|
|
54
|
+
Leaf = 2,
|
|
55
|
+
State = 3
|
|
56
|
+
}
|
|
57
|
+
/**
|
|
58
|
+
* RHSResolver is a class that allows to interact with the RHS service to get revocation status.
|
|
59
|
+
*
|
|
60
|
+
* @public
|
|
61
|
+
* @class RHSResolver
|
|
62
|
+
*/
|
|
63
|
+
export declare class RHSResolver implements CredentialStatusResolver {
|
|
64
|
+
private readonly _state;
|
|
65
|
+
constructor(_state: IStateStorage);
|
|
66
|
+
/**
|
|
67
|
+
* resolve is a method to resolve a credential status from the blockchain.
|
|
68
|
+
*
|
|
69
|
+
* @public
|
|
70
|
+
* @param {CredentialStatus} credentialStatus - credential status to resolve
|
|
71
|
+
* @param {CredentialStatusResolveOptions} credentialStatusResolveOptions - options for resolver
|
|
72
|
+
* @returns `{Promise<RevocationStatus>}`
|
|
73
|
+
*/
|
|
74
|
+
resolve(credentialStatus: CredentialStatus, credentialStatusResolveOptions?: CredentialStatusResolveOptions): Promise<RevocationStatus>;
|
|
75
|
+
/**
|
|
76
|
+
* Gets revocation status from rhs service.
|
|
77
|
+
* @param {CredentialStatus} credentialStatus
|
|
78
|
+
* @param {DID} issuerDID
|
|
79
|
+
* @param {IssuerData} issuerData
|
|
80
|
+
* @returns Promise<RevocationStatus>
|
|
81
|
+
*/
|
|
82
|
+
private getStatus;
|
|
83
|
+
/**
|
|
84
|
+
* Extract revocation status from issuer data.
|
|
85
|
+
* @param {DID} issuerDID
|
|
86
|
+
* @param {IssuerData} issuerData
|
|
87
|
+
*/
|
|
88
|
+
private getRevocationStatusFromIssuerData;
|
|
89
|
+
/**
|
|
90
|
+
* Gets partial revocation status info from rhs service.
|
|
91
|
+
*
|
|
92
|
+
* @param {Hash} data - hash to fetch
|
|
93
|
+
* @param {Hash} issuerRoot - issuer root which is a part of url
|
|
94
|
+
* @param {string} rhsUrl - base URL for reverse hash service
|
|
95
|
+
* @returns Promise<RevocationStatus>
|
|
96
|
+
*/
|
|
97
|
+
private getRevocationStatusFromRHS;
|
|
98
|
+
rhsGenerateProof(treeRoot: Hash, key: Hash, rhsUrl: string): Promise<Proof>;
|
|
99
|
+
/**
|
|
100
|
+
* Get state param from rhs url
|
|
101
|
+
* @param {string} id
|
|
102
|
+
* @returns string | null
|
|
103
|
+
*/
|
|
104
|
+
private extractState;
|
|
105
|
+
}
|
|
106
|
+
/**
|
|
107
|
+
* @deprecated The method should not be used. Use isGenesisState instead.
|
|
108
|
+
* Checks if issuer did is created from given state is genesis
|
|
109
|
+
*
|
|
110
|
+
* @param {string} issuer - did (string)
|
|
111
|
+
* @param {string} state - hex state
|
|
112
|
+
* @returns boolean
|
|
113
|
+
*/
|
|
114
|
+
export declare function isIssuerGenesis(issuer: string, state: string): boolean;
|
|
115
|
+
/**
|
|
116
|
+
* @deprecated The method should not be used. Use isGenesisState instead.
|
|
117
|
+
* Checks if id is created from given state and type is genesis
|
|
118
|
+
*
|
|
119
|
+
* @param {bigint} id
|
|
120
|
+
* @param {bigint} state
|
|
121
|
+
* @param {Uint8Array} type
|
|
122
|
+
* @returns boolean - returns if id is genesis
|
|
123
|
+
*/
|
|
124
|
+
export declare function isGenesisStateId(id: bigint, state: bigint, type: Uint8Array): boolean;
|
|
125
|
+
export {};
|
|
126
|
+
//# sourceMappingURL=reverse-sparse-merkle-tree.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"reverse-sparse-merkle-tree.d.ts","sourceRoot":"","sources":["../../../../src/credentials/status/reverse-sparse-merkle-tree.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,IAAI,EAAE,KAAK,EAA+B,MAAM,sBAAsB,CAAC;AAChF,OAAO,EAAE,aAAa,EAAE,MAAM,eAAe,CAAC;AAC9C,OAAO,EAAE,wBAAwB,EAAE,8BAA8B,EAAE,MAAM,YAAY,CAAC;AACtF,OAAO,EAAE,gBAAgB,EAAE,gBAAgB,EAAS,MAAM,kBAAkB,CAAC;AAM7E;;;;;;GAMG;AACH,qBAAa,SAAS;IAOD,IAAI,EAAE,IAAI;IAAqB,QAAQ,EAAE,IAAI,EAAE;IANlE;;;;;OAKG;gBACgB,IAAI,GAAE,IAAgB,EAAS,QAAQ,GAAE,IAAI,EAAO;IAEvE;;;;;OAKG;IACH,QAAQ,IAAI,QAAQ;IAepB;;;;OAIG;IACH,MAAM;;;;IAMN;;;;;;OAMG;IACH,MAAM,CAAC,OAAO,CAAC,OAAO,EAAE,YAAY,GAAG,SAAS;CAMjD;AAED,UAAU,YAAY;IACpB,IAAI,EAAE,MAAM,CAAC;IACb,QAAQ,EAAE,MAAM,EAAE,CAAC;CACpB;AAOD,aAAK,QAAQ;IACX,OAAO,IAAI;IACX,MAAM,IAAI;IACV,IAAI,IAAI;IACR,KAAK,IAAI;CACV;AAED;;;;;GAKG;AACH,qBAAa,WAAY,YAAW,wBAAwB;IAC9C,OAAO,CAAC,QAAQ,CAAC,MAAM;gBAAN,MAAM,EAAE,aAAa;IAElD;;;;;;;OAOG;IACG,OAAO,CACX,gBAAgB,EAAE,gBAAgB,EAClC,8BAA8B,CAAC,EAAE,8BAA8B,GAC9D,OAAO,CAAC,gBAAgB,CAAC;IA0B5B;;;;;;OAMG;YACW,SAAS;IAqDvB;;;;OAIG;IACH,OAAO,CAAC,iCAAiC;IAuCzC;;;;;;;OAOG;YACW,0BAA0B;IA8BlC,gBAAgB,CAAC,QAAQ,EAAE,IAAI,EAAE,GAAG,EAAE,IAAI,EAAE,MAAM,EAAE,MAAM,GAAG,OAAO,CAAC,KAAK,CAAC;IA6CjF;;;;OAIG;IACH,OAAO,CAAC,YAAY;CAIrB;AAED;;;;;;;GAOG;AACH,wBAAgB,eAAe,CAAC,MAAM,EAAE,MAAM,EAAE,KAAK,EAAE,MAAM,GAAG,OAAO,CAQtE;AAED;;;;;;;;GAQG;AACH,wBAAgB,gBAAgB,CAAC,EAAE,EAAE,MAAM,EAAE,KAAK,EAAE,MAAM,EAAE,IAAI,EAAE,UAAU,GAAG,OAAO,CAGrF"}
|
|
@@ -0,0 +1,38 @@
|
|
|
1
|
+
import { CredentialStatus, RevocationStatus, Issuer } from '../../verifiable';
|
|
2
|
+
import { CredentialStatusResolver } from './resolver';
|
|
3
|
+
import { ProofJSON } from '@iden3/js-merkletree';
|
|
4
|
+
/**
|
|
5
|
+
* IssuerResolver is a class that allows to interact with the issuer's http endpoint to get revocation status.
|
|
6
|
+
*
|
|
7
|
+
* @public
|
|
8
|
+
* @class IssuerResolver
|
|
9
|
+
*/
|
|
10
|
+
export declare class IssuerResolver implements CredentialStatusResolver {
|
|
11
|
+
/**
|
|
12
|
+
* resolve is a method to resolve a credential status directly from the issuer.
|
|
13
|
+
*
|
|
14
|
+
* @public
|
|
15
|
+
* @param {CredentialStatus} credentialStatus - credential status to resolve
|
|
16
|
+
* @param {CredentialStatusResolveOptions} credentialStatusResolveOptions - options for resolver
|
|
17
|
+
* @returns `{Promise<RevocationStatus>}`
|
|
18
|
+
*/
|
|
19
|
+
resolve(credentialStatus: CredentialStatus): Promise<RevocationStatus>;
|
|
20
|
+
}
|
|
21
|
+
/**
|
|
22
|
+
* RevocationStatusResponse is a response of fetching credential status with type SparseMerkleTreeProof
|
|
23
|
+
*
|
|
24
|
+
* @export
|
|
25
|
+
* @interface RevocationStatusResponse
|
|
26
|
+
*/
|
|
27
|
+
export interface RevocationStatusResponse {
|
|
28
|
+
issuer: Issuer;
|
|
29
|
+
mtp: ProofJSON;
|
|
30
|
+
}
|
|
31
|
+
/**
|
|
32
|
+
* toRevocationStatus is a result of fetching credential status with type SparseMerkleTreeProof converts to RevocationStatus
|
|
33
|
+
*
|
|
34
|
+
* @param {RevocationStatusResponse} { issuer, mtp }
|
|
35
|
+
* @returns {RevocationStatus} RevocationStatus
|
|
36
|
+
*/
|
|
37
|
+
export declare const toRevocationStatus: ({ issuer, mtp }: RevocationStatusResponse) => RevocationStatus;
|
|
38
|
+
//# sourceMappingURL=sparse-merkle-tree.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"sparse-merkle-tree.d.ts","sourceRoot":"","sources":["../../../../src/credentials/status/sparse-merkle-tree.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,gBAAgB,EAAE,gBAAgB,EAAE,MAAM,EAAE,MAAM,kBAAkB,CAAC;AAC9E,OAAO,EAAE,wBAAwB,EAAE,MAAM,YAAY,CAAC;AACtD,OAAO,EAAS,SAAS,EAAE,MAAM,sBAAsB,CAAC;AAExD;;;;;GAKG;AAEH,qBAAa,cAAe,YAAW,wBAAwB;IAC7D;;;;;;;OAOG;IACG,OAAO,CAAC,gBAAgB,EAAE,gBAAgB,GAAG,OAAO,CAAC,gBAAgB,CAAC;CAK7E;AAED;;;;;GAKG;AACH,MAAM,WAAW,wBAAwB;IACvC,MAAM,EAAE,MAAM,CAAC;IACf,GAAG,EAAE,SAAS,CAAC;CAChB;AAED;;;;;GAKG;AACH,eAAO,MAAM,kBAAkB,GAAI,iBAAiB,wBAAwB,KAAG,gBAK9E,CAAC"}
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
import { DID } from '@mocanetwork/moca-iden3';
|
|
2
|
+
import { W3CCredential } from '../verifiable';
|
|
3
|
+
import { KmsKeyId } from '../kms';
|
|
4
|
+
/**
|
|
5
|
+
* Retrieves the user DID from a given credential.
|
|
6
|
+
* If the credential does not have a credentialSubject.id property, the issuer DID is returned.
|
|
7
|
+
* If the credentialSubject.id is not a string, an error is thrown.
|
|
8
|
+
* @param issuerDID The DID of the issuer.
|
|
9
|
+
* @param credential The credential object.
|
|
10
|
+
* @returns The user DID parsed from the credential.
|
|
11
|
+
* @throws Error if the credentialSubject.id is not a string.
|
|
12
|
+
*/
|
|
13
|
+
export declare const getUserDIDFromCredential: (issuerDID: DID, credential: W3CCredential) => DID;
|
|
14
|
+
export declare const getKMSIdByAuthCredential: (credential: W3CCredential) => KmsKeyId;
|
|
15
|
+
//# sourceMappingURL=utils.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"utils.d.ts","sourceRoot":"","sources":["../../../src/credentials/utils.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,GAAG,EAAE,MAAM,yBAAyB,CAAC;AAC9C,OAAO,EAAE,aAAa,EAAE,MAAM,eAAe,CAAC;AAE9C,OAAO,EAAE,QAAQ,EAAuB,MAAM,QAAQ,CAAC;AAEvD;;;;;;;;GAQG;AACH,eAAO,MAAM,wBAAwB,GAAI,WAAW,GAAG,EAAE,YAAY,aAAa,QASjF,CAAC;AAEF,eAAO,MAAM,wBAAwB,GAAI,YAAY,aAAa,KAAG,QAUpE,CAAC"}
|
|
@@ -0,0 +1,61 @@
|
|
|
1
|
+
import { AcceptProfile } from './types';
|
|
2
|
+
/**
|
|
3
|
+
* Constants for Iden3 protocol
|
|
4
|
+
*/
|
|
5
|
+
export declare const PROTOCOL_MESSAGE_TYPE: Readonly<{
|
|
6
|
+
AUTHORIZATION_REQUEST_MESSAGE_TYPE: "https://iden3-communication.io/authorization/1.0/request";
|
|
7
|
+
AUTHORIZATION_RESPONSE_MESSAGE_TYPE: "https://iden3-communication.io/authorization/1.0/response";
|
|
8
|
+
CREDENTIAL_ISSUANCE_REQUEST_MESSAGE_TYPE: "https://iden3-communication.io/credentials/1.0/issuance-request";
|
|
9
|
+
CREDENTIAL_FETCH_REQUEST_MESSAGE_TYPE: "https://iden3-communication.io/credentials/1.0/fetch-request";
|
|
10
|
+
CREDENTIAL_OFFER_MESSAGE_TYPE: "https://iden3-communication.io/credentials/1.0/offer";
|
|
11
|
+
CREDENTIAL_ISSUANCE_RESPONSE_MESSAGE_TYPE: "https://iden3-communication.io/credentials/1.0/issuance-response";
|
|
12
|
+
CREDENTIAL_REFRESH_MESSAGE_TYPE: "https://iden3-communication.io/credentials/1.0/refresh";
|
|
13
|
+
DEVICE_REGISTRATION_REQUEST_MESSAGE_TYPE: "https://iden3-communication.io/devices/1.0/registration";
|
|
14
|
+
MESSAGE_FETCH_REQUEST_MESSAGE_TYPE: "https://iden3-communication.io/messages/1.0/fetch";
|
|
15
|
+
PROOF_GENERATION_REQUEST_MESSAGE_TYPE: "https://iden3-communication.io/proofs/1.0/request";
|
|
16
|
+
PROOF_GENERATION_RESPONSE_MESSAGE_TYPE: "https://iden3-communication.io/proofs/1.0/response";
|
|
17
|
+
REVOCATION_STATUS_REQUEST_MESSAGE_TYPE: "https://iden3-communication.io/revocation/1.0/request-status";
|
|
18
|
+
REVOCATION_STATUS_RESPONSE_MESSAGE_TYPE: "https://iden3-communication.io/revocation/1.0/status";
|
|
19
|
+
CONTRACT_INVOKE_REQUEST_MESSAGE_TYPE: "https://iden3-communication.io/proofs/1.0/contract-invoke-request";
|
|
20
|
+
CONTRACT_INVOKE_RESPONSE_MESSAGE_TYPE: "https://iden3-communication.io/proofs/1.0/contract-invoke-response";
|
|
21
|
+
CREDENTIAL_ONCHAIN_OFFER_MESSAGE_TYPE: "https://iden3-communication.io/credentials/1.0/onchain-offer";
|
|
22
|
+
PROPOSAL_REQUEST_MESSAGE_TYPE: "https://iden3-communication.io/credentials/0.1/proposal-request";
|
|
23
|
+
PROPOSAL_MESSAGE_TYPE: "https://iden3-communication.io/credentials/0.1/proposal";
|
|
24
|
+
PAYMENT_REQUEST_MESSAGE_TYPE: "https://iden3-communication.io/credentials/0.1/payment-request";
|
|
25
|
+
PAYMENT_MESSAGE_TYPE: "https://iden3-communication.io/credentials/0.1/payment";
|
|
26
|
+
DISCOVERY_PROTOCOL_QUERIES_MESSAGE_TYPE: "https://didcomm.org/discover-features/2.0/queries";
|
|
27
|
+
DISCOVERY_PROTOCOL_DISCLOSE_MESSAGE_TYPE: "https://didcomm.org/discover-features/2.0/disclose";
|
|
28
|
+
PROBLEM_REPORT_MESSAGE_TYPE: "https://didcomm.org/report-problem/2.0/problem-report";
|
|
29
|
+
}>;
|
|
30
|
+
/**
|
|
31
|
+
* Media types for iden3 comm communication protocol
|
|
32
|
+
*
|
|
33
|
+
* @enum {number}
|
|
34
|
+
*/
|
|
35
|
+
export declare enum MediaType {
|
|
36
|
+
ZKPMessage = "application/iden3-zkp-json",
|
|
37
|
+
PlainMessage = "application/iden3comm-plain-json",
|
|
38
|
+
SignedMessage = "application/iden3comm-signed-json"
|
|
39
|
+
}
|
|
40
|
+
export declare const SUPPORTED_PUBLIC_KEY_TYPES: {
|
|
41
|
+
ES256K: string[];
|
|
42
|
+
'ES256K-R': string[];
|
|
43
|
+
};
|
|
44
|
+
export declare enum ProtocolVersion {
|
|
45
|
+
V1 = "iden3comm/v1"
|
|
46
|
+
}
|
|
47
|
+
export declare enum AcceptAuthCircuits {
|
|
48
|
+
AuthV2 = "authV2",
|
|
49
|
+
AuthV3 = "authV3"
|
|
50
|
+
}
|
|
51
|
+
export declare enum AcceptJwzAlgorithms {
|
|
52
|
+
Groth16 = "groth16"
|
|
53
|
+
}
|
|
54
|
+
export declare enum AcceptJwsAlgorithms {
|
|
55
|
+
ES256K = "ES256K",
|
|
56
|
+
ES256KR = "ES256K-R"
|
|
57
|
+
}
|
|
58
|
+
export declare const defaultAcceptProfile: AcceptProfile;
|
|
59
|
+
export declare const DEFAULT_PROOF_VERIFY_DELAY: number;
|
|
60
|
+
export declare const DEFAULT_AUTH_VERIFY_DELAY: number;
|
|
61
|
+
//# sourceMappingURL=constants.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"constants.d.ts","sourceRoot":"","sources":["../../../src/iden3comm/constants.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,aAAa,EAAE,MAAM,SAAS,CAAC;AAIxC;;GAEG;AACH,eAAO,MAAM,qBAAqB;;;;;;;;;;;;;;;;;;;;;;;;EAqDhC,CAAC;AAEH;;;;GAIG;AACH,oBAAY,SAAS;IACnB,UAAU,+BAA+B;IACzC,YAAY,qCAAqC;IACjD,aAAa,sCAAsC;CACpD;AAED,eAAO,MAAM,0BAA0B;;;CAiBtC,CAAC;AAEF,oBAAY,eAAe;IACzB,EAAE,iBAAiB;CACpB;AAED,oBAAY,kBAAkB;IAC5B,MAAM,WAAW;IACjB,MAAM,WAAW;CAClB;AAED,oBAAY,mBAAmB;IAC7B,OAAO,YAAY;CACpB;AAED,oBAAY,mBAAmB;IAC7B,MAAM,WAAW;IACjB,OAAO,aAAa;CACrB;AAED,eAAO,MAAM,oBAAoB,EAAE,aAKlC,CAAC;AAEF,eAAO,MAAM,0BAA0B,QAAqB,CAAC;AAC7D,eAAO,MAAM,yBAAyB,QAAgB,CAAC"}
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
export declare const ErrNotProtocolMessage = "the envelope is not a protocol message";
|
|
2
|
+
export declare const ErrNotEnvelopeStub = "the envelope doesn't contain field protected";
|
|
3
|
+
export declare const ErrNotHeaderStub = "the envelope doesn't contain field typ";
|
|
4
|
+
export declare const ErrUnknownCircuitID = "unknown circuit ID. can't verify msg sender";
|
|
5
|
+
export declare const ErrSenderNotUsedTokenCreation = "sender of message is not used for jwz token creation";
|
|
6
|
+
export declare const ErrPackedWithUnsupportedCircuit = "message was packed with unsupported circuit";
|
|
7
|
+
export declare const ErrProofIsInvalid = "message proof is invalid";
|
|
8
|
+
export declare const ErrStateVerificationFailed = "message state verification failed";
|
|
9
|
+
export declare const ErrNoProvingMethodAlg = "unknown proving method algorithm";
|
|
10
|
+
//# sourceMappingURL=errors.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"errors.d.ts","sourceRoot":"","sources":["../../../src/iden3comm/errors.ts"],"names":[],"mappings":"AACA,eAAO,MAAM,qBAAqB,2CAA2C,CAAC;AAC9E,eAAO,MAAM,kBAAkB,iDAAiD,CAAC;AACjF,eAAO,MAAM,gBAAgB,2CAA2C,CAAC;AAGzE,eAAO,MAAM,mBAAmB,gDAAgD,CAAC;AACjF,eAAO,MAAM,6BAA6B,yDAAyD,CAAC;AAGpG,eAAO,MAAM,+BAA+B,gDAAgD,CAAC;AAC7F,eAAO,MAAM,iBAAiB,6BAA6B,CAAC;AAC5D,eAAO,MAAM,0BAA0B,sCAAsC,CAAC;AAC9E,eAAO,MAAM,qBAAqB,qCAAqC,CAAC"}
|
|
@@ -0,0 +1,157 @@
|
|
|
1
|
+
import { MediaType } from '../constants';
|
|
2
|
+
import { IProofService } from '../../proof/proof-service';
|
|
3
|
+
import { StateVerificationOpts, AuthorizationRequestMessage, AuthorizationResponseMessage, BasicMessage, IPackageManager, JWSPackerParams, ZeroKnowledgeProofRequest, Attachment } from '../types';
|
|
4
|
+
import { DID } from '@mocanetwork/moca-iden3';
|
|
5
|
+
import { AbstractMessageHandler, BasicHandlerOptions, IProtocolMessageHandler } from './message-handler';
|
|
6
|
+
/**
|
|
7
|
+
* Options to pass to createAuthorizationRequest function
|
|
8
|
+
* @public
|
|
9
|
+
*/
|
|
10
|
+
export type AuthorizationRequestCreateOptions = {
|
|
11
|
+
accept?: string[];
|
|
12
|
+
scope?: ZeroKnowledgeProofRequest[];
|
|
13
|
+
expires_time?: Date;
|
|
14
|
+
attachments?: Attachment[];
|
|
15
|
+
};
|
|
16
|
+
/**
|
|
17
|
+
* createAuthorizationRequest is a function to create protocol authorization request
|
|
18
|
+
* @param {string} reason - reason to request proof
|
|
19
|
+
* @param {string} sender - sender did
|
|
20
|
+
* @param {string} callbackUrl - callback that user should use to send response
|
|
21
|
+
* @param {AuthorizationRequestCreateOptions} opts - authorization request options
|
|
22
|
+
* @returns `Promise<AuthorizationRequestMessage>`
|
|
23
|
+
*/
|
|
24
|
+
export declare function createAuthorizationRequest(reason: string, sender: string, callbackUrl: string, opts?: AuthorizationRequestCreateOptions): AuthorizationRequestMessage;
|
|
25
|
+
/**
|
|
26
|
+
* createAuthorizationRequestWithMessage is a function to create protocol authorization request with explicit message to sign
|
|
27
|
+
* @param {string} reason - reason to request proof
|
|
28
|
+
* @param {string} message - message to sign in the response
|
|
29
|
+
* @param {string} sender - sender did
|
|
30
|
+
* @param {string} callbackUrl - callback that user should use to send response
|
|
31
|
+
* @param {AuthorizationRequestCreateOptions} opts - authorization request options
|
|
32
|
+
* @returns `Promise<AuthorizationRequestMessage>`
|
|
33
|
+
*/
|
|
34
|
+
export declare function createAuthorizationRequestWithMessage(reason: string, message: string, sender: string, callbackUrl: string, opts?: AuthorizationRequestCreateOptions): AuthorizationRequestMessage;
|
|
35
|
+
/**
|
|
36
|
+
*
|
|
37
|
+
* Options to pass to auth response handler
|
|
38
|
+
*
|
|
39
|
+
* @public
|
|
40
|
+
*/
|
|
41
|
+
export type AuthResponseHandlerOptions = StateVerificationOpts & BasicHandlerOptions & {
|
|
42
|
+
acceptedProofGenerationDelay?: number;
|
|
43
|
+
};
|
|
44
|
+
/**
|
|
45
|
+
* Interface that allows the processing of the authorization request in the raw format for given identifier
|
|
46
|
+
*
|
|
47
|
+
* @public
|
|
48
|
+
* @interface IAuthHandler
|
|
49
|
+
*/
|
|
50
|
+
export interface IAuthHandler {
|
|
51
|
+
/**
|
|
52
|
+
* unpacks authorization request
|
|
53
|
+
* @public
|
|
54
|
+
* @param {Uint8Array} request - raw byte message
|
|
55
|
+
* @returns `Promise<AuthorizationRequestMessage>`
|
|
56
|
+
*/
|
|
57
|
+
parseAuthorizationRequest(request: Uint8Array): Promise<AuthorizationRequestMessage>;
|
|
58
|
+
/**
|
|
59
|
+
* unpacks authorization request
|
|
60
|
+
* @public
|
|
61
|
+
* @param {did} did - sender DID
|
|
62
|
+
* @param {Uint8Array} request - raw byte message
|
|
63
|
+
* @returns `Promise<{
|
|
64
|
+
token: string;
|
|
65
|
+
authRequest: AuthorizationRequestMessage;
|
|
66
|
+
authResponse: AuthorizationResponseMessage;
|
|
67
|
+
}>`
|
|
68
|
+
*/
|
|
69
|
+
handleAuthorizationRequest(did: DID, request: Uint8Array, opts?: AuthHandlerOptions): Promise<{
|
|
70
|
+
token: string;
|
|
71
|
+
authRequest: AuthorizationRequestMessage;
|
|
72
|
+
authResponse: AuthorizationResponseMessage;
|
|
73
|
+
}>;
|
|
74
|
+
/**
|
|
75
|
+
* handle authorization response
|
|
76
|
+
* @public
|
|
77
|
+
* @param {AuthorizationResponseMessage} response - auth response
|
|
78
|
+
* @param {AuthorizationRequestMessage} request - auth request
|
|
79
|
+
* @param {AuthResponseHandlerOptions} opts - options
|
|
80
|
+
* @returns `Promise<{
|
|
81
|
+
request: AuthorizationRequestMessage;
|
|
82
|
+
response: AuthorizationResponseMessage;
|
|
83
|
+
}>`
|
|
84
|
+
*/
|
|
85
|
+
handleAuthorizationResponse(response: AuthorizationResponseMessage, request: AuthorizationRequestMessage, opts?: AuthResponseHandlerOptions): Promise<{
|
|
86
|
+
request: AuthorizationRequestMessage;
|
|
87
|
+
response: AuthorizationResponseMessage;
|
|
88
|
+
}>;
|
|
89
|
+
}
|
|
90
|
+
type AuthReqOptions = {
|
|
91
|
+
senderDid: DID;
|
|
92
|
+
mediaType?: MediaType;
|
|
93
|
+
};
|
|
94
|
+
type AuthRespOptions = {
|
|
95
|
+
request: AuthorizationRequestMessage;
|
|
96
|
+
acceptedStateTransitionDelay?: number;
|
|
97
|
+
acceptedProofGenerationDelay?: number;
|
|
98
|
+
};
|
|
99
|
+
export type AuthMessageHandlerOptions = AuthReqOptions | AuthRespOptions;
|
|
100
|
+
/**
|
|
101
|
+
*
|
|
102
|
+
* Options to pass to auth handler
|
|
103
|
+
*
|
|
104
|
+
* @public
|
|
105
|
+
* @interface AuthHandlerOptions
|
|
106
|
+
*/
|
|
107
|
+
export type AuthHandlerOptions = BasicHandlerOptions & {
|
|
108
|
+
mediaType: MediaType;
|
|
109
|
+
packerOptions?: JWSPackerParams;
|
|
110
|
+
};
|
|
111
|
+
/**
|
|
112
|
+
*
|
|
113
|
+
* Allows to process AuthorizationRequest protocol message and produce JWZ response.
|
|
114
|
+
*
|
|
115
|
+
* @public
|
|
116
|
+
|
|
117
|
+
* @class AuthHandler
|
|
118
|
+
* @implements implements IAuthHandler interface
|
|
119
|
+
*/
|
|
120
|
+
export declare class AuthHandler extends AbstractMessageHandler implements IAuthHandler, IProtocolMessageHandler {
|
|
121
|
+
private readonly _packerMgr;
|
|
122
|
+
private readonly _proofService;
|
|
123
|
+
private readonly _supportedCircuits;
|
|
124
|
+
/**
|
|
125
|
+
* Creates an instance of AuthHandler.
|
|
126
|
+
* @param {IPackageManager} _packerMgr - package manager to unpack message envelope
|
|
127
|
+
* @param {IProofService} _proofService - proof service to verify zk proofs
|
|
128
|
+
*
|
|
129
|
+
*/
|
|
130
|
+
constructor(_packerMgr: IPackageManager, _proofService: IProofService);
|
|
131
|
+
handle(message: BasicMessage, ctx: AuthMessageHandlerOptions): Promise<BasicMessage | null>;
|
|
132
|
+
/**
|
|
133
|
+
* @inheritdoc IAuthHandler#parseAuthorizationRequest
|
|
134
|
+
*/
|
|
135
|
+
parseAuthorizationRequest(request: Uint8Array): Promise<AuthorizationRequestMessage>;
|
|
136
|
+
private handleAuthRequest;
|
|
137
|
+
/**
|
|
138
|
+
* @inheritdoc IAuthHandler#handleAuthorizationRequest
|
|
139
|
+
*/
|
|
140
|
+
handleAuthorizationRequest(did: DID, request: Uint8Array, opts?: AuthHandlerOptions): Promise<{
|
|
141
|
+
token: string;
|
|
142
|
+
authRequest: AuthorizationRequestMessage;
|
|
143
|
+
authResponse: AuthorizationResponseMessage;
|
|
144
|
+
}>;
|
|
145
|
+
private handleAuthResponse;
|
|
146
|
+
/**
|
|
147
|
+
* @inheritdoc IAuthHandler#handleAuthorizationResponse
|
|
148
|
+
*/
|
|
149
|
+
handleAuthorizationResponse(response: AuthorizationResponseMessage, request: AuthorizationRequestMessage, opts?: AuthResponseHandlerOptions | undefined): Promise<{
|
|
150
|
+
request: AuthorizationRequestMessage;
|
|
151
|
+
response: AuthorizationResponseMessage;
|
|
152
|
+
}>;
|
|
153
|
+
private verifyAuthRequest;
|
|
154
|
+
private getSupportedMediaTypeByProfile;
|
|
155
|
+
}
|
|
156
|
+
export {};
|
|
157
|
+
//# sourceMappingURL=auth.d.ts.map
|