@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,38 @@
|
|
|
1
|
+
import { Id, DID } from '@mocanetwork/moca-iden3';
|
|
2
|
+
import { Hash } from '@iden3/js-merkletree';
|
|
3
|
+
import { VerificationMethod, DIDResolutionMetadata } from 'did-resolver';
|
|
4
|
+
/**
|
|
5
|
+
* Supported DID Document Signatures
|
|
6
|
+
*/
|
|
7
|
+
export declare enum DIDDocumentSignature {
|
|
8
|
+
EthereumEip712Signature2021 = "EthereumEip712Signature2021"
|
|
9
|
+
}
|
|
10
|
+
/**
|
|
11
|
+
* Checks if state is genesis state
|
|
12
|
+
*
|
|
13
|
+
* @param {DID} did - did
|
|
14
|
+
* @param {bigint|string} state - hash on bigInt or hex string format
|
|
15
|
+
* @returns boolean
|
|
16
|
+
*/
|
|
17
|
+
export declare function isGenesisState(did: DID, state: bigint | string): boolean;
|
|
18
|
+
/**
|
|
19
|
+
* Checks if DID is an ethereum identity
|
|
20
|
+
*
|
|
21
|
+
* @param {DID} did - did
|
|
22
|
+
* @returns boolean
|
|
23
|
+
*/
|
|
24
|
+
export declare function isEthereumIdentity(did: DID): boolean;
|
|
25
|
+
export declare const buildVerifierId: (address: string, info: {
|
|
26
|
+
method: string;
|
|
27
|
+
blockchain: string;
|
|
28
|
+
networkId: string;
|
|
29
|
+
}) => Id;
|
|
30
|
+
export declare const validateDIDDocumentAuth: (did: DID, resolverURL: string, state: Hash) => Promise<void>;
|
|
31
|
+
export declare const resolveDIDDocumentAuth: (did: DID, resolveURL: string, state?: Hash) => Promise<VerificationMethod | undefined>;
|
|
32
|
+
export declare const resolveDidDocument: (did: DID, resolverUrl: string, opts?: {
|
|
33
|
+
state?: Hash;
|
|
34
|
+
gist?: Hash;
|
|
35
|
+
signature?: DIDDocumentSignature;
|
|
36
|
+
}) => Promise<DIDResolutionMetadata>;
|
|
37
|
+
export declare const buildDIDFromEthPubKey: (didType: Uint8Array, pubKeyEth: string) => DID;
|
|
38
|
+
//# sourceMappingURL=did-helper.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"did-helper.d.ts","sourceRoot":"","sources":["../../../src/utils/did-helper.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,EAAE,EAAuC,GAAG,EAAE,MAAM,yBAAyB,CAAC;AACvF,OAAO,EAAE,IAAI,EAAE,MAAM,sBAAsB,CAAC;AAC5C,OAAO,EAAuB,kBAAkB,EAAE,qBAAqB,EAAE,MAAM,cAAc,CAAC;AAI9F;;GAEG;AACH,oBAAY,oBAAoB;IAC9B,2BAA2B,gCAAgC;CAC5D;AAED;;;;;;GAMG;AACH,wBAAgB,cAAc,CAAC,GAAG,EAAE,GAAG,EAAE,KAAK,EAAE,MAAM,GAAG,MAAM,GAAG,OAAO,CAUxE;AAED;;;;;GAKG;AACH,wBAAgB,kBAAkB,CAAC,GAAG,EAAE,GAAG,GAAG,OAAO,CAUpD;AAED,eAAO,MAAM,eAAe,GAC1B,SAAS,MAAM,EACf,MAAM;IAAE,MAAM,EAAE,MAAM,CAAC;IAAC,UAAU,EAAE,MAAM,CAAC;IAAC,SAAS,EAAE,MAAM,CAAA;CAAE,KAC9D,EASF,CAAC;AAEF,eAAO,MAAM,uBAAuB,GAAU,KAAK,GAAG,EAAE,aAAa,MAAM,EAAE,OAAO,IAAI,kBAYvF,CAAC;AAEF,eAAO,MAAM,sBAAsB,GACjC,KAAK,GAAG,EACR,YAAY,MAAM,EAClB,QAAQ,IAAI,KACX,OAAO,CAAC,kBAAkB,GAAG,SAAS,CAUxC,CAAC;AAeF,eAAO,MAAM,kBAAkB,GAC7B,KAAK,GAAG,EACR,aAAa,MAAM,EACnB,OAAO;IACL,KAAK,CAAC,EAAE,IAAI,CAAC;IACb,IAAI,CAAC,EAAE,IAAI,CAAC;IACZ,SAAS,CAAC,EAAE,oBAAoB,CAAC;CAClC,KACA,OAAO,CAAC,qBAAqB,CA2B/B,CAAC;AAEF,eAAO,MAAM,qBAAqB,GAAI,SAAS,UAAU,EAAE,WAAW,MAAM,KAAG,GAW9E,CAAC"}
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
export declare const byteEncoder: TextEncoder;
|
|
2
|
+
export declare const byteDecoder: TextDecoder;
|
|
3
|
+
export declare function bytesToBase64url(b: Uint8Array, opts?: {
|
|
4
|
+
pad: boolean;
|
|
5
|
+
}): string;
|
|
6
|
+
export declare function base64ToBytes(s: string, opts?: {
|
|
7
|
+
loose: boolean;
|
|
8
|
+
}): Uint8Array;
|
|
9
|
+
export declare function bytesToBase64(b: Uint8Array, opts?: {
|
|
10
|
+
pad: boolean;
|
|
11
|
+
}): string;
|
|
12
|
+
export declare function base64UrlToBytes(s: string, opts?: {
|
|
13
|
+
loose: boolean;
|
|
14
|
+
}): Uint8Array;
|
|
15
|
+
export declare function base58ToBytes(s: string): Uint8Array;
|
|
16
|
+
export declare function bytesToBase58(b: Uint8Array): string;
|
|
17
|
+
export declare function hexToBytes(s: string): Uint8Array;
|
|
18
|
+
export declare function encodeBase64url(s: string, opts?: {
|
|
19
|
+
pad: boolean;
|
|
20
|
+
}): string;
|
|
21
|
+
export declare function decodeBase64url(s: string, opts?: {
|
|
22
|
+
loose: boolean;
|
|
23
|
+
}): string;
|
|
24
|
+
export declare function bytesToHex(b: Uint8Array): string;
|
|
25
|
+
//# sourceMappingURL=encoding.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"encoding.d.ts","sourceRoot":"","sources":["../../../src/utils/encoding.ts"],"names":[],"mappings":"AAGA,eAAO,MAAM,WAAW,aAAoB,CAAC;AAC7C,eAAO,MAAM,WAAW,aAAoB,CAAC;AAE7C,wBAAgB,gBAAgB,CAAC,CAAC,EAAE,UAAU,EAAE,IAAI;;CAAiB,GAAG,MAAM,CAE7E;AAED,wBAAgB,aAAa,CAAC,CAAC,EAAE,MAAM,EAAE,IAAI;;CAAkB,GAAG,UAAU,CAE3E;AAED,wBAAgB,aAAa,CAAC,CAAC,EAAE,UAAU,EAAE,IAAI;;CAAiB,GAAG,MAAM,CAE1E;AAED,wBAAgB,gBAAgB,CAAC,CAAC,EAAE,MAAM,EAAE,IAAI;;CAAkB,GAAG,UAAU,CAG9E;AAED,wBAAgB,aAAa,CAAC,CAAC,EAAE,MAAM,GAAG,UAAU,CAEnD;AAED,wBAAgB,aAAa,CAAC,CAAC,EAAE,UAAU,GAAG,MAAM,CAEnD;AAED,wBAAgB,UAAU,CAAC,CAAC,EAAE,MAAM,GAAG,UAAU,CAGhD;AAED,wBAAgB,eAAe,CAAC,CAAC,EAAE,MAAM,EAAE,IAAI;;CAAiB,GAAG,MAAM,CAExE;AAED,wBAAgB,eAAe,CAAC,CAAC,EAAE,MAAM,EAAE,IAAI;;CAAkB,GAAG,MAAM,CAEzE;AAED,wBAAgB,UAAU,CAAC,CAAC,EAAE,UAAU,GAAG,MAAM,CAEhD"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/utils/index.ts"],"names":[],"mappings":"AAAA,cAAc,YAAY,CAAC;AAC3B,cAAc,UAAU,CAAC;AACzB,cAAc,cAAc,CAAC;AAC7B,cAAc,eAAe,CAAC;AAC9B,cAAc,gBAAgB,CAAC;AAC/B,cAAc,mBAAmB,CAAC;AAClC,cAAc,gBAAgB,CAAC"}
|
|
@@ -0,0 +1,63 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Represents an event in the SDK.
|
|
3
|
+
*/
|
|
4
|
+
type SdkEvent = string;
|
|
5
|
+
export declare const SDK_EVENTS: {
|
|
6
|
+
[k: SdkEvent]: SdkEvent;
|
|
7
|
+
};
|
|
8
|
+
/**
|
|
9
|
+
* Represents a topic in the SDK message bus.
|
|
10
|
+
*/
|
|
11
|
+
export type SdkTopic = keyof typeof SDK_EVENTS;
|
|
12
|
+
/**
|
|
13
|
+
* Represents a message bus that allows publishing and subscribing to topics.
|
|
14
|
+
*/
|
|
15
|
+
export declare class MessageBus {
|
|
16
|
+
/**
|
|
17
|
+
* The singleton instance of the MessageBus class.
|
|
18
|
+
*/
|
|
19
|
+
private static instance;
|
|
20
|
+
/**
|
|
21
|
+
* Private constructor for the MessageBus class.
|
|
22
|
+
*/
|
|
23
|
+
private constructor();
|
|
24
|
+
/**
|
|
25
|
+
* Returns the singleton instance of the MessageBus class.
|
|
26
|
+
* If the instance doesn't exist, it creates a new one.
|
|
27
|
+
* @returns The singleton instance of the MessageBus class.
|
|
28
|
+
*/
|
|
29
|
+
static getInstance(): MessageBus;
|
|
30
|
+
/**
|
|
31
|
+
* Publishes a message to the specified topic.
|
|
32
|
+
*
|
|
33
|
+
* @template T - The type of data being published.
|
|
34
|
+
* @param {SdkTopic} topic - The topic to publish the message to.
|
|
35
|
+
* @param {T} data - The data to be published.
|
|
36
|
+
* @returns {boolean} - Returns true if the message was successfully published, false otherwise.
|
|
37
|
+
*/
|
|
38
|
+
publish<T>(topic: SdkTopic, data: T): boolean;
|
|
39
|
+
/**
|
|
40
|
+
* Subscribes to a specific topic and registers a callback function to be executed when a message is published.
|
|
41
|
+
*
|
|
42
|
+
* @param topic - The topic to subscribe to.
|
|
43
|
+
* @param callback - The callback function to be executed when a message is published.
|
|
44
|
+
*/
|
|
45
|
+
subscribe<T>(topic: SdkTopic, callback: (data: T) => void): string;
|
|
46
|
+
/**
|
|
47
|
+
* Subscribes to a specific topic and registers a callback function to be executed when a message is published.
|
|
48
|
+
* The callback function is executed only once.
|
|
49
|
+
*
|
|
50
|
+
* @param topic - The topic to subscribe to.
|
|
51
|
+
* @param callback - The callback function to be executed when a message is published.
|
|
52
|
+
*/
|
|
53
|
+
subscribeOnce<T>(topic: SdkTopic, callback: (data: T) => void): void;
|
|
54
|
+
/**
|
|
55
|
+
* Unsubscribes from a specific topic in the message bus.
|
|
56
|
+
*
|
|
57
|
+
* @param topic - The topic to unsubscribe from.
|
|
58
|
+
* @returns A string or boolean indicating the success of the unsubscribe operation.
|
|
59
|
+
*/
|
|
60
|
+
unsubscribe(topic: SdkTopic): string | boolean;
|
|
61
|
+
}
|
|
62
|
+
export {};
|
|
63
|
+
//# sourceMappingURL=message-bus.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"message-bus.d.ts","sourceRoot":"","sources":["../../../src/utils/message-bus.ts"],"names":[],"mappings":"AAEA;;GAEG;AACH,KAAK,QAAQ,GAAG,MAAM,CAAC;AAEvB,eAAO,MAAM,UAAU,EAAE;IAAE,CAAC,CAAC,EAAE,QAAQ,GAAG,QAAQ,CAAA;CAEjD,CAAC;AAEF;;GAEG;AACH,MAAM,MAAM,QAAQ,GAAG,MAAM,OAAO,UAAU,CAAC;AAE/C;;GAEG;AACH,qBAAa,UAAU;IACrB;;OAEG;IACH,OAAO,CAAC,MAAM,CAAC,QAAQ,CAAa;IAEpC;;OAEG;IAEH,OAAO;IAEP;;;;OAIG;WACW,WAAW,IAAI,UAAU;IASvC;;;;;;;OAOG;IACI,OAAO,CAAC,CAAC,EAAE,KAAK,EAAE,QAAQ,EAAE,IAAI,EAAE,CAAC,GAAG,OAAO;IAIpD;;;;;OAKG;IACI,SAAS,CAAC,CAAC,EAAE,KAAK,EAAE,QAAQ,EAAE,QAAQ,EAAE,CAAC,IAAI,EAAE,CAAC,KAAK,IAAI,GAAG,MAAM;IAIzE;;;;;;OAMG;IACI,aAAa,CAAC,CAAC,EAAE,KAAK,EAAE,QAAQ,EAAE,QAAQ,EAAE,CAAC,IAAI,EAAE,CAAC,KAAK,IAAI,GAAG,IAAI;IAI3E;;;;;OAKG;IACI,WAAW,CAAC,KAAK,EAAE,QAAQ,GAAG,MAAM,GAAG,OAAO;CAGtD"}
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Merges two objects together, prioritizing the properties of the second object.
|
|
3
|
+
* If a property exists in both objects, the value from the second object will be used.
|
|
4
|
+
* @param credSubject - The first object to merge.
|
|
5
|
+
* @param otherCredSubject - The second object to merge.
|
|
6
|
+
* @returns A new object with the merged properties.
|
|
7
|
+
*/
|
|
8
|
+
import { JsonDocumentObject } from '../iden3comm';
|
|
9
|
+
export declare function mergeObjects(credSubject: JsonDocumentObject, otherCredSubject: JsonDocumentObject): JsonDocumentObject;
|
|
10
|
+
//# sourceMappingURL=object.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"object.d.ts","sourceRoot":"","sources":["../../../src/utils/object.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;AAEH,OAAO,EAAE,kBAAkB,EAAE,MAAM,cAAc,CAAC;AAElD,wBAAgB,YAAY,CAC1B,WAAW,EAAE,kBAAkB,EAC/B,gBAAgB,EAAE,kBAAkB,sBAuCrC"}
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
import { Signer } from 'ethers';
|
|
2
|
+
import { Iden3PaymentRailsERC20RequestV1, Iden3PaymentRailsRequestV1, MultiChainPaymentConfigOption } from '../../iden3comm';
|
|
3
|
+
import { Resolvable } from 'did-resolver';
|
|
4
|
+
/**
|
|
5
|
+
* @beta
|
|
6
|
+
* buildEvmPayment creates an EVM-based payment request and signs it using EIP-712.
|
|
7
|
+
* @param {Signer} signer - EIP-712 compatible signer
|
|
8
|
+
* @param {MultiChainPaymentConfigOption} option - payment option configuration
|
|
9
|
+
* @param {string} chainId - EVM chain ID
|
|
10
|
+
* @param {string} paymentRails - payment rails contract address
|
|
11
|
+
* @param {string} recipient - recipient address
|
|
12
|
+
* @param {bigint} amount - payment amount in smallest units
|
|
13
|
+
* @param {Date} expirationDateRequired - expiration date
|
|
14
|
+
* @param {bigint} nonce - unique nonce for the payment
|
|
15
|
+
* @returns {Promise<Iden3PaymentRailsRequestV1 | Iden3PaymentRailsERC20RequestV1>} payment request object
|
|
16
|
+
*/
|
|
17
|
+
export declare const buildEvmPayment: (signer: Signer, option: MultiChainPaymentConfigOption, chainId: string, paymentRails: string, recipient: string, amount: bigint, expirationDateRequired: Date, nonce: bigint) => Promise<Iden3PaymentRailsRequestV1 | Iden3PaymentRailsERC20RequestV1>;
|
|
18
|
+
export declare function verifyEIP712TypedData(data: Iden3PaymentRailsRequestV1 | Iden3PaymentRailsERC20RequestV1, resolver: Resolvable): Promise<string>;
|
|
19
|
+
//# sourceMappingURL=evm.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"evm.d.ts","sourceRoot":"","sources":["../../../../src/utils/payments/evm.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,MAAM,EAAU,MAAM,QAAQ,CAAC;AACxC,OAAO,EAEL,+BAA+B,EAC/B,0BAA0B,EAC1B,6BAA6B,EAC9B,MAAM,iBAAiB,CAAC;AAGzB,OAAO,EAAE,UAAU,EAAE,MAAM,cAAc,CAAC;AAE1C;;;;;;;;;;;;GAYG;AACH,eAAO,MAAM,eAAe,GAC1B,QAAQ,MAAM,EACd,QAAQ,6BAA6B,EACrC,SAAS,MAAM,EACf,cAAc,MAAM,EACpB,WAAW,MAAM,EACjB,QAAQ,MAAM,EACd,wBAAwB,IAAI,EAC5B,OAAO,MAAM,KACZ,OAAO,CAAC,0BAA0B,GAAG,+BAA+B,CAqEtE,CAAC;AAEF,wBAAsB,qBAAqB,CACzC,IAAI,EAAE,0BAA0B,GAAG,+BAA+B,EAClE,QAAQ,EAAE,UAAU,GACnB,OAAO,CAAC,MAAM,CAAC,CA4CjB"}
|
|
@@ -0,0 +1,88 @@
|
|
|
1
|
+
import { Schema } from 'borsh';
|
|
2
|
+
import { Iden3PaymentRailsSolanaRequestV1, Iden3PaymentRailsSolanaSPLRequestV1, MultiChainPaymentConfigOption } from '../../iden3comm';
|
|
3
|
+
import { Keypair } from '@solana/web3.js';
|
|
4
|
+
import { Resolvable } from 'did-resolver';
|
|
5
|
+
export declare class SolanaNativePaymentRequest {
|
|
6
|
+
version: Uint8Array;
|
|
7
|
+
chainId: bigint;
|
|
8
|
+
verifyingContract: Uint8Array;
|
|
9
|
+
recipient: Uint8Array;
|
|
10
|
+
amount: bigint;
|
|
11
|
+
expirationDate: bigint;
|
|
12
|
+
nonce: bigint;
|
|
13
|
+
metadata: Uint8Array;
|
|
14
|
+
constructor(fields: {
|
|
15
|
+
version: Uint8Array;
|
|
16
|
+
chainId: bigint;
|
|
17
|
+
verifyingContract: Uint8Array;
|
|
18
|
+
recipient: Uint8Array;
|
|
19
|
+
amount: bigint;
|
|
20
|
+
expirationDate: bigint;
|
|
21
|
+
nonce: bigint;
|
|
22
|
+
metadata: Uint8Array;
|
|
23
|
+
});
|
|
24
|
+
}
|
|
25
|
+
export declare class SolanaSplPaymentRequest {
|
|
26
|
+
version: Uint8Array;
|
|
27
|
+
chainId: bigint;
|
|
28
|
+
verifyingContract: Uint8Array;
|
|
29
|
+
tokenAddress: Uint8Array;
|
|
30
|
+
recipient: Uint8Array;
|
|
31
|
+
amount: bigint;
|
|
32
|
+
expirationDate: bigint;
|
|
33
|
+
nonce: bigint;
|
|
34
|
+
metadata: Uint8Array;
|
|
35
|
+
constructor(fields: {
|
|
36
|
+
version: Uint8Array;
|
|
37
|
+
chainId: bigint;
|
|
38
|
+
verifyingContract: Uint8Array;
|
|
39
|
+
tokenAddress: Uint8Array;
|
|
40
|
+
recipient: Uint8Array;
|
|
41
|
+
amount: bigint;
|
|
42
|
+
expirationDate: bigint;
|
|
43
|
+
nonce: bigint;
|
|
44
|
+
metadata: Uint8Array;
|
|
45
|
+
});
|
|
46
|
+
}
|
|
47
|
+
export declare const SolanaNativePaymentSchema: Map<typeof SolanaNativePaymentRequest, {
|
|
48
|
+
kind: string;
|
|
49
|
+
fields: (string | (string | number)[])[][];
|
|
50
|
+
}>;
|
|
51
|
+
export declare const SolanaSplPaymentSchema: Map<typeof SolanaSplPaymentRequest, {
|
|
52
|
+
kind: string;
|
|
53
|
+
fields: (string | (string | number)[])[][];
|
|
54
|
+
}>;
|
|
55
|
+
export declare class SolanaPaymentInstruction {
|
|
56
|
+
recipient: Uint8Array;
|
|
57
|
+
amount: bigint;
|
|
58
|
+
expiration_date: bigint;
|
|
59
|
+
nonce: bigint;
|
|
60
|
+
metadata: Uint8Array;
|
|
61
|
+
signature: Uint8Array;
|
|
62
|
+
constructor(fields: {
|
|
63
|
+
recipient: Uint8Array;
|
|
64
|
+
amount: bigint;
|
|
65
|
+
expiration_date: bigint;
|
|
66
|
+
nonce: bigint;
|
|
67
|
+
metadata: Uint8Array;
|
|
68
|
+
signature: Uint8Array;
|
|
69
|
+
});
|
|
70
|
+
}
|
|
71
|
+
export declare const SolanaPaymentInstructionSchema: Schema;
|
|
72
|
+
/**
|
|
73
|
+
* @beta
|
|
74
|
+
* buildSolanaPayment creates an Solana-based payment request and signs it using ed25519.
|
|
75
|
+
* @param {Keypair} solSigner - Keypair for signing the payment request
|
|
76
|
+
* @param {MultiChainPaymentConfigOption} option - payment option configuration
|
|
77
|
+
* @param {string} chainId - EVM chain ID
|
|
78
|
+
* @param {string} paymentRails - payment rails contract address
|
|
79
|
+
* @param {string} recipient - recipient address
|
|
80
|
+
* @param {bigint} amount - payment amount in smallest units
|
|
81
|
+
* @param {Date} expirationDateRequired - expiration date
|
|
82
|
+
* @param {bigint} nonce - unique nonce for the payment
|
|
83
|
+
* @returns {Promise<Iden3PaymentRailsSolanaRequestV1 | Iden3PaymentRailsSolanaSPLRequestV1>} payment request object
|
|
84
|
+
*/
|
|
85
|
+
export declare const buildSolanaPayment: (solSigner: Keypair, option: MultiChainPaymentConfigOption, chainId: string, paymentRails: string, recipient: string, amount: bigint, expirationDate: Date, nonce: bigint) => Promise<Iden3PaymentRailsSolanaRequestV1 | Iden3PaymentRailsSolanaSPLRequestV1>;
|
|
86
|
+
export declare const serializeSolanaPaymentInstruction: (data: Iden3PaymentRailsSolanaRequestV1 | Iden3PaymentRailsSolanaSPLRequestV1) => Uint8Array;
|
|
87
|
+
export declare const verifyIden3SolanaPaymentRequest: (data: Iden3PaymentRailsSolanaRequestV1 | Iden3PaymentRailsSolanaSPLRequestV1, resolver: Resolvable) => Promise<boolean>;
|
|
88
|
+
//# sourceMappingURL=solana.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"solana.d.ts","sourceRoot":"","sources":["../../../../src/utils/payments/solana.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,MAAM,EAAa,MAAM,OAAO,CAAC;AAC1C,OAAO,EACL,gCAAgC,EAChC,mCAAmC,EAEnC,6BAA6B,EAC9B,MAAM,iBAAiB,CAAC;AASzB,OAAO,EAAE,OAAO,EAAa,MAAM,iBAAiB,CAAC;AACrD,OAAO,EAAE,UAAU,EAAE,MAAM,cAAc,CAAC;AAE1C,qBAAa,0BAA0B;IACrC,OAAO,EAAE,UAAU,CAAC;IACpB,OAAO,EAAE,MAAM,CAAC;IAChB,iBAAiB,EAAE,UAAU,CAAC;IAC9B,SAAS,EAAE,UAAU,CAAC;IACtB,MAAM,EAAE,MAAM,CAAC;IACf,cAAc,EAAE,MAAM,CAAC;IACvB,KAAK,EAAE,MAAM,CAAC;IACd,QAAQ,EAAE,UAAU,CAAC;gBAET,MAAM,EAAE;QAClB,OAAO,EAAE,UAAU,CAAC;QACpB,OAAO,EAAE,MAAM,CAAC;QAChB,iBAAiB,EAAE,UAAU,CAAC;QAC9B,SAAS,EAAE,UAAU,CAAC;QACtB,MAAM,EAAE,MAAM,CAAC;QACf,cAAc,EAAE,MAAM,CAAC;QACvB,KAAK,EAAE,MAAM,CAAC;QACd,QAAQ,EAAE,UAAU,CAAC;KACtB;CAUF;AAED,qBAAa,uBAAuB;IAClC,OAAO,EAAE,UAAU,CAAC;IACpB,OAAO,EAAE,MAAM,CAAC;IAChB,iBAAiB,EAAE,UAAU,CAAC;IAC9B,YAAY,EAAE,UAAU,CAAC;IACzB,SAAS,EAAE,UAAU,CAAC;IACtB,MAAM,EAAE,MAAM,CAAC;IACf,cAAc,EAAE,MAAM,CAAC;IACvB,KAAK,EAAE,MAAM,CAAC;IACd,QAAQ,EAAE,UAAU,CAAC;gBAET,MAAM,EAAE;QAClB,OAAO,EAAE,UAAU,CAAC;QACpB,OAAO,EAAE,MAAM,CAAC;QAChB,iBAAiB,EAAE,UAAU,CAAC;QAC9B,YAAY,EAAE,UAAU,CAAC;QACzB,SAAS,EAAE,UAAU,CAAC;QACtB,MAAM,EAAE,MAAM,CAAC;QACf,cAAc,EAAE,MAAM,CAAC;QACvB,KAAK,EAAE,MAAM,CAAC;QACd,QAAQ,EAAE,UAAU,CAAC;KACtB;CAWF;AAED,eAAO,MAAM,yBAAyB;;;EAiBpC,CAAC;AAEH,eAAO,MAAM,sBAAsB;;;EAkBjC,CAAC;AAEH,qBAAa,wBAAwB;IACnC,SAAS,EAAE,UAAU,CAAC;IACtB,MAAM,EAAE,MAAM,CAAC;IACf,eAAe,EAAE,MAAM,CAAC;IACxB,KAAK,EAAE,MAAM,CAAC;IACd,QAAQ,EAAE,UAAU,CAAC;IACrB,SAAS,EAAE,UAAU,CAAC;gBAEV,MAAM,EAAE;QAClB,SAAS,EAAE,UAAU,CAAC;QACtB,MAAM,EAAE,MAAM,CAAC;QACf,eAAe,EAAE,MAAM,CAAC;QACxB,KAAK,EAAE,MAAM,CAAC;QACd,QAAQ,EAAE,UAAU,CAAC;QACrB,SAAS,EAAE,UAAU,CAAC;KACvB;CAQF;AAED,eAAO,MAAM,8BAA8B,EAAE,MAe3C,CAAC;AAEH;;;;;;;;;;;;GAYG;AACH,eAAO,MAAM,kBAAkB,GAC7B,WAAW,OAAO,EAClB,QAAQ,6BAA6B,EACrC,SAAS,MAAM,EACf,cAAc,MAAM,EACpB,WAAW,MAAM,EACjB,QAAQ,MAAM,EACd,gBAAgB,IAAI,EACpB,OAAO,MAAM,KACZ,OAAO,CAAC,gCAAgC,GAAG,mCAAmC,CAsFhF,CAAC;AAEF,eAAO,MAAM,iCAAiC,GAC5C,MAAM,gCAAgC,GAAG,mCAAmC,KAC3E,UAkCF,CAAC;AACF,eAAO,MAAM,+BAA+B,GAC1C,MAAM,gCAAgC,GAAG,mCAAmC,EAC5E,UAAU,UAAU,KACnB,OAAO,CAAC,OAAO,CA6CjB,CAAC"}
|
|
@@ -0,0 +1,188 @@
|
|
|
1
|
+
/** Verifiable constants */
|
|
2
|
+
export declare const VerifiableConstants: Readonly<{
|
|
3
|
+
ERRORS: {
|
|
4
|
+
FiELD_IS_EMPTY: string;
|
|
5
|
+
CONTEXT_TYPE_IS_EMPTY: string;
|
|
6
|
+
IDENTITY_DOES_NOT_EXIST: string;
|
|
7
|
+
IDENTITY_DOES_NOT_EXIST_CUSTOM_ERROR: string;
|
|
8
|
+
NO_AUTH_CRED_FOUND: string;
|
|
9
|
+
STATE_DOES_NOT_EXIST: string;
|
|
10
|
+
STATE_DOES_NOT_EXIST_CUSTOM_ERROR: string;
|
|
11
|
+
ROOT_DOES_NOT_EXIST: string;
|
|
12
|
+
ROOT_DOES_NOT_EXIST_CUSTOM_ERROR: string;
|
|
13
|
+
ID_WALLET_NO_CREDENTIAL_SATISFIED_QUERY: string;
|
|
14
|
+
ID_WALLET_SIGNER_IS_REQUIRED: string;
|
|
15
|
+
ID_WALLET_PROVER_IS_REQUIRED: string;
|
|
16
|
+
ID_WALLET_CORE_CLAIM_REQUIRED_IN_SIG_PROOF: string;
|
|
17
|
+
ID_WALLET_CORE_CLAIM_REQUIRED_IN_ANY_PROOF: string;
|
|
18
|
+
ID_WALLET_CORE_CLAIM_MISMATCH: string;
|
|
19
|
+
ID_WALLET_CORE_CLAIM_IS_NOT_SET: string;
|
|
20
|
+
ID_WALLET_PROFILE_OR_IDENTITY_NOT_FOUND: string;
|
|
21
|
+
ID_WALLET_PROFILE_ALREADY_EXISTS: string;
|
|
22
|
+
ID_WALLET_PROFILE_ALREADY_EXISTS_VERIFIER_TAGS: string;
|
|
23
|
+
ID_WALLET_ISSUER_AUTH_BJJ_CRED_MUST_HAVE_ANY_PROOF: string;
|
|
24
|
+
ID_WALLET_ISSUER_AUTH_BJJ_CRED_MUST_HAVE_MTP_PROOF: string;
|
|
25
|
+
PROOF_SERVICE_NO_CREDENTIAL_FOR_IDENTITY_OR_PROFILE: string;
|
|
26
|
+
PROOF_SERVICE_NO_CREDENTIAL_FOR_QUERY: string;
|
|
27
|
+
PROOF_SERVICE_PROFILE_GENESIS_DID_MISMATCH: string;
|
|
28
|
+
PROOF_SERVICE_NO_QUERIES_IN_ZKP_REQUEST: string;
|
|
29
|
+
CREDENTIAL_WALLET_ALL_CREDENTIALS_ARE_REVOKED: string;
|
|
30
|
+
};
|
|
31
|
+
CREDENTIAL_TYPE: {
|
|
32
|
+
W3C_VERIFIABLE_CREDENTIAL: string;
|
|
33
|
+
W3C_VERIFIABLE_PRESENTATION: string;
|
|
34
|
+
};
|
|
35
|
+
CREDENTIAL_SUBJECT_PATH: "https://www.w3.org/2018/credentials#credentialSubject";
|
|
36
|
+
JSONLD_SCHEMA: {
|
|
37
|
+
IDEN3_CREDENTIAL: string;
|
|
38
|
+
IDEN3_DISPLAY_METHOD: string;
|
|
39
|
+
W3C_CREDENTIAL_2018: string;
|
|
40
|
+
W3C_VC_DOCUMENT_2018: string;
|
|
41
|
+
IDEN3_PROOFS_DEFINITION_DOCUMENT: string;
|
|
42
|
+
IDEN3_DISPLAY_METHOD_DEFINITION_DOCUMENT: string;
|
|
43
|
+
};
|
|
44
|
+
JSON_SCHEMA_VALIDATOR: "JsonSchema2023";
|
|
45
|
+
SERVICE_TYPE: {
|
|
46
|
+
IDEN3_COMM: string;
|
|
47
|
+
PUSH_NOTIFICATION: string;
|
|
48
|
+
};
|
|
49
|
+
AUTH: {
|
|
50
|
+
AUTH_BJJ_CREDENTIAL_HASH: string;
|
|
51
|
+
AUTH_BJJ_CREDENTIAL_SCHEMA_JSON_URL: string;
|
|
52
|
+
AUTH_BJJ_CREDENTIAL_SCHEMA_JSONLD_URL: string;
|
|
53
|
+
AUTH_BJJ_CREDENTIAL_TYPE: string;
|
|
54
|
+
AUTH_BJJ_CREDENTIAL_SCHEMA_JSON: string;
|
|
55
|
+
AUTH_BJJ_CREDENTIAL_SCHEMA_JSONLD: string;
|
|
56
|
+
};
|
|
57
|
+
}>;
|
|
58
|
+
/**
|
|
59
|
+
* Proof type for Verifiable Credential supported by sdk
|
|
60
|
+
*
|
|
61
|
+
* @enum {number}
|
|
62
|
+
*/
|
|
63
|
+
export declare enum ProofType {
|
|
64
|
+
BJJSignature = "BJJSignature2021",
|
|
65
|
+
Iden3SparseMerkleTreeProof = "Iden3SparseMerkleTreeProof"
|
|
66
|
+
}
|
|
67
|
+
/**
|
|
68
|
+
* CredentialStatusType type for revocation type
|
|
69
|
+
*
|
|
70
|
+
* @enum {number}
|
|
71
|
+
*/
|
|
72
|
+
export declare enum CredentialStatusType {
|
|
73
|
+
SparseMerkleTreeProof = "SparseMerkleTreeProof",
|
|
74
|
+
Iden3ReverseSparseMerkleTreeProof = "Iden3ReverseSparseMerkleTreeProof",
|
|
75
|
+
Iden3commRevocationStatusV1 = "Iden3commRevocationStatusV1.0",
|
|
76
|
+
Iden3OnchainSparseMerkleTreeProof2023 = "Iden3OnchainSparseMerkleTreeProof2023"
|
|
77
|
+
}
|
|
78
|
+
/**
|
|
79
|
+
* W3C Proof purpose
|
|
80
|
+
*
|
|
81
|
+
* @enum {number}
|
|
82
|
+
*/
|
|
83
|
+
export declare enum ProofPurpose {
|
|
84
|
+
Authentication = "Authentication"
|
|
85
|
+
}
|
|
86
|
+
/**
|
|
87
|
+
* Merklized Core.Claim root position for vc creation
|
|
88
|
+
*
|
|
89
|
+
* @enum {number}
|
|
90
|
+
*/
|
|
91
|
+
export declare enum MerklizedRootPosition {
|
|
92
|
+
Index = "index",
|
|
93
|
+
Value = "value",
|
|
94
|
+
None = ""
|
|
95
|
+
}
|
|
96
|
+
/**
|
|
97
|
+
* Subject Core.Claim position for vc creation
|
|
98
|
+
*
|
|
99
|
+
* @enum {number}
|
|
100
|
+
*/
|
|
101
|
+
export declare enum SubjectPosition {
|
|
102
|
+
None = "",
|
|
103
|
+
Index = "index",
|
|
104
|
+
Value = "value"
|
|
105
|
+
}
|
|
106
|
+
/**
|
|
107
|
+
* RefreshServiceType type for refreshService
|
|
108
|
+
*
|
|
109
|
+
* @enum {string}
|
|
110
|
+
*/
|
|
111
|
+
export declare enum RefreshServiceType {
|
|
112
|
+
Iden3RefreshService2023 = "Iden3RefreshService2023"
|
|
113
|
+
}
|
|
114
|
+
/**
|
|
115
|
+
* PaymentRequestDataType type for payment requests
|
|
116
|
+
* @beta
|
|
117
|
+
* @enum {string}
|
|
118
|
+
*/
|
|
119
|
+
export declare enum PaymentRequestDataType {
|
|
120
|
+
Iden3PaymentRequestCryptoV1 = "Iden3PaymentRequestCryptoV1",
|
|
121
|
+
Iden3PaymentRailsRequestV1 = "Iden3PaymentRailsRequestV1",
|
|
122
|
+
Iden3PaymentRailsERC20RequestV1 = "Iden3PaymentRailsERC20RequestV1",
|
|
123
|
+
Iden3PaymentRailsSolanaRequestV1 = "Iden3PaymentRailsSolanaRequestV1",
|
|
124
|
+
Iden3PaymentRailsSolanaSPLRequestV1 = "Iden3PaymentRailsSolanaSPLRequestV1"
|
|
125
|
+
}
|
|
126
|
+
/**
|
|
127
|
+
* PaymentType type for payment responses
|
|
128
|
+
* @beta
|
|
129
|
+
* @enum {string}
|
|
130
|
+
*/
|
|
131
|
+
export declare enum PaymentType {
|
|
132
|
+
Iden3PaymentCryptoV1 = "Iden3PaymentCryptoV1",
|
|
133
|
+
Iden3PaymentRailsV1 = "Iden3PaymentRailsV1",
|
|
134
|
+
Iden3PaymentRailsERC20V1 = "Iden3PaymentRailsERC20V1",
|
|
135
|
+
Iden3PaymentRailsSolanaV1 = "Iden3PaymentRailsSolanaV1",
|
|
136
|
+
Iden3PaymentRailsSolanaSPLV1 = "Iden3PaymentRailsSolanaSPLV1"
|
|
137
|
+
}
|
|
138
|
+
/**
|
|
139
|
+
* SupportedPaymentProofType type for payment proofs
|
|
140
|
+
* @beta
|
|
141
|
+
* @enum {string}
|
|
142
|
+
*/
|
|
143
|
+
export declare enum SupportedPaymentProofType {
|
|
144
|
+
EthereumEip712Signature2021 = "EthereumEip712Signature2021",
|
|
145
|
+
SolanaEd25519Signature2025 = "SolanaEd25519Signature2025"
|
|
146
|
+
}
|
|
147
|
+
/**
|
|
148
|
+
* Media types for Payment supported currencies
|
|
149
|
+
* @beta
|
|
150
|
+
* @deprecated
|
|
151
|
+
* @enum {string}
|
|
152
|
+
*/
|
|
153
|
+
export declare enum SupportedCurrencies {
|
|
154
|
+
ETH = "ETH",
|
|
155
|
+
ETH_WEI = "ETHWEI",
|
|
156
|
+
ETH_GWEI = "ETHGWEI",
|
|
157
|
+
MATIC = "MATIC",
|
|
158
|
+
POL = "POL"
|
|
159
|
+
}
|
|
160
|
+
/**
|
|
161
|
+
* Supported features for payment-request
|
|
162
|
+
* @beta
|
|
163
|
+
* @enum {string}
|
|
164
|
+
*/
|
|
165
|
+
export declare enum PaymentFeatures {
|
|
166
|
+
EIP_2612 = "EIP-2612"
|
|
167
|
+
}
|
|
168
|
+
/**
|
|
169
|
+
* DisplayMethodType type for display method
|
|
170
|
+
*
|
|
171
|
+
* @enum {string}
|
|
172
|
+
*/
|
|
173
|
+
export declare enum DisplayMethodType {
|
|
174
|
+
Iden3BasicDisplayMethodV1 = "Iden3BasicDisplayMethodV1"
|
|
175
|
+
}
|
|
176
|
+
/**
|
|
177
|
+
* Default cache max size for in-memory cache
|
|
178
|
+
*/
|
|
179
|
+
export declare const DEFAULT_CACHE_MAX_SIZE = 10000;
|
|
180
|
+
/**
|
|
181
|
+
* Solana chain reference
|
|
182
|
+
*/
|
|
183
|
+
export declare const SOLANA_CHAIN_REF: Readonly<{
|
|
184
|
+
DEVNET: "EtWTRABZaYq6iMfeYKouRu166VU2xqa1";
|
|
185
|
+
TESTNET: "4uhcVJyU9pJkvQyS88uRDiswHXSCkY3z";
|
|
186
|
+
MAINNET: "5eykt4UsFv8P8NJdTREpY1vzqKqZKvdp";
|
|
187
|
+
}>;
|
|
188
|
+
//# sourceMappingURL=constants.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"constants.d.ts","sourceRoot":"","sources":["../../../src/verifiable/constants.ts"],"names":[],"mappings":"AAAA,2BAA2B;AAC3B,eAAO,MAAM,mBAAmB;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;EAiF9B,CAAC;AAEH;;;;GAIG;AACH,oBAAY,SAAS;IAEnB,YAAY,qBAAqB;IAEjC,0BAA0B,+BAA+B;CAC1D;AAED;;;;GAIG;AACH,oBAAY,oBAAoB;IAE9B,qBAAqB,0BAA0B;IAE/C,iCAAiC,sCAAsC;IAEvE,2BAA2B,kCAAkC;IAE7D,qCAAqC,0CAA0C;CAChF;AAED;;;;GAIG;AACH,oBAAY,YAAY;IACtB,cAAc,mBAAmB;CAClC;AAED;;;;GAIG;AACH,oBAAY,qBAAqB;IAE/B,KAAK,UAAU;IAEf,KAAK,UAAU;IAEf,IAAI,KAAK;CACV;AAED;;;;GAIG;AACH,oBAAY,eAAe;IAEzB,IAAI,KAAK;IAET,KAAK,UAAU;IAEf,KAAK,UAAU;CAChB;AAED;;;;GAIG;AACH,oBAAY,kBAAkB;IAC5B,uBAAuB,4BAA4B;CACpD;AAED;;;;GAIG;AACH,oBAAY,sBAAsB;IAChC,2BAA2B,gCAAgC;IAC3D,0BAA0B,+BAA+B;IACzD,+BAA+B,oCAAoC;IACnE,gCAAgC,qCAAqC;IACrE,mCAAmC,wCAAwC;CAC5E;AAED;;;;GAIG;AACH,oBAAY,WAAW;IACrB,oBAAoB,yBAAyB;IAC7C,mBAAmB,wBAAwB;IAC3C,wBAAwB,6BAA6B;IACrD,yBAAyB,8BAA8B;IACvD,4BAA4B,iCAAiC;CAC9D;AAED;;;;GAIG;AACH,oBAAY,yBAAyB;IACnC,2BAA2B,gCAAgC;IAC3D,0BAA0B,+BAA+B;CAC1D;AAED;;;;;GAKG;AACH,oBAAY,mBAAmB;IAC7B,GAAG,QAAQ;IACX,OAAO,WAAW;IAClB,QAAQ,YAAY;IACpB,KAAK,UAAU;IACf,GAAG,QAAQ;CACZ;AAED;;;;GAIG;AACH,oBAAY,eAAe;IACzB,QAAQ,aAAa;CACtB;AAED;;;;GAIG;AACH,oBAAY,iBAAiB;IAC3B,yBAAyB,8BAA8B;CACxD;AAED;;GAEG;AACH,eAAO,MAAM,sBAAsB,QAAS,CAAC;AAE7C;;GAEG;AACH,eAAO,MAAM,gBAAgB;;;;EAI3B,CAAC"}
|
|
@@ -0,0 +1,87 @@
|
|
|
1
|
+
import { SchemaHash } from '@mocanetwork/moca-iden3';
|
|
2
|
+
import { Merklizer, Options } from '@iden3/js-jsonld-merklization';
|
|
3
|
+
type ParsedCtx = {
|
|
4
|
+
mappings: Map<string, Record<string, unknown>>;
|
|
5
|
+
};
|
|
6
|
+
/**
|
|
7
|
+
* CoreClaimCreationOptions is params for core claim creation
|
|
8
|
+
*
|
|
9
|
+
* @public
|
|
10
|
+
* @interface CoreClaimCreationOptions
|
|
11
|
+
*/
|
|
12
|
+
export interface CoreClaimCreationOptions {
|
|
13
|
+
revNonce: number;
|
|
14
|
+
version: number;
|
|
15
|
+
subjectPosition: string;
|
|
16
|
+
merklizedRootPosition: string;
|
|
17
|
+
updatable: boolean;
|
|
18
|
+
merklizeOpts?: Options;
|
|
19
|
+
}
|
|
20
|
+
/**
|
|
21
|
+
* Parsed slots of core.Claim
|
|
22
|
+
*
|
|
23
|
+
* @public
|
|
24
|
+
* @interface CoreClaimParsedSlots
|
|
25
|
+
*/
|
|
26
|
+
export interface CoreClaimParsedSlots {
|
|
27
|
+
indexA: Uint8Array;
|
|
28
|
+
indexB: Uint8Array;
|
|
29
|
+
valueA: Uint8Array;
|
|
30
|
+
valueB: Uint8Array;
|
|
31
|
+
}
|
|
32
|
+
/**
|
|
33
|
+
* Slots paths of core.Claim
|
|
34
|
+
*
|
|
35
|
+
* @public
|
|
36
|
+
* @interface CoreClaimSlotsPaths
|
|
37
|
+
*/
|
|
38
|
+
export interface CoreClaimSlotsPaths {
|
|
39
|
+
indexAPath: string;
|
|
40
|
+
indexBPath: string;
|
|
41
|
+
valueAPath: string;
|
|
42
|
+
valueBPath: string;
|
|
43
|
+
}
|
|
44
|
+
/**
|
|
45
|
+
* GetFieldSlotIndex return index of slot from 0 to 7 (each claim has by default 8 slots) for non-merklized claims
|
|
46
|
+
*
|
|
47
|
+
* @param {string} field - field name
|
|
48
|
+
* @param {Uint8Array} schemaBytes -json schema bytes
|
|
49
|
+
* @returns `number`
|
|
50
|
+
*/
|
|
51
|
+
export declare const getFieldSlotIndex: (field: string, typeName: string, schemaBytes: Uint8Array) => Promise<number>;
|
|
52
|
+
/**
|
|
53
|
+
* checks if data can fill the slot
|
|
54
|
+
*
|
|
55
|
+
* @param {Uint8Array} slotData - slot data
|
|
56
|
+
* @param {Merklizer} mz - merklizer
|
|
57
|
+
* @param {string} path - path
|
|
58
|
+
* @returns {void}
|
|
59
|
+
*/
|
|
60
|
+
export declare const fillCoreClaimSlot: (slotData: Uint8Array, mz: Merklizer, path: string) => Promise<void>;
|
|
61
|
+
export declare const getSerializationAttrFromContext: (context: object, opts: Options, tp: string) => Promise<string>;
|
|
62
|
+
export declare const getSerializationAttrFromParsedContext: (ldCtx: ParsedCtx, tp: string) => Promise<string>;
|
|
63
|
+
export declare const parseSerializationAttr: (serAttr: string) => CoreClaimSlotsPaths;
|
|
64
|
+
export declare const findCredentialType: (mz: Merklizer) => string;
|
|
65
|
+
/**
|
|
66
|
+
* parseCoreClaimSlots converts payload to claim slots using provided schema
|
|
67
|
+
*
|
|
68
|
+
* @param { { mappings: Map<string, Record<string, unknown>> } } ldCtx - ldCtx
|
|
69
|
+
* @param {Merklizer} mz - Merklizer
|
|
70
|
+
* @param {string} credentialType - credential type
|
|
71
|
+
* @returns `Promise<{ slots: ParsedSlots; nonMerklized: boolean }>`
|
|
72
|
+
*/
|
|
73
|
+
export declare const parseCoreClaimSlots: (ldCtx: {
|
|
74
|
+
mappings: Map<string, Record<string, unknown>>;
|
|
75
|
+
}, mz: Merklizer, credentialType: string) => Promise<{
|
|
76
|
+
slots: CoreClaimParsedSlots;
|
|
77
|
+
nonMerklized: boolean;
|
|
78
|
+
}>;
|
|
79
|
+
/**
|
|
80
|
+
* Calculates core schema hash
|
|
81
|
+
*
|
|
82
|
+
* @param {Uint8Array} schemaId
|
|
83
|
+
* @returns {*} {SchemaHash}
|
|
84
|
+
*/
|
|
85
|
+
export declare const calculateCoreSchemaHash: (schemaId: Uint8Array) => SchemaHash;
|
|
86
|
+
export {};
|
|
87
|
+
//# sourceMappingURL=core-utils.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"core-utils.d.ts","sourceRoot":"","sources":["../../../src/verifiable/core-utils.ts"],"names":[],"mappings":"AAAA,OAAO,EAAe,UAAU,EAAE,MAAM,yBAAyB,CAAC;AAClE,OAAO,EAAE,SAAS,EAAE,OAAO,EAAQ,MAAM,+BAA+B,CAAC;AAazE,KAAK,SAAS,GAAG;IAAE,QAAQ,EAAE,GAAG,CAAC,MAAM,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC,CAAA;CAAE,CAAC;AAEpE;;;;;GAKG;AACH,MAAM,WAAW,wBAAwB;IACvC,QAAQ,EAAE,MAAM,CAAC;IACjB,OAAO,EAAE,MAAM,CAAC;IAChB,eAAe,EAAE,MAAM,CAAC;IACxB,qBAAqB,EAAE,MAAM,CAAC;IAC9B,SAAS,EAAE,OAAO,CAAC;IACnB,YAAY,CAAC,EAAE,OAAO,CAAC;CACxB;AAED;;;;;GAKG;AACH,MAAM,WAAW,oBAAoB;IACnC,MAAM,EAAE,UAAU,CAAC;IACnB,MAAM,EAAE,UAAU,CAAC;IACnB,MAAM,EAAE,UAAU,CAAC;IACnB,MAAM,EAAE,UAAU,CAAC;CACpB;AAED;;;;;GAKG;AACH,MAAM,WAAW,mBAAmB;IAClC,UAAU,EAAE,MAAM,CAAC;IACnB,UAAU,EAAE,MAAM,CAAC;IACnB,UAAU,EAAE,MAAM,CAAC;IACnB,UAAU,EAAE,MAAM,CAAC;CACpB;AAED;;;;;;GAMG;AACH,eAAO,MAAM,iBAAiB,GAC5B,OAAO,MAAM,EACb,UAAU,MAAM,EAChB,aAAa,UAAU,KACtB,OAAO,CAAC,MAAM,CAoChB,CAAC;AAEF;;;;;;;GAOG;AACH,eAAO,MAAM,iBAAiB,GAC5B,UAAU,UAAU,EACpB,IAAI,SAAS,EACb,MAAM,MAAM,KACX,OAAO,CAAC,IAAI,CAqBd,CAAC;AAKF,eAAO,MAAM,+BAA+B,GAC1C,SAAS,MAAM,EACf,MAAM,OAAO,EACb,IAAI,MAAM,KACT,OAAO,CAAC,MAAM,CAQhB,CAAC;AAEF,eAAO,MAAM,qCAAqC,GAChD,OAAO,SAAS,EAChB,IAAI,MAAM,KACT,OAAO,CAAC,MAAM,CAoBhB,CAAC;AAEF,eAAO,MAAM,sBAAsB,GAAI,SAAS,MAAM,KAAG,mBAiCxD,CAAC;AAEF,eAAO,MAAM,kBAAkB,GAAI,IAAI,SAAS,KAAG,MAgClD,CAAC;AAEF;;;;;;;GAOG;AACH,eAAO,MAAM,mBAAmB,GAC9B,OAAO;IAAE,QAAQ,EAAE,GAAG,CAAC,MAAM,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC,CAAA;CAAE,EACzD,IAAI,SAAS,EACb,gBAAgB,MAAM,KACrB,OAAO,CAAC;IAAE,KAAK,EAAE,oBAAoB,CAAC;IAAC,YAAY,EAAE,OAAO,CAAA;CAAE,CA+BhE,CAAC;AAEF;;;;;GAKG;AACH,eAAO,MAAM,uBAAuB,GAAI,UAAU,UAAU,KAAG,UAG9D,CAAC"}
|