@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,231 @@
|
|
|
1
|
+
import { BasicMessage } from '../';
|
|
2
|
+
import {
|
|
3
|
+
PaymentFeatures,
|
|
4
|
+
PaymentRequestDataType,
|
|
5
|
+
SupportedCurrencies,
|
|
6
|
+
SupportedPaymentProofType
|
|
7
|
+
} from '../../../verifiable';
|
|
8
|
+
import { PROTOCOL_MESSAGE_TYPE } from '../../constants';
|
|
9
|
+
import { CredentialSchemaInfo } from './common';
|
|
10
|
+
|
|
11
|
+
/** @beta PaymentRequestMessage is struct the represents payment-request message */
|
|
12
|
+
export type PaymentRequestMessage = BasicMessage & {
|
|
13
|
+
body: PaymentRequestMessageBody;
|
|
14
|
+
from: string;
|
|
15
|
+
to: string;
|
|
16
|
+
type: typeof PROTOCOL_MESSAGE_TYPE.PAYMENT_REQUEST_MESSAGE_TYPE;
|
|
17
|
+
};
|
|
18
|
+
|
|
19
|
+
/** @beta PaymentRequestMessageBody is struct the represents body for payment-request */
|
|
20
|
+
export type PaymentRequestMessageBody = {
|
|
21
|
+
agent: string;
|
|
22
|
+
payments: PaymentRequestInfo[];
|
|
23
|
+
};
|
|
24
|
+
|
|
25
|
+
/** @beta PaymentRequestInfo is struct the represents payment info for payment-request */
|
|
26
|
+
export type PaymentRequestInfo = {
|
|
27
|
+
credentials: CredentialSchemaInfo[];
|
|
28
|
+
data:
|
|
29
|
+
| Iden3PaymentRequestCryptoV1
|
|
30
|
+
| (
|
|
31
|
+
| Iden3PaymentRequestCryptoV1
|
|
32
|
+
| Iden3PaymentRailsRequestV1
|
|
33
|
+
| Iden3PaymentRailsERC20RequestV1
|
|
34
|
+
| Iden3PaymentRailsSolanaRequestV1
|
|
35
|
+
| Iden3PaymentRailsSolanaSPLRequestV1
|
|
36
|
+
)[];
|
|
37
|
+
description?: string;
|
|
38
|
+
};
|
|
39
|
+
|
|
40
|
+
/** @beta Iden3PaymentRequestCryptoV1 is struct the represents payment data info for payment-request */
|
|
41
|
+
export type Iden3PaymentRequestCryptoV1 = {
|
|
42
|
+
type: PaymentRequestDataType.Iden3PaymentRequestCryptoV1;
|
|
43
|
+
'@context'?: string | (string | object)[];
|
|
44
|
+
amount: string;
|
|
45
|
+
id: string;
|
|
46
|
+
chainId: string;
|
|
47
|
+
address: string;
|
|
48
|
+
currency: SupportedCurrencies | string;
|
|
49
|
+
expiration?: string;
|
|
50
|
+
};
|
|
51
|
+
|
|
52
|
+
/** @beta Iden3PaymentRailsRequestV1 is struct the represents EVM native payment rails request */
|
|
53
|
+
export type Iden3PaymentRailsRequestV1 = {
|
|
54
|
+
type: PaymentRequestDataType.Iden3PaymentRailsRequestV1;
|
|
55
|
+
'@context': string | (string | object)[];
|
|
56
|
+
recipient: string;
|
|
57
|
+
amount: string;
|
|
58
|
+
expirationDate: string;
|
|
59
|
+
nonce: string;
|
|
60
|
+
metadata: string;
|
|
61
|
+
proof: EthereumEip712Signature2021 | EthereumEip712Signature2021[];
|
|
62
|
+
};
|
|
63
|
+
|
|
64
|
+
/** @beta Iden3PaymentRailsERC20RequestV1 is struct the represents EVM ERC 20 payment rails request */
|
|
65
|
+
export type Iden3PaymentRailsERC20RequestV1 = Omit<Required<Iden3PaymentRailsRequestV1>, 'type'> & {
|
|
66
|
+
tokenAddress: string;
|
|
67
|
+
features?: PaymentFeatures[];
|
|
68
|
+
type: PaymentRequestDataType.Iden3PaymentRailsERC20RequestV1;
|
|
69
|
+
};
|
|
70
|
+
|
|
71
|
+
/** @beta Iden3PaymentRailsSolanaRequestV1 is struct the represents Solana native payment rails request */
|
|
72
|
+
export type Iden3PaymentRailsSolanaRequestV1 = Omit<
|
|
73
|
+
Required<Iden3PaymentRailsRequestV1>,
|
|
74
|
+
'type' | 'proof'
|
|
75
|
+
> & {
|
|
76
|
+
type: PaymentRequestDataType.Iden3PaymentRailsSolanaRequestV1;
|
|
77
|
+
proof: Iden3SolanaEd25519SignatureV1 | Iden3SolanaEd25519SignatureV1[];
|
|
78
|
+
};
|
|
79
|
+
|
|
80
|
+
/** @beta Iden3PaymentRailsSolanaSPLRequestV1 is struct the represents Solana SPL payment rails request */
|
|
81
|
+
export type Iden3PaymentRailsSolanaSPLRequestV1 = Omit<
|
|
82
|
+
Required<Iden3PaymentRailsERC20RequestV1>,
|
|
83
|
+
'type' | 'proof'
|
|
84
|
+
> & {
|
|
85
|
+
type: PaymentRequestDataType.Iden3PaymentRailsSolanaSPLRequestV1;
|
|
86
|
+
proof: Iden3SolanaEd25519SignatureV1 | Iden3SolanaEd25519SignatureV1[];
|
|
87
|
+
};
|
|
88
|
+
|
|
89
|
+
/** @beta EthereumEip712Signature2021 is struct the represents EIP-712 signature for Ethereum */
|
|
90
|
+
export type EthereumEip712Signature2021 = {
|
|
91
|
+
type: SupportedPaymentProofType.EthereumEip712Signature2021;
|
|
92
|
+
proofPurpose: string;
|
|
93
|
+
proofValue: string;
|
|
94
|
+
verificationMethod: string;
|
|
95
|
+
created: string;
|
|
96
|
+
eip712: {
|
|
97
|
+
types: string;
|
|
98
|
+
primaryType: string;
|
|
99
|
+
domain: {
|
|
100
|
+
name: string;
|
|
101
|
+
version: string;
|
|
102
|
+
chainId: string;
|
|
103
|
+
verifyingContract: string;
|
|
104
|
+
};
|
|
105
|
+
};
|
|
106
|
+
};
|
|
107
|
+
|
|
108
|
+
/** @beta Iden3SolanaEd25519SignatureV1 is struct the represents Ed25519 signature for Solana Payment Instruction */
|
|
109
|
+
export type Iden3SolanaEd25519SignatureV1 = {
|
|
110
|
+
type: SupportedPaymentProofType.SolanaEd25519Signature2025;
|
|
111
|
+
proofPurpose: string;
|
|
112
|
+
proofValue: string;
|
|
113
|
+
created: string;
|
|
114
|
+
verificationMethod: string;
|
|
115
|
+
domain: {
|
|
116
|
+
version: 'SolanaEd25519NativeV1' | 'SolanaEd25519SPLV1';
|
|
117
|
+
chainId: string;
|
|
118
|
+
verifyingContract: string;
|
|
119
|
+
};
|
|
120
|
+
};
|
|
121
|
+
|
|
122
|
+
/** @beta PaymentMessage is struct the represents payment message */
|
|
123
|
+
export type PaymentMessage = BasicMessage & {
|
|
124
|
+
body: PaymentMessageBody;
|
|
125
|
+
from: string;
|
|
126
|
+
to: string;
|
|
127
|
+
type: typeof PROTOCOL_MESSAGE_TYPE.PAYMENT_MESSAGE_TYPE;
|
|
128
|
+
};
|
|
129
|
+
|
|
130
|
+
/** @beta PaymentMessageBody is struct the represents body for payment message */
|
|
131
|
+
export type PaymentMessageBody = {
|
|
132
|
+
payments: PaymentTypeUnion[];
|
|
133
|
+
};
|
|
134
|
+
|
|
135
|
+
/** @beta Iden3PaymentCryptoV1 is struct the represents payment info for payment */
|
|
136
|
+
export type Iden3PaymentCryptoV1 = {
|
|
137
|
+
id: string;
|
|
138
|
+
type: 'Iden3PaymentCryptoV1';
|
|
139
|
+
'@context'?: string | (string | object)[];
|
|
140
|
+
paymentData: {
|
|
141
|
+
txId: string;
|
|
142
|
+
};
|
|
143
|
+
};
|
|
144
|
+
|
|
145
|
+
/** @beta Iden3PaymentRailsV1 is struct the represents payment info for Iden3PaymentRailsRequestV1 */
|
|
146
|
+
export type Iden3PaymentRailsV1 = {
|
|
147
|
+
nonce: string;
|
|
148
|
+
type: 'Iden3PaymentRailsV1';
|
|
149
|
+
'@context': string | (string | object)[];
|
|
150
|
+
paymentData: {
|
|
151
|
+
txId: string;
|
|
152
|
+
chainId: string;
|
|
153
|
+
};
|
|
154
|
+
};
|
|
155
|
+
|
|
156
|
+
/** @beta Iden3PaymentRailsERC20V1 is struct the represents payment info for Iden3PaymentRailsERC20RequestV1 */
|
|
157
|
+
export type Iden3PaymentRailsERC20V1 = {
|
|
158
|
+
nonce: string;
|
|
159
|
+
type: 'Iden3PaymentRailsERC20V1';
|
|
160
|
+
'@context': string | (string | object)[];
|
|
161
|
+
paymentData: {
|
|
162
|
+
txId: string;
|
|
163
|
+
chainId: string;
|
|
164
|
+
tokenAddress: string;
|
|
165
|
+
};
|
|
166
|
+
};
|
|
167
|
+
|
|
168
|
+
/** @beta Iden3PaymentRailsSolanaV1 is struct the represents payment info for Iden3PaymentRailsSolanaV1 */
|
|
169
|
+
export type Iden3PaymentRailsSolanaV1 = {
|
|
170
|
+
nonce: string;
|
|
171
|
+
type: 'Iden3PaymentRailsSolanaV1';
|
|
172
|
+
'@context': string | (string | object)[];
|
|
173
|
+
paymentData: {
|
|
174
|
+
txId: string;
|
|
175
|
+
chainId: string;
|
|
176
|
+
};
|
|
177
|
+
};
|
|
178
|
+
|
|
179
|
+
/** @beta Iden3PaymentRailsSolanaSPLV1 is struct the represents payment info for Iden3PaymentRailsSolanaSPLV1 */
|
|
180
|
+
export type Iden3PaymentRailsSolanaSPLV1 = {
|
|
181
|
+
nonce: string;
|
|
182
|
+
type: 'Iden3PaymentRailsSolanaSPLV1';
|
|
183
|
+
'@context': string | (string | object)[];
|
|
184
|
+
paymentData: {
|
|
185
|
+
txId: string;
|
|
186
|
+
chainId: string;
|
|
187
|
+
tokenAddress: string;
|
|
188
|
+
};
|
|
189
|
+
};
|
|
190
|
+
|
|
191
|
+
/** @beta MultiChainPaymentConfig is struct that represents payments contracts information for different chains */
|
|
192
|
+
export type MultiChainPaymentConfig = {
|
|
193
|
+
chainId: string;
|
|
194
|
+
paymentRails: string;
|
|
195
|
+
recipient: string;
|
|
196
|
+
options: MultiChainPaymentConfigOption[];
|
|
197
|
+
};
|
|
198
|
+
|
|
199
|
+
/** @beta MultiChainPaymentConfigOption is struct that represents payment options for different chains */
|
|
200
|
+
export type MultiChainPaymentConfigOption = {
|
|
201
|
+
id: string;
|
|
202
|
+
type:
|
|
203
|
+
| PaymentRequestDataType.Iden3PaymentRailsRequestV1
|
|
204
|
+
| PaymentRequestDataType.Iden3PaymentRailsERC20RequestV1
|
|
205
|
+
| PaymentRequestDataType.Iden3PaymentRailsSolanaRequestV1
|
|
206
|
+
| PaymentRequestDataType.Iden3PaymentRailsSolanaSPLRequestV1;
|
|
207
|
+
contractAddress?: string;
|
|
208
|
+
features?: PaymentFeatures[];
|
|
209
|
+
};
|
|
210
|
+
|
|
211
|
+
/**
|
|
212
|
+
* @beta
|
|
213
|
+
* PaymentRequestTypeUnion is a type of supported payment request types
|
|
214
|
+
*/
|
|
215
|
+
export type PaymentRequestTypeUnion =
|
|
216
|
+
| Iden3PaymentRequestCryptoV1
|
|
217
|
+
| Iden3PaymentRailsRequestV1
|
|
218
|
+
| Iden3PaymentRailsERC20RequestV1
|
|
219
|
+
| Iden3PaymentRailsSolanaRequestV1
|
|
220
|
+
| Iden3PaymentRailsSolanaSPLRequestV1;
|
|
221
|
+
|
|
222
|
+
/**
|
|
223
|
+
* @beta
|
|
224
|
+
* PaymentTypeUnion is a type of supported payment types
|
|
225
|
+
*/
|
|
226
|
+
export type PaymentTypeUnion =
|
|
227
|
+
| Iden3PaymentCryptoV1
|
|
228
|
+
| Iden3PaymentRailsV1
|
|
229
|
+
| Iden3PaymentRailsERC20V1
|
|
230
|
+
| Iden3PaymentRailsSolanaV1
|
|
231
|
+
| Iden3PaymentRailsSolanaSPLV1;
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
import { PROTOCOL_MESSAGE_TYPE } from '../../constants';
|
|
2
|
+
import { BasicMessage } from '../packer';
|
|
3
|
+
|
|
4
|
+
/** ProblemReportMessage is struct for problem report message */
|
|
5
|
+
export type ProblemReportMessage = BasicMessage & {
|
|
6
|
+
body: ProblemReportMessageBody;
|
|
7
|
+
pthid: string;
|
|
8
|
+
ack?: string[];
|
|
9
|
+
type: typeof PROTOCOL_MESSAGE_TYPE.PROBLEM_REPORT_MESSAGE_TYPE;
|
|
10
|
+
};
|
|
11
|
+
|
|
12
|
+
/** ProblemReportMessageBody is struct for problem report message body */
|
|
13
|
+
export type ProblemReportMessageBody = {
|
|
14
|
+
code: string;
|
|
15
|
+
comment?: string;
|
|
16
|
+
args?: string[];
|
|
17
|
+
escalate_to?: string;
|
|
18
|
+
};
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
import { RequiredBasicMessage } from '../';
|
|
2
|
+
import { PROTOCOL_MESSAGE_TYPE } from '../../constants';
|
|
3
|
+
import { ZeroKnowledgeProofRequest, ZeroKnowledgeProofResponse } from './auth';
|
|
4
|
+
|
|
5
|
+
/** ProofGenerationRequestMessage is struct the represents body for proof generation request */
|
|
6
|
+
export type ProofGenerationRequestMessage = RequiredBasicMessage & {
|
|
7
|
+
body: ProofGenerationRequestMessageBody;
|
|
8
|
+
type: typeof PROTOCOL_MESSAGE_TYPE.PROOF_GENERATION_REQUEST_MESSAGE_TYPE;
|
|
9
|
+
};
|
|
10
|
+
|
|
11
|
+
/** ProofGenerationRequestMessageBody is struct the represents body for proof generation request */
|
|
12
|
+
export type ProofGenerationRequestMessageBody = {
|
|
13
|
+
scope: Array<ZeroKnowledgeProofRequest>;
|
|
14
|
+
};
|
|
15
|
+
|
|
16
|
+
/** ProofGenerationResponseMessage is struct the represents body for proof generation request */
|
|
17
|
+
export type ProofGenerationResponseMessage = RequiredBasicMessage & {
|
|
18
|
+
body: ResponseMessageBody;
|
|
19
|
+
type: typeof PROTOCOL_MESSAGE_TYPE.PROOF_GENERATION_RESPONSE_MESSAGE_TYPE;
|
|
20
|
+
};
|
|
21
|
+
|
|
22
|
+
/** ResponseMessageBody is struct the represents request for revocation status */
|
|
23
|
+
export type ResponseMessageBody = {
|
|
24
|
+
scope: Array<ZeroKnowledgeProofResponse>;
|
|
25
|
+
};
|
|
@@ -0,0 +1,38 @@
|
|
|
1
|
+
import { BasicMessage, DIDDocument } from '../';
|
|
2
|
+
import { PROTOCOL_MESSAGE_TYPE } from '../../constants';
|
|
3
|
+
import { CredentialSchemaInfo } from './common';
|
|
4
|
+
|
|
5
|
+
/** @beta ProposalRequestMessage is struct the represents proposal-request message */
|
|
6
|
+
export type ProposalRequestMessage = BasicMessage & {
|
|
7
|
+
body: ProposalRequestMessageBody;
|
|
8
|
+
type: typeof PROTOCOL_MESSAGE_TYPE.PROPOSAL_REQUEST_MESSAGE_TYPE;
|
|
9
|
+
};
|
|
10
|
+
|
|
11
|
+
/** @beta ProposalRequestCredential is struct the represents proposal request credential */
|
|
12
|
+
export type ProposalRequestCredential = CredentialSchemaInfo;
|
|
13
|
+
|
|
14
|
+
/** @beta ProposalRequestMessageBody is struct the represents body for proposal-request */
|
|
15
|
+
export type ProposalRequestMessageBody = {
|
|
16
|
+
credentials: ProposalRequestCredential[];
|
|
17
|
+
did_doc?: DIDDocument;
|
|
18
|
+
};
|
|
19
|
+
|
|
20
|
+
/** @beta ProposalMessage is struct the represents proposal message */
|
|
21
|
+
export type ProposalMessage = BasicMessage & {
|
|
22
|
+
body: ProposalMessageBody;
|
|
23
|
+
type: typeof PROTOCOL_MESSAGE_TYPE.PROPOSAL_MESSAGE_TYPE;
|
|
24
|
+
};
|
|
25
|
+
|
|
26
|
+
/** @beta ProposalMessageBody is struct the represents body for proposal message */
|
|
27
|
+
export type ProposalMessageBody = {
|
|
28
|
+
proposals: Proposal[];
|
|
29
|
+
};
|
|
30
|
+
|
|
31
|
+
/** @beta Proposal is struct the represents proposal inside proposal protocol message */
|
|
32
|
+
export type Proposal = {
|
|
33
|
+
credentials: ProposalRequestCredential[];
|
|
34
|
+
type: string;
|
|
35
|
+
url?: string;
|
|
36
|
+
expiration?: string;
|
|
37
|
+
description?: string;
|
|
38
|
+
};
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
import { BasicMessage, RequiredBasicMessage } from '../';
|
|
2
|
+
import { RevocationStatus } from '../../../verifiable';
|
|
3
|
+
import { PROTOCOL_MESSAGE_TYPE } from '../../constants';
|
|
4
|
+
|
|
5
|
+
/** RevocationStatusRequestMessage is struct the represents body for proof generation request */
|
|
6
|
+
export type RevocationStatusRequestMessage = BasicMessage & {
|
|
7
|
+
body: RevocationStatusRequestMessageBody;
|
|
8
|
+
type: typeof PROTOCOL_MESSAGE_TYPE.REVOCATION_STATUS_REQUEST_MESSAGE_TYPE;
|
|
9
|
+
};
|
|
10
|
+
|
|
11
|
+
/** RevocationStatusRequestMessageBody is struct the represents request for revocation status */
|
|
12
|
+
export type RevocationStatusRequestMessageBody = {
|
|
13
|
+
revocation_nonce: number;
|
|
14
|
+
};
|
|
15
|
+
|
|
16
|
+
/** RevocationStatusResponseMessage is struct the represents body for proof generation request */
|
|
17
|
+
export type RevocationStatusResponseMessage = RequiredBasicMessage & {
|
|
18
|
+
body: RevocationStatusResponseMessageBody;
|
|
19
|
+
type: typeof PROTOCOL_MESSAGE_TYPE.REVOCATION_STATUS_RESPONSE_MESSAGE_TYPE;
|
|
20
|
+
};
|
|
21
|
+
|
|
22
|
+
/** RevocationStatusResponseMessageBody is struct the represents request for revocation status */
|
|
23
|
+
export type RevocationStatusResponseMessageBody = RevocationStatus;
|
|
@@ -0,0 +1,121 @@
|
|
|
1
|
+
import {
|
|
2
|
+
MediaType,
|
|
3
|
+
ProtocolVersion,
|
|
4
|
+
AcceptAuthCircuits,
|
|
5
|
+
AcceptJwzAlgorithms,
|
|
6
|
+
AcceptJwsAlgorithms
|
|
7
|
+
} from '../constants';
|
|
8
|
+
import { AcceptProfile } from '../types';
|
|
9
|
+
|
|
10
|
+
function isProtocolVersion(value: string): boolean {
|
|
11
|
+
return Object.values(ProtocolVersion).includes(value as ProtocolVersion);
|
|
12
|
+
}
|
|
13
|
+
|
|
14
|
+
function isMediaType(value: string): boolean {
|
|
15
|
+
return Object.values(MediaType).includes(value as MediaType);
|
|
16
|
+
}
|
|
17
|
+
|
|
18
|
+
function isAcceptAuthCircuits(value: string): boolean {
|
|
19
|
+
return Object.values(AcceptAuthCircuits).includes(value as AcceptAuthCircuits);
|
|
20
|
+
}
|
|
21
|
+
|
|
22
|
+
function isAcceptJwsAlgorithms(value: string): boolean {
|
|
23
|
+
return Object.values(AcceptJwsAlgorithms).includes(value as AcceptJwsAlgorithms);
|
|
24
|
+
}
|
|
25
|
+
|
|
26
|
+
function isAcceptJwzAlgorithms(value: string): boolean {
|
|
27
|
+
return Object.values(AcceptJwzAlgorithms).includes(value as AcceptJwzAlgorithms);
|
|
28
|
+
}
|
|
29
|
+
|
|
30
|
+
export const buildAccept = (profiles: AcceptProfile[]): string[] => {
|
|
31
|
+
const result = [];
|
|
32
|
+
for (const profile of profiles) {
|
|
33
|
+
let accept = `${profile.protocolVersion};env=${profile.env}`;
|
|
34
|
+
if (profile.circuits?.length) {
|
|
35
|
+
accept += `;circuitId=${profile.circuits.join(',')}`;
|
|
36
|
+
}
|
|
37
|
+
if (profile.alg?.length) {
|
|
38
|
+
accept += `;alg=${profile.alg.join(',')}`;
|
|
39
|
+
}
|
|
40
|
+
result.push(accept);
|
|
41
|
+
}
|
|
42
|
+
|
|
43
|
+
return result;
|
|
44
|
+
};
|
|
45
|
+
|
|
46
|
+
export const parseAcceptProfile = (profile: string): AcceptProfile => {
|
|
47
|
+
const params = profile.split(';');
|
|
48
|
+
|
|
49
|
+
if (params.length < 2) {
|
|
50
|
+
throw new Error('Invalid accept profile');
|
|
51
|
+
}
|
|
52
|
+
const protocolVersion = params[0].trim() as ProtocolVersion;
|
|
53
|
+
if (!isProtocolVersion(protocolVersion)) {
|
|
54
|
+
throw new Error(`Protocol version '${protocolVersion}' not supported`);
|
|
55
|
+
}
|
|
56
|
+
|
|
57
|
+
const envParam = params[1].split('=');
|
|
58
|
+
if (envParam.length !== 2) {
|
|
59
|
+
throw new Error(`Invalid accept profile 'env' parameter`);
|
|
60
|
+
}
|
|
61
|
+
const env = params[1].split('=')[1].trim() as MediaType;
|
|
62
|
+
if (!isMediaType(env)) {
|
|
63
|
+
throw new Error(`Envelop '${env}' not supported`);
|
|
64
|
+
}
|
|
65
|
+
|
|
66
|
+
const circuitsIndex = params.findIndex((i: string) => i.includes('circuitId='));
|
|
67
|
+
if (env !== MediaType.ZKPMessage && circuitsIndex > 0) {
|
|
68
|
+
throw new Error(`Circuits not supported for env '${env}'`);
|
|
69
|
+
}
|
|
70
|
+
|
|
71
|
+
let circuits: AcceptAuthCircuits[] | undefined = undefined;
|
|
72
|
+
if (circuitsIndex > 0) {
|
|
73
|
+
circuits = params[circuitsIndex]
|
|
74
|
+
.split('=')[1]
|
|
75
|
+
.split(',')
|
|
76
|
+
.map((i) => i.trim())
|
|
77
|
+
.map((i) => {
|
|
78
|
+
if (!isAcceptAuthCircuits(i)) {
|
|
79
|
+
throw new Error(`Circuit '${i}' not supported`);
|
|
80
|
+
}
|
|
81
|
+
return i as AcceptAuthCircuits;
|
|
82
|
+
});
|
|
83
|
+
}
|
|
84
|
+
|
|
85
|
+
const algIndex = params.findIndex((i: string) => i.includes('alg='));
|
|
86
|
+
let alg: AcceptJwsAlgorithms[] | AcceptJwzAlgorithms[] | undefined = undefined;
|
|
87
|
+
if (algIndex > 0) {
|
|
88
|
+
if (env === MediaType.ZKPMessage) {
|
|
89
|
+
alg = params[algIndex]
|
|
90
|
+
.split('=')[1]
|
|
91
|
+
.split(',')
|
|
92
|
+
.map((i) => {
|
|
93
|
+
i = i.trim();
|
|
94
|
+
if (!isAcceptJwzAlgorithms(i)) {
|
|
95
|
+
throw new Error(`Algorithm '${i}' not supported for '${env}'`);
|
|
96
|
+
}
|
|
97
|
+
return i as AcceptJwzAlgorithms;
|
|
98
|
+
});
|
|
99
|
+
} else if (env === MediaType.SignedMessage) {
|
|
100
|
+
alg = params[algIndex]
|
|
101
|
+
.split('=')[1]
|
|
102
|
+
.split(',')
|
|
103
|
+
.map((i) => {
|
|
104
|
+
i = i.trim();
|
|
105
|
+
if (!isAcceptJwsAlgorithms(i)) {
|
|
106
|
+
throw new Error(`Algorithm '${i}' not supported for '${env}'`);
|
|
107
|
+
}
|
|
108
|
+
return i as AcceptJwsAlgorithms;
|
|
109
|
+
});
|
|
110
|
+
} else {
|
|
111
|
+
throw new Error(`Algorithm not supported for '${env}'`);
|
|
112
|
+
}
|
|
113
|
+
}
|
|
114
|
+
|
|
115
|
+
return {
|
|
116
|
+
protocolVersion,
|
|
117
|
+
env,
|
|
118
|
+
circuits,
|
|
119
|
+
alg
|
|
120
|
+
};
|
|
121
|
+
};
|
|
@@ -0,0 +1,71 @@
|
|
|
1
|
+
import { SUPPORTED_PUBLIC_KEY_TYPES } from '../constants';
|
|
2
|
+
import { DIDDocument, VerificationMethod } from 'did-resolver';
|
|
3
|
+
import { secp256k1 as sec } from '@noble/curves/secp256k1';
|
|
4
|
+
|
|
5
|
+
import { KmsKeyType } from '../../kms';
|
|
6
|
+
import { base58ToBytes, base64UrlToBytes, bytesToHex, hexToBytes } from '../../utils';
|
|
7
|
+
|
|
8
|
+
const DIDAuthenticationSection = 'authentication';
|
|
9
|
+
export const resolveVerificationMethods = (didDocument: DIDDocument): VerificationMethod[] => {
|
|
10
|
+
const vms: VerificationMethod[] = didDocument.verificationMethod || [];
|
|
11
|
+
|
|
12
|
+
// prioritize: first verification methods to be chosen are from `authentication` section.
|
|
13
|
+
const sortedVerificationMethods = (didDocument[DIDAuthenticationSection] || [])
|
|
14
|
+
.map((verificationMethod) => {
|
|
15
|
+
if (typeof verificationMethod === 'string') {
|
|
16
|
+
return vms.find((i) => i.id === verificationMethod);
|
|
17
|
+
}
|
|
18
|
+
return verificationMethod as VerificationMethod;
|
|
19
|
+
})
|
|
20
|
+
.filter((key) => key) as VerificationMethod[];
|
|
21
|
+
|
|
22
|
+
// add all other verification methods
|
|
23
|
+
for (let index = 0; index < vms.length; index++) {
|
|
24
|
+
const id = vms[index].id;
|
|
25
|
+
if (sortedVerificationMethods.findIndex((vm) => vm.id === id) === -1) {
|
|
26
|
+
sortedVerificationMethods.push(vms[index]);
|
|
27
|
+
}
|
|
28
|
+
}
|
|
29
|
+
return sortedVerificationMethods;
|
|
30
|
+
};
|
|
31
|
+
|
|
32
|
+
export const extractPublicKeyBytes = (
|
|
33
|
+
vm: VerificationMethod
|
|
34
|
+
): { publicKeyBytes: Uint8Array | null; kmsKeyType?: KmsKeyType } => {
|
|
35
|
+
const isSupportedVmType = Object.keys(SUPPORTED_PUBLIC_KEY_TYPES).some((key) =>
|
|
36
|
+
SUPPORTED_PUBLIC_KEY_TYPES[key as keyof typeof SUPPORTED_PUBLIC_KEY_TYPES].includes(vm.type)
|
|
37
|
+
);
|
|
38
|
+
if (vm.publicKeyBase58 && isSupportedVmType) {
|
|
39
|
+
return { publicKeyBytes: base58ToBytes(vm.publicKeyBase58), kmsKeyType: KmsKeyType.Secp256k1 };
|
|
40
|
+
}
|
|
41
|
+
if (vm.publicKeyBase64 && isSupportedVmType) {
|
|
42
|
+
return {
|
|
43
|
+
publicKeyBytes: base64UrlToBytes(vm.publicKeyBase64),
|
|
44
|
+
kmsKeyType: KmsKeyType.Secp256k1
|
|
45
|
+
};
|
|
46
|
+
}
|
|
47
|
+
if (vm.publicKeyHex && isSupportedVmType) {
|
|
48
|
+
return { publicKeyBytes: hexToBytes(vm.publicKeyHex), kmsKeyType: KmsKeyType.Secp256k1 };
|
|
49
|
+
}
|
|
50
|
+
if (
|
|
51
|
+
vm.publicKeyJwk &&
|
|
52
|
+
vm.publicKeyJwk.crv === 'secp256k1' &&
|
|
53
|
+
vm.publicKeyJwk.x &&
|
|
54
|
+
vm.publicKeyJwk.y
|
|
55
|
+
) {
|
|
56
|
+
const [xHex, yHex] = [
|
|
57
|
+
base64UrlToBytes(vm.publicKeyJwk.x),
|
|
58
|
+
base64UrlToBytes(vm.publicKeyJwk.y)
|
|
59
|
+
].map(bytesToHex);
|
|
60
|
+
const x = xHex.includes('0x') ? BigInt(xHex) : BigInt(`0x${xHex}`);
|
|
61
|
+
const y = yHex.includes('0x') ? BigInt(yHex) : BigInt(`0x${yHex}`);
|
|
62
|
+
return {
|
|
63
|
+
publicKeyBytes: sec.ProjectivePoint.fromAffine({
|
|
64
|
+
x,
|
|
65
|
+
y
|
|
66
|
+
}).toRawBytes(false),
|
|
67
|
+
kmsKeyType: KmsKeyType.Secp256k1
|
|
68
|
+
};
|
|
69
|
+
}
|
|
70
|
+
return { publicKeyBytes: null };
|
|
71
|
+
};
|
|
@@ -0,0 +1,101 @@
|
|
|
1
|
+
import { BasicMessage, EnvelopeStub, HeaderStub } from '../types';
|
|
2
|
+
import { basicMessageFactory, envelopeStubFactory, headerStubFactory } from './message';
|
|
3
|
+
import { ErrNotEnvelopeStub, ErrNotHeaderStub, ErrNotProtocolMessage } from '../errors';
|
|
4
|
+
import { Token } from '@iden3/js-jwz';
|
|
5
|
+
import { byteDecoder, byteEncoder } from '../../utils';
|
|
6
|
+
|
|
7
|
+
const objectIs = (
|
|
8
|
+
obj: { [key in string]: any }, //eslint-disable-line @typescript-eslint/no-explicit-any
|
|
9
|
+
targetObj: { [key in string]: any } //eslint-disable-line @typescript-eslint/no-explicit-any
|
|
10
|
+
): boolean => {
|
|
11
|
+
Object.keys(targetObj).forEach((prop) => {
|
|
12
|
+
if (!obj[prop]) {
|
|
13
|
+
return false;
|
|
14
|
+
}
|
|
15
|
+
if (typeof targetObj[prop as keyof typeof targetObj] !== typeof obj[prop as keyof typeof obj]) {
|
|
16
|
+
return false;
|
|
17
|
+
}
|
|
18
|
+
});
|
|
19
|
+
return true;
|
|
20
|
+
};
|
|
21
|
+
|
|
22
|
+
//eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
23
|
+
const isProtocolMessage = (message: { [key in string]: any }): boolean => {
|
|
24
|
+
const basicMessage = basicMessageFactory();
|
|
25
|
+
Object.keys(basicMessage).forEach((prop) => {
|
|
26
|
+
if (!message[prop]) {
|
|
27
|
+
return false;
|
|
28
|
+
}
|
|
29
|
+
if (prop !== 'body') {
|
|
30
|
+
const res =
|
|
31
|
+
typeof basicMessage[prop as keyof typeof basicMessage] ===
|
|
32
|
+
typeof (message[prop as keyof typeof message] as any); //eslint-disable-line @typescript-eslint/no-explicit-any
|
|
33
|
+
if (!res) {
|
|
34
|
+
return false;
|
|
35
|
+
}
|
|
36
|
+
}
|
|
37
|
+
});
|
|
38
|
+
|
|
39
|
+
return true;
|
|
40
|
+
};
|
|
41
|
+
|
|
42
|
+
/**
|
|
43
|
+
*
|
|
44
|
+
* @param {Uint8Array} e
|
|
45
|
+
* @returns Promise<BasicMessage>
|
|
46
|
+
*/
|
|
47
|
+
export const envelopeToProtocolMessage = async (e: Uint8Array): Promise<BasicMessage> => {
|
|
48
|
+
const t = await Token.parse(byteDecoder.decode(e));
|
|
49
|
+
const pBytes = byteEncoder.encode(t.getPayload());
|
|
50
|
+
return bytesToProtocolMessage(pBytes);
|
|
51
|
+
};
|
|
52
|
+
|
|
53
|
+
/**
|
|
54
|
+
* helper function to convert serialized JSON bytes to protocol message
|
|
55
|
+
*
|
|
56
|
+
* @param {Uint8Array} bytes
|
|
57
|
+
* @returns {BasicMessage}
|
|
58
|
+
*/
|
|
59
|
+
export const bytesToProtocolMessage = (bytes: Uint8Array): BasicMessage => {
|
|
60
|
+
const str = byteDecoder.decode(bytes);
|
|
61
|
+
const message = JSON.parse(str);
|
|
62
|
+
if (!isProtocolMessage(message)) {
|
|
63
|
+
throw new Error(ErrNotProtocolMessage);
|
|
64
|
+
}
|
|
65
|
+
return message as BasicMessage;
|
|
66
|
+
};
|
|
67
|
+
|
|
68
|
+
/**
|
|
69
|
+
* helper function to convert serialized JSON bytes to envelop stub
|
|
70
|
+
* so we can work with protected field of jwt token
|
|
71
|
+
*
|
|
72
|
+
*
|
|
73
|
+
* @param {Uint8Array} envelope
|
|
74
|
+
* @returns {EnvelopeStub}
|
|
75
|
+
*/
|
|
76
|
+
export const bytesToEnvelopeStub = (envelope: Uint8Array): EnvelopeStub => {
|
|
77
|
+
const tmpObj = envelopeStubFactory();
|
|
78
|
+
const str = byteDecoder.decode(envelope);
|
|
79
|
+
const message = JSON.parse(str);
|
|
80
|
+
if (!objectIs(message, tmpObj)) {
|
|
81
|
+
throw new Error(ErrNotEnvelopeStub);
|
|
82
|
+
}
|
|
83
|
+
return message as EnvelopeStub;
|
|
84
|
+
};
|
|
85
|
+
|
|
86
|
+
/**
|
|
87
|
+
* helper function to convert serialized JSON bytes to header stub
|
|
88
|
+
* so we can work with know the media type of the message
|
|
89
|
+
*
|
|
90
|
+
* @param {Uint8Array} envelope
|
|
91
|
+
* @returns {HeaderStub}
|
|
92
|
+
*/
|
|
93
|
+
export const bytesToHeaderStub = (envelope: Uint8Array): HeaderStub => {
|
|
94
|
+
const tmpObj = headerStubFactory();
|
|
95
|
+
const str = byteDecoder.decode(envelope);
|
|
96
|
+
const message = JSON.parse(str);
|
|
97
|
+
if (!objectIs(message, tmpObj)) {
|
|
98
|
+
throw new Error(ErrNotHeaderStub);
|
|
99
|
+
}
|
|
100
|
+
return message as HeaderStub;
|
|
101
|
+
};
|
|
@@ -0,0 +1,41 @@
|
|
|
1
|
+
import { MediaType } from '../constants';
|
|
2
|
+
import { BasicMessage, EnvelopeStub, HeaderStub, ProtocolMessage } from '../types';
|
|
3
|
+
|
|
4
|
+
/**
|
|
5
|
+
* creates empty basic message
|
|
6
|
+
*
|
|
7
|
+
* @returns BasicMessage
|
|
8
|
+
*/
|
|
9
|
+
export const basicMessageFactory = (): BasicMessage => {
|
|
10
|
+
return {
|
|
11
|
+
id: '',
|
|
12
|
+
typ: '' as MediaType,
|
|
13
|
+
thid: '',
|
|
14
|
+
type: '' as ProtocolMessage,
|
|
15
|
+
body: {},
|
|
16
|
+
from: '',
|
|
17
|
+
to: ''
|
|
18
|
+
};
|
|
19
|
+
};
|
|
20
|
+
|
|
21
|
+
/**
|
|
22
|
+
* create empty envelope stub
|
|
23
|
+
*
|
|
24
|
+
* @returns EnvelopeStub
|
|
25
|
+
*/
|
|
26
|
+
export const envelopeStubFactory = (): EnvelopeStub => {
|
|
27
|
+
return {
|
|
28
|
+
protected: ''
|
|
29
|
+
};
|
|
30
|
+
};
|
|
31
|
+
|
|
32
|
+
/**
|
|
33
|
+
* create empty header stub
|
|
34
|
+
*
|
|
35
|
+
* @returns {HeaderStub}
|
|
36
|
+
*/
|
|
37
|
+
export const headerStubFactory = (): HeaderStub => {
|
|
38
|
+
return {
|
|
39
|
+
typ: '' as MediaType
|
|
40
|
+
};
|
|
41
|
+
};
|