@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,353 @@
|
|
|
1
|
+
import { DID } from '@mocanetwork/moca-iden3';
|
|
2
|
+
import { IDataStorage } from '../storage/interfaces';
|
|
3
|
+
import {
|
|
4
|
+
W3CCredential,
|
|
5
|
+
ProofQuery,
|
|
6
|
+
VerifiableConstants,
|
|
7
|
+
CredentialStatus,
|
|
8
|
+
RevocationStatus,
|
|
9
|
+
CredentialStatusType,
|
|
10
|
+
State,
|
|
11
|
+
DisplayMethodType
|
|
12
|
+
} from './../verifiable';
|
|
13
|
+
|
|
14
|
+
import { JSONSchema } from '../schema-processor';
|
|
15
|
+
import * as uuid from 'uuid';
|
|
16
|
+
import { CredentialStatusResolverRegistry } from './status/resolver';
|
|
17
|
+
import { IssuerResolver } from './status/sparse-merkle-tree';
|
|
18
|
+
import { AgentResolver } from './status/agent-revocation';
|
|
19
|
+
import { CredentialStatusResolveOptions } from './status/resolver';
|
|
20
|
+
import { getUserDIDFromCredential } from './utils';
|
|
21
|
+
import { CredentialRequest } from './models';
|
|
22
|
+
|
|
23
|
+
/**
|
|
24
|
+
* Interface to work with credential wallets
|
|
25
|
+
*
|
|
26
|
+
* @public
|
|
27
|
+
* @interface ICredentialWallet
|
|
28
|
+
*/
|
|
29
|
+
export interface ICredentialWallet {
|
|
30
|
+
/**
|
|
31
|
+
* List of W3C Credential
|
|
32
|
+
*
|
|
33
|
+
* @returns `Promise<W3CCredential[]`
|
|
34
|
+
*/
|
|
35
|
+
list(): Promise<W3CCredential[]>;
|
|
36
|
+
/**
|
|
37
|
+
* saves W3C credential (upsert)
|
|
38
|
+
* @param {W3CCredential} credential - credential to save
|
|
39
|
+
* @returns `Promise<void>`
|
|
40
|
+
*
|
|
41
|
+
*/
|
|
42
|
+
save(credential: W3CCredential): Promise<void>;
|
|
43
|
+
/**
|
|
44
|
+
* saves the batch of W3C credentials (upsert)
|
|
45
|
+
* @param {W3CCredential[]} credentials - credentials to save
|
|
46
|
+
* @returns `Promise<void>`
|
|
47
|
+
*/
|
|
48
|
+
saveAll(credentials: W3CCredential[]): Promise<void>;
|
|
49
|
+
|
|
50
|
+
/**
|
|
51
|
+
*
|
|
52
|
+
* removes W3C credentials from data storage
|
|
53
|
+
* @param {string} id
|
|
54
|
+
* @returns `Promise<void>`
|
|
55
|
+
*/
|
|
56
|
+
remove(id: string): Promise<void>;
|
|
57
|
+
/**
|
|
58
|
+
* Find credential using iden3 query language
|
|
59
|
+
*
|
|
60
|
+
* @param {ProofQuery} query - protocol query to find credential
|
|
61
|
+
* @returns `Promise<W3CCredential[]>`
|
|
62
|
+
*/
|
|
63
|
+
findByQuery(query: ProofQuery): Promise<W3CCredential[]>;
|
|
64
|
+
/**
|
|
65
|
+
* Finds the credential by its id
|
|
66
|
+
*
|
|
67
|
+
* @param {string} id - id of credential
|
|
68
|
+
* @returns `Promise<W3CCredential | undefined>`
|
|
69
|
+
*/
|
|
70
|
+
findById(id: string): Promise<W3CCredential | undefined>;
|
|
71
|
+
/**
|
|
72
|
+
* Finds credentials by JSON-LD schema and type
|
|
73
|
+
*
|
|
74
|
+
* @param {string} context - the URL of JSON-LD schema where type is defined
|
|
75
|
+
* @returns `Promise<W3CCredential[]>`
|
|
76
|
+
*/
|
|
77
|
+
findByContextType(context: string, type: string): Promise<W3CCredential[]>;
|
|
78
|
+
|
|
79
|
+
/**
|
|
80
|
+
* Filters given credentials with given credential subject
|
|
81
|
+
*
|
|
82
|
+
* @param {W3CCredential[]} credentials - credentials to filter
|
|
83
|
+
* @param {DID} subject - credential subject id
|
|
84
|
+
* @returns `Promise<W3CCredential[]>`
|
|
85
|
+
*/
|
|
86
|
+
filterByCredentialSubject(credentials: W3CCredential[], subject: DID): Promise<W3CCredential[]>;
|
|
87
|
+
/**
|
|
88
|
+
* Finds first non-revoked Auth BJJ credential for given user
|
|
89
|
+
*
|
|
90
|
+
* @param {DID} did - the issuer of Auth BJJ credential
|
|
91
|
+
* @returns `Promise<W3CCredential>` W3CCredential with AuthBJJCredential type
|
|
92
|
+
*/
|
|
93
|
+
getAuthBJJCredential(did: DID): Promise<W3CCredential>;
|
|
94
|
+
|
|
95
|
+
/**
|
|
96
|
+
* Finds all Auth BJJ credentials for given user
|
|
97
|
+
*
|
|
98
|
+
* @param {DID} did - the issuer of Auth BJJ credential
|
|
99
|
+
* @returns `Promise<W3CCredential[]>` W3CCredentials with AuthBJJCredential type
|
|
100
|
+
*/
|
|
101
|
+
getAllAuthBJJCredentials(did: DID): Promise<W3CCredential[]>;
|
|
102
|
+
|
|
103
|
+
/**
|
|
104
|
+
* Fetches or Builds a revocation status for a given credential
|
|
105
|
+
* Supported types for credentialStatus field: SparseMerkleTreeProof, Iden3ReverseSparseMerkleTreeProof
|
|
106
|
+
*
|
|
107
|
+
* @param {W3CCredential} cred - credential for which lib should build revocation status
|
|
108
|
+
* @returns `Promise<RevocationStatus>`
|
|
109
|
+
*/
|
|
110
|
+
getRevocationStatusFromCredential(cred: W3CCredential): Promise<RevocationStatus>;
|
|
111
|
+
/**
|
|
112
|
+
* Fetches Revocation status depended on type
|
|
113
|
+
*
|
|
114
|
+
* @param {(CredentialStatus )} credStatus - credentialStatus field of the Verifiable Credential. Supported types for credentialStatus field: SparseMerkleTreeProof, Iden3ReverseSparseMerkleTreeProof
|
|
115
|
+
* @param {CredentialStatusResolveOptions} credentialStatusResolveOptions - options to resolve credential status
|
|
116
|
+
* @returns `Promise<RevocationStatus>`
|
|
117
|
+
*/
|
|
118
|
+
getRevocationStatus(
|
|
119
|
+
credStatus: CredentialStatus,
|
|
120
|
+
credentialStatusResolveOptions?: CredentialStatusResolveOptions
|
|
121
|
+
): Promise<RevocationStatus>;
|
|
122
|
+
/**
|
|
123
|
+
* Creates a W3C verifiable Credential object
|
|
124
|
+
*
|
|
125
|
+
* @param {string} hostUrl - URL that will be used as a prefix for credential identifier
|
|
126
|
+
* @param {DID} issuer - issuer identity
|
|
127
|
+
* @param {CredentialRequest} request - specification of claim creation parameters
|
|
128
|
+
* @param {JSONSchema} schema - JSON schema for W3C Verifiable Credential
|
|
129
|
+
* @returns W3CCredential
|
|
130
|
+
*/
|
|
131
|
+
createCredential(issuer: DID, request: CredentialRequest, schema: JSONSchema): W3CCredential;
|
|
132
|
+
|
|
133
|
+
/**
|
|
134
|
+
* Finds non-revoked credential from a given list by resolving their credential status
|
|
135
|
+
*
|
|
136
|
+
* @param {W3CCredential[]} creds
|
|
137
|
+
* @returns `{Promise<{
|
|
138
|
+
* cred: W3CCredential;
|
|
139
|
+
* revStatus: RevocationStatus;
|
|
140
|
+
* }>` not revoked credential and it's revocation status
|
|
141
|
+
*/
|
|
142
|
+
findNonRevokedCredential(creds: W3CCredential[]): Promise<{
|
|
143
|
+
cred: W3CCredential;
|
|
144
|
+
revStatus: RevocationStatus;
|
|
145
|
+
}>;
|
|
146
|
+
}
|
|
147
|
+
|
|
148
|
+
/**
|
|
149
|
+
*
|
|
150
|
+
* Wallet instance is a wrapper of CRUD logic for W3C credentials,
|
|
151
|
+
* also it allows to fetch revocation statuses.
|
|
152
|
+
*
|
|
153
|
+
* @public
|
|
154
|
+
* @class CredentialWallet
|
|
155
|
+
* @implements implements ICredentialWallet interface
|
|
156
|
+
*/
|
|
157
|
+
export class CredentialWallet implements ICredentialWallet {
|
|
158
|
+
/**
|
|
159
|
+
* Creates an instance of CredentialWallet.
|
|
160
|
+
* @param {IDataStorage} _storage - data storage to access credential / identity / Merkle tree data
|
|
161
|
+
* @param {CredentialStatusResolverRegistry} _credentialStatusResolverRegistry - list of credential status resolvers
|
|
162
|
+
* if _credentialStatusResolverRegistry is not provided, default resolvers will be used
|
|
163
|
+
*/
|
|
164
|
+
constructor(
|
|
165
|
+
private readonly _storage: IDataStorage,
|
|
166
|
+
private readonly _credentialStatusResolverRegistry?: CredentialStatusResolverRegistry
|
|
167
|
+
) {
|
|
168
|
+
// if no credential status resolvers are provided
|
|
169
|
+
// register default issuer resolver
|
|
170
|
+
if (!this._credentialStatusResolverRegistry) {
|
|
171
|
+
this._credentialStatusResolverRegistry = new CredentialStatusResolverRegistry();
|
|
172
|
+
this._credentialStatusResolverRegistry.register(
|
|
173
|
+
CredentialStatusType.SparseMerkleTreeProof,
|
|
174
|
+
new IssuerResolver()
|
|
175
|
+
);
|
|
176
|
+
this._credentialStatusResolverRegistry.register(
|
|
177
|
+
CredentialStatusType.Iden3commRevocationStatusV1,
|
|
178
|
+
new AgentResolver()
|
|
179
|
+
);
|
|
180
|
+
}
|
|
181
|
+
}
|
|
182
|
+
|
|
183
|
+
/**
|
|
184
|
+
* {@inheritDoc ICredentialWallet.getAuthBJJCredential}
|
|
185
|
+
*/
|
|
186
|
+
async getAuthBJJCredential(did: DID): Promise<W3CCredential> {
|
|
187
|
+
// filter where the issuer of auth credential is given did
|
|
188
|
+
|
|
189
|
+
const authBJJCredsOfIssuer = await this._storage.credential.findCredentialsByQuery({
|
|
190
|
+
context: VerifiableConstants.AUTH.AUTH_BJJ_CREDENTIAL_SCHEMA_JSONLD_URL,
|
|
191
|
+
type: VerifiableConstants.AUTH.AUTH_BJJ_CREDENTIAL_TYPE,
|
|
192
|
+
allowedIssuers: [did.string()]
|
|
193
|
+
});
|
|
194
|
+
|
|
195
|
+
if (!authBJJCredsOfIssuer.length) {
|
|
196
|
+
throw new Error(VerifiableConstants.ERRORS.NO_AUTH_CRED_FOUND);
|
|
197
|
+
}
|
|
198
|
+
|
|
199
|
+
for (let index = 0; index < authBJJCredsOfIssuer.length; index++) {
|
|
200
|
+
const authCred = authBJJCredsOfIssuer[index];
|
|
201
|
+
const revocationStatus = await this.getRevocationStatusFromCredential(authCred);
|
|
202
|
+
|
|
203
|
+
if (!revocationStatus.mtp.existence) {
|
|
204
|
+
return authCred;
|
|
205
|
+
}
|
|
206
|
+
}
|
|
207
|
+
throw new Error('all auth bjj credentials are revoked');
|
|
208
|
+
}
|
|
209
|
+
|
|
210
|
+
/**
|
|
211
|
+
* {@inheritDoc ICredentialWallet.getAllAuthBJJCredentials}
|
|
212
|
+
*/
|
|
213
|
+
async getAllAuthBJJCredentials(did: DID): Promise<W3CCredential[]> {
|
|
214
|
+
return this._storage.credential.findCredentialsByQuery({
|
|
215
|
+
context: VerifiableConstants.AUTH.AUTH_BJJ_CREDENTIAL_SCHEMA_JSONLD_URL,
|
|
216
|
+
type: VerifiableConstants.AUTH.AUTH_BJJ_CREDENTIAL_TYPE,
|
|
217
|
+
allowedIssuers: [did.string()]
|
|
218
|
+
});
|
|
219
|
+
}
|
|
220
|
+
|
|
221
|
+
/**
|
|
222
|
+
* {@inheritDoc ICredentialWallet.getRevocationStatusFromCredential}
|
|
223
|
+
*/
|
|
224
|
+
async getRevocationStatusFromCredential(cred: W3CCredential): Promise<RevocationStatus> {
|
|
225
|
+
const mtpProof = cred.getIden3SparseMerkleTreeProof();
|
|
226
|
+
const sigProof = cred.getBJJSignature2021Proof();
|
|
227
|
+
|
|
228
|
+
const stateInfo: State | undefined = mtpProof
|
|
229
|
+
? mtpProof.issuerData.state
|
|
230
|
+
: sigProof?.issuerData.state;
|
|
231
|
+
const issuerDID = DID.parse(cred.issuer);
|
|
232
|
+
|
|
233
|
+
const userDID = getUserDIDFromCredential(issuerDID, cred);
|
|
234
|
+
|
|
235
|
+
const opts: CredentialStatusResolveOptions = {
|
|
236
|
+
issuerGenesisState: stateInfo,
|
|
237
|
+
issuerDID,
|
|
238
|
+
userDID
|
|
239
|
+
};
|
|
240
|
+
|
|
241
|
+
return this.getRevocationStatus(cred.credentialStatus, opts);
|
|
242
|
+
}
|
|
243
|
+
|
|
244
|
+
/**
|
|
245
|
+
* {@inheritDoc ICredentialWallet.getRevocationStatus}
|
|
246
|
+
*/
|
|
247
|
+
async getRevocationStatus(
|
|
248
|
+
credStatus: CredentialStatus,
|
|
249
|
+
credentialStatusResolveOptions?: CredentialStatusResolveOptions
|
|
250
|
+
): Promise<RevocationStatus> {
|
|
251
|
+
const statusResolver = this._credentialStatusResolverRegistry?.get(credStatus.type);
|
|
252
|
+
if (!statusResolver) {
|
|
253
|
+
throw new Error(`credential status resolver does not exist for ${credStatus.type} type`);
|
|
254
|
+
}
|
|
255
|
+
|
|
256
|
+
return statusResolver.resolve(credStatus, credentialStatusResolveOptions);
|
|
257
|
+
}
|
|
258
|
+
/**
|
|
259
|
+
* {@inheritDoc ICredentialWallet.createCredential}
|
|
260
|
+
*/
|
|
261
|
+
createCredential = (
|
|
262
|
+
issuer: DID,
|
|
263
|
+
request: CredentialRequest,
|
|
264
|
+
schema: JSONSchema
|
|
265
|
+
): W3CCredential => {
|
|
266
|
+
if (!schema.$metadata.uris['jsonLdContext']) {
|
|
267
|
+
throw new Error('jsonLdContext is missing is the schema');
|
|
268
|
+
}
|
|
269
|
+
// do copy of request to avoid mutation
|
|
270
|
+
const r = { ...request };
|
|
271
|
+
r.context = r.context ?? [];
|
|
272
|
+
if (
|
|
273
|
+
r.displayMethod?.type === DisplayMethodType.Iden3BasicDisplayMethodV1 &&
|
|
274
|
+
!r.context.includes(VerifiableConstants.JSONLD_SCHEMA.IDEN3_DISPLAY_METHOD)
|
|
275
|
+
) {
|
|
276
|
+
r.context.push(VerifiableConstants.JSONLD_SCHEMA.IDEN3_DISPLAY_METHOD);
|
|
277
|
+
}
|
|
278
|
+
r.context.push(schema.$metadata.uris['jsonLdContext']);
|
|
279
|
+
r.expiration = r.expiration ? r.expiration * 1000 : undefined;
|
|
280
|
+
r.id = r.id ? r.id : `urn:${uuid.v4()}`;
|
|
281
|
+
r.issuanceDate = r.issuanceDate ? r.issuanceDate * 1000 : Date.now();
|
|
282
|
+
|
|
283
|
+
return W3CCredential.fromCredentialRequest(issuer, r);
|
|
284
|
+
};
|
|
285
|
+
|
|
286
|
+
/**
|
|
287
|
+
* {@inheritDoc ICredentialWallet.findById}
|
|
288
|
+
*/
|
|
289
|
+
async findById(id: string): Promise<W3CCredential | undefined> {
|
|
290
|
+
return this._storage.credential.findCredentialById(id);
|
|
291
|
+
}
|
|
292
|
+
/**
|
|
293
|
+
* {@inheritDoc ICredentialWallet.findByContextType}
|
|
294
|
+
*/
|
|
295
|
+
async findByContextType(context: string, type: string): Promise<W3CCredential[]> {
|
|
296
|
+
return this._storage.credential.findCredentialsByQuery({ context, type });
|
|
297
|
+
}
|
|
298
|
+
/**
|
|
299
|
+
* {@inheritDoc ICredentialWallet.save}
|
|
300
|
+
*/
|
|
301
|
+
async save(credential: W3CCredential): Promise<void> {
|
|
302
|
+
return this._storage.credential.saveCredential(credential);
|
|
303
|
+
}
|
|
304
|
+
/**
|
|
305
|
+
* {@inheritDoc ICredentialWallet.saveAll}
|
|
306
|
+
*/
|
|
307
|
+
async saveAll(credentials: W3CCredential[]): Promise<void> {
|
|
308
|
+
return this._storage.credential.saveAllCredentials(credentials);
|
|
309
|
+
}
|
|
310
|
+
/**
|
|
311
|
+
* {@inheritDoc ICredentialWallet.remove}
|
|
312
|
+
*/
|
|
313
|
+
async remove(id: string): Promise<void> {
|
|
314
|
+
return this._storage.credential.removeCredential(id);
|
|
315
|
+
}
|
|
316
|
+
/**
|
|
317
|
+
* {@inheritDoc ICredentialWallet.list}
|
|
318
|
+
*/
|
|
319
|
+
async list(): Promise<W3CCredential[]> {
|
|
320
|
+
return this._storage.credential.listCredentials();
|
|
321
|
+
}
|
|
322
|
+
/**
|
|
323
|
+
* {@inheritDoc ICredentialWallet.findByQuery}
|
|
324
|
+
*/
|
|
325
|
+
async findByQuery(query: ProofQuery): Promise<W3CCredential[]> {
|
|
326
|
+
return this._storage.credential.findCredentialsByQuery(query);
|
|
327
|
+
}
|
|
328
|
+
|
|
329
|
+
/**
|
|
330
|
+
* {@inheritDoc ICredentialWallet.filterByCredentialSubject}
|
|
331
|
+
*/
|
|
332
|
+
async filterByCredentialSubject(
|
|
333
|
+
credentials: W3CCredential[],
|
|
334
|
+
subject: DID
|
|
335
|
+
): Promise<W3CCredential[]> {
|
|
336
|
+
return credentials.filter((cred: W3CCredential) => {
|
|
337
|
+
return cred.credentialSubject['id'] === subject.string();
|
|
338
|
+
});
|
|
339
|
+
}
|
|
340
|
+
async findNonRevokedCredential(creds: W3CCredential[]): Promise<{
|
|
341
|
+
cred: W3CCredential;
|
|
342
|
+
revStatus: RevocationStatus;
|
|
343
|
+
}> {
|
|
344
|
+
for (const cred of creds) {
|
|
345
|
+
const revStatus = await this.getRevocationStatusFromCredential(cred);
|
|
346
|
+
if (revStatus.mtp.existence) {
|
|
347
|
+
continue;
|
|
348
|
+
}
|
|
349
|
+
return { cred, revStatus };
|
|
350
|
+
}
|
|
351
|
+
throw new Error(VerifiableConstants.ERRORS.CREDENTIAL_WALLET_ALL_CREDENTIALS_ARE_REVOKED);
|
|
352
|
+
}
|
|
353
|
+
}
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
export * from './status/on-chain-revocation';
|
|
2
|
+
export * from './status/reverse-sparse-merkle-tree';
|
|
3
|
+
export * from './status/sparse-merkle-tree';
|
|
4
|
+
export * from './status/resolver';
|
|
5
|
+
export * from './status/agent-revocation';
|
|
6
|
+
export * from './status/credential-status-publisher';
|
|
7
|
+
export * from './status/did-resolver-revocation';
|
|
8
|
+
export * from './credential-wallet';
|
|
9
|
+
export * from './rhs';
|
|
10
|
+
export * from './utils';
|
|
11
|
+
export * from './models';
|
|
@@ -0,0 +1,93 @@
|
|
|
1
|
+
import { JsonDocumentObject } from '../iden3comm';
|
|
2
|
+
import {
|
|
3
|
+
CredentialStatusType,
|
|
4
|
+
DisplayMethod,
|
|
5
|
+
MerklizedRootPosition,
|
|
6
|
+
RefreshService,
|
|
7
|
+
SubjectPosition
|
|
8
|
+
} from '../verifiable';
|
|
9
|
+
|
|
10
|
+
/**
|
|
11
|
+
* Represents the publish mode for identity wallet.
|
|
12
|
+
* It can be one of the following values: 'sync', 'async', or 'callback'.
|
|
13
|
+
* 'sync' - publish the status synchronously
|
|
14
|
+
* 'async' - publish the status asynchronously via message bus
|
|
15
|
+
* 'callback' - publish the status with a txCallback
|
|
16
|
+
*/
|
|
17
|
+
export type PublishMode = 'sync' | 'async' | 'callback';
|
|
18
|
+
|
|
19
|
+
/**
|
|
20
|
+
* Request to core library to create Core Claim from W3C Verifiable Credential
|
|
21
|
+
*
|
|
22
|
+
* @public
|
|
23
|
+
* @interface CredentialRequest
|
|
24
|
+
*/
|
|
25
|
+
export interface CredentialRequest {
|
|
26
|
+
/**
|
|
27
|
+
* Credential ID
|
|
28
|
+
*/
|
|
29
|
+
id?: string;
|
|
30
|
+
/**
|
|
31
|
+
* JSON credential schema
|
|
32
|
+
*/
|
|
33
|
+
credentialSchema: string;
|
|
34
|
+
/**
|
|
35
|
+
* Credential type
|
|
36
|
+
*/
|
|
37
|
+
type: string;
|
|
38
|
+
/**
|
|
39
|
+
* Credential subject, usually contains claims and identifier
|
|
40
|
+
*/
|
|
41
|
+
credentialSubject: JsonDocumentObject;
|
|
42
|
+
/**
|
|
43
|
+
* expiration time
|
|
44
|
+
*/
|
|
45
|
+
expiration?: number;
|
|
46
|
+
/**
|
|
47
|
+
* refreshService
|
|
48
|
+
*/
|
|
49
|
+
refreshService?: RefreshService;
|
|
50
|
+
/**
|
|
51
|
+
* displayMethod
|
|
52
|
+
*/
|
|
53
|
+
displayMethod?: DisplayMethod;
|
|
54
|
+
/**
|
|
55
|
+
* optional custom context
|
|
56
|
+
*/
|
|
57
|
+
context?: string[];
|
|
58
|
+
/**
|
|
59
|
+
* claim version
|
|
60
|
+
*/
|
|
61
|
+
version?: number;
|
|
62
|
+
|
|
63
|
+
/**
|
|
64
|
+
* subject position (index / value / none)
|
|
65
|
+
*/
|
|
66
|
+
subjectPosition?: SubjectPosition;
|
|
67
|
+
/**
|
|
68
|
+
* merklizedRootPosition (index / value / none)
|
|
69
|
+
*/
|
|
70
|
+
merklizedRootPosition?: MerklizedRootPosition;
|
|
71
|
+
/**
|
|
72
|
+
* issuance Date
|
|
73
|
+
*/
|
|
74
|
+
issuanceDate?: number;
|
|
75
|
+
|
|
76
|
+
/**
|
|
77
|
+
* Revocation options
|
|
78
|
+
*
|
|
79
|
+
* @type {{
|
|
80
|
+
* id: string;
|
|
81
|
+
* nonce?: number;
|
|
82
|
+
* type: CredentialStatusType;
|
|
83
|
+
* issuerState?: string;
|
|
84
|
+
* }}
|
|
85
|
+
* @memberof CredentialRequest
|
|
86
|
+
*/
|
|
87
|
+
revocationOpts: {
|
|
88
|
+
id: string;
|
|
89
|
+
nonce?: number;
|
|
90
|
+
type: CredentialStatusType;
|
|
91
|
+
issuerState?: string;
|
|
92
|
+
};
|
|
93
|
+
}
|
|
@@ -0,0 +1,176 @@
|
|
|
1
|
+
import { Hash, testBit, Merkletree, NodeLeaf, Siblings } from '@iden3/js-merkletree';
|
|
2
|
+
|
|
3
|
+
import { NODE_TYPE_LEAF } from '@iden3/js-merkletree';
|
|
4
|
+
import { hashElems } from '@iden3/js-merkletree';
|
|
5
|
+
import { ProofNode } from './status/reverse-sparse-merkle-tree';
|
|
6
|
+
import { Iden3SmtRhsCredentialStatusPublisher } from './status/credential-status-publisher';
|
|
7
|
+
import { CredentialStatusType } from '../verifiable';
|
|
8
|
+
/**
|
|
9
|
+
* Interface to unite contains three trees: claim, revocation and rootOfRoots
|
|
10
|
+
* Also contains the current state of identity
|
|
11
|
+
* @public
|
|
12
|
+
* @interface TreesModel
|
|
13
|
+
*/
|
|
14
|
+
export interface TreesModel {
|
|
15
|
+
claimsTree: Merkletree;
|
|
16
|
+
revocationTree: Merkletree;
|
|
17
|
+
rootsTree: Merkletree;
|
|
18
|
+
state: Hash;
|
|
19
|
+
}
|
|
20
|
+
|
|
21
|
+
/**
|
|
22
|
+
* Pushes identity state information to a reverse hash service.
|
|
23
|
+
*
|
|
24
|
+
* A reverse hash service (RHS) is a centralized or decentralized service for storing publicly available data about identity.
|
|
25
|
+
* Such data are identity state and state of revocation tree and roots tree root tree.
|
|
26
|
+
*
|
|
27
|
+
* @deprecated Use `pushHashesToReverseHashService` instead.
|
|
28
|
+
* @param {Hash} state - current state of identity
|
|
29
|
+
* @param {TreesModel} trees - current trees of identity (claims, revocation, rootOfRoots )
|
|
30
|
+
* @param {string} rhsUrl - URL of service
|
|
31
|
+
* @param {number[]} [revokedNonces] - revoked nonces since last published info
|
|
32
|
+
* @returns void
|
|
33
|
+
*/
|
|
34
|
+
export async function pushHashesToRHS(
|
|
35
|
+
state: Hash,
|
|
36
|
+
trees: TreesModel,
|
|
37
|
+
rhsUrl: string,
|
|
38
|
+
revokedNonces?: number[]
|
|
39
|
+
): Promise<void> {
|
|
40
|
+
const nodes = await getNodesRepresentation(revokedNonces, trees, state);
|
|
41
|
+
const publisher = new Iden3SmtRhsCredentialStatusPublisher();
|
|
42
|
+
await publisher.publish({
|
|
43
|
+
nodes,
|
|
44
|
+
credentialStatusType: CredentialStatusType.Iden3ReverseSparseMerkleTreeProof,
|
|
45
|
+
rhsUrl: rhsUrl
|
|
46
|
+
});
|
|
47
|
+
}
|
|
48
|
+
|
|
49
|
+
/**
|
|
50
|
+
* Retrieves the representation of nodes for generating a proof.
|
|
51
|
+
*
|
|
52
|
+
* @param revokedNonces - An array of revoked nonces.
|
|
53
|
+
* @param trees - The TreesModel object containing the necessary trees.
|
|
54
|
+
* @param state - The hash of the state.
|
|
55
|
+
* @returns A Promise that resolves to an array of ProofNode objects.
|
|
56
|
+
*/
|
|
57
|
+
export async function getNodesRepresentation(
|
|
58
|
+
revokedNonces: number[] | undefined,
|
|
59
|
+
trees: TreesModel,
|
|
60
|
+
state: Hash
|
|
61
|
+
): Promise<ProofNode[]> {
|
|
62
|
+
const nb = new NodesBuilder();
|
|
63
|
+
|
|
64
|
+
if (revokedNonces) {
|
|
65
|
+
await addRevocationNode(nb, trees, revokedNonces);
|
|
66
|
+
}
|
|
67
|
+
|
|
68
|
+
await addRoRNode(nb, trees);
|
|
69
|
+
|
|
70
|
+
// add new state node
|
|
71
|
+
if (!state.bytes.every((b) => b === 0)) {
|
|
72
|
+
nb.addProofNode(
|
|
73
|
+
new ProofNode(state, [
|
|
74
|
+
await trees.claimsTree.root(),
|
|
75
|
+
await trees.revocationTree.root(),
|
|
76
|
+
await trees.rootsTree.root()
|
|
77
|
+
])
|
|
78
|
+
);
|
|
79
|
+
}
|
|
80
|
+
|
|
81
|
+
return nb.nodes;
|
|
82
|
+
}
|
|
83
|
+
|
|
84
|
+
async function addRoRNode(nb: NodesBuilder, trees: TreesModel): Promise<void> {
|
|
85
|
+
const currentRootsTree = trees.rootsTree;
|
|
86
|
+
const claimsTree = trees.claimsTree;
|
|
87
|
+
|
|
88
|
+
return nb.addKey(currentRootsTree, (await claimsTree.root()).bigInt());
|
|
89
|
+
}
|
|
90
|
+
|
|
91
|
+
async function addRevocationNode(
|
|
92
|
+
nb: NodesBuilder,
|
|
93
|
+
trees: TreesModel,
|
|
94
|
+
revokedNonces: number[]
|
|
95
|
+
): Promise<void> {
|
|
96
|
+
const revocationTree = trees.revocationTree;
|
|
97
|
+
|
|
98
|
+
for (const nonce of revokedNonces) {
|
|
99
|
+
await nb.addKey(revocationTree, BigInt(nonce));
|
|
100
|
+
}
|
|
101
|
+
}
|
|
102
|
+
|
|
103
|
+
/**
|
|
104
|
+
* Builder to send state information to Reverse hash Service
|
|
105
|
+
*
|
|
106
|
+
* @public
|
|
107
|
+
* @class NodesBuilder
|
|
108
|
+
*/
|
|
109
|
+
class NodesBuilder {
|
|
110
|
+
constructor(
|
|
111
|
+
public readonly nodes: ProofNode[] = [],
|
|
112
|
+
public readonly seen: Map<string, boolean> = new Map()
|
|
113
|
+
) {}
|
|
114
|
+
|
|
115
|
+
async addKey(tree: Merkletree, nodeKey: bigint): Promise<void> {
|
|
116
|
+
const { value: nodeValue, siblings } = await tree.get(nodeKey);
|
|
117
|
+
|
|
118
|
+
const nodeKeyHash = Hash.fromBigInt(nodeKey);
|
|
119
|
+
|
|
120
|
+
const nodeValueHash = Hash.fromBigInt(nodeValue);
|
|
121
|
+
|
|
122
|
+
const node = new NodeLeaf(nodeKeyHash, nodeValueHash);
|
|
123
|
+
const newNodes: ProofNode[] = await buildNodesUp(siblings, node);
|
|
124
|
+
|
|
125
|
+
for (const n of newNodes) {
|
|
126
|
+
if (!this.seen.get(n.hash.hex())) {
|
|
127
|
+
this.nodes.push(n);
|
|
128
|
+
this.seen.set(n.hash.hex(), true);
|
|
129
|
+
}
|
|
130
|
+
}
|
|
131
|
+
}
|
|
132
|
+
|
|
133
|
+
addProofNode(node: ProofNode): void {
|
|
134
|
+
const hex = node.hash.hex();
|
|
135
|
+
const isSeen = this.seen.get(hex);
|
|
136
|
+
if (!isSeen) {
|
|
137
|
+
this.nodes.push(node);
|
|
138
|
+
this.seen.set(hex, true);
|
|
139
|
+
}
|
|
140
|
+
}
|
|
141
|
+
}
|
|
142
|
+
|
|
143
|
+
async function buildNodesUp(siblings: Siblings, node: NodeLeaf): Promise<ProofNode[]> {
|
|
144
|
+
if (node.type !== NODE_TYPE_LEAF) {
|
|
145
|
+
throw new Error('node is not a leaf');
|
|
146
|
+
}
|
|
147
|
+
|
|
148
|
+
let prevHash = await node.getKey();
|
|
149
|
+
const sl = siblings.length;
|
|
150
|
+
const nodes = new Array<ProofNode>(sl + 1);
|
|
151
|
+
for (let index = 0; index < nodes.length; index++) {
|
|
152
|
+
nodes[index] = new ProofNode();
|
|
153
|
+
}
|
|
154
|
+
nodes[sl].hash = prevHash;
|
|
155
|
+
const hashOfOne = Hash.fromBigInt(BigInt(1));
|
|
156
|
+
|
|
157
|
+
nodes[sl].children = [node.entry[0], node.entry[1], hashOfOne];
|
|
158
|
+
|
|
159
|
+
const pathKey: Hash = node.entry[0];
|
|
160
|
+
for (let i = sl - 1; i >= 0; i--) {
|
|
161
|
+
const isRight = testBit(pathKey.bytes, i);
|
|
162
|
+
nodes[i].children = new Array<Hash>(2);
|
|
163
|
+
if (isRight) {
|
|
164
|
+
nodes[i].children[0] = siblings[i];
|
|
165
|
+
nodes[i].children[1] = prevHash;
|
|
166
|
+
} else {
|
|
167
|
+
nodes[i].children[0] = prevHash;
|
|
168
|
+
nodes[i].children[1] = siblings[i];
|
|
169
|
+
}
|
|
170
|
+
nodes[i].hash = hashElems([nodes[i].children[0].bigInt(), nodes[i].children[1].bigInt()]);
|
|
171
|
+
|
|
172
|
+
prevHash = nodes[i].hash;
|
|
173
|
+
}
|
|
174
|
+
|
|
175
|
+
return nodes;
|
|
176
|
+
}
|
|
@@ -0,0 +1,69 @@
|
|
|
1
|
+
import { CredentialStatus, RevocationStatus } from '../../verifiable';
|
|
2
|
+
import { CredentialStatusResolver, CredentialStatusResolveOptions } from './resolver';
|
|
3
|
+
import { RevocationStatusRequestMessage } from '../../iden3comm/types';
|
|
4
|
+
import { MediaType, PROTOCOL_MESSAGE_TYPE } from '../../iden3comm/constants';
|
|
5
|
+
import * as uuid from 'uuid';
|
|
6
|
+
import { toRevocationStatus } from './sparse-merkle-tree';
|
|
7
|
+
|
|
8
|
+
/**
|
|
9
|
+
* AgentResolver is a class that allows to interact with the issuer's agent to get revocation status.
|
|
10
|
+
*
|
|
11
|
+
* @public
|
|
12
|
+
* @class AgentResolver
|
|
13
|
+
*/
|
|
14
|
+
export class AgentResolver implements CredentialStatusResolver {
|
|
15
|
+
/**
|
|
16
|
+
* resolve is a method to resolve a credential status from an agent.
|
|
17
|
+
*
|
|
18
|
+
* @public
|
|
19
|
+
* @param {CredentialStatus} credentialStatus - credential status to resolve
|
|
20
|
+
* @param {CredentialStatusResolveOptions} credentialStatusResolveOptions - options for resolver
|
|
21
|
+
* @returns `{Promise<RevocationStatus>}`
|
|
22
|
+
*/
|
|
23
|
+
async resolve(
|
|
24
|
+
credentialStatus: CredentialStatus,
|
|
25
|
+
credentialStatusResolveOptions?: CredentialStatusResolveOptions
|
|
26
|
+
): Promise<RevocationStatus> {
|
|
27
|
+
if (!credentialStatusResolveOptions?.issuerDID) {
|
|
28
|
+
throw new Error('IssuerDID is not set in options');
|
|
29
|
+
}
|
|
30
|
+
if (!credentialStatusResolveOptions?.userDID) {
|
|
31
|
+
throw new Error('UserDID is not set in options');
|
|
32
|
+
}
|
|
33
|
+
|
|
34
|
+
if (typeof credentialStatus.revocationNonce !== 'number') {
|
|
35
|
+
throw new Error('Revocation nonce is not set in credential status');
|
|
36
|
+
}
|
|
37
|
+
|
|
38
|
+
const from = credentialStatusResolveOptions.userDID.string();
|
|
39
|
+
const to = credentialStatusResolveOptions.issuerDID.string();
|
|
40
|
+
const msg = buildRevocationMessageRequest(from, to, credentialStatus.revocationNonce);
|
|
41
|
+
const response = await fetch(credentialStatus.id, {
|
|
42
|
+
method: 'POST',
|
|
43
|
+
body: JSON.stringify(msg),
|
|
44
|
+
headers: {
|
|
45
|
+
'Content-Type': 'application/json'
|
|
46
|
+
}
|
|
47
|
+
});
|
|
48
|
+
const agentResponse = await response.json();
|
|
49
|
+
return toRevocationStatus(agentResponse.body);
|
|
50
|
+
}
|
|
51
|
+
}
|
|
52
|
+
|
|
53
|
+
function buildRevocationMessageRequest(
|
|
54
|
+
from: string,
|
|
55
|
+
to: string,
|
|
56
|
+
revocationNonce: number
|
|
57
|
+
): RevocationStatusRequestMessage {
|
|
58
|
+
return {
|
|
59
|
+
id: uuid.v4(),
|
|
60
|
+
typ: MediaType.PlainMessage,
|
|
61
|
+
type: PROTOCOL_MESSAGE_TYPE.REVOCATION_STATUS_REQUEST_MESSAGE_TYPE,
|
|
62
|
+
body: {
|
|
63
|
+
revocation_nonce: revocationNonce
|
|
64
|
+
},
|
|
65
|
+
thid: uuid.v4(),
|
|
66
|
+
from: from,
|
|
67
|
+
to: to
|
|
68
|
+
};
|
|
69
|
+
}
|