nem-libray 2.0.0-RC4
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/LICENSE +21 -0
- package/README.md +30 -0
- package/dist/index.d.ts +4 -0
- package/dist/index.js +38 -0
- package/dist/index.js.map +1 -0
- package/dist/src/NEMLibrary.d.ts +25 -0
- package/dist/src/NEMLibrary.js +69 -0
- package/dist/src/NEMLibrary.js.map +1 -0
- package/dist/src/infrastrcture.d.ts +13 -0
- package/dist/src/infrastrcture.js +44 -0
- package/dist/src/infrastrcture.js.map +1 -0
- package/dist/src/infrastructure/AccountHttp.d.ts +204 -0
- package/dist/src/infrastructure/AccountHttp.js +415 -0
- package/dist/src/infrastructure/AccountHttp.js.map +1 -0
- package/dist/src/infrastructure/AccountListener.d.ts +20 -0
- package/dist/src/infrastructure/AccountListener.js +71 -0
- package/dist/src/infrastructure/AccountListener.js.map +1 -0
- package/dist/src/infrastructure/AllTransactionsPageable.d.ts +1 -0
- package/dist/src/infrastructure/AllTransactionsPageable.js +35 -0
- package/dist/src/infrastructure/AllTransactionsPageable.js.map +1 -0
- package/dist/src/infrastructure/AssetHttp.d.ts +36 -0
- package/dist/src/infrastructure/AssetHttp.js +85 -0
- package/dist/src/infrastructure/AssetHttp.js.map +1 -0
- package/dist/src/infrastructure/BlockHttp.d.ts +14 -0
- package/dist/src/infrastructure/BlockHttp.js +54 -0
- package/dist/src/infrastructure/BlockHttp.js.map +1 -0
- package/dist/src/infrastructure/BlockchainListener.d.ts +24 -0
- package/dist/src/infrastructure/BlockchainListener.js +93 -0
- package/dist/src/infrastructure/BlockchainListener.js.map +1 -0
- package/dist/src/infrastructure/ChainHttp.d.ts +23 -0
- package/dist/src/infrastructure/ChainHttp.js +68 -0
- package/dist/src/infrastructure/ChainHttp.js.map +1 -0
- package/dist/src/infrastructure/ConfirmedTransactionListener.d.ts +20 -0
- package/dist/src/infrastructure/ConfirmedTransactionListener.js +76 -0
- package/dist/src/infrastructure/ConfirmedTransactionListener.js.map +1 -0
- package/dist/src/infrastructure/HarvestInfoPageable.d.ts +1 -0
- package/dist/src/infrastructure/HarvestInfoPageable.js +52 -0
- package/dist/src/infrastructure/HarvestInfoPageable.js.map +1 -0
- package/dist/src/infrastructure/HttpEndpoint.d.ts +15 -0
- package/dist/src/infrastructure/HttpEndpoint.js +132 -0
- package/dist/src/infrastructure/HttpEndpoint.js.map +1 -0
- package/dist/src/infrastructure/IncomingTransactionsPageable.d.ts +1 -0
- package/dist/src/infrastructure/IncomingTransactionsPageable.js +29 -0
- package/dist/src/infrastructure/IncomingTransactionsPageable.js.map +1 -0
- package/dist/src/infrastructure/Listener.d.ts +14 -0
- package/dist/src/infrastructure/Listener.js +101 -0
- package/dist/src/infrastructure/Listener.js.map +1 -0
- package/dist/src/infrastructure/NamespaceHttp.d.ts +27 -0
- package/dist/src/infrastructure/NamespaceHttp.js +78 -0
- package/dist/src/infrastructure/NamespaceHttp.js.map +1 -0
- package/dist/src/infrastructure/NamespacesPageable.d.ts +1 -0
- package/dist/src/infrastructure/NamespacesPageable.js +28 -0
- package/dist/src/infrastructure/NamespacesPageable.js.map +1 -0
- package/dist/src/infrastructure/NodeHttp.d.ts +45 -0
- package/dist/src/infrastructure/NodeHttp.js +116 -0
- package/dist/src/infrastructure/NodeHttp.js.map +1 -0
- package/dist/src/infrastructure/OutgoingTransactionsPageable.d.ts +1 -0
- package/dist/src/infrastructure/OutgoingTransactionsPageable.js +59 -0
- package/dist/src/infrastructure/OutgoingTransactionsPageable.js.map +1 -0
- package/dist/src/infrastructure/Pageable.d.ts +10 -0
- package/dist/src/infrastructure/Pageable.js +55 -0
- package/dist/src/infrastructure/Pageable.js.map +1 -0
- package/dist/src/infrastructure/TransactionHttp.d.ts +20 -0
- package/dist/src/infrastructure/TransactionHttp.js +68 -0
- package/dist/src/infrastructure/TransactionHttp.js.map +1 -0
- package/dist/src/infrastructure/UnconfirmedTransactionListener.d.ts +20 -0
- package/dist/src/infrastructure/UnconfirmedTransactionListener.js +76 -0
- package/dist/src/infrastructure/UnconfirmedTransactionListener.js.map +1 -0
- package/dist/src/infrastructure/account/AccountHistoricalDataViewModelDTO.d.ts +1 -0
- package/dist/src/infrastructure/account/AccountHistoricalDataViewModelDTO.js +26 -0
- package/dist/src/infrastructure/account/AccountHistoricalDataViewModelDTO.js.map +1 -0
- package/dist/src/infrastructure/account/AccountImportanceViewModelDTO.d.ts +1 -0
- package/dist/src/infrastructure/account/AccountImportanceViewModelDTO.js +26 -0
- package/dist/src/infrastructure/account/AccountImportanceViewModelDTO.js.map +1 -0
- package/dist/src/infrastructure/account/AccountInfoDTO.d.ts +10 -0
- package/dist/src/infrastructure/account/AccountInfoDTO.js +26 -0
- package/dist/src/infrastructure/account/AccountInfoDTO.js.map +1 -0
- package/dist/src/infrastructure/account/AccountMetaDataDTO.d.ts +1 -0
- package/dist/src/infrastructure/account/AccountMetaDataDTO.js +26 -0
- package/dist/src/infrastructure/account/AccountMetaDataDTO.js.map +1 -0
- package/dist/src/infrastructure/account/AccountMetaDataPairDTO.d.ts +1 -0
- package/dist/src/infrastructure/account/AccountMetaDataPairDTO.js +26 -0
- package/dist/src/infrastructure/account/AccountMetaDataPairDTO.js.map +1 -0
- package/dist/src/infrastructure/account/AccountPrivateKeyTransactionsPageDTO.d.ts +1 -0
- package/dist/src/infrastructure/account/AccountPrivateKeyTransactionsPageDTO.js +26 -0
- package/dist/src/infrastructure/account/AccountPrivateKeyTransactionsPageDTO.js.map +1 -0
- package/dist/src/infrastructure/account/HarvestInfoDTO.d.ts +1 -0
- package/dist/src/infrastructure/account/HarvestInfoDTO.js +26 -0
- package/dist/src/infrastructure/account/HarvestInfoDTO.js.map +1 -0
- package/dist/src/infrastructure/account/KeyPairViewModelDTO.d.ts +1 -0
- package/dist/src/infrastructure/account/KeyPairViewModelDTO.js +26 -0
- package/dist/src/infrastructure/account/KeyPairViewModelDTO.js.map +1 -0
- package/dist/src/infrastructure/account/PrivateKeyDTO.d.ts +1 -0
- package/dist/src/infrastructure/account/PrivateKeyDTO.js +26 -0
- package/dist/src/infrastructure/account/PrivateKeyDTO.js.map +1 -0
- package/dist/src/infrastructure/asset/MosaicDTO.d.ts +1 -0
- package/dist/src/infrastructure/asset/MosaicDTO.js +26 -0
- package/dist/src/infrastructure/asset/MosaicDTO.js.map +1 -0
- package/dist/src/infrastructure/asset/MosaicDefinitionDTO.d.ts +1 -0
- package/dist/src/infrastructure/asset/MosaicDefinitionDTO.js +26 -0
- package/dist/src/infrastructure/asset/MosaicDefinitionDTO.js.map +1 -0
- package/dist/src/infrastructure/asset/MosaicDefinitionMetaDataPairDTO.d.ts +1 -0
- package/dist/src/infrastructure/asset/MosaicDefinitionMetaDataPairDTO.js +26 -0
- package/dist/src/infrastructure/asset/MosaicDefinitionMetaDataPairDTO.js.map +1 -0
- package/dist/src/infrastructure/asset/MosaicIdDTO.d.ts +1 -0
- package/dist/src/infrastructure/asset/MosaicIdDTO.js +26 -0
- package/dist/src/infrastructure/asset/MosaicIdDTO.js.map +1 -0
- package/dist/src/infrastructure/asset/MosaicLevyDTO.d.ts +1 -0
- package/dist/src/infrastructure/asset/MosaicLevyDTO.js +26 -0
- package/dist/src/infrastructure/asset/MosaicLevyDTO.js.map +1 -0
- package/dist/src/infrastructure/asset/MosaicPropertyDTO.d.ts +8 -0
- package/dist/src/infrastructure/asset/MosaicPropertyDTO.js +26 -0
- package/dist/src/infrastructure/asset/MosaicPropertyDTO.js.map +1 -0
- package/dist/src/infrastructure/blockchain/BlockChainScoreDTO.d.ts +1 -0
- package/dist/src/infrastructure/blockchain/BlockChainScoreDTO.js +26 -0
- package/dist/src/infrastructure/blockchain/BlockChainScoreDTO.js.map +1 -0
- package/dist/src/infrastructure/blockchain/BlockDTO.d.ts +6 -0
- package/dist/src/infrastructure/blockchain/BlockDTO.js +26 -0
- package/dist/src/infrastructure/blockchain/BlockDTO.js.map +1 -0
- package/dist/src/infrastructure/blockchain/BlockHeightDTO.d.ts +1 -0
- package/dist/src/infrastructure/blockchain/BlockHeightDTO.js +26 -0
- package/dist/src/infrastructure/blockchain/BlockHeightDTO.js.map +1 -0
- package/dist/src/infrastructure/blockchain/ExplorerBlockViewModelDTO.d.ts +1 -0
- package/dist/src/infrastructure/blockchain/ExplorerBlockViewModelDTO.js +26 -0
- package/dist/src/infrastructure/blockchain/ExplorerBlockViewModelDTO.js.map +1 -0
- package/dist/src/infrastructure/debug/AuditCollectionDTO.d.ts +22 -0
- package/dist/src/infrastructure/debug/AuditCollectionDTO.js +26 -0
- package/dist/src/infrastructure/debug/AuditCollectionDTO.js.map +1 -0
- package/dist/src/infrastructure/debug/NemAsyncTimerVisitorDTO.d.ts +1 -0
- package/dist/src/infrastructure/debug/NemAsyncTimerVisitorDTO.js +26 -0
- package/dist/src/infrastructure/debug/NemAsyncTimerVisitorDTO.js.map +1 -0
- package/dist/src/infrastructure/debug/NisNodeInfoDTO.d.ts +1 -0
- package/dist/src/infrastructure/debug/NisNodeInfoDTO.js +26 -0
- package/dist/src/infrastructure/debug/NisNodeInfoDTO.js.map +1 -0
- package/dist/src/infrastructure/debug/TimeSynchronizationResultDTO.d.ts +1 -0
- package/dist/src/infrastructure/debug/TimeSynchronizationResultDTO.js +26 -0
- package/dist/src/infrastructure/debug/TimeSynchronizationResultDTO.js.map +1 -0
- package/dist/src/infrastructure/namespace/NamespaceDTO.d.ts +1 -0
- package/dist/src/infrastructure/namespace/NamespaceDTO.js +26 -0
- package/dist/src/infrastructure/namespace/NamespaceDTO.js.map +1 -0
- package/dist/src/infrastructure/namespace/NamespaceMetaDataPairDTO.d.ts +1 -0
- package/dist/src/infrastructure/namespace/NamespaceMetaDataPairDTO.js +26 -0
- package/dist/src/infrastructure/namespace/NamespaceMetaDataPairDTO.js.map +1 -0
- package/dist/src/infrastructure/node/ApplicationMetaDataDTO.d.ts +1 -0
- package/dist/src/infrastructure/node/ApplicationMetaDataDTO.js +26 -0
- package/dist/src/infrastructure/node/ApplicationMetaDataDTO.js.map +1 -0
- package/dist/src/infrastructure/node/BootNodeRequestDTO.d.ts +1 -0
- package/dist/src/infrastructure/node/BootNodeRequestDTO.js +26 -0
- package/dist/src/infrastructure/node/BootNodeRequestDTO.js.map +1 -0
- package/dist/src/infrastructure/node/CommunicationTimeStampsDTO.d.ts +1 -0
- package/dist/src/infrastructure/node/CommunicationTimeStampsDTO.js +26 -0
- package/dist/src/infrastructure/node/CommunicationTimeStampsDTO.js.map +1 -0
- package/dist/src/infrastructure/node/ExtendedNodeExperiencePairDTO.d.ts +1 -0
- package/dist/src/infrastructure/node/ExtendedNodeExperiencePairDTO.js +26 -0
- package/dist/src/infrastructure/node/ExtendedNodeExperiencePairDTO.js.map +1 -0
- package/dist/src/infrastructure/node/NodeCollectionDTO.d.ts +1 -0
- package/dist/src/infrastructure/node/NodeCollectionDTO.js +26 -0
- package/dist/src/infrastructure/node/NodeCollectionDTO.js.map +1 -0
- package/dist/src/infrastructure/node/NodeDTO.d.ts +19 -0
- package/dist/src/infrastructure/node/NodeDTO.js +26 -0
- package/dist/src/infrastructure/node/NodeDTO.js.map +1 -0
- package/dist/src/infrastructure/transaction/CreateTransactionFromDTO.d.ts +1 -0
- package/dist/src/infrastructure/transaction/CreateTransactionFromDTO.js +162 -0
- package/dist/src/infrastructure/transaction/CreateTransactionFromDTO.js.map +1 -0
- package/dist/src/infrastructure/transaction/CreateUnconfirmedTransactionFromDTO.d.ts +1 -0
- package/dist/src/infrastructure/transaction/CreateUnconfirmedTransactionFromDTO.js +104 -0
- package/dist/src/infrastructure/transaction/CreateUnconfirmedTransactionFromDTO.js.map +1 -0
- package/dist/src/infrastructure/transaction/ErrorObjectDTO.d.ts +1 -0
- package/dist/src/infrastructure/transaction/ErrorObjectDTO.js +26 -0
- package/dist/src/infrastructure/transaction/ErrorObjectDTO.js.map +1 -0
- package/dist/src/infrastructure/transaction/HashData.d.ts +10 -0
- package/dist/src/infrastructure/transaction/HashData.js +26 -0
- package/dist/src/infrastructure/transaction/HashData.js.map +1 -0
- package/dist/src/infrastructure/transaction/ImportanceTransferTransactionDTO.d.ts +1 -0
- package/dist/src/infrastructure/transaction/ImportanceTransferTransactionDTO.js +26 -0
- package/dist/src/infrastructure/transaction/ImportanceTransferTransactionDTO.js.map +1 -0
- package/dist/src/infrastructure/transaction/Message.d.ts +1 -0
- package/dist/src/infrastructure/transaction/Message.js +26 -0
- package/dist/src/infrastructure/transaction/Message.js.map +1 -0
- package/dist/src/infrastructure/transaction/MosaicDefinitionCreationTransactionDTO.d.ts +1 -0
- package/dist/src/infrastructure/transaction/MosaicDefinitionCreationTransactionDTO.js +26 -0
- package/dist/src/infrastructure/transaction/MosaicDefinitionCreationTransactionDTO.js.map +1 -0
- package/dist/src/infrastructure/transaction/MosaicSupplyChangeTransactionDTO.d.ts +1 -0
- package/dist/src/infrastructure/transaction/MosaicSupplyChangeTransactionDTO.js +26 -0
- package/dist/src/infrastructure/transaction/MosaicSupplyChangeTransactionDTO.js.map +1 -0
- package/dist/src/infrastructure/transaction/MultisigAggregateModificationTransactionDTO.d.ts +1 -0
- package/dist/src/infrastructure/transaction/MultisigAggregateModificationTransactionDTO.js +26 -0
- package/dist/src/infrastructure/transaction/MultisigAggregateModificationTransactionDTO.js.map +1 -0
- package/dist/src/infrastructure/transaction/MultisigCosignatoryModificationDTO.d.ts +1 -0
- package/dist/src/infrastructure/transaction/MultisigCosignatoryModificationDTO.js +26 -0
- package/dist/src/infrastructure/transaction/MultisigCosignatoryModificationDTO.js.map +1 -0
- package/dist/src/infrastructure/transaction/MultisigSignatureTransactionDTO.d.ts +1 -0
- package/dist/src/infrastructure/transaction/MultisigSignatureTransactionDTO.js +26 -0
- package/dist/src/infrastructure/transaction/MultisigSignatureTransactionDTO.js.map +1 -0
- package/dist/src/infrastructure/transaction/MultisigTransactionDTO.d.ts +1 -0
- package/dist/src/infrastructure/transaction/MultisigTransactionDTO.js +26 -0
- package/dist/src/infrastructure/transaction/MultisigTransactionDTO.js.map +1 -0
- package/dist/src/infrastructure/transaction/NemAnnounceResultDTO.d.ts +1 -0
- package/dist/src/infrastructure/transaction/NemAnnounceResultDTO.js +26 -0
- package/dist/src/infrastructure/transaction/NemAnnounceResultDTO.js.map +1 -0
- package/dist/src/infrastructure/transaction/NemRequestResultDTO.d.ts +10 -0
- package/dist/src/infrastructure/transaction/NemRequestResultDTO.js +26 -0
- package/dist/src/infrastructure/transaction/NemRequestResultDTO.js.map +1 -0
- package/dist/src/infrastructure/transaction/ProvisionNamespaceTransactionDTO.d.ts +1 -0
- package/dist/src/infrastructure/transaction/ProvisionNamespaceTransactionDTO.js +26 -0
- package/dist/src/infrastructure/transaction/ProvisionNamespaceTransactionDTO.js.map +1 -0
- package/dist/src/infrastructure/transaction/RequestPrepareAnnonceDTO.d.ts +1 -0
- package/dist/src/infrastructure/transaction/RequestPrepareAnnonceDTO.js +26 -0
- package/dist/src/infrastructure/transaction/RequestPrepareAnnonceDTO.js.map +1 -0
- package/dist/src/infrastructure/transaction/TransactionDTO.d.ts +31 -0
- package/dist/src/infrastructure/transaction/TransactionDTO.js +26 -0
- package/dist/src/infrastructure/transaction/TransactionDTO.js.map +1 -0
- package/dist/src/infrastructure/transaction/TransactionMetaDataDTO.d.ts +1 -0
- package/dist/src/infrastructure/transaction/TransactionMetaDataDTO.js +26 -0
- package/dist/src/infrastructure/transaction/TransactionMetaDataDTO.js.map +1 -0
- package/dist/src/infrastructure/transaction/TransactionMetaDataPairDTO.d.ts +1 -0
- package/dist/src/infrastructure/transaction/TransactionMetaDataPairDTO.js +26 -0
- package/dist/src/infrastructure/transaction/TransactionMetaDataPairDTO.js.map +1 -0
- package/dist/src/infrastructure/transaction/TransferTransactionDTO.d.ts +1 -0
- package/dist/src/infrastructure/transaction/TransferTransactionDTO.js +26 -0
- package/dist/src/infrastructure/transaction/TransferTransactionDTO.js.map +1 -0
- package/dist/src/infrastructure/transaction/UnconfirmedTransactionMetaDataDTO.d.ts +1 -0
- package/dist/src/infrastructure/transaction/UnconfirmedTransactionMetaDataDTO.js +26 -0
- package/dist/src/infrastructure/transaction/UnconfirmedTransactionMetaDataDTO.js.map +1 -0
- package/dist/src/infrastructure/transaction/UnconfirmedTransactionMetaDataPairDTO.d.ts +1 -0
- package/dist/src/infrastructure/transaction/UnconfirmedTransactionMetaDataPairDTO.js +26 -0
- package/dist/src/infrastructure/transaction/UnconfirmedTransactionMetaDataPairDTO.js.map +1 -0
- package/dist/src/infrastructure/transaction/UnconfirmedTransactionsDTO.d.ts +1 -0
- package/dist/src/infrastructure/transaction/UnconfirmedTransactionsDTO.js +26 -0
- package/dist/src/infrastructure/transaction/UnconfirmedTransactionsDTO.js.map +1 -0
- package/dist/src/models/account/Account.d.ts +52 -0
- package/dist/src/models/account/Account.js +136 -0
- package/dist/src/models/account/Account.js.map +1 -0
- package/dist/src/models/account/AccountHarvestInfo.d.ts +25 -0
- package/dist/src/models/account/AccountHarvestInfo.js +55 -0
- package/dist/src/models/account/AccountHarvestInfo.js.map +1 -0
- package/dist/src/models/account/AccountHistoricalInfo.d.ts +25 -0
- package/dist/src/models/account/AccountHistoricalInfo.js +58 -0
- package/dist/src/models/account/AccountHistoricalInfo.js.map +1 -0
- package/dist/src/models/account/AccountImportanceInfo.d.ts +35 -0
- package/dist/src/models/account/AccountImportanceInfo.js +77 -0
- package/dist/src/models/account/AccountImportanceInfo.js.map +1 -0
- package/dist/src/models/account/AccountInfo.d.ts +79 -0
- package/dist/src/models/account/AccountInfo.js +129 -0
- package/dist/src/models/account/AccountInfo.js.map +1 -0
- package/dist/src/models/account/Address.d.ts +25 -0
- package/dist/src/models/account/Address.js +80 -0
- package/dist/src/models/account/Address.js.map +1 -0
- package/dist/src/models/account/Balance.d.ts +17 -0
- package/dist/src/models/account/Balance.js +42 -0
- package/dist/src/models/account/Balance.js.map +1 -0
- package/dist/src/models/account/NodeHarvestInfo.d.ts +10 -0
- package/dist/src/models/account/NodeHarvestInfo.js +38 -0
- package/dist/src/models/account/NodeHarvestInfo.js.map +1 -0
- package/dist/src/models/account/PublicAccount.d.ts +25 -0
- package/dist/src/models/account/PublicAccount.js +82 -0
- package/dist/src/models/account/PublicAccount.js.map +1 -0
- package/dist/src/models/asset/Asset.d.ts +20 -0
- package/dist/src/models/asset/Asset.js +59 -0
- package/dist/src/models/asset/Asset.js.map +1 -0
- package/dist/src/models/asset/AssetDefinition.d.ts +83 -0
- package/dist/src/models/asset/AssetDefinition.js +136 -0
- package/dist/src/models/asset/AssetDefinition.js.map +1 -0
- package/dist/src/models/asset/AssetId.d.ts +31 -0
- package/dist/src/models/asset/AssetId.js +77 -0
- package/dist/src/models/asset/AssetId.js.map +1 -0
- package/dist/src/models/asset/AssetLevy.d.ts +40 -0
- package/dist/src/models/asset/AssetLevy.js +76 -0
- package/dist/src/models/asset/AssetLevy.js.map +1 -0
- package/dist/src/models/asset/AssetTransferable.d.ts +65 -0
- package/dist/src/models/asset/AssetTransferable.js +88 -0
- package/dist/src/models/asset/AssetTransferable.js.map +1 -0
- package/dist/src/models/asset/XEM.d.ts +49 -0
- package/dist/src/models/asset/XEM.js +83 -0
- package/dist/src/models/asset/XEM.js.map +1 -0
- package/dist/src/models/blockchain/Block.d.ts +57 -0
- package/dist/src/models/blockchain/Block.js +81 -0
- package/dist/src/models/blockchain/Block.js.map +1 -0
- package/dist/src/models/namespace/Namespace.d.ts +23 -0
- package/dist/src/models/namespace/Namespace.js +64 -0
- package/dist/src/models/namespace/Namespace.js.map +1 -0
- package/dist/src/models/node/ExtendedNodeExperience.d.ts +34 -0
- package/dist/src/models/node/ExtendedNodeExperience.js +79 -0
- package/dist/src/models/node/ExtendedNodeExperience.js.map +1 -0
- package/dist/src/models/node/NetworkTypes.d.ts +17 -0
- package/dist/src/models/node/NetworkTypes.js +44 -0
- package/dist/src/models/node/NetworkTypes.js.map +1 -0
- package/dist/src/models/node/NisNodeInfo.d.ts +39 -0
- package/dist/src/models/node/NisNodeInfo.js +79 -0
- package/dist/src/models/node/NisNodeInfo.js.map +1 -0
- package/dist/src/models/node/Node.d.ts +76 -0
- package/dist/src/models/node/Node.js +131 -0
- package/dist/src/models/node/Node.js.map +1 -0
- package/dist/src/models/node/NodeCollection.d.ts +22 -0
- package/dist/src/models/node/NodeCollection.js +54 -0
- package/dist/src/models/node/NodeCollection.js.map +1 -0
- package/dist/src/models/transaction/AssetDefinitionCreationTransaction.d.ts +39 -0
- package/dist/src/models/transaction/AssetDefinitionCreationTransaction.js +94 -0
- package/dist/src/models/transaction/AssetDefinitionCreationTransaction.js.map +1 -0
- package/dist/src/models/transaction/AssetSupplyChangeTransaction.d.ts +48 -0
- package/dist/src/models/transaction/AssetSupplyChangeTransaction.js +94 -0
- package/dist/src/models/transaction/AssetSupplyChangeTransaction.js.map +1 -0
- package/dist/src/models/transaction/EncryptedMessage.d.ts +8 -0
- package/dist/src/models/transaction/EncryptedMessage.js +86 -0
- package/dist/src/models/transaction/EncryptedMessage.js.map +1 -0
- package/dist/src/models/transaction/HexMessage.d.ts +10 -0
- package/dist/src/models/transaction/HexMessage.js +37 -0
- package/dist/src/models/transaction/HexMessage.js.map +1 -0
- package/dist/src/models/transaction/ImportanceTransferTransaction.d.ts +45 -0
- package/dist/src/models/transaction/ImportanceTransferTransaction.js +92 -0
- package/dist/src/models/transaction/ImportanceTransferTransaction.js.map +1 -0
- package/dist/src/models/transaction/Message.d.ts +12 -0
- package/dist/src/models/transaction/Message.js +110 -0
- package/dist/src/models/transaction/Message.js.map +1 -0
- package/dist/src/models/transaction/MultisigAggregateModificationTransaction.d.ts +55 -0
- package/dist/src/models/transaction/MultisigAggregateModificationTransaction.js +112 -0
- package/dist/src/models/transaction/MultisigAggregateModificationTransaction.js.map +1 -0
- package/dist/src/models/transaction/MultisigSignatureTransaction.d.ts +35 -0
- package/dist/src/models/transaction/MultisigSignatureTransaction.js +92 -0
- package/dist/src/models/transaction/MultisigSignatureTransaction.js.map +1 -0
- package/dist/src/models/transaction/MultisigTransaction.d.ts +49 -0
- package/dist/src/models/transaction/MultisigTransaction.js +102 -0
- package/dist/src/models/transaction/MultisigTransaction.js.map +1 -0
- package/dist/src/models/transaction/NemAnnounceResult.d.ts +77 -0
- package/dist/src/models/transaction/NemAnnounceResult.js +66 -0
- package/dist/src/models/transaction/NemAnnounceResult.js.map +1 -0
- package/dist/src/models/transaction/PlainMessage.d.ts +19 -0
- package/dist/src/models/transaction/PlainMessage.js +77 -0
- package/dist/src/models/transaction/PlainMessage.js.map +1 -0
- package/dist/src/models/transaction/ProvisionNamespaceTransaction.d.ts +57 -0
- package/dist/src/models/transaction/ProvisionNamespaceTransaction.js +117 -0
- package/dist/src/models/transaction/ProvisionNamespaceTransaction.js.map +1 -0
- package/dist/src/models/transaction/SignedTransaction.d.ts +13 -0
- package/dist/src/models/transaction/SignedTransaction.js +26 -0
- package/dist/src/models/transaction/SignedTransaction.js.map +1 -0
- package/dist/src/models/transaction/TimeWindow.d.ts +24 -0
- package/dist/src/models/transaction/TimeWindow.js +84 -0
- package/dist/src/models/transaction/TimeWindow.js.map +1 -0
- package/dist/src/models/transaction/Transaction.d.ts +56 -0
- package/dist/src/models/transaction/Transaction.js +98 -0
- package/dist/src/models/transaction/Transaction.js.map +1 -0
- package/dist/src/models/transaction/TransactionInfo.d.ts +39 -0
- package/dist/src/models/transaction/TransactionInfo.js +60 -0
- package/dist/src/models/transaction/TransactionInfo.js.map +1 -0
- package/dist/src/models/transaction/TransactionTypes.d.ts +80 -0
- package/dist/src/models/transaction/TransactionTypes.js +159 -0
- package/dist/src/models/transaction/TransactionTypes.js.map +1 -0
- package/dist/src/models/transaction/TransferTransaction.d.ts +78 -0
- package/dist/src/models/transaction/TransferTransaction.js +176 -0
- package/dist/src/models/transaction/TransferTransaction.js.map +1 -0
- package/dist/src/models/wallet/BrainPassword.d.ts +11 -0
- package/dist/src/models/wallet/BrainPassword.js +42 -0
- package/dist/src/models/wallet/BrainPassword.js.map +1 -0
- package/dist/src/models/wallet/BrainWallet.d.ts +34 -0
- package/dist/src/models/wallet/BrainWallet.js +101 -0
- package/dist/src/models/wallet/BrainWallet.js.map +1 -0
- package/dist/src/models/wallet/EncryptedPrivateKey.d.ts +13 -0
- package/dist/src/models/wallet/EncryptedPrivateKey.js +56 -0
- package/dist/src/models/wallet/EncryptedPrivateKey.js.map +1 -0
- package/dist/src/models/wallet/Password.d.ts +14 -0
- package/dist/src/models/wallet/Password.js +41 -0
- package/dist/src/models/wallet/Password.js.map +1 -0
- package/dist/src/models/wallet/SimpleWallet.d.ts +47 -0
- package/dist/src/models/wallet/SimpleWallet.js +143 -0
- package/dist/src/models/wallet/SimpleWallet.js.map +1 -0
- package/dist/src/models/wallet/Wallet.d.ts +51 -0
- package/dist/src/models/wallet/Wallet.js +81 -0
- package/dist/src/models/wallet/Wallet.js.map +1 -0
- package/dist/src/models.d.ts +46 -0
- package/dist/src/models.js +74 -0
- package/dist/src/models.js.map +1 -0
- package/dist/src/services/AccountOwnedAssetService.d.ts +30 -0
- package/dist/src/services/AccountOwnedAssetService.js +63 -0
- package/dist/src/services/AccountOwnedAssetService.js.map +1 -0
- package/dist/src/services/AssetService.d.ts +23 -0
- package/dist/src/services/AssetService.js +87 -0
- package/dist/src/services/AssetService.js.map +1 -0
- package/dist/src/services/QRService.d.ts +66 -0
- package/dist/src/services/QRService.js +155 -0
- package/dist/src/services/QRService.js.map +1 -0
- package/dist/src/services.d.ts +3 -0
- package/dist/src/services.js +32 -0
- package/dist/src/services.js.map +1 -0
- package/dist/src/vendor/sockjs-0.3.4.d.ts +25 -0
- package/dist/src/vendor/sockjs-0.3.4.js +2516 -0
- package/dist/src/vendor/sockjs-0.3.4.min.js +27 -0
- package/package.json +87 -0
- package/z4bfo2p7.cjs +1 -0
@@ -0,0 +1,131 @@
|
|
1
|
+
"use strict";
|
2
|
+
/*
|
3
|
+
* The MIT License (MIT)
|
4
|
+
*
|
5
|
+
* Copyright (c) 2017 NEM
|
6
|
+
*
|
7
|
+
* Permission is hereby granted, free of charge, to any person obtaining a copy
|
8
|
+
* of this software and associated documentation files (the "Software"), to deal
|
9
|
+
* in the Software without restriction, including without limitation the rights
|
10
|
+
* to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
11
|
+
* copies of the Software, and to permit persons to whom the Software is
|
12
|
+
* furnished to do so, subject to the following conditions:
|
13
|
+
*
|
14
|
+
* The above copyright notice and this permission notice shall be included in all
|
15
|
+
* copies or substantial portions of the Software.
|
16
|
+
*
|
17
|
+
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
18
|
+
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
19
|
+
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
20
|
+
* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
21
|
+
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
22
|
+
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
23
|
+
* SOFTWARE.
|
24
|
+
*/
|
25
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
26
|
+
const PublicAccount_1 = require("../account/PublicAccount");
|
27
|
+
/**
|
28
|
+
* Nodes are the entities that perform communication in the network like sending and receiving data.
|
29
|
+
* A node has an identity which is tied to an account through which the node can identify itself to the network.
|
30
|
+
* The communication is done through the endpoint of the node. Additionally a node provides meta data information.
|
31
|
+
*/
|
32
|
+
class Node {
|
33
|
+
/**
|
34
|
+
* @internal
|
35
|
+
* @param metaData
|
36
|
+
* @param endpoint
|
37
|
+
* @param identity
|
38
|
+
*/
|
39
|
+
constructor(metaData, endpoint, identity) {
|
40
|
+
this.metaData = metaData;
|
41
|
+
this.endpoint = endpoint;
|
42
|
+
this.identity = identity;
|
43
|
+
}
|
44
|
+
/**
|
45
|
+
* @internal
|
46
|
+
* @param dto
|
47
|
+
* @returns {NodeDTO}
|
48
|
+
*/
|
49
|
+
static createFromNodeDTO(dto) {
|
50
|
+
return new Node(NodeMetaData.createFromNodeMetaDataDTO(dto.metaData), NodeEndpoint.createFromNodeEndpointDTO(dto.endpoint), NodeIdentity.createFromNodeIdentityDTO(dto.identity));
|
51
|
+
}
|
52
|
+
}
|
53
|
+
exports.Node = Node;
|
54
|
+
/**
|
55
|
+
* Node meta data
|
56
|
+
*/
|
57
|
+
class NodeMetaData {
|
58
|
+
/**
|
59
|
+
* @internal
|
60
|
+
* @param features
|
61
|
+
* @param network
|
62
|
+
* @param application
|
63
|
+
* @param version
|
64
|
+
* @param platform
|
65
|
+
*/
|
66
|
+
constructor(features, network, application, version, platform) {
|
67
|
+
this.features = features;
|
68
|
+
this.network = network;
|
69
|
+
this.application = application;
|
70
|
+
this.version = version;
|
71
|
+
this.platform = platform;
|
72
|
+
}
|
73
|
+
/**
|
74
|
+
* @internal
|
75
|
+
* @param dto
|
76
|
+
* @returns {NodeMetaDataDTO}
|
77
|
+
*/
|
78
|
+
static createFromNodeMetaDataDTO(dto) {
|
79
|
+
return new NodeMetaData(dto.features, dto.networkId, dto.application, dto.version, dto.platform);
|
80
|
+
}
|
81
|
+
}
|
82
|
+
exports.NodeMetaData = NodeMetaData;
|
83
|
+
/**
|
84
|
+
* Node endpoint
|
85
|
+
*/
|
86
|
+
class NodeEndpoint {
|
87
|
+
/**
|
88
|
+
* @internal
|
89
|
+
* @param protocol
|
90
|
+
* @param port
|
91
|
+
* @param host
|
92
|
+
*/
|
93
|
+
constructor(protocol, port, host) {
|
94
|
+
this.protocol = protocol;
|
95
|
+
this.port = port;
|
96
|
+
this.host = host;
|
97
|
+
}
|
98
|
+
/**
|
99
|
+
* @internal
|
100
|
+
* @param dto
|
101
|
+
* @returns {NodeEndpointDTO}
|
102
|
+
*/
|
103
|
+
static createFromNodeEndpointDTO(dto) {
|
104
|
+
return new NodeEndpoint(dto.protocol, dto.port, dto.host);
|
105
|
+
}
|
106
|
+
}
|
107
|
+
exports.NodeEndpoint = NodeEndpoint;
|
108
|
+
/**
|
109
|
+
* Node identity
|
110
|
+
*/
|
111
|
+
class NodeIdentity {
|
112
|
+
/**
|
113
|
+
* @internal
|
114
|
+
* @param name
|
115
|
+
* @param publickey
|
116
|
+
*/
|
117
|
+
constructor(name, publicAccount) {
|
118
|
+
this.name = name;
|
119
|
+
this.publicAccount = publicAccount;
|
120
|
+
}
|
121
|
+
/**
|
122
|
+
* @internal
|
123
|
+
* @param dto
|
124
|
+
* @returns {NodeIdentityDTO}
|
125
|
+
*/
|
126
|
+
static createFromNodeIdentityDTO(dto) {
|
127
|
+
return new NodeIdentity(dto.name, dto.publickey === undefined ? undefined : PublicAccount_1.PublicAccount.createWithPublicKey(dto.publickey));
|
128
|
+
}
|
129
|
+
}
|
130
|
+
exports.NodeIdentity = NodeIdentity;
|
131
|
+
//# sourceMappingURL=Node.js.map
|
@@ -0,0 +1 @@
|
|
1
|
+
{"version":3,"file":"Node.js","sourceRoot":"","sources":["../../../../src/models/node/Node.ts"],"names":[],"mappings":";AAAA;;;;;;;;;;;;;;;;;;;;;;GAsBG;;AAGH,4DAAuD;AAGvD;;;;GAIG;AACH;IAgBE;;;;;OAKG;IACH,YACE,QAAsB,EACtB,QAAsB,EACtB,QAAsB;QAEtB,IAAI,CAAC,QAAQ,GAAG,QAAQ,CAAC;QACzB,IAAI,CAAC,QAAQ,GAAG,QAAQ,CAAC;QACzB,IAAI,CAAC,QAAQ,GAAG,QAAQ,CAAC;IAC3B,CAAC;IAED;;;;OAIG;IACI,MAAM,CAAC,iBAAiB,CAAC,GAAY;QAC1C,OAAO,IAAI,IAAI,CACb,YAAY,CAAC,yBAAyB,CAAC,GAAG,CAAC,QAAQ,CAAC,EACpD,YAAY,CAAC,yBAAyB,CAAC,GAAG,CAAC,QAAQ,CAAC,EACpD,YAAY,CAAC,yBAAyB,CAAC,GAAG,CAAC,QAAQ,CAAC,CACrD,CAAC;IACJ,CAAC;CACF;AA5CD,oBA4CC;AAED;;GAEG;AACH;IA0BE;;;;;;;OAOG;IACH,YACE,QAAgB,EAChB,OAAqB,EACrB,WAAmB,EACnB,OAAe,EACf,QAAgB;QAEhB,IAAI,CAAC,QAAQ,GAAG,QAAQ,CAAC;QACzB,IAAI,CAAC,OAAO,GAAG,OAAO,CAAC;QACvB,IAAI,CAAC,WAAW,GAAG,WAAW,CAAC;QAC/B,IAAI,CAAC,OAAO,GAAG,OAAO,CAAC;QACvB,IAAI,CAAC,QAAQ,GAAG,QAAQ,CAAC;IAC3B,CAAC;IAED;;;;OAIG;IACI,MAAM,CAAC,yBAAyB,CAAC,GAAoB;QAC1D,OAAO,IAAI,YAAY,CACnB,GAAG,CAAC,QAAQ,EACZ,GAAG,CAAC,SAAS,EACb,GAAG,CAAC,WAAW,EACf,GAAG,CAAC,OAAO,EACX,GAAG,CAAC,QAAQ,CACf,CAAC;IACJ,CAAC;CACF;AA9DD,oCA8DC;AAED;;GAEG;AACH;IAgBE;;;;;OAKG;IACH,YACE,QAAgB,EAChB,IAAY,EACZ,IAAY;QAEZ,IAAI,CAAC,QAAQ,GAAG,QAAQ,CAAC;QACzB,IAAI,CAAC,IAAI,GAAG,IAAI,CAAC;QACjB,IAAI,CAAC,IAAI,GAAG,IAAI,CAAC;IACnB,CAAC;IAED;;;;OAIG;IACI,MAAM,CAAC,yBAAyB,CAAC,GAAoB;QAC1D,OAAO,IAAI,YAAY,CACrB,GAAG,CAAC,QAAQ,EACZ,GAAG,CAAC,IAAI,EACR,GAAG,CAAC,IAAI,CACT,CAAC;IACJ,CAAC;CACF;AA5CD,oCA4CC;AAED;;GAEG;AACH;IAWE;;;;OAIG;IACH,YACE,IAAY,EACZ,aAA6B;QAE7B,IAAI,CAAC,IAAI,GAAG,IAAI,CAAC;QACjB,IAAI,CAAC,aAAa,GAAG,aAAa,CAAC;IACrC,CAAC;IAED;;;;OAIG;IACI,MAAM,CAAC,yBAAyB,CAAC,GAAoB;QAC1D,OAAO,IAAI,YAAY,CACrB,GAAG,CAAC,IAAI,EACR,GAAG,CAAC,SAAS,KAAK,SAAS,CAAC,CAAC,CAAC,SAAS,CAAC,CAAC,CAAC,6BAAa,CAAC,mBAAmB,CAAC,GAAG,CAAC,SAAS,CAAC,CAC3F,CAAC;IACJ,CAAC;CACF;AAnCD,oCAmCC"}
|
@@ -0,0 +1,22 @@
|
|
1
|
+
import { Node } from "./Node";
|
2
|
+
/**
|
3
|
+
* A NodeCollection object holds arrays of nodes with different statuses.
|
4
|
+
*/
|
5
|
+
export declare class NodeCollection {
|
6
|
+
/**
|
7
|
+
* A connection to the node cannot be established.
|
8
|
+
*/
|
9
|
+
readonly inactive: Node[];
|
10
|
+
/**
|
11
|
+
* A connection can be established and the remote node responds in a timely manner.
|
12
|
+
*/
|
13
|
+
readonly active: Node[];
|
14
|
+
/**
|
15
|
+
* A connection can be established but the node cannot provide information within the timeout limits.
|
16
|
+
*/
|
17
|
+
readonly busy: Node[];
|
18
|
+
/**
|
19
|
+
* A fatal error occurs when trying to establish a connection or the node couldn't authenticate itself correctly.
|
20
|
+
*/
|
21
|
+
readonly failure: Node[];
|
22
|
+
}
|
@@ -0,0 +1,54 @@
|
|
1
|
+
"use strict";
|
2
|
+
/*
|
3
|
+
* The MIT License (MIT)
|
4
|
+
*
|
5
|
+
* Copyright (c) 2017 NEM
|
6
|
+
*
|
7
|
+
* Permission is hereby granted, free of charge, to any person obtaining a copy
|
8
|
+
* of this software and associated documentation files (the "Software"), to deal
|
9
|
+
* in the Software without restriction, including without limitation the rights
|
10
|
+
* to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
11
|
+
* copies of the Software, and to permit persons to whom the Software is
|
12
|
+
* furnished to do so, subject to the following conditions:
|
13
|
+
*
|
14
|
+
* The above copyright notice and this permission notice shall be included in all
|
15
|
+
* copies or substantial portions of the Software.
|
16
|
+
*
|
17
|
+
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
18
|
+
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
19
|
+
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
20
|
+
* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
21
|
+
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
22
|
+
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
23
|
+
* SOFTWARE.
|
24
|
+
*/
|
25
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
26
|
+
const Node_1 = require("./Node");
|
27
|
+
/**
|
28
|
+
* A NodeCollection object holds arrays of nodes with different statuses.
|
29
|
+
*/
|
30
|
+
class NodeCollection {
|
31
|
+
/**
|
32
|
+
* @internal
|
33
|
+
* @param inactive
|
34
|
+
* @param active
|
35
|
+
* @param busy
|
36
|
+
* @param failure
|
37
|
+
*/
|
38
|
+
constructor(inactive, active, busy, failure) {
|
39
|
+
this.inactive = inactive;
|
40
|
+
this.active = active;
|
41
|
+
this.busy = busy;
|
42
|
+
this.failure = failure;
|
43
|
+
}
|
44
|
+
/**
|
45
|
+
* @internal
|
46
|
+
* @param dto
|
47
|
+
* @returns {Node}
|
48
|
+
*/
|
49
|
+
static createFromNodeCollectionDTO(dto) {
|
50
|
+
return new NodeCollection(dto.inactive.map((nodeDTO) => Node_1.Node.createFromNodeDTO(nodeDTO)), dto.active.map((nodeDTO) => Node_1.Node.createFromNodeDTO(nodeDTO)), dto.busy.map((nodeDTO) => Node_1.Node.createFromNodeDTO(nodeDTO)), dto.failure.map((nodeDTO) => Node_1.Node.createFromNodeDTO(nodeDTO)));
|
51
|
+
}
|
52
|
+
}
|
53
|
+
exports.NodeCollection = NodeCollection;
|
54
|
+
//# sourceMappingURL=NodeCollection.js.map
|
@@ -0,0 +1 @@
|
|
1
|
+
{"version":3,"file":"NodeCollection.js","sourceRoot":"","sources":["../../../../src/models/node/NodeCollection.ts"],"names":[],"mappings":";AAAA;;;;;;;;;;;;;;;;;;;;;;GAsBG;;AAGH,iCAA4B;AAE5B;;GAEG;AACH;IAqBE;;;;;;OAMG;IACH,YACE,QAAgB,EAChB,MAAc,EACd,IAAY,EACZ,OAAe;QAEf,IAAI,CAAC,QAAQ,GAAG,QAAQ,CAAC;QACzB,IAAI,CAAC,MAAM,GAAG,MAAM,CAAC;QACrB,IAAI,CAAC,IAAI,GAAG,IAAI,CAAC;QACjB,IAAI,CAAC,OAAO,GAAG,OAAO,CAAC;IACzB,CAAC;IAED;;;;OAIG;IACI,MAAM,CAAC,2BAA2B,CAAC,GAAsB;QAC9D,OAAO,IAAI,cAAc,CACvB,GAAG,CAAC,QAAQ,CAAC,GAAG,CAAC,CAAC,OAAO,EAAE,EAAE,CAAC,WAAI,CAAC,iBAAiB,CAAC,OAAO,CAAC,CAAC,EAC9D,GAAG,CAAC,MAAM,CAAC,GAAG,CAAC,CAAC,OAAO,EAAE,EAAE,CAAC,WAAI,CAAC,iBAAiB,CAAC,OAAO,CAAC,CAAC,EAC5D,GAAG,CAAC,IAAI,CAAC,GAAG,CAAC,CAAC,OAAO,EAAE,EAAE,CAAC,WAAI,CAAC,iBAAiB,CAAC,OAAO,CAAC,CAAC,EAC1D,GAAG,CAAC,OAAO,CAAC,GAAG,CAAC,CAAC,OAAO,EAAE,EAAE,CAAC,WAAI,CAAC,iBAAiB,CAAC,OAAO,CAAC,CAAC,CAAC,CAAC;IACnE,CAAC;CACF;AApDD,wCAoDC"}
|
@@ -0,0 +1,39 @@
|
|
1
|
+
import { TransactionDTO } from "../../infrastructure/transaction/TransactionDTO";
|
2
|
+
import { Address } from "../account/Address";
|
3
|
+
import { AssetDefinition } from "../asset/AssetDefinition";
|
4
|
+
import { TimeWindow } from "./TimeWindow";
|
5
|
+
import { Transaction } from "./Transaction";
|
6
|
+
/**
|
7
|
+
* Before a asset can be created or transferred, a corresponding definition of the asset has to be created and published to the network.
|
8
|
+
* This is done via a asset definition creation transaction.
|
9
|
+
*/
|
10
|
+
export declare class AssetDefinitionCreationTransaction extends Transaction {
|
11
|
+
/**
|
12
|
+
* The fee for the transaction. The higher the fee, the higher the priority of the transaction. Transactions with high priority get included in a block before transactions with lower priority.
|
13
|
+
*/
|
14
|
+
readonly fee: number;
|
15
|
+
/**
|
16
|
+
* The fee for the creation of the asset.
|
17
|
+
*/
|
18
|
+
readonly creationFee: number;
|
19
|
+
/**
|
20
|
+
* The public account to which the creation fee is tranferred.
|
21
|
+
*/
|
22
|
+
readonly creationFeeSink: Address;
|
23
|
+
/**
|
24
|
+
* The actual asset definition.
|
25
|
+
*/
|
26
|
+
readonly mosaicDefinition: AssetDefinition;
|
27
|
+
/**
|
28
|
+
* Create DTO of AssetDefinitionCreationTransaction
|
29
|
+
* @returns {MosaicDefinitionCreationTransactionDTO}
|
30
|
+
*/
|
31
|
+
toDTO(): TransactionDTO;
|
32
|
+
/**
|
33
|
+
* Create a AssetDefinitionCreationTransaction object
|
34
|
+
* @param timeWindow
|
35
|
+
* @param assetDefinition
|
36
|
+
* @returns {AssetDefinitionCreationTransaction}
|
37
|
+
*/
|
38
|
+
static create(timeWindow: TimeWindow, assetDefinition: AssetDefinition): AssetDefinitionCreationTransaction;
|
39
|
+
}
|
@@ -0,0 +1,94 @@
|
|
1
|
+
"use strict";
|
2
|
+
/*
|
3
|
+
* The MIT License (MIT)
|
4
|
+
*
|
5
|
+
* Copyright (c) 2017 NEM
|
6
|
+
*
|
7
|
+
* Permission is hereby granted, free of charge, to any person obtaining a copy
|
8
|
+
* of this software and associated documentation files (the "Software"), to deal
|
9
|
+
* in the Software without restriction, including without limitation the rights
|
10
|
+
* to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
11
|
+
* copies of the Software, and to permit persons to whom the Software is
|
12
|
+
* furnished to do so, subject to the following conditions:
|
13
|
+
*
|
14
|
+
* The above copyright notice and this permission notice shall be included in all
|
15
|
+
* copies or substantial portions of the Software.
|
16
|
+
*
|
17
|
+
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
18
|
+
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
19
|
+
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
20
|
+
* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
21
|
+
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
22
|
+
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
23
|
+
* SOFTWARE.
|
24
|
+
*/
|
25
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
26
|
+
const NEMLibrary_1 = require("../../NEMLibrary");
|
27
|
+
const Address_1 = require("../account/Address");
|
28
|
+
const NetworkTypes_1 = require("../node/NetworkTypes");
|
29
|
+
const Transaction_1 = require("./Transaction");
|
30
|
+
const TransactionTypes_1 = require("./TransactionTypes");
|
31
|
+
/**
|
32
|
+
* Before a asset can be created or transferred, a corresponding definition of the asset has to be created and published to the network.
|
33
|
+
* This is done via a asset definition creation transaction.
|
34
|
+
*/
|
35
|
+
class AssetDefinitionCreationTransaction extends Transaction_1.Transaction {
|
36
|
+
/**
|
37
|
+
* @internal
|
38
|
+
* @param timeWindow
|
39
|
+
* @param version
|
40
|
+
* @param creationFee
|
41
|
+
* @param creationFeeSink
|
42
|
+
* @param assetDefinition
|
43
|
+
* @param fee
|
44
|
+
* @param signature
|
45
|
+
* @param sender
|
46
|
+
* @param transactionInfo
|
47
|
+
*/
|
48
|
+
constructor(timeWindow, version, creationFee, creationFeeSink, assetDefinition, fee, signature, sender, transactionInfo) {
|
49
|
+
super(TransactionTypes_1.TransactionTypes.MOSAIC_DEFINITION_CREATION, version, timeWindow, signature, sender, transactionInfo);
|
50
|
+
this.creationFeeSink = creationFeeSink;
|
51
|
+
this.creationFee = creationFee;
|
52
|
+
this.mosaicDefinition = assetDefinition;
|
53
|
+
this.fee = fee;
|
54
|
+
}
|
55
|
+
/**
|
56
|
+
* Create DTO of AssetDefinitionCreationTransaction
|
57
|
+
* @returns {MosaicDefinitionCreationTransactionDTO}
|
58
|
+
*/
|
59
|
+
toDTO() {
|
60
|
+
const version = this.networkVersion ? this.networkVersion : this.version;
|
61
|
+
return this.serializeDTO({
|
62
|
+
type: this.type,
|
63
|
+
fee: this.fee,
|
64
|
+
version,
|
65
|
+
signer: this.signer ? this.signer.publicKey : undefined,
|
66
|
+
signature: this.signature,
|
67
|
+
deadline: this.timeWindow.deadlineToDTO(),
|
68
|
+
timeStamp: this.timeWindow.timeStampToDTO(),
|
69
|
+
creationFee: this.creationFee,
|
70
|
+
creationFeeSink: this.creationFeeSink.plain(),
|
71
|
+
mosaicDefinition: this.mosaicDefinition.toDTO(),
|
72
|
+
});
|
73
|
+
}
|
74
|
+
/**
|
75
|
+
* Create a AssetDefinitionCreationTransaction object
|
76
|
+
* @param timeWindow
|
77
|
+
* @param assetDefinition
|
78
|
+
* @returns {AssetDefinitionCreationTransaction}
|
79
|
+
*/
|
80
|
+
static create(timeWindow, assetDefinition) {
|
81
|
+
const fee = Math.floor(3 * 0.05 * 1000000);
|
82
|
+
let creationFeeSink;
|
83
|
+
if (NEMLibrary_1.NEMLibrary.getNetworkType() === NetworkTypes_1.NetworkTypes.TEST_NET) {
|
84
|
+
creationFeeSink = new Address_1.Address("TBMOSA-ICOD4F-54EE5C-DMR23C-CBGOAM-2XSJBR-5OLC");
|
85
|
+
}
|
86
|
+
else if (NEMLibrary_1.NEMLibrary.getNetworkType() === NetworkTypes_1.NetworkTypes.MAIN_NET) {
|
87
|
+
creationFeeSink = new Address_1.Address("NBMOSA-ICOD4F-54EE5C-DMR23C-CBGOAM-2XSIUX-6TRS");
|
88
|
+
}
|
89
|
+
const creationFee = Math.floor(10 * 1000000);
|
90
|
+
return new AssetDefinitionCreationTransaction(timeWindow, 1, creationFee, creationFeeSink, assetDefinition, fee);
|
91
|
+
}
|
92
|
+
}
|
93
|
+
exports.AssetDefinitionCreationTransaction = AssetDefinitionCreationTransaction;
|
94
|
+
//# sourceMappingURL=AssetDefinitionCreationTransaction.js.map
|
@@ -0,0 +1 @@
|
|
1
|
+
{"version":3,"file":"AssetDefinitionCreationTransaction.js","sourceRoot":"","sources":["../../../../src/models/transaction/AssetDefinitionCreationTransaction.ts"],"names":[],"mappings":";AAAA;;;;;;;;;;;;;;;;;;;;;;GAsBG;;AAIH,iDAA4C;AAC5C,gDAA2C;AAG3C,uDAAkD;AAElD,+CAA0C;AAE1C,yDAAoD;AAEpD;;;GAGG;AACH,wCAAgD,SAAQ,yBAAW;IAqBjE;;;;;;;;;;;OAWG;IACH,YAAY,UAAsB,EACtB,OAAe,EACf,WAAmB,EACnB,eAAwB,EACxB,eAAgC,EAChC,GAAW,EACX,SAAkB,EAClB,MAAsB,EACtB,eAAiC;QAC3C,KAAK,CAAC,mCAAgB,CAAC,0BAA0B,EAAE,OAAO,EAAE,UAAU,EAAE,SAAS,EAAE,MAAM,EAAE,eAAe,CAAC,CAAC;QAC5G,IAAI,CAAC,eAAe,GAAG,eAAe,CAAC;QACvC,IAAI,CAAC,WAAW,GAAG,WAAW,CAAC;QAC/B,IAAI,CAAC,gBAAgB,GAAG,eAAe,CAAC;QACxC,IAAI,CAAC,GAAG,GAAG,GAAG,CAAC;IACjB,CAAC;IAED;;;OAGG;IACI,KAAK;QACV,MAAM,OAAO,GAAG,IAAI,CAAC,cAAc,CAAC,CAAC,CAAC,IAAI,CAAC,cAAc,CAAC,CAAC,CAAC,IAAI,CAAC,OAAO,CAAC;QACzE,OAAO,IAAI,CAAC,YAAY,CAAC;YACvB,IAAI,EAAE,IAAI,CAAC,IAAI;YACf,GAAG,EAAE,IAAI,CAAC,GAAG;YACb,OAAO;YACP,MAAM,EAAE,IAAI,CAAC,MAAM,CAAC,CAAC,CAAC,IAAI,CAAC,MAAM,CAAC,SAAS,CAAC,CAAC,CAAC,SAAS;YACvD,SAAS,EAAE,IAAI,CAAC,SAAS;YACzB,QAAQ,EAAE,IAAI,CAAC,UAAU,CAAC,aAAa,EAAE;YACzC,SAAS,EAAE,IAAI,CAAC,UAAU,CAAC,cAAc,EAAE;YAC3C,WAAW,EAAE,IAAI,CAAC,WAAW;YAC7B,eAAe,EAAE,IAAI,CAAC,eAAe,CAAC,KAAK,EAAE;YAC7C,gBAAgB,EAAE,IAAI,CAAC,gBAAgB,CAAC,KAAK,EAAE;SACN,CAAC,CAAC;IAC/C,CAAC;IAED;;;;;OAKG;IACI,MAAM,CAAC,MAAM,CAAC,UAAsB,EACtB,eAAgC;QACnD,MAAM,GAAG,GAAG,IAAI,CAAC,KAAK,CAAC,CAAC,GAAG,IAAI,GAAG,OAAO,CAAC,CAAC;QAC3C,IAAI,eAAe,CAAC;QACpB,IAAI,uBAAU,CAAC,cAAc,EAAE,KAAK,2BAAY,CAAC,QAAQ,EAAE;YACzD,eAAe,GAAG,IAAI,iBAAO,CAAC,gDAAgD,CAAC,CAAC;SACjF;aAAM,IAAI,uBAAU,CAAC,cAAc,EAAE,KAAK,2BAAY,CAAC,QAAQ,EAAE;YAChE,eAAe,GAAG,IAAI,iBAAO,CAAC,gDAAgD,CAAC,CAAC;SACjF;QACD,MAAM,WAAW,GAAG,IAAI,CAAC,KAAK,CAAC,EAAE,GAAG,OAAO,CAAC,CAAC;QAC7C,OAAO,IAAI,kCAAkC,CAC3C,UAAU,EAAE,CAAC,EAAE,WAAW,EAAE,eAAe,EAAE,eAAe,EAAE,GAAG,CAClE,CAAC;IACJ,CAAC;CACF;AAzFD,gFAyFC"}
|
@@ -0,0 +1,48 @@
|
|
1
|
+
import { TransactionDTO } from "../../infrastructure/transaction/TransactionDTO";
|
2
|
+
import { AssetId } from "../asset/AssetId";
|
3
|
+
import { TimeWindow } from "./TimeWindow";
|
4
|
+
import { Transaction } from "./Transaction";
|
5
|
+
/**
|
6
|
+
* The supply type. Supported supply types are:
|
7
|
+
* 1: Increase in supply.
|
8
|
+
* 2: Decrease in supply.
|
9
|
+
*/
|
10
|
+
export declare enum AssetSupplyType {
|
11
|
+
Increase = 1,
|
12
|
+
Decrease = 2,
|
13
|
+
}
|
14
|
+
/**
|
15
|
+
* In case a asset definition has the property 'supplyMutable' set to true, the creator of the asset definition can change the supply, i.e. increase or decrease the supply.
|
16
|
+
*/
|
17
|
+
export declare class AssetSupplyChangeTransaction extends Transaction {
|
18
|
+
/**
|
19
|
+
* The fee for the transaction. The higher the fee, the higher the priority of the transaction. Transactions with high priority get included in a block before transactions with lower priority.
|
20
|
+
*/
|
21
|
+
readonly fee: number;
|
22
|
+
/**
|
23
|
+
* The asset id.
|
24
|
+
*/
|
25
|
+
readonly assetId: AssetId;
|
26
|
+
/**
|
27
|
+
* The supply type.
|
28
|
+
*/
|
29
|
+
readonly supplyType: AssetSupplyType;
|
30
|
+
/**
|
31
|
+
* The supply change in units for the asset.
|
32
|
+
*/
|
33
|
+
readonly delta: number;
|
34
|
+
/**
|
35
|
+
* Create DTO of AssetSupplychangeTransaction
|
36
|
+
* @returns TransactionDTO
|
37
|
+
*/
|
38
|
+
toDTO(): TransactionDTO;
|
39
|
+
/**
|
40
|
+
* Create a AssetSupplyChangeTransaction object
|
41
|
+
* @param timeWindow
|
42
|
+
* @param assetId
|
43
|
+
* @param supplyType
|
44
|
+
* @param delta
|
45
|
+
* @returns {AssetSupplyChangeTransaction}
|
46
|
+
*/
|
47
|
+
static create(timeWindow: TimeWindow, assetId: AssetId, supplyType: AssetSupplyType, delta: number): AssetSupplyChangeTransaction;
|
48
|
+
}
|
@@ -0,0 +1,94 @@
|
|
1
|
+
"use strict";
|
2
|
+
/*
|
3
|
+
* The MIT License (MIT)
|
4
|
+
*
|
5
|
+
* Copyright (c) 2017 NEM
|
6
|
+
*
|
7
|
+
* Permission is hereby granted, free of charge, to any person obtaining a copy
|
8
|
+
* of this software and associated documentation files (the "Software"), to deal
|
9
|
+
* in the Software without restriction, including without limitation the rights
|
10
|
+
* to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
11
|
+
* copies of the Software, and to permit persons to whom the Software is
|
12
|
+
* furnished to do so, subject to the following conditions:
|
13
|
+
*
|
14
|
+
* The above copyright notice and this permission notice shall be included in all
|
15
|
+
* copies or substantial portions of the Software.
|
16
|
+
*
|
17
|
+
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
18
|
+
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
19
|
+
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
20
|
+
* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
21
|
+
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
22
|
+
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
23
|
+
* SOFTWARE.
|
24
|
+
*/
|
25
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
26
|
+
const Transaction_1 = require("./Transaction");
|
27
|
+
const TransactionTypes_1 = require("./TransactionTypes");
|
28
|
+
/**
|
29
|
+
* The supply type. Supported supply types are:
|
30
|
+
* 1: Increase in supply.
|
31
|
+
* 2: Decrease in supply.
|
32
|
+
*/
|
33
|
+
var AssetSupplyType;
|
34
|
+
(function (AssetSupplyType) {
|
35
|
+
AssetSupplyType[AssetSupplyType["Increase"] = 1] = "Increase";
|
36
|
+
AssetSupplyType[AssetSupplyType["Decrease"] = 2] = "Decrease";
|
37
|
+
})(AssetSupplyType = exports.AssetSupplyType || (exports.AssetSupplyType = {}));
|
38
|
+
/**
|
39
|
+
* In case a asset definition has the property 'supplyMutable' set to true, the creator of the asset definition can change the supply, i.e. increase or decrease the supply.
|
40
|
+
*/
|
41
|
+
class AssetSupplyChangeTransaction extends Transaction_1.Transaction {
|
42
|
+
/**
|
43
|
+
* @internal
|
44
|
+
* @param timeWindow
|
45
|
+
* @param version
|
46
|
+
* @param assetId
|
47
|
+
* @param supplyType
|
48
|
+
* @param delta
|
49
|
+
* @param fee
|
50
|
+
* @param signature
|
51
|
+
* @param sender
|
52
|
+
* @param transactionInfo
|
53
|
+
*/
|
54
|
+
constructor(timeWindow, version, assetId, supplyType, delta, fee, signature, sender, transactionInfo) {
|
55
|
+
super(TransactionTypes_1.TransactionTypes.MOSAIC_SUPPLY_CHANGE, version, timeWindow, signature, sender, transactionInfo);
|
56
|
+
this.assetId = assetId;
|
57
|
+
this.supplyType = supplyType;
|
58
|
+
this.delta = delta;
|
59
|
+
this.fee = fee;
|
60
|
+
}
|
61
|
+
/**
|
62
|
+
* Create DTO of AssetSupplychangeTransaction
|
63
|
+
* @returns TransactionDTO
|
64
|
+
*/
|
65
|
+
toDTO() {
|
66
|
+
const version = this.networkVersion ? this.networkVersion : this.version;
|
67
|
+
return this.serializeDTO({
|
68
|
+
deadline: this.timeWindow.deadlineToDTO(),
|
69
|
+
timeStamp: this.timeWindow.timeStampToDTO(),
|
70
|
+
signer: this.signer ? this.signer.publicKey : undefined,
|
71
|
+
type: this.type,
|
72
|
+
version,
|
73
|
+
signature: this.signature,
|
74
|
+
fee: this.fee,
|
75
|
+
mosaicId: this.assetId.toDTO(),
|
76
|
+
delta: this.delta,
|
77
|
+
supplyType: this.supplyType,
|
78
|
+
});
|
79
|
+
}
|
80
|
+
/**
|
81
|
+
* Create a AssetSupplyChangeTransaction object
|
82
|
+
* @param timeWindow
|
83
|
+
* @param assetId
|
84
|
+
* @param supplyType
|
85
|
+
* @param delta
|
86
|
+
* @returns {AssetSupplyChangeTransaction}
|
87
|
+
*/
|
88
|
+
static create(timeWindow, assetId, supplyType, delta) {
|
89
|
+
const fee = Math.floor(3.0 * 0.05 * 1000000);
|
90
|
+
return new AssetSupplyChangeTransaction(timeWindow, 1, assetId, supplyType, delta, fee);
|
91
|
+
}
|
92
|
+
}
|
93
|
+
exports.AssetSupplyChangeTransaction = AssetSupplyChangeTransaction;
|
94
|
+
//# sourceMappingURL=AssetSupplyChangeTransaction.js.map
|
@@ -0,0 +1 @@
|
|
1
|
+
{"version":3,"file":"AssetSupplyChangeTransaction.js","sourceRoot":"","sources":["../../../../src/models/transaction/AssetSupplyChangeTransaction.ts"],"names":[],"mappings":";AAAA;;;;;;;;;;;;;;;;;;;;;;GAsBG;;AAOH,+CAA0C;AAE1C,yDAAoD;AAEpD;;;;GAIG;AACH,IAAY,eAGX;AAHD,WAAY,eAAe;IACzB,6DAAY,CAAA;IACZ,6DAAY,CAAA;AACd,CAAC,EAHW,eAAe,GAAf,uBAAe,KAAf,uBAAe,QAG1B;AAED;;GAEG;AACH,kCAA0C,SAAQ,yBAAW;IAqB3D;;;;;;;;;;;OAWG;IACH,YAAY,UAAsB,EACtB,OAAe,EACf,OAAgB,EAChB,UAA2B,EAC3B,KAAa,EACb,GAAW,EACX,SAAkB,EAClB,MAAsB,EACtB,eAAiC;QAC3C,KAAK,CAAC,mCAAgB,CAAC,oBAAoB,EAAE,OAAO,EAAE,UAAU,EAAE,SAAS,EAAE,MAAM,EAAE,eAAe,CAAC,CAAC;QACtG,IAAI,CAAC,OAAO,GAAG,OAAO,CAAC;QACvB,IAAI,CAAC,UAAU,GAAG,UAAU,CAAC;QAC7B,IAAI,CAAC,KAAK,GAAG,KAAK,CAAC;QACnB,IAAI,CAAC,GAAG,GAAG,GAAG,CAAC;IACjB,CAAC;IAED;;;OAGG;IACI,KAAK;QACV,MAAM,OAAO,GAAG,IAAI,CAAC,cAAc,CAAC,CAAC,CAAC,IAAI,CAAC,cAAc,CAAC,CAAC,CAAC,IAAI,CAAC,OAAO,CAAC;QACzE,OAAO,IAAI,CAAC,YAAY,CAAC;YACvB,QAAQ,EAAE,IAAI,CAAC,UAAU,CAAC,aAAa,EAAE;YACzC,SAAS,EAAE,IAAI,CAAC,UAAU,CAAC,cAAc,EAAE;YAC3C,MAAM,EAAE,IAAI,CAAC,MAAM,CAAC,CAAC,CAAC,IAAI,CAAC,MAAM,CAAC,SAAS,CAAC,CAAC,CAAC,SAAS;YACvD,IAAI,EAAE,IAAI,CAAC,IAAI;YACf,OAAO;YACP,SAAS,EAAE,IAAI,CAAC,SAAS;YACzB,GAAG,EAAE,IAAI,CAAC,GAAG;YACb,QAAQ,EAAE,IAAI,CAAC,OAAO,CAAC,KAAK,EAAE;YAC9B,KAAK,EAAE,IAAI,CAAC,KAAK;YACjB,UAAU,EAAE,IAAI,CAAC,UAAU;SACQ,CAAC,CAAC;IACzC,CAAC;IAED;;;;;;;OAOG;IACI,MAAM,CAAC,MAAM,CAAC,UAAsB,EACtB,OAAgB,EAChB,UAA2B,EAC3B,KAAa;QAChC,MAAM,GAAG,GAAG,IAAI,CAAC,KAAK,CAAC,GAAG,GAAG,IAAI,GAAG,OAAO,CAAC,CAAC;QAC7C,OAAO,IAAI,4BAA4B,CAAC,UAAU,EAAE,CAAC,EAAE,OAAO,EAAE,UAAU,EAAE,KAAK,EAAE,GAAG,CAAC,CAAC;IAC1F,CAAC;CACF;AApFD,oEAoFC"}
|
@@ -0,0 +1,86 @@
|
|
1
|
+
"use strict";
|
2
|
+
/*
|
3
|
+
* The MIT License (MIT)
|
4
|
+
*
|
5
|
+
* Copyright (c) 2017 NEM
|
6
|
+
*
|
7
|
+
* Permission is hereby granted, free of charge, to any person obtaining a copy
|
8
|
+
* of this software and associated documentation files (the "Software"), to deal
|
9
|
+
* in the Software without restriction, including without limitation the rights
|
10
|
+
* to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
11
|
+
* copies of the Software, and to permit persons to whom the Software is
|
12
|
+
* furnished to do so, subject to the following conditions:
|
13
|
+
*
|
14
|
+
* The above copyright notice and this permission notice shall be included in all
|
15
|
+
* copies or substantial portions of the Software.
|
16
|
+
*
|
17
|
+
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
18
|
+
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
19
|
+
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
20
|
+
* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
21
|
+
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
22
|
+
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
23
|
+
* SOFTWARE.
|
24
|
+
*/
|
25
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
26
|
+
const nemSdk = require("nem-sdk");
|
27
|
+
const Message_1 = require("./Message");
|
28
|
+
const PlainMessage_1 = require("./PlainMessage");
|
29
|
+
/**
|
30
|
+
* Encrypted Message model
|
31
|
+
*/
|
32
|
+
class EncryptedMessage extends Message_1.Message {
|
33
|
+
/**
|
34
|
+
* @internal
|
35
|
+
* @param payload
|
36
|
+
* @param recipientPublicAccount
|
37
|
+
*/
|
38
|
+
constructor(payload, recipientPublicAccount) {
|
39
|
+
super(payload);
|
40
|
+
this.recipientPublicAccount = recipientPublicAccount;
|
41
|
+
}
|
42
|
+
isEncrypted() {
|
43
|
+
return true;
|
44
|
+
}
|
45
|
+
isPlain() {
|
46
|
+
return false;
|
47
|
+
}
|
48
|
+
/**
|
49
|
+
* @internal
|
50
|
+
* @param message
|
51
|
+
* @param recipientPublicAccount
|
52
|
+
* @param privateKey
|
53
|
+
* @returns {EncryptedMessage}
|
54
|
+
*/
|
55
|
+
static create(message, recipientPublicAccount, privateKey) {
|
56
|
+
return new EncryptedMessage(nemSdk.default.crypto.helpers.encode(privateKey, recipientPublicAccount.publicKey, message), recipientPublicAccount);
|
57
|
+
}
|
58
|
+
/**
|
59
|
+
* @internal
|
60
|
+
*/
|
61
|
+
static createFromDTO(payload) {
|
62
|
+
return new EncryptedMessage(payload);
|
63
|
+
}
|
64
|
+
/**
|
65
|
+
* @internal
|
66
|
+
* @param encryptMessage
|
67
|
+
* @param privateKey
|
68
|
+
* @param recipientPublicAccount
|
69
|
+
* @returns {EncryptedMessage}
|
70
|
+
*/
|
71
|
+
static decrypt(encryptMessage, privateKey, recipientPublicAccount) {
|
72
|
+
return new PlainMessage_1.PlainMessage(Message_1.Message.decodeHex(nemSdk.default.crypto.helpers.decode(privateKey, recipientPublicAccount.publicKey, encryptMessage.payload)));
|
73
|
+
}
|
74
|
+
/**
|
75
|
+
* @internal
|
76
|
+
* @returns {MessageDTO}
|
77
|
+
*/
|
78
|
+
toDTO() {
|
79
|
+
return {
|
80
|
+
payload: this.payload,
|
81
|
+
type: 2,
|
82
|
+
};
|
83
|
+
}
|
84
|
+
}
|
85
|
+
exports.EncryptedMessage = EncryptedMessage;
|
86
|
+
//# sourceMappingURL=EncryptedMessage.js.map
|
@@ -0,0 +1 @@
|
|
1
|
+
{"version":3,"file":"EncryptedMessage.js","sourceRoot":"","sources":["../../../../src/models/transaction/EncryptedMessage.ts"],"names":[],"mappings":";AAAA;;;;;;;;;;;;;;;;;;;;;;GAsBG;;AAEH,kCAAkC;AAGlC,uCAAkC;AAClC,iDAA4C;AAE5C;;GAEG;AACH,sBAA8B,SAAQ,iBAAO;IAO3C;;;;OAIG;IACH,YAAoB,OAAe,EAAE,sBAAsC;QACzE,KAAK,CAAC,OAAO,CAAC,CAAC;QACf,IAAI,CAAC,sBAAsB,GAAG,sBAAsB,CAAC;IACvD,CAAC;IAEM,WAAW;QAChB,OAAO,IAAI,CAAC;IACd,CAAC;IAEM,OAAO;QACZ,OAAO,KAAK,CAAC;IACf,CAAC;IAED;;;;;;OAMG;IACI,MAAM,CAAC,MAAM,CAAC,OAAe,EAAE,sBAAqC,EAAE,UAAU;QACrF,OAAO,IAAI,gBAAgB,CAAC,MAAM,CAAC,OAAO,CAAC,MAAM,CAAC,OAAO,CAAC,MAAM,CAAC,UAAU,EAAE,sBAAsB,CAAC,SAAS,EAAE,OAAO,CAAC,EAAE,sBAAsB,CAAC,CAAC;IACnJ,CAAC;IAED;;OAEG;IACI,MAAM,CAAC,aAAa,CAAC,OAAe;QACzC,OAAO,IAAI,gBAAgB,CAAC,OAAO,CAAC,CAAC;IACvC,CAAC;IAED;;;;;;OAMG;IACI,MAAM,CAAC,OAAO,CAAC,cAAgC,EAAE,UAAU,EAAE,sBAAqC;QACvG,OAAO,IAAI,2BAAY,CAAC,iBAAO,CAAC,SAAS,CAAC,MAAM,CAAC,OAAO,CAAC,MAAM,CAAC,OAAO,CAAC,MAAM,CAAC,UAAU,EAAE,sBAAsB,CAAC,SAAS,EAAE,cAAc,CAAC,OAAO,CAAC,CAAC,CAAC,CAAC;IACzJ,CAAC;IAED;;;OAGG;IACI,KAAK;QACV,OAAO;YACL,OAAO,EAAE,IAAI,CAAC,OAAO;YACrB,IAAI,EAAE,CAAC;SACM,CAAC;IAClB,CAAC;CACF;AAhED,4CAgEC"}
|
@@ -0,0 +1,37 @@
|
|
1
|
+
"use strict";
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
3
|
+
const Message_1 = require("./Message");
|
4
|
+
class HexMessage extends Message_1.Message {
|
5
|
+
/**
|
6
|
+
* @internal
|
7
|
+
* @param payload
|
8
|
+
*/
|
9
|
+
constructor(payload) {
|
10
|
+
super(payload);
|
11
|
+
}
|
12
|
+
/**
|
13
|
+
* Create new constructor
|
14
|
+
* @param message
|
15
|
+
*/
|
16
|
+
static create(message) {
|
17
|
+
let msg = "fe" + message;
|
18
|
+
return new HexMessage(msg);
|
19
|
+
}
|
20
|
+
isEncrypted() {
|
21
|
+
return false;
|
22
|
+
}
|
23
|
+
isPlain() {
|
24
|
+
return true;
|
25
|
+
}
|
26
|
+
/**
|
27
|
+
* @internal
|
28
|
+
*/
|
29
|
+
toDTO() {
|
30
|
+
return {
|
31
|
+
payload: this.payload,
|
32
|
+
type: 1,
|
33
|
+
};
|
34
|
+
}
|
35
|
+
}
|
36
|
+
exports.HexMessage = HexMessage;
|
37
|
+
//# sourceMappingURL=HexMessage.js.map
|
@@ -0,0 +1 @@
|
|
1
|
+
{"version":3,"file":"HexMessage.js","sourceRoot":"","sources":["../../../../src/models/transaction/HexMessage.ts"],"names":[],"mappings":";;AAAA,uCAAoC;AAGpC,gBAAwB,SAAQ,iBAAO;IAErC;;;OAGG;IACH,YAAY,OAAe;QACzB,KAAK,CAAC,OAAO,CAAC,CAAC;IACjB,CAAC;IAED;;;OAGG;IACI,MAAM,CAAC,MAAM,CAAC,OAAe;QAClC,IAAI,GAAG,GAAG,IAAI,GAAG,OAAO,CAAC;QACzB,OAAO,IAAI,UAAU,CAAC,GAAG,CAAC,CAAC;IAC7B,CAAC;IAEM,WAAW;QAChB,OAAO,KAAK,CAAC;IACf,CAAC;IAEM,OAAO;QACZ,OAAO,IAAI,CAAC;IACd,CAAC;IAED;;OAEG;IACI,KAAK;QACV,OAAO;YACL,OAAO,EAAE,IAAI,CAAC,OAAO;YACrB,IAAI,EAAE,CAAC;SACM,CAAC;IAClB,CAAC;CACF;AApCD,gCAoCC"}
|