From 0183e870aa23ab7b297a947ff2e7e75a3bed681f Mon Sep 17 00:00:00 2001 From: Greg S Date: Wed, 17 Apr 2019 09:23:12 +0200 Subject: [PATCH 1/3] fix transaction.maxFee initialization in CreateTransactionFromDTO --- .../transaction/CreateTransactionFromDTO.ts | 29 ++++++++++--------- 1 file changed, 15 insertions(+), 14 deletions(-) diff --git a/src/infrastructure/transaction/CreateTransactionFromDTO.ts b/src/infrastructure/transaction/CreateTransactionFromDTO.ts index 18234743fb..0078b5bb60 100644 --- a/src/infrastructure/transaction/CreateTransactionFromDTO.ts +++ b/src/infrastructure/transaction/CreateTransactionFromDTO.ts @@ -117,12 +117,13 @@ export const CreateTransactionFromDTO = (transactionDTO): Transaction => { * @constructor */ const CreateStandaloneTransactionFromDTO = (transactionDTO, transactionInfo): Transaction => { + if (transactionDTO.type === TransactionType.TRANSFER) { return new TransferTransaction( extractNetworkType(transactionDTO.version), extractTransactionVersion(transactionDTO.version), Deadline.createFromDTO(transactionDTO.deadline), - UInt64.fromUint(transactionDTO.maxFee || 0), + new UInt64(transactionDTO.maxFee || [0, 0]), extractRecipient(transactionDTO.recipient), extractMosaics(transactionDTO.mosaics), extractMessage(transactionDTO.message !== undefined ? transactionDTO.message.payload : undefined), @@ -136,7 +137,7 @@ const CreateStandaloneTransactionFromDTO = (transactionDTO, transactionInfo): Tr extractNetworkType(transactionDTO.version), extractTransactionVersion(transactionDTO.version), Deadline.createFromDTO(transactionDTO.deadline), - UInt64.fromUint(transactionDTO.maxFee || 0), + new UInt64(transactionDTO.maxFee || [0, 0]), transactionDTO.namespaceType, transactionDTO.name, new NamespaceId(transactionDTO.namespaceId), @@ -152,7 +153,7 @@ const CreateStandaloneTransactionFromDTO = (transactionDTO, transactionInfo): Tr extractNetworkType(transactionDTO.version), extractTransactionVersion(transactionDTO.version), Deadline.createFromDTO(transactionDTO.deadline), - UInt64.fromUint(transactionDTO.maxFee || 0), + new UInt64(transactionDTO.maxFee || [0, 0]), transactionDTO.nonce, new MosaicId(transactionDTO.mosaicId), new MosaicProperties( @@ -171,7 +172,7 @@ const CreateStandaloneTransactionFromDTO = (transactionDTO, transactionInfo): Tr extractNetworkType(transactionDTO.version), extractTransactionVersion(transactionDTO.version), Deadline.createFromDTO(transactionDTO.deadline), - UInt64.fromUint(transactionDTO.maxFee || 0), + new UInt64(transactionDTO.maxFee), new MosaicId(transactionDTO.mosaicId), transactionDTO.direction, new UInt64(transactionDTO.delta), @@ -185,7 +186,7 @@ const CreateStandaloneTransactionFromDTO = (transactionDTO, transactionInfo): Tr extractNetworkType(transactionDTO.version), extractTransactionVersion(transactionDTO.version), Deadline.createFromDTO(transactionDTO.deadline), - UInt64.fromUint(transactionDTO.maxFee || 0), + new UInt64(transactionDTO.maxFee || [0, 0]), transactionDTO.minApprovalDelta, transactionDTO.minRemovalDelta, transactionDTO.modifications ? transactionDTO.modifications.map((modificationDTO) => new MultisigCosignatoryModification( @@ -203,7 +204,7 @@ const CreateStandaloneTransactionFromDTO = (transactionDTO, transactionInfo): Tr networkType, extractTransactionVersion(transactionDTO.version), Deadline.createFromDTO(transactionDTO.deadline), - UInt64.fromUint(transactionDTO.maxFee || 0), + new UInt64(transactionDTO.maxFee), new Mosaic(new MosaicId(transactionDTO.mosaicId), new UInt64(transactionDTO.amount)), new UInt64(transactionDTO.duration), new SignedTransaction('', transactionDTO.hash, '', TransactionType.AGGREGATE_BONDED, networkType), @@ -217,7 +218,7 @@ const CreateStandaloneTransactionFromDTO = (transactionDTO, transactionInfo): Tr extractNetworkType(transactionDTO.version), extractTransactionVersion(transactionDTO.version), Deadline.createFromDTO(transactionDTO.deadline), - UInt64.fromUint(transactionDTO.maxFee || 0), + new UInt64(transactionDTO.maxFee || [0, 0]), new Mosaic(new MosaicId(transactionDTO.mosaicId), new UInt64(transactionDTO.amount)), new UInt64(transactionDTO.duration), transactionDTO.hashAlgorithm, @@ -234,7 +235,7 @@ const CreateStandaloneTransactionFromDTO = (transactionDTO, transactionInfo): Tr extractNetworkType(transactionDTO.version), extractTransactionVersion(transactionDTO.version), Deadline.createFromDTO(transactionDTO.deadline), - UInt64.fromUint(transactionDTO.maxFee || 0), + new UInt64(transactionDTO.maxFee), transactionDTO.hashAlgorithm, transactionDTO.secret, transactionDTO.proof, @@ -248,7 +249,7 @@ const CreateStandaloneTransactionFromDTO = (transactionDTO, transactionInfo): Tr extractNetworkType(transactionDTO.version), extractTransactionVersion(transactionDTO.version), Deadline.createFromDTO(transactionDTO.deadline), - UInt64.fromUint(transactionDTO.maxFee || 0), + new UInt64(transactionDTO.maxFee || [0, 0]), transactionDTO.aliasAction, new NamespaceId(transactionDTO.namespaceId), new MosaicId(transactionDTO.mosaicId), @@ -262,7 +263,7 @@ const CreateStandaloneTransactionFromDTO = (transactionDTO, transactionInfo): Tr extractNetworkType(transactionDTO.version), extractTransactionVersion(transactionDTO.version), Deadline.createFromDTO(transactionDTO.deadline), - UInt64.fromUint(transactionDTO.maxFee || 0), + new UInt64(transactionDTO.maxFee || [0, 0]), transactionDTO.aliasAction, new NamespaceId(transactionDTO.namespaceId), extractRecipient(transactionDTO.address) as Address, @@ -276,7 +277,7 @@ const CreateStandaloneTransactionFromDTO = (transactionDTO, transactionInfo): Tr extractNetworkType(transactionDTO.version), extractTransactionVersion(transactionDTO.version), Deadline.createFromDTO(transactionDTO.deadline), - UInt64.fromUint(transactionDTO.maxFee || 0), + new UInt64(transactionDTO.maxFee || [0, 0]), transactionDTO.propertyType, transactionDTO.modifications ? transactionDTO.modifications.map((modificationDTO) => new AccountPropertyModification( modificationDTO.modificationType, @@ -292,7 +293,7 @@ const CreateStandaloneTransactionFromDTO = (transactionDTO, transactionInfo): Tr extractNetworkType(transactionDTO.version), extractTransactionVersion(transactionDTO.version), Deadline.createFromDTO(transactionDTO.deadline), - UInt64.fromUint(transactionDTO.maxFee || 0), + new UInt64(transactionDTO.maxFee || [0, 0]), transactionDTO.propertyType, transactionDTO.modifications ? transactionDTO.modifications.map((modificationDTO) => new AccountPropertyModification( modificationDTO.modificationType, @@ -308,7 +309,7 @@ const CreateStandaloneTransactionFromDTO = (transactionDTO, transactionInfo): Tr extractNetworkType(transactionDTO.version), extractTransactionVersion(transactionDTO.version), Deadline.createFromDTO(transactionDTO.deadline), - UInt64.fromUint(transactionDTO.maxFee || 0), + new UInt64(transactionDTO.maxFee || [0, 0]), transactionDTO.propertyType, transactionDTO.modifications ? transactionDTO.modifications.map((modificationDTO) => new AccountPropertyModification( modificationDTO.modificationType, @@ -324,7 +325,7 @@ const CreateStandaloneTransactionFromDTO = (transactionDTO, transactionInfo): Tr extractNetworkType(transactionDTO.version), extractTransactionVersion(transactionDTO.version), Deadline.createFromDTO(transactionDTO.deadline), - UInt64.fromUint(transactionDTO.maxFee || 0), + new UInt64(transactionDTO.maxFee || [0, 0]), transactionDTO.remoteAccountKey, transactionDTO.linkAction, transactionDTO.signature, From 85d9e4aa714d60cf758a1bb55aa55926fcb1263d Mon Sep 17 00:00:00 2001 From: Greg S Date: Wed, 17 Apr 2019 09:23:37 +0200 Subject: [PATCH 2/3] prepare release 0.11.4 --- CHANGELOG.md | 8 ++++++++ README.md | 3 ++- 2 files changed, 10 insertions(+), 1 deletion(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index b1651c16f5..dc59ae0ae4 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -3,6 +3,14 @@ All notable changes to this project will be documented in this file. The changelog format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/). +## [0.11.4] - 17-Apr-2019 + +- Fixed #117, Typo in AddressAliasTransaction and MosaicAliasTransaction comments +- Fixed several typos in documentation +- Fixed CreateTransactionFromDTO to allow `message` to be undefined +- Added transaction/EncryptedMessage +- Added QueryParams.order order parameter + ## [0.11.3] - 10-Apr-2019 - Added `Transaction.maxFee` optional property in `create()` methods. (fixes #53) diff --git a/README.md b/README.md index e415b34513..856b61ba37 100644 --- a/README.md +++ b/README.md @@ -12,7 +12,7 @@ with the NEM2 (a.k.a Catapult) Due to a network upgrade with [catapult-server@cow](https://github.com/nemtech/catapult-server/releases/tag/v0.3.0.2) version, **transactions from Alpaca&Bison are not compatible anymore**. -The upgrade to this SDK's [version v0.11](https://github.com/nemtech/nem2-sdk-typescript-javascript/releases/tag/v0.11) is mandatory for **cow compatibility**. +The upgrade to this SDK's [version v0.11.4](https://github.com/nemtech/nem2-sdk-typescript-javascript/releases/tag/v0.11.4) is mandatory for **cow compatibility**. Other versions like [version v0.10.1-beta](https://github.com/nemtech/nem2-sdk-typescript-javascript/releases/tag/v0.10.1-beta) can be used for **bison** network version. @@ -55,6 +55,7 @@ Please, use the following available resources to get help: Important versions listed below. Refer to the [Changelog](CHANGELOG.md) for a full history of the project. +- [0.11.4](CHANGELOG.md#0114-17-Apr-2019) - **Cow compatible** - 17.04.2019 - [0.11.3](CHANGELOG.md#0113-10-Apr-2019) - **Cow compatible** - 10.04.2019 - [0.11.2](CHANGELOG.md#0112-1-Apr-2019) - **Cow compatible** - 01.04.2019 - [0.11](CHANGELOG.md#011-14-Mar-2019) - **Cow compatible** - 14.03.2019 From 13e4af9874ab90786d18b7b109a65f989d2a0d3d Mon Sep 17 00:00:00 2001 From: Greg S Date: Wed, 17 Apr 2019 09:26:27 +0200 Subject: [PATCH 3/3] 0.11.4: COW - Several bugfixes with DTO reads --- package-lock.json | 2 +- package.json | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/package-lock.json b/package-lock.json index 2eefecf759..4f608ad19a 100644 --- a/package-lock.json +++ b/package-lock.json @@ -1,6 +1,6 @@ { "name": "nem2-sdk", - "version": "0.11.3", + "version": "0.11.4", "lockfileVersion": 1, "requires": true, "dependencies": { diff --git a/package.json b/package.json index 0e45e0c02f..8ba3f7c5b9 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "nem2-sdk", - "version": "0.11.3", + "version": "0.11.4", "description": "Reactive Nem2 sdk for typescript and javascript", "scripts": { "pretest": "npm run build",