Skip to content

Commit ddef626

Browse files
author
Grégory Saive
authored
Merge branch 'master' into add/EncryptedMessage
2 parents 6da136e + 597736e commit ddef626

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

54 files changed

+2340
-144
lines changed

CHANGELOG.md

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,20 +1,20 @@
11
# CHANGELOG
22

3-
# v0.10.3
3+
# v0.11
44

55
- Fixed NetworkCurrencyMosaic, NetworkHarvestMosaic
66
- Added exposed UInt64.fromHex and UInt64.toHex
77
- Added MosaicId.createFromNonce
88
- Added MosaicNonce, MosaicNonce.createRandom
99
- Fixed AliasDTO.mosaicId to be UInt64
1010
- Added nem2-library@v0.9.8 version update (cow compatibility)
11-
12-
# v0.10.2
13-
1411
- Added cow network update *base* compatibility
1512
- Added AliasTransaction, AddressAliasTransaction, MosaicAliasTransaction
1613
- Changed MosaicDefinition to hold MosaicNonce
1714
- Changed SecretLock transaction to work with Sha3_256 instead of Sha3_512
15+
- Added delegated harvesting
16+
- Fixed #38: error message for aggregate as inner tx
17+
- Added TransferTransaction.recipient NamespaceId argument type
1818

1919
# v0.10.1-beta
2020

README.md

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -10,9 +10,9 @@ with the NEM2 (a.k.a Catapult)
1010

1111
## Important Notes
1212

13-
Due to a network upgrade with [catapult-server@cow](https://github.com/nemtech/catapult-server/releases/tag/v0.3.0.1) version, **transactions from Alpaca&Bison are not compatible anymore**.
13+
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**.
1414

15-
The upgrade to this SDK's [version v0.10.2](https://github.com/nemtech/nem2-sdk-typescript-javascript/releases/tag/v0.10.2) is mandatory for **cow compatibility**.
15+
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**.
1616

1717
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.
1818

@@ -55,9 +55,8 @@ Please, use the following available resources to get help:
5555

5656
Important versions listed below. Refer to the [Changelog](CHANGELOG.md) for a full history of the project.
5757

58-
- [0.10.3](CHANGELOG.md#v0103) - **Cow compatible** - TBD
59-
- [0.10.2](CHANGELOG.md#v0102) - **Cow compatible** - 2019-02-25
60-
- [0.10.1-beta](CHANGELOG.md#v0101-beta) - **Alpaca compatible**
58+
- [0.11](CHANGELOG.md#v011) - **Cow compatible** - 14.03.2019
59+
- [0.10.1-beta](CHANGELOG.md#v0101-beta) - **Alpaca compatible** 07.2018
6160

6261
## License
6362

e2e/infrastructure/Listener.spec.ts

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -154,4 +154,16 @@ describe('Listener', () => {
154154
TransactionUtils.createAndAnnounceWithInsufficientBalance();
155155
}, 1000);
156156
});
157+
158+
it('multisigAccountAdded', (done) => {
159+
listener.multisigAccountAdded(account.address)
160+
.toPromise()
161+
.then((res) => {
162+
done();
163+
});
164+
165+
setTimeout(() => {
166+
TransactionUtils.createModifyMultisigAccountTransaction(account);
167+
}, 1000);
168+
});
157169
});

e2e/infrastructure/TransactionUtils.ts

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -17,11 +17,15 @@ import {ChronoUnit} from 'js-joda';
1717
import {TransactionHttp} from '../../src/infrastructure/TransactionHttp';
1818
import {Account} from '../../src/model/account/Account';
1919
import {Address} from '../../src/model/account/Address';
20+
import { PublicAccount } from '../../src/model/account/PublicAccount';
2021
import {NetworkType} from '../../src/model/blockchain/NetworkType';
2122
import {NetworkCurrencyMosaic} from '../../src/model/mosaic/NetworkCurrencyMosaic';
2223
import {AggregateTransaction} from '../../src/model/transaction/AggregateTransaction';
2324
import {CosignatureTransaction} from '../../src/model/transaction/CosignatureTransaction';
2425
import {Deadline} from '../../src/model/transaction/Deadline';
26+
import { ModifyMultisigAccountTransaction } from '../../src/model/transaction/ModifyMultisigAccountTransaction';
27+
import { MultisigCosignatoryModification } from '../../src/model/transaction/MultisigCosignatoryModification';
28+
import { MultisigCosignatoryModificationType } from '../../src/model/transaction/MultisigCosignatoryModificationType';
2529
import {PlainMessage} from '../../src/model/transaction/PlainMessage';
2630
import {TransferTransaction} from '../../src/model/transaction/TransferTransaction';
2731
import {CosignatoryAccount, MultisigAccount, NIS2_URL, TestingAccount} from '../../test/conf/conf.spec';
@@ -82,4 +86,20 @@ export class TransactionUtils {
8286
const cosignatureSignedTransaction = account.signCosignatureTransaction(cosignatureTransaction);
8387
transactionHttp.announceAggregateBondedCosignature(cosignatureSignedTransaction);
8488
}
89+
90+
public static createModifyMultisigAccountTransaction( account: Account,
91+
transactionHttp: TransactionHttp = new TransactionHttp(NIS2_URL)) {
92+
const modifyMultisig = ModifyMultisigAccountTransaction.create(
93+
Deadline.create(),
94+
2,
95+
1,
96+
[new MultisigCosignatoryModification(
97+
MultisigCosignatoryModificationType.Add,
98+
PublicAccount.createFromPublicKey(account.publicKey, NetworkType.MIJIN_TEST),
99+
)],
100+
NetworkType.MIJIN_TEST,
101+
);
102+
const signedTransaction = account.sign(modifyMultisig);
103+
transactionHttp.announce(signedTransaction);
104+
}
85105
}

e2e/service/MosaicService.spec.ts

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,6 @@
11
import { map, mergeMap, toArray } from 'rxjs/operators';
22
import { AccountHttp } from '../../src/infrastructure/AccountHttp';
33
import { MosaicHttp } from '../../src/infrastructure/MosaicHttp';
4-
import { NamespaceHttp } from '../../src/infrastructure/NamespaceHttp';
54
import { Address } from '../../src/model/account/Address';
65
import { MosaicService } from '../../src/service/MosaicService';
76
import { APIUrl } from '../conf/conf.spec';
@@ -12,7 +11,6 @@ describe('MosaicService', () => {
1211
const mosaicService = new MosaicService(
1312
new AccountHttp(APIUrl),
1413
new MosaicHttp(APIUrl),
15-
new NamespaceHttp(APIUrl),
1614
);
1715

1816
const address = Address.createFromRawAddress('SCO2JY-N6OJSM-CJPPVS-Z3OX7P-TWPQEJ-GZTI6W-GLKK');

index.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -17,3 +17,4 @@
1717
export * from './src/infrastructure/infrastructure';
1818
export * from './src/model/model';
1919
export * from './src/service/service';
20+
export * from './src/core/utils/utility';

package-lock.json

Lines changed: 13 additions & 13 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

package.json

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "nem2-sdk",
3-
"version": "0.10.3-4",
3+
"version": "0.11.2",
44
"description": "Reactive Nem2 sdk for typescript and javascript",
55
"scripts": {
66
"pretest": "npm run build",
@@ -53,7 +53,7 @@
5353
"@types/crypto-js": "^3.1.43",
5454
"crypto-js": "^3.1.9-1",
5555
"js-joda": "^1.6.2",
56-
"nem2-library": "^0.9.11",
56+
"nem2-library": "^0.9.13",
5757
"request": "^2.83.0",
5858
"request-promise-native": "^1.0.5",
5959
"rxjs": "^6.2.1",
Lines changed: 40 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,40 @@
1+
/*
2+
* Copyright 2019 NEM
3+
*
4+
* Licensed under the Apache License, Version 2.0 (the "License");
5+
* you may not use this file except in compliance with the License.
6+
* You may obtain a copy of the License at
7+
*
8+
* http://www.apache.org/licenses/LICENSE-2.0
9+
*
10+
* Unless required by applicable law or agreed to in writing, software
11+
* distributed under the License is distributed on an "AS IS" BASIS,
12+
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13+
* See the License for the specific language governing permissions and
14+
* limitations under the License.
15+
*/
16+
17+
import { CreateTransactionFromDTO } from '../../infrastructure/transaction/CreateTransactionFromDTO';
18+
import { CreateTransactionFromPayload } from '../../infrastructure/transaction/CreateTransactionFromPayload';
19+
import { Transaction } from '../../model/transaction/Transaction';
20+
21+
export class TransactionMapping {
22+
23+
/**
24+
* Create transaction class from Json.
25+
* @param {object} dataJson The transaction json object.
26+
* @returns {module: model/transaction/transaction} The transaction class.
27+
*/
28+
public static createFromDTO(dataJson: object): Transaction {
29+
return CreateTransactionFromDTO(dataJson);
30+
}
31+
32+
/**
33+
* Create transaction class from payload binary.
34+
* @param {string} dataBytes The transaction json object.
35+
* @returns {module: model/transaction/transaction} The transaction class.
36+
*/
37+
public static createFromPayload(dataBytes: string): Transaction {
38+
return CreateTransactionFromPayload(dataBytes);
39+
}
40+
}

src/core/utils/utility.ts

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
/*
2+
* Copyright 2019 NEM
3+
*
4+
* Licensed under the Apache License, Version 2.0 (the "License");
5+
* you may not use this file except in compliance with the License.
6+
* You may obtain a copy of the License at
7+
*
8+
* http://www.apache.org/licenses/LICENSE-2.0
9+
*
10+
* Unless required by applicable law or agreed to in writing, software
11+
* distributed under the License is distributed on an "AS IS" BASIS,
12+
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13+
* See the License for the specific language governing permissions and
14+
* limitations under the License.
15+
*/
16+
17+
export * from './TransactionMapping';

0 commit comments

Comments
 (0)