@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,472 @@
|
|
|
1
|
+
import { KMS, KmsKeyId, KmsKeyType } from '../kms';
|
|
2
|
+
import { Claim, DID } from '@mocanetwork/moca-iden3';
|
|
3
|
+
import { Signature } from '@iden3/js-crypto';
|
|
4
|
+
import { IDataStorage, Profile } from '../storage';
|
|
5
|
+
import { W3CCredential, MerkleTreeProofWithTreeState, CredentialStatusType, ProofQuery, CoreClaimCreationOptions } from '../verifiable';
|
|
6
|
+
import { CredentialRequest, ICredentialWallet, PublishMode, TreesModel } from '../credentials';
|
|
7
|
+
import { TreeState } from '../circuits';
|
|
8
|
+
import { Options } from '@iden3/js-jsonld-merklization';
|
|
9
|
+
import { Signer, TransactionReceipt } from 'ethers';
|
|
10
|
+
import { CredentialStatusPublisherRegistry } from '../credentials/status/credential-status-publisher';
|
|
11
|
+
import { IZKProver } from '../proof';
|
|
12
|
+
/**
|
|
13
|
+
* DID creation options
|
|
14
|
+
* seed - seed to generate BJJ key pair
|
|
15
|
+
* revocationOpts -
|
|
16
|
+
|
|
17
|
+
* @type IdentityCreationOptions
|
|
18
|
+
*/
|
|
19
|
+
export type IdentityCreationOptions = {
|
|
20
|
+
method?: string;
|
|
21
|
+
blockchain?: string;
|
|
22
|
+
networkId?: string;
|
|
23
|
+
} & AuthBJJCredentialCreationOptions;
|
|
24
|
+
/**
|
|
25
|
+
* Options for creating Auth BJJ credential
|
|
26
|
+
* seed - seed to generate BJJ key pair
|
|
27
|
+
* revocationOpts
|
|
28
|
+
* nonce - explicit revocation nonce to use
|
|
29
|
+
* onChain - onchain status related option
|
|
30
|
+
* txCallback - defines how the TransactionReceipt is handled
|
|
31
|
+
* publishMode - specifies the work of transaction polling type: sync / async / callback
|
|
32
|
+
* genesisPublishingDisabled - genesis is publishing by default. Set `true` to prevent genesis publishing
|
|
33
|
+
*/
|
|
34
|
+
export type AuthBJJCredentialCreationOptions = {
|
|
35
|
+
revocationOpts: {
|
|
36
|
+
id: string;
|
|
37
|
+
type: CredentialStatusType;
|
|
38
|
+
nonce?: number;
|
|
39
|
+
genesisPublishingDisabled?: boolean;
|
|
40
|
+
onChain?: {
|
|
41
|
+
txCallback?: (tx: TransactionReceipt) => Promise<void>;
|
|
42
|
+
publishMode?: PublishMode;
|
|
43
|
+
};
|
|
44
|
+
};
|
|
45
|
+
seed?: Uint8Array;
|
|
46
|
+
};
|
|
47
|
+
/**
|
|
48
|
+
* Options for creating Ethereum based identity
|
|
49
|
+
*/
|
|
50
|
+
export type EthereumBasedIdentityCreationOptions = IdentityCreationOptions & {
|
|
51
|
+
ethSigner?: Signer;
|
|
52
|
+
createBjjCredential?: boolean;
|
|
53
|
+
};
|
|
54
|
+
/**
|
|
55
|
+
* Options for RevocationInfoOptions.
|
|
56
|
+
*/
|
|
57
|
+
export type RevocationInfoOptions = {
|
|
58
|
+
revokedNonces?: number[];
|
|
59
|
+
treeModel?: TreesModel;
|
|
60
|
+
rhsUrl?: string;
|
|
61
|
+
onChain?: {
|
|
62
|
+
txCallback?: (tx: TransactionReceipt) => Promise<void>;
|
|
63
|
+
publishMode?: PublishMode;
|
|
64
|
+
};
|
|
65
|
+
};
|
|
66
|
+
/**
|
|
67
|
+
* Proof creation result
|
|
68
|
+
*
|
|
69
|
+
* @public
|
|
70
|
+
* @interface Iden3ProofCreationResult
|
|
71
|
+
*/
|
|
72
|
+
export interface Iden3ProofCreationResult {
|
|
73
|
+
credentials: W3CCredential[];
|
|
74
|
+
oldTreeState: TreeState;
|
|
75
|
+
newTreeState: TreeState;
|
|
76
|
+
}
|
|
77
|
+
/**
|
|
78
|
+
* Interface for IdentityWallet
|
|
79
|
+
* @public
|
|
80
|
+
*/
|
|
81
|
+
export interface IIdentityWallet {
|
|
82
|
+
/**
|
|
83
|
+
* Create Identity creates Auth BJJ credential,
|
|
84
|
+
* Merkle trees for claims, revocations and root of roots,
|
|
85
|
+
* adds auth BJJ credential to claims tree and generates mtp of inclusion
|
|
86
|
+
* based on the resulting state it provides an identifier in DID form.
|
|
87
|
+
*
|
|
88
|
+
* @param {IdentityCreationOptions} opts - default is did:iden3:polygon:amoy** with generated key.
|
|
89
|
+
* @returns `Promise<{ did: DID; credential: W3CCredential }>` - returns did and Auth BJJ credential
|
|
90
|
+
* @public
|
|
91
|
+
*/
|
|
92
|
+
createIdentity(opts: IdentityCreationOptions): Promise<{
|
|
93
|
+
did: DID;
|
|
94
|
+
credential: W3CCredential;
|
|
95
|
+
}>;
|
|
96
|
+
/**
|
|
97
|
+
* Credential wallet getter
|
|
98
|
+
*
|
|
99
|
+
* @returns {ICredentialWallet}
|
|
100
|
+
* @memberof IIdentityWallet
|
|
101
|
+
*/
|
|
102
|
+
get credentialWallet(): ICredentialWallet;
|
|
103
|
+
/**
|
|
104
|
+
* Create Identity based in Ethereum address and it provides an identifier in DID form.
|
|
105
|
+
*
|
|
106
|
+
* @param {IdentityCreationOptions} opts - default is did:iden3:polygon:amoy** with generated key.
|
|
107
|
+
* @returns `Promise<{ did: DID; credential: W3CCredential | undefined }>` - returns did and Auth BJJ credential
|
|
108
|
+
* @public
|
|
109
|
+
*/
|
|
110
|
+
createEthereumBasedIdentity(opts: EthereumBasedIdentityCreationOptions): Promise<{
|
|
111
|
+
did: DID;
|
|
112
|
+
credential: W3CCredential | undefined;
|
|
113
|
+
}>;
|
|
114
|
+
/**
|
|
115
|
+
* Creates profile based on genesis identifier
|
|
116
|
+
*
|
|
117
|
+
* @param {DID} did - identity to derive profile from
|
|
118
|
+
* @param {number |string} nonce - unique integer number to generate a profile
|
|
119
|
+
* @param {string} verifier - verifier identity/alias in a string from
|
|
120
|
+
* @param {string[]} tags - optional tag that can be assigned to profile by client
|
|
121
|
+
* @returns `Promise<DID>` - profile did
|
|
122
|
+
*/
|
|
123
|
+
createProfile(did: DID, nonce: number | string, verifier: string, tags?: string[]): Promise<DID>;
|
|
124
|
+
/**
|
|
125
|
+
* Generates a new key
|
|
126
|
+
*
|
|
127
|
+
* @param {KmsKeyType} keyType - supported key type by KMS
|
|
128
|
+
* @returns `Promise<KmsKeyId>` - creates a new key BJJ or ECDSA
|
|
129
|
+
*/
|
|
130
|
+
generateKey(keyType: KmsKeyType): Promise<KmsKeyId>;
|
|
131
|
+
/**
|
|
132
|
+
* Issues new credential from issuer according to the claim request
|
|
133
|
+
*
|
|
134
|
+
* @param {DID} issuerDID - issuer identity
|
|
135
|
+
* @param {CredentialRequest} req - claim request
|
|
136
|
+
* @returns `Promise<W3CCredential>` - returns created W3CCredential
|
|
137
|
+
*/
|
|
138
|
+
issueCredential(issuerDID: DID, req: CredentialRequest, opts?: Options): Promise<W3CCredential>;
|
|
139
|
+
/**
|
|
140
|
+
* Gets a tree model for given did that includes claims tree, revocation tree, the root of roots tree and calculated state hash
|
|
141
|
+
*
|
|
142
|
+
* @param {DID} did - did which trees info we need to receive
|
|
143
|
+
* @returns `Promise<TreesModel>`
|
|
144
|
+
* */
|
|
145
|
+
getDIDTreeModel(did: DID): Promise<TreesModel>;
|
|
146
|
+
/**
|
|
147
|
+
* Generates proof of credential inclusion / non-inclusion to the given claims tree
|
|
148
|
+
* and its root or to the current root of the Claims tree in the given Merkle tree storage.
|
|
149
|
+
*
|
|
150
|
+
* @param {DID} did - issuer did
|
|
151
|
+
* @param {W3CCredential} credential - credential to generate mtp
|
|
152
|
+
* @param {TreeState} [treeState] - tree state when to generate a proof
|
|
153
|
+
* @returns `Promise<MerkleTreeProofWithTreeState>` - MerkleTreeProof and TreeState on which proof has been generated
|
|
154
|
+
*/
|
|
155
|
+
generateCredentialMtp(did: DID, credential: W3CCredential, treeState?: TreeState): Promise<MerkleTreeProofWithTreeState>;
|
|
156
|
+
/**
|
|
157
|
+
* Generates proof of core claim inclusion / non-inclusion to the given claims tree
|
|
158
|
+
* and its root or to the current root of the Claims tree in the given Merkle tree storage.
|
|
159
|
+
*
|
|
160
|
+
* @param {DID} did - issuer did
|
|
161
|
+
* @param {core.Claim} core - core claim to generate mtp
|
|
162
|
+
* @param {TreeState} [treeState] - tree state when to generate a proof
|
|
163
|
+
* @returns `Promise<MerkleTreeProofWithTreeState>` - MerkleTreeProof and TreeState on which proof has been generated
|
|
164
|
+
*/
|
|
165
|
+
generateCoreClaimMtp(did: DID, coreClaim: Claim, treeState?: TreeState): Promise<MerkleTreeProofWithTreeState>;
|
|
166
|
+
/**
|
|
167
|
+
* Generates proof of credential revocation nonce (with credential as a param) inclusion / non-inclusion to the given revocation tree
|
|
168
|
+
* and its root or to the current root of the Revocation tree in the given Merkle tree storage.
|
|
169
|
+
*
|
|
170
|
+
* @param {DID} did
|
|
171
|
+
* @param {W3CCredential} credential
|
|
172
|
+
* @param {TreeState} [treeState]
|
|
173
|
+
* @returns `Promise<MerkleTreeProofWithTreeState>` - MerkleTreeProof and TreeState on which proof has been generated
|
|
174
|
+
*/
|
|
175
|
+
generateNonRevocationMtp(did: DID, credential: W3CCredential, treeState?: TreeState): Promise<MerkleTreeProofWithTreeState>;
|
|
176
|
+
/**
|
|
177
|
+
* Generates proof of credential revocation nonce (with revNonce as a param) inclusion / non-inclusion to the given revocation tree
|
|
178
|
+
* and its root or to the current root of the Revocation tree in the given Merkle tree storage.
|
|
179
|
+
*
|
|
180
|
+
* @param {DID} did
|
|
181
|
+
* @param {bigint} revNonce
|
|
182
|
+
* @param {TreeState} [treeState]
|
|
183
|
+
* @returns `Promise<MerkleTreeProofWithTreeState>` - MerkleTreeProof and TreeState on which proof has been generated
|
|
184
|
+
*/
|
|
185
|
+
generateNonRevocationMtpWithNonce(did: DID, revNonce: bigint, treeState?: TreeState): Promise<MerkleTreeProofWithTreeState>;
|
|
186
|
+
/**
|
|
187
|
+
* Signs a payload of arbitrary size with an Auth BJJ Credential that identifies a key for signing.
|
|
188
|
+
*
|
|
189
|
+
* @param {Uint8Array} payload
|
|
190
|
+
* @param {W3CCredential} credential - Auth BJJ Credential
|
|
191
|
+
* @returns `Promise<Signature>`- the signature object with R8 and S params
|
|
192
|
+
*/
|
|
193
|
+
sign(payload: Uint8Array, credential: W3CCredential): Promise<Signature>;
|
|
194
|
+
/**
|
|
195
|
+
* Signs a big integer with an Auth BJJ Credential that identifies a key for signing.
|
|
196
|
+
*
|
|
197
|
+
*
|
|
198
|
+
* @param {bigint} payload - big number in Field
|
|
199
|
+
* @param {W3CCredential} credential - Auth BJJ credential
|
|
200
|
+
* @returns `Promise<Signature>` - the signature object with R8 and S params
|
|
201
|
+
*/
|
|
202
|
+
signChallenge(payload: bigint, credential: W3CCredential): Promise<Signature>;
|
|
203
|
+
/**
|
|
204
|
+
*
|
|
205
|
+
*
|
|
206
|
+
* @param {DID} issuerDID - identifier of the issuer
|
|
207
|
+
* @param {W3CCredential} credential - credential to revoke
|
|
208
|
+
* @returns `Promise<number>` a revocation nonce of credential
|
|
209
|
+
*/
|
|
210
|
+
revokeCredential(issuerDID: DID, credential: W3CCredential): Promise<number>;
|
|
211
|
+
/**
|
|
212
|
+
* Generate Iden3SparseMerkleTree proof of inclusion to issuer state of specific credentials
|
|
213
|
+
*
|
|
214
|
+
* @param {DID} issuerDID - issuer did
|
|
215
|
+
* @param {W3CCredential[]} credentials - list of verifiable credentials to generate a proof
|
|
216
|
+
* @param {string} txId - transaction hash in which state transition has been done
|
|
217
|
+
* @param {number} [blockNumber] - block number in which state transition has been done
|
|
218
|
+
* @param {number} [blockTimestamp] - block timestamp in which state transition has been done
|
|
219
|
+
* @returns `Promise<W3CCredential[]>` credentials with an Iden3SparseMerkleTreeProof
|
|
220
|
+
*/
|
|
221
|
+
generateIden3SparseMerkleTreeProof(issuerDID: DID, credentials: W3CCredential[], txId: string, blockNumber?: number, blockTimestamp?: number): Promise<W3CCredential[]>;
|
|
222
|
+
/**
|
|
223
|
+
* Adds verifiable credentials to issuer Claims Merkle tree
|
|
224
|
+
*
|
|
225
|
+
* @param {W3CCredential[]} credentials - credentials to include in the claims tree
|
|
226
|
+
* @param {DID} issuerDID - issuer did
|
|
227
|
+
* @returns `Promise<Iden3ProofCreationResult>`- old tree state and tree state with included credentials
|
|
228
|
+
*/
|
|
229
|
+
addCredentialsToMerkleTree(credentials: W3CCredential[], issuerDID: DID): Promise<Iden3ProofCreationResult>;
|
|
230
|
+
/**
|
|
231
|
+
* Publishes issuer state to the reverse hash service by given URL
|
|
232
|
+
*
|
|
233
|
+
* @deprecated use publishRevocationInfoByCredentialStatusType instead with the same arguments in opts
|
|
234
|
+
* @param {DID} issuerDID - issuer did
|
|
235
|
+
* @param {string} rhsURL - reverse hash service URL
|
|
236
|
+
* @param {number[]} [revokedNonces] - revoked nonces for the period from the last published
|
|
237
|
+
* @returns `Promise<void>`
|
|
238
|
+
*/
|
|
239
|
+
publishStateToRHS(issuerDID: DID, rhsURL: string, revokedNonces?: number[], opts?: object): Promise<void>;
|
|
240
|
+
/**
|
|
241
|
+
* Publishes specific state to the reverse hash service by given URL
|
|
242
|
+
* @deprecated use publishRevocationInfoByCredentialStatusType instead with the same arguments in opts
|
|
243
|
+
* @param {TreesModel} treeModel - trees model to publish
|
|
244
|
+
* @param {string} rhsURL - reverse hash service URL
|
|
245
|
+
* @param {number[]} [revokedNonces] - revoked nonces for the period from the last published
|
|
246
|
+
* @returns `Promise<void>`
|
|
247
|
+
*/
|
|
248
|
+
publishSpecificStateToRHS(treeModel: TreesModel, rhsURL: string, revokedNonces?: number[], opts?: object): Promise<void>;
|
|
249
|
+
/**
|
|
250
|
+
* Publishes revocation info by credential status predefined publishers
|
|
251
|
+
*
|
|
252
|
+
* @param {(RevocationInfoOptions)} opts
|
|
253
|
+
* @returns {Promise<void>}
|
|
254
|
+
* @memberof IIdentityWallet
|
|
255
|
+
*/
|
|
256
|
+
publishRevocationInfoByCredentialStatusType(issuerDID: DID, credentialStatusType: CredentialStatusType, opts?: RevocationInfoOptions): Promise<void>;
|
|
257
|
+
/**
|
|
258
|
+
* Extracts core claim from signature or merkle tree proof. If both proof persists core claim must be the same
|
|
259
|
+
*
|
|
260
|
+
* @public
|
|
261
|
+
* @param {W3CCredential} credential - credential to extract core claim
|
|
262
|
+
* @returns `{Promise<Claim>}`
|
|
263
|
+
*/
|
|
264
|
+
getCoreClaimFromCredential(credential: W3CCredential): Promise<Claim>;
|
|
265
|
+
/**
|
|
266
|
+
*
|
|
267
|
+
* gets profile identity by genesis identifiers
|
|
268
|
+
*
|
|
269
|
+
* @param {DID} did - genesis identifier from which profile has been derived
|
|
270
|
+
* @returns `{Promise<Profile[]>}`
|
|
271
|
+
*/
|
|
272
|
+
getProfilesByDID(did: DID): Promise<Profile[]>;
|
|
273
|
+
/**
|
|
274
|
+
*
|
|
275
|
+
* gets profile nonce by it's id. if profile is genesis identifier - 0 is returned
|
|
276
|
+
*
|
|
277
|
+
* @param {DID} did - profile that has been derived or genesis identity
|
|
278
|
+
* @returns `{Promise<{nonce:number, genesisIdentifier: DID}>}`
|
|
279
|
+
*/
|
|
280
|
+
getGenesisDIDMetadata(did: DID): Promise<{
|
|
281
|
+
nonce: number | string;
|
|
282
|
+
genesisDID: DID;
|
|
283
|
+
}>;
|
|
284
|
+
/**
|
|
285
|
+
*
|
|
286
|
+
* find all credentials that belong to any profile or genesis identity for the given did
|
|
287
|
+
*
|
|
288
|
+
* @param {DID} did - profile that has been derived or genesis identity
|
|
289
|
+
* @returns `{Promise<W3CCredential[]>}`
|
|
290
|
+
*/
|
|
291
|
+
findOwnedCredentialsByDID(did: DID, query: ProofQuery): Promise<W3CCredential[]>;
|
|
292
|
+
/**
|
|
293
|
+
*
|
|
294
|
+
* gets profile identity by verifier
|
|
295
|
+
* @deprecated The method should not be used. It returns only one profile per verifier, which can potentially restrict business use cases
|
|
296
|
+
* @param {string} verifier - identifier of the verifier
|
|
297
|
+
* @returns `{Promise<Profile>}`
|
|
298
|
+
*/
|
|
299
|
+
getProfileByVerifier(verifier: string): Promise<Profile | undefined>;
|
|
300
|
+
/**
|
|
301
|
+
* gets profile by verifiers
|
|
302
|
+
*
|
|
303
|
+
* @param {string} verifier - verifier to which profile has been shared
|
|
304
|
+
* @param {string} tags - optional, tags to filter profile entry
|
|
305
|
+
* @returns `{Promise<Profile[]>}`
|
|
306
|
+
*/
|
|
307
|
+
getProfilesByVerifier(verifier: string, tags?: string[]): Promise<Profile[]>;
|
|
308
|
+
/**
|
|
309
|
+
*
|
|
310
|
+
* updates latest identity state in storage with given state or latest from the trees.
|
|
311
|
+
*
|
|
312
|
+
* @param {DID} issuerDID - identifier of the issuer
|
|
313
|
+
* @param {boolean} published - if states is published onchain
|
|
314
|
+
* @param {TreeState} treeState - contains state to upgrade
|
|
315
|
+
* @returns `{Promise<void>}`
|
|
316
|
+
*/
|
|
317
|
+
updateIdentityState(issuerDID: DID, published: boolean, treeState?: TreeState): Promise<void>;
|
|
318
|
+
/**
|
|
319
|
+
*
|
|
320
|
+
* gets actual auth credential with proofs for provided tree state or latest from the trees.
|
|
321
|
+
*
|
|
322
|
+
* @param {DID} issuerDID - identifier of the issuer
|
|
323
|
+
* @param {TreeState} treeStateInfo - optional, state for retrieval
|
|
324
|
+
* @returns `{Promise<{
|
|
325
|
+
authCredential: W3CCredential;
|
|
326
|
+
incProof: MerkleTreeProofWithTreeState;
|
|
327
|
+
nonRevProof: MerkleTreeProofWithTreeState;
|
|
328
|
+
}>}`
|
|
329
|
+
*/
|
|
330
|
+
getActualAuthCredential(did: DID, treeStateInfo?: TreeState): Promise<{
|
|
331
|
+
authCredential: W3CCredential;
|
|
332
|
+
incProof: MerkleTreeProofWithTreeState;
|
|
333
|
+
nonRevProof: MerkleTreeProofWithTreeState;
|
|
334
|
+
}>;
|
|
335
|
+
/**
|
|
336
|
+
* Transit state for the identity with the given DID
|
|
337
|
+
*
|
|
338
|
+
* @param {DID} did - identifier of the user
|
|
339
|
+
* @param {TreeState} oldTreeState - old state of the user
|
|
340
|
+
* @param {boolean} isOldStateGenesis - if the old state is genesis
|
|
341
|
+
* @param {IStateStorage} stateStorage - storage to save the new state
|
|
342
|
+
* @param {Signer} ethSigner - signer to sign the transaction
|
|
343
|
+
*/
|
|
344
|
+
transitState(did: DID, oldTreeState: TreeState, isOldStateGenesis: boolean, ethSigner: Signer, prover?: IZKProver): Promise<string>;
|
|
345
|
+
/**
|
|
346
|
+
* Add BJJ credential and transit state
|
|
347
|
+
*
|
|
348
|
+
* @param {DID} did - identifier of the user
|
|
349
|
+
* @param {TreeState} oldTreeState - old tree state of the user
|
|
350
|
+
* @param {boolean} isOldTreeState - if the old state is genesis
|
|
351
|
+
* @param {Signer} ethSigner - signer to sign the transaction
|
|
352
|
+
* @param {AuthBJJCredentialCreationOptions} opts - additional options
|
|
353
|
+
*/
|
|
354
|
+
addBJJAuthCredential(did: DID, oldTreeState: TreeState, isOldTreeStateGenesis: boolean, ethSigner: Signer, opts?: AuthBJJCredentialCreationOptions): Promise<W3CCredential>;
|
|
355
|
+
}
|
|
356
|
+
/**
|
|
357
|
+
* @public
|
|
358
|
+
* Wallet instance to manage the digital identity based on iden3 protocol
|
|
359
|
+
* allows to: create identity/profile, sign payloads (bigint / bytes), generate keys,
|
|
360
|
+
* generate Merkle tree proofs of inclusion / non-inclusion to Merkle trees, issue credentials with a BJJSignature and Iden3SparseMerkleTree Proofs,
|
|
361
|
+
* revoke credentials, add credentials to Merkle trees, push states to reverse hash service
|
|
362
|
+
*
|
|
363
|
+
*
|
|
364
|
+
* @class IdentityWallet - class
|
|
365
|
+
* @implements implements IIdentityWallet interface
|
|
366
|
+
*/
|
|
367
|
+
export declare class IdentityWallet implements IIdentityWallet {
|
|
368
|
+
private readonly _kms;
|
|
369
|
+
private readonly _storage;
|
|
370
|
+
private readonly _credentialWallet;
|
|
371
|
+
private readonly _opts?;
|
|
372
|
+
private readonly _credentialStatusPublisherRegistry;
|
|
373
|
+
private readonly _inputsGenerator;
|
|
374
|
+
private readonly _transactionService;
|
|
375
|
+
/**
|
|
376
|
+
* Constructs a new instance of the `IdentityWallet` class
|
|
377
|
+
*
|
|
378
|
+
* @param {KMS} _kms - Key Management System that allows signing data with BJJ key
|
|
379
|
+
* @param {IDataStorage} _storage - data storage to access credential / identity / Merkle tree data
|
|
380
|
+
* @param {ICredentialWallet} _credentialWallet - credential wallet instance to quickly access credential CRUD functionality
|
|
381
|
+
* @public
|
|
382
|
+
*/
|
|
383
|
+
constructor(_kms: KMS, _storage: IDataStorage, _credentialWallet: ICredentialWallet, _opts?: {
|
|
384
|
+
credentialStatusPublisherRegistry?: CredentialStatusPublisherRegistry;
|
|
385
|
+
} | undefined);
|
|
386
|
+
get credentialWallet(): ICredentialWallet;
|
|
387
|
+
private getCredentialStatusPublisherRegistry;
|
|
388
|
+
private createAuthCoreClaim;
|
|
389
|
+
private createAuthBJJCredential;
|
|
390
|
+
/**
|
|
391
|
+
* {@inheritDoc IIdentityWallet.createIdentity}
|
|
392
|
+
*/
|
|
393
|
+
createIdentity(opts: IdentityCreationOptions): Promise<{
|
|
394
|
+
did: DID;
|
|
395
|
+
credential: W3CCredential;
|
|
396
|
+
}>;
|
|
397
|
+
/**
|
|
398
|
+
* {@inheritDoc IIdentityWallet.createEthereumBasedIdentity}
|
|
399
|
+
*/
|
|
400
|
+
createEthereumBasedIdentity(opts: EthereumBasedIdentityCreationOptions): Promise<{
|
|
401
|
+
did: DID;
|
|
402
|
+
credential: W3CCredential | undefined;
|
|
403
|
+
}>;
|
|
404
|
+
/** {@inheritDoc IIdentityWallet.getGenesisDIDMetadata} */
|
|
405
|
+
getGenesisDIDMetadata(did: DID): Promise<{
|
|
406
|
+
nonce: number | string;
|
|
407
|
+
genesisDID: DID;
|
|
408
|
+
}>;
|
|
409
|
+
/** {@inheritDoc IIdentityWallet.createProfile} */
|
|
410
|
+
createProfile(did: DID, nonce: number | string, verifier: string, tags?: string[]): Promise<DID>;
|
|
411
|
+
/**
|
|
412
|
+
*
|
|
413
|
+
* gets profile identity by genesis identifiers
|
|
414
|
+
*
|
|
415
|
+
* @param {string} genesisIdentifier - genesis identifier from which profile has been derived
|
|
416
|
+
* @returns `{Promise<Profile[]>}`
|
|
417
|
+
*/
|
|
418
|
+
getProfilesByDID(did: DID): Promise<Profile[]>;
|
|
419
|
+
/** {@inheritDoc IIdentityWallet.generateKey} */
|
|
420
|
+
generateKey(keyType: KmsKeyType): Promise<KmsKeyId>;
|
|
421
|
+
/**
|
|
422
|
+
* @deprecated The method should not be used. It returns only one profile per verifier, which can potentially restrict business use cases
|
|
423
|
+
* {@inheritDoc IIdentityWallet.getProfileByVerifier}
|
|
424
|
+
*/
|
|
425
|
+
getProfileByVerifier(verifier: string): Promise<Profile | undefined>;
|
|
426
|
+
/** {@inheritDoc IIdentityWallet.getProfilesByVerifier} */
|
|
427
|
+
getProfilesByVerifier(verifier: string, tags?: string[]): Promise<Profile[]>;
|
|
428
|
+
/** {@inheritDoc IIdentityWallet.getDIDTreeModel} */
|
|
429
|
+
getDIDTreeModel(did: DID): Promise<TreesModel>;
|
|
430
|
+
/** {@inheritDoc IIdentityWallet.generateClaimMtp} */
|
|
431
|
+
generateCredentialMtp(did: DID, credential: W3CCredential, treeState?: TreeState): Promise<MerkleTreeProofWithTreeState>;
|
|
432
|
+
/** {@inheritDoc IIdentityWallet.generateClaimMtp} */
|
|
433
|
+
generateCoreClaimMtp(did: DID, coreClaim: Claim, treeState?: TreeState): Promise<MerkleTreeProofWithTreeState>;
|
|
434
|
+
/** {@inheritDoc IIdentityWallet.generateNonRevocationMtp} */
|
|
435
|
+
generateNonRevocationMtp(did: DID, credential: W3CCredential, treeState?: TreeState): Promise<MerkleTreeProofWithTreeState>;
|
|
436
|
+
/** {@inheritDoc IIdentityWallet.generateNonRevocationMtpWithNonce} */
|
|
437
|
+
generateNonRevocationMtpWithNonce(did: DID, revNonce: bigint, treeState?: TreeState): Promise<MerkleTreeProofWithTreeState>;
|
|
438
|
+
/** {@inheritDoc IIdentityWallet.sign} */
|
|
439
|
+
sign(message: Uint8Array, credential: W3CCredential): Promise<Signature>;
|
|
440
|
+
/** {@inheritDoc IIdentityWallet.signChallenge} */
|
|
441
|
+
signChallenge(challenge: bigint, credential: W3CCredential): Promise<Signature>;
|
|
442
|
+
/** {@inheritDoc IIdentityWallet.issueCredential} */
|
|
443
|
+
issueCredential(issuerDID: DID, req: CredentialRequest, opts?: Options): Promise<W3CCredential>;
|
|
444
|
+
/** {@inheritDoc IIdentityWallet.getActualAuthCredential} */
|
|
445
|
+
getActualAuthCredential(did: DID, treeStateInfo?: TreeState): Promise<{
|
|
446
|
+
authCredential: W3CCredential;
|
|
447
|
+
incProof: MerkleTreeProofWithTreeState;
|
|
448
|
+
nonRevProof: MerkleTreeProofWithTreeState;
|
|
449
|
+
}>;
|
|
450
|
+
/** {@inheritDoc IIdentityWallet.revokeCredential} */
|
|
451
|
+
revokeCredential(issuerDID: DID, credential: W3CCredential): Promise<number>;
|
|
452
|
+
/** {@inheritDoc IIdentityWallet.addCredentialsToMerkleTree} */
|
|
453
|
+
addCredentialsToMerkleTree(credentials: W3CCredential[], issuerDID: DID): Promise<Iden3ProofCreationResult>;
|
|
454
|
+
/** {@inheritDoc IIdentityWallet.generateIden3SparseMerkleTreeProof} */
|
|
455
|
+
generateIden3SparseMerkleTreeProof(issuerDID: DID, credentials: W3CCredential[], txId: string, blockNumber?: number, blockTimestamp?: number, treeState?: TreeState, opts?: CoreClaimCreationOptions): Promise<W3CCredential[]>;
|
|
456
|
+
/** {@inheritDoc IIdentityWallet.publishSpecificStateToRHS} */
|
|
457
|
+
publishSpecificStateToRHS(treeModel: TreesModel, rhsURL: string, revokedNonces?: number[]): Promise<void>;
|
|
458
|
+
/** {@inheritDoc IIdentityWallet.publishStateToRHS} */
|
|
459
|
+
publishStateToRHS(issuerDID: DID, rhsURL: string, revokedNonces?: number[]): Promise<void>;
|
|
460
|
+
/** {@inheritDoc IIdentityWallet.publishRevocationInfoByCredentialStatusType} */
|
|
461
|
+
publishRevocationInfoByCredentialStatusType(issuerDID: DID, credentialStatusType: CredentialStatusType, opts?: RevocationInfoOptions): Promise<void>;
|
|
462
|
+
getCoreClaimFromCredential(credential: W3CCredential): Promise<Claim>;
|
|
463
|
+
findOwnedCredentialsByDID(did: DID, query: ProofQuery): Promise<W3CCredential[]>;
|
|
464
|
+
/** {@inheritDoc IIdentityWallet.updateIdentityState} */
|
|
465
|
+
updateIdentityState(issuerDID: DID, published: boolean, treeState?: TreeState): Promise<void>;
|
|
466
|
+
/** {@inheritdoc IIdentityWallet.transitState} */
|
|
467
|
+
transitState(did: DID, oldTreeState: TreeState, isOldStateGenesis: boolean, ethSigner: Signer, prover?: IZKProver): Promise<string>;
|
|
468
|
+
private getAuthBJJCredential;
|
|
469
|
+
/** {@inheritdoc IIdentityWallet.addBJJAuthCredential} */
|
|
470
|
+
addBJJAuthCredential(did: DID, oldTreeState: TreeState, isOldStateGenesis: boolean, ethSigner: Signer, opts: AuthBJJCredentialCreationOptions, prover?: IZKProver): Promise<W3CCredential>;
|
|
471
|
+
}
|
|
472
|
+
//# sourceMappingURL=identity-wallet.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"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,MAAM,EAAE,aAAa,CAAC,EAAE,MAAM,EAAE,GAAG,OAAO,CAAC,IAAI,CAAC;IAehG,gFAAgF;IAC1E,2CAA2C,CAC/C,SAAS,EAAE,GAAG,EACd,oBAAoB,EAAE,oBAAoB,EAC1C,IAAI,CAAC,EAAE,qBAAqB,GAC3B,OAAO,CAAC,IAAI,CAAC;IAiCH,0BAA0B,CAAC,UAAU,EAAE,aAAa,GAAG,OAAO,CAAC,KAAK,CAAC;IAwB5E,yBAAyB,CAAC,GAAG,EAAE,GAAG,EAAE,KAAK,EAAE,UAAU,GAAG,OAAO,CAAC,aAAa,EAAE,CAAC;IAqBtF,wDAAwD;IAClD,mBAAmB,CACvB,SAAS,EAAE,GAAG,EACd,SAAS,EAAE,OAAO,EAClB,SAAS,CAAC,EAAE,SAAS,GACpB,OAAO,CAAC,IAAI,CAAC;IAWhB,iDAAiD;IAC3C,YAAY,CAChB,GAAG,EAAE,GAAG,EACR,YAAY,EAAE,SAAS,EACvB,iBAAiB,EAAE,OAAO,EAC1B,SAAS,EAAE,MAAM,EACjB,MAAM,CAAC,EAAE,SAAS,GACjB,OAAO,CAAC,MAAM,CAAC;YA0EJ,oBAAoB;IAgClC,yDAAyD;IACnD,oBAAoB,CACxB,GAAG,EAAE,GAAG,EACR,YAAY,EAAE,SAAS,EACvB,iBAAiB,EAAE,OAAO,EAC1B,SAAS,EAAE,MAAM,EACjB,IAAI,EAAE,gCAAgC,EACtC,MAAM,CAAC,EAAE,SAAS,GACjB,OAAO,CAAC,aAAa,CAAC;CAiF1B"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/identity/index.ts"],"names":[],"mappings":"AAAA,cAAc,mBAAmB,CAAC;AAClC,cAAc,UAAU,CAAC"}
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
export * from './identity';
|
|
2
|
+
export * from './credentials';
|
|
3
|
+
export * from './kms';
|
|
4
|
+
export * from './storage';
|
|
5
|
+
export * from './verifiable';
|
|
6
|
+
export * from './schema-processor';
|
|
7
|
+
export * from './proof';
|
|
8
|
+
export * from './iden3comm';
|
|
9
|
+
export * from './circuits';
|
|
10
|
+
export * from './iden3comm';
|
|
11
|
+
export * from './utils';
|
|
12
|
+
export * from './blockchain';
|
|
13
|
+
import * as core from '@mocanetwork/moca-iden3';
|
|
14
|
+
import * as jsonLDMerklizer from '@iden3/js-jsonld-merklization';
|
|
15
|
+
export { core };
|
|
16
|
+
export { jsonLDMerklizer };
|
|
17
|
+
//# sourceMappingURL=index.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/index.ts"],"names":[],"mappings":"AAAA,cAAc,YAAY,CAAC;AAC3B,cAAc,eAAe,CAAC;AAC9B,cAAc,OAAO,CAAC;AACtB,cAAc,WAAW,CAAC;AAC1B,cAAc,cAAc,CAAC;AAC7B,cAAc,oBAAoB,CAAC;AACnC,cAAc,SAAS,CAAC;AACxB,cAAc,aAAa,CAAC;AAC5B,cAAc,YAAY,CAAC;AAC3B,cAAc,aAAa,CAAC;AAC5B,cAAc,SAAS,CAAC;AACxB,cAAc,cAAc,CAAC;AAC7B,OAAO,KAAK,IAAI,MAAM,yBAAyB,CAAC;AAChD,OAAO,KAAK,eAAe,MAAM,+BAA+B,CAAC;AACjE,OAAO,EAAE,IAAI,EAAE,CAAC;AAChB,OAAO,EAAE,eAAe,EAAE,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/kms/index.ts"],"names":[],"mappings":"AAAA,cAAc,OAAO,CAAC;AACtB,cAAc,iBAAiB,CAAC;AAChC,cAAc,SAAS,CAAC;AACxB,cAAc,oBAAoB,CAAC"}
|
|
@@ -0,0 +1,54 @@
|
|
|
1
|
+
import { IKeyProvider } from '../kms';
|
|
2
|
+
import { AbstractPrivateKeyStore, KmsKeyId, KmsKeyType } from '../store';
|
|
3
|
+
/**
|
|
4
|
+
* Provider for Baby Jub Jub keys
|
|
5
|
+
* @public
|
|
6
|
+
* @class BjjProvider
|
|
7
|
+
* @implements implements IKeyProvider interface
|
|
8
|
+
*/
|
|
9
|
+
export declare class BjjProvider implements IKeyProvider {
|
|
10
|
+
/**
|
|
11
|
+
* key type that is handled by BJJ Provider
|
|
12
|
+
* @type {KmsKeyType}
|
|
13
|
+
*/
|
|
14
|
+
keyType: KmsKeyType;
|
|
15
|
+
private keyStore;
|
|
16
|
+
/**
|
|
17
|
+
* Creates an instance of BjjProvider.
|
|
18
|
+
* @param {KmsKeyType} keyType - kms key type
|
|
19
|
+
* @param {AbstractPrivateKeyStore} keyStore - key store for kms
|
|
20
|
+
*/
|
|
21
|
+
constructor(keyType: KmsKeyType, keyStore: AbstractPrivateKeyStore);
|
|
22
|
+
/**
|
|
23
|
+
* get all keys
|
|
24
|
+
* @returns list of keys
|
|
25
|
+
*/
|
|
26
|
+
list(): Promise<{
|
|
27
|
+
alias: string;
|
|
28
|
+
key: string;
|
|
29
|
+
}[]>;
|
|
30
|
+
/**
|
|
31
|
+
* generates a baby jub jub key from a seed phrase
|
|
32
|
+
* @param {Uint8Array} seed - byte array seed
|
|
33
|
+
* @returns kms key identifier
|
|
34
|
+
*/
|
|
35
|
+
newPrivateKeyFromSeed(seed: Uint8Array): Promise<KmsKeyId>;
|
|
36
|
+
/**
|
|
37
|
+
* Gets public key by kmsKeyId
|
|
38
|
+
*
|
|
39
|
+
* @param {KmsKeyId} keyId - key identifier
|
|
40
|
+
*/
|
|
41
|
+
publicKey(keyId: KmsKeyId): Promise<string>;
|
|
42
|
+
/**
|
|
43
|
+
* signs prepared payload of size,
|
|
44
|
+
* with a key id
|
|
45
|
+
*
|
|
46
|
+
* @param {KmsKeyId} keyId - key identifier
|
|
47
|
+
* @param {Uint8Array} data - data to sign (32 bytes)
|
|
48
|
+
* @returns Uint8Array signature
|
|
49
|
+
*/
|
|
50
|
+
sign(keyId: KmsKeyId, data: Uint8Array): Promise<Uint8Array>;
|
|
51
|
+
private privateKey;
|
|
52
|
+
verify(message: Uint8Array, signatureHex: string, keyId: KmsKeyId): Promise<boolean>;
|
|
53
|
+
}
|
|
54
|
+
//# sourceMappingURL=bjj-provider.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"bjj-provider.d.ts","sourceRoot":"","sources":["../../../../src/kms/key-providers/bjj-provider.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,YAAY,EAAE,MAAM,QAAQ,CAAC;AACtC,OAAO,EAAE,uBAAuB,EAAE,QAAQ,EAAE,UAAU,EAAE,MAAM,UAAU,CAAC;AAKzE;;;;;GAKG;AACH,qBAAa,WAAY,YAAW,YAAY;IAC9C;;;OAGG;IACH,OAAO,EAAE,UAAU,CAAC;IACpB,OAAO,CAAC,QAAQ,CAA0B;IAC1C;;;;OAIG;gBACS,OAAO,EAAE,UAAU,EAAE,QAAQ,EAAE,uBAAuB;IAOlE;;;OAGG;IACG,IAAI,IAAI,OAAO,CACnB;QACE,KAAK,EAAE,MAAM,CAAC;QACd,GAAG,EAAE,MAAM,CAAC;KACb,EAAE,CACJ;IAKD;;;;OAIG;IACG,qBAAqB,CAAC,IAAI,EAAE,UAAU,GAAG,OAAO,CAAC,QAAQ,CAAC;IAiBhE;;;;OAIG;IACG,SAAS,CAAC,KAAK,EAAE,QAAQ,GAAG,OAAO,CAAC,MAAM,CAAC;IAKjD;;;;;;;OAOG;IACG,IAAI,CAAC,KAAK,EAAE,QAAQ,EAAE,IAAI,EAAE,UAAU,GAAG,OAAO,CAAC,UAAU,CAAC;YAgBpD,UAAU;IAMlB,MAAM,CAAC,OAAO,EAAE,UAAU,EAAE,YAAY,EAAE,MAAM,EAAE,KAAK,EAAE,QAAQ,GAAG,OAAO,CAAC,OAAO,CAAC;CAQ3F"}
|
|
@@ -0,0 +1,61 @@
|
|
|
1
|
+
import { IKeyProvider } from '../kms';
|
|
2
|
+
import { AbstractPrivateKeyStore, KmsKeyId, KmsKeyType } from '../store';
|
|
3
|
+
/**
|
|
4
|
+
* Provider for Ed25519 keys
|
|
5
|
+
* @public
|
|
6
|
+
* @class Ed25519Provider
|
|
7
|
+
* @implements IKeyProvider interface
|
|
8
|
+
*/
|
|
9
|
+
export declare class Ed25519Provider implements IKeyProvider {
|
|
10
|
+
readonly keyType: KmsKeyType;
|
|
11
|
+
private readonly _keyStore;
|
|
12
|
+
/**
|
|
13
|
+
* Creates an instance of Ed25519Provider.
|
|
14
|
+
* @param {KmsKeyType} keyType - kms key type
|
|
15
|
+
* @param {AbstractPrivateKeyStore} keyStore - key store for kms
|
|
16
|
+
*/
|
|
17
|
+
constructor(keyType: KmsKeyType, _keyStore: AbstractPrivateKeyStore);
|
|
18
|
+
/**
|
|
19
|
+
* get all keys
|
|
20
|
+
* @returns list of keys
|
|
21
|
+
*/
|
|
22
|
+
list(): Promise<{
|
|
23
|
+
alias: string;
|
|
24
|
+
key: string;
|
|
25
|
+
}[]>;
|
|
26
|
+
/**
|
|
27
|
+
* generates a ed25519 key from a seed phrase
|
|
28
|
+
* @param {Uint8Array} seed - byte array seed
|
|
29
|
+
* @returns {Promise<KmsKeyId>} kms key identifier
|
|
30
|
+
*/
|
|
31
|
+
newPrivateKeyFromSeed(seed: Uint8Array): Promise<KmsKeyId>;
|
|
32
|
+
/**
|
|
33
|
+
* Gets public key by kmsKeyId
|
|
34
|
+
* @param {KmsKeyId} keyId - key identifier
|
|
35
|
+
* @returns {Promise<string>} Public key as a hex string
|
|
36
|
+
*/
|
|
37
|
+
publicKey(keyId: KmsKeyId): Promise<string>;
|
|
38
|
+
/**
|
|
39
|
+
* signs prepared payload of size,
|
|
40
|
+
* with a key id
|
|
41
|
+
* @param {KmsKeyId} keyId - key identifier
|
|
42
|
+
* @param {Uint8Array} digest - data to sign (32 bytes)
|
|
43
|
+
* @returns {Promise<Uint8Array>} signature
|
|
44
|
+
*/
|
|
45
|
+
sign(keyId: KmsKeyId, digest: Uint8Array): Promise<Uint8Array>;
|
|
46
|
+
/**
|
|
47
|
+
* Verifies a signature for the given message and key identifier.
|
|
48
|
+
* @param digest - The message to verify the signature against.
|
|
49
|
+
* @param signatureHex - The signature to verify, as a hexadecimal string.
|
|
50
|
+
* @param keyId - The key identifier to use for verification.
|
|
51
|
+
* @returns A Promise that resolves to a boolean indicating whether the signature is valid.
|
|
52
|
+
*/
|
|
53
|
+
verify(digest: Uint8Array, signatureHex: string, keyId: KmsKeyId): Promise<boolean>;
|
|
54
|
+
/**
|
|
55
|
+
* Retrieves the private key for a given keyId from the key store.
|
|
56
|
+
* @param {KmsKeyId} keyId - The identifier of the key to retrieve.
|
|
57
|
+
* @returns {Promise<string>} The private key associated with the keyId.
|
|
58
|
+
*/
|
|
59
|
+
private privateKey;
|
|
60
|
+
}
|
|
61
|
+
//# sourceMappingURL=ed25519-provider.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"ed25519-provider.d.ts","sourceRoot":"","sources":["../../../../src/kms/key-providers/ed25519-provider.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,YAAY,EAAE,MAAM,QAAQ,CAAC;AACtC,OAAO,EAAE,uBAAuB,EAAE,QAAQ,EAAE,UAAU,EAAE,MAAM,UAAU,CAAC;AAKzE;;;;;GAKG;AACH,qBAAa,eAAgB,YAAW,YAAY;aAOhC,OAAO,EAAE,UAAU;IACnC,OAAO,CAAC,QAAQ,CAAC,SAAS;IAP5B;;;;OAIG;gBAEe,OAAO,EAAE,UAAU,EAClB,SAAS,EAAE,uBAAuB;IAGrD;;;OAGG;IACG,IAAI,IAAI,OAAO,CACnB;QACE,KAAK,EAAE,MAAM,CAAC;QACd,GAAG,EAAE,MAAM,CAAC;KACb,EAAE,CACJ;IAKD;;;;OAIG;IACG,qBAAqB,CAAC,IAAI,EAAE,UAAU,GAAG,OAAO,CAAC,QAAQ,CAAC;IAmBhE;;;;OAIG;IACG,SAAS,CAAC,KAAK,EAAE,QAAQ,GAAG,OAAO,CAAC,MAAM,CAAC;IAMjD;;;;;;OAMG;IACG,IAAI,CAAC,KAAK,EAAE,QAAQ,EAAE,MAAM,EAAE,UAAU,GAAG,OAAO,CAAC,UAAU,CAAC;IAKpE;;;;;;OAMG;IACG,MAAM,CAAC,MAAM,EAAE,UAAU,EAAE,YAAY,EAAE,MAAM,EAAE,KAAK,EAAE,QAAQ,GAAG,OAAO,CAAC,OAAO,CAAC;IAKzF;;;;OAIG;YACW,UAAU;CAGzB"}
|