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,129 @@
|
|
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 Balance_1 = require("./Balance");
|
27
|
+
const PublicAccount_1 = require("./PublicAccount");
|
28
|
+
var RemoteStatus;
|
29
|
+
(function (RemoteStatus) {
|
30
|
+
RemoteStatus["REMOTE"] = "REMOTE";
|
31
|
+
RemoteStatus["ACTIVATING"] = "ACTIVATING";
|
32
|
+
RemoteStatus["ACTIVE"] = "ACTIVE";
|
33
|
+
RemoteStatus["DEACTIVATING"] = "DEACTIVATING";
|
34
|
+
RemoteStatus["INACTIVE"] = "INACTIVE";
|
35
|
+
})(RemoteStatus = exports.RemoteStatus || (exports.RemoteStatus = {}));
|
36
|
+
var Status;
|
37
|
+
(function (Status) {
|
38
|
+
Status["UNKNOWN"] = "UNKNOWN";
|
39
|
+
Status["LOCKED"] = "LOCKED";
|
40
|
+
Status["UNLOCKED"] = "UNLOCKED";
|
41
|
+
})(Status = exports.Status || (exports.Status = {}));
|
42
|
+
/**
|
43
|
+
* The account structure describes basic information for an account.
|
44
|
+
*/
|
45
|
+
class AccountInfo {
|
46
|
+
/**
|
47
|
+
* @internal
|
48
|
+
* @param balance
|
49
|
+
* @param vestedBalance
|
50
|
+
* @param importance
|
51
|
+
* @param publicKey
|
52
|
+
* @param harvestedBlocks
|
53
|
+
* @param cosignatoriesCount
|
54
|
+
* @param minCosignatories
|
55
|
+
*/
|
56
|
+
constructor(balance, vestedBalance, importance, publicKey, harvestedBlocks, cosignatoriesCount, minCosignatories) {
|
57
|
+
this.balance = new Balance_1.Balance(balance, vestedBalance);
|
58
|
+
this.importance = importance;
|
59
|
+
if (publicKey != null) {
|
60
|
+
this.publicAccount = PublicAccount_1.PublicAccount.createWithPublicKey(publicKey);
|
61
|
+
}
|
62
|
+
this.harvestedBlocks = harvestedBlocks;
|
63
|
+
this.cosignatoriesCount = cosignatoriesCount;
|
64
|
+
this.minCosignatories = minCosignatories;
|
65
|
+
}
|
66
|
+
/**
|
67
|
+
* @internal
|
68
|
+
* @param dto
|
69
|
+
* @returns {AccountInfo}
|
70
|
+
*/
|
71
|
+
static createFromAccountInfoDTO(dto) {
|
72
|
+
return new AccountInfo(dto.balance, dto.vestedBalance, dto.importance, dto.publicKey, dto.harvestedBlocks);
|
73
|
+
}
|
74
|
+
}
|
75
|
+
exports.AccountInfo = AccountInfo;
|
76
|
+
class AccountInfoWithMetaData extends AccountInfo {
|
77
|
+
/**
|
78
|
+
* @internal
|
79
|
+
* @param status
|
80
|
+
* @param remoteStatus
|
81
|
+
* @param cosignatoryOf
|
82
|
+
* @param cosignatories
|
83
|
+
* @param balance
|
84
|
+
* @param vestedBalance
|
85
|
+
* @param importance
|
86
|
+
* @param publicKey
|
87
|
+
* @param harvestedBlocks
|
88
|
+
* @param cosignatoriesCount
|
89
|
+
* @param minCosignatories
|
90
|
+
*/
|
91
|
+
constructor(status, remoteStatus, cosignatoryOf, cosignatories, balance, vestedBalance, importance, publicKey, harvestedBlocks, cosignatoriesCount, minCosignatories) {
|
92
|
+
super(balance, vestedBalance, importance, publicKey, harvestedBlocks, cosignatoriesCount, minCosignatories);
|
93
|
+
this.status = status;
|
94
|
+
this.remoteStatus = remoteStatus;
|
95
|
+
this.cosignatoryOf = cosignatoryOf;
|
96
|
+
this.cosignatories = cosignatories;
|
97
|
+
}
|
98
|
+
/**
|
99
|
+
* @internal
|
100
|
+
* @param dto
|
101
|
+
* @returns {AccountInfoWithMetaData}
|
102
|
+
*/
|
103
|
+
static createFromAccountMetaDataPairDTO(dto) {
|
104
|
+
return new AccountInfoWithMetaData(Status[dto.meta.status], RemoteStatus[dto.meta.remoteStatus], dto.meta.cosignatoryOf.map((accountInfoDTO) => AccountInfo.createFromAccountInfoDTO(accountInfoDTO)), dto.meta.cosignatories.map((accountInfoDTO) => AccountInfo.createFromAccountInfoDTO(accountInfoDTO)), dto.account.balance, dto.account.vestedBalance, dto.account.importance, dto.account.publicKey, dto.account.harvestedBlocks, dto.account.multisigInfo.cosignatoriesCount, dto.account.multisigInfo.minCosignatories);
|
105
|
+
}
|
106
|
+
}
|
107
|
+
exports.AccountInfoWithMetaData = AccountInfoWithMetaData;
|
108
|
+
// TODO: Solve this, issue with AccountHttp.status(address: Address)
|
109
|
+
class AccountStatus {
|
110
|
+
/**
|
111
|
+
* @internal
|
112
|
+
*/
|
113
|
+
constructor(status, remoteStatus, cosignatoryOf, cosignatories) {
|
114
|
+
this.status = status;
|
115
|
+
this.remoteStatus = remoteStatus;
|
116
|
+
this.cosignatoryOf = cosignatoryOf;
|
117
|
+
this.cosignatories = cosignatories;
|
118
|
+
}
|
119
|
+
/**
|
120
|
+
* @internal
|
121
|
+
* @param dto
|
122
|
+
* @returns {AccountInfoWithMetaData}
|
123
|
+
*/
|
124
|
+
static createFromAccountMetaDataDTO(dto) {
|
125
|
+
return new AccountStatus(Status[dto.status], RemoteStatus[dto.remoteStatus], dto.cosignatoryOf.map((accountInfoDTO) => AccountInfo.createFromAccountInfoDTO(accountInfoDTO)), dto.cosignatories.map((accountInfoDTO) => AccountInfo.createFromAccountInfoDTO(accountInfoDTO)));
|
126
|
+
}
|
127
|
+
}
|
128
|
+
exports.AccountStatus = AccountStatus;
|
129
|
+
//# sourceMappingURL=AccountInfo.js.map
|
@@ -0,0 +1 @@
|
|
1
|
+
{"version":3,"file":"AccountInfo.js","sourceRoot":"","sources":["../../../../src/models/account/AccountInfo.ts"],"names":[],"mappings":"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"}
|
@@ -0,0 +1,25 @@
|
|
1
|
+
import { NetworkTypes } from "../node/NetworkTypes";
|
2
|
+
/**
|
3
|
+
* Address model
|
4
|
+
*/
|
5
|
+
export declare class Address {
|
6
|
+
private readonly value;
|
7
|
+
private readonly networkType;
|
8
|
+
constructor(address: string);
|
9
|
+
/**
|
10
|
+
* Get address in plain format ex: TALICEROONSJCPHC63F52V6FY3SDMSVAEUGHMB7C
|
11
|
+
* @returns {string}
|
12
|
+
*/
|
13
|
+
plain(): string;
|
14
|
+
/**
|
15
|
+
* Get address in pretty format ex: TALICE-ROONSJ-CPHC63-F52V6F-Y3SDMS-VAEUGH-MB7C
|
16
|
+
* @returns {string}
|
17
|
+
*/
|
18
|
+
pretty(): string;
|
19
|
+
/**
|
20
|
+
* Address network
|
21
|
+
* @returns {number}
|
22
|
+
*/
|
23
|
+
network(): NetworkTypes;
|
24
|
+
equals(otherAddress: Address): boolean;
|
25
|
+
}
|
@@ -0,0 +1,80 @@
|
|
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 NetworkTypes_1 = require("../node/NetworkTypes");
|
27
|
+
/**
|
28
|
+
* Address model
|
29
|
+
*/
|
30
|
+
class Address {
|
31
|
+
constructor(address) {
|
32
|
+
this.value = address.replace(/-/g, "").trim().toUpperCase();
|
33
|
+
if (this.value.charAt(0) == "T") {
|
34
|
+
this.networkType = NetworkTypes_1.NetworkTypes.TEST_NET;
|
35
|
+
}
|
36
|
+
else if (this.value.charAt(0) == "N") {
|
37
|
+
this.networkType = NetworkTypes_1.NetworkTypes.MAIN_NET;
|
38
|
+
}
|
39
|
+
else if (this.value.charAt(0) == "M") {
|
40
|
+
this.networkType = NetworkTypes_1.NetworkTypes.MIJIN_NET;
|
41
|
+
}
|
42
|
+
else {
|
43
|
+
throw new Error("NetworkType invalid");
|
44
|
+
}
|
45
|
+
}
|
46
|
+
/**
|
47
|
+
* Get address in plain format ex: TALICEROONSJCPHC63F52V6FY3SDMSVAEUGHMB7C
|
48
|
+
* @returns {string}
|
49
|
+
*/
|
50
|
+
plain() {
|
51
|
+
return this.value;
|
52
|
+
}
|
53
|
+
/**
|
54
|
+
* Get address in pretty format ex: TALICE-ROONSJ-CPHC63-F52V6F-Y3SDMS-VAEUGH-MB7C
|
55
|
+
* @returns {string}
|
56
|
+
*/
|
57
|
+
pretty() {
|
58
|
+
return this.value.match(/.{1,6}/g).join("-");
|
59
|
+
}
|
60
|
+
/**
|
61
|
+
* Address network
|
62
|
+
* @returns {number}
|
63
|
+
*/
|
64
|
+
network() {
|
65
|
+
if (this.value.charAt(0) == "T") {
|
66
|
+
return NetworkTypes_1.NetworkTypes.TEST_NET;
|
67
|
+
}
|
68
|
+
else if (this.value.charAt(0) == "N") {
|
69
|
+
return NetworkTypes_1.NetworkTypes.MAIN_NET;
|
70
|
+
}
|
71
|
+
else {
|
72
|
+
return NetworkTypes_1.NetworkTypes.MIJIN_NET;
|
73
|
+
}
|
74
|
+
}
|
75
|
+
equals(otherAddress) {
|
76
|
+
return this.plain() == otherAddress.plain();
|
77
|
+
}
|
78
|
+
}
|
79
|
+
exports.Address = Address;
|
80
|
+
//# sourceMappingURL=Address.js.map
|
@@ -0,0 +1 @@
|
|
1
|
+
{"version":3,"file":"Address.js","sourceRoot":"","sources":["../../../../src/models/account/Address.ts"],"names":[],"mappings":";AAAA;;;;;;;;;;;;;;;;;;;;;;GAsBG;;AAEH,uDAAkD;AAElD;;GAEG;AACH;IAIE,YAAY,OAAe;QACzB,IAAI,CAAC,KAAK,GAAG,OAAO,CAAC,OAAO,CAAC,IAAI,EAAE,EAAE,CAAC,CAAC,IAAI,EAAE,CAAC,WAAW,EAAE,CAAC;QAC5D,IAAI,IAAI,CAAC,KAAK,CAAC,MAAM,CAAC,CAAC,CAAC,IAAI,GAAG,EAAE;YAC/B,IAAI,CAAC,WAAW,GAAG,2BAAY,CAAC,QAAQ,CAAC;SAC1C;aAAM,IAAI,IAAI,CAAC,KAAK,CAAC,MAAM,CAAC,CAAC,CAAC,IAAI,GAAG,EAAE;YACtC,IAAI,CAAC,WAAW,GAAG,2BAAY,CAAC,QAAQ,CAAC;SAC1C;aAAM,IAAI,IAAI,CAAC,KAAK,CAAC,MAAM,CAAC,CAAC,CAAC,IAAI,GAAG,EAAE;YACtC,IAAI,CAAC,WAAW,GAAG,2BAAY,CAAC,SAAS,CAAC;SAC3C;aAAM;YACL,MAAM,IAAI,KAAK,CAAC,qBAAqB,CAAC,CAAC;SACxC;IACH,CAAC;IAED;;;OAGG;IACI,KAAK;QACV,OAAO,IAAI,CAAC,KAAK,CAAC;IACpB,CAAC;IAED;;;OAGG;IACI,MAAM;QACX,OAAO,IAAI,CAAC,KAAK,CAAC,KAAK,CAAC,SAAS,CAAE,CAAC,IAAI,CAAC,GAAG,CAAC,CAAC;IAChD,CAAC;IAED;;;OAGG;IACI,OAAO;QACZ,IAAI,IAAI,CAAC,KAAK,CAAC,MAAM,CAAC,CAAC,CAAC,IAAI,GAAG,EAAE;YAC/B,OAAO,2BAAY,CAAC,QAAQ,CAAC;SAC9B;aAAM,IAAI,IAAI,CAAC,KAAK,CAAC,MAAM,CAAC,CAAC,CAAC,IAAI,GAAG,EAAE;YACtC,OAAO,2BAAY,CAAC,QAAQ,CAAC;SAC9B;aAAM;YACL,OAAO,2BAAY,CAAC,SAAS,CAAC;SAC/B;IACH,CAAC;IAEM,MAAM,CAAC,YAAqB;QACjC,OAAO,IAAI,CAAC,KAAK,EAAE,IAAI,YAAY,CAAC,KAAK,EAAE,CAAC;IAC9C,CAAC;CACF;AAlDD,0BAkDC"}
|
@@ -0,0 +1,17 @@
|
|
1
|
+
/**
|
2
|
+
* Balance model
|
3
|
+
*/
|
4
|
+
export declare class Balance {
|
5
|
+
/**
|
6
|
+
* The balance of the account in micro NEM.
|
7
|
+
*/
|
8
|
+
readonly balance: number;
|
9
|
+
/**
|
10
|
+
* The vested part of the balance of the account in micro NEM.
|
11
|
+
*/
|
12
|
+
readonly vestedBalance: number;
|
13
|
+
/**
|
14
|
+
* The unvested part of the balance of the account in micro NEM.
|
15
|
+
*/
|
16
|
+
readonly unvestedBalance: number;
|
17
|
+
}
|
@@ -0,0 +1,42 @@
|
|
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
|
+
/**
|
27
|
+
* Balance model
|
28
|
+
*/
|
29
|
+
class Balance {
|
30
|
+
/**
|
31
|
+
* @internal
|
32
|
+
* @param balance
|
33
|
+
* @param vestedBalance
|
34
|
+
*/
|
35
|
+
constructor(balance, vestedBalance) {
|
36
|
+
this.balance = balance;
|
37
|
+
this.vestedBalance = vestedBalance;
|
38
|
+
this.unvestedBalance = balance - vestedBalance;
|
39
|
+
}
|
40
|
+
}
|
41
|
+
exports.Balance = Balance;
|
42
|
+
//# sourceMappingURL=Balance.js.map
|
@@ -0,0 +1 @@
|
|
1
|
+
{"version":3,"file":"Balance.js","sourceRoot":"","sources":["../../../../src/models/account/Balance.ts"],"names":[],"mappings":";AAAA;;;;;;;;;;;;;;;;;;;;;;GAsBG;;AAEH;;GAEG;AACH;IAiBE;;;;OAIG;IACH,YACE,OAAe,EACf,aAAqB;QAErB,IAAI,CAAC,OAAO,GAAG,OAAO,CAAC;QACvB,IAAI,CAAC,aAAa,GAAG,aAAa,CAAC;QACnC,IAAI,CAAC,eAAe,GAAG,OAAO,GAAG,aAAa,CAAC;IACjD,CAAC;CACF;AA9BD,0BA8BC"}
|
@@ -0,0 +1,38 @@
|
|
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
|
+
class NodeHarvestInfo {
|
27
|
+
/**
|
28
|
+
* @internal
|
29
|
+
* @param maxUnlocked
|
30
|
+
* @param numUnlocked
|
31
|
+
*/
|
32
|
+
constructor(maxUnlocked, numUnlocked) {
|
33
|
+
this.maxUnlocked = maxUnlocked;
|
34
|
+
this.numUnlocked = numUnlocked;
|
35
|
+
}
|
36
|
+
}
|
37
|
+
exports.NodeHarvestInfo = NodeHarvestInfo;
|
38
|
+
//# sourceMappingURL=NodeHarvestInfo.js.map
|
@@ -0,0 +1 @@
|
|
1
|
+
{"version":3,"file":"NodeHarvestInfo.js","sourceRoot":"","sources":["../../../../src/models/account/NodeHarvestInfo.ts"],"names":[],"mappings":";AAAA;;;;;;;;;;;;;;;;;;;;;;GAsBG;;AAEH;IAYE;;;;OAIG;IACH,YACE,WAAmB,EACnB,WAAmB;QAEnB,IAAI,CAAC,WAAW,GAAG,WAAW,CAAC;QAC/B,IAAI,CAAC,WAAW,GAAG,WAAW,CAAC;IACjC,CAAC;CAEF;AAzBD,0CAyBC"}
|
@@ -0,0 +1,25 @@
|
|
1
|
+
import { Address } from "./Address";
|
2
|
+
/**
|
3
|
+
* Public account model
|
4
|
+
*/
|
5
|
+
export declare class PublicAccount {
|
6
|
+
readonly address: Address;
|
7
|
+
readonly publicKey: string;
|
8
|
+
/**
|
9
|
+
* @returns {boolean}
|
10
|
+
*/
|
11
|
+
hasPublicKey(): boolean;
|
12
|
+
/**
|
13
|
+
* Creates a new PublicAccount from a public key
|
14
|
+
* @param publicKey
|
15
|
+
* @returns {PublicAccount}
|
16
|
+
*/
|
17
|
+
static createWithPublicKey(publicKey: string): PublicAccount;
|
18
|
+
/**
|
19
|
+
* verify message
|
20
|
+
* @param signedMessage
|
21
|
+
* @param signature
|
22
|
+
* @returns true/false
|
23
|
+
*/
|
24
|
+
verifySignedMessage(signedMessage: string, signature: string): any;
|
25
|
+
}
|
@@ -0,0 +1,82 @@
|
|
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 NEMLibrary_1 = require("../../NEMLibrary");
|
28
|
+
const NetworkTypes_1 = require("../node/NetworkTypes");
|
29
|
+
const Address_1 = require("./Address");
|
30
|
+
/**
|
31
|
+
* Public account model
|
32
|
+
*/
|
33
|
+
class PublicAccount {
|
34
|
+
/**
|
35
|
+
* @internal
|
36
|
+
* @param address
|
37
|
+
* @param publicKey
|
38
|
+
*/
|
39
|
+
constructor(address, publicKey) {
|
40
|
+
this.address = address;
|
41
|
+
this.publicKey = publicKey;
|
42
|
+
}
|
43
|
+
/**
|
44
|
+
* @returns {boolean}
|
45
|
+
*/
|
46
|
+
hasPublicKey() {
|
47
|
+
return this.publicKey != null && (this.publicKey.length === 64 || this.publicKey.length === 66);
|
48
|
+
}
|
49
|
+
/**
|
50
|
+
* Creates a new PublicAccount from a public key
|
51
|
+
* @param publicKey
|
52
|
+
* @returns {PublicAccount}
|
53
|
+
*/
|
54
|
+
static createWithPublicKey(publicKey) {
|
55
|
+
if (publicKey == null || (publicKey.length !== 64 && publicKey.length !== 66)) {
|
56
|
+
throw new Error("Not a valid public key");
|
57
|
+
}
|
58
|
+
let network;
|
59
|
+
if (NEMLibrary_1.NEMLibrary.getNetworkType() === NetworkTypes_1.NetworkTypes.MAIN_NET) {
|
60
|
+
network = nemSdk.default.model.network.data.mainnet.id;
|
61
|
+
}
|
62
|
+
else if (NEMLibrary_1.NEMLibrary.getNetworkType() === NetworkTypes_1.NetworkTypes.TEST_NET) {
|
63
|
+
network = nemSdk.default.model.network.data.testnet.id;
|
64
|
+
}
|
65
|
+
else if (NEMLibrary_1.NEMLibrary.getNetworkType() == NetworkTypes_1.NetworkTypes.MIJIN_NET) {
|
66
|
+
network = nemSdk.default.model.network.data.mijin.id;
|
67
|
+
}
|
68
|
+
const address = nemSdk.default.model.address.toAddress(publicKey, network);
|
69
|
+
return new PublicAccount(new Address_1.Address(address), publicKey);
|
70
|
+
}
|
71
|
+
/**
|
72
|
+
* verify message
|
73
|
+
* @param signedMessage
|
74
|
+
* @param signature
|
75
|
+
* @returns true/false
|
76
|
+
*/
|
77
|
+
verifySignedMessage(signedMessage, signature) {
|
78
|
+
return nemSdk.default.crypto.verifySignature(this.publicKey, signedMessage, signature);
|
79
|
+
}
|
80
|
+
}
|
81
|
+
exports.PublicAccount = PublicAccount;
|
82
|
+
//# sourceMappingURL=PublicAccount.js.map
|
@@ -0,0 +1 @@
|
|
1
|
+
{"version":3,"file":"PublicAccount.js","sourceRoot":"","sources":["../../../../src/models/account/PublicAccount.ts"],"names":[],"mappings":";AAAA;;;;;;;;;;;;;;;;;;;;;;GAsBG;;AAEH,kCAAkC;AAClC,iDAA4C;AAC5C,uDAAkD;AAClD,uCAAkC;AAElC;;GAEG;AACH;IAIE;;;;OAIG;IACH,YAAY,OAAgB,EAChB,SAAiB;QAE3B,IAAI,CAAC,OAAO,GAAG,OAAO,CAAC;QACvB,IAAI,CAAC,SAAS,GAAG,SAAS,CAAC;IAC7B,CAAC;IAED;;OAEG;IACI,YAAY;QACjB,OAAO,IAAI,CAAC,SAAS,IAAI,IAAI,IAAI,CAAC,IAAI,CAAC,SAAS,CAAC,MAAM,KAAK,EAAE,IAAI,IAAI,CAAC,SAAS,CAAC,MAAM,KAAK,EAAE,CAAC,CAAC;IAClG,CAAC;IAED;;;;OAIG;IACI,MAAM,CAAC,mBAAmB,CAAC,SAAiB;QACjD,IAAI,SAAS,IAAI,IAAI,IAAI,CAAC,SAAS,CAAC,MAAM,KAAK,EAAE,IAAI,SAAS,CAAC,MAAM,KAAK,EAAE,CAAC,EAAE;YAC7E,MAAM,IAAI,KAAK,CAAC,wBAAwB,CAAC,CAAC;SAC3C;QACD,IAAI,OAAO,CAAC;QACZ,IAAI,uBAAU,CAAC,cAAc,EAAE,KAAK,2BAAY,CAAC,QAAQ,EAAE;YACzD,OAAO,GAAG,MAAM,CAAC,OAAO,CAAC,KAAK,CAAC,OAAO,CAAC,IAAI,CAAC,OAAO,CAAC,EAAE,CAAC;SACxD;aAAM,IAAI,uBAAU,CAAC,cAAc,EAAE,KAAK,2BAAY,CAAC,QAAQ,EAAE;YAChE,OAAO,GAAG,MAAM,CAAC,OAAO,CAAC,KAAK,CAAC,OAAO,CAAC,IAAI,CAAC,OAAO,CAAC,EAAE,CAAC;SACxD;aAAM,IAAI,uBAAU,CAAC,cAAc,EAAE,IAAI,2BAAY,CAAC,SAAS,EAAC;YAC/D,OAAO,GAAG,MAAM,CAAC,OAAO,CAAC,KAAK,CAAC,OAAO,CAAC,IAAI,CAAC,KAAK,CAAC,EAAE,CAAC;SACtD;QACD,MAAM,OAAO,GAAW,MAAM,CAAC,OAAO,CAAC,KAAK,CAAC,OAAO,CAAC,SAAS,CAAC,SAAS,EAAE,OAAO,CAAC,CAAC;QACnF,OAAO,IAAI,aAAa,CAAC,IAAI,iBAAO,CAAC,OAAO,CAAC,EAAE,SAAS,CAAC,CAAC;IAC5D,CAAC;IAED;;;;;OAKG;IACI,mBAAmB,CAAC,aAAoB,EAAE,SAAgB;QAC/D,OAAO,MAAM,CAAC,OAAO,CAAC,MAAM,CAAC,eAAe,CAAC,IAAI,CAAC,SAAS,EAAE,aAAa,EAAE,SAAS,CAAC,CAAC;IACzF,CAAC;CACF;AArDD,sCAqDC"}
|
@@ -0,0 +1,20 @@
|
|
1
|
+
import { AssetId } from "./AssetId";
|
2
|
+
/**
|
3
|
+
* A asset describes an instance of a asset definition. Assets can be transferred by means of a transfer transaction.
|
4
|
+
*/
|
5
|
+
export declare class Asset {
|
6
|
+
/**
|
7
|
+
* The asset id
|
8
|
+
*/
|
9
|
+
readonly assetId: AssetId;
|
10
|
+
/**
|
11
|
+
* The asset quantity. The quantity is always given in smallest units for the asset, i.e. if it has a divisibility of 3 the quantity is given in millis.
|
12
|
+
*/
|
13
|
+
readonly quantity: number;
|
14
|
+
/**
|
15
|
+
* constructor
|
16
|
+
* @param assetId
|
17
|
+
* @param quantity
|
18
|
+
*/
|
19
|
+
constructor(assetId: AssetId, quantity: number);
|
20
|
+
}
|
@@ -0,0 +1,59 @@
|
|
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 AssetId_1 = require("./AssetId");
|
27
|
+
/**
|
28
|
+
* A asset describes an instance of a asset definition. Assets can be transferred by means of a transfer transaction.
|
29
|
+
*/
|
30
|
+
class Asset {
|
31
|
+
/**
|
32
|
+
* constructor
|
33
|
+
* @param assetId
|
34
|
+
* @param quantity
|
35
|
+
*/
|
36
|
+
constructor(assetId, quantity) {
|
37
|
+
this.assetId = assetId;
|
38
|
+
this.quantity = quantity;
|
39
|
+
}
|
40
|
+
/**
|
41
|
+
* @internal
|
42
|
+
* @param dto
|
43
|
+
* @returns {Asset}
|
44
|
+
*/
|
45
|
+
static createFromMosaicDTO(dto) {
|
46
|
+
return new Asset(AssetId_1.AssetId.createFromMosaicIdDTO(dto.mosaicId), dto.quantity);
|
47
|
+
}
|
48
|
+
/**
|
49
|
+
* @internal
|
50
|
+
*/
|
51
|
+
toDTO() {
|
52
|
+
return {
|
53
|
+
mosaicId: this.assetId,
|
54
|
+
quantity: this.quantity
|
55
|
+
};
|
56
|
+
}
|
57
|
+
}
|
58
|
+
exports.Asset = Asset;
|
59
|
+
//# sourceMappingURL=Asset.js.map
|
@@ -0,0 +1 @@
|
|
1
|
+
{"version":3,"file":"Asset.js","sourceRoot":"","sources":["../../../../src/models/asset/Asset.ts"],"names":[],"mappings":";AAAA;;;;;;;;;;;;;;;;;;;;;;GAsBG;;AAGH,uCAAkC;AAElC;;GAEG;AACH;IAYE;;;;OAIG;IACH,YACE,OAAgB,EAChB,QAAgB;QAEhB,IAAI,CAAC,OAAO,GAAG,OAAO,CAAC;QACvB,IAAI,CAAC,QAAQ,GAAG,QAAQ,CAAC;IAC3B,CAAC;IAED;;;;OAIG;IACI,MAAM,CAAC,mBAAmB,CAAC,GAAc;QAC9C,OAAO,IAAI,KAAK,CACd,iBAAO,CAAC,qBAAqB,CAAC,GAAG,CAAC,QAAQ,CAAC,EAC3C,GAAG,CAAC,QAAQ,CAAC,CAAC;IAClB,CAAC;IAED;;OAEG;IACI,KAAK;QACV,OAAO;YACL,QAAQ,EAAE,IAAI,CAAC,OAAO;YACtB,QAAQ,EAAE,IAAI,CAAC,QAAQ;SACxB,CAAA;IACH,CAAC;CACF;AA7CD,sBA6CC"}
|
@@ -0,0 +1,83 @@
|
|
1
|
+
import { PublicAccount } from "../account/PublicAccount";
|
2
|
+
import { AssetId } from "./AssetId";
|
3
|
+
import { AssetLevy } from "./AssetLevy";
|
4
|
+
/**
|
5
|
+
* A asset definition describes an asset class. Some fields are mandatory while others are optional.
|
6
|
+
* The properties of a asset definition always have a default value and only need to be supplied if they differ from the default value.
|
7
|
+
*/
|
8
|
+
export declare class AssetDefinition {
|
9
|
+
/**
|
10
|
+
* The public key of the asset definition creator.
|
11
|
+
*/
|
12
|
+
readonly creator: PublicAccount;
|
13
|
+
/**
|
14
|
+
* The asset id
|
15
|
+
*/
|
16
|
+
readonly id: AssetId;
|
17
|
+
/**
|
18
|
+
* The asset description. The description may have a length of up to 512 characters and cannot be empty.
|
19
|
+
*/
|
20
|
+
readonly description: string;
|
21
|
+
/**
|
22
|
+
* Asset properties
|
23
|
+
*/
|
24
|
+
readonly properties: AssetProperties;
|
25
|
+
/**
|
26
|
+
* The optional levy for the asset. A creator can demand that each asset transfer induces an additional fee
|
27
|
+
*/
|
28
|
+
readonly levy?: AssetLevy;
|
29
|
+
/**
|
30
|
+
* The id for the asset definition object.
|
31
|
+
*/
|
32
|
+
readonly metaId?: number;
|
33
|
+
/**
|
34
|
+
* constructor
|
35
|
+
* @param creator
|
36
|
+
* @param id
|
37
|
+
* @param description
|
38
|
+
* @param properties
|
39
|
+
* @param levy
|
40
|
+
* @param metaId
|
41
|
+
*/
|
42
|
+
constructor(creator: PublicAccount, id: AssetId, description: string, properties: AssetProperties, levy?: AssetLevy, metaId?: number);
|
43
|
+
}
|
44
|
+
/**
|
45
|
+
* Each asset definition comes with a set of properties.
|
46
|
+
* Each property has a default value which will be applied in case it was not specified.
|
47
|
+
* Future release may add additional properties to the set of available properties
|
48
|
+
*/
|
49
|
+
export declare class AssetProperties {
|
50
|
+
/**
|
51
|
+
* initialSupply: The creator can specify an initial supply of assets when creating the definition.
|
52
|
+
* The supply is given in entire units of the asset, not in smallest sub-units.
|
53
|
+
* The initial supply must be in the range of 0 and 9,000,000,000. The default value is "1000".
|
54
|
+
*/
|
55
|
+
readonly initialSupply: number;
|
56
|
+
/**
|
57
|
+
* The creator can choose between a definition that allows a asset supply change at a later point or an immutable supply.
|
58
|
+
* Allowed values for the property are "true" and "false". The default value is "false".
|
59
|
+
*/
|
60
|
+
readonly supplyMutable: boolean;
|
61
|
+
/**
|
62
|
+
* The creator can choose if the asset definition should allow for transfers of the asset among accounts other than the creator.
|
63
|
+
* If the property 'transferable' is set to "false", only transfer transactions having the creator as sender or as recipient can transfer assets of that type.
|
64
|
+
* If set to "true" the assets can be transferred to and from arbitrary accounts.
|
65
|
+
* Allowed values for the property are thus "true" and "false". The default value is "true".
|
66
|
+
*/
|
67
|
+
readonly transferable: boolean;
|
68
|
+
/**
|
69
|
+
* The divisibility determines up to what decimal place the asset can be divided into.
|
70
|
+
* Thus a divisibility of 3 means that a asset can be divided into smallest parts of 0.001 assets, i.e. milli assets is the smallest sub-unit.
|
71
|
+
* When transferring assets via a transfer transaction the quantity transferred is given in multiples of those smallest parts.
|
72
|
+
* The divisibility must be in the range of 0 and 6. The default value is "0".
|
73
|
+
*/
|
74
|
+
readonly divisibility: number;
|
75
|
+
/**
|
76
|
+
* constructor
|
77
|
+
* @param divisibility
|
78
|
+
* @param initialSupply
|
79
|
+
* @param supplyMutable
|
80
|
+
* @param transferable
|
81
|
+
*/
|
82
|
+
constructor(divisibility?: number, initialSupply?: number, transferable?: boolean, supplyMutable?: boolean);
|
83
|
+
}
|