@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,97 @@
|
|
|
1
|
+
import { VerifiableConstants } from './constants';
|
|
2
|
+
import { Options, Path } from '@iden3/js-jsonld-merklization';
|
|
3
|
+
import { W3CCredential } from './credential';
|
|
4
|
+
import { QueryMetadata } from '../proof';
|
|
5
|
+
import { VerifiablePresentation, JsonDocumentObject } from '../iden3comm';
|
|
6
|
+
|
|
7
|
+
export const stringByPath = (obj: { [key: string]: unknown }, path: string): string => {
|
|
8
|
+
const parts = path.split('.');
|
|
9
|
+
|
|
10
|
+
let value = obj;
|
|
11
|
+
for (let index = 0; index < parts.length; index++) {
|
|
12
|
+
const key = parts[index];
|
|
13
|
+
if (!key) {
|
|
14
|
+
throw new Error('path is empty');
|
|
15
|
+
}
|
|
16
|
+
value = value[key] as { [key: string]: unknown };
|
|
17
|
+
if (value === undefined) {
|
|
18
|
+
throw new Error('path not found');
|
|
19
|
+
}
|
|
20
|
+
}
|
|
21
|
+
return value.toString();
|
|
22
|
+
};
|
|
23
|
+
|
|
24
|
+
export const buildFieldPath = async (
|
|
25
|
+
ldSchema: string,
|
|
26
|
+
contextType: string,
|
|
27
|
+
field: string,
|
|
28
|
+
opts?: Options
|
|
29
|
+
): Promise<Path> => {
|
|
30
|
+
let path = new Path();
|
|
31
|
+
|
|
32
|
+
if (field) {
|
|
33
|
+
path = await Path.getContextPathKey(ldSchema, contextType, field, opts);
|
|
34
|
+
}
|
|
35
|
+
path.prepend([VerifiableConstants.CREDENTIAL_SUBJECT_PATH]);
|
|
36
|
+
return path;
|
|
37
|
+
};
|
|
38
|
+
|
|
39
|
+
export const findValue = (fieldName: string, credential: W3CCredential): JsonDocumentObject => {
|
|
40
|
+
const [first, ...rest] = fieldName.split('.');
|
|
41
|
+
let v = credential.credentialSubject[first];
|
|
42
|
+
for (const part of rest) {
|
|
43
|
+
v = (v as JsonDocumentObject)[part];
|
|
44
|
+
}
|
|
45
|
+
return v as JsonDocumentObject;
|
|
46
|
+
};
|
|
47
|
+
|
|
48
|
+
export const createVerifiablePresentation = (
|
|
49
|
+
context: string,
|
|
50
|
+
tp: string,
|
|
51
|
+
credential: W3CCredential,
|
|
52
|
+
queries: QueryMetadata[]
|
|
53
|
+
): VerifiablePresentation => {
|
|
54
|
+
const baseContext = [VerifiableConstants.JSONLD_SCHEMA.W3C_CREDENTIAL_2018];
|
|
55
|
+
const ldContext = baseContext[0] === context ? baseContext : [...baseContext, context];
|
|
56
|
+
|
|
57
|
+
const vc = VerifiableConstants.CREDENTIAL_TYPE.W3C_VERIFIABLE_CREDENTIAL;
|
|
58
|
+
const vcTypes = [vc];
|
|
59
|
+
if (tp !== vc) {
|
|
60
|
+
vcTypes.push(tp);
|
|
61
|
+
}
|
|
62
|
+
|
|
63
|
+
const skeleton = {
|
|
64
|
+
'@context': baseContext,
|
|
65
|
+
type: VerifiableConstants.CREDENTIAL_TYPE.W3C_VERIFIABLE_PRESENTATION,
|
|
66
|
+
verifiableCredential: {
|
|
67
|
+
'@context': ldContext,
|
|
68
|
+
type: vcTypes,
|
|
69
|
+
credentialSubject: {
|
|
70
|
+
type: tp
|
|
71
|
+
}
|
|
72
|
+
}
|
|
73
|
+
};
|
|
74
|
+
|
|
75
|
+
let result: JsonDocumentObject = {};
|
|
76
|
+
for (const query of queries) {
|
|
77
|
+
const parts = query.fieldName.split('.');
|
|
78
|
+
const current: JsonDocumentObject = parts.reduceRight(
|
|
79
|
+
(acc: JsonDocumentObject, part: string) => {
|
|
80
|
+
if (result[part]) {
|
|
81
|
+
return { [part]: { ...(result[part] as JsonDocumentObject), ...acc } };
|
|
82
|
+
}
|
|
83
|
+
return { [part]: acc };
|
|
84
|
+
},
|
|
85
|
+
findValue(query.fieldName, credential) as JsonDocumentObject
|
|
86
|
+
);
|
|
87
|
+
|
|
88
|
+
result = { ...result, ...current };
|
|
89
|
+
}
|
|
90
|
+
|
|
91
|
+
skeleton.verifiableCredential.credentialSubject = {
|
|
92
|
+
...skeleton.verifiableCredential.credentialSubject,
|
|
93
|
+
...result
|
|
94
|
+
};
|
|
95
|
+
|
|
96
|
+
return skeleton;
|
|
97
|
+
};
|
|
@@ -0,0 +1,277 @@
|
|
|
1
|
+
import { Hash, Proof } from '@iden3/js-merkletree';
|
|
2
|
+
import {
|
|
3
|
+
ProofType,
|
|
4
|
+
CredentialStatusType,
|
|
5
|
+
RefreshServiceType,
|
|
6
|
+
DisplayMethodType
|
|
7
|
+
} from './constants';
|
|
8
|
+
import { TreeState } from '../circuits';
|
|
9
|
+
import { Hex, Signature } from '@iden3/js-crypto';
|
|
10
|
+
import { Claim, DID } from '@mocanetwork/moca-iden3';
|
|
11
|
+
import { JsonDocumentObject, JSONObject } from '../iden3comm';
|
|
12
|
+
|
|
13
|
+
/**
|
|
14
|
+
* Represents the published state of the issuer
|
|
15
|
+
*
|
|
16
|
+
* @public
|
|
17
|
+
* @interface State
|
|
18
|
+
*/
|
|
19
|
+
export interface State {
|
|
20
|
+
txId?: string;
|
|
21
|
+
blockTimestamp?: number;
|
|
22
|
+
blockNumber?: number;
|
|
23
|
+
rootOfRoots: Hash;
|
|
24
|
+
claimsTreeRoot: Hash;
|
|
25
|
+
revocationTreeRoot: Hash;
|
|
26
|
+
value: Hash;
|
|
27
|
+
status?: string;
|
|
28
|
+
}
|
|
29
|
+
|
|
30
|
+
/**
|
|
31
|
+
* Iden3SparseMerkleProof is a iden3 protocol merkle tree proof
|
|
32
|
+
*
|
|
33
|
+
* @public
|
|
34
|
+
* @class Iden3SparseMerkleTreeProof
|
|
35
|
+
*/
|
|
36
|
+
export class Iden3SparseMerkleTreeProof {
|
|
37
|
+
type: ProofType;
|
|
38
|
+
issuerData: {
|
|
39
|
+
id: DID;
|
|
40
|
+
state: State;
|
|
41
|
+
};
|
|
42
|
+
mtp: Proof;
|
|
43
|
+
coreClaim: Claim;
|
|
44
|
+
/**
|
|
45
|
+
* Creates an instance of Iden3SparseMerkleTreeProof.
|
|
46
|
+
* @param {object} obj
|
|
47
|
+
*/
|
|
48
|
+
constructor(obj: {
|
|
49
|
+
issuerData: {
|
|
50
|
+
id: DID;
|
|
51
|
+
state: State;
|
|
52
|
+
};
|
|
53
|
+
mtp: Proof;
|
|
54
|
+
coreClaim: Claim;
|
|
55
|
+
}) {
|
|
56
|
+
this.coreClaim = obj.coreClaim;
|
|
57
|
+
this.issuerData = obj.issuerData;
|
|
58
|
+
this.type = ProofType.Iden3SparseMerkleTreeProof;
|
|
59
|
+
this.mtp = obj.mtp;
|
|
60
|
+
}
|
|
61
|
+
|
|
62
|
+
/**
|
|
63
|
+
*
|
|
64
|
+
*
|
|
65
|
+
* @returns `json object in serialized presentation`
|
|
66
|
+
*/
|
|
67
|
+
toJSON() {
|
|
68
|
+
const issuerId = this.issuerData.id;
|
|
69
|
+
return {
|
|
70
|
+
issuerData: {
|
|
71
|
+
id: issuerId.string(),
|
|
72
|
+
state: {
|
|
73
|
+
...this.issuerData.state,
|
|
74
|
+
rootOfRoots: this.issuerData.state.rootOfRoots.hex(),
|
|
75
|
+
claimsTreeRoot: this.issuerData.state.claimsTreeRoot.hex(),
|
|
76
|
+
revocationTreeRoot: this.issuerData.state.revocationTreeRoot.hex(),
|
|
77
|
+
value: this.issuerData.state.value.hex()
|
|
78
|
+
}
|
|
79
|
+
},
|
|
80
|
+
type: this.type,
|
|
81
|
+
coreClaim: this.coreClaim.hex(),
|
|
82
|
+
mtp: this.mtp.toJSON()
|
|
83
|
+
};
|
|
84
|
+
}
|
|
85
|
+
|
|
86
|
+
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
87
|
+
static fromJSON(obj: any) {
|
|
88
|
+
let mtp: Proof;
|
|
89
|
+
if (obj?.mtp?.notEmpties && obj?.mtp?.depth && obj?.mtp?.siblings) {
|
|
90
|
+
// legacy
|
|
91
|
+
|
|
92
|
+
const ne = obj?.mtp?.notEmpties;
|
|
93
|
+
const notEmpties = ne instanceof Uint8Array ? ne : new Uint8Array(Object.values(ne));
|
|
94
|
+
const siblingsHashes = obj?.mtp?.siblings.map((h: unknown) =>
|
|
95
|
+
Hash.fromString(JSON.stringify(h))
|
|
96
|
+
);
|
|
97
|
+
const allSiblings = Proof.buildAllSiblings(obj?.mtp?.depth, notEmpties, siblingsHashes);
|
|
98
|
+
let nodeAux = obj.mtp.nodeAux || obj.mtp.node_aux;
|
|
99
|
+
if (nodeAux) {
|
|
100
|
+
nodeAux = {
|
|
101
|
+
key: Hash.fromString(JSON.stringify(nodeAux.key)),
|
|
102
|
+
value: Hash.fromString(JSON.stringify(nodeAux.value))
|
|
103
|
+
};
|
|
104
|
+
}
|
|
105
|
+
mtp = new Proof({ existence: obj?.mtp.existence, nodeAux: nodeAux, siblings: allSiblings });
|
|
106
|
+
} else {
|
|
107
|
+
mtp = Proof.fromJSON(obj.mtp);
|
|
108
|
+
}
|
|
109
|
+
|
|
110
|
+
return new Iden3SparseMerkleTreeProof({
|
|
111
|
+
coreClaim: new Claim().fromHex(obj.coreClaim),
|
|
112
|
+
mtp,
|
|
113
|
+
issuerData: {
|
|
114
|
+
id: DID.parse(obj.issuerData.id),
|
|
115
|
+
state: {
|
|
116
|
+
...obj.issuerData.state,
|
|
117
|
+
rootOfRoots: Hash.fromHex(obj.issuerData.state.rootOfRoots),
|
|
118
|
+
claimsTreeRoot: Hash.fromHex(obj.issuerData.state.claimsTreeRoot),
|
|
119
|
+
revocationTreeRoot: Hash.fromHex(obj.issuerData.state.revocationTreeRoot),
|
|
120
|
+
value: Hash.fromHex(obj.issuerData.state.value)
|
|
121
|
+
}
|
|
122
|
+
}
|
|
123
|
+
});
|
|
124
|
+
}
|
|
125
|
+
}
|
|
126
|
+
|
|
127
|
+
/**
|
|
128
|
+
*
|
|
129
|
+
* BJJSignatureProof2021 is a signature of core claim by BJJ key
|
|
130
|
+
* @public
|
|
131
|
+
* @class BJJSignatureProof2021
|
|
132
|
+
*/
|
|
133
|
+
export class BJJSignatureProof2021 {
|
|
134
|
+
type: ProofType;
|
|
135
|
+
issuerData: {
|
|
136
|
+
id: DID;
|
|
137
|
+
state: State;
|
|
138
|
+
authCoreClaim: Claim;
|
|
139
|
+
mtp: Proof;
|
|
140
|
+
credentialStatus: CredentialStatus;
|
|
141
|
+
};
|
|
142
|
+
signature: Signature;
|
|
143
|
+
coreClaim: Claim;
|
|
144
|
+
|
|
145
|
+
constructor(obj: {
|
|
146
|
+
issuerData: {
|
|
147
|
+
id: DID;
|
|
148
|
+
state: State;
|
|
149
|
+
authCoreClaim: Claim;
|
|
150
|
+
mtp: Proof;
|
|
151
|
+
credentialStatus: CredentialStatus;
|
|
152
|
+
};
|
|
153
|
+
coreClaim: Claim;
|
|
154
|
+
signature: Signature;
|
|
155
|
+
}) {
|
|
156
|
+
this.type = ProofType.BJJSignature;
|
|
157
|
+
this.issuerData = obj.issuerData;
|
|
158
|
+
this.coreClaim = obj.coreClaim;
|
|
159
|
+
this.signature = obj.signature;
|
|
160
|
+
}
|
|
161
|
+
|
|
162
|
+
/**
|
|
163
|
+
* toJSON is a method to serialize BJJSignatureProof2021 to json
|
|
164
|
+
*
|
|
165
|
+
* @returns `json object in serialized presentation`
|
|
166
|
+
*/
|
|
167
|
+
toJSON() {
|
|
168
|
+
return {
|
|
169
|
+
issuerData: {
|
|
170
|
+
id: this.issuerData.id.string(),
|
|
171
|
+
state: {
|
|
172
|
+
...this.issuerData.state,
|
|
173
|
+
rootOfRoots: this.issuerData.state.rootOfRoots.hex(),
|
|
174
|
+
claimsTreeRoot: this.issuerData.state.claimsTreeRoot.hex(),
|
|
175
|
+
revocationTreeRoot: this.issuerData.state.revocationTreeRoot.hex(),
|
|
176
|
+
value: this.issuerData.state.value.hex()
|
|
177
|
+
},
|
|
178
|
+
mtp: this.issuerData.mtp.toJSON(),
|
|
179
|
+
authCoreClaim: this.issuerData.authCoreClaim.hex(),
|
|
180
|
+
credentialStatus: this.issuerData.credentialStatus
|
|
181
|
+
},
|
|
182
|
+
type: this.type,
|
|
183
|
+
coreClaim: this.coreClaim.hex(),
|
|
184
|
+
signature: Hex.encodeString(this.signature.compress())
|
|
185
|
+
};
|
|
186
|
+
}
|
|
187
|
+
|
|
188
|
+
/**
|
|
189
|
+
* fromJSON is a method to deserialize BJJSignatureProof2021 from json
|
|
190
|
+
* @param obj
|
|
191
|
+
*/
|
|
192
|
+
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
193
|
+
static fromJSON(obj: any) {
|
|
194
|
+
return new BJJSignatureProof2021({
|
|
195
|
+
issuerData: {
|
|
196
|
+
id: DID.parse(obj.issuerData.id),
|
|
197
|
+
mtp: Proof.fromJSON(obj.issuerData.mtp),
|
|
198
|
+
state: {
|
|
199
|
+
...obj.issuerData.state,
|
|
200
|
+
rootOfRoots: Hash.fromHex(obj.issuerData.state.rootOfRoots),
|
|
201
|
+
claimsTreeRoot: Hash.fromHex(obj.issuerData.state.claimsTreeRoot),
|
|
202
|
+
revocationTreeRoot: Hash.fromHex(obj.issuerData.state.revocationTreeRoot),
|
|
203
|
+
value: Hash.fromHex(obj.issuerData.state.value)
|
|
204
|
+
},
|
|
205
|
+
credentialStatus: obj.issuerData.credentialStatus,
|
|
206
|
+
authCoreClaim: new Claim().fromHex(obj.issuerData.authCoreClaim)
|
|
207
|
+
},
|
|
208
|
+
coreClaim: new Claim().fromHex(obj.coreClaim),
|
|
209
|
+
signature: Signature.newFromCompressed(
|
|
210
|
+
Uint8Array.from(Hex.decodeString(obj.signature)).slice(0, 64)
|
|
211
|
+
)
|
|
212
|
+
});
|
|
213
|
+
}
|
|
214
|
+
}
|
|
215
|
+
/**
|
|
216
|
+
* Query represents structure for query to atomic circuit
|
|
217
|
+
*
|
|
218
|
+
* @public
|
|
219
|
+
* @interface ProofQuery
|
|
220
|
+
*/
|
|
221
|
+
export interface ProofQuery {
|
|
222
|
+
allowedIssuers?: string[];
|
|
223
|
+
credentialSubject?: JsonDocumentObject;
|
|
224
|
+
schema?: string; // string url
|
|
225
|
+
claimId?: string;
|
|
226
|
+
credentialSubjectId?: string;
|
|
227
|
+
context?: string;
|
|
228
|
+
type?: string;
|
|
229
|
+
skipClaimRevocationCheck?: boolean;
|
|
230
|
+
proofType?: string;
|
|
231
|
+
groupId?: number;
|
|
232
|
+
params?: JSONObject;
|
|
233
|
+
}
|
|
234
|
+
|
|
235
|
+
/**
|
|
236
|
+
* Proof with MerkleTree info
|
|
237
|
+
*
|
|
238
|
+
* @public
|
|
239
|
+
* @interface MerkleTreeProofWithTreeState
|
|
240
|
+
*/
|
|
241
|
+
export interface MerkleTreeProofWithTreeState {
|
|
242
|
+
proof: Proof;
|
|
243
|
+
treeState: TreeState;
|
|
244
|
+
}
|
|
245
|
+
|
|
246
|
+
/**
|
|
247
|
+
*
|
|
248
|
+
* CredentialStatus contains type and revocation Url
|
|
249
|
+
* @public
|
|
250
|
+
* @interface CredentialStatus
|
|
251
|
+
*/
|
|
252
|
+
export interface CredentialStatus {
|
|
253
|
+
id: string;
|
|
254
|
+
type: CredentialStatusType;
|
|
255
|
+
revocationNonce?: number;
|
|
256
|
+
statusIssuer?: { id: string; type: CredentialStatusType; revocationNonce?: number };
|
|
257
|
+
}
|
|
258
|
+
|
|
259
|
+
/**
|
|
260
|
+
* RefreshService contains type and id
|
|
261
|
+
* @public
|
|
262
|
+
* @interface RefreshService
|
|
263
|
+
*/
|
|
264
|
+
export interface RefreshService {
|
|
265
|
+
id: string;
|
|
266
|
+
type: RefreshServiceType | string;
|
|
267
|
+
}
|
|
268
|
+
|
|
269
|
+
/**
|
|
270
|
+
* DisplayMethod contains type and id
|
|
271
|
+
* @public
|
|
272
|
+
* @interface DisplayMethod
|
|
273
|
+
*/
|
|
274
|
+
export interface DisplayMethod {
|
|
275
|
+
id: string;
|
|
276
|
+
type: DisplayMethodType | string;
|
|
277
|
+
}
|
|
@@ -0,0 +1,241 @@
|
|
|
1
|
+
/** DIDDocumentJSONSchema is a basic schema of did document */
|
|
2
|
+
export const DIDDocumentJSONSchema = `{
|
|
3
|
+
"type": "object",
|
|
4
|
+
"$defs": {
|
|
5
|
+
"serviceEndpoint": {
|
|
6
|
+
"type": "object",
|
|
7
|
+
"properties": {
|
|
8
|
+
"id": {
|
|
9
|
+
"type": "string"
|
|
10
|
+
},
|
|
11
|
+
"type": {
|
|
12
|
+
"type": "string"
|
|
13
|
+
},
|
|
14
|
+
"serviceEndpoint": {
|
|
15
|
+
"type": "string"
|
|
16
|
+
},
|
|
17
|
+
"metadata": {
|
|
18
|
+
"type": "object"
|
|
19
|
+
}
|
|
20
|
+
},
|
|
21
|
+
"required": [
|
|
22
|
+
"id",
|
|
23
|
+
"type",
|
|
24
|
+
"serviceEndpoint"
|
|
25
|
+
]
|
|
26
|
+
},
|
|
27
|
+
"jsonWebKey": {
|
|
28
|
+
"type": "object",
|
|
29
|
+
"properties": {
|
|
30
|
+
"alg": {
|
|
31
|
+
"type": "string"
|
|
32
|
+
},
|
|
33
|
+
"crv": {
|
|
34
|
+
"type": "string"
|
|
35
|
+
},
|
|
36
|
+
"e": {
|
|
37
|
+
"type": "string"
|
|
38
|
+
},
|
|
39
|
+
"ext": {
|
|
40
|
+
"type": "boolean"
|
|
41
|
+
},
|
|
42
|
+
"key_ops": {
|
|
43
|
+
"type": "array",
|
|
44
|
+
"items": {
|
|
45
|
+
"type": "string"
|
|
46
|
+
}
|
|
47
|
+
},
|
|
48
|
+
"kid": {
|
|
49
|
+
"type": "string"
|
|
50
|
+
},
|
|
51
|
+
"kty": {
|
|
52
|
+
"type": "string"
|
|
53
|
+
},
|
|
54
|
+
"n": {
|
|
55
|
+
"type": "string"
|
|
56
|
+
},
|
|
57
|
+
"use": {
|
|
58
|
+
"type": "string"
|
|
59
|
+
},
|
|
60
|
+
"x": {
|
|
61
|
+
"type": "string"
|
|
62
|
+
},
|
|
63
|
+
"y": {
|
|
64
|
+
"type": "string"
|
|
65
|
+
}
|
|
66
|
+
},
|
|
67
|
+
"required": [
|
|
68
|
+
"kty"
|
|
69
|
+
],
|
|
70
|
+
"description": "Public parts of JSON web key"
|
|
71
|
+
},
|
|
72
|
+
"verificationMethod": {
|
|
73
|
+
"type": "object",
|
|
74
|
+
"properties": {
|
|
75
|
+
"id": {
|
|
76
|
+
"type": "string"
|
|
77
|
+
},
|
|
78
|
+
"type": {
|
|
79
|
+
"type": "string"
|
|
80
|
+
},
|
|
81
|
+
"controller": {
|
|
82
|
+
"type": "string"
|
|
83
|
+
},
|
|
84
|
+
"publicKeyBase58": {
|
|
85
|
+
"type": "string"
|
|
86
|
+
},
|
|
87
|
+
"publicKeyBase64": {
|
|
88
|
+
"type": "string"
|
|
89
|
+
},
|
|
90
|
+
"publicKeyJwk": {
|
|
91
|
+
"$ref": "#/$defs/jsonWebKey"
|
|
92
|
+
},
|
|
93
|
+
"publicKeyHex": {
|
|
94
|
+
"type": "string"
|
|
95
|
+
},
|
|
96
|
+
"publicKeyMultibase": {
|
|
97
|
+
"type": "string"
|
|
98
|
+
},
|
|
99
|
+
"blockchainAccountId": {
|
|
100
|
+
"type": "string"
|
|
101
|
+
},
|
|
102
|
+
"ethereumAddress": {
|
|
103
|
+
"type": "string"
|
|
104
|
+
}
|
|
105
|
+
},
|
|
106
|
+
"required": [
|
|
107
|
+
"id",
|
|
108
|
+
"type",
|
|
109
|
+
"controller"
|
|
110
|
+
]
|
|
111
|
+
}
|
|
112
|
+
},
|
|
113
|
+
"properties": {
|
|
114
|
+
"authentication": {
|
|
115
|
+
"type": "array",
|
|
116
|
+
"items": {
|
|
117
|
+
"anyOf": [
|
|
118
|
+
{
|
|
119
|
+
"type": "string"
|
|
120
|
+
},
|
|
121
|
+
{
|
|
122
|
+
"$ref": "#/$defs/verificationMethod"
|
|
123
|
+
}
|
|
124
|
+
]
|
|
125
|
+
}
|
|
126
|
+
},
|
|
127
|
+
"assertionMethod": {
|
|
128
|
+
"type": "array",
|
|
129
|
+
"items": {
|
|
130
|
+
"anyOf": [
|
|
131
|
+
{
|
|
132
|
+
"type": "string"
|
|
133
|
+
},
|
|
134
|
+
{
|
|
135
|
+
"$ref": "#/$defs/verificationMethod"
|
|
136
|
+
}
|
|
137
|
+
]
|
|
138
|
+
}
|
|
139
|
+
},
|
|
140
|
+
"keyAgreement": {
|
|
141
|
+
"type": "array",
|
|
142
|
+
"items": {
|
|
143
|
+
"anyOf": [
|
|
144
|
+
{
|
|
145
|
+
"type": "string"
|
|
146
|
+
},
|
|
147
|
+
{
|
|
148
|
+
"$ref": "#/$defs/verificationMethod"
|
|
149
|
+
}
|
|
150
|
+
]
|
|
151
|
+
}
|
|
152
|
+
},
|
|
153
|
+
"capabilityInvocation": {
|
|
154
|
+
"type": "array",
|
|
155
|
+
"items": {
|
|
156
|
+
"anyOf": [
|
|
157
|
+
{
|
|
158
|
+
"type": "string"
|
|
159
|
+
},
|
|
160
|
+
{
|
|
161
|
+
"$ref": "#/$defs/verificationMethod"
|
|
162
|
+
}
|
|
163
|
+
]
|
|
164
|
+
}
|
|
165
|
+
},
|
|
166
|
+
"capabilityDelegation": {
|
|
167
|
+
"type": "array",
|
|
168
|
+
"items": {
|
|
169
|
+
"anyOf": [
|
|
170
|
+
{
|
|
171
|
+
"type": "string"
|
|
172
|
+
},
|
|
173
|
+
{
|
|
174
|
+
"$ref": "#/$defs/verificationMethod"
|
|
175
|
+
}
|
|
176
|
+
]
|
|
177
|
+
}
|
|
178
|
+
},
|
|
179
|
+
"@context": {
|
|
180
|
+
"anyOf": [
|
|
181
|
+
{
|
|
182
|
+
"type": "string",
|
|
183
|
+
"const": "https://www.w3.org/ns/did/v1"
|
|
184
|
+
},
|
|
185
|
+
{
|
|
186
|
+
"type": "string"
|
|
187
|
+
},
|
|
188
|
+
{
|
|
189
|
+
"type": "array",
|
|
190
|
+
"items": {
|
|
191
|
+
"type": "string"
|
|
192
|
+
}
|
|
193
|
+
}
|
|
194
|
+
]
|
|
195
|
+
},
|
|
196
|
+
"id": {
|
|
197
|
+
"type": "string"
|
|
198
|
+
},
|
|
199
|
+
"alsoKnownAs": {
|
|
200
|
+
"type": "array",
|
|
201
|
+
"items": {
|
|
202
|
+
"type": "string"
|
|
203
|
+
}
|
|
204
|
+
},
|
|
205
|
+
"controller": {
|
|
206
|
+
"anyOf": [
|
|
207
|
+
{
|
|
208
|
+
"type": "string"
|
|
209
|
+
},
|
|
210
|
+
{
|
|
211
|
+
"type": "array",
|
|
212
|
+
"items": {
|
|
213
|
+
"type": "string"
|
|
214
|
+
}
|
|
215
|
+
}
|
|
216
|
+
]
|
|
217
|
+
},
|
|
218
|
+
"verificationMethod": {
|
|
219
|
+
"type": "array",
|
|
220
|
+
"items": {
|
|
221
|
+
"$ref": "#/$defs/verificationMethod"
|
|
222
|
+
}
|
|
223
|
+
},
|
|
224
|
+
"service": {
|
|
225
|
+
"type": "array",
|
|
226
|
+
"items": {
|
|
227
|
+
"$ref": "#/$defs/serviceEndpoint"
|
|
228
|
+
}
|
|
229
|
+
},
|
|
230
|
+
"publicKey": {
|
|
231
|
+
"type": "array",
|
|
232
|
+
"items": {
|
|
233
|
+
"$ref": "#/$defs/verificationMethod"
|
|
234
|
+
},
|
|
235
|
+
"deprecated": true
|
|
236
|
+
}
|
|
237
|
+
},
|
|
238
|
+
"required": [
|
|
239
|
+
"id"
|
|
240
|
+
]
|
|
241
|
+
}`;
|