From e2c37e832a99e36e80a43a258714409ebe20b8a0 Mon Sep 17 00:00:00 2001 From: decentraliser Date: Thu, 26 Dec 2019 15:24:04 +0800 Subject: [PATCH 1/2] export simpleWalletDTO --- src/infrastructure/infrastructure.ts | 13 +++++++------ 1 file changed, 7 insertions(+), 6 deletions(-) diff --git a/src/infrastructure/infrastructure.ts b/src/infrastructure/infrastructure.ts index 6bc372b0af..899c2e38fc 100644 --- a/src/infrastructure/infrastructure.ts +++ b/src/infrastructure/infrastructure.ts @@ -19,16 +19,17 @@ export * from './BlockHttp'; export * from './ChainHttp'; export * from './DiagnosticHttp'; export * from './Http'; -export * from './MosaicHttp'; +export * from './Listener'; export * from './MetadataHttp'; +export * from './MosaicHttp'; +export * from './MultisigHttp'; export * from './NamespaceHttp'; -export * from './TransactionHttp'; -export * from './Listener'; -export * from './QueryParams'; export * from './NetworkHttp'; export * from './NodeHttp'; +export * from './QueryParams'; +export * from './ReceiptHttp'; export * from './RestrictionAccountHttp'; export * from './RestrictionMosaicHttp'; -export * from './MultisigHttp'; -export * from './ReceiptHttp'; export * from './transaction/NamespaceMosaicIdGenerator'; +export * from './TransactionHttp'; +export * from './wallet/simpleWalletDTO'; From 4701a2bdb4c5b20944d8a917d8a52fe35953f138 Mon Sep 17 00:00:00 2001 From: decentraliser Date: Mon, 30 Dec 2019 15:55:04 +0800 Subject: [PATCH 2/2] update location and export of ISimpleWalletDTO --- src/infrastructure/infrastructure.ts | 13 ++++++------- src/model/model.ts | 1 + .../wallet/ISimpleWalletDTO.ts} | 0 src/model/wallet/SimpleWallet.ts | 5 +++-- 4 files changed, 10 insertions(+), 9 deletions(-) rename src/{infrastructure/wallet/simpleWalletDTO.ts => model/wallet/ISimpleWalletDTO.ts} (100%) diff --git a/src/infrastructure/infrastructure.ts b/src/infrastructure/infrastructure.ts index 899c2e38fc..6bc372b0af 100644 --- a/src/infrastructure/infrastructure.ts +++ b/src/infrastructure/infrastructure.ts @@ -19,17 +19,16 @@ export * from './BlockHttp'; export * from './ChainHttp'; export * from './DiagnosticHttp'; export * from './Http'; -export * from './Listener'; -export * from './MetadataHttp'; export * from './MosaicHttp'; -export * from './MultisigHttp'; +export * from './MetadataHttp'; export * from './NamespaceHttp'; +export * from './TransactionHttp'; +export * from './Listener'; +export * from './QueryParams'; export * from './NetworkHttp'; export * from './NodeHttp'; -export * from './QueryParams'; -export * from './ReceiptHttp'; export * from './RestrictionAccountHttp'; export * from './RestrictionMosaicHttp'; +export * from './MultisigHttp'; +export * from './ReceiptHttp'; export * from './transaction/NamespaceMosaicIdGenerator'; -export * from './TransactionHttp'; -export * from './wallet/simpleWalletDTO'; diff --git a/src/model/model.ts b/src/model/model.ts index 02370bf73a..f760473578 100644 --- a/src/model/model.ts +++ b/src/model/model.ts @@ -158,6 +158,7 @@ export * from './transaction/MosaicAddressRestrictionTransaction'; // Wallet export * from './wallet/EncryptedPrivateKey'; +export * from './wallet/ISimpleWalletDTO'; export * from './wallet/Password'; export * from './wallet/SimpleWallet'; export * from './wallet/Wallet'; diff --git a/src/infrastructure/wallet/simpleWalletDTO.ts b/src/model/wallet/ISimpleWalletDTO.ts similarity index 100% rename from src/infrastructure/wallet/simpleWalletDTO.ts rename to src/model/wallet/ISimpleWalletDTO.ts diff --git a/src/model/wallet/SimpleWallet.ts b/src/model/wallet/SimpleWallet.ts index 02df387f44..892a3b7bd3 100644 --- a/src/model/wallet/SimpleWallet.ts +++ b/src/model/wallet/SimpleWallet.ts @@ -17,11 +17,11 @@ import {LocalDateTime} from 'js-joda'; import {Crypto, KeyPair, SHA3Hasher} from '../../core/crypto'; import {Convert as convert} from '../../core/format'; -import {ISimpleWalletDTO} from '../../infrastructure/wallet/simpleWalletDTO'; import {Account} from '../account/Account'; import {Address} from '../account/Address'; import {NetworkType} from '../blockchain/NetworkType'; import {EncryptedPrivateKey} from './EncryptedPrivateKey'; +import {ISimpleWalletDTO} from './ISimpleWalletDTO'; import {Password} from './Password'; import {Wallet} from './Wallet'; @@ -109,8 +109,9 @@ export class SimpleWallet extends Wallet { /** * Instantiate a SimpleWallet from a DTO * @param simpleWalletDTO simple wallet without prototype + * @returns {SimpleWallet} */ - static createFromDTO(simpleWalletDTO: ISimpleWalletDTO) { + static createFromDTO(simpleWalletDTO: ISimpleWalletDTO): SimpleWallet { return new SimpleWallet( simpleWalletDTO.name, simpleWalletDTO.network,