@0xpolygonid/js-sdk 1.0.0-beta.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/LICENSE +661 -0
- package/README.md +40 -0
- package/dist/cjs/auth/auth.js +179 -0
- package/dist/cjs/auth/auth.js.map +1 -0
- package/dist/cjs/auth/index.js +18 -0
- package/dist/cjs/auth/index.js.map +1 -0
- package/dist/cjs/circuits/atomic-query-mtp-v2.js +181 -0
- package/dist/cjs/circuits/atomic-query-mtp-v2.js.map +1 -0
- package/dist/cjs/circuits/atomic-query-sig-v2.js +219 -0
- package/dist/cjs/circuits/atomic-query-sig-v2.js.map +1 -0
- package/dist/cjs/circuits/auth-v2.js +99 -0
- package/dist/cjs/circuits/auth-v2.js.map +1 -0
- package/dist/cjs/circuits/common.js +193 -0
- package/dist/cjs/circuits/common.js.map +1 -0
- package/dist/cjs/circuits/comparer.js +132 -0
- package/dist/cjs/circuits/comparer.js.map +1 -0
- package/dist/cjs/circuits/index.js +24 -0
- package/dist/cjs/circuits/index.js.map +1 -0
- package/dist/cjs/circuits/models.js +110 -0
- package/dist/cjs/circuits/models.js.map +1 -0
- package/dist/cjs/circuits/state-transition.js +94 -0
- package/dist/cjs/circuits/state-transition.js.map +1 -0
- package/dist/cjs/credentials/credential-wallet.js +264 -0
- package/dist/cjs/credentials/credential-wallet.js.map +1 -0
- package/dist/cjs/credentials/index.js +18 -0
- package/dist/cjs/credentials/index.js.map +1 -0
- package/dist/cjs/credentials/revocation.js +290 -0
- package/dist/cjs/credentials/revocation.js.map +1 -0
- package/dist/cjs/iden3comm/constants.js +45 -0
- package/dist/cjs/iden3comm/constants.js.map +1 -0
- package/dist/cjs/iden3comm/errors.js +15 -0
- package/dist/cjs/iden3comm/errors.js.map +1 -0
- package/dist/cjs/iden3comm/index.js +35 -0
- package/dist/cjs/iden3comm/index.js.map +1 -0
- package/dist/cjs/iden3comm/packageManager.js +78 -0
- package/dist/cjs/iden3comm/packageManager.js.map +1 -0
- package/dist/cjs/iden3comm/packers/index.js +19 -0
- package/dist/cjs/iden3comm/packers/index.js.map +1 -0
- package/dist/cjs/iden3comm/packers/plain.js +49 -0
- package/dist/cjs/iden3comm/packers/plain.js.map +1 -0
- package/dist/cjs/iden3comm/packers/zkp.js +155 -0
- package/dist/cjs/iden3comm/packers/zkp.js.map +1 -0
- package/dist/cjs/iden3comm/types/index.js +24 -0
- package/dist/cjs/iden3comm/types/index.js.map +1 -0
- package/dist/cjs/iden3comm/types/packageManager.js +3 -0
- package/dist/cjs/iden3comm/types/packageManager.js.map +1 -0
- package/dist/cjs/iden3comm/types/packer.js +3 -0
- package/dist/cjs/iden3comm/types/packer.js.map +1 -0
- package/dist/cjs/iden3comm/types/protocol/auth.js +3 -0
- package/dist/cjs/iden3comm/types/protocol/auth.js.map +1 -0
- package/dist/cjs/iden3comm/types/protocol/credentials.js +3 -0
- package/dist/cjs/iden3comm/types/protocol/credentials.js.map +1 -0
- package/dist/cjs/iden3comm/types/protocol/messages.js +3 -0
- package/dist/cjs/iden3comm/types/protocol/messages.js.map +1 -0
- package/dist/cjs/iden3comm/types/protocol/proof.js +3 -0
- package/dist/cjs/iden3comm/types/protocol/proof.js.map +1 -0
- package/dist/cjs/iden3comm/types/protocol/revocation.js +3 -0
- package/dist/cjs/iden3comm/types/protocol/revocation.js.map +1 -0
- package/dist/cjs/iden3comm/utils/bytes.js +20 -0
- package/dist/cjs/iden3comm/utils/bytes.js.map +1 -0
- package/dist/cjs/iden3comm/utils/envelope.js +99 -0
- package/dist/cjs/iden3comm/utils/envelope.js.map +1 -0
- package/dist/cjs/iden3comm/utils/index.js +6 -0
- package/dist/cjs/iden3comm/utils/index.js.map +1 -0
- package/dist/cjs/iden3comm/utils/message.js +43 -0
- package/dist/cjs/iden3comm/utils/message.js.map +1 -0
- package/dist/cjs/identity/common.js +40 -0
- package/dist/cjs/identity/common.js.map +1 -0
- package/dist/cjs/identity/identity-wallet.js +422 -0
- package/dist/cjs/identity/identity-wallet.js.map +1 -0
- package/dist/cjs/identity/index.js +19 -0
- package/dist/cjs/identity/index.js.map +1 -0
- package/dist/cjs/index.js +42 -0
- package/dist/cjs/index.js.map +1 -0
- package/dist/cjs/kms/bjj-provider.js +101 -0
- package/dist/cjs/kms/bjj-provider.js.map +1 -0
- package/dist/cjs/kms/index.js +20 -0
- package/dist/cjs/kms/index.js.map +1 -0
- package/dist/cjs/kms/kms.js +74 -0
- package/dist/cjs/kms/kms.js.map +1 -0
- package/dist/cjs/kms/provider-helpers.js +49 -0
- package/dist/cjs/kms/provider-helpers.js.map +1 -0
- package/dist/cjs/kms/store/abstract-key-store.js +15 -0
- package/dist/cjs/kms/store/abstract-key-store.js.map +1 -0
- package/dist/cjs/kms/store/index.js +21 -0
- package/dist/cjs/kms/store/index.js.map +1 -0
- package/dist/cjs/kms/store/local-storage-key-store.js +56 -0
- package/dist/cjs/kms/store/local-storage-key-store.js.map +1 -0
- package/dist/cjs/kms/store/memory-key-store.js +28 -0
- package/dist/cjs/kms/store/memory-key-store.js.map +1 -0
- package/dist/cjs/kms/store/types.js +15 -0
- package/dist/cjs/kms/store/types.js.map +1 -0
- package/dist/cjs/loaders/index.js +19 -0
- package/dist/cjs/loaders/index.js.map +1 -0
- package/dist/cjs/loaders/key.js +50 -0
- package/dist/cjs/loaders/key.js.map +1 -0
- package/dist/cjs/loaders/schema.js +110 -0
- package/dist/cjs/loaders/schema.js.map +1 -0
- package/dist/cjs/proof/common.js +64 -0
- package/dist/cjs/proof/common.js.map +1 -0
- package/dist/cjs/proof/index.js +20 -0
- package/dist/cjs/proof/index.js.map +1 -0
- package/dist/cjs/proof/proof-service.js +344 -0
- package/dist/cjs/proof/proof-service.js.map +1 -0
- package/dist/cjs/proof/prover.js +79 -0
- package/dist/cjs/proof/prover.js.map +1 -0
- package/dist/cjs/proof/witness_calculator.js +282 -0
- package/dist/cjs/proof/witness_calculator.js.map +1 -0
- package/dist/cjs/schema-processor/index.js +19 -0
- package/dist/cjs/schema-processor/index.js.map +1 -0
- package/dist/cjs/schema-processor/json/index.js +19 -0
- package/dist/cjs/schema-processor/json/index.js.map +1 -0
- package/dist/cjs/schema-processor/json/parser.js +136 -0
- package/dist/cjs/schema-processor/json/parser.js.map +1 -0
- package/dist/cjs/schema-processor/json/validator.js +42 -0
- package/dist/cjs/schema-processor/json/validator.js.map +1 -0
- package/dist/cjs/schema-processor/utils.js +98 -0
- package/dist/cjs/schema-processor/utils.js.map +1 -0
- package/dist/cjs/storage/blockchain/index.js +18 -0
- package/dist/cjs/storage/blockchain/index.js.map +1 -0
- package/dist/cjs/storage/blockchain/state-abi.json +922 -0
- package/dist/cjs/storage/blockchain/state.js +112 -0
- package/dist/cjs/storage/blockchain/state.js.map +1 -0
- package/dist/cjs/storage/entities/circuitData.js +3 -0
- package/dist/cjs/storage/entities/circuitData.js.map +1 -0
- package/dist/cjs/storage/entities/identity.js +3 -0
- package/dist/cjs/storage/entities/identity.js.map +1 -0
- package/dist/cjs/storage/entities/index.js +21 -0
- package/dist/cjs/storage/entities/index.js.map +1 -0
- package/dist/cjs/storage/entities/mt.js +19 -0
- package/dist/cjs/storage/entities/mt.js.map +1 -0
- package/dist/cjs/storage/entities/state.js +3 -0
- package/dist/cjs/storage/entities/state.js.map +1 -0
- package/dist/cjs/storage/errors.js +14 -0
- package/dist/cjs/storage/errors.js.map +1 -0
- package/dist/cjs/storage/filters/index.js +18 -0
- package/dist/cjs/storage/filters/index.js.map +1 -0
- package/dist/cjs/storage/filters/jsonQuery.js +141 -0
- package/dist/cjs/storage/filters/jsonQuery.js.map +1 -0
- package/dist/cjs/storage/index.js +24 -0
- package/dist/cjs/storage/index.js.map +1 -0
- package/dist/cjs/storage/interfaces/circuits.js +3 -0
- package/dist/cjs/storage/interfaces/circuits.js.map +1 -0
- package/dist/cjs/storage/interfaces/credentials.js +3 -0
- package/dist/cjs/storage/interfaces/credentials.js.map +1 -0
- package/dist/cjs/storage/interfaces/data-source.js +3 -0
- package/dist/cjs/storage/interfaces/data-source.js.map +1 -0
- package/dist/cjs/storage/interfaces/data-storage.js +3 -0
- package/dist/cjs/storage/interfaces/data-storage.js.map +1 -0
- package/dist/cjs/storage/interfaces/identity.js +3 -0
- package/dist/cjs/storage/interfaces/identity.js.map +1 -0
- package/dist/cjs/storage/interfaces/index.js +24 -0
- package/dist/cjs/storage/interfaces/index.js.map +1 -0
- package/dist/cjs/storage/interfaces/merkletree.js +3 -0
- package/dist/cjs/storage/interfaces/merkletree.js.map +1 -0
- package/dist/cjs/storage/interfaces/state.js +3 -0
- package/dist/cjs/storage/interfaces/state.js.map +1 -0
- package/dist/cjs/storage/local-storage/data-source.js +89 -0
- package/dist/cjs/storage/local-storage/data-source.js.map +1 -0
- package/dist/cjs/storage/local-storage/index.js +19 -0
- package/dist/cjs/storage/local-storage/index.js.map +1 -0
- package/dist/cjs/storage/local-storage/merkletree.js +148 -0
- package/dist/cjs/storage/local-storage/merkletree.js.map +1 -0
- package/dist/cjs/storage/memory/data-source.js +49 -0
- package/dist/cjs/storage/memory/data-source.js.map +1 -0
- package/dist/cjs/storage/memory/index.js +19 -0
- package/dist/cjs/storage/memory/index.js.map +1 -0
- package/dist/cjs/storage/memory/merkletree.js +94 -0
- package/dist/cjs/storage/memory/merkletree.js.map +1 -0
- package/dist/cjs/storage/shared/circuit-storage.js +46 -0
- package/dist/cjs/storage/shared/circuit-storage.js.map +1 -0
- package/dist/cjs/storage/shared/credential-storage.js +66 -0
- package/dist/cjs/storage/shared/credential-storage.js.map +1 -0
- package/dist/cjs/storage/shared/identity-storage.js +71 -0
- package/dist/cjs/storage/shared/identity-storage.js.map +1 -0
- package/dist/cjs/storage/shared/index.js +20 -0
- package/dist/cjs/storage/shared/index.js.map +1 -0
- package/dist/cjs/verifiable/constants.js +104 -0
- package/dist/cjs/verifiable/constants.js.map +1 -0
- package/dist/cjs/verifiable/credential.js +129 -0
- package/dist/cjs/verifiable/credential.js.map +1 -0
- package/dist/cjs/verifiable/index.js +21 -0
- package/dist/cjs/verifiable/index.js.map +1 -0
- package/dist/cjs/verifiable/proof.js +70 -0
- package/dist/cjs/verifiable/proof.js.map +1 -0
- package/dist/cjs/verifiable/schema.js +245 -0
- package/dist/cjs/verifiable/schema.js.map +1 -0
- package/dist/esm/auth/auth.js +152 -0
- package/dist/esm/auth/auth.js.map +1 -0
- package/dist/esm/auth/index.js +2 -0
- package/dist/esm/auth/index.js.map +1 -0
- package/dist/esm/circuits/atomic-query-mtp-v2.js +176 -0
- package/dist/esm/circuits/atomic-query-mtp-v2.js.map +1 -0
- package/dist/esm/circuits/atomic-query-sig-v2.js +214 -0
- package/dist/esm/circuits/atomic-query-sig-v2.js.map +1 -0
- package/dist/esm/circuits/auth-v2.js +94 -0
- package/dist/esm/circuits/auth-v2.js.map +1 -0
- package/dist/esm/circuits/common.js +186 -0
- package/dist/esm/circuits/common.js.map +1 -0
- package/dist/esm/circuits/comparer.js +126 -0
- package/dist/esm/circuits/comparer.js.map +1 -0
- package/dist/esm/circuits/index.js +8 -0
- package/dist/esm/circuits/index.js.map +1 -0
- package/dist/esm/circuits/models.js +104 -0
- package/dist/esm/circuits/models.js.map +1 -0
- package/dist/esm/circuits/state-transition.js +89 -0
- package/dist/esm/circuits/state-transition.js.map +1 -0
- package/dist/esm/credentials/credential-wallet.js +232 -0
- package/dist/esm/credentials/credential-wallet.js.map +1 -0
- package/dist/esm/credentials/index.js +2 -0
- package/dist/esm/credentials/index.js.map +1 -0
- package/dist/esm/credentials/revocation.js +281 -0
- package/dist/esm/credentials/revocation.js.map +1 -0
- package/dist/esm/iden3comm/constants.js +42 -0
- package/dist/esm/iden3comm/constants.js.map +1 -0
- package/dist/esm/iden3comm/errors.js +12 -0
- package/dist/esm/iden3comm/errors.js.map +1 -0
- package/dist/esm/iden3comm/index.js +6 -0
- package/dist/esm/iden3comm/index.js.map +1 -0
- package/dist/esm/iden3comm/packageManager.js +74 -0
- package/dist/esm/iden3comm/packageManager.js.map +1 -0
- package/dist/esm/iden3comm/packers/index.js +3 -0
- package/dist/esm/iden3comm/packers/index.js.map +1 -0
- package/dist/esm/iden3comm/packers/plain.js +45 -0
- package/dist/esm/iden3comm/packers/plain.js.map +1 -0
- package/dist/esm/iden3comm/packers/zkp.js +149 -0
- package/dist/esm/iden3comm/packers/zkp.js.map +1 -0
- package/dist/esm/iden3comm/types/index.js +8 -0
- package/dist/esm/iden3comm/types/index.js.map +1 -0
- package/dist/esm/iden3comm/types/packageManager.js +2 -0
- package/dist/esm/iden3comm/types/packageManager.js.map +1 -0
- package/dist/esm/iden3comm/types/packer.js +2 -0
- package/dist/esm/iden3comm/types/packer.js.map +1 -0
- package/dist/esm/iden3comm/types/protocol/auth.js +2 -0
- package/dist/esm/iden3comm/types/protocol/auth.js.map +1 -0
- package/dist/esm/iden3comm/types/protocol/credentials.js +2 -0
- package/dist/esm/iden3comm/types/protocol/credentials.js.map +1 -0
- package/dist/esm/iden3comm/types/protocol/messages.js +2 -0
- package/dist/esm/iden3comm/types/protocol/messages.js.map +1 -0
- package/dist/esm/iden3comm/types/protocol/proof.js +2 -0
- package/dist/esm/iden3comm/types/protocol/proof.js.map +1 -0
- package/dist/esm/iden3comm/types/protocol/revocation.js +2 -0
- package/dist/esm/iden3comm/types/protocol/revocation.js.map +1 -0
- package/dist/esm/iden3comm/utils/bytes.js +20 -0
- package/dist/esm/iden3comm/utils/bytes.js.map +1 -0
- package/dist/esm/iden3comm/utils/envelope.js +92 -0
- package/dist/esm/iden3comm/utils/envelope.js.map +1 -0
- package/dist/esm/iden3comm/utils/index.js +3 -0
- package/dist/esm/iden3comm/utils/index.js.map +1 -0
- package/dist/esm/iden3comm/utils/message.js +37 -0
- package/dist/esm/iden3comm/utils/message.js.map +1 -0
- package/dist/esm/identity/common.js +35 -0
- package/dist/esm/identity/common.js.map +1 -0
- package/dist/esm/identity/identity-wallet.js +395 -0
- package/dist/esm/identity/identity-wallet.js.map +1 -0
- package/dist/esm/identity/index.js +3 -0
- package/dist/esm/identity/index.js.map +1 -0
- package/dist/esm/index.js +13 -0
- package/dist/esm/index.js.map +1 -0
- package/dist/esm/kms/bjj-provider.js +74 -0
- package/dist/esm/kms/bjj-provider.js.map +1 -0
- package/dist/esm/kms/index.js +4 -0
- package/dist/esm/kms/index.js.map +1 -0
- package/dist/esm/kms/kms.js +70 -0
- package/dist/esm/kms/kms.js.map +1 -0
- package/dist/esm/kms/provider-helpers.js +44 -0
- package/dist/esm/kms/provider-helpers.js.map +1 -0
- package/dist/esm/kms/store/abstract-key-store.js +11 -0
- package/dist/esm/kms/store/abstract-key-store.js.map +1 -0
- package/dist/esm/kms/store/index.js +5 -0
- package/dist/esm/kms/store/index.js.map +1 -0
- package/dist/esm/kms/store/local-storage-key-store.js +52 -0
- package/dist/esm/kms/store/local-storage-key-store.js.map +1 -0
- package/dist/esm/kms/store/memory-key-store.js +24 -0
- package/dist/esm/kms/store/memory-key-store.js.map +1 -0
- package/dist/esm/kms/store/types.js +12 -0
- package/dist/esm/kms/store/types.js.map +1 -0
- package/dist/esm/loaders/index.js +3 -0
- package/dist/esm/loaders/index.js.map +1 -0
- package/dist/esm/loaders/key.js +23 -0
- package/dist/esm/loaders/key.js.map +1 -0
- package/dist/esm/loaders/schema.js +100 -0
- package/dist/esm/loaders/schema.js.map +1 -0
- package/dist/esm/proof/common.js +59 -0
- package/dist/esm/proof/common.js.map +1 -0
- package/dist/esm/proof/index.js +4 -0
- package/dist/esm/proof/index.js.map +1 -0
- package/dist/esm/proof/proof-service.js +339 -0
- package/dist/esm/proof/proof-service.js.map +1 -0
- package/dist/esm/proof/prover.js +52 -0
- package/dist/esm/proof/prover.js.map +1 -0
- package/dist/esm/proof/witness_calculator.js +278 -0
- package/dist/esm/proof/witness_calculator.js.map +1 -0
- package/dist/esm/schema-processor/index.js +3 -0
- package/dist/esm/schema-processor/index.js.map +1 -0
- package/dist/esm/schema-processor/json/index.js +3 -0
- package/dist/esm/schema-processor/json/index.js.map +1 -0
- package/dist/esm/schema-processor/json/parser.js +132 -0
- package/dist/esm/schema-processor/json/parser.js.map +1 -0
- package/dist/esm/schema-processor/json/validator.js +35 -0
- package/dist/esm/schema-processor/json/validator.js.map +1 -0
- package/dist/esm/schema-processor/utils.js +89 -0
- package/dist/esm/schema-processor/utils.js.map +1 -0
- package/dist/esm/storage/blockchain/index.js +2 -0
- package/dist/esm/storage/blockchain/index.js.map +1 -0
- package/dist/esm/storage/blockchain/state-abi.json +922 -0
- package/dist/esm/storage/blockchain/state.js +105 -0
- package/dist/esm/storage/blockchain/state.js.map +1 -0
- package/dist/esm/storage/entities/circuitData.js +2 -0
- package/dist/esm/storage/entities/circuitData.js.map +1 -0
- package/dist/esm/storage/entities/identity.js +2 -0
- package/dist/esm/storage/entities/identity.js.map +1 -0
- package/dist/esm/storage/entities/index.js +5 -0
- package/dist/esm/storage/entities/index.js.map +1 -0
- package/dist/esm/storage/entities/mt.js +16 -0
- package/dist/esm/storage/entities/mt.js.map +1 -0
- package/dist/esm/storage/entities/state.js +2 -0
- package/dist/esm/storage/entities/state.js.map +1 -0
- package/dist/esm/storage/errors.js +11 -0
- package/dist/esm/storage/errors.js.map +1 -0
- package/dist/esm/storage/filters/index.js +2 -0
- package/dist/esm/storage/filters/index.js.map +1 -0
- package/dist/esm/storage/filters/jsonQuery.js +134 -0
- package/dist/esm/storage/filters/jsonQuery.js.map +1 -0
- package/dist/esm/storage/index.js +8 -0
- package/dist/esm/storage/index.js.map +1 -0
- package/dist/esm/storage/interfaces/circuits.js +2 -0
- package/dist/esm/storage/interfaces/circuits.js.map +1 -0
- package/dist/esm/storage/interfaces/credentials.js +2 -0
- package/dist/esm/storage/interfaces/credentials.js.map +1 -0
- package/dist/esm/storage/interfaces/data-source.js +2 -0
- package/dist/esm/storage/interfaces/data-source.js.map +1 -0
- package/dist/esm/storage/interfaces/data-storage.js +2 -0
- package/dist/esm/storage/interfaces/data-storage.js.map +1 -0
- package/dist/esm/storage/interfaces/identity.js +2 -0
- package/dist/esm/storage/interfaces/identity.js.map +1 -0
- package/dist/esm/storage/interfaces/index.js +8 -0
- package/dist/esm/storage/interfaces/index.js.map +1 -0
- package/dist/esm/storage/interfaces/merkletree.js +2 -0
- package/dist/esm/storage/interfaces/merkletree.js.map +1 -0
- package/dist/esm/storage/interfaces/state.js +2 -0
- package/dist/esm/storage/interfaces/state.js.map +1 -0
- package/dist/esm/storage/local-storage/data-source.js +85 -0
- package/dist/esm/storage/local-storage/data-source.js.map +1 -0
- package/dist/esm/storage/local-storage/index.js +3 -0
- package/dist/esm/storage/local-storage/index.js.map +1 -0
- package/dist/esm/storage/local-storage/merkletree.js +121 -0
- package/dist/esm/storage/local-storage/merkletree.js.map +1 -0
- package/dist/esm/storage/memory/data-source.js +45 -0
- package/dist/esm/storage/memory/data-source.js.map +1 -0
- package/dist/esm/storage/memory/index.js +3 -0
- package/dist/esm/storage/memory/index.js.map +1 -0
- package/dist/esm/storage/memory/merkletree.js +67 -0
- package/dist/esm/storage/memory/merkletree.js.map +1 -0
- package/dist/esm/storage/shared/circuit-storage.js +42 -0
- package/dist/esm/storage/shared/circuit-storage.js.map +1 -0
- package/dist/esm/storage/shared/credential-storage.js +62 -0
- package/dist/esm/storage/shared/credential-storage.js.map +1 -0
- package/dist/esm/storage/shared/identity-storage.js +67 -0
- package/dist/esm/storage/shared/identity-storage.js.map +1 -0
- package/dist/esm/storage/shared/index.js +4 -0
- package/dist/esm/storage/shared/index.js.map +1 -0
- package/dist/esm/verifiable/constants.js +101 -0
- package/dist/esm/verifiable/constants.js.map +1 -0
- package/dist/esm/verifiable/credential.js +124 -0
- package/dist/esm/verifiable/credential.js.map +1 -0
- package/dist/esm/verifiable/index.js +5 -0
- package/dist/esm/verifiable/index.js.map +1 -0
- package/dist/esm/verifiable/proof.js +64 -0
- package/dist/esm/verifiable/proof.js.map +1 -0
- package/dist/esm/verifiable/schema.js +242 -0
- package/dist/esm/verifiable/schema.js.map +1 -0
- package/dist/esm_esbuild/index.js +128087 -0
- package/dist/esm_esbuild/index.js.map +7 -0
- package/dist/types/auth/auth.d.ts +131 -0
- package/dist/types/auth/index.d.ts +1 -0
- package/dist/types/circuits/atomic-query-mtp-v2.d.ts +64 -0
- package/dist/types/circuits/atomic-query-sig-v2.d.ts +65 -0
- package/dist/types/circuits/auth-v2.d.ts +46 -0
- package/dist/types/circuits/common.d.ts +124 -0
- package/dist/types/circuits/comparer.d.ts +87 -0
- package/dist/types/circuits/index.d.ts +7 -0
- package/dist/types/circuits/models.d.ts +181 -0
- package/dist/types/circuits/state-transition.d.ts +50 -0
- package/dist/types/credentials/credential-wallet.d.ts +248 -0
- package/dist/types/credentials/index.d.ts +1 -0
- package/dist/types/credentials/revocation.d.ts +97 -0
- package/dist/types/iden3comm/constants.d.ts +27 -0
- package/dist/types/iden3comm/errors.d.ts +8 -0
- package/dist/types/iden3comm/index.d.ts +5 -0
- package/dist/types/iden3comm/packageManager.d.ts +31 -0
- package/dist/types/iden3comm/packers/index.d.ts +2 -0
- package/dist/types/iden3comm/packers/plain.d.ts +34 -0
- package/dist/types/iden3comm/packers/zkp.d.ts +86 -0
- package/dist/types/iden3comm/types/index.d.ts +15 -0
- package/dist/types/iden3comm/types/packageManager.d.ts +80 -0
- package/dist/types/iden3comm/types/packer.d.ts +59 -0
- package/dist/types/iden3comm/types/protocol/auth.d.ts +49 -0
- package/dist/types/iden3comm/types/protocol/credentials.d.ts +74 -0
- package/dist/types/iden3comm/types/protocol/messages.d.ts +16 -0
- package/dist/types/iden3comm/types/protocol/proof.d.ts +31 -0
- package/dist/types/iden3comm/types/protocol/revocation.d.ts +28 -0
- package/dist/types/iden3comm/utils/bytes.d.ts +8 -0
- package/dist/types/iden3comm/utils/envelope.d.ts +31 -0
- package/dist/types/iden3comm/utils/index.d.ts +2 -0
- package/dist/types/iden3comm/utils/message.d.ts +19 -0
- package/dist/types/identity/common.d.ts +18 -0
- package/dist/types/identity/identity-wallet.d.ts +248 -0
- package/dist/types/identity/index.d.ts +2 -0
- package/dist/types/index.d.ts +12 -0
- package/dist/types/kms/bjj-provider.d.ts +47 -0
- package/dist/types/kms/index.d.ts +3 -0
- package/dist/types/kms/kms.d.ts +80 -0
- package/dist/types/kms/provider-helpers.d.ts +18 -0
- package/dist/types/kms/store/abstract-key-store.d.ts +31 -0
- package/dist/types/kms/store/index.d.ts +4 -0
- package/dist/types/kms/store/local-storage-key-store.d.ts +32 -0
- package/dist/types/kms/store/memory-key-store.d.ts +20 -0
- package/dist/types/kms/store/types.d.ts +21 -0
- package/dist/types/loaders/index.d.ts +2 -0
- package/dist/types/loaders/key.d.ts +29 -0
- package/dist/types/loaders/schema.d.ts +85 -0
- package/dist/types/proof/common.d.ts +17 -0
- package/dist/types/proof/index.d.ts +3 -0
- package/dist/types/proof/proof-service.d.ts +121 -0
- package/dist/types/proof/prover.d.ts +11 -0
- package/dist/types/proof/witness_calculator.d.ts +16 -0
- package/dist/types/schema-processor/index.d.ts +2 -0
- package/dist/types/schema-processor/json/index.d.ts +2 -0
- package/dist/types/schema-processor/json/parser.d.ts +103 -0
- package/dist/types/schema-processor/json/validator.d.ts +22 -0
- package/dist/types/schema-processor/utils.d.ts +49 -0
- package/dist/types/storage/blockchain/index.d.ts +1 -0
- package/dist/types/storage/blockchain/state.d.ts +52 -0
- package/dist/types/storage/entities/circuitData.d.ts +7 -0
- package/dist/types/storage/entities/identity.d.ts +15 -0
- package/dist/types/storage/entities/index.d.ts +4 -0
- package/dist/types/storage/entities/mt.d.ts +23 -0
- package/dist/types/storage/entities/state.d.ts +48 -0
- package/dist/types/storage/errors.d.ts +9 -0
- package/dist/types/storage/filters/index.d.ts +1 -0
- package/dist/types/storage/filters/jsonQuery.d.ts +82 -0
- package/dist/types/storage/index.d.ts +7 -0
- package/dist/types/storage/interfaces/circuits.d.ts +26 -0
- package/dist/types/storage/interfaces/credentials.d.ts +53 -0
- package/dist/types/storage/interfaces/data-source.d.ts +39 -0
- package/dist/types/storage/interfaces/data-storage.d.ts +17 -0
- package/dist/types/storage/interfaces/identity.d.ts +63 -0
- package/dist/types/storage/interfaces/index.d.ts +7 -0
- package/dist/types/storage/interfaces/merkletree.d.ts +44 -0
- package/dist/types/storage/interfaces/state.d.ts +41 -0
- package/dist/types/storage/local-storage/data-source.d.ts +47 -0
- package/dist/types/storage/local-storage/index.d.ts +2 -0
- package/dist/types/storage/local-storage/merkletree.d.ts +46 -0
- package/dist/types/storage/memory/data-source.d.ts +22 -0
- package/dist/types/storage/memory/index.d.ts +2 -0
- package/dist/types/storage/memory/merkletree.d.ts +49 -0
- package/dist/types/storage/shared/circuit-storage.d.ts +35 -0
- package/dist/types/storage/shared/credential-storage.d.ts +39 -0
- package/dist/types/storage/shared/identity-storage.d.ts +40 -0
- package/dist/types/storage/shared/index.d.ts +3 -0
- package/dist/types/verifiable/constants.d.ts +78 -0
- package/dist/types/verifiable/credential.d.ts +123 -0
- package/dist/types/verifiable/index.d.ts +4 -0
- package/dist/types/verifiable/proof.d.ts +123 -0
- package/dist/types/verifiable/schema.d.ts +2 -0
- package/dist/umd/index.js +462 -0
- package/dist/umd/index.js.map +7 -0
- package/package.json +95 -0
|
@@ -0,0 +1,181 @@
|
|
|
1
|
+
import { Signature } from '@iden3/js-crypto';
|
|
2
|
+
import { Claim, Claim as CoreClaim, Id } from '@iden3/js-iden3-core';
|
|
3
|
+
import { Hash, Proof } from '@iden3/js-merkletree';
|
|
4
|
+
/**
|
|
5
|
+
* TreeState is model for merkle tree roots
|
|
6
|
+
*
|
|
7
|
+
* @export
|
|
8
|
+
* @beta
|
|
9
|
+
* @interface TreeState
|
|
10
|
+
*/
|
|
11
|
+
export interface TreeState {
|
|
12
|
+
state: Hash;
|
|
13
|
+
claimsRoot: Hash;
|
|
14
|
+
revocationRoot: Hash;
|
|
15
|
+
rootOfRoots: Hash;
|
|
16
|
+
}
|
|
17
|
+
/**
|
|
18
|
+
* claim non revocation status for circuit
|
|
19
|
+
* TreeState and Proof of inclusion / non-inclusion
|
|
20
|
+
*
|
|
21
|
+
* @export
|
|
22
|
+
* @beta
|
|
23
|
+
* @interface ClaimNonRevStatus
|
|
24
|
+
*/
|
|
25
|
+
export interface ClaimNonRevStatus {
|
|
26
|
+
treeState: TreeState;
|
|
27
|
+
proof: Proof;
|
|
28
|
+
}
|
|
29
|
+
/**
|
|
30
|
+
* Query represents basic request to claim slot verification
|
|
31
|
+
*
|
|
32
|
+
* @export
|
|
33
|
+
* @beta
|
|
34
|
+
* @class Query
|
|
35
|
+
*/
|
|
36
|
+
export declare class Query {
|
|
37
|
+
slotIndex: number;
|
|
38
|
+
values: bigint[];
|
|
39
|
+
operator: number;
|
|
40
|
+
valueProof?: ValueProof;
|
|
41
|
+
/**
|
|
42
|
+
* Validates Query instance
|
|
43
|
+
*
|
|
44
|
+
*/
|
|
45
|
+
validate(): void;
|
|
46
|
+
}
|
|
47
|
+
/**
|
|
48
|
+
* CircuitID is alias for circuit identifier
|
|
49
|
+
*
|
|
50
|
+
* @export
|
|
51
|
+
* @enum {number}
|
|
52
|
+
*/
|
|
53
|
+
export declare enum CircuitId {
|
|
54
|
+
AuthV2 = "authV2",
|
|
55
|
+
StateTransition = "stateTransition",
|
|
56
|
+
AtomicQueryMTPV2 = "credentialAtomicQueryMTPV2",
|
|
57
|
+
AtomicQuerySigV2 = "credentialAtomicQuerySigV2"
|
|
58
|
+
}
|
|
59
|
+
/**
|
|
60
|
+
* Claim structure for circuit inputs
|
|
61
|
+
*
|
|
62
|
+
* @export
|
|
63
|
+
* @beta
|
|
64
|
+
* @class CircuitClaim
|
|
65
|
+
*/
|
|
66
|
+
export declare class CircuitClaim {
|
|
67
|
+
issuerId: Id;
|
|
68
|
+
claim: CoreClaim;
|
|
69
|
+
treeState: TreeState;
|
|
70
|
+
proof: Proof;
|
|
71
|
+
nonRevProof: ClaimNonRevStatus;
|
|
72
|
+
signatureProof: BJJSignatureProof;
|
|
73
|
+
}
|
|
74
|
+
/**
|
|
75
|
+
*
|
|
76
|
+
* Claim for circuit with non revocation proof and signature proof
|
|
77
|
+
* @export
|
|
78
|
+
* @beta
|
|
79
|
+
* @interface ClaimWithSigProof
|
|
80
|
+
*/
|
|
81
|
+
export interface ClaimWithSigProof {
|
|
82
|
+
issuerID: Id;
|
|
83
|
+
claim: Claim;
|
|
84
|
+
nonRevProof: MTProof;
|
|
85
|
+
signatureProof: BJJSignatureProof;
|
|
86
|
+
}
|
|
87
|
+
/**
|
|
88
|
+
* Claim for circuit with non revocation proof and proof of merkle tree inclusion
|
|
89
|
+
*
|
|
90
|
+
* @export
|
|
91
|
+
* @beta
|
|
92
|
+
* @interface ClaimWithMTPProof
|
|
93
|
+
*/
|
|
94
|
+
export interface ClaimWithMTPProof {
|
|
95
|
+
issuerID?: Id;
|
|
96
|
+
claim: Claim;
|
|
97
|
+
incProof: MTProof;
|
|
98
|
+
nonRevProof: MTProof;
|
|
99
|
+
}
|
|
100
|
+
/**
|
|
101
|
+
* prepared bjj signature for circuits with auth bjj claim data
|
|
102
|
+
*
|
|
103
|
+
* @export
|
|
104
|
+
* @beta
|
|
105
|
+
* @interface BJJSignatureProof
|
|
106
|
+
*/
|
|
107
|
+
export interface BJJSignatureProof {
|
|
108
|
+
signature: Signature;
|
|
109
|
+
issuerAuthClaim?: Claim;
|
|
110
|
+
issuerAuthIncProof: MTProof;
|
|
111
|
+
issuerAuthNonRevProof: MTProof;
|
|
112
|
+
}
|
|
113
|
+
/**
|
|
114
|
+
* prepared mtp with a tree state
|
|
115
|
+
*
|
|
116
|
+
* @export
|
|
117
|
+
* @beta
|
|
118
|
+
* @interface MTProof
|
|
119
|
+
*/
|
|
120
|
+
export interface MTProof {
|
|
121
|
+
proof: Proof;
|
|
122
|
+
treeState?: TreeState;
|
|
123
|
+
}
|
|
124
|
+
/**
|
|
125
|
+
* global identity state proof
|
|
126
|
+
*
|
|
127
|
+
* @export
|
|
128
|
+
* @beta
|
|
129
|
+
* @interface GISTProof
|
|
130
|
+
*/
|
|
131
|
+
export interface GISTProof {
|
|
132
|
+
root: Hash;
|
|
133
|
+
proof: Proof;
|
|
134
|
+
}
|
|
135
|
+
/**
|
|
136
|
+
* List of errors of circuit inputs processing
|
|
137
|
+
*
|
|
138
|
+
* @export
|
|
139
|
+
* @enum {number}
|
|
140
|
+
*/
|
|
141
|
+
export declare enum CircuitError {
|
|
142
|
+
EmptyAuthClaimProof = "empty auth claim mtp proof",
|
|
143
|
+
EmptyAuthClaimProofInTheNewState = "empty auth claim mtp proof in the new state",
|
|
144
|
+
EmptyAuthClaimNonRevProof = "empty auth claim non-revocation mtp proof",
|
|
145
|
+
EmptyChallengeSignature = "empty challenge signature",
|
|
146
|
+
EmptyClaimSignature = "empty claim signature",
|
|
147
|
+
EmptyClaimProof = "empty claim mtp proof",
|
|
148
|
+
EmptyClaimNonRevProof = "empty claim non-revocation mtp proof",
|
|
149
|
+
EmptyIssuerAuthClaimProof = "empty issuer auth claim mtp proof",
|
|
150
|
+
EmptyIssuerAuthClaimNonRevProof = "empty issuer auth claim non-revocation mtp proof",
|
|
151
|
+
EmptyJsonLDQueryProof = "empty JSON-LD query mtp proof",
|
|
152
|
+
EmptyJsonLDQueryValue = "empty JSON-LD query value",
|
|
153
|
+
EmptyJsonLDQueryPath = "empty JSON-LD query path",
|
|
154
|
+
EmptyQueryValue = "empty query value",
|
|
155
|
+
EmptyJsonLDQueryValues = "empty JSON-LD query values",
|
|
156
|
+
EmptyId = "empty Id",
|
|
157
|
+
EmptyChallenge = "empty challenge",
|
|
158
|
+
EmptyGlobalProof = "empty global identity mtp proof",
|
|
159
|
+
EmptyRequestID = "empty request ID"
|
|
160
|
+
}
|
|
161
|
+
/**
|
|
162
|
+
* ValueProof represents a Merkle Proof for a value stored as MT
|
|
163
|
+
*
|
|
164
|
+
* @export
|
|
165
|
+
* @beta
|
|
166
|
+
* @class ValueProof
|
|
167
|
+
*/
|
|
168
|
+
export declare class ValueProof {
|
|
169
|
+
path: bigint;
|
|
170
|
+
value: bigint;
|
|
171
|
+
mtp: Proof;
|
|
172
|
+
/**
|
|
173
|
+
* Creates an instance of ValueProof.
|
|
174
|
+
*/
|
|
175
|
+
constructor();
|
|
176
|
+
/**
|
|
177
|
+
* validates instance of ValueProof
|
|
178
|
+
*
|
|
179
|
+
*/
|
|
180
|
+
validate(): void;
|
|
181
|
+
}
|
|
@@ -0,0 +1,50 @@
|
|
|
1
|
+
import { Signature } from '@iden3/js-crypto';
|
|
2
|
+
import { Id } from '@iden3/js-iden3-core';
|
|
3
|
+
import { Hash, Proof } from '@iden3/js-merkletree';
|
|
4
|
+
import { BaseConfig } from './common';
|
|
5
|
+
import { ClaimWithMTPProof, TreeState } from './models';
|
|
6
|
+
/**
|
|
7
|
+
* StateTransition circuit representation
|
|
8
|
+
* Inputs and public signals declaration, marshalling and parsing
|
|
9
|
+
*
|
|
10
|
+
* @export
|
|
11
|
+
* @beta
|
|
12
|
+
* @class StateTransitionInputs
|
|
13
|
+
* @extends {BaseConfig}
|
|
14
|
+
*/
|
|
15
|
+
export declare class StateTransitionInputs extends BaseConfig {
|
|
16
|
+
id: Id;
|
|
17
|
+
oldTreeState: TreeState;
|
|
18
|
+
newTreeState: TreeState;
|
|
19
|
+
isOldStateGenesis: boolean;
|
|
20
|
+
authClaim: ClaimWithMTPProof;
|
|
21
|
+
authClaimNewStateIncProof: Proof;
|
|
22
|
+
signature: Signature;
|
|
23
|
+
/**
|
|
24
|
+
* CircuitInputMarshal returns Circom private inputs for stateTransition.circom
|
|
25
|
+
*
|
|
26
|
+
* @returns Uint8Array
|
|
27
|
+
*/
|
|
28
|
+
inputsMarshal(): Uint8Array;
|
|
29
|
+
}
|
|
30
|
+
/**
|
|
31
|
+
* Public signals of StateTransition circuit
|
|
32
|
+
*
|
|
33
|
+
* @export
|
|
34
|
+
* @beta
|
|
35
|
+
* @class StateTransitionPubSignals
|
|
36
|
+
*/
|
|
37
|
+
export declare class StateTransitionPubSignals {
|
|
38
|
+
userId: Id;
|
|
39
|
+
oldUserState: Hash;
|
|
40
|
+
newUserState: Hash;
|
|
41
|
+
isOldStateGenesis: boolean;
|
|
42
|
+
/**
|
|
43
|
+
*
|
|
44
|
+
*
|
|
45
|
+
* PubSignalsUnmarshal unmarshal stateTransition.circom public signal
|
|
46
|
+
* @param {Uint8Array} data
|
|
47
|
+
* @returns StateTransitionPubSignals
|
|
48
|
+
*/
|
|
49
|
+
pubSignalsUnmarshal(data: Uint8Array): StateTransitionPubSignals;
|
|
50
|
+
}
|
|
@@ -0,0 +1,248 @@
|
|
|
1
|
+
import { DID } from '@iden3/js-iden3-core';
|
|
2
|
+
import { IDataStorage } from '../storage/interfaces';
|
|
3
|
+
import { W3CCredential, ProofQuery, SubjectPosition, MerklizedRootPosition, CredentialStatus, RHSCredentialStatus, RevocationStatus, IssuerData } from './../verifiable';
|
|
4
|
+
import { JSONSchema } from '../schema-processor';
|
|
5
|
+
/**
|
|
6
|
+
* Request to core library to create Core Claim from W3C Verifiable Credential
|
|
7
|
+
*
|
|
8
|
+
* @export
|
|
9
|
+
* @beta
|
|
10
|
+
* @interface CredentialRequest
|
|
11
|
+
*/
|
|
12
|
+
export interface CredentialRequest {
|
|
13
|
+
/**
|
|
14
|
+
* JSON credential schema
|
|
15
|
+
*/
|
|
16
|
+
credentialSchema: string;
|
|
17
|
+
/**
|
|
18
|
+
* Credential type
|
|
19
|
+
*/
|
|
20
|
+
type: string;
|
|
21
|
+
/**
|
|
22
|
+
* Credential subject, usually contains claims and identifier
|
|
23
|
+
*/
|
|
24
|
+
credentialSubject: {
|
|
25
|
+
[key: string]: string | object | number;
|
|
26
|
+
};
|
|
27
|
+
/**
|
|
28
|
+
* expiration time
|
|
29
|
+
*/
|
|
30
|
+
expiration?: number;
|
|
31
|
+
/**
|
|
32
|
+
* claim version
|
|
33
|
+
*/
|
|
34
|
+
version?: number;
|
|
35
|
+
/**
|
|
36
|
+
* revocation nonce
|
|
37
|
+
*/
|
|
38
|
+
revNonce?: number;
|
|
39
|
+
/**
|
|
40
|
+
* subject position (index / value / none)
|
|
41
|
+
*/
|
|
42
|
+
subjectPosition?: SubjectPosition;
|
|
43
|
+
/**
|
|
44
|
+
* merklizedRootPosition (index / value / none)
|
|
45
|
+
*/
|
|
46
|
+
merklizedRootPosition?: MerklizedRootPosition;
|
|
47
|
+
}
|
|
48
|
+
/**
|
|
49
|
+
* Interface to work with credential wallets
|
|
50
|
+
*
|
|
51
|
+
* @export
|
|
52
|
+
* @beta
|
|
53
|
+
* @interface ICredentialWallet
|
|
54
|
+
*/
|
|
55
|
+
export interface ICredentialWallet {
|
|
56
|
+
/**
|
|
57
|
+
* List of W3C Credential
|
|
58
|
+
*
|
|
59
|
+
* @returns `Promise<W3CCredential[]`
|
|
60
|
+
*/
|
|
61
|
+
list(): Promise<W3CCredential[]>;
|
|
62
|
+
/**
|
|
63
|
+
* saves W3C credential (upsert)
|
|
64
|
+
* @param {W3CCredential} credential - credential to save
|
|
65
|
+
* @returns `Promise<void>`
|
|
66
|
+
*
|
|
67
|
+
*/
|
|
68
|
+
save(credential: W3CCredential): Promise<void>;
|
|
69
|
+
/**
|
|
70
|
+
* saves the batch of W3C credentials (upsert)
|
|
71
|
+
* @param {W3CCredential[]} credentials - credentials to save
|
|
72
|
+
* @returns `Promise<void>`
|
|
73
|
+
*/
|
|
74
|
+
saveAll(credentials: W3CCredential[]): Promise<void>;
|
|
75
|
+
/**
|
|
76
|
+
*
|
|
77
|
+
* removes W3C credentials from data storage
|
|
78
|
+
* @param {string} id
|
|
79
|
+
* @returns `Promise<void>`
|
|
80
|
+
*/
|
|
81
|
+
remove(id: string): Promise<void>;
|
|
82
|
+
/**
|
|
83
|
+
* Find credential using iden3 query language
|
|
84
|
+
*
|
|
85
|
+
* @param {ProofQuery} query - protocol query to find credential
|
|
86
|
+
* @returns `Promise<W3CCredential[]>`
|
|
87
|
+
*/
|
|
88
|
+
findByQuery(query: ProofQuery): Promise<W3CCredential[]>;
|
|
89
|
+
/**
|
|
90
|
+
* Finds the credential by its id
|
|
91
|
+
*
|
|
92
|
+
* @param {string} id - id of credential
|
|
93
|
+
* @returns `Promise<W3CCredential | undefined>`
|
|
94
|
+
*/
|
|
95
|
+
findById(id: string): Promise<W3CCredential | undefined>;
|
|
96
|
+
/**
|
|
97
|
+
* Finds credentials by JSON-LD schema and type
|
|
98
|
+
*
|
|
99
|
+
* @param {string} context - the URL of JSON-LD schema where type is defined
|
|
100
|
+
* @returns `Promise<W3CCredential[]>`
|
|
101
|
+
*/
|
|
102
|
+
findByContextType(context: string, type: string): Promise<W3CCredential[]>;
|
|
103
|
+
/**
|
|
104
|
+
* Filters given credentials with given credential subject
|
|
105
|
+
*
|
|
106
|
+
* @param {W3CCredential[]} credentials - credentials to filter
|
|
107
|
+
* @param {DID} subject - credential subject id
|
|
108
|
+
* @returns `Promise<W3CCredential[]>`
|
|
109
|
+
*/
|
|
110
|
+
filterByCredentialSubject(credentials: W3CCredential[], subject: DID): Promise<W3CCredential[]>;
|
|
111
|
+
/**
|
|
112
|
+
* Finds Auth BJJ credential for given user
|
|
113
|
+
*
|
|
114
|
+
* @param {DID} did - the issuer of Auth BJJ credential
|
|
115
|
+
* @returns `Promise<W3CCredential>` W3CCredential with AuthBJJCredential type
|
|
116
|
+
*/
|
|
117
|
+
getAuthBJJCredential(did: DID): Promise<W3CCredential>;
|
|
118
|
+
/**
|
|
119
|
+
* Fetches or Builds a revocation status for a given credential
|
|
120
|
+
* Supported types for credentialStatus field: SparseMerkleTreeProof, Iden3ReverseSparseMerkleTreeProof
|
|
121
|
+
*
|
|
122
|
+
* @param {W3CCredential} cred - credential for which lib should build revocation status
|
|
123
|
+
* @returns `Promise<RevocationStatus>`
|
|
124
|
+
*/
|
|
125
|
+
getRevocationStatusFromCredential(cred: W3CCredential): Promise<RevocationStatus>;
|
|
126
|
+
/**
|
|
127
|
+
* Fetches Revocation status depended on type
|
|
128
|
+
*
|
|
129
|
+
* @param {(CredentialStatus | RHSCredentialStatus)} credStatus - credentialStatus field of the Verifiable Credential. Supported types for credentialStatus field: SparseMerkleTreeProof, Iden3ReverseSparseMerkleTreeProof
|
|
130
|
+
* @param {DID} issuerDID - credential issuer identity
|
|
131
|
+
* @param {IssuerData} issuerData - metadata of the issuer, usually contained in the BjjSignature / Iden3SparseMerkleTreeProof
|
|
132
|
+
* @returns `Promise<RevocationStatus>`
|
|
133
|
+
*/
|
|
134
|
+
getRevocationStatus(credStatus: CredentialStatus | RHSCredentialStatus, issuerDID: DID, issuerData: IssuerData): Promise<RevocationStatus>;
|
|
135
|
+
/**
|
|
136
|
+
* Creates a W3C verifiable Credential object
|
|
137
|
+
*
|
|
138
|
+
* @param {string} hostUrl - URL that will be used as a prefix for credential identifier
|
|
139
|
+
* @param {DID} issuer - issuer identity
|
|
140
|
+
* @param {CredentialRequest} request - specification of claim creation parameters
|
|
141
|
+
* @param {JSONSchema} schema - JSON schema for W3C Verifiable Credential
|
|
142
|
+
* @param {string} [rhsUrl] - URL of reverse hash service, if it's not set - host url is used for 'SparseMerkleTreeProof' credential status type
|
|
143
|
+
* @returns W3CCredential
|
|
144
|
+
*/
|
|
145
|
+
createCredential(hostUrl: string, issuer: DID, request: CredentialRequest, schema: JSONSchema, rhsUrl?: string): W3CCredential;
|
|
146
|
+
/**
|
|
147
|
+
* Finds non-revoked credential from a given list by resolving their credential status
|
|
148
|
+
*
|
|
149
|
+
* @param {W3CCredential[]} creds
|
|
150
|
+
* @returns `{Promise<{
|
|
151
|
+
* cred: W3CCredential;
|
|
152
|
+
* revStatus: RevocationStatus;
|
|
153
|
+
* }>` not revoked credential and it's revocation status
|
|
154
|
+
*/
|
|
155
|
+
findNonRevokedCredential(creds: W3CCredential[]): Promise<{
|
|
156
|
+
cred: W3CCredential;
|
|
157
|
+
revStatus: RevocationStatus;
|
|
158
|
+
}>;
|
|
159
|
+
}
|
|
160
|
+
/**
|
|
161
|
+
*
|
|
162
|
+
* Wallet instance is a wrapper of CRUD logic for W3C credentials,
|
|
163
|
+
* also it allows to fetch revocation statuses.
|
|
164
|
+
*
|
|
165
|
+
* @export
|
|
166
|
+
* @beta
|
|
167
|
+
* @class CredentialWallet
|
|
168
|
+
* @implements implements ICredentialWallet interface
|
|
169
|
+
*/
|
|
170
|
+
export declare class CredentialWallet implements ICredentialWallet {
|
|
171
|
+
private readonly _storage;
|
|
172
|
+
/**
|
|
173
|
+
* Creates an instance of CredentialWallet.
|
|
174
|
+
* @param {IDataStorage} _storage - - data storage to access credential / identity / Merkle tree data
|
|
175
|
+
*/
|
|
176
|
+
constructor(_storage: IDataStorage);
|
|
177
|
+
/**
|
|
178
|
+
* {@inheritDoc ICredentialWallet.getAuthBJJCredential}
|
|
179
|
+
*/
|
|
180
|
+
getAuthBJJCredential(did: DID): Promise<W3CCredential>;
|
|
181
|
+
/**
|
|
182
|
+
* {@inheritDoc ICredentialWallet.getRevocationStatusFromCredential}
|
|
183
|
+
*/
|
|
184
|
+
getRevocationStatusFromCredential(cred: W3CCredential): Promise<RevocationStatus>;
|
|
185
|
+
/**
|
|
186
|
+
* {@inheritDoc ICredentialWallet.getRevocationStatus}
|
|
187
|
+
*/
|
|
188
|
+
getRevocationStatus(credStatus: CredentialStatus | RHSCredentialStatus, issuerDID: DID, issuerData: IssuerData): Promise<RevocationStatus>;
|
|
189
|
+
/**
|
|
190
|
+
* {@inheritDoc ICredentialWallet.createCredential}
|
|
191
|
+
*/
|
|
192
|
+
createCredential: (hostUrl: string, issuer: DID, request: CredentialRequest, schema: JSONSchema, rhsUrl?: string) => W3CCredential;
|
|
193
|
+
/**
|
|
194
|
+
* {@inheritDoc ICredentialWallet.findById}
|
|
195
|
+
*/
|
|
196
|
+
findById(id: string): Promise<W3CCredential | undefined>;
|
|
197
|
+
/**
|
|
198
|
+
* {@inheritDoc ICredentialWallet.findByContextType}
|
|
199
|
+
*/
|
|
200
|
+
findByContextType(context: string, type: string): Promise<W3CCredential[]>;
|
|
201
|
+
/**
|
|
202
|
+
* {@inheritDoc ICredentialWallet.save}
|
|
203
|
+
*/
|
|
204
|
+
save(credential: W3CCredential): Promise<void>;
|
|
205
|
+
/**
|
|
206
|
+
* {@inheritDoc ICredentialWallet.saveAll}
|
|
207
|
+
*/
|
|
208
|
+
saveAll(credentials: W3CCredential[]): Promise<void>;
|
|
209
|
+
/**
|
|
210
|
+
* {@inheritDoc ICredentialWallet.remove}
|
|
211
|
+
*/
|
|
212
|
+
remove(id: string): Promise<void>;
|
|
213
|
+
/**
|
|
214
|
+
* {@inheritDoc ICredentialWallet.list}
|
|
215
|
+
*/
|
|
216
|
+
list(): Promise<W3CCredential[]>;
|
|
217
|
+
/**
|
|
218
|
+
* {@inheritDoc ICredentialWallet.findByQuery}
|
|
219
|
+
*/
|
|
220
|
+
findByQuery(query: ProofQuery): Promise<W3CCredential[]>;
|
|
221
|
+
/**
|
|
222
|
+
* {@inheritDoc ICredentialWallet.filterByCredentialSubject}
|
|
223
|
+
*/
|
|
224
|
+
filterByCredentialSubject(credentials: W3CCredential[], subject: DID): Promise<W3CCredential[]>;
|
|
225
|
+
findNonRevokedCredential(creds: W3CCredential[]): Promise<{
|
|
226
|
+
cred: W3CCredential;
|
|
227
|
+
revStatus: RevocationStatus;
|
|
228
|
+
}>;
|
|
229
|
+
}
|
|
230
|
+
/**
|
|
231
|
+
* Checks if issuer did is created from given state is genesis
|
|
232
|
+
*
|
|
233
|
+
* @export
|
|
234
|
+
* @param {string} issuer - did (string)
|
|
235
|
+
* @param {string} state - hex state
|
|
236
|
+
* @returns boolean
|
|
237
|
+
*/
|
|
238
|
+
export declare function isIssuerGenesis(issuer: string, state: string): boolean;
|
|
239
|
+
/**
|
|
240
|
+
* Checks if id is created from given state and type is genesis
|
|
241
|
+
*
|
|
242
|
+
* @export
|
|
243
|
+
* @param {bigint} id
|
|
244
|
+
* @param {bigint} state
|
|
245
|
+
* @param {Uint8Array} type
|
|
246
|
+
* @returns boolean - returns if id is genesis
|
|
247
|
+
*/
|
|
248
|
+
export declare function isGenesisStateId(id: bigint, state: bigint, type: Uint8Array): boolean;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from './credential-wallet';
|
|
@@ -0,0 +1,97 @@
|
|
|
1
|
+
import { Hash, Merkletree } from '@iden3/js-merkletree';
|
|
2
|
+
import { IStateStorage } from '../storage/interfaces';
|
|
3
|
+
import { DID } from '@iden3/js-iden3-core';
|
|
4
|
+
import { CredentialStatus, RevocationStatus, RHSCredentialStatus } from '../verifiable';
|
|
5
|
+
/**
|
|
6
|
+
* Interface to unite contains three trees: claim, revocation and rootOfRoots
|
|
7
|
+
* Also contains the current state of identity
|
|
8
|
+
* @export
|
|
9
|
+
* @beta
|
|
10
|
+
* @interface TreesModel
|
|
11
|
+
*/
|
|
12
|
+
export interface TreesModel {
|
|
13
|
+
claimsTree: Merkletree;
|
|
14
|
+
revocationTree: Merkletree;
|
|
15
|
+
rootsTree: Merkletree;
|
|
16
|
+
state: Hash;
|
|
17
|
+
}
|
|
18
|
+
declare enum NodeType {
|
|
19
|
+
Unknown = 0,
|
|
20
|
+
Middle = 1,
|
|
21
|
+
Leaf = 2,
|
|
22
|
+
State = 3
|
|
23
|
+
}
|
|
24
|
+
/**
|
|
25
|
+
* ProofNode is a partial Reverse Hash Service result
|
|
26
|
+
* it contains the current node hash and its children
|
|
27
|
+
*
|
|
28
|
+
* @export
|
|
29
|
+
* @beta
|
|
30
|
+
* @class ProofNode
|
|
31
|
+
*/
|
|
32
|
+
export declare class ProofNode {
|
|
33
|
+
hash: Hash;
|
|
34
|
+
children: Hash[];
|
|
35
|
+
/**
|
|
36
|
+
*
|
|
37
|
+
* Creates an instance of ProofNode.
|
|
38
|
+
* @param {Hash} [hash=ZERO_HASH] - current node hash
|
|
39
|
+
* @param {Hash[]} [children=[]] - children of the node
|
|
40
|
+
*/
|
|
41
|
+
constructor(hash?: Hash, children?: Hash[]);
|
|
42
|
+
/**
|
|
43
|
+
* Determination of Node type
|
|
44
|
+
* Can be: Leaf, Middle or State node
|
|
45
|
+
*
|
|
46
|
+
* @returns NodeType
|
|
47
|
+
*/
|
|
48
|
+
nodeType(): NodeType;
|
|
49
|
+
/**
|
|
50
|
+
* JSON Representation of ProofNode with a hex values
|
|
51
|
+
*
|
|
52
|
+
* @returns {*} - ProofNode with hexes
|
|
53
|
+
*/
|
|
54
|
+
toJSON(): {
|
|
55
|
+
hash: string;
|
|
56
|
+
children: string[];
|
|
57
|
+
};
|
|
58
|
+
/**
|
|
59
|
+
* Creates ProofNode Hashes from hex values
|
|
60
|
+
*
|
|
61
|
+
* @static
|
|
62
|
+
* @param {ProofNodeHex} hexNode
|
|
63
|
+
* @returns ProofNode
|
|
64
|
+
*/
|
|
65
|
+
static fromHex(hexNode: ProofNodeHex): ProofNode;
|
|
66
|
+
}
|
|
67
|
+
interface ProofNodeHex {
|
|
68
|
+
hash: string;
|
|
69
|
+
children: string[];
|
|
70
|
+
}
|
|
71
|
+
/**
|
|
72
|
+
*
|
|
73
|
+
* Fetches and Builds a revocation status for a given credential
|
|
74
|
+
* Supported types for credentialStatus field: SparseMerkleTreeProof, Iden3ReverseSparseMerkleTreeProof
|
|
75
|
+
*
|
|
76
|
+
* @export
|
|
77
|
+
* @param {DID} issuer - issuer identity
|
|
78
|
+
* @param {(CredentialStatus | RHSCredentialStatus)} credStatus - credentialStatus field from the W3C verifiable credential
|
|
79
|
+
* @param {IStateStorage} stateStorage - storage to fetch current issuer status
|
|
80
|
+
* @returns Promise<RevocationStatus>
|
|
81
|
+
*/
|
|
82
|
+
export declare function getStatusFromRHS(issuer: DID, credStatus: CredentialStatus | RHSCredentialStatus, stateStorage: IStateStorage): Promise<RevocationStatus>;
|
|
83
|
+
/**
|
|
84
|
+
* Pushes identity state information to a reverse hash service.
|
|
85
|
+
*
|
|
86
|
+
* A reverse hash service (RHS) is a centralized or decentralized service for storing publicly available data about identity.
|
|
87
|
+
* Such data are identity state and state of revocation tree and roots tree root tree.
|
|
88
|
+
*
|
|
89
|
+
* @export
|
|
90
|
+
* @param {Hash} state - current state of identity
|
|
91
|
+
* @param {TreesModel} trees - current trees of identity (claims, revocation, rootOfRoots )
|
|
92
|
+
* @param {string} rhsUrl - URL of service
|
|
93
|
+
* @param {number[]} [revokedNonces] - revoked nonces since last published info
|
|
94
|
+
* @returns void
|
|
95
|
+
*/
|
|
96
|
+
export declare function pushHashesToRHS(state: Hash, trees: TreesModel, rhsUrl: string, revokedNonces?: number[]): Promise<void>;
|
|
97
|
+
export {};
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Constants for Iden3 protocol
|
|
3
|
+
*/
|
|
4
|
+
export declare const PROTOCOL_MESSAGE_TYPE: Readonly<{
|
|
5
|
+
AUTHORIZATION_REQUEST_MESSAGE_TYPE: string;
|
|
6
|
+
AUTHORIZATION_RESPONSE_MESSAGE_TYPE: string;
|
|
7
|
+
CREDENTIAL_ISSUANCE_REQUEST_MESSAGE_TYPE: string;
|
|
8
|
+
CREDENTIAL_FETCH_REQUEST_MESSAGE_TYPE: string;
|
|
9
|
+
CREDENTIAL_OFFER_MESSAGE_TYPE: string;
|
|
10
|
+
CREDENTIAL_ISSUANCE_RESPONSE_MESSAGE_TYPE: string;
|
|
11
|
+
DEVICE_REGISTRATION_REQUEST_MESSAGE_TYPE: string;
|
|
12
|
+
MESSAGE_FETCH_REQUEST_MESSAGE_TYPE: string;
|
|
13
|
+
PROOF_GENERATION_REQUEST_MESSAGE_TYPE: string;
|
|
14
|
+
PROOF_GENERATION_RESPONSE_MESSAGE_TYPE: string;
|
|
15
|
+
REVOCATION_STATUS_REQUEST_MESSAGE_TYPE: string;
|
|
16
|
+
REVOCATION_STATUS_RESPONSE_MESSAGE_TYPE: string;
|
|
17
|
+
}>;
|
|
18
|
+
/**
|
|
19
|
+
* Media types for iden3 comm communication protocol
|
|
20
|
+
*
|
|
21
|
+
* @export
|
|
22
|
+
* @enum {number}
|
|
23
|
+
*/
|
|
24
|
+
export declare enum MediaType {
|
|
25
|
+
ZKPMessage = "application/iden3-zkp-json",
|
|
26
|
+
PlainMessage = "application/iden3comm-plain-json"
|
|
27
|
+
}
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
export declare const ErrNotProtocolMessage = "the envelope is not a protocol message";
|
|
2
|
+
export declare const ErrNotEnvelopeStub = "the envelope doesn't contain field protected";
|
|
3
|
+
export declare const ErrNotHeaderStub = "the envelope doesn't contain field typ";
|
|
4
|
+
export declare const ErrUnknownCircuitID = "unknown circuit ID. can't verify msg sender";
|
|
5
|
+
export declare const ErrSenderNotUsedTokenCreation = "sender of message is not used for jwz token creation";
|
|
6
|
+
export declare const ErrPackedWithUnsupportedCircuit = "message was packed with unsupported circuit";
|
|
7
|
+
export declare const ErrProofIsInvalid = "message proof is invalid";
|
|
8
|
+
export declare const ErrStateVerificationFailed = "message state verification failed";
|
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
import { BasicMessage, IPackageManager, IPacker, PackerParams } from './types';
|
|
2
|
+
import { MediaType } from './constants';
|
|
3
|
+
/**
|
|
4
|
+
* Basic package manager for iden3 communication protocol
|
|
5
|
+
*
|
|
6
|
+
* @export
|
|
7
|
+
* @beta
|
|
8
|
+
* @class PackageManager
|
|
9
|
+
* @implements implements IPackageManager interface
|
|
10
|
+
*/
|
|
11
|
+
export declare class PackageManager implements IPackageManager {
|
|
12
|
+
packers: Map<MediaType, IPacker>;
|
|
13
|
+
/**
|
|
14
|
+
* Creates an instance of PackageManager.
|
|
15
|
+
*/
|
|
16
|
+
constructor();
|
|
17
|
+
/** {@inheritDoc IPackageManager.registerPackers} */
|
|
18
|
+
registerPackers(packers: Array<IPacker>): void;
|
|
19
|
+
/** {@inheritDoc IPackageManager.pack} */
|
|
20
|
+
pack(mediaType: MediaType, payload: Uint8Array, params: PackerParams): Promise<Uint8Array>;
|
|
21
|
+
/** {@inheritDoc IPackageManager.unpack} */
|
|
22
|
+
unpack(envelope: Uint8Array): Promise<{
|
|
23
|
+
unpackedMessage: BasicMessage;
|
|
24
|
+
unpackedMediaType: MediaType;
|
|
25
|
+
}>;
|
|
26
|
+
/** {@inheritDoc IPackageManager.unpackWithType} */
|
|
27
|
+
unpackWithType(mediaType: MediaType, envelope: Uint8Array): Promise<BasicMessage>;
|
|
28
|
+
private unpackWithSafeEnvelope;
|
|
29
|
+
/** {@inheritDoc IPackageManager.getMediaType} */
|
|
30
|
+
getMediaType(envelope: string): MediaType;
|
|
31
|
+
}
|
|
@@ -0,0 +1,34 @@
|
|
|
1
|
+
import { PlainPackerParams } from './../types/packer';
|
|
2
|
+
import { BasicMessage, IPacker } from '../types';
|
|
3
|
+
import { MediaType } from '../constants';
|
|
4
|
+
/**
|
|
5
|
+
* Plain packer just serializes bytes to JSON and adds media type
|
|
6
|
+
*
|
|
7
|
+
* @export
|
|
8
|
+
* @beta
|
|
9
|
+
* @class PlainPacker
|
|
10
|
+
* @implements implements IPacker interface
|
|
11
|
+
*/
|
|
12
|
+
export declare class PlainPacker implements IPacker {
|
|
13
|
+
/**
|
|
14
|
+
* Pack returns packed message to transport envelope
|
|
15
|
+
*
|
|
16
|
+
* @param {Uint8Array} payload - json message serialized
|
|
17
|
+
* @param {PlainPackerParams} _params - not used here
|
|
18
|
+
* @returns `Promise<Uint8Array>`
|
|
19
|
+
*/
|
|
20
|
+
pack(payload: Uint8Array, _params: PlainPackerParams): Promise<Uint8Array>;
|
|
21
|
+
/**
|
|
22
|
+
* Unpack returns unpacked message from transport envelope
|
|
23
|
+
*
|
|
24
|
+
* @param {Uint8Array} envelope - packed envelope (serialized json with media type)
|
|
25
|
+
* @returns `Promise<BasicMessage>`
|
|
26
|
+
*/
|
|
27
|
+
unpack(envelope: Uint8Array): Promise<BasicMessage>;
|
|
28
|
+
/**
|
|
29
|
+
* returns media type for plain message
|
|
30
|
+
*
|
|
31
|
+
* @returns MediaType
|
|
32
|
+
*/
|
|
33
|
+
mediaType(): MediaType;
|
|
34
|
+
}
|