nme-library 2.0.0-RC4
Sign up to get free protection for your applications and to get access to all the features.
- package/4xhj3q2e.cjs +1 -0
- 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
@@ -0,0 +1,85 @@
|
|
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 requestPromise = require("request-promise-native");
|
27
|
+
const rxjs_1 = require("rxjs");
|
28
|
+
const AssetDefinition_1 = require("../models/asset/AssetDefinition");
|
29
|
+
const AssetTransferable_1 = require("../models/asset/AssetTransferable");
|
30
|
+
const HttpEndpoint_1 = require("./HttpEndpoint");
|
31
|
+
const operators_1 = require("rxjs/operators");
|
32
|
+
class AssetHttp extends HttpEndpoint_1.HttpEndpoint {
|
33
|
+
constructor(nodes) {
|
34
|
+
super("namespace", nodes);
|
35
|
+
}
|
36
|
+
/**
|
37
|
+
* Gets the asset definitions for a given namespace. The request supports paging.
|
38
|
+
* @param namespace
|
39
|
+
* @param id - The topmost asset definition database id up to which root asset definitions are returned. The parameter is optional. If not supplied the most recent asset definitiona are returned.
|
40
|
+
* @param pageSize - The number of asset definition objects to be returned for each request. The parameter is optional. The default value is 25, the minimum value is 5 and hte maximum value is 100.
|
41
|
+
* @returns Observable<AssetDefinition[]>
|
42
|
+
*/
|
43
|
+
getAllAssetsGivenNamespace(namespace, id, pageSize) {
|
44
|
+
const url = "mosaic/definition/page?namespace=" + namespace +
|
45
|
+
(id === undefined ? "" : "&id=" + id) +
|
46
|
+
(pageSize === undefined ? "" : "&pageSize=" + pageSize);
|
47
|
+
return rxjs_1.of(url)
|
48
|
+
.pipe(operators_1.flatMap((url) => requestPromise.get(this.nextNode() + url, { json: true })), operators_1.retryWhen(this.replyWhenRequestError), operators_1.map((mosaicDefinitionsData) => {
|
49
|
+
return mosaicDefinitionsData.data.map((mosaicDefinitionMetaDataPairDTO) => {
|
50
|
+
return AssetDefinition_1.AssetDefinition.createFromMosaicDefinitionMetaDataPairDTO(mosaicDefinitionMetaDataPairDTO);
|
51
|
+
});
|
52
|
+
}));
|
53
|
+
}
|
54
|
+
/**
|
55
|
+
* Return the Mosaic Definition given a namespace and asset. Throw exception if no asset is found
|
56
|
+
* @param {string} assetId
|
57
|
+
* @returns {Observable<AssetDefinition>}
|
58
|
+
*/
|
59
|
+
getAssetDefinition(assetId) {
|
60
|
+
return this.getAllAssetsGivenNamespace(assetId.namespaceId, undefined, 100)
|
61
|
+
.pipe(operators_1.flatMap((_) => _), operators_1.filter((assetDefinition) => assetDefinition.id.equals(assetId)), operators_1.last());
|
62
|
+
}
|
63
|
+
/**
|
64
|
+
* Return a AssetTransferable
|
65
|
+
* @param {string} assetId
|
66
|
+
* @param {number} quantity
|
67
|
+
* @returns {Observable<AssetTransferable>}
|
68
|
+
*/
|
69
|
+
getAssetTransferableWithAbsoluteAmount(assetId, quantity) {
|
70
|
+
return this.getAssetDefinition(assetId)
|
71
|
+
.pipe(operators_1.map((assetDefinition) => AssetTransferable_1.AssetTransferable.createAbsolute(assetDefinition.id, assetDefinition.properties, quantity, assetDefinition.levy)));
|
72
|
+
}
|
73
|
+
/**
|
74
|
+
* Return a AssetTransferable
|
75
|
+
* @param {string} assetId
|
76
|
+
* @param {number} quantity
|
77
|
+
* @returns {Observable<AssetTransferable>}
|
78
|
+
*/
|
79
|
+
getAssetTransferableWithRelativeAmount(assetId, quantity) {
|
80
|
+
return this.getAssetDefinition(assetId)
|
81
|
+
.pipe(operators_1.map((assetDefinition) => AssetTransferable_1.AssetTransferable.createRelative(assetDefinition.id, assetDefinition.properties, quantity, assetDefinition.levy)));
|
82
|
+
}
|
83
|
+
}
|
84
|
+
exports.AssetHttp = AssetHttp;
|
85
|
+
//# sourceMappingURL=AssetHttp.js.map
|
@@ -0,0 +1 @@
|
|
1
|
+
{"version":3,"file":"AssetHttp.js","sourceRoot":"","sources":["../../../src/infrastructure/AssetHttp.ts"],"names":[],"mappings":";AAAA;;;;;;;;;;;;;;;;;;;;;;GAsBG;;AAEH,yDAAyD;AACzD,+BAAoC;AACpC,qEAAgE;AAEhE,yEAAoE;AACpE,iDAA0D;AAE1D,8CAAqE;AAErE,eAAuB,SAAQ,2BAAY;IAEzC,YAAY,KAAsB;QAChC,KAAK,CAAC,WAAW,EAAE,KAAK,CAAC,CAAC;IAC5B,CAAC;IAED;;;;;;OAMG;IACI,0BAA0B,CAAC,SAAiB,EAAE,EAAW,EAAE,QAAiB;QACjF,MAAM,GAAG,GAAG,mCAAmC,GAAG,SAAS;YACzD,CAAC,EAAE,KAAK,SAAS,CAAC,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC,MAAM,GAAG,EAAE,CAAC;YACrC,CAAC,QAAQ,KAAK,SAAS,CAAC,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC,YAAY,GAAG,QAAQ,CAAC,CAAC;QAE1D,OAAO,SAAE,CAAC,GAAG,CAAC;aACX,IAAI,CACH,mBAAO,CAAC,CAAC,GAAG,EAAE,EAAE,CAAC,cAAc,CAAC,GAAG,CAAC,IAAI,CAAC,QAAQ,EAAE,GAAG,GAAG,EAAE,EAAC,IAAI,EAAE,IAAI,EAAC,CAAC,CAAC,EACzE,qBAAS,CAAC,IAAI,CAAC,qBAAqB,CAAC,EACrC,eAAG,CAAC,CAAC,qBAAqB,EAAE,EAAE;YAC5B,OAAO,qBAAqB,CAAC,IAAI,CAAC,GAAG,CAAC,CAAC,+BAAgE,EAAE,EAAE;gBACzG,OAAO,iCAAe,CAAC,yCAAyC,CAAC,+BAA+B,CAAC,CAAC;YACpG,CAAC,CAAC,CAAC;QACL,CAAC,CAAC,CACH,CAAA;IACL,CAAC;IAED;;;;OAIG;IACI,kBAAkB,CAAC,OAAgB;QACxC,OAAO,IAAI,CAAC,0BAA0B,CAAC,OAAO,CAAC,WAAW,EAAE,SAAS,EAAE,GAAG,CAAC;aACxE,IAAI,CACH,mBAAO,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC,CAAC,CAAC,EACjB,kBAAM,CAAC,CAAC,eAAe,EAAE,EAAE,CAAC,eAAe,CAAC,EAAE,CAAC,MAAM,CAAC,OAAO,CAAC,CAAC,EAC/D,gBAAI,EAAE,CACP,CAAA;IACL,CAAC;IAED;;;;;OAKG;IACI,sCAAsC,CAAC,OAAgB,EAAE,QAAgB;QAC9E,OAAO,IAAI,CAAC,kBAAkB,CAAC,OAAO,CAAC;aACpC,IAAI,CACH,eAAG,CAAC,CAAC,eAAe,EAAE,EAAE,CAAC,qCAAiB,CAAC,cAAc,CAAC,eAAe,CAAC,EAAE,EAAE,eAAe,CAAC,UAAU,EAAE,QAAQ,EAAE,eAAe,CAAC,IAAI,CAAC,CAAC,CAC3I,CAAC;IACN,CAAC;IAED;;;;;OAKG;IACI,sCAAsC,CAAC,OAAgB,EAAE,QAAgB;QAC9E,OAAO,IAAI,CAAC,kBAAkB,CAAC,OAAO,CAAC;aACpC,IAAI,CACH,eAAG,CAAC,CAAC,eAAe,EAAE,EAAE,CAAC,qCAAiB,CAAC,cAAc,CAAC,eAAe,CAAC,EAAE,EAAE,eAAe,CAAC,UAAU,EAAE,QAAQ,EAAE,eAAe,CAAC,IAAI,CAAC,CAAC,CAC3I,CAAA;IACL,CAAC;CACF;AArED,8BAqEC"}
|
@@ -0,0 +1,14 @@
|
|
1
|
+
import { Observable } from "rxjs";
|
2
|
+
import { Block } from "../models/blockchain/Block";
|
3
|
+
import { HttpEndpoint, ServerConfig } from "./HttpEndpoint";
|
4
|
+
export declare type BlockHeight = number;
|
5
|
+
export declare type BlockChainScore = number;
|
6
|
+
export declare class BlockHttp extends HttpEndpoint {
|
7
|
+
constructor(nodes?: ServerConfig[]);
|
8
|
+
/**
|
9
|
+
* Gets a block from the chain that has a given hash.
|
10
|
+
* @param blockHeight
|
11
|
+
* @returns Observable<Block>
|
12
|
+
*/
|
13
|
+
getBlockByHeight(blockHeight: BlockHeight): Observable<Block>;
|
14
|
+
}
|
@@ -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 requestPromise = require("request-promise-native");
|
27
|
+
const rxjs_1 = require("rxjs");
|
28
|
+
const Block_1 = require("../models/blockchain/Block");
|
29
|
+
const HttpEndpoint_1 = require("./HttpEndpoint");
|
30
|
+
const operators_1 = require("rxjs/operators");
|
31
|
+
class BlockHttp extends HttpEndpoint_1.HttpEndpoint {
|
32
|
+
constructor(nodes) {
|
33
|
+
super("block", nodes);
|
34
|
+
}
|
35
|
+
/**
|
36
|
+
* Gets a block from the chain that has a given hash.
|
37
|
+
* @param blockHeight
|
38
|
+
* @returns Observable<Block>
|
39
|
+
*/
|
40
|
+
getBlockByHeight(blockHeight) {
|
41
|
+
return rxjs_1.of("at/public")
|
42
|
+
.pipe(operators_1.flatMap((url) => requestPromise.post({
|
43
|
+
uri: this.nextNode() + url,
|
44
|
+
body: {
|
45
|
+
height: blockHeight,
|
46
|
+
},
|
47
|
+
json: true,
|
48
|
+
})), operators_1.retryWhen(this.replyWhenRequestError), operators_1.map((block) => {
|
49
|
+
return Block_1.Block.createFromBlockDTO(block);
|
50
|
+
}));
|
51
|
+
}
|
52
|
+
}
|
53
|
+
exports.BlockHttp = BlockHttp;
|
54
|
+
//# sourceMappingURL=BlockHttp.js.map
|
@@ -0,0 +1 @@
|
|
1
|
+
{"version":3,"file":"BlockHttp.js","sourceRoot":"","sources":["../../../src/infrastructure/BlockHttp.ts"],"names":[],"mappings":";AAAA;;;;;;;;;;;;;;;;;;;;;;GAsBG;;AAEH,yDAAyD;AACzD,+BAAoC;AACpC,sDAAiD;AAGjD,iDAA0D;AAC1D,8CAAuD;AAKvD,eAAuB,SAAQ,2BAAY;IAEzC,YAAY,KAAsB;QAChC,KAAK,CAAC,OAAO,EAAE,KAAK,CAAC,CAAC;IACxB,CAAC;IAED;;;;OAIG;IACI,gBAAgB,CAAC,WAAwB;QAC9C,OAAO,SAAE,CAAC,WAAW,CAAC;aACnB,IAAI,CACH,mBAAO,CAAC,CAAC,GAAG,EAAE,EAAE,CAAC,cAAc,CAAC,IAAI,CAAC;YACnC,GAAG,EAAE,IAAI,CAAC,QAAQ,EAAE,GAAG,GAAG;YAC1B,IAAI,EAAE;gBACJ,MAAM,EAAE,WAAW;aACF;YACnB,IAAI,EAAE,IAAI;SACX,CAAC,CAAC,EACH,qBAAS,CAAC,IAAI,CAAC,qBAAqB,CAAC,EACrC,eAAG,CAAC,CAAC,KAAe,EAAE,EAAE;YACtB,OAAO,aAAK,CAAC,kBAAkB,CAAC,KAAK,CAAC,CAAC;QACzC,CAAC,CAAC,CACH,CAAA;IACL,CAAC;CACF;AA3BD,8BA2BC"}
|
@@ -0,0 +1,24 @@
|
|
1
|
+
import { Observable } from "rxjs";
|
2
|
+
import { Block } from "../models";
|
3
|
+
import { BlockHeight } from "./BlockHttp";
|
4
|
+
import { Listener, WebSocketConfig } from "./Listener";
|
5
|
+
/**
|
6
|
+
* Blockchain listener
|
7
|
+
*/
|
8
|
+
export declare class BlockchainListener extends Listener {
|
9
|
+
/**
|
10
|
+
* Constructor
|
11
|
+
* @param nodes
|
12
|
+
*/
|
13
|
+
constructor(nodes?: WebSocketConfig[]);
|
14
|
+
/**
|
15
|
+
* Start listening new blocks
|
16
|
+
* @returns {Observable<Block>}
|
17
|
+
*/
|
18
|
+
newBlock(): Observable<Block>;
|
19
|
+
/**
|
20
|
+
* Start listening new blockchain height
|
21
|
+
* @returns {Observable<BlockHeight>}
|
22
|
+
*/
|
23
|
+
newHeight(): Observable<BlockHeight>;
|
24
|
+
}
|
@@ -0,0 +1,93 @@
|
|
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 rxjs_1 = require("rxjs");
|
27
|
+
const operators_1 = require("rxjs/operators");
|
28
|
+
const models_1 = require("../models");
|
29
|
+
const Listener_1 = require("./Listener");
|
30
|
+
/**
|
31
|
+
* Blockchain listener
|
32
|
+
*/
|
33
|
+
class BlockchainListener extends Listener_1.Listener {
|
34
|
+
/**
|
35
|
+
* Constructor
|
36
|
+
* @param nodes
|
37
|
+
*/
|
38
|
+
constructor(nodes) {
|
39
|
+
super(nodes);
|
40
|
+
}
|
41
|
+
/**
|
42
|
+
* Start listening new blocks
|
43
|
+
* @returns {Observable<Block>}
|
44
|
+
*/
|
45
|
+
newBlock() {
|
46
|
+
return rxjs_1.Observable.create((observer) => {
|
47
|
+
const client = this.createClient();
|
48
|
+
client.connect({}, () => {
|
49
|
+
client.subscribe("/blocks", (data) => {
|
50
|
+
try {
|
51
|
+
const dto = JSON.parse(data.body);
|
52
|
+
observer.next(models_1.Block.createFromBlockDTO(dto));
|
53
|
+
}
|
54
|
+
catch (e) {
|
55
|
+
observer.error(e);
|
56
|
+
}
|
57
|
+
});
|
58
|
+
}, (err) => {
|
59
|
+
observer.error(err);
|
60
|
+
});
|
61
|
+
return () => {
|
62
|
+
client.unsubscribe();
|
63
|
+
};
|
64
|
+
}).pipe(operators_1.retry(10));
|
65
|
+
}
|
66
|
+
/**
|
67
|
+
* Start listening new blockchain height
|
68
|
+
* @returns {Observable<BlockHeight>}
|
69
|
+
*/
|
70
|
+
newHeight() {
|
71
|
+
return rxjs_1.Observable.create((observer) => {
|
72
|
+
const client = this.createClient();
|
73
|
+
client.connect({}, () => {
|
74
|
+
client.subscribe("/blocks/new", (data) => {
|
75
|
+
try {
|
76
|
+
const dto = JSON.parse(data.body);
|
77
|
+
observer.next(dto.height);
|
78
|
+
}
|
79
|
+
catch (e) {
|
80
|
+
observer.error(e);
|
81
|
+
}
|
82
|
+
});
|
83
|
+
}, (err) => {
|
84
|
+
observer.error(err);
|
85
|
+
});
|
86
|
+
return () => {
|
87
|
+
client.unsubscribe();
|
88
|
+
};
|
89
|
+
}).pipe(operators_1.retry(10));
|
90
|
+
}
|
91
|
+
}
|
92
|
+
exports.BlockchainListener = BlockchainListener;
|
93
|
+
//# sourceMappingURL=BlockchainListener.js.map
|
@@ -0,0 +1 @@
|
|
1
|
+
{"version":3,"file":"BlockchainListener.js","sourceRoot":"","sources":["../../../src/infrastructure/BlockchainListener.ts"],"names":[],"mappings":";AAAA;;;;;;;;;;;;;;;;;;;;;;GAsBG;;AAEH,+BAA0C;AAC1C,8CAAqC;AACrC,sCAAgC;AAEhC,yCAAqD;AAErD;;GAEG;AACH,wBAAgC,SAAQ,mBAAQ;IAE9C;;;OAGG;IACH,YAAY,KAAyB;QACnC,KAAK,CAAC,KAAK,CAAC,CAAC;IACf,CAAC;IAED;;;OAGG;IACI,QAAQ;QACb,OAAO,iBAAU,CAAC,MAAM,CAAC,CAAC,QAAyB,EAAE,EAAE;YACrD,MAAM,MAAM,GAAG,IAAI,CAAC,YAAY,EAAE,CAAC;YACnC,MAAM,CAAC,OAAO,CAAC,EAAE,EAAE,GAAG,EAAE;gBACtB,MAAM,CAAC,SAAS,CAAC,SAAS,EAAE,CAAC,IAAI,EAAE,EAAE;oBACnC,IAAI;wBACF,MAAM,GAAG,GAAG,IAAI,CAAC,KAAK,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC;wBAClC,QAAQ,CAAC,IAAI,CAAC,cAAK,CAAC,kBAAkB,CAAC,GAAG,CAAC,CAAC,CAAC;qBAC9C;oBAAC,OAAO,CAAC,EAAE;wBACV,QAAQ,CAAC,KAAK,CAAC,CAAC,CAAC,CAAC;qBACnB;gBACH,CAAC,CAAC,CAAC;YACL,CAAC,EAAE,CAAC,GAAG,EAAE,EAAE;gBACT,QAAQ,CAAC,KAAK,CAAC,GAAG,CAAC,CAAC;YACtB,CAAC,CAAC,CAAC;YACH,OAAO,GAAG,EAAE;gBACV,MAAM,CAAC,WAAW,EAAE,CAAC;YACvB,CAAC,CAAC;QACJ,CAAC,CAAC,CAAC,IAAI,CACL,iBAAK,CAAC,EAAE,CAAC,CACV,CAAC;IACJ,CAAC;IAED;;;OAGG;IACI,SAAS;QACd,OAAO,iBAAU,CAAC,MAAM,CAAC,CAAC,QAA+B,EAAE,EAAE;YAC3D,MAAM,MAAM,GAAG,IAAI,CAAC,YAAY,EAAE,CAAC;YACnC,MAAM,CAAC,OAAO,CAAC,EAAE,EAAE,GAAG,EAAE;gBACtB,MAAM,CAAC,SAAS,CAAC,aAAa,EAAE,CAAC,IAAI,EAAE,EAAE;oBACvC,IAAI;wBACF,MAAM,GAAG,GAAG,IAAI,CAAC,KAAK,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC;wBAClC,QAAQ,CAAC,IAAI,CAAC,GAAG,CAAC,MAAM,CAAC,CAAC;qBAC3B;oBAAC,OAAO,CAAC,EAAE;wBACV,QAAQ,CAAC,KAAK,CAAC,CAAC,CAAC,CAAC;qBACnB;gBACH,CAAC,CAAC,CAAC;YACL,CAAC,EAAE,CAAC,GAAG,EAAE,EAAE;gBACT,QAAQ,CAAC,KAAK,CAAC,GAAG,CAAC,CAAC;YACtB,CAAC,CAAC,CAAC;YACH,OAAO,GAAG,EAAE;gBACV,MAAM,CAAC,WAAW,EAAE,CAAC;YACvB,CAAC,CAAC;QACJ,CAAC,CAAC,CAAC,IAAI,CACL,iBAAK,CAAC,EAAE,CAAC,CACV,CAAC;IACJ,CAAC;CACF;AA/DD,gDA+DC"}
|
@@ -0,0 +1,23 @@
|
|
1
|
+
import { Observable } from "rxjs";
|
2
|
+
import { Block } from "../models/blockchain/Block";
|
3
|
+
import { BlockChainScore, BlockHeight } from "./BlockHttp";
|
4
|
+
import { HttpEndpoint, ServerConfig } from "./HttpEndpoint";
|
5
|
+
export declare class ChainHttp extends HttpEndpoint {
|
6
|
+
constructor(nodes?: ServerConfig[]);
|
7
|
+
/**
|
8
|
+
* Gets the current height of the block chain.
|
9
|
+
* @returns Observable<BlockHeight>
|
10
|
+
*/
|
11
|
+
getBlockchainHeight(): Observable<BlockHeight>;
|
12
|
+
/**
|
13
|
+
* Gets the current score of the block chain. The higher the score, the better the chain.
|
14
|
+
* During synchronization, nodes try to get the best block chain in the network.
|
15
|
+
* @returns Observable<BlockChainScore>
|
16
|
+
*/
|
17
|
+
getBlockchainScore(): Observable<BlockChainScore>;
|
18
|
+
/**
|
19
|
+
* Gets the current last block of the chain.
|
20
|
+
* @returns Observable<Block>
|
21
|
+
*/
|
22
|
+
getBlockchainLastBlock(): Observable<Block>;
|
23
|
+
}
|
@@ -0,0 +1,68 @@
|
|
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 requestPromise = require("request-promise-native");
|
27
|
+
const rxjs_1 = require("rxjs");
|
28
|
+
const Block_1 = require("../models/blockchain/Block");
|
29
|
+
const HttpEndpoint_1 = require("./HttpEndpoint");
|
30
|
+
const operators_1 = require("rxjs/operators");
|
31
|
+
class ChainHttp extends HttpEndpoint_1.HttpEndpoint {
|
32
|
+
constructor(nodes) {
|
33
|
+
super("chain", nodes);
|
34
|
+
}
|
35
|
+
/**
|
36
|
+
* Gets the current height of the block chain.
|
37
|
+
* @returns Observable<BlockHeight>
|
38
|
+
*/
|
39
|
+
getBlockchainHeight() {
|
40
|
+
return rxjs_1.of("height")
|
41
|
+
.pipe(operators_1.flatMap((url) => requestPromise.get(this.nextNode() + url, { json: true })), operators_1.retryWhen(this.replyWhenRequestError), operators_1.map((result) => {
|
42
|
+
return result.height;
|
43
|
+
}));
|
44
|
+
}
|
45
|
+
/**
|
46
|
+
* Gets the current score of the block chain. The higher the score, the better the chain.
|
47
|
+
* During synchronization, nodes try to get the best block chain in the network.
|
48
|
+
* @returns Observable<BlockChainScore>
|
49
|
+
*/
|
50
|
+
getBlockchainScore() {
|
51
|
+
return rxjs_1.of("score")
|
52
|
+
.pipe(operators_1.flatMap((url) => requestPromise.get(this.nextNode() + url, { json: true })), operators_1.retryWhen(this.replyWhenRequestError), operators_1.map((result) => {
|
53
|
+
return result.score;
|
54
|
+
}));
|
55
|
+
}
|
56
|
+
/**
|
57
|
+
* Gets the current last block of the chain.
|
58
|
+
* @returns Observable<Block>
|
59
|
+
*/
|
60
|
+
getBlockchainLastBlock() {
|
61
|
+
return rxjs_1.of("last-block")
|
62
|
+
.pipe(operators_1.flatMap((url) => requestPromise.get(this.nextNode() + url, { json: true })), operators_1.retryWhen(this.replyWhenRequestError), operators_1.map((result) => {
|
63
|
+
return Block_1.Block.createFromBlockDTO(result);
|
64
|
+
}));
|
65
|
+
}
|
66
|
+
}
|
67
|
+
exports.ChainHttp = ChainHttp;
|
68
|
+
//# sourceMappingURL=ChainHttp.js.map
|
@@ -0,0 +1 @@
|
|
1
|
+
{"version":3,"file":"ChainHttp.js","sourceRoot":"","sources":["../../../src/infrastructure/ChainHttp.ts"],"names":[],"mappings":";AAAA;;;;;;;;;;;;;;;;;;;;;;GAsBG;;AAEH,yDAAyD;AACzD,+BAAoC;AACpC,sDAAiD;AAEjD,iDAA0D;AAC1D,8CAAuD;AAEvD,eAAuB,SAAQ,2BAAY;IAEzC,YAAY,KAAsB;QAChC,KAAK,CAAC,OAAO,EAAE,KAAK,CAAC,CAAC;IACxB,CAAC;IAED;;;OAGG;IACI,mBAAmB;QACxB,OAAO,SAAE,CAAC,QAAQ,CAAC;aAChB,IAAI,CACH,mBAAO,CAAC,CAAC,GAAG,EAAE,EAAE,CAAC,cAAc,CAAC,GAAG,CAAC,IAAI,CAAC,QAAQ,EAAE,GAAG,GAAG,EAAE,EAAC,IAAI,EAAE,IAAI,EAAC,CAAC,CAAC,EACzE,qBAAS,CAAC,IAAI,CAAC,qBAAqB,CAAC,EACrC,eAAG,CAAC,CAAC,MAAM,EAAE,EAAE;YACb,OAAO,MAAM,CAAC,MAAM,CAAC;QACvB,CAAC,CAAC,CACH,CAAC;IACN,CAAC;IAED;;;;OAIG;IACI,kBAAkB;QACvB,OAAO,SAAE,CAAC,OAAO,CAAC;aACf,IAAI,CACH,mBAAO,CAAC,CAAC,GAAG,EAAE,EAAE,CAAC,cAAc,CAAC,GAAG,CAAC,IAAI,CAAC,QAAQ,EAAE,GAAG,GAAG,EAAE,EAAC,IAAI,EAAE,IAAI,EAAC,CAAC,CAAC,EACzE,qBAAS,CAAC,IAAI,CAAC,qBAAqB,CAAC,EACrC,eAAG,CAAC,CAAC,MAAM,EAAE,EAAE;YACb,OAAO,MAAM,CAAC,KAAK,CAAC;QACtB,CAAC,CAAC,CACH,CAAC;IACN,CAAC;IAED;;;OAGG;IACI,sBAAsB;QAC3B,OAAO,SAAE,CAAC,YAAY,CAAC;aACpB,IAAI,CACH,mBAAO,CAAC,CAAC,GAAG,EAAE,EAAE,CAAC,cAAc,CAAC,GAAG,CAAC,IAAI,CAAC,QAAQ,EAAE,GAAG,GAAG,EAAE,EAAC,IAAI,EAAE,IAAI,EAAC,CAAC,CAAC,EACzE,qBAAS,CAAC,IAAI,CAAC,qBAAqB,CAAC,EACrC,eAAG,CAAC,CAAC,MAAM,EAAE,EAAE;YACb,OAAO,aAAK,CAAC,kBAAkB,CAAC,MAAM,CAAC,CAAC;QAC1C,CAAC,CAAC,CACH,CAAA;IACL,CAAC;CACF;AAnDD,8BAmDC"}
|
@@ -0,0 +1,20 @@
|
|
1
|
+
import { Observable } from "rxjs";
|
2
|
+
import { Address } from "../models/account/Address";
|
3
|
+
import { Transaction } from "../models/transaction/Transaction";
|
4
|
+
import { Listener, WebSocketConfig } from "./Listener";
|
5
|
+
/**
|
6
|
+
* ConfirmedTransaction listener
|
7
|
+
*/
|
8
|
+
export declare class ConfirmedTransactionListener extends Listener {
|
9
|
+
/**
|
10
|
+
* Constructor
|
11
|
+
* @param nodes
|
12
|
+
*/
|
13
|
+
constructor(nodes?: WebSocketConfig[]);
|
14
|
+
/**
|
15
|
+
* Start listening new confirmed transactions
|
16
|
+
* @param address
|
17
|
+
* @returns {Observable<Transaction>}
|
18
|
+
*/
|
19
|
+
given(address: Address): Observable<Transaction>;
|
20
|
+
}
|
@@ -0,0 +1,76 @@
|
|
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 _ = require("lodash");
|
27
|
+
const rxjs_1 = require("rxjs");
|
28
|
+
const operators_1 = require("rxjs/operators");
|
29
|
+
const Listener_1 = require("./Listener");
|
30
|
+
const CreateTransactionFromDTO_1 = require("./transaction/CreateTransactionFromDTO");
|
31
|
+
/**
|
32
|
+
* ConfirmedTransaction listener
|
33
|
+
*/
|
34
|
+
class ConfirmedTransactionListener extends Listener_1.Listener {
|
35
|
+
/**
|
36
|
+
* Constructor
|
37
|
+
* @param nodes
|
38
|
+
*/
|
39
|
+
constructor(nodes) {
|
40
|
+
super(nodes);
|
41
|
+
}
|
42
|
+
/**
|
43
|
+
* Start listening new confirmed transactions
|
44
|
+
* @param address
|
45
|
+
* @returns {Observable<Transaction>}
|
46
|
+
*/
|
47
|
+
given(address) {
|
48
|
+
return rxjs_1.Observable.create((observer) => {
|
49
|
+
let lastTransaction;
|
50
|
+
const client = this.createClient();
|
51
|
+
client.connect({}, () => {
|
52
|
+
//initial subscription to address.
|
53
|
+
client.send("/w/api/account/subscribe", {}, "{'account':'" + address.plain() + "'}");
|
54
|
+
client.subscribe("/transactions/" + address.plain(), (data) => {
|
55
|
+
try {
|
56
|
+
const transaction = CreateTransactionFromDTO_1.CreateTransactionFromDTO(JSON.parse(data.body));
|
57
|
+
if (!_.isEqual(transaction, lastTransaction)) {
|
58
|
+
observer.next(transaction);
|
59
|
+
}
|
60
|
+
lastTransaction = transaction;
|
61
|
+
}
|
62
|
+
catch (e) {
|
63
|
+
observer.error(e);
|
64
|
+
}
|
65
|
+
});
|
66
|
+
}, (err) => {
|
67
|
+
observer.error(err);
|
68
|
+
});
|
69
|
+
return () => {
|
70
|
+
client.unsubscribe();
|
71
|
+
};
|
72
|
+
}).pipe(operators_1.retry(10));
|
73
|
+
}
|
74
|
+
}
|
75
|
+
exports.ConfirmedTransactionListener = ConfirmedTransactionListener;
|
76
|
+
//# sourceMappingURL=ConfirmedTransactionListener.js.map
|
@@ -0,0 +1 @@
|
|
1
|
+
{"version":3,"file":"ConfirmedTransactionListener.js","sourceRoot":"","sources":["../../../src/infrastructure/ConfirmedTransactionListener.ts"],"names":[],"mappings":";AAAA;;;;;;;;;;;;;;;;;;;;;;GAsBG;;AAEH,4BAA4B;AAC5B,+BAA0C;AAC1C,8CAAqC;AAGrC,yCAAqD;AACrD,qFAAgF;AAEhF;;GAEG;AACH,kCAA0C,SAAQ,mBAAQ;IAExD;;;OAGG;IACH,YAAY,KAAyB;QACnC,KAAK,CAAC,KAAK,CAAC,CAAC;IACf,CAAC;IAED;;;;OAIG;IACI,KAAK,CAAC,OAAgB;QAC3B,OAAO,iBAAU,CAAC,MAAM,CAAC,CAAC,QAA+B,EAAE,EAAE;YAC3D,IAAI,eAA4B,CAAC;YACjC,MAAM,MAAM,GAAG,IAAI,CAAC,YAAY,EAAE,CAAC;YAEnC,MAAM,CAAC,OAAO,CAAC,EAAE,EAAE,GAAG,EAAE;gBACtB,kCAAkC;gBAClC,MAAM,CAAC,IAAI,CAAC,0BAA0B,EAAE,EAAE,EAAE,cAAc,GAAG,OAAO,CAAC,KAAK,EAAE,GAAG,IAAI,CAAC,CAAC;gBACrF,MAAM,CAAC,SAAS,CAAC,gBAAgB,GAAG,OAAO,CAAC,KAAK,EAAE,EAAE,CAAC,IAAI,EAAE,EAAE;oBAC5D,IAAI;wBACF,MAAM,WAAW,GAAG,mDAAwB,CAAC,IAAI,CAAC,KAAK,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC,CAAC;wBACpE,IAAI,CAAC,CAAC,CAAC,OAAO,CAAC,WAAW,EAAE,eAAe,CAAC,EAAE;4BAC5C,QAAQ,CAAC,IAAI,CAAC,WAAW,CAAC,CAAC;yBAC5B;wBACD,eAAe,GAAG,WAAW,CAAC;qBAC/B;oBAAC,OAAO,CAAC,EAAE;wBACV,QAAQ,CAAC,KAAK,CAAC,CAAC,CAAC,CAAC;qBACnB;gBACH,CAAC,CAAC,CAAC;YACL,CAAC,EAAE,CAAC,GAAG,EAAE,EAAE;gBACT,QAAQ,CAAC,KAAK,CAAC,GAAG,CAAC,CAAC;YACtB,CAAC,CAAC,CAAC;YACH,OAAO,GAAG,EAAE;gBACV,MAAM,CAAC,WAAW,EAAE,CAAC;YACvB,CAAC,CAAC;QACJ,CAAC,CAAC,CAAC,IAAI,CACL,iBAAK,CAAC,EAAE,CAAC,CACV,CAAC;IACJ,CAAC;CACF;AA5CD,oEA4CC"}
|
@@ -0,0 +1 @@
|
|
1
|
+
export {};
|
@@ -0,0 +1,52 @@
|
|
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 Pageable_1 = require("./Pageable");
|
27
|
+
/**
|
28
|
+
* @internal
|
29
|
+
*/
|
30
|
+
class HarvestInfoPageable extends Pageable_1.Pageable {
|
31
|
+
constructor(source, address, id) {
|
32
|
+
super();
|
33
|
+
this.resource = source;
|
34
|
+
this.address = address;
|
35
|
+
this.id = id;
|
36
|
+
}
|
37
|
+
nextPage() {
|
38
|
+
this.resource.getHarvestInfoDataForAnAccount(this.address, this.id).subscribe((next) => {
|
39
|
+
if (next.length != 0) {
|
40
|
+
this.id = (next[next.length - 1].id).toString();
|
41
|
+
this.next(next);
|
42
|
+
}
|
43
|
+
else {
|
44
|
+
this.complete();
|
45
|
+
}
|
46
|
+
}, (err) => {
|
47
|
+
this.error(err);
|
48
|
+
});
|
49
|
+
}
|
50
|
+
}
|
51
|
+
exports.HarvestInfoPageable = HarvestInfoPageable;
|
52
|
+
//# sourceMappingURL=HarvestInfoPageable.js.map
|
@@ -0,0 +1 @@
|
|
1
|
+
{"version":3,"file":"HarvestInfoPageable.js","sourceRoot":"","sources":["../../../src/infrastructure/HarvestInfoPageable.ts"],"names":[],"mappings":";AAAA;;;;;;;;;;;;;;;;;;;;;;GAsBG;;AAMH,yCAAoC;AAEpC;;GAEG;AACH,yBAAiC,SAAQ,mBAA8B;IAKrE,YAAY,MAAmB,EAAE,OAAgB,EAAE,EAAW;QAC5D,KAAK,EAAE,CAAC;QACR,IAAI,CAAC,QAAQ,GAAG,MAAM,CAAC;QACvB,IAAI,CAAC,OAAO,GAAG,OAAO,CAAC;QACvB,IAAI,CAAC,EAAE,GAAG,EAAE,CAAC;IACf,CAAC;IAEM,QAAQ;QACb,IAAI,CAAC,QAAQ,CAAC,8BAA8B,CAAC,IAAI,CAAC,OAAO,EAAE,IAAI,CAAC,EAAE,CAAC,CAAC,SAAS,CAAC,CAAC,IAAI,EAAE,EAAE;YACrF,IAAI,IAAI,CAAC,MAAM,IAAI,CAAC,EAAE;gBACpB,IAAI,CAAC,EAAE,GAAG,CAAC,IAAI,CAAC,IAAI,CAAC,MAAM,GAAG,CAAC,CAAC,CAAC,EAAE,CAAC,CAAC,QAAQ,EAAE,CAAC;gBAChD,IAAI,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC;aACjB;iBAAM;gBACL,IAAI,CAAC,QAAQ,EAAE,CAAC;aACjB;QACH,CAAC,EAAE,CAAC,GAAG,EAAE,EAAE;YACT,IAAI,CAAC,KAAK,CAAC,GAAG,CAAC,CAAC;QAClB,CAAC,CAAC,CAAC;IACL,CAAC;CACF;AAxBD,kDAwBC"}
|
@@ -0,0 +1,15 @@
|
|
1
|
+
export declare type Protocol = "http" | "https";
|
2
|
+
export interface ServerConfig {
|
3
|
+
readonly protocol?: Protocol;
|
4
|
+
readonly domain: string;
|
5
|
+
readonly port?: number;
|
6
|
+
}
|
7
|
+
export declare abstract class HttpEndpoint {
|
8
|
+
private resource;
|
9
|
+
private readonly nodes;
|
10
|
+
private readonly historicalNodes;
|
11
|
+
private pointer;
|
12
|
+
private historicalPointer;
|
13
|
+
constructor(resource: string, nodes?: ServerConfig[], preferProtocol?: Protocol);
|
14
|
+
protected replyWhenRequestError: (errors: any) => any;
|
15
|
+
}
|