@decaf-ts/for-fabric 0.9.0 → 0.10.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/lib/cjs/bin/cli.cjs +3 -2
- package/lib/cjs/bin/cli.cjs.map +1 -0
- package/lib/cjs/cli-module.cjs +26 -25
- package/lib/cjs/cli-module.cjs.map +1 -0
- package/lib/cjs/cli-utils.cjs +5 -5
- package/lib/cjs/cli-utils.cjs.map +1 -0
- package/lib/cjs/client/FabricClientAdapter.cjs +46 -40
- package/lib/cjs/client/FabricClientAdapter.cjs.map +1 -0
- package/lib/cjs/client/FabricClientDispatch.cjs +8 -7
- package/lib/cjs/client/FabricClientDispatch.cjs.map +1 -0
- package/lib/cjs/client/FabricClientPaginator.cjs +1 -0
- package/lib/cjs/client/FabricClientPaginator.cjs.map +1 -0
- package/lib/cjs/client/FabricClientRepository.cjs +4 -3
- package/lib/cjs/client/FabricClientRepository.cjs.map +1 -0
- package/lib/cjs/client/FabricClientStatement.cjs +1 -0
- package/lib/cjs/client/FabricClientStatement.cjs.map +1 -0
- package/lib/cjs/client/collections/generation.cjs +3 -2
- package/lib/cjs/client/collections/generation.cjs.map +1 -0
- package/lib/cjs/client/collections/index.cjs +1 -0
- package/lib/cjs/client/collections/index.cjs.map +1 -0
- package/lib/cjs/client/constants.cjs +1 -0
- package/lib/cjs/client/constants.cjs.map +1 -0
- package/lib/cjs/client/crypto.cjs +12 -13
- package/lib/cjs/client/crypto.cjs.map +1 -0
- package/lib/cjs/client/erc20/FabricERC20ClientRepository.cjs +7 -6
- package/lib/cjs/client/erc20/FabricERC20ClientRepository.cjs.map +1 -0
- package/lib/cjs/client/erc20/index.cjs +1 -0
- package/lib/cjs/client/erc20/index.cjs.map +1 -0
- package/lib/cjs/client/fabric-fs.cjs +1 -0
- package/lib/cjs/client/fabric-fs.cjs.map +1 -0
- package/lib/cjs/client/fabric-hsm.cjs +3 -2
- package/lib/cjs/client/fabric-hsm.cjs.map +1 -0
- package/lib/cjs/client/ids/id-extraction.cjs +1 -0
- package/lib/cjs/client/ids/id-extraction.cjs.map +1 -0
- package/lib/cjs/client/ids/index.cjs +1 -0
- package/lib/cjs/client/ids/index.cjs.map +1 -0
- package/lib/cjs/client/index.cjs +10 -9
- package/lib/cjs/client/index.cjs.map +1 -0
- package/lib/cjs/client/indexes/generation.cjs +1 -0
- package/lib/cjs/client/indexes/generation.cjs.map +1 -0
- package/lib/cjs/client/indexes/index.cjs +1 -0
- package/lib/cjs/client/indexes/index.cjs.map +1 -0
- package/lib/cjs/client/logging.cjs +1 -0
- package/lib/cjs/client/logging.cjs.map +1 -0
- package/lib/cjs/client/services/FabricEnrollmentService.cjs +17 -32
- package/lib/cjs/client/services/FabricEnrollmentService.cjs.map +1 -0
- package/lib/cjs/client/services/FabricIdentityService.cjs +15 -14
- package/lib/cjs/client/services/FabricIdentityService.cjs.map +1 -0
- package/lib/cjs/client/services/RegistrationRequestBuilder.cjs +11 -5
- package/lib/cjs/client/services/RegistrationRequestBuilder.cjs.map +1 -0
- package/lib/cjs/client/services/constants.cjs +2 -9
- package/lib/cjs/client/services/constants.cjs.map +1 -0
- package/lib/cjs/client/services/index.cjs +1 -0
- package/lib/cjs/client/services/index.cjs.map +1 -0
- package/lib/cjs/client/types.cjs +1 -0
- package/lib/cjs/client/types.cjs.map +1 -0
- package/lib/cjs/client/utils.cjs +1 -0
- package/lib/cjs/client/utils.cjs.map +1 -0
- package/lib/cjs/contract/Address.cjs +14 -8
- package/lib/cjs/contract/Address.cjs.map +1 -0
- package/lib/cjs/contract/AddressContract.cjs +15 -9
- package/lib/cjs/contract/AddressContract.cjs.map +1 -0
- package/lib/cjs/contract/AuditContract.cjs +15 -9
- package/lib/cjs/contract/AuditContract.cjs.map +1 -0
- package/lib/cjs/contract/BatchContract.cjs +15 -9
- package/lib/cjs/contract/BatchContract.cjs.map +1 -0
- package/lib/cjs/contract/MarketContract.cjs +15 -9
- package/lib/cjs/contract/MarketContract.cjs.map +1 -0
- package/lib/cjs/contract/OtherAuditContract.cjs +15 -9
- package/lib/cjs/contract/OtherAuditContract.cjs.map +1 -0
- package/lib/cjs/contract/OtherBatchContract.cjs +15 -9
- package/lib/cjs/contract/OtherBatchContract.cjs.map +1 -0
- package/lib/cjs/contract/OtherMarketContract.cjs +15 -9
- package/lib/cjs/contract/OtherMarketContract.cjs.map +1 -0
- package/lib/cjs/contract/OtherProductContract.cjs +15 -9
- package/lib/cjs/contract/OtherProductContract.cjs.map +1 -0
- package/lib/cjs/contract/OtherProductImageContract.cjs +15 -9
- package/lib/cjs/contract/OtherProductImageContract.cjs.map +1 -0
- package/lib/cjs/contract/OtherProductSharedContract.cjs +15 -9
- package/lib/cjs/contract/OtherProductSharedContract.cjs.map +1 -0
- package/lib/cjs/contract/OtherProductStrengthContract.cjs +15 -9
- package/lib/cjs/contract/OtherProductStrengthContract.cjs.map +1 -0
- package/lib/cjs/contract/Product.cjs +15 -9
- package/lib/cjs/contract/Product.cjs.map +1 -0
- package/lib/cjs/contract/ProductContract.cjs +15 -9
- package/lib/cjs/contract/ProductContract.cjs.map +1 -0
- package/lib/cjs/contract/ProductStrengthContract.cjs +15 -9
- package/lib/cjs/contract/ProductStrengthContract.cjs.map +1 -0
- package/lib/cjs/contract/SegregatedPrivateDocumentContract.cjs +15 -9
- package/lib/cjs/contract/SegregatedPrivateDocumentContract.cjs.map +1 -0
- package/lib/cjs/contract/SegregatedSharedDocumentContract.cjs +15 -9
- package/lib/cjs/contract/SegregatedSharedDocumentContract.cjs.map +1 -0
- package/lib/cjs/contract/User.cjs +13 -7
- package/lib/cjs/contract/User.cjs.map +1 -0
- package/lib/cjs/contract/UserContract.cjs +15 -9
- package/lib/cjs/contract/UserContract.cjs.map +1 -0
- package/lib/cjs/contract/index.cjs +31 -30
- package/lib/cjs/contract/index.cjs.map +1 -0
- package/lib/cjs/contract/logging-context.cjs +1 -0
- package/lib/cjs/contract/logging-context.cjs.map +1 -0
- package/lib/cjs/contract/models/Audit.cjs +17 -11
- package/lib/cjs/contract/models/Audit.cjs.map +1 -0
- package/lib/cjs/contract/models/BaseIdentifiedModel.cjs +15 -9
- package/lib/cjs/contract/models/BaseIdentifiedModel.cjs.map +1 -0
- package/lib/cjs/contract/models/BaseModel.cjs +13 -7
- package/lib/cjs/contract/models/BaseModel.cjs.map +1 -0
- package/lib/cjs/contract/models/Batch.cjs +24 -18
- package/lib/cjs/contract/models/Batch.cjs.map +1 -0
- package/lib/cjs/contract/models/GtinOwner.cjs +18 -12
- package/lib/cjs/contract/models/GtinOwner.cjs.map +1 -0
- package/lib/cjs/contract/models/History.cjs +15 -9
- package/lib/cjs/contract/models/History.cjs.map +1 -0
- package/lib/cjs/contract/models/Leaflet.cjs +25 -19
- package/lib/cjs/contract/models/Leaflet.cjs.map +1 -0
- package/lib/cjs/contract/models/LeafletFile.cjs +19 -13
- package/lib/cjs/contract/models/LeafletFile.cjs.map +1 -0
- package/lib/cjs/contract/models/Market.cjs +19 -13
- package/lib/cjs/contract/models/Market.cjs.map +1 -0
- package/lib/cjs/contract/models/OtherAudit.cjs +20 -14
- package/lib/cjs/contract/models/OtherAudit.cjs.map +1 -0
- package/lib/cjs/contract/models/OtherBatchShared.cjs +27 -21
- package/lib/cjs/contract/models/OtherBatchShared.cjs.map +1 -0
- package/lib/cjs/contract/models/OtherLeaflet.cjs +27 -21
- package/lib/cjs/contract/models/OtherLeaflet.cjs.map +1 -0
- package/lib/cjs/contract/models/OtherLeafletFile.cjs +18 -12
- package/lib/cjs/contract/models/OtherLeafletFile.cjs.map +1 -0
- package/lib/cjs/contract/models/OtherMarket.cjs +21 -15
- package/lib/cjs/contract/models/OtherMarket.cjs.map +1 -0
- package/lib/cjs/contract/models/OtherProduct.cjs +24 -18
- package/lib/cjs/contract/models/OtherProduct.cjs.map +1 -0
- package/lib/cjs/contract/models/OtherProductImage.cjs +22 -16
- package/lib/cjs/contract/models/OtherProductImage.cjs.map +1 -0
- package/lib/cjs/contract/models/OtherProductShared.cjs +32 -26
- package/lib/cjs/contract/models/OtherProductShared.cjs.map +1 -0
- package/lib/cjs/contract/models/OtherProductStrength.cjs +21 -15
- package/lib/cjs/contract/models/OtherProductStrength.cjs.map +1 -0
- package/lib/cjs/contract/models/Product.cjs +24 -18
- package/lib/cjs/contract/models/Product.cjs.map +1 -0
- package/lib/cjs/contract/models/ProductStrength.cjs +19 -13
- package/lib/cjs/contract/models/ProductStrength.cjs.map +1 -0
- package/lib/cjs/contract/models/SegregatedDocument.cjs +23 -17
- package/lib/cjs/contract/models/SegregatedDocument.cjs.map +1 -0
- package/lib/cjs/contract/models/constants.cjs +3 -4
- package/lib/cjs/contract/models/constants.cjs.map +1 -0
- package/lib/cjs/contract/models/decorators-private.cjs +11 -10
- package/lib/cjs/contract/models/decorators-private.cjs.map +1 -0
- package/lib/cjs/contract/models/decorators.cjs +13 -12
- package/lib/cjs/contract/models/decorators.cjs.map +1 -0
- package/lib/cjs/contract/models/gtin.cjs +13 -7
- package/lib/cjs/contract/models/gtin.cjs.map +1 -0
- package/lib/cjs/contract/models/history-dec.cjs +11 -10
- package/lib/cjs/contract/models/history-dec.cjs.map +1 -0
- package/lib/cjs/contracts/ContractAdapter.cjs +27 -26
- package/lib/cjs/contracts/ContractAdapter.cjs.map +1 -0
- package/lib/cjs/contracts/ContractContext.cjs +1 -0
- package/lib/cjs/contracts/ContractContext.cjs.map +1 -0
- package/lib/cjs/contracts/FabricContractDispatch.cjs +1 -0
- package/lib/cjs/contracts/FabricContractDispatch.cjs.map +1 -0
- package/lib/cjs/contracts/FabricContractPaginator.cjs +5 -4
- package/lib/cjs/contracts/FabricContractPaginator.cjs.map +1 -0
- package/lib/cjs/contracts/FabricContractRepository.cjs +8 -7
- package/lib/cjs/contracts/FabricContractRepository.cjs.map +1 -0
- package/lib/cjs/contracts/FabricContractRepositoryObservableHandler.cjs +3 -2
- package/lib/cjs/contracts/FabricContractRepositoryObservableHandler.cjs.map +1 -0
- package/lib/cjs/contracts/FabricContractSequence.cjs +1 -0
- package/lib/cjs/contracts/FabricContractSequence.cjs.map +1 -0
- package/lib/cjs/contracts/FabricContractStatement.cjs +5 -4
- package/lib/cjs/contracts/FabricContractStatement.cjs.map +1 -0
- package/lib/cjs/contracts/MigrationContract.cjs +20 -14
- package/lib/cjs/contracts/MigrationContract.cjs.map +1 -0
- package/lib/cjs/contracts/PrivateSequence.cjs +11 -5
- package/lib/cjs/contracts/PrivateSequence.cjs.map +1 -0
- package/lib/cjs/contracts/auth/decorators.cjs +3 -2
- package/lib/cjs/contracts/auth/decorators.cjs.map +1 -0
- package/lib/cjs/contracts/auth/index.cjs +1 -0
- package/lib/cjs/contracts/auth/index.cjs.map +1 -0
- package/lib/cjs/contracts/crud/crud-contract.cjs +12 -11
- package/lib/cjs/contracts/crud/crud-contract.cjs.map +1 -0
- package/lib/cjs/contracts/crud/index.cjs +1 -0
- package/lib/cjs/contracts/crud/index.cjs.map +1 -0
- package/lib/cjs/contracts/crud/serialized-crud-contract.cjs +13 -7
- package/lib/cjs/contracts/crud/serialized-crud-contract.cjs.map +1 -0
- package/lib/cjs/contracts/erc20/erc20contract.cjs +53 -47
- package/lib/cjs/contracts/erc20/erc20contract.cjs.map +1 -0
- package/lib/cjs/contracts/erc20/index.cjs +3 -2
- package/lib/cjs/contracts/erc20/index.cjs.map +1 -0
- package/lib/cjs/contracts/erc20/models.cjs +11 -5
- package/lib/cjs/contracts/erc20/models.cjs.map +1 -0
- package/lib/cjs/contracts/index.cjs +1 -0
- package/lib/cjs/contracts/index.cjs.map +1 -0
- package/lib/cjs/contracts/logging.cjs +4 -3
- package/lib/cjs/contracts/logging.cjs.map +1 -0
- package/lib/cjs/contracts/overrides.cjs +3 -2
- package/lib/cjs/contracts/overrides.cjs.map +1 -0
- package/lib/cjs/contracts/types.cjs +1 -0
- package/lib/cjs/contracts/types.cjs.map +1 -0
- package/lib/cjs/contracts/uuid.cjs +1 -0
- package/lib/cjs/contracts/uuid.cjs.map +1 -0
- package/lib/cjs/index.cjs +6 -5
- package/lib/cjs/index.cjs.map +1 -0
- package/lib/cjs/shared/ClientSerializer.cjs +1 -0
- package/lib/cjs/shared/ClientSerializer.cjs.map +1 -0
- package/lib/cjs/shared/DeterministicSerializer.cjs +1 -0
- package/lib/cjs/shared/DeterministicSerializer.cjs.map +1 -0
- package/lib/cjs/shared/SimpleDeterministicSerializer.cjs +3 -2
- package/lib/cjs/shared/SimpleDeterministicSerializer.cjs.map +1 -0
- package/lib/cjs/shared/constants.cjs +3 -18
- package/lib/cjs/shared/constants.cjs.map +1 -0
- package/lib/cjs/shared/decorators.cjs +14 -13
- package/lib/cjs/shared/decorators.cjs.map +1 -0
- package/lib/cjs/shared/erc20/erc20-constants.cjs +2 -9
- package/lib/cjs/shared/erc20/erc20-constants.cjs.map +1 -0
- package/lib/cjs/shared/erc20/index.cjs +1 -0
- package/lib/cjs/shared/erc20/index.cjs.map +1 -0
- package/lib/cjs/shared/errors.cjs +1 -0
- package/lib/cjs/shared/errors.cjs.map +1 -0
- package/lib/cjs/shared/events.cjs +1 -0
- package/lib/cjs/shared/events.cjs.map +1 -0
- package/lib/cjs/shared/fabric-types.cjs +1 -0
- package/lib/cjs/shared/fabric-types.cjs.map +1 -0
- package/lib/cjs/shared/index.cjs +1 -0
- package/lib/cjs/shared/index.cjs.map +1 -0
- package/lib/cjs/shared/interfaces/Checkable.cjs +1 -0
- package/lib/cjs/shared/interfaces/Checkable.cjs.map +1 -0
- package/lib/cjs/shared/interfaces/index.cjs +1 -0
- package/lib/cjs/shared/interfaces/index.cjs.map +1 -0
- package/lib/cjs/shared/math.cjs +4 -3
- package/lib/cjs/shared/math.cjs.map +1 -0
- package/lib/cjs/shared/model/FabricBaseModel.cjs +13 -7
- package/lib/cjs/shared/model/FabricBaseModel.cjs.map +1 -0
- package/lib/cjs/shared/model/FabricIdentifiedBaseModel.cjs +15 -9
- package/lib/cjs/shared/model/FabricIdentifiedBaseModel.cjs.map +1 -0
- package/lib/cjs/shared/model/Identity.cjs +16 -10
- package/lib/cjs/shared/model/Identity.cjs.map +1 -0
- package/lib/cjs/shared/model/IdentityCredentials.cjs +11 -5
- package/lib/cjs/shared/model/IdentityCredentials.cjs.map +1 -0
- package/lib/cjs/shared/model/index.cjs +1 -0
- package/lib/cjs/shared/model/index.cjs.map +1 -0
- package/lib/cjs/shared/overrides/Model.cjs +1 -0
- package/lib/cjs/shared/overrides/Model.cjs.map +1 -0
- package/lib/cjs/shared/overrides/index.cjs +1 -0
- package/lib/cjs/shared/overrides/index.cjs.map +1 -0
- package/lib/cjs/shared/overrides/overrides.cjs +11 -10
- package/lib/cjs/shared/overrides/overrides.cjs.map +1 -0
- package/lib/cjs/shared/types.cjs +1 -0
- package/lib/cjs/shared/types.cjs.map +1 -0
- package/lib/cjs/version.cjs +2 -1
- package/lib/cjs/version.cjs.map +1 -0
- package/lib/esm/version.js +1 -1
- package/lib/types/bin/cli.d.cts +1 -0
- package/lib/types/bin/cli.d.mts +1 -0
- package/lib/types/cli-module.d.cts +3 -0
- package/lib/types/cli-module.d.mts +3 -0
- package/lib/types/cli-utils.d.cts +21 -0
- package/lib/types/cli-utils.d.mts +21 -0
- package/lib/types/client/FabricClientAdapter.d.cts +404 -0
- package/lib/types/client/FabricClientAdapter.d.mts +404 -0
- package/lib/types/client/FabricClientDispatch.d.cts +133 -0
- package/lib/types/client/FabricClientDispatch.d.mts +133 -0
- package/lib/types/client/FabricClientPaginator.d.cts +12 -0
- package/lib/types/client/FabricClientPaginator.d.mts +12 -0
- package/lib/types/client/FabricClientRepository.d.cts +71 -0
- package/lib/types/client/FabricClientRepository.d.mts +71 -0
- package/lib/types/client/FabricClientStatement.d.cts +64 -0
- package/lib/types/client/FabricClientStatement.d.mts +64 -0
- package/lib/types/client/collections/generation.d.cts +46 -0
- package/lib/types/client/collections/generation.d.mts +46 -0
- package/lib/types/client/collections/index.d.cts +1 -0
- package/lib/types/client/collections/index.d.mts +1 -0
- package/lib/types/client/constants.d.cts +2 -0
- package/lib/types/client/constants.d.mts +2 -0
- package/lib/types/client/crypto.d.cts +107 -0
- package/lib/types/client/crypto.d.mts +107 -0
- package/lib/types/client/erc20/FabricERC20ClientRepository.d.cts +254 -0
- package/lib/types/client/erc20/FabricERC20ClientRepository.d.mts +254 -0
- package/lib/types/client/erc20/index.d.cts +1 -0
- package/lib/types/client/erc20/index.d.mts +1 -0
- package/lib/types/client/fabric-fs.d.cts +92 -0
- package/lib/types/client/fabric-fs.d.mts +92 -0
- package/lib/types/client/fabric-hsm.d.cts +24 -0
- package/lib/types/client/fabric-hsm.d.mts +24 -0
- package/lib/types/client/ids/id-extraction.d.cts +4 -0
- package/lib/types/client/ids/id-extraction.d.mts +4 -0
- package/lib/types/client/ids/index.d.cts +1 -0
- package/lib/types/client/ids/index.d.mts +1 -0
- package/lib/types/client/index.d.cts +23 -0
- package/lib/types/client/index.d.mts +23 -0
- package/lib/types/client/indexes/generation.d.cts +10 -0
- package/lib/types/client/indexes/generation.d.mts +10 -0
- package/lib/types/client/indexes/index.d.cts +1 -0
- package/lib/types/client/indexes/index.d.mts +1 -0
- package/lib/types/client/logging.d.cts +60 -0
- package/lib/types/client/logging.d.mts +60 -0
- package/lib/types/client/services/FabricEnrollmentService.d.cts +176 -0
- package/lib/types/client/services/FabricEnrollmentService.d.mts +176 -0
- package/lib/types/client/services/FabricIdentityService.d.cts +98 -0
- package/lib/types/client/services/FabricIdentityService.d.mts +98 -0
- package/lib/types/client/services/RegistrationRequestBuilder.d.cts +19 -0
- package/lib/types/client/services/RegistrationRequestBuilder.d.mts +19 -0
- package/lib/types/client/services/constants.d.cts +15 -0
- package/lib/types/client/services/constants.d.mts +15 -0
- package/lib/types/client/services/index.d.cts +4 -0
- package/lib/types/client/services/index.d.mts +4 -0
- package/lib/types/client/types.d.cts +20 -0
- package/lib/types/client/types.d.mts +20 -0
- package/lib/types/client/utils.d.cts +71 -0
- package/lib/types/client/utils.d.mts +71 -0
- package/lib/types/contract/Address.d.cts +13 -0
- package/lib/types/contract/Address.d.mts +13 -0
- package/lib/types/contract/AddressContract.d.cts +5 -0
- package/lib/types/contract/AddressContract.d.mts +5 -0
- package/lib/types/contract/AuditContract.d.cts +5 -0
- package/lib/types/contract/AuditContract.d.mts +5 -0
- package/lib/types/contract/BatchContract.d.cts +5 -0
- package/lib/types/contract/BatchContract.d.mts +5 -0
- package/lib/types/contract/MarketContract.d.cts +5 -0
- package/lib/types/contract/MarketContract.d.mts +5 -0
- package/lib/types/contract/OtherAuditContract.d.cts +5 -0
- package/lib/types/contract/OtherAuditContract.d.mts +5 -0
- package/lib/types/contract/OtherBatchContract.d.cts +5 -0
- package/lib/types/contract/OtherBatchContract.d.mts +5 -0
- package/lib/types/contract/OtherMarketContract.d.cts +5 -0
- package/lib/types/contract/OtherMarketContract.d.mts +5 -0
- package/lib/types/contract/OtherProductContract.d.cts +5 -0
- package/lib/types/contract/OtherProductContract.d.mts +5 -0
- package/lib/types/contract/OtherProductImageContract.d.cts +5 -0
- package/lib/types/contract/OtherProductImageContract.d.mts +5 -0
- package/lib/types/contract/OtherProductSharedContract.d.cts +5 -0
- package/lib/types/contract/OtherProductSharedContract.d.mts +5 -0
- package/lib/types/contract/OtherProductStrengthContract.d.cts +5 -0
- package/lib/types/contract/OtherProductStrengthContract.d.mts +5 -0
- package/lib/types/contract/Product.d.cts +7 -0
- package/lib/types/contract/Product.d.mts +7 -0
- package/lib/types/contract/ProductContract.d.cts +5 -0
- package/lib/types/contract/ProductContract.d.mts +5 -0
- package/lib/types/contract/ProductStrengthContract.d.cts +5 -0
- package/lib/types/contract/ProductStrengthContract.d.mts +5 -0
- package/lib/types/contract/SegregatedPrivateDocumentContract.d.cts +5 -0
- package/lib/types/contract/SegregatedPrivateDocumentContract.d.mts +5 -0
- package/lib/types/contract/SegregatedSharedDocumentContract.d.cts +5 -0
- package/lib/types/contract/SegregatedSharedDocumentContract.d.mts +5 -0
- package/lib/types/contract/User.d.cts +7 -0
- package/lib/types/contract/User.d.mts +7 -0
- package/lib/types/contract/UserContract.d.cts +5 -0
- package/lib/types/contract/UserContract.d.mts +5 -0
- package/lib/types/contract/index.d.cts +2 -0
- package/lib/types/contract/index.d.mts +2 -0
- package/lib/types/contract/logging-context.d.cts +8 -0
- package/lib/types/contract/logging-context.d.mts +8 -0
- package/lib/types/contract/models/Audit.d.cts +13 -0
- package/lib/types/contract/models/Audit.d.mts +13 -0
- package/lib/types/contract/models/BaseIdentifiedModel.d.cts +7 -0
- package/lib/types/contract/models/BaseIdentifiedModel.d.mts +7 -0
- package/lib/types/contract/models/BaseModel.d.cts +7 -0
- package/lib/types/contract/models/BaseModel.d.mts +7 -0
- package/lib/types/contract/models/Batch.d.cts +18 -0
- package/lib/types/contract/models/Batch.d.mts +18 -0
- package/lib/types/contract/models/GtinOwner.d.cts +8 -0
- package/lib/types/contract/models/GtinOwner.d.mts +8 -0
- package/lib/types/contract/models/History.d.cts +9 -0
- package/lib/types/contract/models/History.d.mts +9 -0
- package/lib/types/contract/models/Leaflet.d.cts +12 -0
- package/lib/types/contract/models/Leaflet.d.mts +12 -0
- package/lib/types/contract/models/LeafletFile.d.cts +9 -0
- package/lib/types/contract/models/LeafletFile.d.mts +9 -0
- package/lib/types/contract/models/Market.d.cts +12 -0
- package/lib/types/contract/models/Market.d.mts +12 -0
- package/lib/types/contract/models/OtherAudit.d.cts +15 -0
- package/lib/types/contract/models/OtherAudit.d.mts +15 -0
- package/lib/types/contract/models/OtherBatchShared.d.cts +18 -0
- package/lib/types/contract/models/OtherBatchShared.d.mts +18 -0
- package/lib/types/contract/models/OtherLeaflet.d.cts +16 -0
- package/lib/types/contract/models/OtherLeaflet.d.mts +16 -0
- package/lib/types/contract/models/OtherLeafletFile.d.cts +10 -0
- package/lib/types/contract/models/OtherLeafletFile.d.mts +10 -0
- package/lib/types/contract/models/OtherMarket.d.cts +13 -0
- package/lib/types/contract/models/OtherMarket.d.mts +13 -0
- package/lib/types/contract/models/OtherProduct.d.cts +12 -0
- package/lib/types/contract/models/OtherProduct.d.mts +12 -0
- package/lib/types/contract/models/OtherProductImage.d.cts +9 -0
- package/lib/types/contract/models/OtherProductImage.d.mts +9 -0
- package/lib/types/contract/models/OtherProductShared.d.cts +18 -0
- package/lib/types/contract/models/OtherProductShared.d.mts +18 -0
- package/lib/types/contract/models/OtherProductStrength.d.cts +12 -0
- package/lib/types/contract/models/OtherProductStrength.d.mts +12 -0
- package/lib/types/contract/models/Product.d.cts +15 -0
- package/lib/types/contract/models/Product.d.mts +15 -0
- package/lib/types/contract/models/ProductStrength.d.cts +11 -0
- package/lib/types/contract/models/ProductStrength.d.mts +11 -0
- package/lib/types/contract/models/SegregatedDocument.d.cts +18 -0
- package/lib/types/contract/models/SegregatedDocument.d.mts +18 -0
- package/lib/types/contract/models/constants.d.cts +24 -0
- package/lib/types/contract/models/constants.d.mts +24 -0
- package/lib/types/contract/models/decorators-private.d.cts +16 -0
- package/lib/types/contract/models/decorators-private.d.mts +16 -0
- package/lib/types/contract/models/decorators.d.cts +28 -0
- package/lib/types/contract/models/decorators.d.mts +28 -0
- package/lib/types/contract/models/gtin.d.cts +8 -0
- package/lib/types/contract/models/gtin.d.mts +8 -0
- package/lib/types/contract/models/history-dec.d.cts +6 -0
- package/lib/types/contract/models/history-dec.d.mts +6 -0
- package/lib/types/contracts/ContractAdapter.d.cts +287 -0
- package/lib/types/contracts/ContractAdapter.d.mts +287 -0
- package/lib/types/contracts/ContractContext.d.cts +89 -0
- package/lib/types/contracts/ContractContext.d.mts +89 -0
- package/lib/types/contracts/FabricContractDispatch.d.cts +7 -0
- package/lib/types/contracts/FabricContractDispatch.d.mts +7 -0
- package/lib/types/contracts/FabricContractPaginator.d.cts +105 -0
- package/lib/types/contracts/FabricContractPaginator.d.mts +105 -0
- package/lib/types/contracts/FabricContractRepository.d.cts +119 -0
- package/lib/types/contracts/FabricContractRepository.d.mts +119 -0
- package/lib/types/contracts/FabricContractRepositoryObservableHandler.d.cts +62 -0
- package/lib/types/contracts/FabricContractRepositoryObservableHandler.d.mts +62 -0
- package/lib/types/contracts/FabricContractSequence.d.cts +87 -0
- package/lib/types/contracts/FabricContractSequence.d.mts +87 -0
- package/lib/types/contracts/FabricContractStatement.d.cts +36 -0
- package/lib/types/contracts/FabricContractStatement.d.mts +36 -0
- package/lib/types/contracts/MigrationContract.d.cts +22 -0
- package/lib/types/contracts/MigrationContract.d.mts +22 -0
- package/lib/types/contracts/PrivateSequence.d.cts +15 -0
- package/lib/types/contracts/PrivateSequence.d.mts +15 -0
- package/lib/types/contracts/auth/decorators.d.cts +6 -0
- package/lib/types/contracts/auth/decorators.d.mts +6 -0
- package/lib/types/contracts/auth/index.d.cts +1 -0
- package/lib/types/contracts/auth/index.d.mts +1 -0
- package/lib/types/contracts/crud/crud-contract.d.cts +199 -0
- package/lib/types/contracts/crud/crud-contract.d.mts +199 -0
- package/lib/types/contracts/crud/index.d.cts +2 -0
- package/lib/types/contracts/crud/index.d.mts +2 -0
- package/lib/types/contracts/crud/serialized-crud-contract.d.cts +42 -0
- package/lib/types/contracts/crud/serialized-crud-contract.d.mts +42 -0
- package/lib/types/contracts/erc20/erc20contract.d.cts +152 -0
- package/lib/types/contracts/erc20/erc20contract.d.mts +152 -0
- package/lib/types/contracts/erc20/index.d.cts +2 -0
- package/lib/types/contracts/erc20/index.d.mts +2 -0
- package/lib/types/contracts/erc20/models.d.cts +114 -0
- package/lib/types/contracts/erc20/models.d.mts +114 -0
- package/lib/types/contracts/index.d.cts +20 -0
- package/lib/types/contracts/index.d.mts +20 -0
- package/lib/types/contracts/logging.d.cts +54 -0
- package/lib/types/contracts/logging.d.mts +54 -0
- package/lib/types/contracts/overrides.d.cts +1 -0
- package/lib/types/contracts/overrides.d.mts +1 -0
- package/lib/types/contracts/types.d.cts +38 -0
- package/lib/types/contracts/types.d.mts +38 -0
- package/lib/types/contracts/uuid.d.cts +2 -0
- package/lib/types/contracts/uuid.d.mts +2 -0
- package/lib/types/index.d.cts +8 -0
- package/lib/types/index.d.mts +8 -0
- package/lib/types/shared/ClientSerializer.d.cts +52 -0
- package/lib/types/shared/ClientSerializer.d.mts +52 -0
- package/lib/types/shared/DeterministicSerializer.d.cts +47 -0
- package/lib/types/shared/DeterministicSerializer.d.mts +47 -0
- package/lib/types/shared/SimpleDeterministicSerializer.d.cts +7 -0
- package/lib/types/shared/SimpleDeterministicSerializer.d.mts +7 -0
- package/lib/types/shared/constants.d.cts +35 -0
- package/lib/types/shared/constants.d.mts +35 -0
- package/lib/types/shared/decorators.d.cts +81 -0
- package/lib/types/shared/decorators.d.mts +81 -0
- package/lib/types/shared/erc20/erc20-constants.d.cts +25 -0
- package/lib/types/shared/erc20/erc20-constants.d.mts +25 -0
- package/lib/types/shared/erc20/index.d.cts +1 -0
- package/lib/types/shared/erc20/index.d.mts +1 -0
- package/lib/types/shared/errors.d.cts +140 -0
- package/lib/types/shared/errors.d.mts +140 -0
- package/lib/types/shared/events.d.cts +37 -0
- package/lib/types/shared/events.d.mts +37 -0
- package/lib/types/shared/fabric-types.d.cts +32 -0
- package/lib/types/shared/fabric-types.d.mts +32 -0
- package/lib/types/shared/index.d.cts +21 -0
- package/lib/types/shared/index.d.mts +21 -0
- package/lib/types/shared/interfaces/Checkable.d.cts +23 -0
- package/lib/types/shared/interfaces/Checkable.d.mts +23 -0
- package/lib/types/shared/interfaces/index.d.cts +1 -0
- package/lib/types/shared/interfaces/index.d.mts +1 -0
- package/lib/types/shared/math.d.cts +34 -0
- package/lib/types/shared/math.d.mts +34 -0
- package/lib/types/shared/model/FabricBaseModel.d.cts +7 -0
- package/lib/types/shared/model/FabricBaseModel.d.mts +7 -0
- package/lib/types/shared/model/FabricIdentifiedBaseModel.d.cts +7 -0
- package/lib/types/shared/model/FabricIdentifiedBaseModel.d.mts +7 -0
- package/lib/types/shared/model/Identity.d.cts +42 -0
- package/lib/types/shared/model/Identity.d.mts +42 -0
- package/lib/types/shared/model/IdentityCredentials.d.cts +41 -0
- package/lib/types/shared/model/IdentityCredentials.d.mts +41 -0
- package/lib/types/shared/model/index.d.cts +4 -0
- package/lib/types/shared/model/index.d.mts +4 -0
- package/lib/types/shared/overrides/Model.d.cts +22 -0
- package/lib/types/shared/overrides/Model.d.mts +22 -0
- package/lib/types/shared/overrides/index.d.cts +2 -0
- package/lib/types/shared/overrides/index.d.mts +2 -0
- package/lib/types/shared/overrides/overrides.d.cts +1 -0
- package/lib/types/shared/overrides/overrides.d.mts +1 -0
- package/lib/types/shared/types.d.cts +125 -0
- package/lib/types/shared/types.d.mts +125 -0
- package/lib/types/version.d.cts +2 -0
- package/lib/types/version.d.mts +2 -0
- package/lib/types/version.d.ts +1 -1
- package/package.json +10 -10
- package/lib/cjs/bin/cli.js.map +0 -1
- package/lib/cjs/cli-module.js.map +0 -1
- package/lib/cjs/cli-utils.js.map +0 -1
- package/lib/cjs/client/FabricClientAdapter.js.map +0 -1
- package/lib/cjs/client/FabricClientDispatch.js.map +0 -1
- package/lib/cjs/client/FabricClientPaginator.js.map +0 -1
- package/lib/cjs/client/FabricClientRepository.js.map +0 -1
- package/lib/cjs/client/FabricClientStatement.js.map +0 -1
- package/lib/cjs/client/collections/generation.js.map +0 -1
- package/lib/cjs/client/collections/index.js.map +0 -1
- package/lib/cjs/client/constants.js.map +0 -1
- package/lib/cjs/client/crypto.js.map +0 -1
- package/lib/cjs/client/erc20/FabricERC20ClientRepository.js.map +0 -1
- package/lib/cjs/client/erc20/index.js.map +0 -1
- package/lib/cjs/client/fabric-fs.js.map +0 -1
- package/lib/cjs/client/fabric-hsm.js.map +0 -1
- package/lib/cjs/client/ids/id-extraction.js.map +0 -1
- package/lib/cjs/client/ids/index.js.map +0 -1
- package/lib/cjs/client/index.js.map +0 -1
- package/lib/cjs/client/indexes/generation.js.map +0 -1
- package/lib/cjs/client/indexes/index.js.map +0 -1
- package/lib/cjs/client/logging.js.map +0 -1
- package/lib/cjs/client/services/FabricEnrollmentService.js.map +0 -1
- package/lib/cjs/client/services/FabricIdentityService.js.map +0 -1
- package/lib/cjs/client/services/RegistrationRequestBuilder.js.map +0 -1
- package/lib/cjs/client/services/constants.js.map +0 -1
- package/lib/cjs/client/services/index.js.map +0 -1
- package/lib/cjs/client/types.js.map +0 -1
- package/lib/cjs/client/utils.js.map +0 -1
- package/lib/cjs/contract/Address.js.map +0 -1
- package/lib/cjs/contract/AddressContract.js.map +0 -1
- package/lib/cjs/contract/AuditContract.js.map +0 -1
- package/lib/cjs/contract/BatchContract.js.map +0 -1
- package/lib/cjs/contract/MarketContract.js.map +0 -1
- package/lib/cjs/contract/OtherAuditContract.js.map +0 -1
- package/lib/cjs/contract/OtherBatchContract.js.map +0 -1
- package/lib/cjs/contract/OtherMarketContract.js.map +0 -1
- package/lib/cjs/contract/OtherProductContract.js.map +0 -1
- package/lib/cjs/contract/OtherProductImageContract.js.map +0 -1
- package/lib/cjs/contract/OtherProductSharedContract.js.map +0 -1
- package/lib/cjs/contract/OtherProductStrengthContract.js.map +0 -1
- package/lib/cjs/contract/Product.js.map +0 -1
- package/lib/cjs/contract/ProductContract.js.map +0 -1
- package/lib/cjs/contract/ProductStrengthContract.js.map +0 -1
- package/lib/cjs/contract/SegregatedPrivateDocumentContract.js.map +0 -1
- package/lib/cjs/contract/SegregatedSharedDocumentContract.js.map +0 -1
- package/lib/cjs/contract/User.js.map +0 -1
- package/lib/cjs/contract/UserContract.js.map +0 -1
- package/lib/cjs/contract/index.js.map +0 -1
- package/lib/cjs/contract/logging-context.js.map +0 -1
- package/lib/cjs/contract/models/Audit.js.map +0 -1
- package/lib/cjs/contract/models/BaseIdentifiedModel.js.map +0 -1
- package/lib/cjs/contract/models/BaseModel.js.map +0 -1
- package/lib/cjs/contract/models/Batch.js.map +0 -1
- package/lib/cjs/contract/models/GtinOwner.js.map +0 -1
- package/lib/cjs/contract/models/History.js.map +0 -1
- package/lib/cjs/contract/models/Leaflet.js.map +0 -1
- package/lib/cjs/contract/models/LeafletFile.js.map +0 -1
- package/lib/cjs/contract/models/Market.js.map +0 -1
- package/lib/cjs/contract/models/OtherAudit.js.map +0 -1
- package/lib/cjs/contract/models/OtherBatchShared.js.map +0 -1
- package/lib/cjs/contract/models/OtherLeaflet.js.map +0 -1
- package/lib/cjs/contract/models/OtherLeafletFile.js.map +0 -1
- package/lib/cjs/contract/models/OtherMarket.js.map +0 -1
- package/lib/cjs/contract/models/OtherProduct.js.map +0 -1
- package/lib/cjs/contract/models/OtherProductImage.js.map +0 -1
- package/lib/cjs/contract/models/OtherProductShared.js.map +0 -1
- package/lib/cjs/contract/models/OtherProductStrength.js.map +0 -1
- package/lib/cjs/contract/models/Product.js.map +0 -1
- package/lib/cjs/contract/models/ProductStrength.js.map +0 -1
- package/lib/cjs/contract/models/SegregatedDocument.js.map +0 -1
- package/lib/cjs/contract/models/constants.js.map +0 -1
- package/lib/cjs/contract/models/decorators-private.js.map +0 -1
- package/lib/cjs/contract/models/decorators.js.map +0 -1
- package/lib/cjs/contract/models/gtin.js.map +0 -1
- package/lib/cjs/contract/models/history-dec.js.map +0 -1
- package/lib/cjs/contracts/ContractAdapter.js.map +0 -1
- package/lib/cjs/contracts/ContractContext.js.map +0 -1
- package/lib/cjs/contracts/FabricContractDispatch.js.map +0 -1
- package/lib/cjs/contracts/FabricContractPaginator.js.map +0 -1
- package/lib/cjs/contracts/FabricContractRepository.js.map +0 -1
- package/lib/cjs/contracts/FabricContractRepositoryObservableHandler.js.map +0 -1
- package/lib/cjs/contracts/FabricContractSequence.js.map +0 -1
- package/lib/cjs/contracts/FabricContractStatement.js.map +0 -1
- package/lib/cjs/contracts/MigrationContract.js.map +0 -1
- package/lib/cjs/contracts/PrivateSequence.js.map +0 -1
- package/lib/cjs/contracts/auth/decorators.js.map +0 -1
- package/lib/cjs/contracts/auth/index.js.map +0 -1
- package/lib/cjs/contracts/crud/crud-contract.js.map +0 -1
- package/lib/cjs/contracts/crud/index.js.map +0 -1
- package/lib/cjs/contracts/crud/serialized-crud-contract.js.map +0 -1
- package/lib/cjs/contracts/erc20/erc20contract.js.map +0 -1
- package/lib/cjs/contracts/erc20/index.js.map +0 -1
- package/lib/cjs/contracts/erc20/models.js.map +0 -1
- package/lib/cjs/contracts/index.js.map +0 -1
- package/lib/cjs/contracts/logging.js.map +0 -1
- package/lib/cjs/contracts/overrides.js.map +0 -1
- package/lib/cjs/contracts/types.js.map +0 -1
- package/lib/cjs/contracts/uuid.js.map +0 -1
- package/lib/cjs/index.js.map +0 -1
- package/lib/cjs/shared/ClientSerializer.js.map +0 -1
- package/lib/cjs/shared/DeterministicSerializer.js.map +0 -1
- package/lib/cjs/shared/SimpleDeterministicSerializer.js.map +0 -1
- package/lib/cjs/shared/constants.js.map +0 -1
- package/lib/cjs/shared/decorators.js.map +0 -1
- package/lib/cjs/shared/erc20/erc20-constants.js.map +0 -1
- package/lib/cjs/shared/erc20/index.js.map +0 -1
- package/lib/cjs/shared/errors.js.map +0 -1
- package/lib/cjs/shared/events.js.map +0 -1
- package/lib/cjs/shared/fabric-types.js.map +0 -1
- package/lib/cjs/shared/index.js.map +0 -1
- package/lib/cjs/shared/interfaces/Checkable.js.map +0 -1
- package/lib/cjs/shared/interfaces/index.js.map +0 -1
- package/lib/cjs/shared/math.js.map +0 -1
- package/lib/cjs/shared/model/FabricBaseModel.js.map +0 -1
- package/lib/cjs/shared/model/FabricIdentifiedBaseModel.js.map +0 -1
- package/lib/cjs/shared/model/Identity.js.map +0 -1
- package/lib/cjs/shared/model/IdentityCredentials.js.map +0 -1
- package/lib/cjs/shared/model/index.js.map +0 -1
- package/lib/cjs/shared/overrides/Model.js.map +0 -1
- package/lib/cjs/shared/overrides/index.js.map +0 -1
- package/lib/cjs/shared/overrides/overrides.js.map +0 -1
- package/lib/cjs/shared/types.js.map +0 -1
- package/lib/cjs/version.js.map +0 -1
|
@@ -0,0 +1,152 @@
|
|
|
1
|
+
import { Context } from "fabric-contract-api";
|
|
2
|
+
import { Allowance, ERC20Token, ERC20Wallet } from "./models.js";
|
|
3
|
+
import type { FabricContractContext } from "../ContractContext.js";
|
|
4
|
+
import { FabricCrudContract } from "../crud/crud-contract.js";
|
|
5
|
+
/**
|
|
6
|
+
* @description ERC20 token contract base for Hyperledger Fabric
|
|
7
|
+
* @summary Implements ERC20-like token logic using repositories and adapters, providing standard token operations such as balance queries, transfers, approvals, minting and burning.
|
|
8
|
+
* @param {string} name - The contract name used to scope token identity
|
|
9
|
+
* @note https://eips.ethereum.org/EIPS/eip-20
|
|
10
|
+
* @return {void}
|
|
11
|
+
* @class FabricERC20Contract
|
|
12
|
+
* @example
|
|
13
|
+
* class MyTokenContract extends FabricERC20Contract {
|
|
14
|
+
* constructor() { super('MyToken'); }
|
|
15
|
+
* }
|
|
16
|
+
* // The contract exposes methods like Transfer, Approve, Mint, Burn, etc.
|
|
17
|
+
* @mermaid
|
|
18
|
+
* sequenceDiagram
|
|
19
|
+
* participant Client
|
|
20
|
+
* participant Contract
|
|
21
|
+
* participant WalletRepo
|
|
22
|
+
* participant TokenRepo
|
|
23
|
+
* participant Ledger
|
|
24
|
+
* Client->>Contract: Transfer(ctx, to, value)
|
|
25
|
+
* Contract->>WalletRepo: read(from)
|
|
26
|
+
* Contract->>WalletRepo: read(to)
|
|
27
|
+
* Contract->>Ledger: putState(updated balances)
|
|
28
|
+
* Contract-->>Client: success
|
|
29
|
+
*/
|
|
30
|
+
export declare abstract class FabricERC20Contract extends FabricCrudContract<ERC20Wallet> {
|
|
31
|
+
private walletRepository;
|
|
32
|
+
private tokenRepository;
|
|
33
|
+
private allowanceRepository;
|
|
34
|
+
protected constructor(name: string);
|
|
35
|
+
TokenName(context: Context): Promise<string>;
|
|
36
|
+
/**
|
|
37
|
+
* Return the symbol of the token. E.g. “HIX”.
|
|
38
|
+
*
|
|
39
|
+
* @param {Context} context the transaction context
|
|
40
|
+
* @returns {String} Returns the symbol of the token
|
|
41
|
+
*/
|
|
42
|
+
Symbol(context: Context): Promise<string>;
|
|
43
|
+
/**
|
|
44
|
+
* Return the number of decimals the token uses
|
|
45
|
+
* e.g. 8, means to divide the token amount by 100000000 to get its user representation.
|
|
46
|
+
*
|
|
47
|
+
* @param {Context} context the transaction context
|
|
48
|
+
* @returns {Number} Returns the number of decimals
|
|
49
|
+
*/
|
|
50
|
+
Decimals(context: Context): Promise<number>;
|
|
51
|
+
/**
|
|
52
|
+
* Return the total token supply.
|
|
53
|
+
*
|
|
54
|
+
* @param {Context} context the transaction context
|
|
55
|
+
* @returns {Number} Returns the total token supply
|
|
56
|
+
*/
|
|
57
|
+
TotalSupply(context: Context): Promise<number>;
|
|
58
|
+
/**
|
|
59
|
+
* BalanceOf returns the balance of the given account.
|
|
60
|
+
*
|
|
61
|
+
* @param {Context} ctx the transaction context
|
|
62
|
+
* @param {String} owner The owner from which the balance will be retrieved
|
|
63
|
+
* @returns {Number} Returns the account balance
|
|
64
|
+
*/
|
|
65
|
+
BalanceOf(context: Context, owner: string): Promise<number>;
|
|
66
|
+
/**
|
|
67
|
+
* @summary Transfer transfers tokens from client account to recipient account.
|
|
68
|
+
* @description recipient account must be a valid clientID as returned by the ClientAccountID() function.
|
|
69
|
+
*
|
|
70
|
+
* @param {Context} context the transaction context
|
|
71
|
+
* @param {String} to The recipient
|
|
72
|
+
* @param {number} value The amount of token to be transferred
|
|
73
|
+
*
|
|
74
|
+
* @returns {Boolean} Return whether the transfer was successful or not
|
|
75
|
+
*/
|
|
76
|
+
Transfer(context: Context, to: string, value: number): Promise<boolean>;
|
|
77
|
+
/**
|
|
78
|
+
* Transfer `value` amount of tokens from `from` to `to`.
|
|
79
|
+
*
|
|
80
|
+
* @param {Context} context the transaction context
|
|
81
|
+
* @param {String} from The sender
|
|
82
|
+
* @param {String} to The recipient
|
|
83
|
+
* @param {number} value The amount of token to be transferred
|
|
84
|
+
* @returns {Boolean} Return whether the transfer was successful or not
|
|
85
|
+
*/
|
|
86
|
+
TransferFrom(context: Context, from: string, to: string, value: number): Promise<boolean>;
|
|
87
|
+
_transfer(from: string, to: string, value: number, ctx: FabricContractContext): Promise<boolean>;
|
|
88
|
+
/**
|
|
89
|
+
* Allows `spender` to spend `value` amount of tokens from the owner. New Approve calls override the previous allowance.
|
|
90
|
+
* @note https://eips.ethereum.org/EIPS/eip-20
|
|
91
|
+
*
|
|
92
|
+
* @param {Context} ctx the transaction context
|
|
93
|
+
* @param {String} spender The spender
|
|
94
|
+
* @param {number} value The amount of tokens to be approved for transfer
|
|
95
|
+
* @returns {Boolean} Return whether the approval was successful or not
|
|
96
|
+
*/
|
|
97
|
+
Approve(context: Context, spender: string, value: number): Promise<boolean>;
|
|
98
|
+
/**
|
|
99
|
+
* Returns the amount of tokens which ` ` is allowed to withdraw from `owner`.
|
|
100
|
+
*
|
|
101
|
+
* @param {Context} ctx the transaction context
|
|
102
|
+
* @param {String} owner The owner of tokens
|
|
103
|
+
* @param {String} spender The spender who are able to transfer the tokens
|
|
104
|
+
* @returns {number} Return the amount of remaining tokens allowed to spent
|
|
105
|
+
*/
|
|
106
|
+
Allowance(context: Context, owner: string, spender: string): Promise<number>;
|
|
107
|
+
_getAllowance(owner: string, spender: string, ctx: FabricContractContext): Promise<Allowance>;
|
|
108
|
+
/**
|
|
109
|
+
* Set optional infomation for a token.
|
|
110
|
+
*
|
|
111
|
+
* @param {Context} ctx the transaction context
|
|
112
|
+
* @param {String} name The name of the token
|
|
113
|
+
* @param {String} symbol The symbol of the token
|
|
114
|
+
* @param {String} decimals The decimals of the token
|
|
115
|
+
* @param {String} totalSupply The totalSupply of the token
|
|
116
|
+
*/
|
|
117
|
+
Initialize(context: Context, token: ERC20Token): Promise<boolean>;
|
|
118
|
+
CheckInitialized(context: Context): Promise<void>;
|
|
119
|
+
/**
|
|
120
|
+
* Mint creates new tokens and adds them to minter's account balance
|
|
121
|
+
*
|
|
122
|
+
* @param {Context} context the transaction context
|
|
123
|
+
* @param {number} amount amount of tokens to be minted
|
|
124
|
+
* @returns {Object} The balance
|
|
125
|
+
*/
|
|
126
|
+
Mint(context: Context, amount: number): Promise<void>;
|
|
127
|
+
/**
|
|
128
|
+
* Burn redeem tokens from minter's account balance
|
|
129
|
+
*
|
|
130
|
+
* @param {Context} context the transaction context
|
|
131
|
+
* @param {number} amount amount of tokens to be burned
|
|
132
|
+
* @returns {Object} The balance
|
|
133
|
+
*/
|
|
134
|
+
Burn(context: Context, amount: number): Promise<void>;
|
|
135
|
+
/**
|
|
136
|
+
* BurnFrom redeem tokens from account allowence and balance
|
|
137
|
+
*
|
|
138
|
+
* @param {Context} context the transaction context
|
|
139
|
+
* @param {number} account account from where tokens will be burned
|
|
140
|
+
* @param {number} amount amount of tokens to be burned
|
|
141
|
+
* @returns {Object} The balance
|
|
142
|
+
*/
|
|
143
|
+
BurnFrom(context: Context, account: string, amount: number): Promise<void>;
|
|
144
|
+
/**
|
|
145
|
+
* ClientAccountBalance returns the balance of the requesting client's account.
|
|
146
|
+
*
|
|
147
|
+
* @param {Context} context the transaction context
|
|
148
|
+
* @returns {Number} Returns the account balance
|
|
149
|
+
*/
|
|
150
|
+
ClientAccountBalance(context: Context): Promise<number>;
|
|
151
|
+
ClientAccountID(context: Context): Promise<string>;
|
|
152
|
+
}
|
|
@@ -0,0 +1,114 @@
|
|
|
1
|
+
import { BaseModel } from "@decaf-ts/core";
|
|
2
|
+
import { type ModelArg } from "@decaf-ts/decorator-validation";
|
|
3
|
+
/**
|
|
4
|
+
* @description ERC20 token metadata model
|
|
5
|
+
* @summary Represents an ERC20 token definition within the Fabric ERC20 sample, including name, symbol, decimals, and the owning identity. Used to define the unique token managed by the contract.
|
|
6
|
+
* @param {ModelArg<ERC20Token>} [m] - Optional partial data or another instance to initialize the model
|
|
7
|
+
* @return {void}
|
|
8
|
+
* @class ERC20Token
|
|
9
|
+
* @example
|
|
10
|
+
* const token = new ERC20Token({ name: "MyToken", symbol: "MTK", decimals: 18, owner: "x509::..." });
|
|
11
|
+
* // Persist through a repository: await repo.create(token, ctx)
|
|
12
|
+
* @mermaid
|
|
13
|
+
* sequenceDiagram
|
|
14
|
+
* participant App
|
|
15
|
+
* participant Repo
|
|
16
|
+
* participant Adapter
|
|
17
|
+
* App->>Repo: create(new ERC20Token({...}), ctx)
|
|
18
|
+
* Repo->>Adapter: create(table, id=name, record, flags)
|
|
19
|
+
* Adapter-->>Repo: stored
|
|
20
|
+
* Repo-->>App: model
|
|
21
|
+
*/
|
|
22
|
+
export declare class ERC20Token extends BaseModel {
|
|
23
|
+
/**
|
|
24
|
+
* @description Token unique name
|
|
25
|
+
* @summary Serves as the primary key for the ERC20 token definition; typically a human-readable identifier
|
|
26
|
+
*/
|
|
27
|
+
name: string;
|
|
28
|
+
/**
|
|
29
|
+
* @description Owning identity of the token
|
|
30
|
+
* @summary X.509 subject or MSP identity string that denotes who owns/controls the token definition
|
|
31
|
+
*/
|
|
32
|
+
owner: string;
|
|
33
|
+
/**
|
|
34
|
+
* @description Token symbol
|
|
35
|
+
* @summary Short ticker-like symbol used to represent the token (e.g., MTK)
|
|
36
|
+
*/
|
|
37
|
+
symbol: string;
|
|
38
|
+
/**
|
|
39
|
+
* @description Decimal precision for token amounts
|
|
40
|
+
* @summary Number of digits after the decimal separator used when formatting token balances
|
|
41
|
+
*/
|
|
42
|
+
decimals: number;
|
|
43
|
+
constructor(m?: ModelArg<ERC20Wallet>);
|
|
44
|
+
}
|
|
45
|
+
/**
|
|
46
|
+
* @description ERC20 wallet model
|
|
47
|
+
* @summary Represents a holder account for an ERC20 token within the Fabric network, tracking balance and token association.
|
|
48
|
+
* @param {ModelArg<ERC20Wallet>} [m] - Optional partial data or another instance to initialize the model
|
|
49
|
+
* @return {void}
|
|
50
|
+
* @class ERC20Wallet
|
|
51
|
+
* @example
|
|
52
|
+
* const wallet = new ERC20Wallet({ id: "acct1", token: "MyToken", balance: 1000 });
|
|
53
|
+
* // Update balance via repository: await repo.update(wallet, ctx)
|
|
54
|
+
* @mermaid
|
|
55
|
+
* sequenceDiagram
|
|
56
|
+
* participant App
|
|
57
|
+
* participant Repo
|
|
58
|
+
* App->>Repo: read("acct1", ctx)
|
|
59
|
+
* Repo-->>App: ERC20Wallet
|
|
60
|
+
*/
|
|
61
|
+
export declare class ERC20Wallet extends BaseModel {
|
|
62
|
+
/**
|
|
63
|
+
* @description Wallet unique identifier
|
|
64
|
+
* @summary Primary key for the wallet; commonly references an account or identity
|
|
65
|
+
*/
|
|
66
|
+
id: string;
|
|
67
|
+
/**
|
|
68
|
+
* @description Associated token name
|
|
69
|
+
* @summary References the ERC20Token this wallet holds; maintained as a relationship for cascading updates/deletes
|
|
70
|
+
*/
|
|
71
|
+
token: string;
|
|
72
|
+
/**
|
|
73
|
+
* @description Token balance for this wallet
|
|
74
|
+
* @summary Current amount of the associated token held by this wallet
|
|
75
|
+
*/
|
|
76
|
+
balance: number;
|
|
77
|
+
/**
|
|
78
|
+
* @description Captive flag or identifier
|
|
79
|
+
* @summary Optional field used by some flows to mark non-transferable funds or managed custody
|
|
80
|
+
*/
|
|
81
|
+
captive: string;
|
|
82
|
+
constructor(m?: ModelArg<ERC20Wallet>);
|
|
83
|
+
}
|
|
84
|
+
/**
|
|
85
|
+
* @description ERC20 allowance model
|
|
86
|
+
* @summary Captures an approval relationship where an owner allows a spender to transfer up to a certain value from the owner's wallet.
|
|
87
|
+
* @param {ModelArg<Allowance>} [m] - Optional partial data or another instance to initialize the model
|
|
88
|
+
* @return {void}
|
|
89
|
+
* @class Allowance
|
|
90
|
+
* @example
|
|
91
|
+
* const allowance = new Allowance({ owner: "acct1", spender: "acct2", value: 50 });
|
|
92
|
+
* @mermaid
|
|
93
|
+
* sequenceDiagram
|
|
94
|
+
* participant App
|
|
95
|
+
* App->>App: new Allowance({ owner, spender, value })
|
|
96
|
+
*/
|
|
97
|
+
export declare class Allowance extends BaseModel {
|
|
98
|
+
/**
|
|
99
|
+
* @description Owner wallet identifier
|
|
100
|
+
* @summary Wallet that authorizes the allowance
|
|
101
|
+
*/
|
|
102
|
+
owner: string;
|
|
103
|
+
/**
|
|
104
|
+
* @description Spender wallet identifier
|
|
105
|
+
* @summary Wallet allowed to spend up to the approved value from the owner
|
|
106
|
+
*/
|
|
107
|
+
spender: string;
|
|
108
|
+
/**
|
|
109
|
+
* @description Approved value
|
|
110
|
+
* @summary Maximum token amount the spender may transfer on behalf of the owner
|
|
111
|
+
*/
|
|
112
|
+
value: number;
|
|
113
|
+
constructor(m?: ModelArg<Allowance>);
|
|
114
|
+
}
|
|
@@ -0,0 +1,114 @@
|
|
|
1
|
+
import { BaseModel } from "@decaf-ts/core";
|
|
2
|
+
import { type ModelArg } from "@decaf-ts/decorator-validation";
|
|
3
|
+
/**
|
|
4
|
+
* @description ERC20 token metadata model
|
|
5
|
+
* @summary Represents an ERC20 token definition within the Fabric ERC20 sample, including name, symbol, decimals, and the owning identity. Used to define the unique token managed by the contract.
|
|
6
|
+
* @param {ModelArg<ERC20Token>} [m] - Optional partial data or another instance to initialize the model
|
|
7
|
+
* @return {void}
|
|
8
|
+
* @class ERC20Token
|
|
9
|
+
* @example
|
|
10
|
+
* const token = new ERC20Token({ name: "MyToken", symbol: "MTK", decimals: 18, owner: "x509::..." });
|
|
11
|
+
* // Persist through a repository: await repo.create(token, ctx)
|
|
12
|
+
* @mermaid
|
|
13
|
+
* sequenceDiagram
|
|
14
|
+
* participant App
|
|
15
|
+
* participant Repo
|
|
16
|
+
* participant Adapter
|
|
17
|
+
* App->>Repo: create(new ERC20Token({...}), ctx)
|
|
18
|
+
* Repo->>Adapter: create(table, id=name, record, flags)
|
|
19
|
+
* Adapter-->>Repo: stored
|
|
20
|
+
* Repo-->>App: model
|
|
21
|
+
*/
|
|
22
|
+
export declare class ERC20Token extends BaseModel {
|
|
23
|
+
/**
|
|
24
|
+
* @description Token unique name
|
|
25
|
+
* @summary Serves as the primary key for the ERC20 token definition; typically a human-readable identifier
|
|
26
|
+
*/
|
|
27
|
+
name: string;
|
|
28
|
+
/**
|
|
29
|
+
* @description Owning identity of the token
|
|
30
|
+
* @summary X.509 subject or MSP identity string that denotes who owns/controls the token definition
|
|
31
|
+
*/
|
|
32
|
+
owner: string;
|
|
33
|
+
/**
|
|
34
|
+
* @description Token symbol
|
|
35
|
+
* @summary Short ticker-like symbol used to represent the token (e.g., MTK)
|
|
36
|
+
*/
|
|
37
|
+
symbol: string;
|
|
38
|
+
/**
|
|
39
|
+
* @description Decimal precision for token amounts
|
|
40
|
+
* @summary Number of digits after the decimal separator used when formatting token balances
|
|
41
|
+
*/
|
|
42
|
+
decimals: number;
|
|
43
|
+
constructor(m?: ModelArg<ERC20Wallet>);
|
|
44
|
+
}
|
|
45
|
+
/**
|
|
46
|
+
* @description ERC20 wallet model
|
|
47
|
+
* @summary Represents a holder account for an ERC20 token within the Fabric network, tracking balance and token association.
|
|
48
|
+
* @param {ModelArg<ERC20Wallet>} [m] - Optional partial data or another instance to initialize the model
|
|
49
|
+
* @return {void}
|
|
50
|
+
* @class ERC20Wallet
|
|
51
|
+
* @example
|
|
52
|
+
* const wallet = new ERC20Wallet({ id: "acct1", token: "MyToken", balance: 1000 });
|
|
53
|
+
* // Update balance via repository: await repo.update(wallet, ctx)
|
|
54
|
+
* @mermaid
|
|
55
|
+
* sequenceDiagram
|
|
56
|
+
* participant App
|
|
57
|
+
* participant Repo
|
|
58
|
+
* App->>Repo: read("acct1", ctx)
|
|
59
|
+
* Repo-->>App: ERC20Wallet
|
|
60
|
+
*/
|
|
61
|
+
export declare class ERC20Wallet extends BaseModel {
|
|
62
|
+
/**
|
|
63
|
+
* @description Wallet unique identifier
|
|
64
|
+
* @summary Primary key for the wallet; commonly references an account or identity
|
|
65
|
+
*/
|
|
66
|
+
id: string;
|
|
67
|
+
/**
|
|
68
|
+
* @description Associated token name
|
|
69
|
+
* @summary References the ERC20Token this wallet holds; maintained as a relationship for cascading updates/deletes
|
|
70
|
+
*/
|
|
71
|
+
token: string;
|
|
72
|
+
/**
|
|
73
|
+
* @description Token balance for this wallet
|
|
74
|
+
* @summary Current amount of the associated token held by this wallet
|
|
75
|
+
*/
|
|
76
|
+
balance: number;
|
|
77
|
+
/**
|
|
78
|
+
* @description Captive flag or identifier
|
|
79
|
+
* @summary Optional field used by some flows to mark non-transferable funds or managed custody
|
|
80
|
+
*/
|
|
81
|
+
captive: string;
|
|
82
|
+
constructor(m?: ModelArg<ERC20Wallet>);
|
|
83
|
+
}
|
|
84
|
+
/**
|
|
85
|
+
* @description ERC20 allowance model
|
|
86
|
+
* @summary Captures an approval relationship where an owner allows a spender to transfer up to a certain value from the owner's wallet.
|
|
87
|
+
* @param {ModelArg<Allowance>} [m] - Optional partial data or another instance to initialize the model
|
|
88
|
+
* @return {void}
|
|
89
|
+
* @class Allowance
|
|
90
|
+
* @example
|
|
91
|
+
* const allowance = new Allowance({ owner: "acct1", spender: "acct2", value: 50 });
|
|
92
|
+
* @mermaid
|
|
93
|
+
* sequenceDiagram
|
|
94
|
+
* participant App
|
|
95
|
+
* App->>App: new Allowance({ owner, spender, value })
|
|
96
|
+
*/
|
|
97
|
+
export declare class Allowance extends BaseModel {
|
|
98
|
+
/**
|
|
99
|
+
* @description Owner wallet identifier
|
|
100
|
+
* @summary Wallet that authorizes the allowance
|
|
101
|
+
*/
|
|
102
|
+
owner: string;
|
|
103
|
+
/**
|
|
104
|
+
* @description Spender wallet identifier
|
|
105
|
+
* @summary Wallet allowed to spend up to the approved value from the owner
|
|
106
|
+
*/
|
|
107
|
+
spender: string;
|
|
108
|
+
/**
|
|
109
|
+
* @description Approved value
|
|
110
|
+
* @summary Maximum token amount the spender may transfer on behalf of the owner
|
|
111
|
+
*/
|
|
112
|
+
value: number;
|
|
113
|
+
constructor(m?: ModelArg<Allowance>);
|
|
114
|
+
}
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @description Contracts submodule for Hyperledger Fabric integration
|
|
3
|
+
* @summary Aggregates chaincode-side building blocks including repositories, sequences, adapters, and ERC20 helpers. This entrypoint re-exports contract-related elements such as {@link FabricContractRepository},, and CRUD/ERC20 utilities for composing Fabric contracts.
|
|
4
|
+
* @namespace contracts
|
|
5
|
+
* @memberOf module:for-fabric
|
|
6
|
+
*/
|
|
7
|
+
import "./overrides";
|
|
8
|
+
export * from "./overrides.cjs";
|
|
9
|
+
export * from "./auth/index.cjs";
|
|
10
|
+
export * from "./crud/index.cjs";
|
|
11
|
+
export * from "./erc20/index.cjs";
|
|
12
|
+
export * from "./ContractAdapter.cjs";
|
|
13
|
+
export * from "./ContractContext.cjs";
|
|
14
|
+
export * from "./FabricContractDispatch.cjs";
|
|
15
|
+
export * from "./FabricContractPaginator.cjs";
|
|
16
|
+
export * from "./FabricContractRepository.cjs";
|
|
17
|
+
export * from "./FabricContractRepositoryObservableHandler.cjs";
|
|
18
|
+
export * from "./logging.cjs";
|
|
19
|
+
export * from "./types.cjs";
|
|
20
|
+
export * from "./MigrationContract.cjs";
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @description Contracts submodule for Hyperledger Fabric integration
|
|
3
|
+
* @summary Aggregates chaincode-side building blocks including repositories, sequences, adapters, and ERC20 helpers. This entrypoint re-exports contract-related elements such as {@link FabricContractRepository},, and CRUD/ERC20 utilities for composing Fabric contracts.
|
|
4
|
+
* @namespace contracts
|
|
5
|
+
* @memberOf module:for-fabric
|
|
6
|
+
*/
|
|
7
|
+
import "./overrides";
|
|
8
|
+
export * from "./overrides.js";
|
|
9
|
+
export * from "./auth/index.js";
|
|
10
|
+
export * from "./crud/index.js";
|
|
11
|
+
export * from "./erc20/index.js";
|
|
12
|
+
export * from "./ContractAdapter.js";
|
|
13
|
+
export * from "./ContractContext.js";
|
|
14
|
+
export * from "./FabricContractDispatch.js";
|
|
15
|
+
export * from "./FabricContractPaginator.js";
|
|
16
|
+
export * from "./FabricContractRepository.js";
|
|
17
|
+
export * from "./FabricContractRepositoryObservableHandler.js";
|
|
18
|
+
export * from "./logging.js";
|
|
19
|
+
export * from "./types.js";
|
|
20
|
+
export * from "./MigrationContract.js";
|
|
@@ -0,0 +1,54 @@
|
|
|
1
|
+
import { LogLevel, LogMeta, MiniLogger, StringLike } from "@decaf-ts/logging";
|
|
2
|
+
import { LoggingConfig } from "@decaf-ts/logging";
|
|
3
|
+
import { Context as Ctx } from "fabric-contract-api";
|
|
4
|
+
/**
|
|
5
|
+
* @description Logger implementation for Fabric chaincode contracts
|
|
6
|
+
* @summary Adapts the standard logging interface to work with Fabric's chaincode context
|
|
7
|
+
*
|
|
8
|
+
* @param {string} context - The logging context name
|
|
9
|
+
* @param {Partial<LoggingConfig> | undefined} conf - Optional logging configuration
|
|
10
|
+
* @param {Ctx} ctx - The Fabric chaincode context
|
|
11
|
+
*
|
|
12
|
+
* @class ContractLogger
|
|
13
|
+
* @extends {MiniLogger}
|
|
14
|
+
* @example
|
|
15
|
+
* ```typescript
|
|
16
|
+
* // In a Fabric chaincode contract
|
|
17
|
+
* import { ContractLogger } from '@decaf-ts/for-fabric';
|
|
18
|
+
*
|
|
19
|
+
* export class MyContract extends Contract {
|
|
20
|
+
* @Transaction()
|
|
21
|
+
* async myFunction(ctx: Context): Promise<void> {
|
|
22
|
+
* const logger = new ContractLogger('MyContract', { level: 'info' }, ctx);
|
|
23
|
+
*
|
|
24
|
+
* logger.info('Processing transaction');
|
|
25
|
+
* logger.debug('Transaction details:', { ... });
|
|
26
|
+
*
|
|
27
|
+
* // Do something
|
|
28
|
+
*
|
|
29
|
+
* logger.info('Transaction complete');
|
|
30
|
+
* }
|
|
31
|
+
* }
|
|
32
|
+
* ```
|
|
33
|
+
*/
|
|
34
|
+
export declare class ContractLogger extends MiniLogger {
|
|
35
|
+
protected sink: {
|
|
36
|
+
verbose: (msg: string) => void;
|
|
37
|
+
info: (msg: string) => void;
|
|
38
|
+
debug: (msg: string) => void;
|
|
39
|
+
error: (msg: string) => void;
|
|
40
|
+
trace: (msg: string) => void;
|
|
41
|
+
warn: (msg: string) => void;
|
|
42
|
+
silly: (msg: string) => void;
|
|
43
|
+
};
|
|
44
|
+
constructor(context: string, conf: Partial<LoggingConfig> | undefined, ctx?: Ctx);
|
|
45
|
+
/**
|
|
46
|
+
* @description Logs a message at the specified level
|
|
47
|
+
* @summary Overrides the base log method to use the Fabric context's logger
|
|
48
|
+
* @param {LogLevel} level - The log level
|
|
49
|
+
* @param {StringLike | Error} msg - The message to log
|
|
50
|
+
* @param {Error} [stack] - Optional stack trace for errors
|
|
51
|
+
* @return {void}
|
|
52
|
+
*/
|
|
53
|
+
protected log(level: LogLevel, msg: StringLike | Error, error?: Error, meta?: LogMeta): void;
|
|
54
|
+
}
|
|
@@ -0,0 +1,54 @@
|
|
|
1
|
+
import { LogLevel, LogMeta, MiniLogger, StringLike } from "@decaf-ts/logging";
|
|
2
|
+
import { LoggingConfig } from "@decaf-ts/logging";
|
|
3
|
+
import { Context as Ctx } from "fabric-contract-api";
|
|
4
|
+
/**
|
|
5
|
+
* @description Logger implementation for Fabric chaincode contracts
|
|
6
|
+
* @summary Adapts the standard logging interface to work with Fabric's chaincode context
|
|
7
|
+
*
|
|
8
|
+
* @param {string} context - The logging context name
|
|
9
|
+
* @param {Partial<LoggingConfig> | undefined} conf - Optional logging configuration
|
|
10
|
+
* @param {Ctx} ctx - The Fabric chaincode context
|
|
11
|
+
*
|
|
12
|
+
* @class ContractLogger
|
|
13
|
+
* @extends {MiniLogger}
|
|
14
|
+
* @example
|
|
15
|
+
* ```typescript
|
|
16
|
+
* // In a Fabric chaincode contract
|
|
17
|
+
* import { ContractLogger } from '@decaf-ts/for-fabric';
|
|
18
|
+
*
|
|
19
|
+
* export class MyContract extends Contract {
|
|
20
|
+
* @Transaction()
|
|
21
|
+
* async myFunction(ctx: Context): Promise<void> {
|
|
22
|
+
* const logger = new ContractLogger('MyContract', { level: 'info' }, ctx);
|
|
23
|
+
*
|
|
24
|
+
* logger.info('Processing transaction');
|
|
25
|
+
* logger.debug('Transaction details:', { ... });
|
|
26
|
+
*
|
|
27
|
+
* // Do something
|
|
28
|
+
*
|
|
29
|
+
* logger.info('Transaction complete');
|
|
30
|
+
* }
|
|
31
|
+
* }
|
|
32
|
+
* ```
|
|
33
|
+
*/
|
|
34
|
+
export declare class ContractLogger extends MiniLogger {
|
|
35
|
+
protected sink: {
|
|
36
|
+
verbose: (msg: string) => void;
|
|
37
|
+
info: (msg: string) => void;
|
|
38
|
+
debug: (msg: string) => void;
|
|
39
|
+
error: (msg: string) => void;
|
|
40
|
+
trace: (msg: string) => void;
|
|
41
|
+
warn: (msg: string) => void;
|
|
42
|
+
silly: (msg: string) => void;
|
|
43
|
+
};
|
|
44
|
+
constructor(context: string, conf: Partial<LoggingConfig> | undefined, ctx?: Ctx);
|
|
45
|
+
/**
|
|
46
|
+
* @description Logs a message at the specified level
|
|
47
|
+
* @summary Overrides the base log method to use the Fabric context's logger
|
|
48
|
+
* @param {LogLevel} level - The log level
|
|
49
|
+
* @param {StringLike | Error} msg - The message to log
|
|
50
|
+
* @param {Error} [stack] - Optional stack trace for errors
|
|
51
|
+
* @return {void}
|
|
52
|
+
*/
|
|
53
|
+
protected log(level: LogLevel, msg: StringLike | Error, error?: Error, meta?: LogMeta): void;
|
|
54
|
+
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -0,0 +1,38 @@
|
|
|
1
|
+
import { ChaincodeStub, ClientIdentity } from "fabric-shim-api";
|
|
2
|
+
import { Logger } from "@decaf-ts/logging";
|
|
3
|
+
import { FabricFlags } from "../shared/index.cjs";
|
|
4
|
+
/**
|
|
5
|
+
* @description Flags for Fabric chaincode contract operations
|
|
6
|
+
* @summary Extends repository flags with Fabric-specific context elements available during Fabric chaincode execution, such as the ChaincodeStub, ClientIdentity and a request-scoped Logger.
|
|
7
|
+
* @template T
|
|
8
|
+
* @param {RepositoryFlags} [base] - Base repository flags that these Fabric-specific flags extend
|
|
9
|
+
* @return {void}
|
|
10
|
+
* @interface FabricContractFlags
|
|
11
|
+
* @memberOf module:fabric.contracts
|
|
12
|
+
*/
|
|
13
|
+
export interface FabricContractFlags extends FabricFlags {
|
|
14
|
+
/**
|
|
15
|
+
* @description Chaincode stub for interacting with the ledger
|
|
16
|
+
*/
|
|
17
|
+
stub: ChaincodeStub;
|
|
18
|
+
/**
|
|
19
|
+
* @description Client identity for the transaction submitter
|
|
20
|
+
*/
|
|
21
|
+
identity: ClientIdentity;
|
|
22
|
+
roles?: string[];
|
|
23
|
+
cert: string;
|
|
24
|
+
segregateWrite?: Record<string, string[]>;
|
|
25
|
+
segregateRead?: string | string[];
|
|
26
|
+
forceSegregateWrite?: boolean;
|
|
27
|
+
fullySegregated?: boolean;
|
|
28
|
+
sequenceSegregation?: Map<string, {
|
|
29
|
+
fullySegregated: boolean;
|
|
30
|
+
collections: string[];
|
|
31
|
+
}>;
|
|
32
|
+
segregatedData?: Record<string, Record<string, any>>;
|
|
33
|
+
segregateReadStack?: any[];
|
|
34
|
+
/**
|
|
35
|
+
* @description Logger instance for the contract
|
|
36
|
+
*/
|
|
37
|
+
logger: Logger;
|
|
38
|
+
}
|
|
@@ -0,0 +1,38 @@
|
|
|
1
|
+
import { ChaincodeStub, ClientIdentity } from "fabric-shim-api";
|
|
2
|
+
import { Logger } from "@decaf-ts/logging";
|
|
3
|
+
import { FabricFlags } from "../shared/index.js";
|
|
4
|
+
/**
|
|
5
|
+
* @description Flags for Fabric chaincode contract operations
|
|
6
|
+
* @summary Extends repository flags with Fabric-specific context elements available during Fabric chaincode execution, such as the ChaincodeStub, ClientIdentity and a request-scoped Logger.
|
|
7
|
+
* @template T
|
|
8
|
+
* @param {RepositoryFlags} [base] - Base repository flags that these Fabric-specific flags extend
|
|
9
|
+
* @return {void}
|
|
10
|
+
* @interface FabricContractFlags
|
|
11
|
+
* @memberOf module:fabric.contracts
|
|
12
|
+
*/
|
|
13
|
+
export interface FabricContractFlags extends FabricFlags {
|
|
14
|
+
/**
|
|
15
|
+
* @description Chaincode stub for interacting with the ledger
|
|
16
|
+
*/
|
|
17
|
+
stub: ChaincodeStub;
|
|
18
|
+
/**
|
|
19
|
+
* @description Client identity for the transaction submitter
|
|
20
|
+
*/
|
|
21
|
+
identity: ClientIdentity;
|
|
22
|
+
roles?: string[];
|
|
23
|
+
cert: string;
|
|
24
|
+
segregateWrite?: Record<string, string[]>;
|
|
25
|
+
segregateRead?: string | string[];
|
|
26
|
+
forceSegregateWrite?: boolean;
|
|
27
|
+
fullySegregated?: boolean;
|
|
28
|
+
sequenceSegregation?: Map<string, {
|
|
29
|
+
fullySegregated: boolean;
|
|
30
|
+
collections: string[];
|
|
31
|
+
}>;
|
|
32
|
+
segregatedData?: Record<string, Record<string, any>>;
|
|
33
|
+
segregateReadStack?: any[];
|
|
34
|
+
/**
|
|
35
|
+
* @description Logger instance for the contract
|
|
36
|
+
*/
|
|
37
|
+
logger: Logger;
|
|
38
|
+
}
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @description Hyperledger Fabric Module for Decaf-ts
|
|
3
|
+
* @summary Provides client-side and chaincode-side tooling for building Hyperledger Fabric applications with Decaf-ts. Exposes client adapters, repositories, contract adapters, sequences, utilities, and shared types to streamline development and interaction with Fabric networks. See {@link module:fabric.client}, {@link module:fabric.contracts}, and {@link module:fabric.shared} for grouped exports.
|
|
4
|
+
* @module for-fabric
|
|
5
|
+
*/
|
|
6
|
+
export * from "./client/index.cjs";
|
|
7
|
+
export * from "./shared/index.cjs";
|
|
8
|
+
export * from "./version.cjs";
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @description Hyperledger Fabric Module for Decaf-ts
|
|
3
|
+
* @summary Provides client-side and chaincode-side tooling for building Hyperledger Fabric applications with Decaf-ts. Exposes client adapters, repositories, contract adapters, sequences, utilities, and shared types to streamline development and interaction with Fabric networks. See {@link module:fabric.client}, {@link module:fabric.contracts}, and {@link module:fabric.shared} for grouped exports.
|
|
4
|
+
* @module for-fabric
|
|
5
|
+
*/
|
|
6
|
+
export * from "./client/index.js";
|
|
7
|
+
export * from "./shared/index.js";
|
|
8
|
+
export * from "./version.js";
|