@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,140 @@
|
|
|
1
|
+
import { createStore, UseStore, get, set, del } from 'idb-keyval';
|
|
2
|
+
import { IndexedDBStorage, Merkletree, str2Bytes } from '@iden3/js-merkletree';
|
|
3
|
+
import { IdentityMerkleTreeMetaInformation, MerkleTreeType } from '../entities/mt';
|
|
4
|
+
import * as uuid from 'uuid';
|
|
5
|
+
|
|
6
|
+
import { IMerkleTreeStorage } from '../interfaces/merkletree';
|
|
7
|
+
import { createMerkleTreeMetaInfo } from '../utils';
|
|
8
|
+
|
|
9
|
+
/**
|
|
10
|
+
* Merkle tree storage that uses browser indexed db storage
|
|
11
|
+
*
|
|
12
|
+
* @public
|
|
13
|
+
* @class MerkleTreeIndexedDBStorage
|
|
14
|
+
* @implements implements IMerkleTreeStorage interface
|
|
15
|
+
*/
|
|
16
|
+
export class MerkleTreeIndexedDBStorage implements IMerkleTreeStorage {
|
|
17
|
+
/**
|
|
18
|
+
* key for the storage key metadata
|
|
19
|
+
*
|
|
20
|
+
* @static
|
|
21
|
+
*/
|
|
22
|
+
static readonly storageKeyMeta = 'merkle-tree-meta';
|
|
23
|
+
static readonly storageBindingKeyMeta = 'binding-did';
|
|
24
|
+
|
|
25
|
+
private readonly _merkleTreeMetaStore: UseStore;
|
|
26
|
+
private readonly _bindingStore: UseStore;
|
|
27
|
+
|
|
28
|
+
/**
|
|
29
|
+
* Creates an instance of MerkleTreeIndexedDBStorage.
|
|
30
|
+
* @param {number} _mtDepth
|
|
31
|
+
*/
|
|
32
|
+
constructor(private readonly _mtDepth: number) {
|
|
33
|
+
this._merkleTreeMetaStore = createStore(
|
|
34
|
+
`${MerkleTreeIndexedDBStorage.storageKeyMeta}-db`,
|
|
35
|
+
MerkleTreeIndexedDBStorage.storageKeyMeta
|
|
36
|
+
);
|
|
37
|
+
this._bindingStore = createStore(
|
|
38
|
+
`${MerkleTreeIndexedDBStorage.storageBindingKeyMeta}-db`,
|
|
39
|
+
MerkleTreeIndexedDBStorage.storageBindingKeyMeta
|
|
40
|
+
);
|
|
41
|
+
}
|
|
42
|
+
|
|
43
|
+
/** creates a tree in the indexed db storage */
|
|
44
|
+
async createIdentityMerkleTrees(
|
|
45
|
+
identifier: string
|
|
46
|
+
): Promise<IdentityMerkleTreeMetaInformation[]> {
|
|
47
|
+
if (!identifier) {
|
|
48
|
+
identifier = `${uuid.v4()}`;
|
|
49
|
+
}
|
|
50
|
+
const existingBinging = await get(identifier, this._bindingStore);
|
|
51
|
+
if (existingBinging) {
|
|
52
|
+
throw new Error(
|
|
53
|
+
`Present merkle tree meta information in the store for current identifier ${identifier}`
|
|
54
|
+
);
|
|
55
|
+
}
|
|
56
|
+
const treesMeta = createMerkleTreeMetaInfo(identifier);
|
|
57
|
+
await set(identifier, treesMeta, this._merkleTreeMetaStore);
|
|
58
|
+
return treesMeta;
|
|
59
|
+
}
|
|
60
|
+
/**
|
|
61
|
+
*
|
|
62
|
+
* getIdentityMerkleTreesInfo from the indexed db storage
|
|
63
|
+
* @param {string} identifier
|
|
64
|
+
* @returns `{Promise<IdentityMerkleTreeMetaInformation[]>}`
|
|
65
|
+
*/
|
|
66
|
+
async getIdentityMerkleTreesInfo(
|
|
67
|
+
identifier: string
|
|
68
|
+
): Promise<IdentityMerkleTreeMetaInformation[]> {
|
|
69
|
+
const meta = await get(identifier, this._merkleTreeMetaStore);
|
|
70
|
+
if (meta) {
|
|
71
|
+
return meta;
|
|
72
|
+
}
|
|
73
|
+
throw new Error(`Merkle tree meta not found for identifier ${identifier}`);
|
|
74
|
+
}
|
|
75
|
+
|
|
76
|
+
/** get merkle tree from the indexed db storage */
|
|
77
|
+
async getMerkleTreeByIdentifierAndType(
|
|
78
|
+
identifier: string,
|
|
79
|
+
mtType: MerkleTreeType
|
|
80
|
+
): Promise<Merkletree> {
|
|
81
|
+
const meta = await get(identifier, this._merkleTreeMetaStore);
|
|
82
|
+
const err = new Error(`Merkle tree not found for identifier ${identifier} and type ${mtType}`);
|
|
83
|
+
if (!meta) {
|
|
84
|
+
throw err;
|
|
85
|
+
}
|
|
86
|
+
|
|
87
|
+
const resultMeta = meta.find(
|
|
88
|
+
(m: { identifier: string; type: MerkleTreeType }) =>
|
|
89
|
+
m.identifier === identifier && m.type === mtType
|
|
90
|
+
);
|
|
91
|
+
if (!resultMeta) {
|
|
92
|
+
throw err;
|
|
93
|
+
}
|
|
94
|
+
return new Merkletree(new IndexedDBStorage(str2Bytes(resultMeta.treeId)), true, this._mtDepth);
|
|
95
|
+
}
|
|
96
|
+
/** adds to merkle tree in the indexed db storage */
|
|
97
|
+
async addToMerkleTree(
|
|
98
|
+
identifier: string,
|
|
99
|
+
mtType: MerkleTreeType,
|
|
100
|
+
hindex: bigint,
|
|
101
|
+
hvalue: bigint
|
|
102
|
+
): Promise<void> {
|
|
103
|
+
const meta = await get(identifier, this._merkleTreeMetaStore);
|
|
104
|
+
if (!meta) {
|
|
105
|
+
throw new Error(`Merkle tree meta not found for identifier ${identifier}`);
|
|
106
|
+
}
|
|
107
|
+
const resultMeta = meta.find(
|
|
108
|
+
(m: { identifier: string; type: MerkleTreeType }) =>
|
|
109
|
+
m.identifier === identifier && m.type === mtType
|
|
110
|
+
);
|
|
111
|
+
if (!resultMeta) {
|
|
112
|
+
throw new Error(`Merkle tree not found for identifier ${identifier} and type ${mtType}`);
|
|
113
|
+
}
|
|
114
|
+
|
|
115
|
+
const tree = new Merkletree(
|
|
116
|
+
new IndexedDBStorage(str2Bytes(resultMeta.treeId)),
|
|
117
|
+
true,
|
|
118
|
+
this._mtDepth
|
|
119
|
+
);
|
|
120
|
+
|
|
121
|
+
await tree.add(hindex, hvalue);
|
|
122
|
+
}
|
|
123
|
+
|
|
124
|
+
/** binds merkle tree in the indexed db storage to the new identifiers */
|
|
125
|
+
async bindMerkleTreeToNewIdentifier(oldIdentifier: string, newIdentifier: string): Promise<void> {
|
|
126
|
+
const meta = await get(oldIdentifier, this._merkleTreeMetaStore);
|
|
127
|
+
if (!meta || !meta?.length) {
|
|
128
|
+
throw new Error(`Merkle tree meta not found for identifier ${oldIdentifier}`);
|
|
129
|
+
}
|
|
130
|
+
|
|
131
|
+
const treesMeta = meta.map((m: { identifier: string; type: MerkleTreeType }) => ({
|
|
132
|
+
...m,
|
|
133
|
+
identifier: newIdentifier
|
|
134
|
+
}));
|
|
135
|
+
|
|
136
|
+
await del(oldIdentifier, this._merkleTreeMetaStore);
|
|
137
|
+
await set(newIdentifier, treesMeta, this._merkleTreeMetaStore);
|
|
138
|
+
await set(oldIdentifier, newIdentifier, this._bindingStore);
|
|
139
|
+
}
|
|
140
|
+
}
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
import { CircuitId } from '../../circuits';
|
|
2
|
+
import { CircuitData } from '../entities/circuitData';
|
|
3
|
+
|
|
4
|
+
/**
|
|
5
|
+
* Interface to work with circuit files
|
|
6
|
+
*
|
|
7
|
+
* @public
|
|
8
|
+
* @interface ICircuitStorage
|
|
9
|
+
*/
|
|
10
|
+
export interface ICircuitStorage {
|
|
11
|
+
/**
|
|
12
|
+
* load circuit keys by id
|
|
13
|
+
*
|
|
14
|
+
* @param {CircuitId} circuitId - circuit id
|
|
15
|
+
* @returns `{Promise<CircuitData>}`
|
|
16
|
+
*/
|
|
17
|
+
loadCircuitData(circuitId: CircuitId): Promise<CircuitData>;
|
|
18
|
+
|
|
19
|
+
/**
|
|
20
|
+
* saves circuit files by circuit id
|
|
21
|
+
*
|
|
22
|
+
* @param {CircuitId} circuitId - circuit id
|
|
23
|
+
* @param {CircuitData} circuitData - circuit keys
|
|
24
|
+
* @returns `Promise<void>`
|
|
25
|
+
*/
|
|
26
|
+
saveCircuitData(circuitId: CircuitId, circuitData: CircuitData): Promise<void>;
|
|
27
|
+
}
|
|
@@ -0,0 +1,53 @@
|
|
|
1
|
+
import { ProofQuery, W3CCredential } from '../../verifiable';
|
|
2
|
+
|
|
3
|
+
/**
|
|
4
|
+
* Interface for credential storages
|
|
5
|
+
*
|
|
6
|
+
* @public
|
|
7
|
+
* @interface ICredentialStorage
|
|
8
|
+
*/
|
|
9
|
+
export interface ICredentialStorage {
|
|
10
|
+
/**
|
|
11
|
+
*
|
|
12
|
+
* save credential to the storage
|
|
13
|
+
*
|
|
14
|
+
* @param {W3CCredential} credential - credential to save
|
|
15
|
+
* @returns `{Promise<void>}`
|
|
16
|
+
*/
|
|
17
|
+
saveCredential(credential: W3CCredential): Promise<void>;
|
|
18
|
+
/**
|
|
19
|
+
*
|
|
20
|
+
* save all credential (upsert) to the storage
|
|
21
|
+
*
|
|
22
|
+
* @param {W3CCredential[]} credentials - credentials to save
|
|
23
|
+
* @returns `Promise<void>`
|
|
24
|
+
*/
|
|
25
|
+
saveAllCredentials(credentials: W3CCredential[]): Promise<void>;
|
|
26
|
+
/**
|
|
27
|
+
* returns all credentials in the storage
|
|
28
|
+
*
|
|
29
|
+
* @returns `Promise<W3CCredential[]>`
|
|
30
|
+
*/
|
|
31
|
+
listCredentials(): Promise<W3CCredential[]>;
|
|
32
|
+
/**
|
|
33
|
+
* Removes credential from storage
|
|
34
|
+
*
|
|
35
|
+
* @param {string} id - id of credential
|
|
36
|
+
* @returns `Promise<void>`
|
|
37
|
+
*/
|
|
38
|
+
removeCredential(id: string): Promise<void>;
|
|
39
|
+
/**
|
|
40
|
+
* finds credential in the storage for given query
|
|
41
|
+
*
|
|
42
|
+
* @param {ProofQuery} query - query to apply
|
|
43
|
+
* @returns `{Promise<W3CCredential[]>}`
|
|
44
|
+
*/
|
|
45
|
+
findCredentialsByQuery(query: ProofQuery): Promise<W3CCredential[]>;
|
|
46
|
+
/**
|
|
47
|
+
* finds credential by identifier
|
|
48
|
+
*
|
|
49
|
+
* @param {string} id - id of credential
|
|
50
|
+
* @returns `{(Promise<W3CCredential | undefined>)}`
|
|
51
|
+
*/
|
|
52
|
+
findCredentialById(id: string): Promise<W3CCredential | undefined>;
|
|
53
|
+
}
|
|
@@ -0,0 +1,41 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Generic Key/Value Data Source for crud operation
|
|
3
|
+
*
|
|
4
|
+
* @public
|
|
5
|
+
* @interface IDataSource
|
|
6
|
+
* @template Type - generic type
|
|
7
|
+
*/
|
|
8
|
+
export interface IDataSource<Type> {
|
|
9
|
+
/**
|
|
10
|
+
* load all object with Type from data source
|
|
11
|
+
*
|
|
12
|
+
* @returns `{Type[]}`
|
|
13
|
+
*/
|
|
14
|
+
load(): Promise<Type[]>;
|
|
15
|
+
|
|
16
|
+
/**
|
|
17
|
+
* Save value under the key with optional key name
|
|
18
|
+
*
|
|
19
|
+
* @param {string} key - key value
|
|
20
|
+
* @param {Type} value - value to store
|
|
21
|
+
* @param {string} [keyName] - key name
|
|
22
|
+
*/
|
|
23
|
+
save(key: string, value: Type, keyName?: string): Promise<void>;
|
|
24
|
+
|
|
25
|
+
/**
|
|
26
|
+
* returns data value for key value and optional key name
|
|
27
|
+
*
|
|
28
|
+
* @param {string} key - key value
|
|
29
|
+
* @param {string} [keyName] - key name
|
|
30
|
+
* @returns ` {(Type | undefined)}`
|
|
31
|
+
*/
|
|
32
|
+
get(key: string, keyName?: string): Promise<Type | undefined>;
|
|
33
|
+
|
|
34
|
+
/**
|
|
35
|
+
* deletes data value for given key with an optional key name
|
|
36
|
+
*
|
|
37
|
+
* @param {string} key - key value
|
|
38
|
+
* @param {string} [keyName] - key name
|
|
39
|
+
*/
|
|
40
|
+
delete(key: string, keyName?: string): Promise<void>;
|
|
41
|
+
}
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
import { ICredentialStorage } from './credentials';
|
|
2
|
+
import { IIdentityStorage } from './identity';
|
|
3
|
+
import { IMerkleTreeStorage } from './merkletree';
|
|
4
|
+
import { IStateStorage } from './state';
|
|
5
|
+
|
|
6
|
+
/**
|
|
7
|
+
* General Data storage interface that union identity, credential, merkletree and states storage.
|
|
8
|
+
*
|
|
9
|
+
* @public
|
|
10
|
+
* @interface IDataStorage
|
|
11
|
+
*/
|
|
12
|
+
export interface IDataStorage {
|
|
13
|
+
credential: ICredentialStorage;
|
|
14
|
+
identity: IIdentityStorage;
|
|
15
|
+
mt: IMerkleTreeStorage;
|
|
16
|
+
states: IStateStorage;
|
|
17
|
+
}
|
|
@@ -0,0 +1,73 @@
|
|
|
1
|
+
import { Identity } from '../entities';
|
|
2
|
+
import { Profile } from '../entities';
|
|
3
|
+
|
|
4
|
+
/**
|
|
5
|
+
* storage for identities and profiles
|
|
6
|
+
*
|
|
7
|
+
* @public
|
|
8
|
+
* @interface IIdentityStorage
|
|
9
|
+
*/
|
|
10
|
+
export interface IIdentityStorage {
|
|
11
|
+
/**
|
|
12
|
+
* saves identity to the data source
|
|
13
|
+
*
|
|
14
|
+
* @param {Identity} identity
|
|
15
|
+
* @returns `{Promise<void>}`
|
|
16
|
+
*/
|
|
17
|
+
saveIdentity(identity: Identity): Promise<void>;
|
|
18
|
+
/**
|
|
19
|
+
* gets identity from the the data source
|
|
20
|
+
*
|
|
21
|
+
*
|
|
22
|
+
* @param {string} identifier - id of identity
|
|
23
|
+
* @returns `{(Promise<Identity | undefined>)}`
|
|
24
|
+
*/
|
|
25
|
+
getIdentity(identifier: string): Promise<Identity | undefined>;
|
|
26
|
+
/**
|
|
27
|
+
*
|
|
28
|
+
* gets all identity from the data source
|
|
29
|
+
*
|
|
30
|
+
* @returns `{Promise<Identity[]>}`
|
|
31
|
+
*/
|
|
32
|
+
getAllIdentities(): Promise<Identity[]>;
|
|
33
|
+
|
|
34
|
+
/**
|
|
35
|
+
*
|
|
36
|
+
* saves profile identity to data
|
|
37
|
+
*
|
|
38
|
+
* @param {Profile} profile - identity profile
|
|
39
|
+
* @returns `{Promise<void>}`
|
|
40
|
+
*/
|
|
41
|
+
saveProfile(profile: Profile): Promise<void>;
|
|
42
|
+
/**
|
|
43
|
+
* gets profile by verifier
|
|
44
|
+
* @deprecated The method should not be used. It returns only one profile per verifier, which can potentially restrict business use cases
|
|
45
|
+
* @param {string} verifier - verifier to which profile has been shared
|
|
46
|
+
* @returns `{Promise<Profile>}`
|
|
47
|
+
*/
|
|
48
|
+
getProfileByVerifier(verifier: string): Promise<Profile | undefined>;
|
|
49
|
+
|
|
50
|
+
/**
|
|
51
|
+
* gets profile by verifiers
|
|
52
|
+
* @param {string} verifier - verifier to which profile has been shared
|
|
53
|
+
* @param {string[]} tags - optional tag to filter profile entry
|
|
54
|
+
* @returns `{Promise<Profile[]>}`
|
|
55
|
+
*/
|
|
56
|
+
getProfilesByVerifier(verifier: string, tags?: string[]): Promise<Profile[]>;
|
|
57
|
+
|
|
58
|
+
/**
|
|
59
|
+
* gets profile by identifier
|
|
60
|
+
*
|
|
61
|
+
* @param {string} identifier - profile id
|
|
62
|
+
* @returns `{Promise<Profile>}`
|
|
63
|
+
*/
|
|
64
|
+
getProfileById(identifier: string): Promise<Profile | undefined>;
|
|
65
|
+
/**
|
|
66
|
+
*
|
|
67
|
+
* gets profile identity by genesis identifiers
|
|
68
|
+
*
|
|
69
|
+
* @param {string} genesisIdentifier - genesis identifier from which profile has been derived
|
|
70
|
+
* @returns `{Promise<Profile[]>}`
|
|
71
|
+
*/
|
|
72
|
+
getProfilesByGenesisIdentifier(genesisIdentifier: string): Promise<Profile[]>;
|
|
73
|
+
}
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
export * from './credentials';
|
|
2
|
+
export * from './identity';
|
|
3
|
+
export * from './merkletree';
|
|
4
|
+
export * from './state';
|
|
5
|
+
export * from './data-storage';
|
|
6
|
+
export * from './data-source';
|
|
7
|
+
export * from './circuits';
|
|
8
|
+
export * from './onchain-zkp-verifier';
|
|
9
|
+
export * from './onchain-revocation';
|
|
10
|
+
export * from './onchain-issuer';
|
|
@@ -0,0 +1,52 @@
|
|
|
1
|
+
import { Merkletree } from '@iden3/js-merkletree';
|
|
2
|
+
import { IdentityMerkleTreeMetaInformation, MerkleTreeType } from '../entities/mt';
|
|
3
|
+
|
|
4
|
+
/**
|
|
5
|
+
* Interface to work with a merkle tree storage
|
|
6
|
+
*
|
|
7
|
+
* @public
|
|
8
|
+
* @interface IMerkleTreeStorage
|
|
9
|
+
*/
|
|
10
|
+
export interface IMerkleTreeStorage {
|
|
11
|
+
/**
|
|
12
|
+
* creates merkle tree in the storage
|
|
13
|
+
*
|
|
14
|
+
* @param {string} identifier
|
|
15
|
+
* @returns `Promise<IdentityMerkleTreeMetaInformation[]>`
|
|
16
|
+
*/
|
|
17
|
+
createIdentityMerkleTrees(identifier: string): Promise<IdentityMerkleTreeMetaInformation[]>;
|
|
18
|
+
|
|
19
|
+
/**
|
|
20
|
+
* adds entry to merkle tree
|
|
21
|
+
*
|
|
22
|
+
* @param {string} identifier - identifier to which tree belongs
|
|
23
|
+
* @param {MerkleTreeType} mtType - merkle tree type
|
|
24
|
+
* @param {bigint} hindex - hash index
|
|
25
|
+
* @param {bigint} hvalue - hash value
|
|
26
|
+
* @returns `Promise<void>`
|
|
27
|
+
*/
|
|
28
|
+
addToMerkleTree(
|
|
29
|
+
identifier: string,
|
|
30
|
+
mtType: MerkleTreeType,
|
|
31
|
+
hindex: bigint,
|
|
32
|
+
hvalue: bigint
|
|
33
|
+
): Promise<void>;
|
|
34
|
+
|
|
35
|
+
/**
|
|
36
|
+
* gets merkle tree by identifier and type
|
|
37
|
+
*
|
|
38
|
+
* @param {string} identifier - identifier for tree
|
|
39
|
+
* @param {MerkleTreeType} mtType - merkle tree type
|
|
40
|
+
* @returns `{Promise<Merkletree>}`
|
|
41
|
+
*/
|
|
42
|
+
getMerkleTreeByIdentifierAndType(identifier: string, mtType: MerkleTreeType): Promise<Merkletree>;
|
|
43
|
+
|
|
44
|
+
/**
|
|
45
|
+
* binding to be able to update identifier that belongs to tree
|
|
46
|
+
*
|
|
47
|
+
* @param {string} oldIdentifier -
|
|
48
|
+
* @param {string} newIdentifier -
|
|
49
|
+
* @returns `{Promise<void>}`
|
|
50
|
+
*/
|
|
51
|
+
bindMerkleTreeToNewIdentifier(oldIdentifier: string, newIdentifier: string): Promise<void>;
|
|
52
|
+
}
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import { DID } from '@mocanetwork/moca-iden3';
|
|
2
|
+
import { W3CCredential } from '../../verifiable';
|
|
3
|
+
|
|
4
|
+
/**
|
|
5
|
+
* Interface that allows the processing of the on-chain issuer
|
|
6
|
+
*
|
|
7
|
+
* @beta
|
|
8
|
+
* @interface IOnchainIssuer
|
|
9
|
+
*/
|
|
10
|
+
export interface IOnchainIssuer {
|
|
11
|
+
getCredential(issuerDID: DID, userDID: DID, credentialId: bigint): Promise<W3CCredential>;
|
|
12
|
+
getUserCredentialIds(issuerDID: DID, userDID: DID): Promise<bigint[]>;
|
|
13
|
+
}
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
import { RevocationStatus } from '../../verifiable';
|
|
2
|
+
/**
|
|
3
|
+
* Interface that defines methods for onchain revocation store
|
|
4
|
+
*
|
|
5
|
+
* @public
|
|
6
|
+
* @interface IOnchainRevocationStore
|
|
7
|
+
*/
|
|
8
|
+
export interface IOnchainRevocationStore {
|
|
9
|
+
/**
|
|
10
|
+
* gets latest state of identity
|
|
11
|
+
*
|
|
12
|
+
* @param {bigint} issuerID - issuer id
|
|
13
|
+
* @param {bigint} state - issuer state
|
|
14
|
+
* @param {number} nonce - revocation nonce
|
|
15
|
+
* @returns `Promise<StateInfo>`
|
|
16
|
+
*/
|
|
17
|
+
getRevocationStatusByIdAndState(
|
|
18
|
+
issuerID: bigint,
|
|
19
|
+
state: bigint,
|
|
20
|
+
nonce: number
|
|
21
|
+
): Promise<RevocationStatus>;
|
|
22
|
+
}
|
|
@@ -0,0 +1,94 @@
|
|
|
1
|
+
import { Signer } from 'ethers';
|
|
2
|
+
import {
|
|
3
|
+
AuthProof,
|
|
4
|
+
ContractInvokeTransactionData,
|
|
5
|
+
JsonDocumentObjectValue,
|
|
6
|
+
ZeroKnowledgeInvokeResponse,
|
|
7
|
+
ZeroKnowledgeProofResponse
|
|
8
|
+
} from '../../iden3comm';
|
|
9
|
+
import { TxPreparationResultSubmitResponse } from '../blockchain/onchain-zkp-verifier';
|
|
10
|
+
|
|
11
|
+
/**
|
|
12
|
+
* Interface that defines methods for ZKP verifier
|
|
13
|
+
*
|
|
14
|
+
* @beta
|
|
15
|
+
* @interface IOnChainZKPVerifier
|
|
16
|
+
*/
|
|
17
|
+
export interface IOnChainZKPVerifier {
|
|
18
|
+
/**
|
|
19
|
+
* Submit ZKP Responses to OnChainZKPVerifier contract.
|
|
20
|
+
* @beta
|
|
21
|
+
* @param {Signer} ethSigner - tx signer
|
|
22
|
+
* @param {txData} ContractInvokeTransactionData - transaction data
|
|
23
|
+
* @param {ZeroKnowledgeProofResponse[]} zkProofResponses - zkProofResponses
|
|
24
|
+
* @returns {Promise<Map<string, ZeroKnowledgeProofResponse>>} - map of transaction hash - ZeroKnowledgeProofResponse
|
|
25
|
+
*/
|
|
26
|
+
submitZKPResponse(
|
|
27
|
+
ethSigner: Signer,
|
|
28
|
+
txData: ContractInvokeTransactionData,
|
|
29
|
+
zkProofResponses: ZeroKnowledgeProofResponse[]
|
|
30
|
+
): Promise<Map<string, ZeroKnowledgeProofResponse>>;
|
|
31
|
+
|
|
32
|
+
/**
|
|
33
|
+
* Submit ZKP Response V2 to OnChainZKPVerifier contract.
|
|
34
|
+
* @beta
|
|
35
|
+
* @param {Signer} ethSigner - tx signer
|
|
36
|
+
* @param {txData} ContractInvokeTransactionData - transaction data
|
|
37
|
+
* @param {ZeroKnowledgeProofResponse[]} zkProofResponses - zkProofResponses
|
|
38
|
+
* @returns {Promise<Map<string, ZeroKnowledgeProofResponse[]>>} - map of transaction hash - ZeroKnowledgeProofResponse[]
|
|
39
|
+
*/
|
|
40
|
+
submitZKPResponseV2(
|
|
41
|
+
ethSigner: Signer,
|
|
42
|
+
txData: ContractInvokeTransactionData,
|
|
43
|
+
zkProofResponses: ZeroKnowledgeProofResponse[]
|
|
44
|
+
): Promise<Map<string, ZeroKnowledgeProofResponse[]>>;
|
|
45
|
+
|
|
46
|
+
/**
|
|
47
|
+
* Submit Response to OnChainZKPVerifier contract.
|
|
48
|
+
* @beta
|
|
49
|
+
* @param {Signer} ethSigner - tx signer
|
|
50
|
+
* @param {txData} ContractInvokeTransactionData - transaction data
|
|
51
|
+
* @param {AuthProofResponse} authResponse - authResponse
|
|
52
|
+
* @param {ZeroKnowledgeProofMultiQueryResponse[]} responses - singleResponses and groupedResponses
|
|
53
|
+
* @param {ZeroKnowledgeProofAuthResponse} [authProof] - authProof in case of authV2
|
|
54
|
+
* @returns {Promise<Map<string, ZeroKnowledgeInvokeResponse>>} - map of transaction hash - ZeroKnowledgeInvokeResponse
|
|
55
|
+
*/
|
|
56
|
+
submitResponse(
|
|
57
|
+
ethSigner: Signer,
|
|
58
|
+
txData: ContractInvokeTransactionData,
|
|
59
|
+
responses: ZeroKnowledgeProofResponse[],
|
|
60
|
+
authProof: AuthProof
|
|
61
|
+
): Promise<Map<string, ZeroKnowledgeInvokeResponse>>;
|
|
62
|
+
|
|
63
|
+
/**
|
|
64
|
+
* Returns tx args for the ZKP verifier contract submission (singe tx args for each response).
|
|
65
|
+
* @param txData
|
|
66
|
+
* @param zkProofResponse
|
|
67
|
+
*/
|
|
68
|
+
prepareTxArgsSubmitV1(
|
|
69
|
+
txData: ContractInvokeTransactionData,
|
|
70
|
+
zkProofResponse: ZeroKnowledgeProofResponse
|
|
71
|
+
): Promise<JsonDocumentObjectValue[]>;
|
|
72
|
+
|
|
73
|
+
/**
|
|
74
|
+
* Returns args for the ZKP verifier contract submission V2 (single tx args for an array of responses).
|
|
75
|
+
* @param txData
|
|
76
|
+
* @param zkProofResponses
|
|
77
|
+
*/
|
|
78
|
+
prepareTxArgsSubmitV2(
|
|
79
|
+
txData: ContractInvokeTransactionData,
|
|
80
|
+
zkProofResponses: ZeroKnowledgeProofResponse[]
|
|
81
|
+
): Promise<JsonDocumentObjectValue[]>;
|
|
82
|
+
|
|
83
|
+
/**
|
|
84
|
+
* Returns args for the verifier multi-query contract submission (single tx args for an array of responses).
|
|
85
|
+
* @param {txData} ContractInvokeTransactionData - transaction data
|
|
86
|
+
* @param {authProof} AuthProof - AuthProof
|
|
87
|
+
* @param {ZeroKnowledgeProofMultiQueryResponse[]} responses - singleResponses and groupedResponses
|
|
88
|
+
*/
|
|
89
|
+
prepareTxArgsSubmit(
|
|
90
|
+
txData: ContractInvokeTransactionData,
|
|
91
|
+
responses: ZeroKnowledgeProofResponse[],
|
|
92
|
+
authProof: AuthProof
|
|
93
|
+
): Promise<{ result: TxPreparationResultSubmitResponse; txDataArgs: JsonDocumentObjectValue[] }>;
|
|
94
|
+
}
|
|
@@ -0,0 +1,81 @@
|
|
|
1
|
+
import { ZKProof } from '@iden3/js-jwz';
|
|
2
|
+
import { JsonRpcProvider, Signer } from 'ethers';
|
|
3
|
+
import { RootInfo, StateInfo, StateProof } from '../entities/state';
|
|
4
|
+
import { Id } from '@mocanetwork/moca-iden3';
|
|
5
|
+
import { Hash } from '@iden3/js-merkletree';
|
|
6
|
+
|
|
7
|
+
export interface UserStateTransitionInfo {
|
|
8
|
+
userId: Id; // Identity id
|
|
9
|
+
oldUserState: Hash; // Previous identity state
|
|
10
|
+
newUserState: Hash; // New identity state
|
|
11
|
+
isOldStateGenesis: boolean; // Is the previous state genesis?
|
|
12
|
+
methodId: bigint; // State transition method id
|
|
13
|
+
methodParams: string; // State transition method-specific params
|
|
14
|
+
}
|
|
15
|
+
|
|
16
|
+
/**
|
|
17
|
+
* Interface that defines methods for state storage
|
|
18
|
+
*
|
|
19
|
+
* @public
|
|
20
|
+
* @interface IStateStorage
|
|
21
|
+
*/
|
|
22
|
+
export interface IStateStorage {
|
|
23
|
+
/**
|
|
24
|
+
* gets latest state of identity
|
|
25
|
+
*
|
|
26
|
+
* @param {bigint} id - id to check
|
|
27
|
+
* @returns `Promise<StateInfo>`
|
|
28
|
+
*/
|
|
29
|
+
getLatestStateById(id: bigint): Promise<StateInfo>;
|
|
30
|
+
|
|
31
|
+
/**
|
|
32
|
+
* gets state info of identity by id and state
|
|
33
|
+
*
|
|
34
|
+
* @param {bigint} id - id to check
|
|
35
|
+
* @param {bigint} state - state to check
|
|
36
|
+
* @returns `Promise<StateInfo>`
|
|
37
|
+
*/
|
|
38
|
+
getStateInfoByIdAndState(id: bigint, state: bigint): Promise<StateInfo>;
|
|
39
|
+
/**
|
|
40
|
+
* method to publish state onchain
|
|
41
|
+
*
|
|
42
|
+
* @param {ZKProof} proof - proof to publish
|
|
43
|
+
* @param {Signer} signer - signer of transaction
|
|
44
|
+
* @returns `Promise<string>` - transaction identifier
|
|
45
|
+
*/
|
|
46
|
+
publishState(proof: ZKProof | undefined, signer: Signer): Promise<string>;
|
|
47
|
+
/**
|
|
48
|
+
* method to publish state onchain
|
|
49
|
+
*
|
|
50
|
+
* @param {Signer} signer - signer of transaction
|
|
51
|
+
* @param {UserStateTransitionInfo} userStateTransitionInfo - user state transition information
|
|
52
|
+
* @returns `Promise<string>` - transaction identifier
|
|
53
|
+
*/
|
|
54
|
+
publishStateGeneric(
|
|
55
|
+
signer: Signer,
|
|
56
|
+
userStateTransitionInfo?: UserStateTransitionInfo
|
|
57
|
+
): Promise<string>;
|
|
58
|
+
/**
|
|
59
|
+
* generates proof of inclusion / non-inclusion to global identity state for given identity
|
|
60
|
+
*
|
|
61
|
+
* @param {bigint} id - id to check
|
|
62
|
+
* @returns `Promise<StateProof>`
|
|
63
|
+
*/
|
|
64
|
+
getGISTProof(id: bigint): Promise<StateProof>;
|
|
65
|
+
|
|
66
|
+
/**
|
|
67
|
+
* gets root info of global identity state tree
|
|
68
|
+
*
|
|
69
|
+
* @param {bigint} root - root to check
|
|
70
|
+
* @param {bigint} userId - user id
|
|
71
|
+
* @returns `Promise<RootInfo>`
|
|
72
|
+
*/
|
|
73
|
+
getGISTRootInfo(root: bigint, userId: bigint): Promise<RootInfo>;
|
|
74
|
+
|
|
75
|
+
/**
|
|
76
|
+
* gets RPC provider
|
|
77
|
+
*
|
|
78
|
+
* @returns `Promise<JsonRpcProvider>`
|
|
79
|
+
*/
|
|
80
|
+
getRpcProvider(): JsonRpcProvider;
|
|
81
|
+
}
|