diff --git a/CHANGELOG.md b/CHANGELOG.md index 6323684b57..57db5056e8 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -3,6 +3,15 @@ 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.13.0] - 03-Jul-2019 + +**Milestone**: Elephant + +- Added SignSchema to make KeyPair generation compatible with either of Catapult and NIS. +- Added SignSchema with KECCAK_REVERSED_KEY and SHA3. The SDK by default uses SHA3 which is the Catapult signature schema. +- Fixed transaction versions back to version 1 +- Added `signTransactionGivenSignatures` to cope with off chain aggregated complete transaction co signing. + ## [0.12.4] - 03-Jul-2019 **Milestone**: Dragon @@ -143,7 +152,7 @@ The changelog format is based on [Keep a Changelog](https://keepachangelog.com/e **Milestone**: Alpaca - Initial code release. - +[0.13.0]: https://github.com/nemtech/nem2-sdk-typescript-javascript/compare/v0.12.4...v0.13.0 [0.12.4]: https://github.com/nemtech/nem2-sdk-typescript-javascript/compare/v0.12.3...v0.12.4 [0.12.3]: https://github.com/nemtech/nem2-sdk-typescript-javascript/compare/v0.12.2...v0.12.3 [0.12.2]: https://github.com/nemtech/nem2-sdk-typescript-javascript/compare/v0.12.1...v0.12.2 diff --git a/README.md b/README.md index ccca71cc60..9d10ea6d2e 100644 --- a/README.md +++ b/README.md @@ -10,6 +10,12 @@ with the NEM2 (a.k.a Catapult) ## Important Notes +### _Elephant Network Compatibility (catapult-server@0.5.0.1) + +Due to a network upgrade with [catapult-server@elephant](https://github.com/nemtech/catapult-server/releases/tag/v0.5.0.1) version, **it is recommended to use this package's 0.13.0 version and upwards to use this package with Dragon versioned networks**. + +The upgrade to this package's [version v0.13.0](https://github.com/nemtech/nem2-sdk-typescript-javascript/releases/tag/v0.13.0) is mandatory for **dragon compatibility**. + ### _Dragon_ Network Compatibility (catapult-server@0.4.0.1) Due to a network upgrade with [catapult-server@dragon](https://github.com/nemtech/catapult-server/releases/tag/v0.4.0.1) version, **it is recommended to use this package's 0.12.4 version and upwards to use this package with Dragon versioned networks**. diff --git a/e2e/infrastructure/AccountHttp.spec.ts b/e2e/infrastructure/AccountHttp.spec.ts index 5dcf195e29..89c0ba90ff 100644 --- a/e2e/infrastructure/AccountHttp.spec.ts +++ b/e2e/infrastructure/AccountHttp.spec.ts @@ -20,15 +20,15 @@ import {AccountHttp} from '../../src/infrastructure/AccountHttp'; import { Listener, TransactionHttp } from '../../src/infrastructure/infrastructure'; import { Account } from '../../src/model/account/Account'; import {Address} from '../../src/model/account/Address'; -import { PropertyModificationType } from '../../src/model/account/PropertyModificationType'; -import { PropertyType } from '../../src/model/account/PropertyType'; +import { RestrictionModificationType } from '../../src/model/account/RestrictionModificationType'; +import { RestrictionType } from '../../src/model/account/RestrictionType'; import {PublicAccount} from '../../src/model/account/PublicAccount'; import {NetworkType} from '../../src/model/blockchain/NetworkType'; import { NetworkCurrencyMosaic } from '../../src/model/mosaic/NetworkCurrencyMosaic'; import { AliasActionType } from '../../src/model/namespace/AliasActionType'; import { NamespaceId } from '../../src/model/namespace/NamespaceId'; -import { AccountPropertyModification } from '../../src/model/transaction/AccountPropertyModification'; -import { AccountPropertyTransaction } from '../../src/model/transaction/AccountPropertyTransaction'; +import { AccountRestrictionModification } from '../../src/model/transaction/AccountRestrictionModification'; +import { AccountRestrictionTransaction } from '../../src/model/transaction/AccountRestrictionTransaction'; import { AddressAliasTransaction } from '../../src/model/transaction/AddressAliasTransaction'; import { AggregateTransaction } from '../../src/model/transaction/AggregateTransaction'; import { Deadline } from '../../src/model/transaction/Deadline'; @@ -193,14 +193,14 @@ describe('AccountHttp', () => { return listener.close(); }); - it('Announce AccountPropertyTransaction', (done) => { - const addressPropertyFilter = AccountPropertyModification.createForAddress( - PropertyModificationType.Add, + it('Announce AccountRestrictionTransaction', (done) => { + const addressPropertyFilter = AccountRestrictionModification.createForAddress( + RestrictionModificationType.Add, account3.address, ); - const addressModification = AccountPropertyTransaction.createAddressPropertyModificationTransaction( + const addressModification = AccountRestrictionTransaction.createAddressRestrictionModificationTransaction( Deadline.create(), - PropertyType.BlockAddress, + RestrictionType.BlockAddress, [addressPropertyFilter], NetworkType.MIJIN_TEST, ); @@ -282,22 +282,22 @@ describe('AccountHttp', () => { }); }); - describe('getAccountProperty', () => { - it('should call getAccountProperty successfully', (done) => { + describe('getAccountRestrictions', () => { + it('should call getAccountRestrictions successfully', (done) => { setTimeout(() => { - accountHttp.getAccountProperties(accountAddress).subscribe((accountProperty) => { - deepEqual(accountProperty.accountProperties.address, accountAddress); + accountHttp.getAccountRestrictions(accountAddress).subscribe((accountRestrictions) => { + deepEqual(accountRestrictions.accountRestrictions.address, accountAddress); done(); }); }, 1000); }); }); - describe('getAccountProperties', () => { - it('should call getAccountProperties successfully', (done) => { + describe('getAccountRestrictions', () => { + it('should call getAccountRestrictions successfully', (done) => { setTimeout(() => { - accountHttp.getAccountPropertiesFromAccounts([accountAddress]).subscribe((accountProperties) => { - deepEqual(accountProperties[0]!.accountProperties.address, accountAddress); + accountHttp.getAccountRestrictionsFromAccounts([accountAddress]).subscribe((accountRestrictions) => { + deepEqual(accountRestrictions[0]!.accountRestrictions.address, accountAddress); done(); }); }, 1000); @@ -409,7 +409,7 @@ describe('AccountHttp', () => { transactionHttp.announce(signedTransaction); }); }); - describe('Remove test AccountProperty - Address', () => { + describe('Remove test AccountRestriction - Address', () => { let listener: Listener; before (() => { listener = new Listener(config.apiUrl); @@ -419,14 +419,14 @@ describe('AccountHttp', () => { return listener.close(); }); - it('Announce AccountPropertyTransaction', (done) => { - const addressPropertyFilter = AccountPropertyModification.createForAddress( - PropertyModificationType.Remove, + it('Announce AccountRestrictionTransaction', (done) => { + const addressPropertyFilter = AccountRestrictionModification.createForAddress( + RestrictionModificationType.Remove, account3.address, ); - const addressModification = AccountPropertyTransaction.createAddressPropertyModificationTransaction( + const addressModification = AccountRestrictionTransaction.createAddressRestrictionModificationTransaction( Deadline.create(), - PropertyType.BlockAddress, + RestrictionType.BlockAddress, [addressPropertyFilter], NetworkType.MIJIN_TEST, ); diff --git a/e2e/infrastructure/TransactionHttp.spec.ts b/e2e/infrastructure/TransactionHttp.spec.ts index dfd5019b00..dbee30b256 100644 --- a/e2e/infrastructure/TransactionHttp.spec.ts +++ b/e2e/infrastructure/TransactionHttp.spec.ts @@ -24,10 +24,8 @@ import { NamespaceHttp } from '../../src/infrastructure/infrastructure'; import {Listener} from '../../src/infrastructure/Listener'; import {TransactionHttp} from '../../src/infrastructure/TransactionHttp'; import {Account} from '../../src/model/account/Account'; -import {Address} from '../../src/model/account/Address'; -import { PropertyModificationType } from '../../src/model/account/PropertyModificationType'; -import { PropertyType } from '../../src/model/account/PropertyType'; -import {PublicAccount} from '../../src/model/account/PublicAccount'; +import { RestrictionModificationType } from '../../src/model/account/RestrictionModificationType'; +import { RestrictionType } from '../../src/model/account/RestrictionType'; import {NetworkType} from '../../src/model/blockchain/NetworkType'; import { Mosaic } from '../../src/model/mosaic/Mosaic'; import {MosaicId} from '../../src/model/mosaic/MosaicId'; @@ -37,32 +35,27 @@ import {MosaicSupplyType} from '../../src/model/mosaic/MosaicSupplyType'; import {NetworkCurrencyMosaic} from '../../src/model/mosaic/NetworkCurrencyMosaic'; import { AliasActionType } from '../../src/model/namespace/AliasActionType'; import { NamespaceId } from '../../src/model/namespace/NamespaceId'; +import { AccountAddressRestrictionModificationTransaction } from '../../src/model/transaction/AccountAddressRestrictionModificationTransaction'; import { AccountLinkTransaction } from '../../src/model/transaction/AccountLinkTransaction'; -import { AccountPropertyModification } from '../../src/model/transaction/AccountPropertyModification'; -import { AccountPropertyTransaction } from '../../src/model/transaction/AccountPropertyTransaction'; +import { AccountMosaicRestrictionModificationTransaction } from '../../src/model/transaction/AccountMosaicRestrictionModificationTransaction'; +import { AccountOperationRestrictionModificationTransaction } from '../../src/model/transaction/AccountOperationRestrictionModificationTransaction'; +import { AccountRestrictionModification } from '../../src/model/transaction/AccountRestrictionModification'; +import { AccountRestrictionTransaction } from '../../src/model/transaction/AccountRestrictionTransaction'; import { AddressAliasTransaction } from '../../src/model/transaction/AddressAliasTransaction'; import {AggregateTransaction} from '../../src/model/transaction/AggregateTransaction'; import {CosignatureSignedTransaction} from '../../src/model/transaction/CosignatureSignedTransaction'; -import {CosignatureTransaction} from '../../src/model/transaction/CosignatureTransaction'; import {Deadline} from '../../src/model/transaction/Deadline'; import { HashLockTransaction } from '../../src/model/transaction/HashLockTransaction'; import {HashType} from '../../src/model/transaction/HashType'; import { LinkAction } from '../../src/model/transaction/LinkAction'; import {LockFundsTransaction} from '../../src/model/transaction/LockFundsTransaction'; -import { ModifyAccountPropertyAddressTransaction } from '../../src/model/transaction/ModifyAccountPropertyAddressTransaction'; -import { ModifyAccountPropertyEntityTypeTransaction } from '../../src/model/transaction/ModifyAccountPropertyEntityTypeTransaction'; -import { ModifyAccountPropertyMosaicTransaction } from '../../src/model/transaction/ModifyAccountPropertyMosaicTransaction'; -import {ModifyMultisigAccountTransaction} from '../../src/model/transaction/ModifyMultisigAccountTransaction'; import { MosaicAliasTransaction } from '../../src/model/transaction/MosaicAliasTransaction'; import {MosaicDefinitionTransaction} from '../../src/model/transaction/MosaicDefinitionTransaction'; import {MosaicSupplyChangeTransaction} from '../../src/model/transaction/MosaicSupplyChangeTransaction'; -import {MultisigCosignatoryModification} from '../../src/model/transaction/MultisigCosignatoryModification'; -import {MultisigCosignatoryModificationType} from '../../src/model/transaction/MultisigCosignatoryModificationType'; -import {EmptyMessage, PlainMessage} from '../../src/model/transaction/PlainMessage'; +import { PlainMessage } from '../../src/model/transaction/PlainMessage'; import {RegisterNamespaceTransaction} from '../../src/model/transaction/RegisterNamespaceTransaction'; import {SecretLockTransaction} from '../../src/model/transaction/SecretLockTransaction'; import {SecretProofTransaction} from '../../src/model/transaction/SecretProofTransaction'; -import {SignedTransaction} from '../../src/model/transaction/SignedTransaction'; import {Transaction} from '../../src/model/transaction/Transaction'; import {TransactionType} from '../../src/model/transaction/TransactionType'; import {TransferTransaction} from '../../src/model/transaction/TransferTransaction'; @@ -272,7 +265,7 @@ describe('TransactionHttp', () => { transactionHttp.announce(signedTransaction); }); }); - describe('AccountPropertyTransaction - Address', () => { + describe('AccountRestrictionTransaction - Address', () => { let listener: Listener; before (() => { listener = new Listener(config.apiUrl); @@ -283,23 +276,23 @@ describe('TransactionHttp', () => { }); it('standalone', (done) => { - const addressPropertyFilter = AccountPropertyModification.createForAddress( - PropertyModificationType.Add, + const addressRestrictionFilter = AccountRestrictionModification.createForAddress( + RestrictionModificationType.Add, account3.address, ); - const addressModification = AccountPropertyTransaction.createAddressPropertyModificationTransaction( + const addressModification = AccountRestrictionTransaction.createAddressRestrictionModificationTransaction( Deadline.create(), - PropertyType.BlockAddress, - [addressPropertyFilter], + RestrictionType.BlockAddress, + [addressRestrictionFilter], NetworkType.MIJIN_TEST, ); const signedTransaction = addressModification.signWith(account, generationHash); - listener.confirmed(account.address).subscribe((transaction: ModifyAccountPropertyAddressTransaction) => { + listener.confirmed(account.address).subscribe((transaction: AccountAddressRestrictionModificationTransaction) => { expect(transaction.modifications, 'Modifications').not.to.be.undefined; expect(transaction.modifications[0].modificationType, 'Modifications.ModificationType').not.to.be.undefined; expect(transaction.modifications[0].value, 'Modifications.Value').not.to.be.undefined; - expect(transaction.propertyType, 'PropertyType').not.to.be.undefined; + expect(transaction.restrictionType, 'RestrictionType').not.to.be.undefined; done(); }); listener.status(account.address).subscribe((error) => { @@ -310,7 +303,7 @@ describe('TransactionHttp', () => { transactionHttp.announce(signedTransaction); }); }); - describe('AccountPropertyTransaction - Address', () => { + describe('AccountRestrictionTransaction - Address', () => { let listener: Listener; before (() => { listener = new Listener(config.apiUrl); @@ -320,14 +313,14 @@ describe('TransactionHttp', () => { return listener.close(); }); it('aggregate', (done) => { - const addressPropertyFilter = AccountPropertyModification.createForAddress( - PropertyModificationType.Remove, + const addressRestrictionFilter = AccountRestrictionModification.createForAddress( + RestrictionModificationType.Remove, account3.address, ); - const addressModification = AccountPropertyTransaction.createAddressPropertyModificationTransaction( + const addressModification = AccountRestrictionTransaction.createAddressRestrictionModificationTransaction( Deadline.create(), - PropertyType.BlockAddress, - [addressPropertyFilter], + RestrictionType.BlockAddress, + [addressRestrictionFilter], NetworkType.MIJIN_TEST, ); const aggregateTransaction = AggregateTransaction.createComplete(Deadline.create(), @@ -347,7 +340,7 @@ describe('TransactionHttp', () => { transactionHttp.announce(signedTransaction); }); }); - describe('AccountPropertyTransaction - Mosaic', () => { + describe('AccountRestrictionTransaction - Mosaic', () => { let listener: Listener; before (() => { listener = new Listener(config.apiUrl); @@ -358,23 +351,23 @@ describe('TransactionHttp', () => { }); it('standalone', (done) => { - const mosaicPropertyFilter = AccountPropertyModification.createForMosaic( - PropertyModificationType.Add, + const mosaicRestrictionFilter = AccountRestrictionModification.createForMosaic( + RestrictionModificationType.Add, mosaicId, ); - const addressModification = AccountPropertyTransaction.createMosaicPropertyModificationTransaction( + const addressModification = AccountRestrictionTransaction.createMosaicRestrictionModificationTransaction( Deadline.create(), - PropertyType.BlockMosaic, - [mosaicPropertyFilter], + RestrictionType.BlockMosaic, + [mosaicRestrictionFilter], NetworkType.MIJIN_TEST, ); const signedTransaction = addressModification.signWith(account, generationHash); - listener.confirmed(account.address).subscribe((transaction: ModifyAccountPropertyMosaicTransaction) => { + listener.confirmed(account.address).subscribe((transaction: AccountMosaicRestrictionModificationTransaction) => { expect(transaction.modifications, 'Modifications').not.to.be.undefined; expect(transaction.modifications[0].modificationType, 'Modifications.ModificationType').not.to.be.undefined; expect(transaction.modifications[0].value, 'Modifications.Value').not.to.be.undefined; - expect(transaction.propertyType, 'PropertyType').not.to.be.undefined; + expect(transaction.restrictionType, 'RestrictionType').not.to.be.undefined; done(); }); listener.status(account.address).subscribe((error) => { @@ -385,7 +378,7 @@ describe('TransactionHttp', () => { transactionHttp.announce(signedTransaction); }); }); - describe('AccountPropertyTransaction - Mosaic', () => { + describe('AccountRestrictionTransaction - Mosaic', () => { let listener: Listener; before (() => { listener = new Listener(config.apiUrl); @@ -395,14 +388,14 @@ describe('TransactionHttp', () => { return listener.close(); }); it('aggregate', (done) => { - const mosaicPropertyFilter = AccountPropertyModification.createForMosaic( - PropertyModificationType.Remove, + const mosaicRestrictionFilter = AccountRestrictionModification.createForMosaic( + RestrictionModificationType.Remove, mosaicId, ); - const addressModification = AccountPropertyTransaction.createMosaicPropertyModificationTransaction( + const addressModification = AccountRestrictionTransaction.createMosaicRestrictionModificationTransaction( Deadline.create(), - PropertyType.BlockMosaic, - [mosaicPropertyFilter], + RestrictionType.BlockMosaic, + [mosaicRestrictionFilter], NetworkType.MIJIN_TEST, ); const aggregateTransaction = AggregateTransaction.createComplete(Deadline.create(), @@ -422,7 +415,7 @@ describe('TransactionHttp', () => { transactionHttp.announce(signedTransaction); }); }); - describe('AccountPropertyTransaction - EntityType', () => { + describe('AccountRestrictionTransaction - Operation', () => { let listener: Listener; before (() => { listener = new Listener(config.apiUrl); @@ -433,23 +426,23 @@ describe('TransactionHttp', () => { }); it('standalone', (done) => { - const entityTypePropertyFilter = AccountPropertyModification.createForEntityType( - PropertyModificationType.Add, + const operationRestrictionFilter = AccountRestrictionModification.createForOperation( + RestrictionModificationType.Add, TransactionType.LINK_ACCOUNT, ); - const addressModification = AccountPropertyTransaction.createEntityTypePropertyModificationTransaction( + const addressModification = AccountRestrictionTransaction.createOperationRestrictionModificationTransaction( Deadline.create(), - PropertyType.BlockTransaction, - [entityTypePropertyFilter], + RestrictionType.BlockTransaction, + [operationRestrictionFilter], NetworkType.MIJIN_TEST, ); const signedTransaction = addressModification.signWith(account3, generationHash); - listener.confirmed(account3.address).subscribe((transaction: ModifyAccountPropertyEntityTypeTransaction) => { + listener.confirmed(account3.address).subscribe((transaction: AccountOperationRestrictionModificationTransaction) => { expect(transaction.modifications, 'Modifications').not.to.be.undefined; expect(transaction.modifications[0].modificationType, 'Modifications.ModificationType').not.to.be.undefined; expect(transaction.modifications[0].value, 'Modifications.Value').not.to.be.undefined; - expect(transaction.propertyType, 'PropertyType').not.to.be.undefined; + expect(transaction.restrictionType, 'RestrictionType').not.to.be.undefined; done(); }); listener.status(account3.address).subscribe((error) => { @@ -460,7 +453,7 @@ describe('TransactionHttp', () => { transactionHttp.announce(signedTransaction); }); }); - describe('AccountPropertyTransaction - EntityType', () => { + describe('AccountRestrictionTransaction - Operation', () => { let listener: Listener; before (() => { listener = new Listener(config.apiUrl); @@ -470,14 +463,14 @@ describe('TransactionHttp', () => { return listener.close(); }); it('aggregate', (done) => { - const entityTypePropertyFilter = AccountPropertyModification.createForEntityType( - PropertyModificationType.Remove, + const operationRestrictionFilter = AccountRestrictionModification.createForOperation( + RestrictionModificationType.Remove, TransactionType.LINK_ACCOUNT, ); - const addressModification = AccountPropertyTransaction.createEntityTypePropertyModificationTransaction( + const addressModification = AccountRestrictionTransaction.createOperationRestrictionModificationTransaction( Deadline.create(), - PropertyType.BlockTransaction, - [entityTypePropertyFilter], + RestrictionType.BlockTransaction, + [operationRestrictionFilter], NetworkType.MIJIN_TEST, ); const aggregateTransaction = AggregateTransaction.createComplete(Deadline.create(), diff --git a/package-lock.json b/package-lock.json index 82520485e7..0459730d4c 100644 --- a/package-lock.json +++ b/package-lock.json @@ -1,6 +1,6 @@ { "name": "nem2-sdk", - "version": "0.12.4", + "version": "0.13.0", "lockfileVersion": 1, "requires": true, "dependencies": { diff --git a/package.json b/package.json index f58619397c..26748b47c6 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "nem2-sdk", - "version": "0.12.4", + "version": "0.13.0", "description": "Reactive Nem2 sdk for typescript and javascript", "scripts": { "pretest": "npm run build", diff --git a/src/core/utils/DtoMapping.ts b/src/core/utils/DtoMapping.ts index 282ecc6029..9a0e2b77d1 100644 --- a/src/core/utils/DtoMapping.ts +++ b/src/core/utils/DtoMapping.ts @@ -14,39 +14,39 @@ * limitations under the License. */ -import { AccountProperties } from '../../model/account/AccountProperties'; -import { AccountPropertiesInfo } from '../../model/account/AccountPropertiesInfo'; -import { AccountProperty } from '../../model/account/AccountProperty'; +import { AccountRestriction } from '../../model/account/AccountRestriction'; +import { AccountRestrictions } from '../../model/account/AccountRestrictions'; +import { AccountRestrictionsInfo } from '../../model/account/AccountRestrictionsInfo'; import { Address } from '../../model/account/Address'; -import { PropertyType } from '../../model/account/PropertyType'; +import { RestrictionType } from '../../model/account/RestrictionType'; import { MosaicId } from '../../model/mosaic/MosaicId'; export class DtoMapping { /** - * Create AccountPropertyInfo class from Json. - * @param {object} dataJson The account property json object. - * @returns {module: model/Account/AccountPropertiesInfo} The AccountPropertiesInfo class. + * Create AccountRestrictionsInfo class from Json. + * @param {object} dataJson The account restriction json object. + * @returns {module: model/Account/AccountRestrictionsInfo} The AccountRestrictionsInfo class. */ - public static extractAccountPropertyFromDto(accountProperties): AccountPropertiesInfo { - return new AccountPropertiesInfo( - accountProperties.meta, - new AccountProperties(Address.createFromEncoded(accountProperties.accountProperties.address), - accountProperties.accountProperties.properties.map((prop) => { - switch (prop.propertyType) { - case PropertyType.AllowAddress: - case PropertyType.BlockAddress: - return new AccountProperty(prop.propertyType, + public static extractAccountRestrictionFromDto(accountRestrictions): AccountRestrictionsInfo { + return new AccountRestrictionsInfo( + accountRestrictions.meta, + new AccountRestrictions(Address.createFromEncoded(accountRestrictions.accountRestrictions.address), + accountRestrictions.accountRestrictions.restrictions.map((prop) => { + switch (prop.restrictionType) { + case RestrictionType.AllowAddress: + case RestrictionType.BlockAddress: + return new AccountRestriction(prop.restrictionType, prop.values.map((value) => Address.createFromEncoded(value))); - case PropertyType.AllowMosaic: - case PropertyType.BlockMosaic: - return new AccountProperty(prop.propertyType, + case RestrictionType.AllowMosaic: + case RestrictionType.BlockMosaic: + return new AccountRestriction(prop.restrictionType, prop.values.map((value) => new MosaicId(value))); - case PropertyType.AllowTransaction: - case PropertyType.BlockTransaction: - return new AccountProperty(prop.propertyType, prop.values); + case RestrictionType.AllowTransaction: + case RestrictionType.BlockTransaction: + return new AccountRestriction(prop.restrictionType, prop.values); default: - throw new Error(`Invalid property type: ${prop.propertyType}`); + throw new Error(`Invalid restriction type: ${prop.restrictionType}`); } }))); } diff --git a/src/infrastructure/AccountHttp.ts b/src/infrastructure/AccountHttp.ts index 7c53b58c7d..6ef6ba3fae 100644 --- a/src/infrastructure/AccountHttp.ts +++ b/src/infrastructure/AccountHttp.ts @@ -19,7 +19,7 @@ import {map, mergeMap} from 'rxjs/operators'; import { DtoMapping } from '../core/utils/DtoMapping'; import {AccountInfo} from '../model/account/AccountInfo'; import { AccountNames } from '../model/account/AccountNames'; -import { AccountPropertiesInfo } from '../model/account/AccountPropertiesInfo'; +import { AccountRestrictionsInfo } from '../model/account/AccountRestrictionsInfo'; import {Address} from '../model/account/Address'; import {MultisigAccountGraphInfo} from '../model/account/MultisigAccountGraphInfo'; import {MultisigAccountInfo} from '../model/account/MultisigAccountInfo'; @@ -34,8 +34,8 @@ import {UInt64} from '../model/UInt64'; import {AccountRepository} from './AccountRepository'; import { AccountInfoDTO, AccountNamesDTO, - AccountPropertiesDTO, - AccountPropertiesInfoDTO, + AccountRestrictionsDTO, + AccountRestrictionsInfoDTO, AccountRoutesApi, MosaicDTO, MultisigAccountGraphInfoDTO, @@ -93,31 +93,31 @@ export class AccountHttp extends Http implements AccountRepository { } /** - * Gets Account property. + * Get Account restrictions. * @param publicAccount public account - * @returns Observable + * @returns Observable */ - public getAccountProperties(address: Address): Observable { - return observableFrom(this.accountRoutesApi.getAccountProperties(address.plain())) - .pipe(map((accountProperties: AccountPropertiesInfoDTO) => { - return DtoMapping.extractAccountPropertyFromDto(accountProperties); + public getAccountRestrictions(address: Address): Observable { + return observableFrom(this.accountRoutesApi.getAccountRestrictions(address.plain())) + .pipe(map((accountRestrictions: AccountRestrictionsInfoDTO) => { + return DtoMapping.extractAccountRestrictionFromDto(accountRestrictions); })); } /** - * Gets Account properties. + * Get Account restrictions. * @param address list of addresses - * @returns Observable + * @returns Observable */ - public getAccountPropertiesFromAccounts(addresses: Address[]): Observable { + public getAccountRestrictionsFromAccounts(addresses: Address[]): Observable { const accountIds = { addresses: addresses.map((address) => address.plain()), }; return observableFrom( - this.accountRoutesApi.getAccountPropertiesFromAccounts(accountIds)) - .pipe(map((accountProperties: AccountPropertiesDTO[]) => { - return accountProperties.map((property) => { - return DtoMapping.extractAccountPropertyFromDto(property); + this.accountRoutesApi.getAccountRestrictionsFromAccounts(accountIds)) + .pipe(map((accountRestrictions: AccountRestrictionsDTO[]) => { + return accountRestrictions.map((restriction) => { + return DtoMapping.extractAccountRestrictionFromDto(restriction); }); })); } diff --git a/src/infrastructure/AccountRepository.ts b/src/infrastructure/AccountRepository.ts index da8d02c988..a853840b49 100644 --- a/src/infrastructure/AccountRepository.ts +++ b/src/infrastructure/AccountRepository.ts @@ -23,7 +23,7 @@ import {PublicAccount} from '../model/account/PublicAccount'; import {AggregateTransaction} from '../model/transaction/AggregateTransaction'; import {Transaction} from '../model/transaction/Transaction'; import {QueryParams} from './QueryParams'; -import {AccountPropertiesInfo} from "../model/account/AccountPropertiesInfo"; +import {AccountRestrictionsInfo} from "../model/account/AccountRestrictionsInfo"; import { AccountNames } from '../model/account/AccountNames'; /** @@ -56,18 +56,18 @@ export interface AccountRepository { getAccountsNames(accountIds: Address[]): Observable; /** - * Gets Account property. + * Gets Account restrictions. * @param publicAccount public account - * @returns Observable + * @returns Observable */ - getAccountProperties(address: Address): Observable; + getAccountRestrictions(address: Address): Observable; /** - * Gets Account properties. + * Gets Account restrictions. * @param address list of addresses - * @returns Observable + * @returns Observable */ - getAccountPropertiesFromAccounts(addresses: Address[]): Observable; + getAccountRestrictionsFromAccounts(addresses: Address[]): Observable; /** * Gets a MultisigAccountInfo for an account. diff --git a/src/infrastructure/api.ts b/src/infrastructure/api.ts index 6d1bd548c9..590b4eacdd 100644 --- a/src/infrastructure/api.ts +++ b/src/infrastructure/api.ts @@ -14,16 +14,17 @@ * limitations under the License. */ /** - * Catapult REST API Reference + * Catapult REST Endpoints * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) * - * The version of the OpenAPI document: 0.7.15 + * The version of the OpenAPI document: 0.7.16 * * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). * https://openapi-generator.tech * Do not edit the class manually. */ + // This is the entrypoint for the package export * from './api/apis'; export * from './model/models'; \ No newline at end of file diff --git a/src/infrastructure/api/accountRoutesApi.ts b/src/infrastructure/api/accountRoutesApi.ts index cdf01391d3..529245b7a5 100644 --- a/src/infrastructure/api/accountRoutesApi.ts +++ b/src/infrastructure/api/accountRoutesApi.ts @@ -14,10 +14,10 @@ * limitations under the License. */ /** - * Catapult REST API Reference + * Catapult REST Endpoints * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) * - * The version of the OpenAPI document: 0.7.15 + * The version of the OpenAPI document: 0.7.16 * * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). @@ -32,7 +32,7 @@ import http = require('http'); import { AccountIds } from '../model/accountIds'; import { AccountInfoDTO } from '../model/accountInfoDTO'; import { AccountNamesDTO } from '../model/accountNamesDTO'; -import { AccountPropertiesInfoDTO } from '../model/accountPropertiesInfoDTO'; +import { AccountRestrictionsInfoDTO } from '../model/accountRestrictionsInfoDTO'; import { MultisigAccountGraphInfoDTO } from '../model/multisigAccountGraphInfoDTO'; import { MultisigAccountInfoDTO } from '../model/multisigAccountInfoDTO'; import { TransactionInfoDTO } from '../model/transactionInfoDTO'; @@ -262,12 +262,12 @@ export class AccountRoutesApi { }); } /** - * Returns the configurable properties for a given account. - * @summary Get account configurable properties information + * Returns the account restrictions for a given account. + * @summary Get the account restrictions * @param accountId The public key or address of the account. */ - public async getAccountProperties (accountId: string, options: {headers: {[name: string]: string}} = {headers: {}}) : Promise<{ response: http.ClientResponse; body: AccountPropertiesInfoDTO; }> { - const localVarPath = this.basePath + '/account/{accountId}/properties/' + public async getAccountRestrictions (accountId: string, options: {headers: {[name: string]: string}} = {headers: {}}) : Promise<{ response: http.ClientResponse; body: AccountRestrictionsInfoDTO; }> { + const localVarPath = this.basePath + '/account/{accountId}/restrictions/' .replace('{' + 'accountId' + '}', encodeURIComponent(String(accountId))); let localVarQueryParameters: any = {}; let localVarHeaderParams: any = (Object).assign({}, this.defaultHeaders); @@ -275,7 +275,7 @@ export class AccountRoutesApi { // verify required parameter 'accountId' is not null or undefined if (accountId === null || accountId === undefined) { - throw new Error('Required parameter accountId was null or undefined when calling getAccountProperties.'); + throw new Error('Required parameter accountId was null or undefined when calling getAccountRestrictions.'); } (Object).assign(localVarHeaderParams, options.headers); @@ -300,12 +300,12 @@ export class AccountRoutesApi { localVarRequestOptions.form = localVarFormParams; } } - return new Promise<{ response: http.ClientResponse; body: AccountPropertiesInfoDTO; }>((resolve, reject) => { + return new Promise<{ response: http.ClientResponse; body: AccountRestrictionsInfoDTO; }>((resolve, reject) => { localVarRequest(localVarRequestOptions, (error, response, body) => { if (error) { reject(error); } else { - body = ObjectSerializer.deserialize(body, "AccountPropertiesInfoDTO"); + body = ObjectSerializer.deserialize(body, "AccountRestrictionsInfoDTO"); if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) { resolve(body); } else { @@ -319,19 +319,19 @@ export class AccountRoutesApi { }); } /** - * Returns the configurable properties for a given array of addresses. - * @summary Get account properties for given array of addresses + * Returns the account restrictions for a given array of addresses. + * @summary Get account restrictions for given array of addresses * @param accountIds */ - public async getAccountPropertiesFromAccounts (accountIds: AccountIds, options: {headers: {[name: string]: string}} = {headers: {}}) : Promise<{ response: http.ClientResponse; body: Array; }> { - const localVarPath = this.basePath + '/account/properties'; + public async getAccountRestrictionsFromAccounts (accountIds: AccountIds, options: {headers: {[name: string]: string}} = {headers: {}}) : Promise<{ response: http.ClientResponse; body: Array; }> { + const localVarPath = this.basePath + '/account/restrictions'; let localVarQueryParameters: any = {}; let localVarHeaderParams: any = (Object).assign({}, this.defaultHeaders); let localVarFormParams: any = {}; // verify required parameter 'accountIds' is not null or undefined if (accountIds === null || accountIds === undefined) { - throw new Error('Required parameter accountIds was null or undefined when calling getAccountPropertiesFromAccounts.'); + throw new Error('Required parameter accountIds was null or undefined when calling getAccountRestrictionsFromAccounts.'); } (Object).assign(localVarHeaderParams, options.headers); @@ -357,12 +357,12 @@ export class AccountRoutesApi { localVarRequestOptions.form = localVarFormParams; } } - return new Promise<{ response: http.ClientResponse; body: Array; }>((resolve, reject) => { + return new Promise<{ response: http.ClientResponse; body: Array; }>((resolve, reject) => { localVarRequest(localVarRequestOptions, (error, response, body) => { if (error) { reject(error); } else { - body = ObjectSerializer.deserialize(body, "Array"); + body = ObjectSerializer.deserialize(body, "Array"); if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) { resolve(body); } else { diff --git a/src/infrastructure/api/apis.ts b/src/infrastructure/api/apis.ts index b32f7659da..8772c3573e 100644 --- a/src/infrastructure/api/apis.ts +++ b/src/infrastructure/api/apis.ts @@ -14,10 +14,10 @@ * limitations under the License. */ /** - * Catapult REST API Reference + * Catapult REST Endpoints * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) * - * The version of the OpenAPI document: 0.7.15 + * The version of the OpenAPI document: 0.7.16 * * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). diff --git a/src/infrastructure/api/blockRoutesApi.ts b/src/infrastructure/api/blockRoutesApi.ts index 81abddbdc6..881fb16997 100644 --- a/src/infrastructure/api/blockRoutesApi.ts +++ b/src/infrastructure/api/blockRoutesApi.ts @@ -14,10 +14,10 @@ * limitations under the License. */ /** - * Catapult REST API Reference + * Catapult REST Endpoints * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) * - * The version of the OpenAPI document: 0.7.15 + * The version of the OpenAPI document: 0.7.16 * * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). diff --git a/src/infrastructure/api/chainRoutesApi.ts b/src/infrastructure/api/chainRoutesApi.ts index b5f3e17326..4e0706620c 100644 --- a/src/infrastructure/api/chainRoutesApi.ts +++ b/src/infrastructure/api/chainRoutesApi.ts @@ -14,10 +14,10 @@ * limitations under the License. */ /** - * Catapult REST API Reference + * Catapult REST Endpoints * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) * - * The version of the OpenAPI document: 0.7.15 + * The version of the OpenAPI document: 0.7.16 * * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). diff --git a/src/infrastructure/api/diagnosticRoutesApi.ts b/src/infrastructure/api/diagnosticRoutesApi.ts index d05fc09bfe..e70a25623f 100644 --- a/src/infrastructure/api/diagnosticRoutesApi.ts +++ b/src/infrastructure/api/diagnosticRoutesApi.ts @@ -14,10 +14,10 @@ * limitations under the License. */ /** - * Catapult REST API Reference + * Catapult REST Endpoints * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) * - * The version of the OpenAPI document: 0.7.15 + * The version of the OpenAPI document: 0.7.16 * * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). diff --git a/src/infrastructure/api/mosaicRoutesApi.ts b/src/infrastructure/api/mosaicRoutesApi.ts index 7470668f53..dfb0e36a8b 100644 --- a/src/infrastructure/api/mosaicRoutesApi.ts +++ b/src/infrastructure/api/mosaicRoutesApi.ts @@ -14,10 +14,10 @@ * limitations under the License. */ /** - * Catapult REST API Reference + * Catapult REST Endpoints * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) * - * The version of the OpenAPI document: 0.7.15 + * The version of the OpenAPI document: 0.7.16 * * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). diff --git a/src/infrastructure/api/namespaceRoutesApi.ts b/src/infrastructure/api/namespaceRoutesApi.ts index ed7857bdf3..7ce0824c7b 100644 --- a/src/infrastructure/api/namespaceRoutesApi.ts +++ b/src/infrastructure/api/namespaceRoutesApi.ts @@ -14,10 +14,10 @@ * limitations under the License. */ /** - * Catapult REST API Reference + * Catapult REST Endpoints * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) * - * The version of the OpenAPI document: 0.7.15 + * The version of the OpenAPI document: 0.7.16 * * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). diff --git a/src/infrastructure/api/networkRoutesApi.ts b/src/infrastructure/api/networkRoutesApi.ts index 368aa05c7d..1e9fa0422c 100644 --- a/src/infrastructure/api/networkRoutesApi.ts +++ b/src/infrastructure/api/networkRoutesApi.ts @@ -14,10 +14,10 @@ * limitations under the License. */ /** - * Catapult REST API Reference + * Catapult REST Endpoints * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) * - * The version of the OpenAPI document: 0.7.15 + * The version of the OpenAPI document: 0.7.16 * * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). diff --git a/src/infrastructure/api/nodeRoutesApi.ts b/src/infrastructure/api/nodeRoutesApi.ts index bd2b829091..cd2b0ca19b 100644 --- a/src/infrastructure/api/nodeRoutesApi.ts +++ b/src/infrastructure/api/nodeRoutesApi.ts @@ -14,10 +14,10 @@ * limitations under the License. */ /** - * Catapult REST API Reference + * Catapult REST Endpoints * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) * - * The version of the OpenAPI document: 0.7.15 + * The version of the OpenAPI document: 0.7.16 * * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). diff --git a/src/infrastructure/api/transactionRoutesApi.ts b/src/infrastructure/api/transactionRoutesApi.ts index e06468ad30..39618d7377 100644 --- a/src/infrastructure/api/transactionRoutesApi.ts +++ b/src/infrastructure/api/transactionRoutesApi.ts @@ -14,10 +14,10 @@ * limitations under the License. */ /** - * Catapult REST API Reference + * Catapult REST Endpoints * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) * - * The version of the OpenAPI document: 0.7.15 + * The version of the OpenAPI document: 0.7.16 * * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). diff --git a/src/infrastructure/buffers/AccountPropertiesAddressTransactionBuffer.ts b/src/infrastructure/buffers/AccountRestrictionsAddressTransactionBuffer.ts similarity index 58% rename from src/infrastructure/buffers/AccountPropertiesAddressTransactionBuffer.ts rename to src/infrastructure/buffers/AccountRestrictionsAddressTransactionBuffer.ts index 128442e660..7f71878ffc 100644 --- a/src/infrastructure/buffers/AccountPropertiesAddressTransactionBuffer.ts +++ b/src/infrastructure/buffers/AccountRestrictionsAddressTransactionBuffer.ts @@ -31,7 +31,7 @@ Catapult.Buffers = Catapult.Buffers || {}; /** * @constructor */ -Catapult.Buffers.PropertyAddressModificationBuffer = function() { +Catapult.Buffers.RestrictionAddressModificationBuffer = function() { /** * @type {flatbuffers.ByteBuffer} */ @@ -46,9 +46,9 @@ Catapult.Buffers.PropertyAddressModificationBuffer = function() { /** * @param {number} i * @param {flatbuffers.ByteBuffer} bb - * @returns {Catapult.Buffers.PropertyAddressModificationBuffer} + * @returns {Catapult.Buffers.RestrictionAddressModificationBuffer} */ -Catapult.Buffers.PropertyAddressModificationBuffer.prototype.__init = function(i, bb) { +Catapult.Buffers.RestrictionAddressModificationBuffer.prototype.__init = function(i, bb) { this.bb_pos = i; this.bb = bb; return this; @@ -56,17 +56,17 @@ Catapult.Buffers.PropertyAddressModificationBuffer.prototype.__init = function(i /** * @param {flatbuffers.ByteBuffer} bb - * @param {Catapult.Buffers.PropertyAddressModificationBuffer=} obj - * @returns {Catapult.Buffers.PropertyAddressModificationBuffer} + * @param {Catapult.Buffers.RestrictionAddressModificationBuffer=} obj + * @returns {Catapult.Buffers.RestrictionAddressModificationBuffer} */ -Catapult.Buffers.PropertyAddressModificationBuffer.getRootAsPropertyAddressModificationBuffer = function(bb, obj) { - return (obj || new Catapult.Buffers.PropertyAddressModificationBuffer).__init(bb.readInt32(bb.position()) + bb.position(), bb); +Catapult.Buffers.RestrictionAddressModificationBuffer.getRootAsRestrictionAddressModificationBuffer = function(bb, obj) { + return (obj || new Catapult.Buffers.RestrictionAddressModificationBuffer).__init(bb.readInt32(bb.position()) + bb.position(), bb); }; /** * @returns {number} */ -Catapult.Buffers.PropertyAddressModificationBuffer.prototype.modificationType = function() { +Catapult.Buffers.RestrictionAddressModificationBuffer.prototype.modificationType = function() { var offset = this.bb.__offset(this.bb_pos, 4); return offset ? this.bb.readUint8(this.bb_pos + offset) : 0; }; @@ -75,7 +75,7 @@ Catapult.Buffers.PropertyAddressModificationBuffer.prototype.modificationType = * @param {number} index * @returns {number} */ -Catapult.Buffers.PropertyAddressModificationBuffer.prototype.value = function(index) { +Catapult.Buffers.RestrictionAddressModificationBuffer.prototype.value = function(index) { var offset = this.bb.__offset(this.bb_pos, 6); return offset ? this.bb.readUint8(this.bb.__vector(this.bb_pos + offset) + index) : 0; }; @@ -83,7 +83,7 @@ Catapult.Buffers.PropertyAddressModificationBuffer.prototype.value = function(in /** * @returns {number} */ -Catapult.Buffers.PropertyAddressModificationBuffer.prototype.valueLength = function() { +Catapult.Buffers.RestrictionAddressModificationBuffer.prototype.valueLength = function() { var offset = this.bb.__offset(this.bb_pos, 6); return offset ? this.bb.__vector_len(this.bb_pos + offset) : 0; }; @@ -91,7 +91,7 @@ Catapult.Buffers.PropertyAddressModificationBuffer.prototype.valueLength = funct /** * @returns {Uint8Array} */ -Catapult.Buffers.PropertyAddressModificationBuffer.prototype.valueArray = function() { +Catapult.Buffers.RestrictionAddressModificationBuffer.prototype.valueArray = function() { var offset = this.bb.__offset(this.bb_pos, 6); return offset ? new Uint8Array(this.bb.bytes().buffer, this.bb.bytes().byteOffset + this.bb.__vector(this.bb_pos + offset), this.bb.__vector_len(this.bb_pos + offset)) : null; }; @@ -99,7 +99,7 @@ Catapult.Buffers.PropertyAddressModificationBuffer.prototype.valueArray = functi /** * @param {flatbuffers.Builder} builder */ -Catapult.Buffers.PropertyAddressModificationBuffer.startPropertyAddressModificationBuffer = function(builder) { +Catapult.Buffers.RestrictionAddressModificationBuffer.startRestrictionAddressModificationBuffer = function(builder) { builder.startObject(2); }; @@ -107,7 +107,7 @@ Catapult.Buffers.PropertyAddressModificationBuffer.startPropertyAddressModificat * @param {flatbuffers.Builder} builder * @param {number} type */ -Catapult.Buffers.PropertyAddressModificationBuffer.addModificationType = function(builder, type) { +Catapult.Buffers.RestrictionAddressModificationBuffer.addModificationType = function(builder, type) { builder.addFieldInt8(0, type, 0); }; @@ -115,7 +115,7 @@ Catapult.Buffers.PropertyAddressModificationBuffer.addModificationType = functio * @param {flatbuffers.Builder} builder * @param {flatbuffers.Offset} valueOffset */ -Catapult.Buffers.PropertyAddressModificationBuffer.addValue = function(builder, valueOffset) { +Catapult.Buffers.RestrictionAddressModificationBuffer.addValue = function(builder, valueOffset) { builder.addFieldOffset(1, valueOffset, 0); }; @@ -124,7 +124,7 @@ Catapult.Buffers.PropertyAddressModificationBuffer.addValue = function(builder, * @param {Array.} data * @returns {flatbuffers.Offset} */ -Catapult.Buffers.PropertyAddressModificationBuffer.createValueVector = function(builder, data) { +Catapult.Buffers.RestrictionAddressModificationBuffer.createValueVector = function(builder, data) { builder.startVector(1, data.length, 1); for (var i = data.length - 1; i >= 0; i--) { builder.addInt8(data[i]); @@ -136,7 +136,7 @@ Catapult.Buffers.PropertyAddressModificationBuffer.createValueVector = function( * @param {flatbuffers.Builder} builder * @param {number} numElems */ -Catapult.Buffers.PropertyAddressModificationBuffer.startValueVector = function(builder, numElems) { +Catapult.Buffers.RestrictionAddressModificationBuffer.startValueVector = function(builder, numElems) { builder.startVector(1, numElems, 1); }; @@ -144,7 +144,7 @@ Catapult.Buffers.PropertyAddressModificationBuffer.startValueVector = function(b * @param {flatbuffers.Builder} builder * @returns {flatbuffers.Offset} */ -Catapult.Buffers.PropertyAddressModificationBuffer.endPropertyAddressModificationBuffer = function(builder) { +Catapult.Buffers.RestrictionAddressModificationBuffer.endRestrictionAddressModificationBuffer = function(builder) { var offset = builder.endObject(); return offset; }; @@ -152,7 +152,7 @@ Catapult.Buffers.PropertyAddressModificationBuffer.endPropertyAddressModificatio /** * @constructor */ -Catapult.Buffers.AccountPropertiesAddressTransactionBuffer = function() { +Catapult.Buffers.AccountRestrictionsAddressTransactionBuffer = function() { /** * @type {flatbuffers.ByteBuffer} */ @@ -167,9 +167,9 @@ Catapult.Buffers.AccountPropertiesAddressTransactionBuffer = function() { /** * @param {number} i * @param {flatbuffers.ByteBuffer} bb - * @returns {Catapult.Buffers.AccountPropertiesAddressTransactionBuffer} + * @returns {Catapult.Buffers.AccountRestrictionsAddressTransactionBuffer} */ -Catapult.Buffers.AccountPropertiesAddressTransactionBuffer.prototype.__init = function(i, bb) { +Catapult.Buffers.AccountRestrictionsAddressTransactionBuffer.prototype.__init = function(i, bb) { this.bb_pos = i; this.bb = bb; return this; @@ -177,17 +177,17 @@ Catapult.Buffers.AccountPropertiesAddressTransactionBuffer.prototype.__init = fu /** * @param {flatbuffers.ByteBuffer} bb - * @param {Catapult.Buffers.AccountPropertiesAddressTransactionBuffer=} obj - * @returns {Catapult.Buffers.AccountPropertiesAddressTransactionBuffer} + * @param {Catapult.Buffers.AccountRestrictionsAddressTransactionBuffer=} obj + * @returns {Catapult.Buffers.AccountRestrictionsAddressTransactionBuffer} */ -Catapult.Buffers.AccountPropertiesAddressTransactionBuffer.getRootAsAccountPropertiesAddressTransactionBuffer = function(bb, obj) { - return (obj || new Catapult.Buffers.AccountPropertiesAddressTransactionBuffer).__init(bb.readInt32(bb.position()) + bb.position(), bb); +Catapult.Buffers.AccountRestrictionsAddressTransactionBuffer.getRootAsAccountRestrictionsAddressTransactionBuffer = function(bb, obj) { + return (obj || new Catapult.Buffers.AccountRestrictionsAddressTransactionBuffer).__init(bb.readInt32(bb.position()) + bb.position(), bb); }; /** * @returns {number} */ -Catapult.Buffers.AccountPropertiesAddressTransactionBuffer.prototype.size = function() { +Catapult.Buffers.AccountRestrictionsAddressTransactionBuffer.prototype.size = function() { var offset = this.bb.__offset(this.bb_pos, 4); return offset ? this.bb.readUint32(this.bb_pos + offset) : 0; }; @@ -196,7 +196,7 @@ Catapult.Buffers.AccountPropertiesAddressTransactionBuffer.prototype.size = func * @param {number} index * @returns {number} */ -Catapult.Buffers.AccountPropertiesAddressTransactionBuffer.prototype.signature = function(index) { +Catapult.Buffers.AccountRestrictionsAddressTransactionBuffer.prototype.signature = function(index) { var offset = this.bb.__offset(this.bb_pos, 6); return offset ? this.bb.readUint8(this.bb.__vector(this.bb_pos + offset) + index) : 0; }; @@ -204,7 +204,7 @@ Catapult.Buffers.AccountPropertiesAddressTransactionBuffer.prototype.signature = /** * @returns {number} */ -Catapult.Buffers.AccountPropertiesAddressTransactionBuffer.prototype.signatureLength = function() { +Catapult.Buffers.AccountRestrictionsAddressTransactionBuffer.prototype.signatureLength = function() { var offset = this.bb.__offset(this.bb_pos, 6); return offset ? this.bb.__vector_len(this.bb_pos + offset) : 0; }; @@ -212,7 +212,7 @@ Catapult.Buffers.AccountPropertiesAddressTransactionBuffer.prototype.signatureLe /** * @returns {Uint8Array} */ -Catapult.Buffers.AccountPropertiesAddressTransactionBuffer.prototype.signatureArray = function() { +Catapult.Buffers.AccountRestrictionsAddressTransactionBuffer.prototype.signatureArray = function() { var offset = this.bb.__offset(this.bb_pos, 6); return offset ? new Uint8Array(this.bb.bytes().buffer, this.bb.bytes().byteOffset + this.bb.__vector(this.bb_pos + offset), this.bb.__vector_len(this.bb_pos + offset)) : null; }; @@ -221,7 +221,7 @@ Catapult.Buffers.AccountPropertiesAddressTransactionBuffer.prototype.signatureAr * @param {number} index * @returns {number} */ -Catapult.Buffers.AccountPropertiesAddressTransactionBuffer.prototype.signer = function(index) { +Catapult.Buffers.AccountRestrictionsAddressTransactionBuffer.prototype.signer = function(index) { var offset = this.bb.__offset(this.bb_pos, 8); return offset ? this.bb.readUint8(this.bb.__vector(this.bb_pos + offset) + index) : 0; }; @@ -229,7 +229,7 @@ Catapult.Buffers.AccountPropertiesAddressTransactionBuffer.prototype.signer = fu /** * @returns {number} */ -Catapult.Buffers.AccountPropertiesAddressTransactionBuffer.prototype.signerLength = function() { +Catapult.Buffers.AccountRestrictionsAddressTransactionBuffer.prototype.signerLength = function() { var offset = this.bb.__offset(this.bb_pos, 8); return offset ? this.bb.__vector_len(this.bb_pos + offset) : 0; }; @@ -237,7 +237,7 @@ Catapult.Buffers.AccountPropertiesAddressTransactionBuffer.prototype.signerLengt /** * @returns {Uint8Array} */ -Catapult.Buffers.AccountPropertiesAddressTransactionBuffer.prototype.signerArray = function() { +Catapult.Buffers.AccountRestrictionsAddressTransactionBuffer.prototype.signerArray = function() { var offset = this.bb.__offset(this.bb_pos, 8); return offset ? new Uint8Array(this.bb.bytes().buffer, this.bb.bytes().byteOffset + this.bb.__vector(this.bb_pos + offset), this.bb.__vector_len(this.bb_pos + offset)) : null; }; @@ -245,7 +245,7 @@ Catapult.Buffers.AccountPropertiesAddressTransactionBuffer.prototype.signerArray /** * @returns {number} */ -Catapult.Buffers.AccountPropertiesAddressTransactionBuffer.prototype.version = function() { +Catapult.Buffers.AccountRestrictionsAddressTransactionBuffer.prototype.version = function() { var offset = this.bb.__offset(this.bb_pos, 10); return offset ? this.bb.readUint16(this.bb_pos + offset) : 0; }; @@ -253,7 +253,7 @@ Catapult.Buffers.AccountPropertiesAddressTransactionBuffer.prototype.version = f /** * @returns {number} */ -Catapult.Buffers.AccountPropertiesAddressTransactionBuffer.prototype.type = function() { +Catapult.Buffers.AccountRestrictionsAddressTransactionBuffer.prototype.type = function() { var offset = this.bb.__offset(this.bb_pos, 12); return offset ? this.bb.readUint16(this.bb_pos + offset) : 0; }; @@ -262,7 +262,7 @@ Catapult.Buffers.AccountPropertiesAddressTransactionBuffer.prototype.type = func * @param {number} index * @returns {number} */ -Catapult.Buffers.AccountPropertiesAddressTransactionBuffer.prototype.fee = function(index) { +Catapult.Buffers.AccountRestrictionsAddressTransactionBuffer.prototype.fee = function(index) { var offset = this.bb.__offset(this.bb_pos, 14); return offset ? this.bb.readUint32(this.bb.__vector(this.bb_pos + offset) + index * 4) : 0; }; @@ -270,7 +270,7 @@ Catapult.Buffers.AccountPropertiesAddressTransactionBuffer.prototype.fee = funct /** * @returns {number} */ -Catapult.Buffers.AccountPropertiesAddressTransactionBuffer.prototype.feeLength = function() { +Catapult.Buffers.AccountRestrictionsAddressTransactionBuffer.prototype.feeLength = function() { var offset = this.bb.__offset(this.bb_pos, 14); return offset ? this.bb.__vector_len(this.bb_pos + offset) : 0; }; @@ -278,7 +278,7 @@ Catapult.Buffers.AccountPropertiesAddressTransactionBuffer.prototype.feeLength = /** * @returns {Uint32Array} */ -Catapult.Buffers.AccountPropertiesAddressTransactionBuffer.prototype.feeArray = function() { +Catapult.Buffers.AccountRestrictionsAddressTransactionBuffer.prototype.feeArray = function() { var offset = this.bb.__offset(this.bb_pos, 14); return offset ? new Uint32Array(this.bb.bytes().buffer, this.bb.bytes().byteOffset + this.bb.__vector(this.bb_pos + offset), this.bb.__vector_len(this.bb_pos + offset)) : null; }; @@ -287,7 +287,7 @@ Catapult.Buffers.AccountPropertiesAddressTransactionBuffer.prototype.feeArray = * @param {number} index * @returns {number} */ -Catapult.Buffers.AccountPropertiesAddressTransactionBuffer.prototype.deadline = function(index) { +Catapult.Buffers.AccountRestrictionsAddressTransactionBuffer.prototype.deadline = function(index) { var offset = this.bb.__offset(this.bb_pos, 16); return offset ? this.bb.readUint32(this.bb.__vector(this.bb_pos + offset) + index * 4) : 0; }; @@ -295,7 +295,7 @@ Catapult.Buffers.AccountPropertiesAddressTransactionBuffer.prototype.deadline = /** * @returns {number} */ -Catapult.Buffers.AccountPropertiesAddressTransactionBuffer.prototype.deadlineLength = function() { +Catapult.Buffers.AccountRestrictionsAddressTransactionBuffer.prototype.deadlineLength = function() { var offset = this.bb.__offset(this.bb_pos, 16); return offset ? this.bb.__vector_len(this.bb_pos + offset) : 0; }; @@ -303,7 +303,7 @@ Catapult.Buffers.AccountPropertiesAddressTransactionBuffer.prototype.deadlineLen /** * @returns {Uint32Array} */ -Catapult.Buffers.AccountPropertiesAddressTransactionBuffer.prototype.deadlineArray = function() { +Catapult.Buffers.AccountRestrictionsAddressTransactionBuffer.prototype.deadlineArray = function() { var offset = this.bb.__offset(this.bb_pos, 16); return offset ? new Uint32Array(this.bb.bytes().buffer, this.bb.bytes().byteOffset + this.bb.__vector(this.bb_pos + offset), this.bb.__vector_len(this.bb_pos + offset)) : null; }; @@ -311,7 +311,7 @@ Catapult.Buffers.AccountPropertiesAddressTransactionBuffer.prototype.deadlineArr /** * @returns {number} */ -Catapult.Buffers.AccountPropertiesAddressTransactionBuffer.prototype.propertyType = function() { +Catapult.Buffers.AccountRestrictionsAddressTransactionBuffer.prototype.restrictionType = function() { var offset = this.bb.__offset(this.bb_pos, 18); return offset ? this.bb.readUint8(this.bb_pos + offset) : 0; }; @@ -320,25 +320,25 @@ Catapult.Buffers.AccountPropertiesAddressTransactionBuffer.prototype.propertyTyp /** * @returns {number} */ -Catapult.Buffers.AccountPropertiesAddressTransactionBuffer.prototype.modificationCount = function() { +Catapult.Buffers.AccountRestrictionsAddressTransactionBuffer.prototype.modificationCount = function() { var offset = this.bb.__offset(this.bb_pos, 20); return offset ? this.bb.readUint8(this.bb_pos + offset) : 0; }; /** * @param {number} index - * @param {Catapult.Buffers.PropertyAddressModificationBuffer=} obj - * @returns {Catapult.Buffers.PropertyAddressModificationBuffer} + * @param {Catapult.Buffers.RestrictionAddressModificationBuffer=} obj + * @returns {Catapult.Buffers.RestrictionAddressModificationBuffer} */ -Catapult.Buffers.AccountPropertiesAddressTransactionBuffer.prototype.modifications = function(index, obj) { +Catapult.Buffers.AccountRestrictionsAddressTransactionBuffer.prototype.modifications = function(index, obj) { var offset = this.bb.__offset(this.bb_pos, 22); - return offset ? (obj || new Catapult.Buffers.PropertyAddressModificationBuffer).__init(this.bb.__indirect(this.bb.__vector(this.bb_pos + offset) + index * 4), this.bb) : null; + return offset ? (obj || new Catapult.Buffers.RestrictionAddressModificationBuffer).__init(this.bb.__indirect(this.bb.__vector(this.bb_pos + offset) + index * 4), this.bb) : null; }; /** * @returns {number} */ -Catapult.Buffers.AccountPropertiesAddressTransactionBuffer.prototype.modificationsLength = function() { +Catapult.Buffers.AccountRestrictionsAddressTransactionBuffer.prototype.modificationsLength = function() { var offset = this.bb.__offset(this.bb_pos, 22); return offset ? this.bb.__vector_len(this.bb_pos + offset) : 0; }; @@ -346,7 +346,7 @@ Catapult.Buffers.AccountPropertiesAddressTransactionBuffer.prototype.modificatio /** * @param {flatbuffers.Builder} builder */ -Catapult.Buffers.AccountPropertiesAddressTransactionBuffer.startAccountPropertiesAddressTransactionBuffer = function(builder) { +Catapult.Buffers.AccountRestrictionsAddressTransactionBuffer.startAccountRestrictionsAddressTransactionBuffer = function(builder) { builder.startObject(11); }; @@ -354,7 +354,7 @@ Catapult.Buffers.AccountPropertiesAddressTransactionBuffer.startAccountPropertie * @param {flatbuffers.Builder} builder * @param {number} size */ -Catapult.Buffers.AccountPropertiesAddressTransactionBuffer.addSize = function(builder, size) { +Catapult.Buffers.AccountRestrictionsAddressTransactionBuffer.addSize = function(builder, size) { builder.addFieldInt32(0, size, 0); }; @@ -362,7 +362,7 @@ Catapult.Buffers.AccountPropertiesAddressTransactionBuffer.addSize = function(bu * @param {flatbuffers.Builder} builder * @param {flatbuffers.Offset} signatureOffset */ -Catapult.Buffers.AccountPropertiesAddressTransactionBuffer.addSignature = function(builder, signatureOffset) { +Catapult.Buffers.AccountRestrictionsAddressTransactionBuffer.addSignature = function(builder, signatureOffset) { builder.addFieldOffset(1, signatureOffset, 0); }; @@ -371,7 +371,7 @@ Catapult.Buffers.AccountPropertiesAddressTransactionBuffer.addSignature = functi * @param {Array.} data * @returns {flatbuffers.Offset} */ -Catapult.Buffers.AccountPropertiesAddressTransactionBuffer.createSignatureVector = function(builder, data) { +Catapult.Buffers.AccountRestrictionsAddressTransactionBuffer.createSignatureVector = function(builder, data) { builder.startVector(1, data.length, 1); for (var i = data.length - 1; i >= 0; i--) { builder.addInt8(data[i]); @@ -383,7 +383,7 @@ Catapult.Buffers.AccountPropertiesAddressTransactionBuffer.createSignatureVector * @param {flatbuffers.Builder} builder * @param {number} numElems */ -Catapult.Buffers.AccountPropertiesAddressTransactionBuffer.startSignatureVector = function(builder, numElems) { +Catapult.Buffers.AccountRestrictionsAddressTransactionBuffer.startSignatureVector = function(builder, numElems) { builder.startVector(1, numElems, 1); }; @@ -391,7 +391,7 @@ Catapult.Buffers.AccountPropertiesAddressTransactionBuffer.startSignatureVector * @param {flatbuffers.Builder} builder * @param {flatbuffers.Offset} signerOffset */ -Catapult.Buffers.AccountPropertiesAddressTransactionBuffer.addSigner = function(builder, signerOffset) { +Catapult.Buffers.AccountRestrictionsAddressTransactionBuffer.addSigner = function(builder, signerOffset) { builder.addFieldOffset(2, signerOffset, 0); }; @@ -400,7 +400,7 @@ Catapult.Buffers.AccountPropertiesAddressTransactionBuffer.addSigner = function( * @param {Array.} data * @returns {flatbuffers.Offset} */ -Catapult.Buffers.AccountPropertiesAddressTransactionBuffer.createSignerVector = function(builder, data) { +Catapult.Buffers.AccountRestrictionsAddressTransactionBuffer.createSignerVector = function(builder, data) { builder.startVector(1, data.length, 1); for (var i = data.length - 1; i >= 0; i--) { builder.addInt8(data[i]); @@ -412,7 +412,7 @@ Catapult.Buffers.AccountPropertiesAddressTransactionBuffer.createSignerVector = * @param {flatbuffers.Builder} builder * @param {number} numElems */ -Catapult.Buffers.AccountPropertiesAddressTransactionBuffer.startSignerVector = function(builder, numElems) { +Catapult.Buffers.AccountRestrictionsAddressTransactionBuffer.startSignerVector = function(builder, numElems) { builder.startVector(1, numElems, 1); }; @@ -420,7 +420,7 @@ Catapult.Buffers.AccountPropertiesAddressTransactionBuffer.startSignerVector = f * @param {flatbuffers.Builder} builder * @param {number} version */ -Catapult.Buffers.AccountPropertiesAddressTransactionBuffer.addVersion = function(builder, version) { +Catapult.Buffers.AccountRestrictionsAddressTransactionBuffer.addVersion = function(builder, version) { builder.addFieldInt16(3, version, 0); }; @@ -428,7 +428,7 @@ Catapult.Buffers.AccountPropertiesAddressTransactionBuffer.addVersion = function * @param {flatbuffers.Builder} builder * @param {number} type */ -Catapult.Buffers.AccountPropertiesAddressTransactionBuffer.addType = function(builder, type) { +Catapult.Buffers.AccountRestrictionsAddressTransactionBuffer.addType = function(builder, type) { builder.addFieldInt16(4, type, 0); }; @@ -436,7 +436,7 @@ Catapult.Buffers.AccountPropertiesAddressTransactionBuffer.addType = function(bu * @param {flatbuffers.Builder} builder * @param {flatbuffers.Offset} feeOffset */ -Catapult.Buffers.AccountPropertiesAddressTransactionBuffer.addFee = function(builder, feeOffset) { +Catapult.Buffers.AccountRestrictionsAddressTransactionBuffer.addFee = function(builder, feeOffset) { builder.addFieldOffset(5, feeOffset, 0); }; @@ -445,7 +445,7 @@ Catapult.Buffers.AccountPropertiesAddressTransactionBuffer.addFee = function(bui * @param {Array.} data * @returns {flatbuffers.Offset} */ -Catapult.Buffers.AccountPropertiesAddressTransactionBuffer.createFeeVector = function(builder, data) { +Catapult.Buffers.AccountRestrictionsAddressTransactionBuffer.createFeeVector = function(builder, data) { builder.startVector(4, data.length, 4); for (var i = data.length - 1; i >= 0; i--) { builder.addInt32(data[i]); @@ -457,7 +457,7 @@ Catapult.Buffers.AccountPropertiesAddressTransactionBuffer.createFeeVector = fun * @param {flatbuffers.Builder} builder * @param {number} numElems */ -Catapult.Buffers.AccountPropertiesAddressTransactionBuffer.startFeeVector = function(builder, numElems) { +Catapult.Buffers.AccountRestrictionsAddressTransactionBuffer.startFeeVector = function(builder, numElems) { builder.startVector(4, numElems, 4); }; @@ -465,7 +465,7 @@ Catapult.Buffers.AccountPropertiesAddressTransactionBuffer.startFeeVector = func * @param {flatbuffers.Builder} builder * @param {flatbuffers.Offset} deadlineOffset */ -Catapult.Buffers.AccountPropertiesAddressTransactionBuffer.addDeadline = function(builder, deadlineOffset) { +Catapult.Buffers.AccountRestrictionsAddressTransactionBuffer.addDeadline = function(builder, deadlineOffset) { builder.addFieldOffset(6, deadlineOffset, 0); }; @@ -474,7 +474,7 @@ Catapult.Buffers.AccountPropertiesAddressTransactionBuffer.addDeadline = functio * @param {Array.} data * @returns {flatbuffers.Offset} */ -Catapult.Buffers.AccountPropertiesAddressTransactionBuffer.createDeadlineVector = function(builder, data) { +Catapult.Buffers.AccountRestrictionsAddressTransactionBuffer.createDeadlineVector = function(builder, data) { builder.startVector(4, data.length, 4); for (var i = data.length - 1; i >= 0; i--) { builder.addInt32(data[i]); @@ -486,16 +486,16 @@ Catapult.Buffers.AccountPropertiesAddressTransactionBuffer.createDeadlineVector * @param {flatbuffers.Builder} builder * @param {number} numElems */ -Catapult.Buffers.AccountPropertiesAddressTransactionBuffer.startDeadlineVector = function(builder, numElems) { +Catapult.Buffers.AccountRestrictionsAddressTransactionBuffer.startDeadlineVector = function(builder, numElems) { builder.startVector(4, numElems, 4); }; /** * @param {flatbuffers.Builder} builder - * @param {number} propertyType + * @param {number} restrictionType */ -Catapult.Buffers.AccountPropertiesAddressTransactionBuffer.addPropertyType = function(builder, propertyType) { - builder.addFieldInt8(7, propertyType, 0); +Catapult.Buffers.AccountRestrictionsAddressTransactionBuffer.addRestrictionType = function(builder, restrictionType) { + builder.addFieldInt8(7, restrictionType, 0); }; @@ -503,7 +503,7 @@ Catapult.Buffers.AccountPropertiesAddressTransactionBuffer.addPropertyType = fun * @param {flatbuffers.Builder} builder * @param {number} modificationCount */ -Catapult.Buffers.AccountPropertiesAddressTransactionBuffer.addModificationCount = function(builder, modificationCount) { +Catapult.Buffers.AccountRestrictionsAddressTransactionBuffer.addModificationCount = function(builder, modificationCount) { builder.addFieldInt8(8, modificationCount, 0); }; @@ -511,7 +511,7 @@ Catapult.Buffers.AccountPropertiesAddressTransactionBuffer.addModificationCount * @param {flatbuffers.Builder} builder * @param {flatbuffers.Offset} modificationsOffset */ -Catapult.Buffers.AccountPropertiesAddressTransactionBuffer.addModifications = function(builder, modificationsOffset) { +Catapult.Buffers.AccountRestrictionsAddressTransactionBuffer.addModifications = function(builder, modificationsOffset) { builder.addFieldOffset(9, modificationsOffset, 0); }; @@ -520,7 +520,7 @@ Catapult.Buffers.AccountPropertiesAddressTransactionBuffer.addModifications = fu * @param {Array.} data * @returns {flatbuffers.Offset} */ -Catapult.Buffers.AccountPropertiesAddressTransactionBuffer.createModificationsVector = function(builder, data) { +Catapult.Buffers.AccountRestrictionsAddressTransactionBuffer.createModificationsVector = function(builder, data) { builder.startVector(4, data.length, 4); for (var i = data.length - 1; i >= 0; i--) { builder.addOffset(data[i]); @@ -532,7 +532,7 @@ Catapult.Buffers.AccountPropertiesAddressTransactionBuffer.createModificationsVe * @param {flatbuffers.Builder} builder * @param {number} numElems */ -Catapult.Buffers.AccountPropertiesAddressTransactionBuffer.startModificationsVector = function(builder, numElems) { +Catapult.Buffers.AccountRestrictionsAddressTransactionBuffer.startModificationsVector = function(builder, numElems) { builder.startVector(4, numElems, 4); }; @@ -540,7 +540,7 @@ Catapult.Buffers.AccountPropertiesAddressTransactionBuffer.startModificationsVec * @param {flatbuffers.Builder} builder * @returns {flatbuffers.Offset} */ -Catapult.Buffers.AccountPropertiesAddressTransactionBuffer.endAccountPropertiesAddressTransactionBuffer = function(builder) { +Catapult.Buffers.AccountRestrictionsAddressTransactionBuffer.endAccountRestrictionsAddressTransactionBuffer = function(builder) { var offset = builder.endObject(); return offset; }; @@ -549,7 +549,7 @@ Catapult.Buffers.AccountPropertiesAddressTransactionBuffer.endAccountPropertiesA * @param {flatbuffers.Builder} builder * @param {flatbuffers.Offset} offset */ -Catapult.Buffers.AccountPropertiesAddressTransactionBuffer.finishAccountPropertiesAddressTransactionBufferBuffer = function(builder, offset) { +Catapult.Buffers.AccountRestrictionsAddressTransactionBuffer.finishAccountRestrictionsAddressTransactionBufferBuffer = function(builder, offset) { builder.finish(offset); }; diff --git a/src/infrastructure/buffers/AccountPropertiesEntityTypeTransactionBuffer.ts b/src/infrastructure/buffers/AccountRestrictionsEntityTypeTransactionBuffer.ts similarity index 57% rename from src/infrastructure/buffers/AccountPropertiesEntityTypeTransactionBuffer.ts rename to src/infrastructure/buffers/AccountRestrictionsEntityTypeTransactionBuffer.ts index 0994479bf7..b842f8d776 100644 --- a/src/infrastructure/buffers/AccountPropertiesEntityTypeTransactionBuffer.ts +++ b/src/infrastructure/buffers/AccountRestrictionsEntityTypeTransactionBuffer.ts @@ -31,7 +31,7 @@ Catapult.Buffers = Catapult.Buffers || {}; /** * @constructor */ -Catapult.Buffers.PropertyEntityTypeModificationBuffer = function() { +Catapult.Buffers.RestrictionEntityTypeModificationBuffer = function() { /** * @type {flatbuffers.ByteBuffer} */ @@ -46,9 +46,9 @@ Catapult.Buffers.PropertyEntityTypeModificationBuffer = function() { /** * @param {number} i * @param {flatbuffers.ByteBuffer} bb - * @returns {Catapult.Buffers.PropertyEntityTypeModificationBuffer} + * @returns {Catapult.Buffers.RestrictionEntityTypeModificationBuffer} */ -Catapult.Buffers.PropertyEntityTypeModificationBuffer.prototype.__init = function(i, bb) { +Catapult.Buffers.RestrictionEntityTypeModificationBuffer.prototype.__init = function(i, bb) { this.bb_pos = i; this.bb = bb; return this; @@ -56,17 +56,17 @@ Catapult.Buffers.PropertyEntityTypeModificationBuffer.prototype.__init = functio /** * @param {flatbuffers.ByteBuffer} bb - * @param {Catapult.Buffers.PropertyEntityTypeModificationBuffer=} obj - * @returns {Catapult.Buffers.PropertyEntityTypeModificationBuffer} + * @param {Catapult.Buffers.RestrictionEntityTypeModificationBuffer=} obj + * @returns {Catapult.Buffers.RestrictionEntityTypeModificationBuffer} */ -Catapult.Buffers.PropertyEntityTypeModificationBuffer.getRootAsPropertyEntityTypeModificationBuffer = function(bb, obj) { - return (obj || new Catapult.Buffers.PropertyEntityTypeModificationBuffer).__init(bb.readInt32(bb.position()) + bb.position(), bb); +Catapult.Buffers.RestrictionEntityTypeModificationBuffer.getRootAsRestrictionEntityTypeModificationBuffer = function(bb, obj) { + return (obj || new Catapult.Buffers.RestrictionEntityTypeModificationBuffer).__init(bb.readInt32(bb.position()) + bb.position(), bb); }; /** * @returns {number} */ -Catapult.Buffers.PropertyEntityTypeModificationBuffer.prototype.modificationType = function() { +Catapult.Buffers.RestrictionEntityTypeModificationBuffer.prototype.modificationType = function() { var offset = this.bb.__offset(this.bb_pos, 4); return offset ? this.bb.readUint8(this.bb_pos + offset) : 0; }; @@ -75,7 +75,7 @@ Catapult.Buffers.PropertyEntityTypeModificationBuffer.prototype.modificationType * @param {number} index * @returns {number} */ -Catapult.Buffers.PropertyEntityTypeModificationBuffer.prototype.value = function() { +Catapult.Buffers.RestrictionEntityTypeModificationBuffer.prototype.value = function() { var offset = this.bb.__offset(this.bb_pos, 6); return offset ? this.bb.readUint16(this.bb_pos + offset) : 0; }; @@ -83,7 +83,7 @@ Catapult.Buffers.PropertyEntityTypeModificationBuffer.prototype.value = function /** * @param {flatbuffers.Builder} builder */ -Catapult.Buffers.PropertyEntityTypeModificationBuffer.startPropertyEntityTypeModificationBuffer = function(builder) { +Catapult.Buffers.RestrictionEntityTypeModificationBuffer.startRestrictionEntityTypeModificationBuffer = function(builder) { builder.startObject(2); }; @@ -91,7 +91,7 @@ Catapult.Buffers.PropertyEntityTypeModificationBuffer.startPropertyEntityTypeMod * @param {flatbuffers.Builder} builder * @param {number} type */ -Catapult.Buffers.PropertyEntityTypeModificationBuffer.addModificationType = function(builder, type) { +Catapult.Buffers.RestrictionEntityTypeModificationBuffer.addModificationType = function(builder, type) { builder.addFieldInt8(0, type, 0); }; @@ -99,7 +99,7 @@ Catapult.Buffers.PropertyEntityTypeModificationBuffer.addModificationType = func * @param {flatbuffers.Builder} builder * @param {number} valueOffset */ -Catapult.Buffers.PropertyEntityTypeModificationBuffer.addValue = function(builder, valueOffset) { +Catapult.Buffers.RestrictionEntityTypeModificationBuffer.addValue = function(builder, valueOffset) { builder.addFieldInt16(1, valueOffset, 0); }; @@ -107,7 +107,7 @@ Catapult.Buffers.PropertyEntityTypeModificationBuffer.addValue = function(builde * @param {flatbuffers.Builder} builder * @returns {flatbuffers.Offset} */ -Catapult.Buffers.PropertyEntityTypeModificationBuffer.endPropertyEntityTypeModificationBuffer = function(builder) { +Catapult.Buffers.RestrictionEntityTypeModificationBuffer.endRestrictionEntityTypeModificationBuffer = function(builder) { var offset = builder.endObject(); return offset; }; @@ -115,7 +115,7 @@ Catapult.Buffers.PropertyEntityTypeModificationBuffer.endPropertyEntityTypeModif /** * @constructor */ -Catapult.Buffers.AccountPropertiesEntityTypeTransactionBuffer = function() { +Catapult.Buffers.AccountRestrictionsEntityTypeTransactionBuffer = function() { /** * @type {flatbuffers.ByteBuffer} */ @@ -130,9 +130,9 @@ Catapult.Buffers.AccountPropertiesEntityTypeTransactionBuffer = function() { /** * @param {number} i * @param {flatbuffers.ByteBuffer} bb - * @returns {Catapult.Buffers.AccountPropertiesEntityTypeTransactionBuffer} + * @returns {Catapult.Buffers.AccountRestrictionsEntityTypeTransactionBuffer} */ -Catapult.Buffers.AccountPropertiesEntityTypeTransactionBuffer.prototype.__init = function(i, bb) { +Catapult.Buffers.AccountRestrictionsEntityTypeTransactionBuffer.prototype.__init = function(i, bb) { this.bb_pos = i; this.bb = bb; return this; @@ -140,17 +140,17 @@ Catapult.Buffers.AccountPropertiesEntityTypeTransactionBuffer.prototype.__init = /** * @param {flatbuffers.ByteBuffer} bb - * @param {Catapult.Buffers.AccountPropertiesEntityTypeTransactionBuffer=} obj - * @returns {Catapult.Buffers.AccountPropertiesEntityTypeTransactionBuffer} + * @param {Catapult.Buffers.AccountRestrictionsEntityTypeTransactionBuffer=} obj + * @returns {Catapult.Buffers.AccountRestrictionsEntityTypeTransactionBuffer} */ -Catapult.Buffers.AccountPropertiesEntityTypeTransactionBuffer.getRootAsAccountPropertiesEntityTypeTransactionBuffer = function(bb, obj) { - return (obj || new Catapult.Buffers.AccountPropertiesEntityTypeTransactionBuffer).__init(bb.readInt32(bb.position()) + bb.position(), bb); +Catapult.Buffers.AccountRestrictionsEntityTypeTransactionBuffer.getRootAsAccountRestrictionsEntityTypeTransactionBuffer = function(bb, obj) { + return (obj || new Catapult.Buffers.AccountRestrictionsEntityTypeTransactionBuffer).__init(bb.readInt32(bb.position()) + bb.position(), bb); }; /** * @returns {number} */ -Catapult.Buffers.AccountPropertiesEntityTypeTransactionBuffer.prototype.size = function() { +Catapult.Buffers.AccountRestrictionsEntityTypeTransactionBuffer.prototype.size = function() { var offset = this.bb.__offset(this.bb_pos, 4); return offset ? this.bb.readUint32(this.bb_pos + offset) : 0; }; @@ -159,7 +159,7 @@ Catapult.Buffers.AccountPropertiesEntityTypeTransactionBuffer.prototype.size = f * @param {number} index * @returns {number} */ -Catapult.Buffers.AccountPropertiesEntityTypeTransactionBuffer.prototype.signature = function(index) { +Catapult.Buffers.AccountRestrictionsEntityTypeTransactionBuffer.prototype.signature = function(index) { var offset = this.bb.__offset(this.bb_pos, 6); return offset ? this.bb.readUint8(this.bb.__vector(this.bb_pos + offset) + index) : 0; }; @@ -167,7 +167,7 @@ Catapult.Buffers.AccountPropertiesEntityTypeTransactionBuffer.prototype.signatur /** * @returns {number} */ -Catapult.Buffers.AccountPropertiesEntityTypeTransactionBuffer.prototype.signatureLength = function() { +Catapult.Buffers.AccountRestrictionsEntityTypeTransactionBuffer.prototype.signatureLength = function() { var offset = this.bb.__offset(this.bb_pos, 6); return offset ? this.bb.__vector_len(this.bb_pos + offset) : 0; }; @@ -175,7 +175,7 @@ Catapult.Buffers.AccountPropertiesEntityTypeTransactionBuffer.prototype.signatur /** * @returns {Uint8Array} */ -Catapult.Buffers.AccountPropertiesEntityTypeTransactionBuffer.prototype.signatureArray = function() { +Catapult.Buffers.AccountRestrictionsEntityTypeTransactionBuffer.prototype.signatureArray = function() { var offset = this.bb.__offset(this.bb_pos, 6); return offset ? new Uint8Array(this.bb.bytes().buffer, this.bb.bytes().byteOffset + this.bb.__vector(this.bb_pos + offset), this.bb.__vector_len(this.bb_pos + offset)) : null; }; @@ -184,7 +184,7 @@ Catapult.Buffers.AccountPropertiesEntityTypeTransactionBuffer.prototype.signatur * @param {number} index * @returns {number} */ -Catapult.Buffers.AccountPropertiesEntityTypeTransactionBuffer.prototype.signer = function(index) { +Catapult.Buffers.AccountRestrictionsEntityTypeTransactionBuffer.prototype.signer = function(index) { var offset = this.bb.__offset(this.bb_pos, 8); return offset ? this.bb.readUint8(this.bb.__vector(this.bb_pos + offset) + index) : 0; }; @@ -192,7 +192,7 @@ Catapult.Buffers.AccountPropertiesEntityTypeTransactionBuffer.prototype.signer = /** * @returns {number} */ -Catapult.Buffers.AccountPropertiesEntityTypeTransactionBuffer.prototype.signerLength = function() { +Catapult.Buffers.AccountRestrictionsEntityTypeTransactionBuffer.prototype.signerLength = function() { var offset = this.bb.__offset(this.bb_pos, 8); return offset ? this.bb.__vector_len(this.bb_pos + offset) : 0; }; @@ -200,7 +200,7 @@ Catapult.Buffers.AccountPropertiesEntityTypeTransactionBuffer.prototype.signerLe /** * @returns {Uint8Array} */ -Catapult.Buffers.AccountPropertiesEntityTypeTransactionBuffer.prototype.signerArray = function() { +Catapult.Buffers.AccountRestrictionsEntityTypeTransactionBuffer.prototype.signerArray = function() { var offset = this.bb.__offset(this.bb_pos, 8); return offset ? new Uint8Array(this.bb.bytes().buffer, this.bb.bytes().byteOffset + this.bb.__vector(this.bb_pos + offset), this.bb.__vector_len(this.bb_pos + offset)) : null; }; @@ -208,7 +208,7 @@ Catapult.Buffers.AccountPropertiesEntityTypeTransactionBuffer.prototype.signerAr /** * @returns {number} */ -Catapult.Buffers.AccountPropertiesEntityTypeTransactionBuffer.prototype.version = function() { +Catapult.Buffers.AccountRestrictionsEntityTypeTransactionBuffer.prototype.version = function() { var offset = this.bb.__offset(this.bb_pos, 10); return offset ? this.bb.readUint16(this.bb_pos + offset) : 0; }; @@ -216,7 +216,7 @@ Catapult.Buffers.AccountPropertiesEntityTypeTransactionBuffer.prototype.version /** * @returns {number} */ -Catapult.Buffers.AccountPropertiesEntityTypeTransactionBuffer.prototype.type = function() { +Catapult.Buffers.AccountRestrictionsEntityTypeTransactionBuffer.prototype.type = function() { var offset = this.bb.__offset(this.bb_pos, 12); return offset ? this.bb.readUint16(this.bb_pos + offset) : 0; }; @@ -225,7 +225,7 @@ Catapult.Buffers.AccountPropertiesEntityTypeTransactionBuffer.prototype.type = f * @param {number} index * @returns {number} */ -Catapult.Buffers.AccountPropertiesEntityTypeTransactionBuffer.prototype.fee = function(index) { +Catapult.Buffers.AccountRestrictionsEntityTypeTransactionBuffer.prototype.fee = function(index) { var offset = this.bb.__offset(this.bb_pos, 14); return offset ? this.bb.readUint32(this.bb.__vector(this.bb_pos + offset) + index * 4) : 0; }; @@ -233,7 +233,7 @@ Catapult.Buffers.AccountPropertiesEntityTypeTransactionBuffer.prototype.fee = fu /** * @returns {number} */ -Catapult.Buffers.AccountPropertiesEntityTypeTransactionBuffer.prototype.feeLength = function() { +Catapult.Buffers.AccountRestrictionsEntityTypeTransactionBuffer.prototype.feeLength = function() { var offset = this.bb.__offset(this.bb_pos, 14); return offset ? this.bb.__vector_len(this.bb_pos + offset) : 0; }; @@ -241,7 +241,7 @@ Catapult.Buffers.AccountPropertiesEntityTypeTransactionBuffer.prototype.feeLengt /** * @returns {Uint32Array} */ -Catapult.Buffers.AccountPropertiesEntityTypeTransactionBuffer.prototype.feeArray = function() { +Catapult.Buffers.AccountRestrictionsEntityTypeTransactionBuffer.prototype.feeArray = function() { var offset = this.bb.__offset(this.bb_pos, 14); return offset ? new Uint32Array(this.bb.bytes().buffer, this.bb.bytes().byteOffset + this.bb.__vector(this.bb_pos + offset), this.bb.__vector_len(this.bb_pos + offset)) : null; }; @@ -250,7 +250,7 @@ Catapult.Buffers.AccountPropertiesEntityTypeTransactionBuffer.prototype.feeArray * @param {number} index * @returns {number} */ -Catapult.Buffers.AccountPropertiesEntityTypeTransactionBuffer.prototype.deadline = function(index) { +Catapult.Buffers.AccountRestrictionsEntityTypeTransactionBuffer.prototype.deadline = function(index) { var offset = this.bb.__offset(this.bb_pos, 16); return offset ? this.bb.readUint32(this.bb.__vector(this.bb_pos + offset) + index * 4) : 0; }; @@ -258,7 +258,7 @@ Catapult.Buffers.AccountPropertiesEntityTypeTransactionBuffer.prototype.deadline /** * @returns {number} */ -Catapult.Buffers.AccountPropertiesEntityTypeTransactionBuffer.prototype.deadlineLength = function() { +Catapult.Buffers.AccountRestrictionsEntityTypeTransactionBuffer.prototype.deadlineLength = function() { var offset = this.bb.__offset(this.bb_pos, 16); return offset ? this.bb.__vector_len(this.bb_pos + offset) : 0; }; @@ -266,7 +266,7 @@ Catapult.Buffers.AccountPropertiesEntityTypeTransactionBuffer.prototype.deadline /** * @returns {Uint32Array} */ -Catapult.Buffers.AccountPropertiesEntityTypeTransactionBuffer.prototype.deadlineArray = function() { +Catapult.Buffers.AccountRestrictionsEntityTypeTransactionBuffer.prototype.deadlineArray = function() { var offset = this.bb.__offset(this.bb_pos, 16); return offset ? new Uint32Array(this.bb.bytes().buffer, this.bb.bytes().byteOffset + this.bb.__vector(this.bb_pos + offset), this.bb.__vector_len(this.bb_pos + offset)) : null; }; @@ -274,7 +274,7 @@ Catapult.Buffers.AccountPropertiesEntityTypeTransactionBuffer.prototype.deadline /** * @returns {number} */ -Catapult.Buffers.AccountPropertiesEntityTypeTransactionBuffer.prototype.propertyType = function() { +Catapult.Buffers.AccountRestrictionsEntityTypeTransactionBuffer.prototype.restrictionType = function() { var offset = this.bb.__offset(this.bb_pos, 18); return offset ? this.bb.readUint8(this.bb_pos + offset) : 0; }; @@ -283,25 +283,25 @@ Catapult.Buffers.AccountPropertiesEntityTypeTransactionBuffer.prototype.property /** * @returns {number} */ -Catapult.Buffers.AccountPropertiesEntityTypeTransactionBuffer.prototype.modificationCount = function() { +Catapult.Buffers.AccountRestrictionsEntityTypeTransactionBuffer.prototype.modificationCount = function() { var offset = this.bb.__offset(this.bb_pos, 20); return offset ? this.bb.readUint8(this.bb_pos + offset) : 0; }; /** * @param {number} index - * @param {Catapult.Buffers.PropertyEntityTypeModificationBuffer=} obj - * @returns {Catapult.Buffers.PropertyEntityTypeModificationBuffer} + * @param {Catapult.Buffers.RestrictionEntityTypeModificationBuffer=} obj + * @returns {Catapult.Buffers.RestrictionEntityTypeModificationBuffer} */ -Catapult.Buffers.AccountPropertiesEntityTypeTransactionBuffer.prototype.modifications = function(index, obj) { +Catapult.Buffers.AccountRestrictionsEntityTypeTransactionBuffer.prototype.modifications = function(index, obj) { var offset = this.bb.__offset(this.bb_pos, 22); - return offset ? (obj || new Catapult.Buffers.PropertyEntityTypeModificationBuffer).__init(this.bb.__indirect(this.bb.__vector(this.bb_pos + offset) + index * 4), this.bb) : null; + return offset ? (obj || new Catapult.Buffers.RestrictionEntityTypeModificationBuffer).__init(this.bb.__indirect(this.bb.__vector(this.bb_pos + offset) + index * 4), this.bb) : null; }; /** * @returns {number} */ -Catapult.Buffers.AccountPropertiesEntityTypeTransactionBuffer.prototype.modificationsLength = function() { +Catapult.Buffers.AccountRestrictionsEntityTypeTransactionBuffer.prototype.modificationsLength = function() { var offset = this.bb.__offset(this.bb_pos, 22); return offset ? this.bb.__vector_len(this.bb_pos + offset) : 0; }; @@ -309,7 +309,7 @@ Catapult.Buffers.AccountPropertiesEntityTypeTransactionBuffer.prototype.modifica /** * @param {flatbuffers.Builder} builder */ -Catapult.Buffers.AccountPropertiesEntityTypeTransactionBuffer.startAccountPropertiesEntityTypeTransactionBuffer = function(builder) { +Catapult.Buffers.AccountRestrictionsEntityTypeTransactionBuffer.startAccountRestrictionsEntityTypeTransactionBuffer = function(builder) { builder.startObject(11); }; @@ -317,7 +317,7 @@ Catapult.Buffers.AccountPropertiesEntityTypeTransactionBuffer.startAccountProper * @param {flatbuffers.Builder} builder * @param {number} size */ -Catapult.Buffers.AccountPropertiesEntityTypeTransactionBuffer.addSize = function(builder, size) { +Catapult.Buffers.AccountRestrictionsEntityTypeTransactionBuffer.addSize = function(builder, size) { builder.addFieldInt32(0, size, 0); }; @@ -325,7 +325,7 @@ Catapult.Buffers.AccountPropertiesEntityTypeTransactionBuffer.addSize = function * @param {flatbuffers.Builder} builder * @param {flatbuffers.Offset} signatureOffset */ -Catapult.Buffers.AccountPropertiesEntityTypeTransactionBuffer.addSignature = function(builder, signatureOffset) { +Catapult.Buffers.AccountRestrictionsEntityTypeTransactionBuffer.addSignature = function(builder, signatureOffset) { builder.addFieldOffset(1, signatureOffset, 0); }; @@ -334,7 +334,7 @@ Catapult.Buffers.AccountPropertiesEntityTypeTransactionBuffer.addSignature = fun * @param {Array.} data * @returns {flatbuffers.Offset} */ -Catapult.Buffers.AccountPropertiesEntityTypeTransactionBuffer.createSignatureVector = function(builder, data) { +Catapult.Buffers.AccountRestrictionsEntityTypeTransactionBuffer.createSignatureVector = function(builder, data) { builder.startVector(1, data.length, 1); for (var i = data.length - 1; i >= 0; i--) { builder.addInt8(data[i]); @@ -346,7 +346,7 @@ Catapult.Buffers.AccountPropertiesEntityTypeTransactionBuffer.createSignatureVec * @param {flatbuffers.Builder} builder * @param {number} numElems */ -Catapult.Buffers.AccountPropertiesEntityTypeTransactionBuffer.startSignatureVector = function(builder, numElems) { +Catapult.Buffers.AccountRestrictionsEntityTypeTransactionBuffer.startSignatureVector = function(builder, numElems) { builder.startVector(1, numElems, 1); }; @@ -354,7 +354,7 @@ Catapult.Buffers.AccountPropertiesEntityTypeTransactionBuffer.startSignatureVect * @param {flatbuffers.Builder} builder * @param {flatbuffers.Offset} signerOffset */ -Catapult.Buffers.AccountPropertiesEntityTypeTransactionBuffer.addSigner = function(builder, signerOffset) { +Catapult.Buffers.AccountRestrictionsEntityTypeTransactionBuffer.addSigner = function(builder, signerOffset) { builder.addFieldOffset(2, signerOffset, 0); }; @@ -363,7 +363,7 @@ Catapult.Buffers.AccountPropertiesEntityTypeTransactionBuffer.addSigner = functi * @param {Array.} data * @returns {flatbuffers.Offset} */ -Catapult.Buffers.AccountPropertiesEntityTypeTransactionBuffer.createSignerVector = function(builder, data) { +Catapult.Buffers.AccountRestrictionsEntityTypeTransactionBuffer.createSignerVector = function(builder, data) { builder.startVector(1, data.length, 1); for (var i = data.length - 1; i >= 0; i--) { builder.addInt8(data[i]); @@ -375,7 +375,7 @@ Catapult.Buffers.AccountPropertiesEntityTypeTransactionBuffer.createSignerVector * @param {flatbuffers.Builder} builder * @param {number} numElems */ -Catapult.Buffers.AccountPropertiesEntityTypeTransactionBuffer.startSignerVector = function(builder, numElems) { +Catapult.Buffers.AccountRestrictionsEntityTypeTransactionBuffer.startSignerVector = function(builder, numElems) { builder.startVector(1, numElems, 1); }; @@ -383,7 +383,7 @@ Catapult.Buffers.AccountPropertiesEntityTypeTransactionBuffer.startSignerVector * @param {flatbuffers.Builder} builder * @param {number} version */ -Catapult.Buffers.AccountPropertiesEntityTypeTransactionBuffer.addVersion = function(builder, version) { +Catapult.Buffers.AccountRestrictionsEntityTypeTransactionBuffer.addVersion = function(builder, version) { builder.addFieldInt16(3, version, 0); }; @@ -391,7 +391,7 @@ Catapult.Buffers.AccountPropertiesEntityTypeTransactionBuffer.addVersion = funct * @param {flatbuffers.Builder} builder * @param {number} type */ -Catapult.Buffers.AccountPropertiesEntityTypeTransactionBuffer.addType = function(builder, type) { +Catapult.Buffers.AccountRestrictionsEntityTypeTransactionBuffer.addType = function(builder, type) { builder.addFieldInt16(4, type, 0); }; @@ -399,7 +399,7 @@ Catapult.Buffers.AccountPropertiesEntityTypeTransactionBuffer.addType = function * @param {flatbuffers.Builder} builder * @param {flatbuffers.Offset} feeOffset */ -Catapult.Buffers.AccountPropertiesEntityTypeTransactionBuffer.addFee = function(builder, feeOffset) { +Catapult.Buffers.AccountRestrictionsEntityTypeTransactionBuffer.addFee = function(builder, feeOffset) { builder.addFieldOffset(5, feeOffset, 0); }; @@ -408,7 +408,7 @@ Catapult.Buffers.AccountPropertiesEntityTypeTransactionBuffer.addFee = function( * @param {Array.} data * @returns {flatbuffers.Offset} */ -Catapult.Buffers.AccountPropertiesEntityTypeTransactionBuffer.createFeeVector = function(builder, data) { +Catapult.Buffers.AccountRestrictionsEntityTypeTransactionBuffer.createFeeVector = function(builder, data) { builder.startVector(4, data.length, 4); for (var i = data.length - 1; i >= 0; i--) { builder.addInt32(data[i]); @@ -420,7 +420,7 @@ Catapult.Buffers.AccountPropertiesEntityTypeTransactionBuffer.createFeeVector = * @param {flatbuffers.Builder} builder * @param {number} numElems */ -Catapult.Buffers.AccountPropertiesEntityTypeTransactionBuffer.startFeeVector = function(builder, numElems) { +Catapult.Buffers.AccountRestrictionsEntityTypeTransactionBuffer.startFeeVector = function(builder, numElems) { builder.startVector(4, numElems, 4); }; @@ -428,7 +428,7 @@ Catapult.Buffers.AccountPropertiesEntityTypeTransactionBuffer.startFeeVector = f * @param {flatbuffers.Builder} builder * @param {flatbuffers.Offset} deadlineOffset */ -Catapult.Buffers.AccountPropertiesEntityTypeTransactionBuffer.addDeadline = function(builder, deadlineOffset) { +Catapult.Buffers.AccountRestrictionsEntityTypeTransactionBuffer.addDeadline = function(builder, deadlineOffset) { builder.addFieldOffset(6, deadlineOffset, 0); }; @@ -437,7 +437,7 @@ Catapult.Buffers.AccountPropertiesEntityTypeTransactionBuffer.addDeadline = func * @param {Array.} data * @returns {flatbuffers.Offset} */ -Catapult.Buffers.AccountPropertiesEntityTypeTransactionBuffer.createDeadlineVector = function(builder, data) { +Catapult.Buffers.AccountRestrictionsEntityTypeTransactionBuffer.createDeadlineVector = function(builder, data) { builder.startVector(4, data.length, 4); for (var i = data.length - 1; i >= 0; i--) { builder.addInt32(data[i]); @@ -449,16 +449,16 @@ Catapult.Buffers.AccountPropertiesEntityTypeTransactionBuffer.createDeadlineVect * @param {flatbuffers.Builder} builder * @param {number} numElems */ -Catapult.Buffers.AccountPropertiesEntityTypeTransactionBuffer.startDeadlineVector = function(builder, numElems) { +Catapult.Buffers.AccountRestrictionsEntityTypeTransactionBuffer.startDeadlineVector = function(builder, numElems) { builder.startVector(4, numElems, 4); }; /** * @param {flatbuffers.Builder} builder - * @param {number} propertyType + * @param {number} restrictionType */ -Catapult.Buffers.AccountPropertiesEntityTypeTransactionBuffer.addPropertyType = function(builder, propertyType) { - builder.addFieldInt8(7, propertyType, 0); +Catapult.Buffers.AccountRestrictionsEntityTypeTransactionBuffer.addRestrictionType = function(builder, restrictionType) { + builder.addFieldInt8(7, restrictionType, 0); }; @@ -466,7 +466,7 @@ Catapult.Buffers.AccountPropertiesEntityTypeTransactionBuffer.addPropertyType = * @param {flatbuffers.Builder} builder * @param {number} modificationCount */ -Catapult.Buffers.AccountPropertiesEntityTypeTransactionBuffer.addModificationCount = function(builder, modificationCount) { +Catapult.Buffers.AccountRestrictionsEntityTypeTransactionBuffer.addModificationCount = function(builder, modificationCount) { builder.addFieldInt8(8, modificationCount, 0); }; @@ -474,7 +474,7 @@ Catapult.Buffers.AccountPropertiesEntityTypeTransactionBuffer.addModificationCou * @param {flatbuffers.Builder} builder * @param {flatbuffers.Offset} modificationsOffset */ -Catapult.Buffers.AccountPropertiesEntityTypeTransactionBuffer.addModifications = function(builder, modificationsOffset) { +Catapult.Buffers.AccountRestrictionsEntityTypeTransactionBuffer.addModifications = function(builder, modificationsOffset) { builder.addFieldOffset(9, modificationsOffset, 0); }; @@ -483,7 +483,7 @@ Catapult.Buffers.AccountPropertiesEntityTypeTransactionBuffer.addModifications = * @param {Array.} data * @returns {flatbuffers.Offset} */ -Catapult.Buffers.AccountPropertiesEntityTypeTransactionBuffer.createModificationsVector = function(builder, data) { +Catapult.Buffers.AccountRestrictionsEntityTypeTransactionBuffer.createModificationsVector = function(builder, data) { builder.startVector(4, data.length, 4); for (var i = data.length - 1; i >= 0; i--) { builder.addOffset(data[i]); @@ -495,7 +495,7 @@ Catapult.Buffers.AccountPropertiesEntityTypeTransactionBuffer.createModification * @param {flatbuffers.Builder} builder * @param {number} numElems */ -Catapult.Buffers.AccountPropertiesEntityTypeTransactionBuffer.startModificationsVector = function(builder, numElems) { +Catapult.Buffers.AccountRestrictionsEntityTypeTransactionBuffer.startModificationsVector = function(builder, numElems) { builder.startVector(4, numElems, 4); }; @@ -503,7 +503,7 @@ Catapult.Buffers.AccountPropertiesEntityTypeTransactionBuffer.startModifications * @param {flatbuffers.Builder} builder * @returns {flatbuffers.Offset} */ -Catapult.Buffers.AccountPropertiesEntityTypeTransactionBuffer.endAccountPropertiesEntityTypeTransactionBuffer = function(builder) { +Catapult.Buffers.AccountRestrictionsEntityTypeTransactionBuffer.endAccountRestrictionsEntityTypeTransactionBuffer = function(builder) { var offset = builder.endObject(); return offset; }; @@ -512,7 +512,7 @@ Catapult.Buffers.AccountPropertiesEntityTypeTransactionBuffer.endAccountProperti * @param {flatbuffers.Builder} builder * @param {flatbuffers.Offset} offset */ -Catapult.Buffers.AccountPropertiesEntityTypeTransactionBuffer.finishAccountPropertiesEntityTypeTransactionBufferBuffer = function(builder, offset) { +Catapult.Buffers.AccountRestrictionsEntityTypeTransactionBuffer.finishAccountRestrictionsEntityTypeTransactionBufferBuffer = function(builder, offset) { builder.finish(offset); }; diff --git a/src/infrastructure/buffers/AccountPropertiesMosaicTransactionBuffer.ts b/src/infrastructure/buffers/AccountRestrictionsMosaicTransactionBuffer.ts similarity index 59% rename from src/infrastructure/buffers/AccountPropertiesMosaicTransactionBuffer.ts rename to src/infrastructure/buffers/AccountRestrictionsMosaicTransactionBuffer.ts index 59241cc50e..2fde91933f 100644 --- a/src/infrastructure/buffers/AccountPropertiesMosaicTransactionBuffer.ts +++ b/src/infrastructure/buffers/AccountRestrictionsMosaicTransactionBuffer.ts @@ -31,7 +31,7 @@ Catapult.Buffers = Catapult.Buffers || {}; /** * @constructor */ -Catapult.Buffers.PropertyMosaicModificationBuffer = function() { +Catapult.Buffers.RestrictionMosaicModificationBuffer = function() { /** * @type {flatbuffers.ByteBuffer} */ @@ -46,9 +46,9 @@ Catapult.Buffers.PropertyMosaicModificationBuffer = function() { /** * @param {number} i * @param {flatbuffers.ByteBuffer} bb - * @returns {Catapult.Buffers.PropertyMosaicModificationBuffer} + * @returns {Catapult.Buffers.RestrictionMosaicModificationBuffer} */ -Catapult.Buffers.PropertyMosaicModificationBuffer.prototype.__init = function(i, bb) { +Catapult.Buffers.RestrictionMosaicModificationBuffer.prototype.__init = function(i, bb) { this.bb_pos = i; this.bb = bb; return this; @@ -56,17 +56,17 @@ Catapult.Buffers.PropertyMosaicModificationBuffer.prototype.__init = function(i, /** * @param {flatbuffers.ByteBuffer} bb - * @param {Catapult.Buffers.PropertyMosaicModificationBuffer=} obj - * @returns {Catapult.Buffers.PropertyMosaicModificationBuffer} + * @param {Catapult.Buffers.RestrictionMosaicModificationBuffer=} obj + * @returns {Catapult.Buffers.RestrictionMosaicModificationBuffer} */ -Catapult.Buffers.PropertyMosaicModificationBuffer.getRootAsPropertyMosaicModificationBuffer = function(bb, obj) { - return (obj || new Catapult.Buffers.PropertyMosaicModificationBuffer).__init(bb.readInt32(bb.position()) + bb.position(), bb); +Catapult.Buffers.RestrictionMosaicModificationBuffer.getRootAsRestrictionMosaicModificationBuffer = function(bb, obj) { + return (obj || new Catapult.Buffers.RestrictionMosaicModificationBuffer).__init(bb.readInt32(bb.position()) + bb.position(), bb); }; /** * @returns {number} */ -Catapult.Buffers.PropertyMosaicModificationBuffer.prototype.modificationType = function() { +Catapult.Buffers.RestrictionMosaicModificationBuffer.prototype.modificationType = function() { var offset = this.bb.__offset(this.bb_pos, 4); return offset ? this.bb.readUint8(this.bb_pos + offset) : 0; }; @@ -75,7 +75,7 @@ Catapult.Buffers.PropertyMosaicModificationBuffer.prototype.modificationType = f * @param {number} index * @returns {number} */ -Catapult.Buffers.PropertyMosaicModificationBuffer.prototype.value = function(index) { +Catapult.Buffers.RestrictionMosaicModificationBuffer.prototype.value = function(index) { var offset = this.bb.__offset(this.bb_pos, 6); return offset ? this.bb.readUint32(this.bb.__vector(this.bb_pos + offset) + index) : 0; }; @@ -83,7 +83,7 @@ Catapult.Buffers.PropertyMosaicModificationBuffer.prototype.value = function(ind /** * @returns {number} */ -Catapult.Buffers.PropertyMosaicModificationBuffer.prototype.valueLength = function() { +Catapult.Buffers.RestrictionMosaicModificationBuffer.prototype.valueLength = function() { var offset = this.bb.__offset(this.bb_pos, 6); return offset ? this.bb.__vector_len(this.bb_pos + offset) : 0; }; @@ -91,7 +91,7 @@ Catapult.Buffers.PropertyMosaicModificationBuffer.prototype.valueLength = functi /** * @returns {Uint8Array} */ -Catapult.Buffers.PropertyMosaicModificationBuffer.prototype.valueArray = function() { +Catapult.Buffers.RestrictionMosaicModificationBuffer.prototype.valueArray = function() { var offset = this.bb.__offset(this.bb_pos, 6); return offset ? new Uint8Array(this.bb.bytes().buffer, this.bb.bytes().byteOffset + this.bb.__vector(this.bb_pos + offset), this.bb.__vector_len(this.bb_pos + offset)) : null; }; @@ -99,7 +99,7 @@ Catapult.Buffers.PropertyMosaicModificationBuffer.prototype.valueArray = functio /** * @param {flatbuffers.Builder} builder */ -Catapult.Buffers.PropertyMosaicModificationBuffer.startPropertyMosaicModificationBuffer = function(builder) { +Catapult.Buffers.RestrictionMosaicModificationBuffer.startRestrictionMosaicModificationBuffer = function(builder) { builder.startObject(2); }; @@ -107,7 +107,7 @@ Catapult.Buffers.PropertyMosaicModificationBuffer.startPropertyMosaicModificatio * @param {flatbuffers.Builder} builder * @param {number} type */ -Catapult.Buffers.PropertyMosaicModificationBuffer.addModificationType = function(builder, type) { +Catapult.Buffers.RestrictionMosaicModificationBuffer.addModificationType = function(builder, type) { builder.addFieldInt8(0, type, 0); }; @@ -115,7 +115,7 @@ Catapult.Buffers.PropertyMosaicModificationBuffer.addModificationType = function * @param {flatbuffers.Builder} builder * @param {flatbuffers.Offset} valueOffset */ -Catapult.Buffers.PropertyMosaicModificationBuffer.addValue = function(builder, valueOffset) { +Catapult.Buffers.RestrictionMosaicModificationBuffer.addValue = function(builder, valueOffset) { builder.addFieldOffset(1, valueOffset, 0); }; @@ -124,7 +124,7 @@ Catapult.Buffers.PropertyMosaicModificationBuffer.addValue = function(builder, v * @param {Array.} data * @returns {flatbuffers.Offset} */ -Catapult.Buffers.PropertyMosaicModificationBuffer.createValueVector = function(builder, data) { +Catapult.Buffers.RestrictionMosaicModificationBuffer.createValueVector = function(builder, data) { builder.startVector(4, data.length, 4); for (var i = data.length - 1; i >= 0; i--) { builder.addInt32(data[i]); @@ -136,7 +136,7 @@ Catapult.Buffers.PropertyMosaicModificationBuffer.createValueVector = function(b * @param {flatbuffers.Builder} builder * @param {number} numElems */ -Catapult.Buffers.PropertyMosaicModificationBuffer.startValueVector = function(builder, numElems) { +Catapult.Buffers.RestrictionMosaicModificationBuffer.startValueVector = function(builder, numElems) { builder.startVector(4, numElems, 4); }; @@ -144,7 +144,7 @@ Catapult.Buffers.PropertyMosaicModificationBuffer.startValueVector = function(bu * @param {flatbuffers.Builder} builder * @returns {flatbuffers.Offset} */ -Catapult.Buffers.PropertyMosaicModificationBuffer.endPropertyMosaicModificationBuffer = function(builder) { +Catapult.Buffers.RestrictionMosaicModificationBuffer.endRestrictionMosaicModificationBuffer = function(builder) { var offset = builder.endObject(); return offset; }; @@ -152,7 +152,7 @@ Catapult.Buffers.PropertyMosaicModificationBuffer.endPropertyMosaicModificationB /** * @constructor */ -Catapult.Buffers.AccountPropertiesMosaicTransactionBuffer = function() { +Catapult.Buffers.AccountRestrictionsMosaicTransactionBuffer = function() { /** * @type {flatbuffers.ByteBuffer} */ @@ -167,9 +167,9 @@ Catapult.Buffers.AccountPropertiesMosaicTransactionBuffer = function() { /** * @param {number} i * @param {flatbuffers.ByteBuffer} bb - * @returns {Catapult.Buffers.AccountPropertiesMosaicTransactionBuffer} + * @returns {Catapult.Buffers.AccountRestrictionsMosaicTransactionBuffer} */ -Catapult.Buffers.AccountPropertiesMosaicTransactionBuffer.prototype.__init = function(i, bb) { +Catapult.Buffers.AccountRestrictionsMosaicTransactionBuffer.prototype.__init = function(i, bb) { this.bb_pos = i; this.bb = bb; return this; @@ -177,17 +177,17 @@ Catapult.Buffers.AccountPropertiesMosaicTransactionBuffer.prototype.__init = fun /** * @param {flatbuffers.ByteBuffer} bb - * @param {Catapult.Buffers.AccountPropertiesMosaicTransactionBuffer=} obj - * @returns {Catapult.Buffers.AccountPropertiesMosaicTransactionBuffer} + * @param {Catapult.Buffers.AccountRestrictionsMosaicTransactionBuffer=} obj + * @returns {Catapult.Buffers.AccountRestrictionsMosaicTransactionBuffer} */ -Catapult.Buffers.AccountPropertiesMosaicTransactionBuffer.getRootAsAccountPropertiesMosaicTransactionBuffer = function(bb, obj) { - return (obj || new Catapult.Buffers.AccountPropertiesMosaicTransactionBuffer).__init(bb.readInt32(bb.position()) + bb.position(), bb); +Catapult.Buffers.AccountRestrictionsMosaicTransactionBuffer.getRootAsAccountRestrictionsMosaicTransactionBuffer = function(bb, obj) { + return (obj || new Catapult.Buffers.AccountRestrictionsMosaicTransactionBuffer).__init(bb.readInt32(bb.position()) + bb.position(), bb); }; /** * @returns {number} */ -Catapult.Buffers.AccountPropertiesMosaicTransactionBuffer.prototype.size = function() { +Catapult.Buffers.AccountRestrictionsMosaicTransactionBuffer.prototype.size = function() { var offset = this.bb.__offset(this.bb_pos, 4); return offset ? this.bb.readUint32(this.bb_pos + offset) : 0; }; @@ -196,7 +196,7 @@ Catapult.Buffers.AccountPropertiesMosaicTransactionBuffer.prototype.size = funct * @param {number} index * @returns {number} */ -Catapult.Buffers.AccountPropertiesMosaicTransactionBuffer.prototype.signature = function(index) { +Catapult.Buffers.AccountRestrictionsMosaicTransactionBuffer.prototype.signature = function(index) { var offset = this.bb.__offset(this.bb_pos, 6); return offset ? this.bb.readUint8(this.bb.__vector(this.bb_pos + offset) + index) : 0; }; @@ -204,7 +204,7 @@ Catapult.Buffers.AccountPropertiesMosaicTransactionBuffer.prototype.signature = /** * @returns {number} */ -Catapult.Buffers.AccountPropertiesMosaicTransactionBuffer.prototype.signatureLength = function() { +Catapult.Buffers.AccountRestrictionsMosaicTransactionBuffer.prototype.signatureLength = function() { var offset = this.bb.__offset(this.bb_pos, 6); return offset ? this.bb.__vector_len(this.bb_pos + offset) : 0; }; @@ -212,7 +212,7 @@ Catapult.Buffers.AccountPropertiesMosaicTransactionBuffer.prototype.signatureLen /** * @returns {Uint8Array} */ -Catapult.Buffers.AccountPropertiesMosaicTransactionBuffer.prototype.signatureArray = function() { +Catapult.Buffers.AccountRestrictionsMosaicTransactionBuffer.prototype.signatureArray = function() { var offset = this.bb.__offset(this.bb_pos, 6); return offset ? new Uint8Array(this.bb.bytes().buffer, this.bb.bytes().byteOffset + this.bb.__vector(this.bb_pos + offset), this.bb.__vector_len(this.bb_pos + offset)) : null; }; @@ -221,7 +221,7 @@ Catapult.Buffers.AccountPropertiesMosaicTransactionBuffer.prototype.signatureArr * @param {number} index * @returns {number} */ -Catapult.Buffers.AccountPropertiesMosaicTransactionBuffer.prototype.signer = function(index) { +Catapult.Buffers.AccountRestrictionsMosaicTransactionBuffer.prototype.signer = function(index) { var offset = this.bb.__offset(this.bb_pos, 8); return offset ? this.bb.readUint8(this.bb.__vector(this.bb_pos + offset) + index) : 0; }; @@ -229,7 +229,7 @@ Catapult.Buffers.AccountPropertiesMosaicTransactionBuffer.prototype.signer = fun /** * @returns {number} */ -Catapult.Buffers.AccountPropertiesMosaicTransactionBuffer.prototype.signerLength = function() { +Catapult.Buffers.AccountRestrictionsMosaicTransactionBuffer.prototype.signerLength = function() { var offset = this.bb.__offset(this.bb_pos, 8); return offset ? this.bb.__vector_len(this.bb_pos + offset) : 0; }; @@ -237,7 +237,7 @@ Catapult.Buffers.AccountPropertiesMosaicTransactionBuffer.prototype.signerLength /** * @returns {Uint8Array} */ -Catapult.Buffers.AccountPropertiesMosaicTransactionBuffer.prototype.signerArray = function() { +Catapult.Buffers.AccountRestrictionsMosaicTransactionBuffer.prototype.signerArray = function() { var offset = this.bb.__offset(this.bb_pos, 8); return offset ? new Uint8Array(this.bb.bytes().buffer, this.bb.bytes().byteOffset + this.bb.__vector(this.bb_pos + offset), this.bb.__vector_len(this.bb_pos + offset)) : null; }; @@ -245,7 +245,7 @@ Catapult.Buffers.AccountPropertiesMosaicTransactionBuffer.prototype.signerArray /** * @returns {number} */ -Catapult.Buffers.AccountPropertiesMosaicTransactionBuffer.prototype.version = function() { +Catapult.Buffers.AccountRestrictionsMosaicTransactionBuffer.prototype.version = function() { var offset = this.bb.__offset(this.bb_pos, 10); return offset ? this.bb.readUint16(this.bb_pos + offset) : 0; }; @@ -253,7 +253,7 @@ Catapult.Buffers.AccountPropertiesMosaicTransactionBuffer.prototype.version = fu /** * @returns {number} */ -Catapult.Buffers.AccountPropertiesMosaicTransactionBuffer.prototype.type = function() { +Catapult.Buffers.AccountRestrictionsMosaicTransactionBuffer.prototype.type = function() { var offset = this.bb.__offset(this.bb_pos, 12); return offset ? this.bb.readUint16(this.bb_pos + offset) : 0; }; @@ -262,7 +262,7 @@ Catapult.Buffers.AccountPropertiesMosaicTransactionBuffer.prototype.type = funct * @param {number} index * @returns {number} */ -Catapult.Buffers.AccountPropertiesMosaicTransactionBuffer.prototype.fee = function(index) { +Catapult.Buffers.AccountRestrictionsMosaicTransactionBuffer.prototype.fee = function(index) { var offset = this.bb.__offset(this.bb_pos, 14); return offset ? this.bb.readUint32(this.bb.__vector(this.bb_pos + offset) + index * 4) : 0; }; @@ -270,7 +270,7 @@ Catapult.Buffers.AccountPropertiesMosaicTransactionBuffer.prototype.fee = functi /** * @returns {number} */ -Catapult.Buffers.AccountPropertiesMosaicTransactionBuffer.prototype.feeLength = function() { +Catapult.Buffers.AccountRestrictionsMosaicTransactionBuffer.prototype.feeLength = function() { var offset = this.bb.__offset(this.bb_pos, 14); return offset ? this.bb.__vector_len(this.bb_pos + offset) : 0; }; @@ -278,7 +278,7 @@ Catapult.Buffers.AccountPropertiesMosaicTransactionBuffer.prototype.feeLength = /** * @returns {Uint32Array} */ -Catapult.Buffers.AccountPropertiesMosaicTransactionBuffer.prototype.feeArray = function() { +Catapult.Buffers.AccountRestrictionsMosaicTransactionBuffer.prototype.feeArray = function() { var offset = this.bb.__offset(this.bb_pos, 14); return offset ? new Uint32Array(this.bb.bytes().buffer, this.bb.bytes().byteOffset + this.bb.__vector(this.bb_pos + offset), this.bb.__vector_len(this.bb_pos + offset)) : null; }; @@ -287,7 +287,7 @@ Catapult.Buffers.AccountPropertiesMosaicTransactionBuffer.prototype.feeArray = f * @param {number} index * @returns {number} */ -Catapult.Buffers.AccountPropertiesMosaicTransactionBuffer.prototype.deadline = function(index) { +Catapult.Buffers.AccountRestrictionsMosaicTransactionBuffer.prototype.deadline = function(index) { var offset = this.bb.__offset(this.bb_pos, 16); return offset ? this.bb.readUint32(this.bb.__vector(this.bb_pos + offset) + index * 4) : 0; }; @@ -295,7 +295,7 @@ Catapult.Buffers.AccountPropertiesMosaicTransactionBuffer.prototype.deadline = f /** * @returns {number} */ -Catapult.Buffers.AccountPropertiesMosaicTransactionBuffer.prototype.deadlineLength = function() { +Catapult.Buffers.AccountRestrictionsMosaicTransactionBuffer.prototype.deadlineLength = function() { var offset = this.bb.__offset(this.bb_pos, 16); return offset ? this.bb.__vector_len(this.bb_pos + offset) : 0; }; @@ -303,7 +303,7 @@ Catapult.Buffers.AccountPropertiesMosaicTransactionBuffer.prototype.deadlineLeng /** * @returns {Uint32Array} */ -Catapult.Buffers.AccountPropertiesMosaicTransactionBuffer.prototype.deadlineArray = function() { +Catapult.Buffers.AccountRestrictionsMosaicTransactionBuffer.prototype.deadlineArray = function() { var offset = this.bb.__offset(this.bb_pos, 16); return offset ? new Uint32Array(this.bb.bytes().buffer, this.bb.bytes().byteOffset + this.bb.__vector(this.bb_pos + offset), this.bb.__vector_len(this.bb_pos + offset)) : null; }; @@ -311,7 +311,7 @@ Catapult.Buffers.AccountPropertiesMosaicTransactionBuffer.prototype.deadlineArra /** * @returns {number} */ -Catapult.Buffers.AccountPropertiesMosaicTransactionBuffer.prototype.propertyType = function() { +Catapult.Buffers.AccountRestrictionsMosaicTransactionBuffer.prototype.restrictionType = function() { var offset = this.bb.__offset(this.bb_pos, 18); return offset ? this.bb.readUint8(this.bb_pos + offset) : 0; }; @@ -320,25 +320,25 @@ Catapult.Buffers.AccountPropertiesMosaicTransactionBuffer.prototype.propertyType /** * @returns {number} */ -Catapult.Buffers.AccountPropertiesMosaicTransactionBuffer.prototype.modificationCount = function() { +Catapult.Buffers.AccountRestrictionsMosaicTransactionBuffer.prototype.modificationCount = function() { var offset = this.bb.__offset(this.bb_pos, 20); return offset ? this.bb.readUint8(this.bb_pos + offset) : 0; }; /** * @param {number} index - * @param {Catapult.Buffers.PropertyMosaicModificationBuffer=} obj - * @returns {Catapult.Buffers.PropertyMosaicModificationBuffer} + * @param {Catapult.Buffers.RestrictionMosaicModificationBuffer=} obj + * @returns {Catapult.Buffers.RestrictionMosaicModificationBuffer} */ -Catapult.Buffers.AccountPropertiesMosaicTransactionBuffer.prototype.modifications = function(index, obj) { +Catapult.Buffers.AccountRestrictionsMosaicTransactionBuffer.prototype.modifications = function(index, obj) { var offset = this.bb.__offset(this.bb_pos, 22); - return offset ? (obj || new Catapult.Buffers.PropertyMosaicModificationBuffer).__init(this.bb.__indirect(this.bb.__vector(this.bb_pos + offset) + index * 4), this.bb) : null; + return offset ? (obj || new Catapult.Buffers.RestrictionMosaicModificationBuffer).__init(this.bb.__indirect(this.bb.__vector(this.bb_pos + offset) + index * 4), this.bb) : null; }; /** * @returns {number} */ -Catapult.Buffers.AccountPropertiesMosaicTransactionBuffer.prototype.modificationsLength = function() { +Catapult.Buffers.AccountRestrictionsMosaicTransactionBuffer.prototype.modificationsLength = function() { var offset = this.bb.__offset(this.bb_pos, 22); return offset ? this.bb.__vector_len(this.bb_pos + offset) : 0; }; @@ -346,7 +346,7 @@ Catapult.Buffers.AccountPropertiesMosaicTransactionBuffer.prototype.modification /** * @param {flatbuffers.Builder} builder */ -Catapult.Buffers.AccountPropertiesMosaicTransactionBuffer.startAccountPropertiesMosaicTransactionBuffer = function(builder) { +Catapult.Buffers.AccountRestrictionsMosaicTransactionBuffer.startAccountRestrictionsMosaicTransactionBuffer = function(builder) { builder.startObject(11); }; @@ -354,7 +354,7 @@ Catapult.Buffers.AccountPropertiesMosaicTransactionBuffer.startAccountProperties * @param {flatbuffers.Builder} builder * @param {number} size */ -Catapult.Buffers.AccountPropertiesMosaicTransactionBuffer.addSize = function(builder, size) { +Catapult.Buffers.AccountRestrictionsMosaicTransactionBuffer.addSize = function(builder, size) { builder.addFieldInt32(0, size, 0); }; @@ -362,7 +362,7 @@ Catapult.Buffers.AccountPropertiesMosaicTransactionBuffer.addSize = function(bui * @param {flatbuffers.Builder} builder * @param {flatbuffers.Offset} signatureOffset */ -Catapult.Buffers.AccountPropertiesMosaicTransactionBuffer.addSignature = function(builder, signatureOffset) { +Catapult.Buffers.AccountRestrictionsMosaicTransactionBuffer.addSignature = function(builder, signatureOffset) { builder.addFieldOffset(1, signatureOffset, 0); }; @@ -371,7 +371,7 @@ Catapult.Buffers.AccountPropertiesMosaicTransactionBuffer.addSignature = functio * @param {Array.} data * @returns {flatbuffers.Offset} */ -Catapult.Buffers.AccountPropertiesMosaicTransactionBuffer.createSignatureVector = function(builder, data) { +Catapult.Buffers.AccountRestrictionsMosaicTransactionBuffer.createSignatureVector = function(builder, data) { builder.startVector(1, data.length, 1); for (var i = data.length - 1; i >= 0; i--) { builder.addInt8(data[i]); @@ -383,7 +383,7 @@ Catapult.Buffers.AccountPropertiesMosaicTransactionBuffer.createSignatureVector * @param {flatbuffers.Builder} builder * @param {number} numElems */ -Catapult.Buffers.AccountPropertiesMosaicTransactionBuffer.startSignatureVector = function(builder, numElems) { +Catapult.Buffers.AccountRestrictionsMosaicTransactionBuffer.startSignatureVector = function(builder, numElems) { builder.startVector(1, numElems, 1); }; @@ -391,7 +391,7 @@ Catapult.Buffers.AccountPropertiesMosaicTransactionBuffer.startSignatureVector = * @param {flatbuffers.Builder} builder * @param {flatbuffers.Offset} signerOffset */ -Catapult.Buffers.AccountPropertiesMosaicTransactionBuffer.addSigner = function(builder, signerOffset) { +Catapult.Buffers.AccountRestrictionsMosaicTransactionBuffer.addSigner = function(builder, signerOffset) { builder.addFieldOffset(2, signerOffset, 0); }; @@ -400,7 +400,7 @@ Catapult.Buffers.AccountPropertiesMosaicTransactionBuffer.addSigner = function(b * @param {Array.} data * @returns {flatbuffers.Offset} */ -Catapult.Buffers.AccountPropertiesMosaicTransactionBuffer.createSignerVector = function(builder, data) { +Catapult.Buffers.AccountRestrictionsMosaicTransactionBuffer.createSignerVector = function(builder, data) { builder.startVector(1, data.length, 1); for (var i = data.length - 1; i >= 0; i--) { builder.addInt8(data[i]); @@ -412,7 +412,7 @@ Catapult.Buffers.AccountPropertiesMosaicTransactionBuffer.createSignerVector = f * @param {flatbuffers.Builder} builder * @param {number} numElems */ -Catapult.Buffers.AccountPropertiesMosaicTransactionBuffer.startSignerVector = function(builder, numElems) { +Catapult.Buffers.AccountRestrictionsMosaicTransactionBuffer.startSignerVector = function(builder, numElems) { builder.startVector(1, numElems, 1); }; @@ -420,7 +420,7 @@ Catapult.Buffers.AccountPropertiesMosaicTransactionBuffer.startSignerVector = fu * @param {flatbuffers.Builder} builder * @param {number} version */ -Catapult.Buffers.AccountPropertiesMosaicTransactionBuffer.addVersion = function(builder, version) { +Catapult.Buffers.AccountRestrictionsMosaicTransactionBuffer.addVersion = function(builder, version) { builder.addFieldInt16(3, version, 0); }; @@ -428,7 +428,7 @@ Catapult.Buffers.AccountPropertiesMosaicTransactionBuffer.addVersion = function( * @param {flatbuffers.Builder} builder * @param {number} type */ -Catapult.Buffers.AccountPropertiesMosaicTransactionBuffer.addType = function(builder, type) { +Catapult.Buffers.AccountRestrictionsMosaicTransactionBuffer.addType = function(builder, type) { builder.addFieldInt16(4, type, 0); }; @@ -436,7 +436,7 @@ Catapult.Buffers.AccountPropertiesMosaicTransactionBuffer.addType = function(bui * @param {flatbuffers.Builder} builder * @param {flatbuffers.Offset} feeOffset */ -Catapult.Buffers.AccountPropertiesMosaicTransactionBuffer.addFee = function(builder, feeOffset) { +Catapult.Buffers.AccountRestrictionsMosaicTransactionBuffer.addFee = function(builder, feeOffset) { builder.addFieldOffset(5, feeOffset, 0); }; @@ -445,7 +445,7 @@ Catapult.Buffers.AccountPropertiesMosaicTransactionBuffer.addFee = function(buil * @param {Array.} data * @returns {flatbuffers.Offset} */ -Catapult.Buffers.AccountPropertiesMosaicTransactionBuffer.createFeeVector = function(builder, data) { +Catapult.Buffers.AccountRestrictionsMosaicTransactionBuffer.createFeeVector = function(builder, data) { builder.startVector(4, data.length, 4); for (var i = data.length - 1; i >= 0; i--) { builder.addInt32(data[i]); @@ -457,7 +457,7 @@ Catapult.Buffers.AccountPropertiesMosaicTransactionBuffer.createFeeVector = func * @param {flatbuffers.Builder} builder * @param {number} numElems */ -Catapult.Buffers.AccountPropertiesMosaicTransactionBuffer.startFeeVector = function(builder, numElems) { +Catapult.Buffers.AccountRestrictionsMosaicTransactionBuffer.startFeeVector = function(builder, numElems) { builder.startVector(4, numElems, 4); }; @@ -465,7 +465,7 @@ Catapult.Buffers.AccountPropertiesMosaicTransactionBuffer.startFeeVector = funct * @param {flatbuffers.Builder} builder * @param {flatbuffers.Offset} deadlineOffset */ -Catapult.Buffers.AccountPropertiesMosaicTransactionBuffer.addDeadline = function(builder, deadlineOffset) { +Catapult.Buffers.AccountRestrictionsMosaicTransactionBuffer.addDeadline = function(builder, deadlineOffset) { builder.addFieldOffset(6, deadlineOffset, 0); }; @@ -474,7 +474,7 @@ Catapult.Buffers.AccountPropertiesMosaicTransactionBuffer.addDeadline = function * @param {Array.} data * @returns {flatbuffers.Offset} */ -Catapult.Buffers.AccountPropertiesMosaicTransactionBuffer.createDeadlineVector = function(builder, data) { +Catapult.Buffers.AccountRestrictionsMosaicTransactionBuffer.createDeadlineVector = function(builder, data) { builder.startVector(4, data.length, 4); for (var i = data.length - 1; i >= 0; i--) { builder.addInt32(data[i]); @@ -486,16 +486,16 @@ Catapult.Buffers.AccountPropertiesMosaicTransactionBuffer.createDeadlineVector = * @param {flatbuffers.Builder} builder * @param {number} numElems */ -Catapult.Buffers.AccountPropertiesMosaicTransactionBuffer.startDeadlineVector = function(builder, numElems) { +Catapult.Buffers.AccountRestrictionsMosaicTransactionBuffer.startDeadlineVector = function(builder, numElems) { builder.startVector(4, numElems, 4); }; /** * @param {flatbuffers.Builder} builder - * @param {number} propertyType + * @param {number} restrictionType */ -Catapult.Buffers.AccountPropertiesMosaicTransactionBuffer.addPropertyType = function(builder, propertyType) { - builder.addFieldInt8(7, propertyType, 0); +Catapult.Buffers.AccountRestrictionsMosaicTransactionBuffer.addRestrictionType = function(builder, restrictionType) { + builder.addFieldInt8(7, restrictionType, 0); }; @@ -503,7 +503,7 @@ Catapult.Buffers.AccountPropertiesMosaicTransactionBuffer.addPropertyType = func * @param {flatbuffers.Builder} builder * @param {number} modificationCount */ -Catapult.Buffers.AccountPropertiesMosaicTransactionBuffer.addModificationCount = function(builder, modificationCount) { +Catapult.Buffers.AccountRestrictionsMosaicTransactionBuffer.addModificationCount = function(builder, modificationCount) { builder.addFieldInt8(8, modificationCount, 0); }; @@ -511,7 +511,7 @@ Catapult.Buffers.AccountPropertiesMosaicTransactionBuffer.addModificationCount = * @param {flatbuffers.Builder} builder * @param {flatbuffers.Offset} modificationsOffset */ -Catapult.Buffers.AccountPropertiesMosaicTransactionBuffer.addModifications = function(builder, modificationsOffset) { +Catapult.Buffers.AccountRestrictionsMosaicTransactionBuffer.addModifications = function(builder, modificationsOffset) { builder.addFieldOffset(9, modificationsOffset, 0); }; @@ -520,7 +520,7 @@ Catapult.Buffers.AccountPropertiesMosaicTransactionBuffer.addModifications = fun * @param {Array.} data * @returns {flatbuffers.Offset} */ -Catapult.Buffers.AccountPropertiesMosaicTransactionBuffer.createModificationsVector = function(builder, data) { +Catapult.Buffers.AccountRestrictionsMosaicTransactionBuffer.createModificationsVector = function(builder, data) { builder.startVector(4, data.length, 4); for (var i = data.length - 1; i >= 0; i--) { builder.addOffset(data[i]); @@ -532,7 +532,7 @@ Catapult.Buffers.AccountPropertiesMosaicTransactionBuffer.createModificationsVec * @param {flatbuffers.Builder} builder * @param {number} numElems */ -Catapult.Buffers.AccountPropertiesMosaicTransactionBuffer.startModificationsVector = function(builder, numElems) { +Catapult.Buffers.AccountRestrictionsMosaicTransactionBuffer.startModificationsVector = function(builder, numElems) { builder.startVector(4, numElems, 4); }; @@ -540,7 +540,7 @@ Catapult.Buffers.AccountPropertiesMosaicTransactionBuffer.startModificationsVect * @param {flatbuffers.Builder} builder * @returns {flatbuffers.Offset} */ -Catapult.Buffers.AccountPropertiesMosaicTransactionBuffer.endAccountPropertiesMosaicTransactionBuffer = function(builder) { +Catapult.Buffers.AccountRestrictionsMosaicTransactionBuffer.endAccountRestrictionsMosaicTransactionBuffer = function(builder) { var offset = builder.endObject(); return offset; }; @@ -549,7 +549,7 @@ Catapult.Buffers.AccountPropertiesMosaicTransactionBuffer.endAccountPropertiesMo * @param {flatbuffers.Builder} builder * @param {flatbuffers.Offset} offset */ -Catapult.Buffers.AccountPropertiesMosaicTransactionBuffer.finishAccountPropertiesMosaicTransactionBufferBuffer = function(builder, offset) { +Catapult.Buffers.AccountRestrictionsMosaicTransactionBuffer.finishAccountRestrictionsMosaicTransactionBufferBuffer = function(builder, offset) { builder.finish(offset); }; diff --git a/src/infrastructure/builders/AccountPropertiesAddressTransaction.ts b/src/infrastructure/builders/AccountPropertiesAddressTransaction.ts deleted file mode 100644 index 13ac8e7da3..0000000000 --- a/src/infrastructure/builders/AccountPropertiesAddressTransaction.ts +++ /dev/null @@ -1,128 +0,0 @@ -/* - * Copyright 2019 NEM - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -/** - * @module transactions/AccountPropertiesAddressTransaction - */ -import { RawAddress as address } from '../../core/format'; -import { TransactionType } from '../../model/transaction/TransactionType'; -import AccountPropertiesAddressTransactionBufferPackage from '../buffers/AccountPropertiesAddressTransactionBuffer'; -import AccountPropertiesAddressModificationTransactionSchema from '../schemas/AccountPropertiesAddressModificationTransactionSchema'; -import { VerifiableTransaction } from './VerifiableTransaction'; -const { - AccountPropertiesAddressTransactionBuffer, - PropertyAddressModificationBuffer, -} = AccountPropertiesAddressTransactionBufferPackage.Buffers; - -import {flatbuffers} from 'flatbuffers'; - -export default class AccountPropertiesAddressTransaction extends VerifiableTransaction { - constructor(bytes) { - super(bytes, AccountPropertiesAddressModificationTransactionSchema); - } -} - -// tslint:disable-next-line:max-classes-per-file -export class Builder { - maxFee: any; - version: any; - type: any; - deadline: any; - propertyType: any; - modifications: any; - constructor() { - this.maxFee = [0, 0]; - this.type = TransactionType.MODIFY_ACCOUNT_PROPERTY_ADDRESS; - } - - addFee(maxFee) { - this.maxFee = maxFee; - return this; - } - - addVersion(version) { - this.version = version; - return this; - } - - addType(type) { - this.type = type; - return this; - } - - addDeadline(deadline) { - this.deadline = deadline; - return this; - } - - addPropertyType(propertyType) { - this.propertyType = propertyType; - return this; - } - - addModifications(modifications) { - this.modifications = modifications; - return this; - } - - build() { - const builder = new flatbuffers.Builder(1); - - // Create modifications - const modificationsArray: any = []; - this.modifications.forEach((modification) => { - const addressModificationVector = PropertyAddressModificationBuffer - .createValueVector(builder, address.stringToAddress(modification.value)); - PropertyAddressModificationBuffer.startPropertyAddressModificationBuffer(builder); - PropertyAddressModificationBuffer.addModificationType(builder, modification.type); - PropertyAddressModificationBuffer.addValue(builder, addressModificationVector); - modificationsArray.push(PropertyAddressModificationBuffer.endPropertyAddressModificationBuffer(builder)); - }); - - // Create vectors - const signatureVector = AccountPropertiesAddressTransactionBuffer - .createSignatureVector(builder, Array(...Array(64)).map(Number.prototype.valueOf, 0)); - const signerVector = AccountPropertiesAddressTransactionBuffer - .createSignerVector(builder, Array(...Array(32)).map(Number.prototype.valueOf, 0)); - const deadlineVector = AccountPropertiesAddressTransactionBuffer - .createDeadlineVector(builder, this.deadline); - const feeVector = AccountPropertiesAddressTransactionBuffer - .createFeeVector(builder, this.maxFee); - const modificationVector = AccountPropertiesAddressTransactionBuffer - .createModificationsVector(builder, modificationsArray); - - AccountPropertiesAddressTransactionBuffer.startAccountPropertiesAddressTransactionBuffer(builder); - AccountPropertiesAddressTransactionBuffer.addSize(builder, 122 + (26 * this.modifications.length)); - AccountPropertiesAddressTransactionBuffer.addSignature(builder, signatureVector); - AccountPropertiesAddressTransactionBuffer.addSigner(builder, signerVector); - AccountPropertiesAddressTransactionBuffer.addVersion(builder, this.version); - AccountPropertiesAddressTransactionBuffer.addType(builder, this.type); - AccountPropertiesAddressTransactionBuffer.addFee(builder, feeVector); - AccountPropertiesAddressTransactionBuffer.addDeadline(builder, deadlineVector); - AccountPropertiesAddressTransactionBuffer.addPropertyType(builder, this.propertyType); - AccountPropertiesAddressTransactionBuffer.addModificationCount(builder, this.modifications.length); - AccountPropertiesAddressTransactionBuffer.addModifications(builder, modificationVector); - - // Calculate size - const codedAccountPropertiesAddress = - AccountPropertiesAddressTransactionBuffer.endAccountPropertiesAddressTransactionBuffer(builder); - builder.finish(codedAccountPropertiesAddress); - - const bytes = builder.asUint8Array(); - - return new AccountPropertiesAddressTransaction(bytes); - } -} diff --git a/src/infrastructure/builders/AccountPropertiesEntityTypeTransaction.ts b/src/infrastructure/builders/AccountPropertiesEntityTypeTransaction.ts deleted file mode 100644 index 094d2bb1dc..0000000000 --- a/src/infrastructure/builders/AccountPropertiesEntityTypeTransaction.ts +++ /dev/null @@ -1,126 +0,0 @@ -/* - * Copyright 2019 NEM - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -/** - * @module transactions/AccountPropertiesEntityTypeTransaction - */ -import { TransactionType } from '../../model/transaction/TransactionType'; -import AccountPropertiesEntityTypeTransactionBufferPackage from '../buffers/AccountPropertiesEntityTypeTransactionBuffer'; -import AccountPropertiesEntityTypeModificationTransactionSchema from '../schemas/AccountPropertiesEntityTypeModificationTransactionSchema'; -import { VerifiableTransaction } from './VerifiableTransaction'; - -const { - AccountPropertiesEntityTypeTransactionBuffer, - PropertyEntityTypeModificationBuffer, -} = AccountPropertiesEntityTypeTransactionBufferPackage.Buffers; - -import {flatbuffers} from 'flatbuffers'; - -export default class AccountPropertiesEntityTypeTransaction extends VerifiableTransaction { - constructor(bytes) { - super(bytes, AccountPropertiesEntityTypeModificationTransactionSchema); - } -} - -// tslint:disable-next-line:max-classes-per-file -export class Builder { - maxFee: any; - version: any; - type: any; - deadline: any; - propertyType: any; - modifications: any; - constructor() { - this.maxFee = [0, 0]; - this.type = TransactionType.MODIFY_ACCOUNT_PROPERTY_ENTITY_TYPE; - } - - addFee(maxFee) { - this.maxFee = maxFee; - return this; - } - - addVersion(version) { - this.version = version; - return this; - } - - addType(type) { - this.type = type; - return this; - } - - addDeadline(deadline) { - this.deadline = deadline; - return this; - } - - addPropertyType(propertyType) { - this.propertyType = propertyType; - return this; - } - - addModifications(modifications) { - this.modifications = modifications; - return this; - } - - build() { - const builder = new flatbuffers.Builder(1); - - // Create modifications - const modificationsArray: any = []; - this.modifications.forEach((modification) => { - PropertyEntityTypeModificationBuffer.startPropertyEntityTypeModificationBuffer(builder); - PropertyEntityTypeModificationBuffer.addModificationType(builder, modification.type); - PropertyEntityTypeModificationBuffer.addValue(builder, modification.value); - modificationsArray.push(PropertyEntityTypeModificationBuffer.endPropertyEntityTypeModificationBuffer(builder)); - }); - - // Create vectors - const signatureVector = AccountPropertiesEntityTypeTransactionBuffer - .createSignatureVector(builder, Array(...Array(64)).map(Number.prototype.valueOf, 0)); - const signerVector = AccountPropertiesEntityTypeTransactionBuffer - .createSignerVector(builder, Array(...Array(32)).map(Number.prototype.valueOf, 0)); - const deadlineVector = AccountPropertiesEntityTypeTransactionBuffer - .createDeadlineVector(builder, this.deadline); - const feeVector = AccountPropertiesEntityTypeTransactionBuffer - .createFeeVector(builder, this.maxFee); - const modificationVector = AccountPropertiesEntityTypeTransactionBuffer - .createModificationsVector(builder, modificationsArray); - - AccountPropertiesEntityTypeTransactionBuffer.startAccountPropertiesEntityTypeTransactionBuffer(builder); - AccountPropertiesEntityTypeTransactionBuffer.addSize(builder, 122 + (3 * this.modifications.length)); - AccountPropertiesEntityTypeTransactionBuffer.addSignature(builder, signatureVector); - AccountPropertiesEntityTypeTransactionBuffer.addSigner(builder, signerVector); - AccountPropertiesEntityTypeTransactionBuffer.addVersion(builder, this.version); - AccountPropertiesEntityTypeTransactionBuffer.addType(builder, this.type); - AccountPropertiesEntityTypeTransactionBuffer.addFee(builder, feeVector); - AccountPropertiesEntityTypeTransactionBuffer.addDeadline(builder, deadlineVector); - AccountPropertiesEntityTypeTransactionBuffer.addPropertyType(builder, this.propertyType); - AccountPropertiesEntityTypeTransactionBuffer.addModificationCount(builder, this.modifications.length); - AccountPropertiesEntityTypeTransactionBuffer.addModifications(builder, modificationVector); - - // Calculate size - const codedAccountPropertiesAddress = AccountPropertiesEntityTypeTransactionBuffer - .endAccountPropertiesEntityTypeTransactionBuffer(builder); - builder.finish(codedAccountPropertiesAddress); - - const bytes = builder.asUint8Array(); - - return new AccountPropertiesEntityTypeTransaction(bytes); - } -} diff --git a/src/infrastructure/builders/AccountPropertiesMosaicTransaction.ts b/src/infrastructure/builders/AccountPropertiesMosaicTransaction.ts deleted file mode 100644 index 3842421260..0000000000 --- a/src/infrastructure/builders/AccountPropertiesMosaicTransaction.ts +++ /dev/null @@ -1,127 +0,0 @@ -/* - * Copyright 2019 NEM - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -/** - * @module transactions/AccountPropertiesMosaicTransaction - */ -import { TransactionType } from '../../model/transaction/TransactionType'; -import AccountPropertiesMosaicTransactionBufferPackage from '../buffers/AccountPropertiesMosaicTransactionBuffer'; -import AccountPropertiesMosaicModificationTransactionSchema from '../schemas/AccountPropertiesMosaicModificationTransactionSchema'; -import { VerifiableTransaction } from './VerifiableTransaction'; - -const { - AccountPropertiesMosaicTransactionBuffer, - PropertyMosaicModificationBuffer, -} = AccountPropertiesMosaicTransactionBufferPackage.Buffers; - -import {flatbuffers} from 'flatbuffers'; - -export default class AccountPropertiesMosaicTransaction extends VerifiableTransaction { - constructor(bytes) { - super(bytes, AccountPropertiesMosaicModificationTransactionSchema); - } -} - -// tslint:disable-next-line:max-classes-per-file -export class Builder { - maxFee: any; - version: any; - type: any; - deadline: any; - propertyType: any; - modifications: any; - constructor() { - this.maxFee = [0, 0]; - this.type = TransactionType.MODIFY_ACCOUNT_PROPERTY_MOSAIC; - } - - addFee(maxFee) { - this.maxFee = maxFee; - return this; - } - - addVersion(version) { - this.version = version; - return this; - } - - addType(type) { - this.type = type; - return this; - } - - addDeadline(deadline) { - this.deadline = deadline; - return this; - } - - addPropertyType(propertyType) { - this.propertyType = propertyType; - return this; - } - - addModifications(modifications) { - this.modifications = modifications; - return this; - } - - build() { - const builder = new flatbuffers.Builder(1); - - // Create modifications - const modificationsArray: any = []; - this.modifications.forEach((modification) => { - const addressModificationVector = PropertyMosaicModificationBuffer - .createValueVector(builder, modification.value); - PropertyMosaicModificationBuffer.startPropertyMosaicModificationBuffer(builder); - PropertyMosaicModificationBuffer.addModificationType(builder, modification.type); - PropertyMosaicModificationBuffer.addValue(builder, addressModificationVector); - modificationsArray.push(PropertyMosaicModificationBuffer.endPropertyMosaicModificationBuffer(builder)); - }); - - // Create vectors - const signatureVector = AccountPropertiesMosaicTransactionBuffer - .createSignatureVector(builder, Array(...Array(64)).map(Number.prototype.valueOf, 0)); - const signerVector = AccountPropertiesMosaicTransactionBuffer - .createSignerVector(builder, Array(...Array(32)).map(Number.prototype.valueOf, 0)); - const deadlineVector = AccountPropertiesMosaicTransactionBuffer - .createDeadlineVector(builder, this.deadline); - const feeVector = AccountPropertiesMosaicTransactionBuffer - .createFeeVector(builder, this.maxFee); - const modificationVector = AccountPropertiesMosaicTransactionBuffer - .createModificationsVector(builder, modificationsArray); - - AccountPropertiesMosaicTransactionBuffer.startAccountPropertiesMosaicTransactionBuffer(builder); - AccountPropertiesMosaicTransactionBuffer.addSize(builder, 122 + (9 * this.modifications.length)); - AccountPropertiesMosaicTransactionBuffer.addSignature(builder, signatureVector); - AccountPropertiesMosaicTransactionBuffer.addSigner(builder, signerVector); - AccountPropertiesMosaicTransactionBuffer.addVersion(builder, this.version); - AccountPropertiesMosaicTransactionBuffer.addType(builder, this.type); - AccountPropertiesMosaicTransactionBuffer.addFee(builder, feeVector); - AccountPropertiesMosaicTransactionBuffer.addDeadline(builder, deadlineVector); - AccountPropertiesMosaicTransactionBuffer.addPropertyType(builder, this.propertyType); - AccountPropertiesMosaicTransactionBuffer.addModificationCount(builder, this.modifications.length); - AccountPropertiesMosaicTransactionBuffer.addModifications(builder, modificationVector); - - // Calculate size - const codedAccountPropertiesMosaic = AccountPropertiesMosaicTransactionBuffer.endAccountPropertiesMosaicTransactionBuffer(builder); - builder.finish(codedAccountPropertiesMosaic); - - const bytes = builder.asUint8Array(); - - return new AccountPropertiesMosaicTransaction(bytes); - } -} diff --git a/src/infrastructure/builders/AccountRestrictionsAddressTransaction.ts b/src/infrastructure/builders/AccountRestrictionsAddressTransaction.ts new file mode 100644 index 0000000000..452e4c30b7 --- /dev/null +++ b/src/infrastructure/builders/AccountRestrictionsAddressTransaction.ts @@ -0,0 +1,128 @@ +/* + * Copyright 2019 NEM + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +/** + * @module transactions/AccountRestrictionsAddressTransaction + */ +import { RawAddress as address } from '../../core/format'; +import { TransactionType } from '../../model/transaction/TransactionType'; +import AccountRestrictionsAddressTransactionBufferPackage from '../buffers/AccountRestrictionsAddressTransactionBuffer'; +import AccountRestrictionsAddressModificationTransactionSchema from '../schemas/AccountRestrictionsAddressModificationTransactionSchema'; +import { VerifiableTransaction } from './VerifiableTransaction'; +const { + AccountRestrictionsAddressTransactionBuffer, + RestrictionAddressModificationBuffer, +} = AccountRestrictionsAddressTransactionBufferPackage.Buffers; + +import {flatbuffers} from 'flatbuffers'; + +export default class AccountRestrictionsAddressTransaction extends VerifiableTransaction { + constructor(bytes) { + super(bytes, AccountRestrictionsAddressModificationTransactionSchema); + } +} + +// tslint:disable-next-line:max-classes-per-file +export class Builder { + maxFee: any; + version: any; + type: any; + deadline: any; + restrictionType: any; + modifications: any; + constructor() { + this.maxFee = [0, 0]; + this.type = TransactionType.MODIFY_ACCOUNT_RESTRICTION_ADDRESS; + } + + addFee(maxFee) { + this.maxFee = maxFee; + return this; + } + + addVersion(version) { + this.version = version; + return this; + } + + addType(type) { + this.type = type; + return this; + } + + addDeadline(deadline) { + this.deadline = deadline; + return this; + } + + addRestrictionType(restrictionType) { + this.restrictionType = restrictionType; + return this; + } + + addModifications(modifications) { + this.modifications = modifications; + return this; + } + + build() { + const builder = new flatbuffers.Builder(1); + + // Create modifications + const modificationsArray: any = []; + this.modifications.forEach((modification) => { + const addressModificationVector = RestrictionAddressModificationBuffer + .createValueVector(builder, address.stringToAddress(modification.value)); + RestrictionAddressModificationBuffer.startRestrictionAddressModificationBuffer(builder); + RestrictionAddressModificationBuffer.addModificationType(builder, modification.type); + RestrictionAddressModificationBuffer.addValue(builder, addressModificationVector); + modificationsArray.push(RestrictionAddressModificationBuffer.endRestrictionAddressModificationBuffer(builder)); + }); + + // Create vectors + const signatureVector = AccountRestrictionsAddressTransactionBuffer + .createSignatureVector(builder, Array(...Array(64)).map(Number.prototype.valueOf, 0)); + const signerVector = AccountRestrictionsAddressTransactionBuffer + .createSignerVector(builder, Array(...Array(32)).map(Number.prototype.valueOf, 0)); + const deadlineVector = AccountRestrictionsAddressTransactionBuffer + .createDeadlineVector(builder, this.deadline); + const feeVector = AccountRestrictionsAddressTransactionBuffer + .createFeeVector(builder, this.maxFee); + const modificationVector = AccountRestrictionsAddressTransactionBuffer + .createModificationsVector(builder, modificationsArray); + + AccountRestrictionsAddressTransactionBuffer.startAccountRestrictionsAddressTransactionBuffer(builder); + AccountRestrictionsAddressTransactionBuffer.addSize(builder, 122 + (26 * this.modifications.length)); + AccountRestrictionsAddressTransactionBuffer.addSignature(builder, signatureVector); + AccountRestrictionsAddressTransactionBuffer.addSigner(builder, signerVector); + AccountRestrictionsAddressTransactionBuffer.addVersion(builder, this.version); + AccountRestrictionsAddressTransactionBuffer.addType(builder, this.type); + AccountRestrictionsAddressTransactionBuffer.addFee(builder, feeVector); + AccountRestrictionsAddressTransactionBuffer.addDeadline(builder, deadlineVector); + AccountRestrictionsAddressTransactionBuffer.addRestrictionType(builder, this.restrictionType); + AccountRestrictionsAddressTransactionBuffer.addModificationCount(builder, this.modifications.length); + AccountRestrictionsAddressTransactionBuffer.addModifications(builder, modificationVector); + + // Calculate size + const codedAccountRestrictionsAddress = + AccountRestrictionsAddressTransactionBuffer.endAccountRestrictionsAddressTransactionBuffer(builder); + builder.finish(codedAccountRestrictionsAddress); + + const bytes = builder.asUint8Array(); + + return new AccountRestrictionsAddressTransaction(bytes); + } +} diff --git a/src/infrastructure/builders/AccountRestrictionsEntityTypeTransaction.ts b/src/infrastructure/builders/AccountRestrictionsEntityTypeTransaction.ts new file mode 100644 index 0000000000..edfed292ba --- /dev/null +++ b/src/infrastructure/builders/AccountRestrictionsEntityTypeTransaction.ts @@ -0,0 +1,126 @@ +/* + * Copyright 2019 NEM + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +/** + * @module transactions/AccountRestrictionsEntityTypeTransaction + */ +import { TransactionType } from '../../model/transaction/TransactionType'; +import AccountRestrictionsEntityTypeTransactionBufferPackage from '../buffers/AccountRestrictionsEntityTypeTransactionBuffer'; +import AccountRestrictionsEntityTypeModificationTransactionSchema from '../schemas/AccountRestrictionsEntityTypeModificationTransactionSchema'; +import { VerifiableTransaction } from './VerifiableTransaction'; + +const { + AccountRestrictionsEntityTypeTransactionBuffer, + RestrictionEntityTypeModificationBuffer, +} = AccountRestrictionsEntityTypeTransactionBufferPackage.Buffers; + +import {flatbuffers} from 'flatbuffers'; + +export default class AccountRestrictionsEntityTypeTransaction extends VerifiableTransaction { + constructor(bytes) { + super(bytes, AccountRestrictionsEntityTypeModificationTransactionSchema); + } +} + +// tslint:disable-next-line:max-classes-per-file +export class Builder { + maxFee: any; + version: any; + type: any; + deadline: any; + restrictionType: any; + modifications: any; + constructor() { + this.maxFee = [0, 0]; + this.type = TransactionType.MODIFY_ACCOUNT_RESTRICTION_OPERATION; + } + + addFee(maxFee) { + this.maxFee = maxFee; + return this; + } + + addVersion(version) { + this.version = version; + return this; + } + + addType(type) { + this.type = type; + return this; + } + + addDeadline(deadline) { + this.deadline = deadline; + return this; + } + + addRestrictionType(restrictionType) { + this.restrictionType = restrictionType; + return this; + } + + addModifications(modifications) { + this.modifications = modifications; + return this; + } + + build() { + const builder = new flatbuffers.Builder(1); + + // Create modifications + const modificationsArray: any = []; + this.modifications.forEach((modification) => { + RestrictionEntityTypeModificationBuffer.startRestrictionEntityTypeModificationBuffer(builder); + RestrictionEntityTypeModificationBuffer.addModificationType(builder, modification.type); + RestrictionEntityTypeModificationBuffer.addValue(builder, modification.value); + modificationsArray.push(RestrictionEntityTypeModificationBuffer.endRestrictionEntityTypeModificationBuffer(builder)); + }); + + // Create vectors + const signatureVector = AccountRestrictionsEntityTypeTransactionBuffer + .createSignatureVector(builder, Array(...Array(64)).map(Number.prototype.valueOf, 0)); + const signerVector = AccountRestrictionsEntityTypeTransactionBuffer + .createSignerVector(builder, Array(...Array(32)).map(Number.prototype.valueOf, 0)); + const deadlineVector = AccountRestrictionsEntityTypeTransactionBuffer + .createDeadlineVector(builder, this.deadline); + const feeVector = AccountRestrictionsEntityTypeTransactionBuffer + .createFeeVector(builder, this.maxFee); + const modificationVector = AccountRestrictionsEntityTypeTransactionBuffer + .createModificationsVector(builder, modificationsArray); + + AccountRestrictionsEntityTypeTransactionBuffer.startAccountRestrictionsEntityTypeTransactionBuffer(builder); + AccountRestrictionsEntityTypeTransactionBuffer.addSize(builder, 122 + (3 * this.modifications.length)); + AccountRestrictionsEntityTypeTransactionBuffer.addSignature(builder, signatureVector); + AccountRestrictionsEntityTypeTransactionBuffer.addSigner(builder, signerVector); + AccountRestrictionsEntityTypeTransactionBuffer.addVersion(builder, this.version); + AccountRestrictionsEntityTypeTransactionBuffer.addType(builder, this.type); + AccountRestrictionsEntityTypeTransactionBuffer.addFee(builder, feeVector); + AccountRestrictionsEntityTypeTransactionBuffer.addDeadline(builder, deadlineVector); + AccountRestrictionsEntityTypeTransactionBuffer.addRestrictionType(builder, this.restrictionType); + AccountRestrictionsEntityTypeTransactionBuffer.addModificationCount(builder, this.modifications.length); + AccountRestrictionsEntityTypeTransactionBuffer.addModifications(builder, modificationVector); + + // Calculate size + const codedAccountRestrictionsAddress = AccountRestrictionsEntityTypeTransactionBuffer + .endAccountRestrictionsEntityTypeTransactionBuffer(builder); + builder.finish(codedAccountRestrictionsAddress); + + const bytes = builder.asUint8Array(); + + return new AccountRestrictionsEntityTypeTransaction(bytes); + } +} diff --git a/src/infrastructure/builders/AccountRestrictionsMosaicTransaction.ts b/src/infrastructure/builders/AccountRestrictionsMosaicTransaction.ts new file mode 100644 index 0000000000..ec97bcc02e --- /dev/null +++ b/src/infrastructure/builders/AccountRestrictionsMosaicTransaction.ts @@ -0,0 +1,127 @@ +/* + * Copyright 2019 NEM + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +/** + * @module transactions/AccountRestrictionsMosaicTransaction + */ +import { TransactionType } from '../../model/transaction/TransactionType'; +import AccountRestrictionsMosaicTransactionBufferPackage from '../buffers/AccountRestrictionsMosaicTransactionBuffer'; +import AccountRestrictionsMosaicModificationTransactionSchema from '../schemas/AccountRestrictionsMosaicModificationTransactionSchema'; +import { VerifiableTransaction } from './VerifiableTransaction'; + +const { + AccountRestrictionsMosaicTransactionBuffer, + RestrictionMosaicModificationBuffer, +} = AccountRestrictionsMosaicTransactionBufferPackage.Buffers; + +import {flatbuffers} from 'flatbuffers'; + +export default class AccountRestrictionsMosaicTransaction extends VerifiableTransaction { + constructor(bytes) { + super(bytes, AccountRestrictionsMosaicModificationTransactionSchema); + } +} + +// tslint:disable-next-line:max-classes-per-file +export class Builder { + maxFee: any; + version: any; + type: any; + deadline: any; + restrictionType: any; + modifications: any; + constructor() { + this.maxFee = [0, 0]; + this.type = TransactionType.MODIFY_ACCOUNT_RESTRICTION_MOSAIC; + } + + addFee(maxFee) { + this.maxFee = maxFee; + return this; + } + + addVersion(version) { + this.version = version; + return this; + } + + addType(type) { + this.type = type; + return this; + } + + addDeadline(deadline) { + this.deadline = deadline; + return this; + } + + addRestrictionType(restrictionType) { + this.restrictionType = restrictionType; + return this; + } + + addModifications(modifications) { + this.modifications = modifications; + return this; + } + + build() { + const builder = new flatbuffers.Builder(1); + + // Create modifications + const modificationsArray: any = []; + this.modifications.forEach((modification) => { + const addressModificationVector = RestrictionMosaicModificationBuffer + .createValueVector(builder, modification.value); + RestrictionMosaicModificationBuffer.startRestrictionMosaicModificationBuffer(builder); + RestrictionMosaicModificationBuffer.addModificationType(builder, modification.type); + RestrictionMosaicModificationBuffer.addValue(builder, addressModificationVector); + modificationsArray.push(RestrictionMosaicModificationBuffer.endRestrictionMosaicModificationBuffer(builder)); + }); + + // Create vectors + const signatureVector = AccountRestrictionsMosaicTransactionBuffer + .createSignatureVector(builder, Array(...Array(64)).map(Number.prototype.valueOf, 0)); + const signerVector = AccountRestrictionsMosaicTransactionBuffer + .createSignerVector(builder, Array(...Array(32)).map(Number.prototype.valueOf, 0)); + const deadlineVector = AccountRestrictionsMosaicTransactionBuffer + .createDeadlineVector(builder, this.deadline); + const feeVector = AccountRestrictionsMosaicTransactionBuffer + .createFeeVector(builder, this.maxFee); + const modificationVector = AccountRestrictionsMosaicTransactionBuffer + .createModificationsVector(builder, modificationsArray); + + AccountRestrictionsMosaicTransactionBuffer.startAccountRestrictionsMosaicTransactionBuffer(builder); + AccountRestrictionsMosaicTransactionBuffer.addSize(builder, 122 + (9 * this.modifications.length)); + AccountRestrictionsMosaicTransactionBuffer.addSignature(builder, signatureVector); + AccountRestrictionsMosaicTransactionBuffer.addSigner(builder, signerVector); + AccountRestrictionsMosaicTransactionBuffer.addVersion(builder, this.version); + AccountRestrictionsMosaicTransactionBuffer.addType(builder, this.type); + AccountRestrictionsMosaicTransactionBuffer.addFee(builder, feeVector); + AccountRestrictionsMosaicTransactionBuffer.addDeadline(builder, deadlineVector); + AccountRestrictionsMosaicTransactionBuffer.addRestrictionType(builder, this.restrictionType); + AccountRestrictionsMosaicTransactionBuffer.addModificationCount(builder, this.modifications.length); + AccountRestrictionsMosaicTransactionBuffer.addModifications(builder, modificationVector); + + // Calculate size + const codedAccountRestrictionsMosaic = AccountRestrictionsMosaicTransactionBuffer.endAccountRestrictionsMosaicTransactionBuffer(builder); + builder.finish(codedAccountRestrictionsMosaic); + + const bytes = builder.asUint8Array(); + + return new AccountRestrictionsMosaicTransaction(bytes); + } +} diff --git a/src/infrastructure/model/accountDTO.ts b/src/infrastructure/model/accountDTO.ts index a312272c82..0b3890eea9 100644 --- a/src/infrastructure/model/accountDTO.ts +++ b/src/infrastructure/model/accountDTO.ts @@ -14,10 +14,10 @@ * limitations under the License. */ /** - * Catapult REST API Reference + * Catapult REST Endpoints * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) * - * The version of the OpenAPI document: 0.7.15 + * The version of the OpenAPI document: 0.7.16 * * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). diff --git a/src/infrastructure/model/accountIds.ts b/src/infrastructure/model/accountIds.ts index 2152a05918..1da22f763f 100644 --- a/src/infrastructure/model/accountIds.ts +++ b/src/infrastructure/model/accountIds.ts @@ -14,10 +14,10 @@ * limitations under the License. */ /** - * Catapult REST API Reference + * Catapult REST Endpoints * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) * - * The version of the OpenAPI document: 0.7.15 + * The version of the OpenAPI document: 0.7.16 * * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). diff --git a/src/infrastructure/model/accountInfoDTO.ts b/src/infrastructure/model/accountInfoDTO.ts index b29f9fffa6..e2a190f4d9 100644 --- a/src/infrastructure/model/accountInfoDTO.ts +++ b/src/infrastructure/model/accountInfoDTO.ts @@ -14,10 +14,10 @@ * limitations under the License. */ /** - * Catapult REST API Reference + * Catapult REST Endpoints * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) * - * The version of the OpenAPI document: 0.7.15 + * The version of the OpenAPI document: 0.7.16 * * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). diff --git a/src/infrastructure/model/accountMetaDTO.ts b/src/infrastructure/model/accountMetaDTO.ts index fd30c7da9a..f5b7b16602 100644 --- a/src/infrastructure/model/accountMetaDTO.ts +++ b/src/infrastructure/model/accountMetaDTO.ts @@ -14,10 +14,10 @@ * limitations under the License. */ /** - * Catapult REST API Reference + * Catapult REST Endpoints * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) * - * The version of the OpenAPI document: 0.7.15 + * The version of the OpenAPI document: 0.7.16 * * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). diff --git a/src/infrastructure/model/accountNamesDTO.ts b/src/infrastructure/model/accountNamesDTO.ts index 5a4bbf42a3..b6e99a36cb 100644 --- a/src/infrastructure/model/accountNamesDTO.ts +++ b/src/infrastructure/model/accountNamesDTO.ts @@ -14,10 +14,10 @@ * limitations under the License. */ /** - * Catapult REST API Reference + * Catapult REST Endpoints * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) * - * The version of the OpenAPI document: 0.7.15 + * The version of the OpenAPI document: 0.7.16 * * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). @@ -28,7 +28,7 @@ export class AccountNamesDTO { /** - * The address of the account in base 32. + * The address of the account in hexadecimal. */ 'address': string; /** diff --git a/src/infrastructure/model/accountPropertyDTO.ts b/src/infrastructure/model/accountRestrictionDTO.ts similarity index 72% rename from src/infrastructure/model/accountPropertyDTO.ts rename to src/infrastructure/model/accountRestrictionDTO.ts index 8b1cdef1a3..0da2925a92 100644 --- a/src/infrastructure/model/accountPropertyDTO.ts +++ b/src/infrastructure/model/accountRestrictionDTO.ts @@ -14,10 +14,10 @@ * limitations under the License. */ /** - * Catapult REST API Reference + * Catapult REST Endpoints * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) * - * The version of the OpenAPI document: 0.7.15 + * The version of the OpenAPI document: 0.7.16 * * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). @@ -25,12 +25,12 @@ * Do not edit the class manually. */ -import { AccountPropertyTypeEnum } from './accountPropertyTypeEnum'; +import { AccountRestrictionTypeEnum } from './accountRestrictionTypeEnum'; -export class AccountPropertyDTO { - 'propertyType': AccountPropertyTypeEnum; +export class AccountRestrictionDTO { + 'restrictionType': AccountRestrictionTypeEnum; /** - * The address, transaction type or mosaic id to filter. + * The address, transaction type or mosaic id to restrict. */ 'values': Array; @@ -38,9 +38,9 @@ export class AccountPropertyDTO { static attributeTypeMap: Array<{name: string, baseName: string, type: string}> = [ { - "name": "propertyType", - "baseName": "propertyType", - "type": "AccountPropertyTypeEnum" + "name": "restrictionType", + "baseName": "restrictionType", + "type": "AccountRestrictionTypeEnum" }, { "name": "values", @@ -49,7 +49,7 @@ export class AccountPropertyDTO { } ]; static getAttributeTypeMap() { - return AccountPropertyDTO.attributeTypeMap; + return AccountRestrictionDTO.attributeTypeMap; } } diff --git a/src/infrastructure/model/accountPropertyTypeEnum.ts b/src/infrastructure/model/accountRestrictionTypeEnum.ts similarity index 56% rename from src/infrastructure/model/accountPropertyTypeEnum.ts rename to src/infrastructure/model/accountRestrictionTypeEnum.ts index 6195456edd..f23969ad40 100644 --- a/src/infrastructure/model/accountPropertyTypeEnum.ts +++ b/src/infrastructure/model/accountRestrictionTypeEnum.ts @@ -14,10 +14,10 @@ * limitations under the License. */ /** - * Catapult REST API Reference + * Catapult REST Endpoints * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) * - * The version of the OpenAPI document: 0.7.15 + * The version of the OpenAPI document: 0.7.16 * * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). @@ -27,9 +27,9 @@ /** -* The account properties type: * 0x01 (1 decimal) - The property type only allows receiving transactions from an address. * 0x02 (2 decimal) - The property type only allows receiving transactions containing a mosaic id. * 0x04 (4 decimal) - The property type only allows sending transactions with a given transaction type. * 0x05 (5 decimal) - Property type sentinel. * 0x81 (129 decimal) - The property type blocks receiving transactions from an address. * 0x82 (130 decimal) - The property type blocks receiving transactions containing a mosaic id. * 0x84 (132 decimal) - The property type blocks sending transactions with a given transaction type. +* The account restriction type: * 0x01 (1 decimal) - Allow only receiving transactions from an address. * 0x02 (2 decimal) - Allow only receiving transactions containing a mosaic id. * 0x04 (4 decimal) - Allow only sending transactions with a given transaction type. * 0x05 (5 decimal) - Restriction type sentinel. * 0x81 (129 decimal) - Block receiving transactions from an address. * 0x82 (130 decimal) - Block receiving transactions containing a mosaic id. * 0x84 (132 decimal) - Block sending transactions with a given transaction type. */ -export class AccountPropertyTypeEnum { +export class AccountRestrictionTypeEnum { static discriminator: string | undefined = undefined; @@ -37,7 +37,7 @@ export class AccountPropertyTypeEnum { ]; static getAttributeTypeMap() { - return AccountPropertyTypeEnum.attributeTypeMap; + return AccountRestrictionTypeEnum.attributeTypeMap; } } diff --git a/src/infrastructure/model/accountPropertiesDTO.ts b/src/infrastructure/model/accountRestrictionsDTO.ts similarity index 76% rename from src/infrastructure/model/accountPropertiesDTO.ts rename to src/infrastructure/model/accountRestrictionsDTO.ts index 27cd8a4dba..61512ce91f 100644 --- a/src/infrastructure/model/accountPropertiesDTO.ts +++ b/src/infrastructure/model/accountRestrictionsDTO.ts @@ -14,10 +14,10 @@ * limitations under the License. */ /** - * Catapult REST API Reference + * Catapult REST Endpoints * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) * - * The version of the OpenAPI document: 0.7.15 + * The version of the OpenAPI document: 0.7.16 * * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). @@ -25,14 +25,14 @@ * Do not edit the class manually. */ -import { AccountPropertyDTO } from './accountPropertyDTO'; +import { AccountRestrictionDTO } from './accountRestrictionDTO'; -export class AccountPropertiesDTO { +export class AccountRestrictionsDTO { /** * The address of the account in hexadecimal. */ 'address': string; - 'properties': Array; + 'restrictions': Array; static discriminator: string | undefined = undefined; @@ -43,13 +43,13 @@ export class AccountPropertiesDTO { "type": "string" }, { - "name": "properties", - "baseName": "properties", - "type": "Array" + "name": "restrictions", + "baseName": "restrictions", + "type": "Array" } ]; static getAttributeTypeMap() { - return AccountPropertiesDTO.attributeTypeMap; + return AccountRestrictionsDTO.attributeTypeMap; } } diff --git a/src/infrastructure/model/accountPropertiesInfoDTO.ts b/src/infrastructure/model/accountRestrictionsInfoDTO.ts similarity index 71% rename from src/infrastructure/model/accountPropertiesInfoDTO.ts rename to src/infrastructure/model/accountRestrictionsInfoDTO.ts index 097a9c9649..8dc7cacf80 100644 --- a/src/infrastructure/model/accountPropertiesInfoDTO.ts +++ b/src/infrastructure/model/accountRestrictionsInfoDTO.ts @@ -14,10 +14,10 @@ * limitations under the License. */ /** - * Catapult REST API Reference + * Catapult REST Endpoints * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) * - * The version of the OpenAPI document: 0.7.15 + * The version of the OpenAPI document: 0.7.16 * * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). @@ -25,22 +25,22 @@ * Do not edit the class manually. */ -import { AccountPropertiesDTO } from './accountPropertiesDTO'; +import { AccountRestrictionsDTO } from './accountRestrictionsDTO'; -export class AccountPropertiesInfoDTO { - 'accountProperties': AccountPropertiesDTO; +export class AccountRestrictionsInfoDTO { + 'accountRestrictions': AccountRestrictionsDTO; static discriminator: string | undefined = undefined; static attributeTypeMap: Array<{name: string, baseName: string, type: string}> = [ { - "name": "accountProperties", - "baseName": "accountProperties", - "type": "AccountPropertiesDTO" + "name": "accountRestrictions", + "baseName": "accountRestrictions", + "type": "AccountRestrictionsDTO" } ]; static getAttributeTypeMap() { - return AccountPropertiesInfoDTO.attributeTypeMap; + return AccountRestrictionsInfoDTO.attributeTypeMap; } } diff --git a/src/infrastructure/model/aliasDTO.ts b/src/infrastructure/model/aliasDTO.ts index c1d05bdeb7..06056e902c 100644 --- a/src/infrastructure/model/aliasDTO.ts +++ b/src/infrastructure/model/aliasDTO.ts @@ -14,10 +14,10 @@ * limitations under the License. */ /** - * Catapult REST API Reference + * Catapult REST Endpoints * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) * - * The version of the OpenAPI document: 0.7.15 + * The version of the OpenAPI document: 0.7.16 * * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). diff --git a/src/infrastructure/model/aliasTypeEnum.ts b/src/infrastructure/model/aliasTypeEnum.ts index c3eb306311..8035ecd711 100644 --- a/src/infrastructure/model/aliasTypeEnum.ts +++ b/src/infrastructure/model/aliasTypeEnum.ts @@ -14,10 +14,10 @@ * limitations under the License. */ /** - * Catapult REST API Reference + * Catapult REST Endpoints * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) * - * The version of the OpenAPI document: 0.7.15 + * The version of the OpenAPI document: 0.7.16 * * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). diff --git a/src/infrastructure/model/announceTransactionInfoDTO.ts b/src/infrastructure/model/announceTransactionInfoDTO.ts index 9a0bd590cc..298c4d310e 100644 --- a/src/infrastructure/model/announceTransactionInfoDTO.ts +++ b/src/infrastructure/model/announceTransactionInfoDTO.ts @@ -14,10 +14,10 @@ * limitations under the License. */ /** - * Catapult REST API Reference + * Catapult REST Endpoints * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) * - * The version of the OpenAPI document: 0.7.15 + * The version of the OpenAPI document: 0.7.16 * * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). diff --git a/src/infrastructure/model/blockDTO.ts b/src/infrastructure/model/blockDTO.ts index 178c52f7a0..4182db536a 100644 --- a/src/infrastructure/model/blockDTO.ts +++ b/src/infrastructure/model/blockDTO.ts @@ -14,10 +14,10 @@ * limitations under the License. */ /** - * Catapult REST API Reference + * Catapult REST Endpoints * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) * - * The version of the OpenAPI document: 0.7.15 + * The version of the OpenAPI document: 0.7.16 * * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). diff --git a/src/infrastructure/model/blockInfoDTO.ts b/src/infrastructure/model/blockInfoDTO.ts index 8472c92e20..e64ced621a 100644 --- a/src/infrastructure/model/blockInfoDTO.ts +++ b/src/infrastructure/model/blockInfoDTO.ts @@ -14,10 +14,10 @@ * limitations under the License. */ /** - * Catapult REST API Reference + * Catapult REST Endpoints * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) * - * The version of the OpenAPI document: 0.7.15 + * The version of the OpenAPI document: 0.7.16 * * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). diff --git a/src/infrastructure/model/blockMetaDTO.ts b/src/infrastructure/model/blockMetaDTO.ts index 42cf4d7f93..d37bd8c65d 100644 --- a/src/infrastructure/model/blockMetaDTO.ts +++ b/src/infrastructure/model/blockMetaDTO.ts @@ -14,10 +14,10 @@ * limitations under the License. */ /** - * Catapult REST API Reference + * Catapult REST Endpoints * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) * - * The version of the OpenAPI document: 0.7.15 + * The version of the OpenAPI document: 0.7.16 * * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). diff --git a/src/infrastructure/model/blockchainScoreDTO.ts b/src/infrastructure/model/blockchainScoreDTO.ts index e878826403..a5498b09d4 100644 --- a/src/infrastructure/model/blockchainScoreDTO.ts +++ b/src/infrastructure/model/blockchainScoreDTO.ts @@ -14,10 +14,10 @@ * limitations under the License. */ /** - * Catapult REST API Reference + * Catapult REST Endpoints * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) * - * The version of the OpenAPI document: 0.7.15 + * The version of the OpenAPI document: 0.7.16 * * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). diff --git a/src/infrastructure/model/communicationTimestamps.ts b/src/infrastructure/model/communicationTimestamps.ts index aac9258c6e..e44d99a240 100644 --- a/src/infrastructure/model/communicationTimestamps.ts +++ b/src/infrastructure/model/communicationTimestamps.ts @@ -14,10 +14,10 @@ * limitations under the License. */ /** - * Catapult REST API Reference + * Catapult REST Endpoints * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) * - * The version of the OpenAPI document: 0.7.15 + * The version of the OpenAPI document: 0.7.16 * * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). diff --git a/src/infrastructure/model/cosignature.ts b/src/infrastructure/model/cosignature.ts index c3f5fea38f..4e078d0794 100644 --- a/src/infrastructure/model/cosignature.ts +++ b/src/infrastructure/model/cosignature.ts @@ -14,10 +14,10 @@ * limitations under the License. */ /** - * Catapult REST API Reference + * Catapult REST Endpoints * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) * - * The version of the OpenAPI document: 0.7.15 + * The version of the OpenAPI document: 0.7.16 * * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). diff --git a/src/infrastructure/model/heightInfoDTO.ts b/src/infrastructure/model/heightInfoDTO.ts index 14276bc9a3..53f49ef78a 100644 --- a/src/infrastructure/model/heightInfoDTO.ts +++ b/src/infrastructure/model/heightInfoDTO.ts @@ -14,10 +14,10 @@ * limitations under the License. */ /** - * Catapult REST API Reference + * Catapult REST Endpoints * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) * - * The version of the OpenAPI document: 0.7.15 + * The version of the OpenAPI document: 0.7.16 * * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). diff --git a/src/infrastructure/model/merklePathItem.ts b/src/infrastructure/model/merklePathItem.ts index 475550c6f5..fe4e09e439 100644 --- a/src/infrastructure/model/merklePathItem.ts +++ b/src/infrastructure/model/merklePathItem.ts @@ -14,10 +14,10 @@ * limitations under the License. */ /** - * Catapult REST API Reference + * Catapult REST Endpoints * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) * - * The version of the OpenAPI document: 0.7.15 + * The version of the OpenAPI document: 0.7.16 * * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). diff --git a/src/infrastructure/model/merkleProofInfo.ts b/src/infrastructure/model/merkleProofInfo.ts index 1b43545088..736671acb0 100644 --- a/src/infrastructure/model/merkleProofInfo.ts +++ b/src/infrastructure/model/merkleProofInfo.ts @@ -14,10 +14,10 @@ * limitations under the License. */ /** - * Catapult REST API Reference + * Catapult REST Endpoints * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) * - * The version of the OpenAPI document: 0.7.15 + * The version of the OpenAPI document: 0.7.16 * * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). diff --git a/src/infrastructure/model/merkleProofInfoDTO.ts b/src/infrastructure/model/merkleProofInfoDTO.ts index d11326ff87..8e46199b97 100644 --- a/src/infrastructure/model/merkleProofInfoDTO.ts +++ b/src/infrastructure/model/merkleProofInfoDTO.ts @@ -14,10 +14,10 @@ * limitations under the License. */ /** - * Catapult REST API Reference + * Catapult REST Endpoints * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) * - * The version of the OpenAPI document: 0.7.15 + * The version of the OpenAPI document: 0.7.16 * * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). diff --git a/src/infrastructure/model/models.ts b/src/infrastructure/model/models.ts index e80d56cb48..79ac71b3db 100644 --- a/src/infrastructure/model/models.ts +++ b/src/infrastructure/model/models.ts @@ -29,10 +29,10 @@ export * from './accountIds'; export * from './accountInfoDTO'; export * from './accountMetaDTO'; export * from './accountNamesDTO'; -export * from './accountPropertiesDTO'; -export * from './accountPropertiesInfoDTO'; -export * from './accountPropertyDTO'; -export * from './accountPropertyTypeEnum'; +export * from './accountRestrictionDTO'; +export * from './accountRestrictionTypeEnum'; +export * from './accountRestrictionsDTO'; +export * from './accountRestrictionsInfoDTO'; export * from './aliasDTO'; export * from './aliasTypeEnum'; export * from './announceTransactionInfoDTO'; @@ -91,10 +91,10 @@ import { AccountIds } from './accountIds'; import { AccountInfoDTO } from './accountInfoDTO'; import { AccountMetaDTO } from './accountMetaDTO'; import { AccountNamesDTO } from './accountNamesDTO'; -import { AccountPropertiesDTO } from './accountPropertiesDTO'; -import { AccountPropertiesInfoDTO } from './accountPropertiesInfoDTO'; -import { AccountPropertyDTO } from './accountPropertyDTO'; -import { AccountPropertyTypeEnum } from './accountPropertyTypeEnum'; +import { AccountRestrictionDTO } from './accountRestrictionDTO'; +import { AccountRestrictionTypeEnum } from './accountRestrictionTypeEnum'; +import { AccountRestrictionsDTO } from './accountRestrictionsDTO'; +import { AccountRestrictionsInfoDTO } from './accountRestrictionsInfoDTO'; import { AliasDTO } from './aliasDTO'; import { AliasTypeEnum } from './aliasTypeEnum'; import { AnnounceTransactionInfoDTO } from './announceTransactionInfoDTO'; @@ -159,7 +159,7 @@ let primitives = [ ]; let enumsMap: {[index: string]: any} = { - "AccountPropertyTypeEnum": AccountPropertyTypeEnum, + "AliasTypeEnum": AliasTypeEnum, "MosaicPropertyIdEnum": MosaicPropertyIdEnum, "MultisigModificationTypeEnum": MultisigModificationTypeEnum, @@ -174,9 +174,10 @@ let typeMap: {[index: string]: any} = { "AccountInfoDTO": AccountInfoDTO, "AccountMetaDTO": AccountMetaDTO, "AccountNamesDTO": AccountNamesDTO, - "AccountPropertiesDTO": AccountPropertiesDTO, - "AccountPropertiesInfoDTO": AccountPropertiesInfoDTO, - "AccountPropertyDTO": AccountPropertyDTO, + "AccountRestrictionDTO": AccountRestrictionDTO, + "AccountRestrictionTypeEnum": AccountRestrictionTypeEnum, + "AccountRestrictionsDTO": AccountRestrictionsDTO, + "AccountRestrictionsInfoDTO": AccountRestrictionsInfoDTO, "AliasDTO": AliasDTO, "AnnounceTransactionInfoDTO": AnnounceTransactionInfoDTO, "BlockDTO": BlockDTO, diff --git a/src/infrastructure/model/mosaicDTO.ts b/src/infrastructure/model/mosaicDTO.ts index 6d378dd0e7..a929869893 100644 --- a/src/infrastructure/model/mosaicDTO.ts +++ b/src/infrastructure/model/mosaicDTO.ts @@ -14,10 +14,10 @@ * limitations under the License. */ /** - * Catapult REST API Reference + * Catapult REST Endpoints * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) * - * The version of the OpenAPI document: 0.7.15 + * The version of the OpenAPI document: 0.7.16 * * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). diff --git a/src/infrastructure/model/mosaicDefinitionDTO.ts b/src/infrastructure/model/mosaicDefinitionDTO.ts index 852beca482..a4582269be 100644 --- a/src/infrastructure/model/mosaicDefinitionDTO.ts +++ b/src/infrastructure/model/mosaicDefinitionDTO.ts @@ -14,10 +14,10 @@ * limitations under the License. */ /** - * Catapult REST API Reference + * Catapult REST Endpoints * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) * - * The version of the OpenAPI document: 0.7.15 + * The version of the OpenAPI document: 0.7.16 * * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). diff --git a/src/infrastructure/model/mosaicIds.ts b/src/infrastructure/model/mosaicIds.ts index 1835e0f87c..0cf86352e0 100644 --- a/src/infrastructure/model/mosaicIds.ts +++ b/src/infrastructure/model/mosaicIds.ts @@ -14,10 +14,10 @@ * limitations under the License. */ /** - * Catapult REST API Reference + * Catapult REST Endpoints * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) * - * The version of the OpenAPI document: 0.7.15 + * The version of the OpenAPI document: 0.7.16 * * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). diff --git a/src/infrastructure/model/mosaicInfoDTO.ts b/src/infrastructure/model/mosaicInfoDTO.ts index 3c47234a50..d3f22605f6 100644 --- a/src/infrastructure/model/mosaicInfoDTO.ts +++ b/src/infrastructure/model/mosaicInfoDTO.ts @@ -14,10 +14,10 @@ * limitations under the License. */ /** - * Catapult REST API Reference + * Catapult REST Endpoints * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) * - * The version of the OpenAPI document: 0.7.15 + * The version of the OpenAPI document: 0.7.16 * * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). diff --git a/src/infrastructure/model/mosaicMetaDTO.ts b/src/infrastructure/model/mosaicMetaDTO.ts index 25725c93aa..845c13a39a 100644 --- a/src/infrastructure/model/mosaicMetaDTO.ts +++ b/src/infrastructure/model/mosaicMetaDTO.ts @@ -14,10 +14,10 @@ * limitations under the License. */ /** - * Catapult REST API Reference + * Catapult REST Endpoints * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) * - * The version of the OpenAPI document: 0.7.15 + * The version of the OpenAPI document: 0.7.16 * * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). diff --git a/src/infrastructure/model/mosaicNamesDTO.ts b/src/infrastructure/model/mosaicNamesDTO.ts index b45f1934f9..e9413ce9be 100644 --- a/src/infrastructure/model/mosaicNamesDTO.ts +++ b/src/infrastructure/model/mosaicNamesDTO.ts @@ -14,10 +14,10 @@ * limitations under the License. */ /** - * Catapult REST API Reference + * Catapult REST Endpoints * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) * - * The version of the OpenAPI document: 0.7.15 + * The version of the OpenAPI document: 0.7.16 * * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). diff --git a/src/infrastructure/model/mosaicPropertyDTO.ts b/src/infrastructure/model/mosaicPropertyDTO.ts index 9f480d6fa0..90f9bde59c 100644 --- a/src/infrastructure/model/mosaicPropertyDTO.ts +++ b/src/infrastructure/model/mosaicPropertyDTO.ts @@ -14,10 +14,10 @@ * limitations under the License. */ /** - * Catapult REST API Reference + * Catapult REST Endpoints * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) * - * The version of the OpenAPI document: 0.7.15 + * The version of the OpenAPI document: 0.7.16 * * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). diff --git a/src/infrastructure/model/mosaicPropertyIdEnum.ts b/src/infrastructure/model/mosaicPropertyIdEnum.ts index 02542b4b78..6f739ec065 100644 --- a/src/infrastructure/model/mosaicPropertyIdEnum.ts +++ b/src/infrastructure/model/mosaicPropertyIdEnum.ts @@ -14,10 +14,10 @@ * limitations under the License. */ /** - * Catapult REST API Reference + * Catapult REST Endpoints * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) * - * The version of the OpenAPI document: 0.7.15 + * The version of the OpenAPI document: 0.7.16 * * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). diff --git a/src/infrastructure/model/multisigAccountGraphInfoDTO.ts b/src/infrastructure/model/multisigAccountGraphInfoDTO.ts index 20a3e027ae..d004a7ce63 100644 --- a/src/infrastructure/model/multisigAccountGraphInfoDTO.ts +++ b/src/infrastructure/model/multisigAccountGraphInfoDTO.ts @@ -14,10 +14,10 @@ * limitations under the License. */ /** - * Catapult REST API Reference + * Catapult REST Endpoints * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) * - * The version of the OpenAPI document: 0.7.15 + * The version of the OpenAPI document: 0.7.16 * * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). diff --git a/src/infrastructure/model/multisigAccountInfoDTO.ts b/src/infrastructure/model/multisigAccountInfoDTO.ts index 5cc02e4c4d..59b5c8e55c 100644 --- a/src/infrastructure/model/multisigAccountInfoDTO.ts +++ b/src/infrastructure/model/multisigAccountInfoDTO.ts @@ -14,10 +14,10 @@ * limitations under the License. */ /** - * Catapult REST API Reference + * Catapult REST Endpoints * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) * - * The version of the OpenAPI document: 0.7.15 + * The version of the OpenAPI document: 0.7.16 * * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). diff --git a/src/infrastructure/model/multisigDTO.ts b/src/infrastructure/model/multisigDTO.ts index 3ad10b6d94..011353a2f3 100644 --- a/src/infrastructure/model/multisigDTO.ts +++ b/src/infrastructure/model/multisigDTO.ts @@ -14,10 +14,10 @@ * limitations under the License. */ /** - * Catapult REST API Reference + * Catapult REST Endpoints * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) * - * The version of the OpenAPI document: 0.7.15 + * The version of the OpenAPI document: 0.7.16 * * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). diff --git a/src/infrastructure/model/multisigModificationTypeEnum.ts b/src/infrastructure/model/multisigModificationTypeEnum.ts index 248b06a1ba..3107b46071 100644 --- a/src/infrastructure/model/multisigModificationTypeEnum.ts +++ b/src/infrastructure/model/multisigModificationTypeEnum.ts @@ -14,10 +14,10 @@ * limitations under the License. */ /** - * Catapult REST API Reference + * Catapult REST Endpoints * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) * - * The version of the OpenAPI document: 0.7.15 + * The version of the OpenAPI document: 0.7.16 * * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). diff --git a/src/infrastructure/model/namespaceDTO.ts b/src/infrastructure/model/namespaceDTO.ts index 6836a3564c..68f20c9d7b 100644 --- a/src/infrastructure/model/namespaceDTO.ts +++ b/src/infrastructure/model/namespaceDTO.ts @@ -14,10 +14,10 @@ * limitations under the License. */ /** - * Catapult REST API Reference + * Catapult REST Endpoints * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) * - * The version of the OpenAPI document: 0.7.15 + * The version of the OpenAPI document: 0.7.16 * * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). diff --git a/src/infrastructure/model/namespaceIds.ts b/src/infrastructure/model/namespaceIds.ts index 684e8c89a9..24f633f1c4 100644 --- a/src/infrastructure/model/namespaceIds.ts +++ b/src/infrastructure/model/namespaceIds.ts @@ -14,10 +14,10 @@ * limitations under the License. */ /** - * Catapult REST API Reference + * Catapult REST Endpoints * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) * - * The version of the OpenAPI document: 0.7.15 + * The version of the OpenAPI document: 0.7.16 * * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). diff --git a/src/infrastructure/model/namespaceInfoDTO.ts b/src/infrastructure/model/namespaceInfoDTO.ts index 084ba6da75..dceebf799a 100644 --- a/src/infrastructure/model/namespaceInfoDTO.ts +++ b/src/infrastructure/model/namespaceInfoDTO.ts @@ -14,10 +14,10 @@ * limitations under the License. */ /** - * Catapult REST API Reference + * Catapult REST Endpoints * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) * - * The version of the OpenAPI document: 0.7.15 + * The version of the OpenAPI document: 0.7.16 * * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). diff --git a/src/infrastructure/model/namespaceMetaDTO.ts b/src/infrastructure/model/namespaceMetaDTO.ts index 13f3557d7f..cb6640b594 100644 --- a/src/infrastructure/model/namespaceMetaDTO.ts +++ b/src/infrastructure/model/namespaceMetaDTO.ts @@ -14,10 +14,10 @@ * limitations under the License. */ /** - * Catapult REST API Reference + * Catapult REST Endpoints * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) * - * The version of the OpenAPI document: 0.7.15 + * The version of the OpenAPI document: 0.7.16 * * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). diff --git a/src/infrastructure/model/namespaceNameDTO.ts b/src/infrastructure/model/namespaceNameDTO.ts index 9a8eef6567..7cd704e180 100644 --- a/src/infrastructure/model/namespaceNameDTO.ts +++ b/src/infrastructure/model/namespaceNameDTO.ts @@ -14,10 +14,10 @@ * limitations under the License. */ /** - * Catapult REST API Reference + * Catapult REST Endpoints * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) * - * The version of the OpenAPI document: 0.7.15 + * The version of the OpenAPI document: 0.7.16 * * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). diff --git a/src/infrastructure/model/namespaceTypeEnum.ts b/src/infrastructure/model/namespaceTypeEnum.ts index 81ae70d2af..9e78121039 100644 --- a/src/infrastructure/model/namespaceTypeEnum.ts +++ b/src/infrastructure/model/namespaceTypeEnum.ts @@ -14,10 +14,10 @@ * limitations under the License. */ /** - * Catapult REST API Reference + * Catapult REST Endpoints * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) * - * The version of the OpenAPI document: 0.7.15 + * The version of the OpenAPI document: 0.7.16 * * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). diff --git a/src/infrastructure/model/networkTypeDTO.ts b/src/infrastructure/model/networkTypeDTO.ts index 8994ce3c30..0df44f1af7 100644 --- a/src/infrastructure/model/networkTypeDTO.ts +++ b/src/infrastructure/model/networkTypeDTO.ts @@ -14,10 +14,10 @@ * limitations under the License. */ /** - * Catapult REST API Reference + * Catapult REST Endpoints * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) * - * The version of the OpenAPI document: 0.7.15 + * The version of the OpenAPI document: 0.7.16 * * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). diff --git a/src/infrastructure/model/nodeInfoDTO.ts b/src/infrastructure/model/nodeInfoDTO.ts index c4786b709d..a44c736793 100644 --- a/src/infrastructure/model/nodeInfoDTO.ts +++ b/src/infrastructure/model/nodeInfoDTO.ts @@ -14,10 +14,10 @@ * limitations under the License. */ /** - * Catapult REST API Reference + * Catapult REST Endpoints * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) * - * The version of the OpenAPI document: 0.7.15 + * The version of the OpenAPI document: 0.7.16 * * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). diff --git a/src/infrastructure/model/nodeTimeDTO.ts b/src/infrastructure/model/nodeTimeDTO.ts index d1a61ad09d..dda0b6eaa4 100644 --- a/src/infrastructure/model/nodeTimeDTO.ts +++ b/src/infrastructure/model/nodeTimeDTO.ts @@ -14,10 +14,10 @@ * limitations under the License. */ /** - * Catapult REST API Reference + * Catapult REST Endpoints * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) * - * The version of the OpenAPI document: 0.7.15 + * The version of the OpenAPI document: 0.7.16 * * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). diff --git a/src/infrastructure/model/receiptTypeEnum.ts b/src/infrastructure/model/receiptTypeEnum.ts index 3083c95477..7c2b4981fa 100644 --- a/src/infrastructure/model/receiptTypeEnum.ts +++ b/src/infrastructure/model/receiptTypeEnum.ts @@ -14,10 +14,10 @@ * limitations under the License. */ /** - * Catapult REST API Reference + * Catapult REST Endpoints * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) * - * The version of the OpenAPI document: 0.7.15 + * The version of the OpenAPI document: 0.7.16 * * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). diff --git a/src/infrastructure/model/resolutionEntryDTO.ts b/src/infrastructure/model/resolutionEntryDTO.ts index 32569b9855..e0f1328c48 100644 --- a/src/infrastructure/model/resolutionEntryDTO.ts +++ b/src/infrastructure/model/resolutionEntryDTO.ts @@ -14,10 +14,10 @@ * limitations under the License. */ /** - * Catapult REST API Reference + * Catapult REST Endpoints * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) * - * The version of the OpenAPI document: 0.7.15 + * The version of the OpenAPI document: 0.7.16 * * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). diff --git a/src/infrastructure/model/resolutionStatementDTO.ts b/src/infrastructure/model/resolutionStatementDTO.ts index d7de883078..ab58575eb1 100644 --- a/src/infrastructure/model/resolutionStatementDTO.ts +++ b/src/infrastructure/model/resolutionStatementDTO.ts @@ -14,10 +14,10 @@ * limitations under the License. */ /** - * Catapult REST API Reference + * Catapult REST Endpoints * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) * - * The version of the OpenAPI document: 0.7.15 + * The version of the OpenAPI document: 0.7.16 * * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). diff --git a/src/infrastructure/model/rolesTypeEnum.ts b/src/infrastructure/model/rolesTypeEnum.ts index a0b91d7a13..1b7cd9a3bb 100644 --- a/src/infrastructure/model/rolesTypeEnum.ts +++ b/src/infrastructure/model/rolesTypeEnum.ts @@ -14,10 +14,10 @@ * limitations under the License. */ /** - * Catapult REST API Reference + * Catapult REST Endpoints * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) * - * The version of the OpenAPI document: 0.7.15 + * The version of the OpenAPI document: 0.7.16 * * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). diff --git a/src/infrastructure/model/serverDTO.ts b/src/infrastructure/model/serverDTO.ts index 0cb1e94b98..ea725312b5 100644 --- a/src/infrastructure/model/serverDTO.ts +++ b/src/infrastructure/model/serverDTO.ts @@ -14,10 +14,10 @@ * limitations under the License. */ /** - * Catapult REST API Reference + * Catapult REST Endpoints * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) * - * The version of the OpenAPI document: 0.7.15 + * The version of the OpenAPI document: 0.7.16 * * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). diff --git a/src/infrastructure/model/serverInfoDTO.ts b/src/infrastructure/model/serverInfoDTO.ts index 9a1ce8b75f..6dd2fd1b2d 100644 --- a/src/infrastructure/model/serverInfoDTO.ts +++ b/src/infrastructure/model/serverInfoDTO.ts @@ -14,10 +14,10 @@ * limitations under the License. */ /** - * Catapult REST API Reference + * Catapult REST Endpoints * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) * - * The version of the OpenAPI document: 0.7.15 + * The version of the OpenAPI document: 0.7.16 * * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). diff --git a/src/infrastructure/model/sourceDTO.ts b/src/infrastructure/model/sourceDTO.ts index b88167f350..d57091485c 100644 --- a/src/infrastructure/model/sourceDTO.ts +++ b/src/infrastructure/model/sourceDTO.ts @@ -14,10 +14,10 @@ * limitations under the License. */ /** - * Catapult REST API Reference + * Catapult REST Endpoints * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) * - * The version of the OpenAPI document: 0.7.15 + * The version of the OpenAPI document: 0.7.16 * * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). diff --git a/src/infrastructure/model/statementsDTO.ts b/src/infrastructure/model/statementsDTO.ts index a7f5016e89..35d64d7a68 100644 --- a/src/infrastructure/model/statementsDTO.ts +++ b/src/infrastructure/model/statementsDTO.ts @@ -14,10 +14,10 @@ * limitations under the License. */ /** - * Catapult REST API Reference + * Catapult REST Endpoints * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) * - * The version of the OpenAPI document: 0.7.15 + * The version of the OpenAPI document: 0.7.16 * * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). diff --git a/src/infrastructure/model/storageInfoDTO.ts b/src/infrastructure/model/storageInfoDTO.ts index 78c7bacd71..672a18ba13 100644 --- a/src/infrastructure/model/storageInfoDTO.ts +++ b/src/infrastructure/model/storageInfoDTO.ts @@ -14,10 +14,10 @@ * limitations under the License. */ /** - * Catapult REST API Reference + * Catapult REST Endpoints * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) * - * The version of the OpenAPI document: 0.7.15 + * The version of the OpenAPI document: 0.7.16 * * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). diff --git a/src/infrastructure/model/transactionHashes.ts b/src/infrastructure/model/transactionHashes.ts index 00a2aaf043..40b833628d 100644 --- a/src/infrastructure/model/transactionHashes.ts +++ b/src/infrastructure/model/transactionHashes.ts @@ -14,10 +14,10 @@ * limitations under the License. */ /** - * Catapult REST API Reference + * Catapult REST Endpoints * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) * - * The version of the OpenAPI document: 0.7.15 + * The version of the OpenAPI document: 0.7.16 * * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). diff --git a/src/infrastructure/model/transactionIds.ts b/src/infrastructure/model/transactionIds.ts index 9f9c4c8ed0..745788bae6 100644 --- a/src/infrastructure/model/transactionIds.ts +++ b/src/infrastructure/model/transactionIds.ts @@ -14,10 +14,10 @@ * limitations under the License. */ /** - * Catapult REST API Reference + * Catapult REST Endpoints * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) * - * The version of the OpenAPI document: 0.7.15 + * The version of the OpenAPI document: 0.7.16 * * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). diff --git a/src/infrastructure/model/transactionInfoDTO.ts b/src/infrastructure/model/transactionInfoDTO.ts index 935036c58a..73901a3a24 100644 --- a/src/infrastructure/model/transactionInfoDTO.ts +++ b/src/infrastructure/model/transactionInfoDTO.ts @@ -14,10 +14,10 @@ * limitations under the License. */ /** - * Catapult REST API Reference + * Catapult REST Endpoints * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) * - * The version of the OpenAPI document: 0.7.15 + * The version of the OpenAPI document: 0.7.16 * * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). diff --git a/src/infrastructure/model/transactionMetaDTO.ts b/src/infrastructure/model/transactionMetaDTO.ts index d264c1c74c..c6e9e626a4 100644 --- a/src/infrastructure/model/transactionMetaDTO.ts +++ b/src/infrastructure/model/transactionMetaDTO.ts @@ -14,10 +14,10 @@ * limitations under the License. */ /** - * Catapult REST API Reference + * Catapult REST Endpoints * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) * - * The version of the OpenAPI document: 0.7.15 + * The version of the OpenAPI document: 0.7.16 * * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). diff --git a/src/infrastructure/model/transactionPayload.ts b/src/infrastructure/model/transactionPayload.ts index dcd42913a6..ff83fbb12a 100644 --- a/src/infrastructure/model/transactionPayload.ts +++ b/src/infrastructure/model/transactionPayload.ts @@ -14,10 +14,10 @@ * limitations under the License. */ /** - * Catapult REST API Reference + * Catapult REST Endpoints * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) * - * The version of the OpenAPI document: 0.7.15 + * The version of the OpenAPI document: 0.7.16 * * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). diff --git a/src/infrastructure/model/transactionStatementDTO.ts b/src/infrastructure/model/transactionStatementDTO.ts index 999e49a2e2..7f0a9959e9 100644 --- a/src/infrastructure/model/transactionStatementDTO.ts +++ b/src/infrastructure/model/transactionStatementDTO.ts @@ -14,10 +14,10 @@ * limitations under the License. */ /** - * Catapult REST API Reference + * Catapult REST Endpoints * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) * - * The version of the OpenAPI document: 0.7.15 + * The version of the OpenAPI document: 0.7.16 * * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). diff --git a/src/infrastructure/model/transactionStatusDTO.ts b/src/infrastructure/model/transactionStatusDTO.ts index 69d24befd9..8ae13588c0 100644 --- a/src/infrastructure/model/transactionStatusDTO.ts +++ b/src/infrastructure/model/transactionStatusDTO.ts @@ -14,10 +14,10 @@ * limitations under the License. */ /** - * Catapult REST API Reference + * Catapult REST Endpoints * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) * - * The version of the OpenAPI document: 0.7.15 + * The version of the OpenAPI document: 0.7.16 * * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). diff --git a/src/infrastructure/schemas/AccountPropertiesAddressModificationTransactionSchema.ts b/src/infrastructure/schemas/AccountRestrictionsAddressModificationTransactionSchema.ts similarity index 87% rename from src/infrastructure/schemas/AccountPropertiesAddressModificationTransactionSchema.ts rename to src/infrastructure/schemas/AccountRestrictionsAddressModificationTransactionSchema.ts index 288fb34f23..f08fd0cda3 100644 --- a/src/infrastructure/schemas/AccountPropertiesAddressModificationTransactionSchema.ts +++ b/src/infrastructure/schemas/AccountRestrictionsAddressModificationTransactionSchema.ts @@ -24,11 +24,11 @@ import { } from './Schema'; /** - * @module schema/AccountPropertiesAddressModificationTransactionSchema + * @module schema/AccountRestrictionsAddressModificationTransactionSchema */ /** - * Account properties address transaction schema + * Account restriction address transaction schema * @const {module:schema/Schema} */ export default new Schema([ @@ -39,7 +39,7 @@ export default new Schema([ ushort('type'), array('fee', TypeSize.INT), array('deadline', TypeSize.INT), - ubyte('propertyType'), + ubyte('restrictionType'), ubyte('modificationCount'), tableArray('modifications', [ ubyte('modificationType'), diff --git a/src/infrastructure/schemas/AccountPropertiesEntityTypeModificationTransactionSchema.ts b/src/infrastructure/schemas/AccountRestrictionsEntityTypeModificationTransactionSchema.ts similarity index 87% rename from src/infrastructure/schemas/AccountPropertiesEntityTypeModificationTransactionSchema.ts rename to src/infrastructure/schemas/AccountRestrictionsEntityTypeModificationTransactionSchema.ts index 5c2373b1cc..6d9090a5c0 100644 --- a/src/infrastructure/schemas/AccountPropertiesEntityTypeModificationTransactionSchema.ts +++ b/src/infrastructure/schemas/AccountRestrictionsEntityTypeModificationTransactionSchema.ts @@ -24,11 +24,11 @@ import { } from './Schema'; /** - * @module schema/AccountPropertiesEntityTypeModificationTransactionSchema + * @module schema/AccountRestrictionsEntityTypeModificationTransactionSchema */ /** - * Account properties address transaction schema + * Account restrictions address transaction schema * @const {module:schema/Schema} */ export default new Schema([ @@ -39,7 +39,7 @@ export default new Schema([ ushort('type'), array('fee', TypeSize.INT), array('deadline', TypeSize.INT), - ubyte('propertyType'), + ubyte('restrictionType'), ubyte('modificationCount'), tableArray('modifications', [ ubyte('modificationType'), diff --git a/src/infrastructure/schemas/AccountPropertiesMosaicModificationTransactionSchema.ts b/src/infrastructure/schemas/AccountRestrictionsMosaicModificationTransactionSchema.ts similarity index 87% rename from src/infrastructure/schemas/AccountPropertiesMosaicModificationTransactionSchema.ts rename to src/infrastructure/schemas/AccountRestrictionsMosaicModificationTransactionSchema.ts index ce323b9e8c..557c38898e 100644 --- a/src/infrastructure/schemas/AccountPropertiesMosaicModificationTransactionSchema.ts +++ b/src/infrastructure/schemas/AccountRestrictionsMosaicModificationTransactionSchema.ts @@ -24,11 +24,11 @@ import { } from './Schema'; /** - * @module schema/AccountPropertiesMosaicModificationTransactionSchema + * @module schema/AccountRestrictionsMosaicModificationTransactionSchema */ /** - * Account properties address transaction schema + * Account restrictions address transaction schema * @const {module:schema/Schema} */ export default new Schema([ @@ -39,7 +39,7 @@ export default new Schema([ ushort('type'), array('fee', TypeSize.INT), array('deadline', TypeSize.INT), - ubyte('propertyType'), + ubyte('restrictionType'), ubyte('modificationCount'), tableArray('modifications', [ ubyte('modificationType'), diff --git a/src/infrastructure/transaction/CreateTransactionFromDTO.ts b/src/infrastructure/transaction/CreateTransactionFromDTO.ts index eb6c258a62..aa094d8499 100644 --- a/src/infrastructure/transaction/CreateTransactionFromDTO.ts +++ b/src/infrastructure/transaction/CreateTransactionFromDTO.ts @@ -25,7 +25,7 @@ import {MosaicProperties} from '../../model/mosaic/MosaicProperties'; import { MosaicPropertyType } from '../../model/mosaic/MosaicPropertyType'; import {NamespaceId} from '../../model/namespace/NamespaceId'; import { AccountLinkTransaction } from '../../model/transaction/AccountLinkTransaction'; -import {AccountPropertyModification} from '../../model/transaction/AccountPropertyModification'; +import {AccountRestrictionModification} from '../../model/transaction/AccountRestrictionModification'; import {AddressAliasTransaction} from '../../model/transaction/AddressAliasTransaction'; import {AggregateTransaction} from '../../model/transaction/AggregateTransaction'; import {AggregateTransactionCosignature} from '../../model/transaction/AggregateTransactionCosignature'; @@ -34,9 +34,9 @@ import {Deadline} from '../../model/transaction/Deadline'; import { EncryptedMessage } from '../../model/transaction/EncryptedMessage'; import {LockFundsTransaction} from '../../model/transaction/LockFundsTransaction'; import { MessageType } from '../../model/transaction/MessageType'; -import {ModifyAccountPropertyAddressTransaction} from '../../model/transaction/ModifyAccountPropertyAddressTransaction'; -import {ModifyAccountPropertyEntityTypeTransaction} from '../../model/transaction/ModifyAccountPropertyEntityTypeTransaction'; -import {ModifyAccountPropertyMosaicTransaction} from '../../model/transaction/ModifyAccountPropertyMosaicTransaction'; +import {AccountAddressRestrictionModificationTransaction} from '../../model/transaction/AccountAddressRestrictionModificationTransaction'; +import {AccountOperationRestrictionModificationTransaction} from '../../model/transaction/AccountOperationRestrictionModificationTransaction'; +import {AccountMosaicRestrictionModificationTransaction} from '../../model/transaction/AccountMosaicRestrictionModificationTransaction'; import {ModifyMultisigAccountTransaction} from '../../model/transaction/ModifyMultisigAccountTransaction'; import {MosaicAliasTransaction} from '../../model/transaction/MosaicAliasTransaction'; import {MosaicDefinitionTransaction} from '../../model/transaction/MosaicDefinitionTransaction'; @@ -276,14 +276,14 @@ const CreateStandaloneTransactionFromDTO = (transactionDTO, transactionInfo): Tr extractNetworkType(transactionDTO.version)) : undefined, transactionInfo, ); - } else if (transactionDTO.type === TransactionType.MODIFY_ACCOUNT_PROPERTY_ADDRESS) { - return new ModifyAccountPropertyAddressTransaction( + } else if (transactionDTO.type === TransactionType.MODIFY_ACCOUNT_RESTRICTION_ADDRESS) { + return new AccountAddressRestrictionModificationTransaction( extractNetworkType(transactionDTO.version), extractTransactionVersion(transactionDTO.version), Deadline.createFromDTO(transactionDTO.deadline), new UInt64(transactionDTO.maxFee || [0, 0]), - transactionDTO.propertyType, - transactionDTO.modifications ? transactionDTO.modifications.map((modificationDTO) => new AccountPropertyModification( + transactionDTO.restrictionType, + transactionDTO.modifications ? transactionDTO.modifications.map((modificationDTO) => new AccountRestrictionModification( modificationDTO.type, modificationDTO.value, )) : [], @@ -292,14 +292,14 @@ const CreateStandaloneTransactionFromDTO = (transactionDTO, transactionInfo): Tr extractNetworkType(transactionDTO.version)) : undefined, transactionInfo, ); - } else if (transactionDTO.type === TransactionType.MODIFY_ACCOUNT_PROPERTY_ENTITY_TYPE) { - return new ModifyAccountPropertyEntityTypeTransaction( + } else if (transactionDTO.type === TransactionType.MODIFY_ACCOUNT_RESTRICTION_OPERATION) { + return new AccountOperationRestrictionModificationTransaction( extractNetworkType(transactionDTO.version), extractTransactionVersion(transactionDTO.version), Deadline.createFromDTO(transactionDTO.deadline), new UInt64(transactionDTO.maxFee || [0, 0]), - transactionDTO.propertyType, - transactionDTO.modifications ? transactionDTO.modifications.map((modificationDTO) => new AccountPropertyModification( + transactionDTO.restrictionType, + transactionDTO.modifications ? transactionDTO.modifications.map((modificationDTO) => new AccountRestrictionModification( modificationDTO.type, modificationDTO.value, )) : [], @@ -308,14 +308,14 @@ const CreateStandaloneTransactionFromDTO = (transactionDTO, transactionInfo): Tr extractNetworkType(transactionDTO.version)) : undefined, transactionInfo, ); - } else if (transactionDTO.type === TransactionType.MODIFY_ACCOUNT_PROPERTY_MOSAIC) { - return new ModifyAccountPropertyMosaicTransaction( + } else if (transactionDTO.type === TransactionType.MODIFY_ACCOUNT_RESTRICTION_MOSAIC) { + return new AccountMosaicRestrictionModificationTransaction( extractNetworkType(transactionDTO.version), extractTransactionVersion(transactionDTO.version), Deadline.createFromDTO(transactionDTO.deadline), new UInt64(transactionDTO.maxFee || [0, 0]), - transactionDTO.propertyType, - transactionDTO.modifications ? transactionDTO.modifications.map((modificationDTO) => new AccountPropertyModification( + transactionDTO.restrictionType, + transactionDTO.modifications ? transactionDTO.modifications.map((modificationDTO) => new AccountRestrictionModification( modificationDTO.type, modificationDTO.value, )) : [], diff --git a/src/infrastructure/transaction/CreateTransactionFromPayload.ts b/src/infrastructure/transaction/CreateTransactionFromPayload.ts index c042e778e7..2759ad3f3c 100644 --- a/src/infrastructure/transaction/CreateTransactionFromPayload.ts +++ b/src/infrastructure/transaction/CreateTransactionFromPayload.ts @@ -26,7 +26,7 @@ import { MosaicProperties } from '../../model/mosaic/MosaicProperties'; import { NamespaceId } from '../../model/namespace/NamespaceId'; import { NamespaceType } from '../../model/namespace/NamespaceType'; import { AccountLinkTransaction } from '../../model/transaction/AccountLinkTransaction'; -import { AccountPropertyModification } from '../../model/transaction/AccountPropertyModification'; +import { AccountRestrictionModification } from '../../model/transaction/AccountRestrictionModification'; import { AddressAliasTransaction } from '../../model/transaction/AddressAliasTransaction'; import { AggregateTransaction } from '../../model/transaction/AggregateTransaction'; import { AggregateTransactionCosignature } from '../../model/transaction/AggregateTransactionCosignature'; @@ -36,9 +36,9 @@ import { HashType } from '../../model/transaction/HashType'; import { LockFundsTransaction } from '../../model/transaction/LockFundsTransaction'; import { Message } from '../../model/transaction/Message'; import { MessageType } from '../../model/transaction/MessageType'; -import { ModifyAccountPropertyAddressTransaction } from '../../model/transaction/ModifyAccountPropertyAddressTransaction'; -import { ModifyAccountPropertyEntityTypeTransaction } from '../../model/transaction/ModifyAccountPropertyEntityTypeTransaction'; -import { ModifyAccountPropertyMosaicTransaction } from '../../model/transaction/ModifyAccountPropertyMosaicTransaction'; +import { AccountAddressRestrictionModificationTransaction } from '../../model/transaction/AccountAddressRestrictionModificationTransaction'; +import { AccountOperationRestrictionModificationTransaction } from '../../model/transaction/AccountOperationRestrictionModificationTransaction'; +import { AccountMosaicRestrictionModificationTransaction } from '../../model/transaction/AccountMosaicRestrictionModificationTransaction'; import { ModifyMultisigAccountTransaction } from '../../model/transaction/ModifyMultisigAccountTransaction'; import { MosaicAliasTransaction } from '../../model/transaction/MosaicAliasTransaction'; import { MosaicDefinitionTransaction } from '../../model/transaction/MosaicDefinitionTransaction'; @@ -98,9 +98,9 @@ export const CreateTransactionFromPayload = (transactionBinary: string): Transac */ const CreateTransaction = (type: number, transactionData: string, networkType: NetworkType, deadline: number[]): Transaction => { switch (type) { - case TransactionType.MODIFY_ACCOUNT_PROPERTY_ADDRESS: - case TransactionType.MODIFY_ACCOUNT_PROPERTY_ENTITY_TYPE: - case TransactionType.MODIFY_ACCOUNT_PROPERTY_MOSAIC: + case TransactionType.MODIFY_ACCOUNT_RESTRICTION_ADDRESS: + case TransactionType.MODIFY_ACCOUNT_RESTRICTION_OPERATION: + case TransactionType.MODIFY_ACCOUNT_RESTRICTION_MOSAIC: const propertyTypeLength = 2; const modificationCountOffset = propertyTypeLength; @@ -112,32 +112,32 @@ const CreateTransaction = (type: number, transactionData: string, networkType: N const modificationArray = modifications.match(/.{1,52}/g); switch (type) { - case TransactionType.MODIFY_ACCOUNT_PROPERTY_ADDRESS: - const t = ModifyAccountPropertyAddressTransaction.create( + case TransactionType.MODIFY_ACCOUNT_RESTRICTION_ADDRESS: + const t = AccountAddressRestrictionModificationTransaction.create( Deadline.createFromDTO(deadline), parseInt(convert.uint8ToHex(convert.hexToUint8(propertyType).reverse()), 16), - modificationArray ? modificationArray.map((modification) => new AccountPropertyModification( + modificationArray ? modificationArray.map((modification) => new AccountRestrictionModification( parseInt(convert.uint8ToHex(convert.hexToUint8(modification.substring(0, 2)).reverse()), 16), Address.createFromEncoded(modification.substring(2, modification.length)).plain(), )) : [], networkType, ); return t; - case TransactionType.MODIFY_ACCOUNT_PROPERTY_MOSAIC: - return ModifyAccountPropertyMosaicTransaction.create( + case TransactionType.MODIFY_ACCOUNT_RESTRICTION_MOSAIC: + return AccountMosaicRestrictionModificationTransaction.create( Deadline.createFromDTO(deadline), parseInt(convert.uint8ToHex(convert.hexToUint8(propertyType).reverse()), 16), - modificationArray ? modificationArray.map((modification) => new AccountPropertyModification( + modificationArray ? modificationArray.map((modification) => new AccountRestrictionModification( parseInt(convert.uint8ToHex(convert.hexToUint8(modification.substring(0, 2)).reverse()), 16), UInt64.fromHex(reverse(modification.substring(2, modification.length))).toDTO(), )) : [], networkType, ); - case TransactionType.MODIFY_ACCOUNT_PROPERTY_ENTITY_TYPE: - return ModifyAccountPropertyEntityTypeTransaction.create( + case TransactionType.MODIFY_ACCOUNT_RESTRICTION_OPERATION: + return AccountOperationRestrictionModificationTransaction.create( Deadline.createFromDTO(deadline), parseInt(convert.uint8ToHex(convert.hexToUint8(propertyType).reverse()), 16), - modificationArray ? modificationArray.map((modification) => new AccountPropertyModification( + modificationArray ? modificationArray.map((modification) => new AccountRestrictionModification( parseInt(convert.uint8ToHex(convert.hexToUint8(modification.substring(0, 2)).reverse()), 16), parseInt(convert.uint8ToHex(convert.hexToUint8( modification.substring(2, modification.length)).reverse()), 16), @@ -145,7 +145,7 @@ const CreateTransaction = (type: number, transactionData: string, networkType: N networkType, ); } - throw new Error ('Account property transaction type not recognised.'); + throw new Error ('Account restriction transaction type not recognised.'); case TransactionType.LINK_ACCOUNT: // read bytes const remoteAccountKey = transactionData.substring(0, 64); diff --git a/src/infrastructure/transaction/SerializeTransactionToJSON.ts b/src/infrastructure/transaction/SerializeTransactionToJSON.ts index b3245a0ca8..c73bd0bd93 100644 --- a/src/infrastructure/transaction/SerializeTransactionToJSON.ts +++ b/src/infrastructure/transaction/SerializeTransactionToJSON.ts @@ -18,9 +18,9 @@ import { AccountLinkTransaction } from '../../model/transaction/AccountLinkTrans import { AddressAliasTransaction } from '../../model/transaction/AddressAliasTransaction'; import { AggregateTransaction } from '../../model/transaction/AggregateTransaction'; import { LockFundsTransaction } from '../../model/transaction/LockFundsTransaction'; -import { ModifyAccountPropertyAddressTransaction } from '../../model/transaction/ModifyAccountPropertyAddressTransaction'; -import { ModifyAccountPropertyEntityTypeTransaction } from '../../model/transaction/ModifyAccountPropertyEntityTypeTransaction'; -import { ModifyAccountPropertyMosaicTransaction } from '../../model/transaction/ModifyAccountPropertyMosaicTransaction'; +import { AccountAddressRestrictionModificationTransaction } from '../../model/transaction/AccountAddressRestrictionModificationTransaction'; +import { AccountOperationRestrictionModificationTransaction } from '../../model/transaction/AccountOperationRestrictionModificationTransaction'; +import { AccountMosaicRestrictionModificationTransaction } from '../../model/transaction/AccountMosaicRestrictionModificationTransaction'; import { ModifyMultisigAccountTransaction } from '../../model/transaction/ModifyMultisigAccountTransaction'; import { MosaicAliasTransaction } from '../../model/transaction/MosaicAliasTransaction'; import { MosaicDefinitionTransaction } from '../../model/transaction/MosaicDefinitionTransaction'; @@ -68,26 +68,26 @@ export const SerializeTransactionToJSON = (transaction: Transaction): any => { duration: (transaction as LockFundsTransaction).duration.toDTO(), hash: (transaction as LockFundsTransaction).hash, }; - case TransactionType.MODIFY_ACCOUNT_PROPERTY_ADDRESS: + case TransactionType.MODIFY_ACCOUNT_RESTRICTION_ADDRESS: return { - propertyType: (transaction as ModifyAccountPropertyAddressTransaction).propertyType, - modifications: (transaction as ModifyAccountPropertyAddressTransaction). + restrictionType: (transaction as AccountAddressRestrictionModificationTransaction).restrictionType, + modifications: (transaction as AccountAddressRestrictionModificationTransaction). modifications.map((modification) => { return modification.toDTO(); }), }; - case TransactionType.MODIFY_ACCOUNT_PROPERTY_ENTITY_TYPE: + case TransactionType.MODIFY_ACCOUNT_RESTRICTION_OPERATION: return { - propertyType: (transaction as ModifyAccountPropertyEntityTypeTransaction).propertyType, - modifications: (transaction as ModifyAccountPropertyEntityTypeTransaction). + restrictionType: (transaction as AccountOperationRestrictionModificationTransaction).restrictionType, + modifications: (transaction as AccountOperationRestrictionModificationTransaction). modifications.map((modification) => { return modification.toDTO(); }), }; - case TransactionType.MODIFY_ACCOUNT_PROPERTY_MOSAIC: + case TransactionType.MODIFY_ACCOUNT_RESTRICTION_MOSAIC: return { - propertyType: (transaction as ModifyAccountPropertyMosaicTransaction).propertyType, - modifications: (transaction as ModifyAccountPropertyMosaicTransaction).modifications.map((modification) => { + restrictionType: (transaction as AccountMosaicRestrictionModificationTransaction).restrictionType, + modifications: (transaction as AccountMosaicRestrictionModificationTransaction).modifications.map((modification) => { return modification.toDTO(); }), }; diff --git a/src/model/account/AccountProperty.ts b/src/model/account/AccountRestriction.ts similarity index 71% rename from src/model/account/AccountProperty.ts rename to src/model/account/AccountRestriction.ts index 96774e1b9f..7eb6928f11 100644 --- a/src/model/account/AccountProperty.ts +++ b/src/model/account/AccountRestriction.ts @@ -14,24 +14,24 @@ * limitations under the License. */ -import { PropertyType } from './PropertyType'; +import { RestrictionType } from './RestrictionType'; /** - * Account property structure describes property information. + * Account restriction structure describes restriction information. */ -export class AccountProperty { +export class AccountRestriction { /** * Constructor - * @param propertyType + * @param restrictionType * @param values */ constructor( /** - * Account property type + * Account restriction type */ - public readonly propertyType: PropertyType, + public readonly restrictionType: RestrictionType, /** - * Property values. + * Restriction values. */ public readonly values: object[]) { diff --git a/src/model/account/AccountProperties.ts b/src/model/account/AccountRestrictions.ts similarity index 74% rename from src/model/account/AccountProperties.ts rename to src/model/account/AccountRestrictions.ts index 80035e71e8..419f174166 100644 --- a/src/model/account/AccountProperties.ts +++ b/src/model/account/AccountRestrictions.ts @@ -13,17 +13,17 @@ * See the License for the specific language governing permissions and * limitations under the License. */ -import { AccountProperty } from './AccountProperty'; +import { AccountRestriction } from './AccountRestriction'; import { Address } from './Address'; /** - * Account properties structure describes property information for an account. + * Account restrictions structure describes restriction information for an account. */ -export class AccountProperties { +export class AccountRestrictions { /** * Constructor * @param address - * @param properties + * @param restrictions */ constructor( /** @@ -31,9 +31,9 @@ export class AccountProperties { */ public readonly address: Address, /** - * Properties. + * Restrictions. */ - public readonly properties: AccountProperty[]) { + public readonly restrictions: AccountRestriction[]) { } } diff --git a/src/model/account/AccountPropertiesInfo.ts b/src/model/account/AccountRestrictionsInfo.ts similarity index 71% rename from src/model/account/AccountPropertiesInfo.ts rename to src/model/account/AccountRestrictionsInfo.ts index b1c3040968..5e6de8a8ba 100644 --- a/src/model/account/AccountPropertiesInfo.ts +++ b/src/model/account/AccountRestrictionsInfo.ts @@ -13,16 +13,16 @@ * See the License for the specific language governing permissions and * limitations under the License. */ -import { AccountProperties } from './AccountProperties'; +import { AccountRestrictions } from './AccountRestrictions'; /** - * Account properties structure describes property information for an account. + * Account restrictions structure describes restriction information for an account. */ -export class AccountPropertiesInfo { +export class AccountRestrictionsInfo { /** * Constructor * @param meta - * @param accountProperties + * @param accountRestrictions */ constructor( /** @@ -30,9 +30,9 @@ export class AccountPropertiesInfo { */ public readonly meta: any, /** - * Properties. + * Restrictions. */ - public readonly accountProperties: AccountProperties) { + public readonly accountRestrictions: AccountRestrictions) { } } diff --git a/src/model/account/PropertyModificationType.ts b/src/model/account/RestrictionModificationType.ts similarity index 88% rename from src/model/account/PropertyModificationType.ts rename to src/model/account/RestrictionModificationType.ts index 6ba3b7d9db..b4aabd8151 100644 --- a/src/model/account/PropertyModificationType.ts +++ b/src/model/account/RestrictionModificationType.ts @@ -15,9 +15,9 @@ */ /** - * Account property modification type + * Account restriction modification type */ -export enum PropertyModificationType { +export enum RestrictionModificationType { Add = 0x00, Remove = 0x01, } diff --git a/src/model/account/PropertyType.ts b/src/model/account/RestrictionType.ts similarity index 72% rename from src/model/account/PropertyType.ts rename to src/model/account/RestrictionType.ts index 1b13f72113..aa7d236ed0 100644 --- a/src/model/account/PropertyType.ts +++ b/src/model/account/RestrictionType.ts @@ -15,15 +15,15 @@ */ /** - * Account property type - * 0x01 The property type is an address. - * 0x02 The property type is mosaic id. - * 0x03 The property type is a transaction type. - * 0x04 Property type sentinel. - * 0x80 + type The property is interpreted as a blocking operation. + * Account restriction type + * 0x01 The restriction type is an address. + * 0x02 The restriction type is mosaic id. + * 0x03 The restriction type is a transaction type. + * 0x04 restriction type sentinel. + * 0x80 + type The restriction is interpreted as a blocking operation. */ -export enum PropertyType { +export enum RestrictionType { AllowAddress = 0x01, AllowMosaic = 0x02, AllowTransaction = 0x04, diff --git a/src/model/model.ts b/src/model/model.ts index 47c8471340..62bb27f331 100644 --- a/src/model/model.ts +++ b/src/model/model.ts @@ -24,11 +24,11 @@ export * from './account/Address'; export * from './account/MultisigAccountGraphInfo'; export * from './account/MultisigAccountInfo'; export * from './account/PublicAccount'; -export * from './account/AccountProperties'; -export * from './account/AccountPropertiesInfo'; -export * from './account/AccountProperty'; -export * from './account/PropertyModificationType'; -export * from './account/PropertyType'; +export * from './account/AccountRestrictions'; +export * from './account/AccountRestrictionsInfo'; +export * from './account/AccountRestriction'; +export * from './account/RestrictionModificationType'; +export * from './account/RestrictionType'; export * from './account/AccountNames'; // Blockchain @@ -91,11 +91,11 @@ export * from './receipt/Statement'; // Transaction export * from './transaction/AccountLinkTransaction'; -export * from './transaction/AccountPropertyTransaction'; -export * from './transaction/ModifyAccountPropertyAddressTransaction'; -export * from './transaction/ModifyAccountPropertyEntityTypeTransaction'; -export * from './transaction/ModifyAccountPropertyMosaicTransaction'; -export * from './transaction/AccountPropertyModification'; +export * from './transaction/AccountRestrictionTransaction'; +export * from './transaction/AccountAddressRestrictionModificationTransaction'; +export * from './transaction/AccountOperationRestrictionModificationTransaction'; +export * from './transaction/AccountMosaicRestrictionModificationTransaction'; +export * from './transaction/AccountRestrictionModification'; export * from './transaction/AddressAliasTransaction'; export * from './transaction/AggregateTransaction'; export * from './transaction/AggregateTransactionCosignature'; diff --git a/src/model/transaction/ModifyAccountPropertyAddressTransaction.ts b/src/model/transaction/AccountAddressRestrictionModificationTransaction.ts similarity index 63% rename from src/model/transaction/ModifyAccountPropertyAddressTransaction.ts rename to src/model/transaction/AccountAddressRestrictionModificationTransaction.ts index 4cfa610839..3a9d99f813 100644 --- a/src/model/transaction/ModifyAccountPropertyAddressTransaction.ts +++ b/src/model/transaction/AccountAddressRestrictionModificationTransaction.ts @@ -14,40 +14,40 @@ * limitations under the License. */ -import { Builder } from '../../infrastructure/builders/AccountPropertiesAddressTransaction'; +import { Builder } from '../../infrastructure/builders/AccountRestrictionsAddressTransaction'; import {VerifiableTransaction} from '../../infrastructure/builders/VerifiableTransaction'; -import { PropertyType } from '../account/PropertyType'; import { PublicAccount } from '../account/PublicAccount'; +import { RestrictionType } from '../account/RestrictionType'; import { NetworkType } from '../blockchain/NetworkType'; import { UInt64 } from '../UInt64'; -import { AccountPropertyModification } from './AccountPropertyModification'; +import { AccountRestrictionModification } from './AccountRestrictionModification'; import { Deadline } from './Deadline'; import { Transaction } from './Transaction'; import { TransactionInfo } from './TransactionInfo'; import { TransactionType } from './TransactionType'; import { TransactionVersion } from './TransactionVersion'; -export class ModifyAccountPropertyAddressTransaction extends Transaction { +export class AccountAddressRestrictionModificationTransaction extends Transaction { /** - * Create a modify account property address transaction object + * Create a modify account address restriction transaction object * @param deadline - The deadline to include the transaction. - * @param propertyType - The account property type. + * @param restrictionType - The account restriction type. * @param modifications - The array of modifications. * @param networkType - The network type. * @param maxFee - (Optional) Max fee defined by the sender - * @returns {ModifyAccountPropertyAddressTransaction} + * @returns {AccountAddressRestrictionModificationTransaction} */ public static create(deadline: Deadline, - propertyType: PropertyType, - modifications: Array>, + restrictionType: RestrictionType, + modifications: Array>, networkType: NetworkType, - maxFee: UInt64 = new UInt64([0, 0])): ModifyAccountPropertyAddressTransaction { - return new ModifyAccountPropertyAddressTransaction(networkType, - TransactionVersion.MODIFY_ACCOUNT_PROPERTY_ADDRESS, + maxFee: UInt64 = new UInt64([0, 0])): AccountAddressRestrictionModificationTransaction { + return new AccountAddressRestrictionModificationTransaction(networkType, + TransactionVersion.MODIFY_ACCOUNT_RESTRICTION_ADDRESS, deadline, maxFee, - propertyType, + restrictionType, modifications); } @@ -56,8 +56,7 @@ export class ModifyAccountPropertyAddressTransaction extends Transaction { * @param version * @param deadline * @param maxFee - * @param minApprovalDelta - * @param minRemovalDelta + * @param restrictionType * @param modifications * @param signature * @param signer @@ -67,25 +66,26 @@ export class ModifyAccountPropertyAddressTransaction extends Transaction { version: number, deadline: Deadline, maxFee: UInt64, - public readonly propertyType: PropertyType, - public readonly modifications: Array>, + public readonly restrictionType: RestrictionType, + public readonly modifications: Array>, signature?: string, signer?: PublicAccount, transactionInfo?: TransactionInfo) { - super(TransactionType.MODIFY_ACCOUNT_PROPERTY_ADDRESS, networkType, version, deadline, maxFee, signature, signer, transactionInfo); + super(TransactionType.MODIFY_ACCOUNT_RESTRICTION_ADDRESS, + networkType, version, deadline, maxFee, signature, signer, transactionInfo); } /** * @override Transaction.size() - * @description get the byte size of a ModifyAccountPropertyAddressTransaction + * @description get the byte size of a AccountAddressRestrictionModificationTransaction * @returns {number} - * @memberof ModifyAccountPropertyAddressTransaction + * @memberof AccountAddressRestrictionModificationTransaction */ public get size(): number { const byteSize = super.size; // set static byte size fields - const bytePropertyType = 1; + const byteRestrictionType = 1; const byteModificationCount = 1; // each modification contains : @@ -93,7 +93,7 @@ export class ModifyAccountPropertyAddressTransaction extends Transaction { // - 25 bytes for the modification value (address) const byteModifications = 26 * this.modifications.length; - return byteSize + bytePropertyType + byteModificationCount + byteModifications; + return byteSize + byteRestrictionType + byteModificationCount + byteModifications; } /** @@ -105,7 +105,7 @@ export class ModifyAccountPropertyAddressTransaction extends Transaction { .addDeadline(this.deadline.toDTO()) .addFee(this.maxFee.toDTO()) .addVersion(this.versionToDTO()) - .addPropertyType(this.propertyType) + .addRestrictionType(this.restrictionType) .addModifications(this.modifications.map((modification) => modification.toDTO())) .build(); } diff --git a/src/model/transaction/ModifyAccountPropertyMosaicTransaction.ts b/src/model/transaction/AccountMosaicRestrictionModificationTransaction.ts similarity index 63% rename from src/model/transaction/ModifyAccountPropertyMosaicTransaction.ts rename to src/model/transaction/AccountMosaicRestrictionModificationTransaction.ts index 1ec9770ae7..3a32656795 100644 --- a/src/model/transaction/ModifyAccountPropertyMosaicTransaction.ts +++ b/src/model/transaction/AccountMosaicRestrictionModificationTransaction.ts @@ -14,40 +14,40 @@ * limitations under the License. */ -import { Builder } from '../../infrastructure/builders/AccountPropertiesMosaicTransaction'; +import { Builder } from '../../infrastructure/builders/AccountRestrictionsMosaicTransaction'; import {VerifiableTransaction} from '../../infrastructure/builders/VerifiableTransaction'; -import { PropertyType } from '../account/PropertyType'; import { PublicAccount } from '../account/PublicAccount'; +import { RestrictionType } from '../account/RestrictionType'; import { NetworkType } from '../blockchain/NetworkType'; import { UInt64 } from '../UInt64'; -import { AccountPropertyModification } from './AccountPropertyModification'; +import { AccountRestrictionModification } from './AccountRestrictionModification'; import { Deadline } from './Deadline'; import { Transaction } from './Transaction'; import { TransactionInfo } from './TransactionInfo'; import { TransactionType } from './TransactionType'; import { TransactionVersion } from './TransactionVersion'; -export class ModifyAccountPropertyMosaicTransaction extends Transaction { +export class AccountMosaicRestrictionModificationTransaction extends Transaction { /** - * Create a modify account property mosaic transaction object + * Create a modify account mosaic restriction transaction object * @param deadline - The deadline to include the transaction. - * @param propertyType - The account property type. + * @param restrictionType - The account restriction type. * @param modifications - The array of modifications. * @param networkType - The network type. * @param maxFee - (Optional) Max fee defined by the sender - * @returns {ModifyAccountPropertyAddressTransaction} + * @returns {AccountAddressRestrictionModificationTransaction} */ public static create(deadline: Deadline, - propertyType: PropertyType, - modifications: Array>, + restrictionType: RestrictionType, + modifications: Array>, networkType: NetworkType, - maxFee: UInt64 = new UInt64([0, 0])): ModifyAccountPropertyMosaicTransaction { - return new ModifyAccountPropertyMosaicTransaction(networkType, - TransactionVersion.MODIFY_ACCOUNT_PROPERTY_MOSAIC, + maxFee: UInt64 = new UInt64([0, 0])): AccountMosaicRestrictionModificationTransaction { + return new AccountMosaicRestrictionModificationTransaction(networkType, + TransactionVersion.MODIFY_ACCOUNT_RESTRICTION_MOSAIC, deadline, maxFee, - propertyType, + restrictionType, modifications); } @@ -56,8 +56,7 @@ export class ModifyAccountPropertyMosaicTransaction extends Transaction { * @param version * @param deadline * @param maxFee - * @param minApprovalDelta - * @param minRemovalDelta + * @param restrictionType * @param modifications * @param signature * @param signer @@ -67,25 +66,26 @@ export class ModifyAccountPropertyMosaicTransaction extends Transaction { version: number, deadline: Deadline, maxFee: UInt64, - public readonly propertyType: PropertyType, - public readonly modifications: Array>, + public readonly restrictionType: RestrictionType, + public readonly modifications: Array>, signature?: string, signer?: PublicAccount, transactionInfo?: TransactionInfo) { - super(TransactionType.MODIFY_ACCOUNT_PROPERTY_MOSAIC, networkType, version, deadline, maxFee, signature, signer, transactionInfo); + super(TransactionType.MODIFY_ACCOUNT_RESTRICTION_MOSAIC, + networkType, version, deadline, maxFee, signature, signer, transactionInfo); } /** * @override Transaction.size() - * @description get the byte size of a ModifyAccountPropertyMosaicTransaction + * @description get the byte size of a AccountMosaicRestrictionModificationTransaction * @returns {number} - * @memberof ModifyAccountPropertyMosaicTransaction + * @memberof AccountMosaicRestrictionModificationTransaction */ public get size(): number { const byteSize = super.size; // set static byte size fields - const bytePropertyType = 1; + const byteRestrictionType = 1; const byteModificationCount = 1; // each modification contains : @@ -93,7 +93,7 @@ export class ModifyAccountPropertyMosaicTransaction extends Transaction { // - 8 bytes for the modification value (mosaicId) const byteModifications = 9 * this.modifications.length; - return byteSize + bytePropertyType + byteModificationCount + byteModifications; + return byteSize + byteRestrictionType + byteModificationCount + byteModifications; } /** @@ -105,7 +105,7 @@ export class ModifyAccountPropertyMosaicTransaction extends Transaction { .addDeadline(this.deadline.toDTO()) .addFee(this.maxFee.toDTO()) .addVersion(this.versionToDTO()) - .addPropertyType(this.propertyType) + .addRestrictionType(this.restrictionType) .addModifications(this.modifications.map((modification) => modification.toDTO())) .build(); } diff --git a/src/model/transaction/ModifyAccountPropertyEntityTypeTransaction.ts b/src/model/transaction/AccountOperationRestrictionModificationTransaction.ts similarity index 62% rename from src/model/transaction/ModifyAccountPropertyEntityTypeTransaction.ts rename to src/model/transaction/AccountOperationRestrictionModificationTransaction.ts index a49c4873a9..38160cc79d 100644 --- a/src/model/transaction/ModifyAccountPropertyEntityTypeTransaction.ts +++ b/src/model/transaction/AccountOperationRestrictionModificationTransaction.ts @@ -14,40 +14,40 @@ * limitations under the License. */ -import { Builder } from '../../infrastructure/builders/AccountPropertiesEntityTypeTransaction'; +import { Builder } from '../../infrastructure/builders/AccountRestrictionsEntityTypeTransaction'; import {VerifiableTransaction} from '../../infrastructure/builders/VerifiableTransaction'; -import { PropertyType } from '../account/PropertyType'; import { PublicAccount } from '../account/PublicAccount'; +import { RestrictionType } from '../account/RestrictionType'; import { NetworkType } from '../blockchain/NetworkType'; import { UInt64 } from '../UInt64'; -import { AccountPropertyModification } from './AccountPropertyModification'; +import { AccountRestrictionModification } from './AccountRestrictionModification'; import { Deadline } from './Deadline'; import { Transaction } from './Transaction'; import { TransactionInfo } from './TransactionInfo'; import { TransactionType } from './TransactionType'; import { TransactionVersion } from './TransactionVersion'; -export class ModifyAccountPropertyEntityTypeTransaction extends Transaction { +export class AccountOperationRestrictionModificationTransaction extends Transaction { /** - * Create a modify account property entity type transaction object + * Create a modify account operation restriction type transaction object * @param deadline - The deadline to include the transaction. - * @param propertyType - The account property type. + * @param restrictionType - The account restriction type. * @param modifications - The array of modifications. * @param networkType - The network type. * @param maxFee - (Optional) Max fee defined by the sender - * @returns {ModifyAccountPropertyEntityTypeTransaction} + * @returns {AccountOperationRestrictionModificationTransaction} */ public static create(deadline: Deadline, - propertyType: PropertyType, - modifications: Array>, + restrictionType: RestrictionType, + modifications: Array>, networkType: NetworkType, - maxFee: UInt64 = new UInt64([0, 0])): ModifyAccountPropertyEntityTypeTransaction { - return new ModifyAccountPropertyEntityTypeTransaction(networkType, - TransactionVersion.MODIFY_ACCOUNT_PROPERTY_ENTITY_TYPE, + maxFee: UInt64 = new UInt64([0, 0])): AccountOperationRestrictionModificationTransaction { + return new AccountOperationRestrictionModificationTransaction(networkType, + TransactionVersion.MODIFY_ACCOUNT_RESTRICTION_ENTITY_TYPE, deadline, maxFee, - propertyType, + restrictionType, modifications); } @@ -56,8 +56,7 @@ export class ModifyAccountPropertyEntityTypeTransaction extends Transaction { * @param version * @param deadline * @param maxFee - * @param minApprovalDelta - * @param minRemovalDelta + * @param restrictionType * @param modifications * @param signature * @param signer @@ -67,25 +66,26 @@ export class ModifyAccountPropertyEntityTypeTransaction extends Transaction { version: number, deadline: Deadline, maxFee: UInt64, - public readonly propertyType: PropertyType, - public readonly modifications: Array>, + public readonly restrictionType: RestrictionType, + public readonly modifications: Array>, signature?: string, signer?: PublicAccount, transactionInfo?: TransactionInfo) { - super(TransactionType.MODIFY_ACCOUNT_PROPERTY_ENTITY_TYPE, networkType, version, deadline, maxFee, signature, signer, transactionInfo); + super(TransactionType.MODIFY_ACCOUNT_RESTRICTION_OPERATION, + networkType, version, deadline, maxFee, signature, signer, transactionInfo); } /** * @override Transaction.size() - * @description get the byte size of a ModifyAccountPropertyEntityTypeTransaction + * @description get the byte size of a AccountOperationRestrictionModificationTransaction * @returns {number} - * @memberof ModifyAccountPropertyEntityTypeTransaction + * @memberof AccountOperationRestrictionModificationTransaction */ public get size(): number { const byteSize = super.size; // set static byte size fields - const bytePropertyType = 1; + const byteRestrictionType = 1; const byteModificationCount = 1; // each modification contains : @@ -93,7 +93,7 @@ export class ModifyAccountPropertyEntityTypeTransaction extends Transaction { // - 2 bytes for the modification value (transaction type) const byteModifications = 3 * this.modifications.length; - return byteSize + bytePropertyType + byteModificationCount + byteModifications; + return byteSize + byteRestrictionType + byteModificationCount + byteModifications; } /** @@ -105,7 +105,7 @@ export class ModifyAccountPropertyEntityTypeTransaction extends Transaction { .addDeadline(this.deadline.toDTO()) .addFee(this.maxFee.toDTO()) .addVersion(this.versionToDTO()) - .addPropertyType(this.propertyType) + .addRestrictionType(this.restrictionType) .addModifications(this.modifications.map((modification) => modification.toDTO())) .build(); } diff --git a/src/model/transaction/AccountPropertyTransaction.ts b/src/model/transaction/AccountPropertyTransaction.ts deleted file mode 100644 index a75ac8ff80..0000000000 --- a/src/model/transaction/AccountPropertyTransaction.ts +++ /dev/null @@ -1,111 +0,0 @@ -/* - * Copyright 2019 NEM - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -import { PropertyType } from '../account/PropertyType'; -import { NetworkType } from '../blockchain/NetworkType'; -import { UInt64 } from '../UInt64'; -import { AccountPropertyModification } from './AccountPropertyModification'; -import { Deadline } from './Deadline'; -import { ModifyAccountPropertyAddressTransaction } from './ModifyAccountPropertyAddressTransaction'; -import { ModifyAccountPropertyEntityTypeTransaction } from './ModifyAccountPropertyEntityTypeTransaction'; -import { ModifyAccountPropertyMosaicTransaction } from './ModifyAccountPropertyMosaicTransaction'; -import { TransactionType } from './TransactionType'; - -export class AccountPropertyTransaction { - /** - * Create an address modification transaction object - * @param deadline - The deadline to include the transaction. - * @param propertyType - Type of account property transaction - * @param modification - array of address modifications - * @param networkType - The network type. - * @param maxFee - (Optional) Max fee defined by the sender - * @returns {ModifyAccountPropertyAddressTransaction} - */ - public static createAddressPropertyModificationTransaction( - deadline: Deadline, - propertyType: PropertyType, - modifications: Array>, - networkType: NetworkType, - maxFee: UInt64 = new UInt64([0, 0]) - ): ModifyAccountPropertyAddressTransaction { - if (![PropertyType.AllowAddress, PropertyType.BlockAddress].includes(propertyType)) { - throw new Error ('Property type is not allowed.'); - } - return ModifyAccountPropertyAddressTransaction.create( - deadline, - propertyType, - modifications, - networkType, - maxFee, - ); - } - - /** - * Create an mosaic modification transaction object - * @param deadline - The deadline to include the transaction. - * @param propertyType - Type of account property transaction - * @param modification - array of mosaic modifications - * @param networkType - The network type. - * @param maxFee - (Optional) Max fee defined by the sender - * @returns {ModifyAccountPropertyMosaicTransaction} - */ - public static createMosaicPropertyModificationTransaction( - deadline: Deadline, - propertyType: PropertyType, - modifications: Array>, - networkType: NetworkType, - maxFee: UInt64 = new UInt64([0, 0]) - ): ModifyAccountPropertyMosaicTransaction { - if (![PropertyType.AllowMosaic, PropertyType.BlockMosaic].includes(propertyType)) { - throw new Error ('Property type is not allowed.'); - } - return ModifyAccountPropertyMosaicTransaction.create( - deadline, - propertyType, - modifications, - networkType, - maxFee, - ); - } - - /** - * Create an entity type modification transaction object - * @param deadline - The deadline to include the transaction. - * @param propertyType - Type of account property transaction - * @param modification - array of entity type modifications - * @param networkType - The network type. - * @param maxFee - (Optional) Max fee defined by the sender - * @returns {ModifyAccountPropertyEntityTypeTransaction} - */ - public static createEntityTypePropertyModificationTransaction( - deadline: Deadline, - propertyType: PropertyType, - modifications: Array>, - networkType: NetworkType, - maxFee: UInt64 = new UInt64([0, 0]) - ): ModifyAccountPropertyEntityTypeTransaction { - if (![PropertyType.AllowTransaction, PropertyType.BlockTransaction].includes(propertyType)) { - throw new Error ('Property type is not allowed.'); - } - return ModifyAccountPropertyEntityTypeTransaction.create( - deadline, - propertyType, - modifications, - networkType, - maxFee, - ); - } -} diff --git a/src/model/transaction/AccountPropertyModification.ts b/src/model/transaction/AccountRestrictionModification.ts similarity index 53% rename from src/model/transaction/AccountPropertyModification.ts rename to src/model/transaction/AccountRestrictionModification.ts index d003dc7fa2..599a61ae65 100644 --- a/src/model/transaction/AccountPropertyModification.ts +++ b/src/model/transaction/AccountRestrictionModification.ts @@ -15,11 +15,11 @@ */ import { Address } from '../account/Address'; -import { PropertyModificationType } from '../account/PropertyModificationType'; +import { RestrictionModificationType } from '../account/RestrictionModificationType'; import { MosaicId } from '../mosaic/MosaicId'; import { TransactionType } from './TransactionType'; -export class AccountPropertyModification { +export class AccountRestrictionModification { /** * Constructor @@ -30,7 +30,7 @@ export class AccountPropertyModification { /** * Modification type. */ - public readonly modificationType: PropertyModificationType, + public readonly modificationType: RestrictionModificationType, /** * Modification value (Address, Mosaic or Transaction Type). */ @@ -39,35 +39,35 @@ export class AccountPropertyModification { } /** - * Create an address filter for account property modification + * Create an address filter for account restriction modification * @param modificationType - modification type. 0: Add, 1: Remove * @param address - modification value (Address) - * @returns {AccountPropertyModification} + * @returns {AccountRestrictionModification} */ - public static createForAddress(modificationType: PropertyModificationType, - address: Address): AccountPropertyModification { - return new AccountPropertyModification(modificationType, address.plain()); + public static createForAddress(modificationType: RestrictionModificationType, + address: Address): AccountRestrictionModification { + return new AccountRestrictionModification(modificationType, address.plain()); } /** - * Create an mosaic filter for account property modification + * Create an mosaic filter for account restriction modification * @param modificationType - modification type. 0: Add, 1: Remove * @param mosaicId - modification value (Mosaic) - * @returns {AccountPropertyModification} + * @returns {AccountRestrictionModification} */ - public static createForMosaic(modificationType: PropertyModificationType, - mosaicId: MosaicId): AccountPropertyModification { - return new AccountPropertyModification(modificationType, mosaicId.id.toDTO()); + public static createForMosaic(modificationType: RestrictionModificationType, + mosaicId: MosaicId): AccountRestrictionModification { + return new AccountRestrictionModification(modificationType, mosaicId.id.toDTO()); } /** - * Create an entity type filter for account property modification + * Create an operation filter for account restriction modification * @param modificationType - modification type. 0: Add, 1: Remove - * @param entityType - modification value (Transaction Type) - * @returns {AccountPropertyModification} + * @param operation - modification value (Transaction Type) + * @returns {AccountRestrictionModification} */ - public static createForEntityType(modificationType: PropertyModificationType, - entityType: number): AccountPropertyModification { - return new AccountPropertyModification(modificationType, entityType); + public static createForOperation(modificationType: RestrictionModificationType, + operation: number): AccountRestrictionModification { + return new AccountRestrictionModification(modificationType, operation); } /** diff --git a/src/model/transaction/AccountRestrictionTransaction.ts b/src/model/transaction/AccountRestrictionTransaction.ts new file mode 100644 index 0000000000..7e0f26c313 --- /dev/null +++ b/src/model/transaction/AccountRestrictionTransaction.ts @@ -0,0 +1,111 @@ +/* + * Copyright 2019 NEM + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +import { RestrictionType } from '../account/RestrictionType'; +import { NetworkType } from '../blockchain/NetworkType'; +import { UInt64 } from '../UInt64'; +import { AccountAddressRestrictionModificationTransaction } from './AccountAddressRestrictionModificationTransaction'; +import { AccountMosaicRestrictionModificationTransaction } from './AccountMosaicRestrictionModificationTransaction'; +import { AccountOperationRestrictionModificationTransaction } from './AccountOperationRestrictionModificationTransaction'; +import { AccountRestrictionModification } from './AccountRestrictionModification'; +import { Deadline } from './Deadline'; +import { TransactionType } from './TransactionType'; + +export class AccountRestrictionTransaction { + /** + * Create an account address restriction transaction object + * @param deadline - The deadline to include the transaction. + * @param restrictionType - Type of account restriction transaction + * @param modification - array of address modifications + * @param networkType - The network type. + * @param maxFee - (Optional) Max fee defined by the sender + * @returns {AccountAddressRestrictionModificationTransaction} + */ + public static createAddressRestrictionModificationTransaction( + deadline: Deadline, + restrictionType: RestrictionType, + modifications: Array>, + networkType: NetworkType, + maxFee: UInt64 = new UInt64([0, 0]), + ): AccountAddressRestrictionModificationTransaction { + if (![RestrictionType.AllowAddress, RestrictionType.BlockAddress].includes(restrictionType)) { + throw new Error ('Restriction type is not allowed.'); + } + return AccountAddressRestrictionModificationTransaction.create( + deadline, + restrictionType, + modifications, + networkType, + maxFee, + ); + } + + /** + * Create an account mosaic restriction transaction object + * @param deadline - The deadline to include the transaction. + * @param restrictionType - Type of account restriction transaction + * @param modification - array of mosaic modifications + * @param networkType - The network type. + * @param maxFee - (Optional) Max fee defined by the sender + * @returns {AccountMosaicRestrictionModificationTransaction} + */ + public static createMosaicRestrictionModificationTransaction( + deadline: Deadline, + restrictionType: RestrictionType, + modifications: Array>, + networkType: NetworkType, + maxFee: UInt64 = new UInt64([0, 0]), + ): AccountMosaicRestrictionModificationTransaction { + if (![RestrictionType.AllowMosaic, RestrictionType.BlockMosaic].includes(restrictionType)) { + throw new Error ('Restriction type is not allowed.'); + } + return AccountMosaicRestrictionModificationTransaction.create( + deadline, + restrictionType, + modifications, + networkType, + maxFee, + ); + } + + /** + * Create an account operation restriction transaction object + * @param deadline - The deadline to include the transaction. + * @param restrictionType - Type of account restriction transaction + * @param modification - array of operation modifications + * @param networkType - The network type. + * @param maxFee - (Optional) Max fee defined by the sender + * @returns {createOperationRestrictionModificationTransaction} + */ + public static createOperationRestrictionModificationTransaction( + deadline: Deadline, + restrictionType: RestrictionType, + modifications: Array>, + networkType: NetworkType, + maxFee: UInt64 = new UInt64([0, 0]), + ): AccountOperationRestrictionModificationTransaction { + if (![RestrictionType.AllowTransaction, RestrictionType.BlockTransaction].includes(restrictionType)) { + throw new Error ('Restriction type is not allowed.'); + } + return AccountOperationRestrictionModificationTransaction.create( + deadline, + restrictionType, + modifications, + networkType, + maxFee, + ); + } +} diff --git a/src/model/transaction/AggregateTransaction.ts b/src/model/transaction/AggregateTransaction.ts index 60b39e0db9..495ba89fb8 100644 --- a/src/model/transaction/AggregateTransaction.ts +++ b/src/model/transaction/AggregateTransaction.ts @@ -22,6 +22,7 @@ import { PublicAccount } from '../account/PublicAccount'; import { NetworkType } from '../blockchain/NetworkType'; import { UInt64 } from '../UInt64'; import { AggregateTransactionCosignature } from './AggregateTransactionCosignature'; +import { CosignatureSignedTransaction } from './CosignatureSignedTransaction'; import { Deadline } from './Deadline'; import { InnerTransaction } from './InnerTransaction'; import { SignedTransaction } from './SignedTransaction'; @@ -96,7 +97,7 @@ export class AggregateTransaction extends Transaction { * @param {InnerTransaction[]} innerTransactions * @param {NetworkType} networkType * @param {AggregateTransactionCosignature[]} cosignatures - * @param {UInt64} maxFee - (Optional) Max fee defined by the sender + * @param {UInt64} maxFee - (Optional) Max fee defined by the sender * @return {AggregateTransaction} */ public static createBonded(deadline: Deadline, @@ -149,6 +150,29 @@ export class AggregateTransaction extends Transaction { this.type, this.networkType); } + /** + * @internal + * Sign transaction with cosignatories collected from cosigned transactions and creating a new SignedTransaction + * For off chain Aggregated Complete Transaction co-signing. + * @param initiatorAccount - Initiator account + * @param {CosignatureSignedTransaction[]} cosignatureSignedTransactions - Array of cosigned transaction + * @param generationHash - Network generation hash hex + * @param {SignSchema} signSchema The Sign Schema. (KECCAK_REVERSED_KEY / SHA3) + * @return {SignedTransaction} + */ + public signTransactionGivenSignatures(initiatorAccount: Account, + cosignatureSignedTransactions: CosignatureSignedTransaction[], + generationHash: string, + signSchema: SignSchema= SignSchema.SHA3) { + const aggregateTransaction = this.buildTransaction(); + const signedTransactionRaw = aggregateTransaction.signTransactionGivenSignatures(initiatorAccount, + cosignatureSignedTransactions, + generationHash, + signSchema); + return new SignedTransaction(signedTransactionRaw.payload, signedTransactionRaw.hash, initiatorAccount.publicKey, + this.type, this.networkType); + } + /** * Check if account has signed transaction * @param publicAccount - Signer public account @@ -179,4 +203,4 @@ export class AggregateTransaction extends Transaction { return byteSize + byteTransactionsSize + byteTransactions; } -} +} \ No newline at end of file diff --git a/src/model/transaction/CosignatureTransaction.ts b/src/model/transaction/CosignatureTransaction.ts index 3b64fbe117..1eb021e01a 100644 --- a/src/model/transaction/CosignatureTransaction.ts +++ b/src/model/transaction/CosignatureTransaction.ts @@ -19,6 +19,7 @@ import {CosignatureTransaction as CosignaturetransactionLibrary} from '../../inf import {Account} from '../account/Account'; import {AggregateTransaction} from './AggregateTransaction'; import {CosignatureSignedTransaction} from './CosignatureSignedTransaction'; +import { VerifiableTransaction } from '../../infrastructure/builders/VerifiableTransaction'; /** * Cosignature transaction is used to sign an aggregate transactions with missing cosignatures. @@ -46,6 +47,26 @@ export class CosignatureTransaction { return new CosignatureTransaction(transactionToCosign); } + /** + * Co-sign transaction with transaction payload (off chain) + * Creating a new CosignatureSignedTransaction + * @param account - The signing account + * @param payload - off transaction payload (aggregated transaction is unannounced) + * @param gernationHash - Network generation hash + * @returns {CosignatureSignedTransaction} + */ + public static signTransactionPayload(account: Account, payload: string, gernationHash: string): CosignatureSignedTransaction { + /** + * For aggregated complete transaction, cosignatories are gathered off chain announced. + */ + const transactionHash = VerifiableTransaction.createTransactionHash(payload, gernationHash); + const aggregateSignatureTransaction = new CosignaturetransactionLibrary(transactionHash); + const signedTransactionRaw = aggregateSignatureTransaction.signCosignatoriesTransaction(account); + return new CosignatureSignedTransaction(signedTransactionRaw.parentHash, + signedTransactionRaw.signature, + signedTransactionRaw.signer); + } + /** * @internal * Serialize and sign transaction creating a new SignedTransaction @@ -60,4 +81,4 @@ export class CosignatureTransaction { signedTransactionRaw.signature, signedTransactionRaw.signer); } -} +} \ No newline at end of file diff --git a/src/model/transaction/TransactionType.ts b/src/model/transaction/TransactionType.ts index 07632512a1..2ff0f82e50 100644 --- a/src/model/transaction/TransactionType.ts +++ b/src/model/transaction/TransactionType.ts @@ -91,22 +91,22 @@ export class TransactionType { public static readonly SECRET_PROOF = 0x4252; /** - * Account property address transaction type + * Account restriction address transaction type * @type {number} */ - public static readonly MODIFY_ACCOUNT_PROPERTY_ADDRESS = 0x4150; + public static readonly MODIFY_ACCOUNT_RESTRICTION_ADDRESS = 0x4150; /** - * Account property mosaic transaction type + * Account restriction mosaic transaction type * @type {number} */ - public static readonly MODIFY_ACCOUNT_PROPERTY_MOSAIC = 0x4250; + public static readonly MODIFY_ACCOUNT_RESTRICTION_MOSAIC = 0x4250; /** - * Account property entity type transaction type + * Account restriction operation transaction type * @type {number} */ - public static readonly MODIFY_ACCOUNT_PROPERTY_ENTITY_TYPE = 0x4350; + public static readonly MODIFY_ACCOUNT_RESTRICTION_OPERATION = 0x4350; /** * Link account transaction type diff --git a/src/model/transaction/TransactionVersion.ts b/src/model/transaction/TransactionVersion.ts index 5f90e38a46..d7446f12ec 100644 --- a/src/model/transaction/TransactionVersion.ts +++ b/src/model/transaction/TransactionVersion.ts @@ -101,22 +101,22 @@ export class TransactionVersion { public static readonly MOSAIC_ALIAS = 0x01; /** - * Account Property address transaction version + * Account Restriction address transaction version * @type {number} */ - public static readonly MODIFY_ACCOUNT_PROPERTY_ADDRESS = 0x01; + public static readonly MODIFY_ACCOUNT_RESTRICTION_ADDRESS = 0x01; /** - * Account Property mosaic transaction version + * Account Restriction mosaic transaction version * @type {number} */ - public static readonly MODIFY_ACCOUNT_PROPERTY_MOSAIC = 0x01; + public static readonly MODIFY_ACCOUNT_RESTRICTION_MOSAIC = 0x01; /** - * Account Property entity type transaction version + * Account Restriction operation transaction version * @type {number} */ - public static readonly MODIFY_ACCOUNT_PROPERTY_ENTITY_TYPE = 0x01; + public static readonly MODIFY_ACCOUNT_RESTRICTION_ENTITY_TYPE = 0x01; /** * Link account transaction version diff --git a/test/core/utils/TransactionMapping.spec.ts b/test/core/utils/TransactionMapping.spec.ts index c7bc986b01..c536e14c06 100644 --- a/test/core/utils/TransactionMapping.spec.ts +++ b/test/core/utils/TransactionMapping.spec.ts @@ -21,9 +21,9 @@ import {Convert as convert} from '../../../src/core/format'; import { TransactionMapping } from '../../../src/core/utils/TransactionMapping'; import { Account } from '../../../src/model/account/Account'; import { Address } from '../../../src/model/account/Address'; -import { PropertyModificationType } from '../../../src/model/account/PropertyModificationType'; -import { PropertyType } from '../../../src/model/account/PropertyType'; import { PublicAccount } from '../../../src/model/account/PublicAccount'; +import { RestrictionModificationType } from '../../../src/model/account/RestrictionModificationType'; +import { RestrictionType } from '../../../src/model/account/RestrictionType'; import { NetworkType } from '../../../src/model/blockchain/NetworkType'; import { EncryptedMessage } from '../../../src/model/model'; import { MosaicId } from '../../../src/model/mosaic/MosaicId'; @@ -34,9 +34,11 @@ import { NetworkCurrencyMosaic } from '../../../src/model/mosaic/NetworkCurrency import { AliasActionType } from '../../../src/model/namespace/AliasActionType'; import { NamespaceId } from '../../../src/model/namespace/NamespaceId'; import { NamespaceType } from '../../../src/model/namespace/NamespaceType'; +import { AccountAddressRestrictionModificationTransaction } from '../../../src/model/transaction/AccountAddressRestrictionModificationTransaction'; import { AccountLinkTransaction } from '../../../src/model/transaction/AccountLinkTransaction'; -import { AccountPropertyModification } from '../../../src/model/transaction/AccountPropertyModification'; -import { AccountPropertyTransaction } from '../../../src/model/transaction/AccountPropertyTransaction'; +import { AccountMosaicRestrictionModificationTransaction } from '../../../src/model/transaction/AccountMosaicRestrictionModificationTransaction'; +import { AccountRestrictionModification } from '../../../src/model/transaction/AccountRestrictionModification'; +import { AccountRestrictionTransaction } from '../../../src/model/transaction/AccountRestrictionTransaction'; import { AddressAliasTransaction } from '../../../src/model/transaction/AddressAliasTransaction'; import { AggregateTransaction } from '../../../src/model/transaction/AggregateTransaction'; import { Deadline } from '../../../src/model/transaction/Deadline'; @@ -44,8 +46,6 @@ import { HashType } from '../../../src/model/transaction/HashType'; import { LinkAction } from '../../../src/model/transaction/LinkAction'; import { LockFundsTransaction } from '../../../src/model/transaction/LockFundsTransaction'; import { MessageType } from '../../../src/model/transaction/MessageType'; -import { ModifyAccountPropertyAddressTransaction } from '../../../src/model/transaction/ModifyAccountPropertyAddressTransaction'; -import { ModifyAccountPropertyMosaicTransaction } from '../../../src/model/transaction/ModifyAccountPropertyMosaicTransaction'; import { ModifyMultisigAccountTransaction } from '../../../src/model/transaction/ModifyMultisigAccountTransaction'; import { MosaicAliasTransaction } from '../../../src/model/transaction/MosaicAliasTransaction'; import { MosaicDefinitionTransaction } from '../../../src/model/transaction/MosaicDefinitionTransaction'; @@ -68,69 +68,69 @@ describe('TransactionMapping - createFromPayload', () => { account = TestingAccount; }); - it('should create AccountPropertyAddressTransaction', () => { + it('should create AccountRestrictionAddressTransaction', () => { const address = Address.createFromRawAddress('SBILTA367K2LX2FEXG5TFWAS7GEFYAGY7QLFBYKC'); - const addressPropertyFilter = AccountPropertyModification.createForAddress( - PropertyModificationType.Add, + const addressRestrictionFilter = AccountRestrictionModification.createForAddress( + RestrictionModificationType.Add, address, ); - const addressPropertyTransaction = AccountPropertyTransaction.createAddressPropertyModificationTransaction( + const addressRestrictionTransaction = AccountRestrictionTransaction.createAddressRestrictionModificationTransaction( Deadline.create(), - PropertyType.AllowAddress, - [addressPropertyFilter], + RestrictionType.AllowAddress, + [addressRestrictionFilter], NetworkType.MIJIN_TEST, ); - const signedTransaction = addressPropertyTransaction.signWith(account, generationHash); + const signedTransaction = addressRestrictionTransaction.signWith(account, generationHash); - const transaction = TransactionMapping.createFromPayload(signedTransaction.payload) as ModifyAccountPropertyAddressTransaction; + const transaction = TransactionMapping.createFromPayload(signedTransaction.payload) as AccountAddressRestrictionModificationTransaction; - expect(transaction.propertyType).to.be.equal(PropertyType.AllowAddress); - expect(transaction.modifications[0].modificationType).to.be.equal(PropertyModificationType.Add); + expect(transaction.restrictionType).to.be.equal(RestrictionType.AllowAddress); + expect(transaction.modifications[0].modificationType).to.be.equal(RestrictionModificationType.Add); expect(transaction.modifications[0].value).to.be.equal('SBILTA367K2LX2FEXG5TFWAS7GEFYAGY7QLFBYKC'); }); - it('should create AccountPropertyMosaicTransaction', () => { + it('should create AccountRestrictionMosaicTransaction', () => { const mosaicId = new MosaicId([2262289484, 3405110546]); - const mosaicPropertyFilter = AccountPropertyModification.createForMosaic( - PropertyModificationType.Add, + const mosaicRestrictionFilter = AccountRestrictionModification.createForMosaic( + RestrictionModificationType.Add, mosaicId, ); - const mosaicPropertyTransaction = AccountPropertyTransaction.createMosaicPropertyModificationTransaction( + const mosaicRestrictionTransaction = AccountRestrictionTransaction.createMosaicRestrictionModificationTransaction( Deadline.create(), - PropertyType.AllowMosaic, - [mosaicPropertyFilter], + RestrictionType.AllowMosaic, + [mosaicRestrictionFilter], NetworkType.MIJIN_TEST, ); - const signedTransaction = mosaicPropertyTransaction.signWith(account, generationHash); + const signedTransaction = mosaicRestrictionTransaction.signWith(account, generationHash); - const transaction = TransactionMapping.createFromPayload(signedTransaction.payload) as ModifyAccountPropertyAddressTransaction; - expect(transaction.propertyType).to.be.equal(PropertyType.AllowMosaic); + const transaction = TransactionMapping.createFromPayload(signedTransaction.payload) as AccountAddressRestrictionModificationTransaction; + expect(transaction.restrictionType).to.be.equal(RestrictionType.AllowMosaic); expect(transaction.modifications[0].value[0]).to.be.equal(2262289484); expect(transaction.modifications[0].value[1]).to.be.equal(3405110546); - expect(transaction.modifications[0].modificationType).to.be.equal(PropertyModificationType.Add); + expect(transaction.modifications[0].modificationType).to.be.equal(RestrictionModificationType.Add); }); - it('should create AccountPropertyMosaicTransaction', () => { - const entityType = TransactionType.ADDRESS_ALIAS; - const entityTypePropertyFilter = AccountPropertyModification.createForEntityType( - PropertyModificationType.Add, - entityType, + it('should create AccountRestrictionOperationTransaction', () => { + const operation = TransactionType.ADDRESS_ALIAS; + const operationRestrictionFilter = AccountRestrictionModification.createForOperation( + RestrictionModificationType.Add, + operation, ); - const entityTypePropertyTransaction = AccountPropertyTransaction.createEntityTypePropertyModificationTransaction( + const operationRestrictionTransaction = AccountRestrictionTransaction.createOperationRestrictionModificationTransaction( Deadline.create(), - PropertyType.AllowTransaction, - [entityTypePropertyFilter], + RestrictionType.AllowTransaction, + [operationRestrictionFilter], NetworkType.MIJIN_TEST, ); - const signedTransaction = entityTypePropertyTransaction.signWith(account, generationHash); + const signedTransaction = operationRestrictionTransaction.signWith(account, generationHash); - const transaction = TransactionMapping.createFromPayload(signedTransaction.payload) as ModifyAccountPropertyAddressTransaction; - expect(transaction.propertyType).to.be.equal(PropertyType.AllowTransaction); - expect(transaction.modifications[0].value).to.be.equal(entityType); - expect(transaction.modifications[0].modificationType).to.be.equal(PropertyModificationType.Add); + const transaction = TransactionMapping.createFromPayload(signedTransaction.payload) as AccountAddressRestrictionModificationTransaction; + expect(transaction.restrictionType).to.be.equal(RestrictionType.AllowTransaction); + expect(transaction.modifications[0].value).to.be.equal(operation); + expect(transaction.modifications[0].modificationType).to.be.equal(RestrictionModificationType.Add); }); it('should create AddressAliasTransaction', () => { @@ -144,7 +144,7 @@ describe('TransactionMapping - createFromPayload', () => { NetworkType.MIJIN_TEST, ); - const signedTransaction = addressAliasTransaction.signWith(account,generationHash); + const signedTransaction = addressAliasTransaction.signWith(account, generationHash); const transaction = TransactionMapping.createFromPayload(signedTransaction.payload) as AddressAliasTransaction; @@ -190,7 +190,7 @@ describe('TransactionMapping - createFromPayload', () => { NetworkType.MIJIN_TEST, ); - const signedTransaction = mosaicDefinitionTransaction.signWith(account,generationHash); + const signedTransaction = mosaicDefinitionTransaction.signWith(account, generationHash); const transaction = TransactionMapping.createFromPayload(signedTransaction.payload) as MosaicDefinitionTransaction; @@ -215,7 +215,7 @@ describe('TransactionMapping - createFromPayload', () => { NetworkType.MIJIN_TEST, ); - const signedTransaction = mosaicDefinitionTransaction.signWith(account,generationHash); + const signedTransaction = mosaicDefinitionTransaction.signWith(account, generationHash); const transaction = TransactionMapping.createFromPayload(signedTransaction.payload) as MosaicDefinitionTransaction; @@ -238,7 +238,7 @@ describe('TransactionMapping - createFromPayload', () => { NetworkType.MIJIN_TEST, ); - const signedTransaction = mosaicDefinitionTransaction.signWith(account,generationHash); + const signedTransaction = mosaicDefinitionTransaction.signWith(account, generationHash); const transaction = TransactionMapping.createFromPayload(signedTransaction.payload) as MosaicDefinitionTransaction; @@ -261,7 +261,7 @@ describe('TransactionMapping - createFromPayload', () => { NetworkType.MIJIN_TEST, ); - const signedTransaction = mosaicDefinitionTransaction.signWith(account,generationHash); + const signedTransaction = mosaicDefinitionTransaction.signWith(account, generationHash); const transaction = TransactionMapping.createFromPayload(signedTransaction.payload) as MosaicDefinitionTransaction; @@ -284,7 +284,7 @@ describe('TransactionMapping - createFromPayload', () => { NetworkType.MIJIN_TEST, ); - const signedTransaction = mosaicDefinitionTransaction.signWith(account,generationHash); + const signedTransaction = mosaicDefinitionTransaction.signWith(account, generationHash); const transaction = TransactionMapping.createFromPayload(signedTransaction.payload) as MosaicDefinitionTransaction; @@ -327,7 +327,7 @@ describe('TransactionMapping - createFromPayload', () => { NetworkType.MIJIN_TEST, ); - const signedTransaction = transferTransaction.signWith(account,generationHash); + const signedTransaction = transferTransaction.signWith(account, generationHash); const transaction = TransactionMapping.createFromPayload(signedTransaction.payload) as TransferTransaction; @@ -468,7 +468,7 @@ describe('TransactionMapping - createFromPayload', () => { signedTransaction, NetworkType.MIJIN_TEST); - const signedLockFundTransaction = lockTransaction.signWith(account,generationHash); + const signedLockFundTransaction = lockTransaction.signWith(account, generationHash); const transaction = TransactionMapping.createFromPayload(signedLockFundTransaction.payload) as LockFundsTransaction; @@ -597,66 +597,66 @@ describe('TransactionMapping - createFromDTO (Transaction.toJSON() feed)', () => expect(transaction.linkAction).to.be.equal(LinkAction.Link); }); - it('should create AccountPropertyAddressTransaction', () => { + it('should create AccountRestrictionAddressTransaction', () => { const address = Address.createFromRawAddress('SBILTA367K2LX2FEXG5TFWAS7GEFYAGY7QLFBYKC'); - const addressPropertyFilter = AccountPropertyModification.createForAddress( - PropertyModificationType.Add, + const addressRestrictionFilter = AccountRestrictionModification.createForAddress( + RestrictionModificationType.Add, address, ); - const addressPropertyTransaction = AccountPropertyTransaction.createAddressPropertyModificationTransaction( + const addressRestrictionTransaction = AccountRestrictionTransaction.createAddressRestrictionModificationTransaction( Deadline.create(), - PropertyType.AllowAddress, - [addressPropertyFilter], + RestrictionType.AllowAddress, + [addressRestrictionFilter], NetworkType.MIJIN_TEST, ); const transaction = - TransactionMapping.createFromDTO(addressPropertyTransaction.toJSON()) as ModifyAccountPropertyAddressTransaction; + TransactionMapping.createFromDTO(addressRestrictionTransaction.toJSON()) as AccountAddressRestrictionModificationTransaction; expect(transaction.modifications[0].value).to.be.equal('SBILTA367K2LX2FEXG5TFWAS7GEFYAGY7QLFBYKC'); - expect(transaction.propertyType).to.be.equal(PropertyType.AllowAddress); - expect(transaction.modifications[0].modificationType).to.be.equal(PropertyModificationType.Add); + expect(transaction.restrictionType).to.be.equal(RestrictionType.AllowAddress); + expect(transaction.modifications[0].modificationType).to.be.equal(RestrictionModificationType.Add); }); - it('should create AccountPropertyMosaicTransaction', () => { + it('should create AccountRestrictionMosaicTransaction', () => { const mosaicId = new MosaicId([2262289484, 3405110546]); - const mosaicPropertyFilter = AccountPropertyModification.createForMosaic( - PropertyModificationType.Add, + const mosaicRestrictionFilter = AccountRestrictionModification.createForMosaic( + RestrictionModificationType.Add, mosaicId, ); - const mosaicPropertyTransaction = AccountPropertyTransaction.createMosaicPropertyModificationTransaction( + const mosaicRestrictionTransaction = AccountRestrictionTransaction.createMosaicRestrictionModificationTransaction( Deadline.create(), - PropertyType.AllowMosaic, - [mosaicPropertyFilter], + RestrictionType.AllowMosaic, + [mosaicRestrictionFilter], NetworkType.MIJIN_TEST, ); const transaction = - TransactionMapping.createFromDTO(mosaicPropertyTransaction.toJSON()) as ModifyAccountPropertyMosaicTransaction; + TransactionMapping.createFromDTO(mosaicRestrictionTransaction.toJSON()) as AccountMosaicRestrictionModificationTransaction; - expect(transaction.type).to.be.equal(TransactionType.MODIFY_ACCOUNT_PROPERTY_MOSAIC); - expect(transaction.propertyType).to.be.equal(PropertyType.AllowMosaic); + expect(transaction.type).to.be.equal(TransactionType.MODIFY_ACCOUNT_RESTRICTION_MOSAIC); + expect(transaction.restrictionType).to.be.equal(RestrictionType.AllowMosaic); expect(transaction.modifications.length).to.be.equal(1); }); - it('should create AccountPropertyMosaicTransaction', () => { - const entityType = TransactionType.ADDRESS_ALIAS; - const entityTypePropertyFilter = AccountPropertyModification.createForEntityType( - PropertyModificationType.Add, - entityType, + it('should create AccountRestrictionMosaicTransaction', () => { + const operation = TransactionType.ADDRESS_ALIAS; + const operationRestrictionFilter = AccountRestrictionModification.createForOperation( + RestrictionModificationType.Add, + operation, ); - const entityTypePropertyTransaction = AccountPropertyTransaction.createEntityTypePropertyModificationTransaction( + const operationRestrictionTransaction = AccountRestrictionTransaction.createOperationRestrictionModificationTransaction( Deadline.create(), - PropertyType.AllowTransaction, - [entityTypePropertyFilter], + RestrictionType.AllowTransaction, + [operationRestrictionFilter], NetworkType.MIJIN_TEST, ); const transaction = - TransactionMapping.createFromDTO(entityTypePropertyTransaction.toJSON()) as ModifyAccountPropertyMosaicTransaction; + TransactionMapping.createFromDTO(operationRestrictionTransaction.toJSON()) as AccountMosaicRestrictionModificationTransaction; - expect(transaction.type).to.be.equal(TransactionType.MODIFY_ACCOUNT_PROPERTY_ENTITY_TYPE); - expect(transaction.propertyType).to.be.equal(PropertyType.AllowTransaction); + expect(transaction.type).to.be.equal(TransactionType.MODIFY_ACCOUNT_RESTRICTION_OPERATION); + expect(transaction.restrictionType).to.be.equal(RestrictionType.AllowTransaction); expect(transaction.modifications.length).to.be.equal(1); }); diff --git a/test/infrastructure/SerializeTransactionToJSON.spec.ts b/test/infrastructure/SerializeTransactionToJSON.spec.ts index 3c2d1bcdf9..5a13ee0d28 100644 --- a/test/infrastructure/SerializeTransactionToJSON.spec.ts +++ b/test/infrastructure/SerializeTransactionToJSON.spec.ts @@ -19,9 +19,9 @@ import { sha3_256 } from 'js-sha3'; import {Convert as convert} from '../../src/core/format'; import { Account } from '../../src/model/account/Account'; import { Address } from '../../src/model/account/Address'; -import { PropertyModificationType } from '../../src/model/account/PropertyModificationType'; -import { PropertyType } from '../../src/model/account/PropertyType'; import { PublicAccount } from '../../src/model/account/PublicAccount'; +import { RestrictionModificationType } from '../../src/model/account/RestrictionModificationType'; +import { RestrictionType } from '../../src/model/account/RestrictionType'; import { NetworkType } from '../../src/model/blockchain/NetworkType'; import { MosaicId } from '../../src/model/mosaic/MosaicId'; import { MosaicNonce } from '../../src/model/mosaic/MosaicNonce'; @@ -31,8 +31,8 @@ import { NetworkCurrencyMosaic } from '../../src/model/mosaic/NetworkCurrencyMos import { AliasActionType } from '../../src/model/namespace/AliasActionType'; import { NamespaceId } from '../../src/model/namespace/NamespaceId'; import { AccountLinkTransaction } from '../../src/model/transaction/AccountLinkTransaction'; -import { AccountPropertyModification } from '../../src/model/transaction/AccountPropertyModification'; -import { AccountPropertyTransaction } from '../../src/model/transaction/AccountPropertyTransaction'; +import { AccountRestrictionModification } from '../../src/model/transaction/AccountRestrictionModification'; +import { AccountRestrictionTransaction } from '../../src/model/transaction/AccountRestrictionTransaction'; import { AddressAliasTransaction } from '../../src/model/transaction/AddressAliasTransaction'; import { AggregateTransaction } from '../../src/model/transaction/AggregateTransaction'; import { Deadline } from '../../src/model/transaction/Deadline'; @@ -75,63 +75,63 @@ describe('SerializeTransactionToJSON', () => { expect(json.transaction.action).to.be.equal(LinkAction.Link); }); - it('should create AccountPropertyAddressTransaction', () => { + it('should create AccountRestrictionAddressTransaction', () => { const address = Address.createFromRawAddress('SBILTA367K2LX2FEXG5TFWAS7GEFYAGY7QLFBYKC'); - const addressPropertyFilter = AccountPropertyModification.createForAddress( - PropertyModificationType.Add, + const addressRestrictionFilter = AccountRestrictionModification.createForAddress( + RestrictionModificationType.Add, address, ); - const addressPropertyTransaction = AccountPropertyTransaction.createAddressPropertyModificationTransaction( + const addressRestrictionTransaction = AccountRestrictionTransaction.createAddressRestrictionModificationTransaction( Deadline.create(), - PropertyType.AllowAddress, - [addressPropertyFilter], + RestrictionType.AllowAddress, + [addressRestrictionFilter], NetworkType.MIJIN_TEST, ); - const json = addressPropertyTransaction.toJSON(); + const json = addressRestrictionTransaction.toJSON(); - expect(json.transaction.type).to.be.equal(TransactionType.MODIFY_ACCOUNT_PROPERTY_ADDRESS); - expect(json.transaction.propertyType).to.be.equal(PropertyType.AllowAddress); + expect(json.transaction.type).to.be.equal(TransactionType.MODIFY_ACCOUNT_RESTRICTION_ADDRESS); + expect(json.transaction.restrictionType).to.be.equal(RestrictionType.AllowAddress); expect(json.transaction.modifications.length).to.be.equal(1); }); - it('should create AccountPropertyMosaicTransaction', () => { + it('should create AccountRestrictionMosaicTransaction', () => { const mosaicId = new MosaicId([2262289484, 3405110546]); - const mosaicPropertyFilter = AccountPropertyModification.createForMosaic( - PropertyModificationType.Add, + const mosaicRestrictionFilter = AccountRestrictionModification.createForMosaic( + RestrictionModificationType.Add, mosaicId, ); - const mosaicPropertyTransaction = AccountPropertyTransaction.createMosaicPropertyModificationTransaction( + const mosaicRestrictionTransaction = AccountRestrictionTransaction.createMosaicRestrictionModificationTransaction( Deadline.create(), - PropertyType.AllowMosaic, - [mosaicPropertyFilter], + RestrictionType.AllowMosaic, + [mosaicRestrictionFilter], NetworkType.MIJIN_TEST, ); - const json = mosaicPropertyTransaction.toJSON(); + const json = mosaicRestrictionTransaction.toJSON(); - expect(json.transaction.type).to.be.equal(TransactionType.MODIFY_ACCOUNT_PROPERTY_MOSAIC); - expect(json.transaction.propertyType).to.be.equal(PropertyType.AllowMosaic); + expect(json.transaction.type).to.be.equal(TransactionType.MODIFY_ACCOUNT_RESTRICTION_MOSAIC); + expect(json.transaction.restrictionType).to.be.equal(RestrictionType.AllowMosaic); expect(json.transaction.modifications.length).to.be.equal(1); }); - it('should create AccountPropertyMosaicTransaction', () => { - const entityType = TransactionType.ADDRESS_ALIAS; - const entityTypePropertyFilter = AccountPropertyModification.createForEntityType( - PropertyModificationType.Add, - entityType, + it('should create AccountRestrictionOperationTransaction', () => { + const operation = TransactionType.ADDRESS_ALIAS; + const operationRestrictionFilter = AccountRestrictionModification.createForOperation( + RestrictionModificationType.Add, + operation, ); - const entityTypePropertyTransaction = AccountPropertyTransaction.createEntityTypePropertyModificationTransaction( + const operationRestrictionTransaction = AccountRestrictionTransaction.createOperationRestrictionModificationTransaction( Deadline.create(), - PropertyType.AllowTransaction, - [entityTypePropertyFilter], + RestrictionType.AllowTransaction, + [operationRestrictionFilter], NetworkType.MIJIN_TEST, ); - const json = entityTypePropertyTransaction.toJSON(); + const json = operationRestrictionTransaction.toJSON(); - expect(json.transaction.type).to.be.equal(TransactionType.MODIFY_ACCOUNT_PROPERTY_ENTITY_TYPE); - expect(json.transaction.propertyType).to.be.equal(PropertyType.AllowTransaction); + expect(json.transaction.type).to.be.equal(TransactionType.MODIFY_ACCOUNT_RESTRICTION_OPERATION); + expect(json.transaction.restrictionType).to.be.equal(RestrictionType.AllowTransaction); expect(json.transaction.modifications.length).to.be.equal(1); }); diff --git a/test/model/account/AccountProperties.spec.ts b/test/model/account/AccountProperties.spec.ts deleted file mode 100644 index 0ffbf09aae..0000000000 --- a/test/model/account/AccountProperties.spec.ts +++ /dev/null @@ -1,48 +0,0 @@ -/* - * Copyright 2018 NEM - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -import {deepEqual} from 'assert'; -import {expect} from 'chai'; -import {Address} from '../../../src/model/account/Address'; -import { AccountProperties, PropertyModificationType, PropertyType } from '../../../src/model/model'; - -describe('AccountProperties', () => { - - it('should createComplete an AccountProperties object', () => { - const accountPropertiesDTO = { - address: Address.createFromEncoded('9050B9837EFAB4BBE8A4B9BB32D812F9885C00D8FC1650E142'), - properties: [{ - propertyType: PropertyType.AllowAddress, - values: [{modificationType: PropertyModificationType.Add, - value: 'SDUP5PLHDXKBX3UU5Q52LAY4WYEKGEWC6IB3VBFM', - }], - }], - }; - - const accountProperties = new AccountProperties( - accountPropertiesDTO.address, - accountPropertiesDTO.properties, - ); - - expect(accountProperties.address).to.be.equal(accountPropertiesDTO.address); - deepEqual(accountPropertiesDTO.properties.length, accountPropertiesDTO.properties.length); - deepEqual(accountPropertiesDTO.properties[0].propertyType, accountPropertiesDTO.properties[0].propertyType); - deepEqual(accountPropertiesDTO.properties[0].values.length, accountPropertiesDTO.properties[0].values.length); - deepEqual(accountPropertiesDTO.properties[0].values[0].modificationType, - accountPropertiesDTO.properties[0].values[0].modificationType); - deepEqual(accountPropertiesDTO.properties[0].values[0].value, accountPropertiesDTO.properties[0].values[0].value); - }); -}); diff --git a/test/model/account/AccountPropertiesInfo.spec.ts b/test/model/account/AccountPropertiesInfo.spec.ts deleted file mode 100644 index dd6d298986..0000000000 --- a/test/model/account/AccountPropertiesInfo.spec.ts +++ /dev/null @@ -1,57 +0,0 @@ -/* - * Copyright 2018 NEM - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -import {deepEqual} from 'assert'; -import { AccountProperties } from '../../../src/model/account/AccountProperties'; -import { AccountPropertiesInfo } from '../../../src/model/account/AccountPropertiesInfo'; -import { AccountProperty } from '../../../src/model/account/AccountProperty'; -import {Address} from '../../../src/model/account/Address'; -import { PropertyModificationType } from '../../../src/model/account/PropertyModificationType'; -import { PropertyType } from '../../../src/model/account/PropertyType'; - -describe('AccountPropertiesInfo', () => { - - it('should createComplete an AccountPropertiesInfo object', () => { - - const accountPropertiesInfoDTO = { - meta: {id: '12345'}, - accountProperties: { - address: '9050B9837EFAB4BBE8A4B9BB32D812F9885C00D8FC1650E142', - properties: [{ - propertyType: PropertyType.AllowAddress, - values: [{modificationType: PropertyModificationType.Add, - value: 'SDUP5PLHDXKBX3UU5Q52LAY4WYEKGEWC6IB3VBFM', - }], - }], - }, - }; - - const accountPropertiesInfo = new AccountPropertiesInfo( - accountPropertiesInfoDTO.meta, - new AccountProperties(Address.createFromEncoded(accountPropertiesInfoDTO.accountProperties.address), - accountPropertiesInfoDTO.accountProperties.properties.map((prop) => - new AccountProperty(prop.propertyType, prop.values))), - ); - - deepEqual(accountPropertiesInfo.meta.id, accountPropertiesInfoDTO.meta.id); - deepEqual(accountPropertiesInfo.accountProperties.address, - Address.createFromEncoded(accountPropertiesInfoDTO.accountProperties.address)); - deepEqual(accountPropertiesInfo.accountProperties.properties.length, - accountPropertiesInfoDTO.accountProperties.properties.length); - deepEqual(accountPropertiesInfo.accountProperties.properties[0].values[0], - accountPropertiesInfoDTO.accountProperties.properties[0].values[0]); - }); -}); diff --git a/test/model/account/AccountProperty.spec.ts b/test/model/account/AccountRestriction.spec.ts similarity index 55% rename from test/model/account/AccountProperty.spec.ts rename to test/model/account/AccountRestriction.spec.ts index ffa7fa4eb6..5bc3e189b6 100644 --- a/test/model/account/AccountProperty.spec.ts +++ b/test/model/account/AccountRestriction.spec.ts @@ -16,25 +16,25 @@ import {deepEqual} from 'assert'; import {expect} from 'chai'; -import { AccountProperty } from '../../../src/model/account/AccountProperty'; +import { AccountRestriction } from '../../../src/model/account/AccountRestriction'; import { Address } from '../../../src/model/account/Address'; -import { PropertyType } from '../../../src/model/account/PropertyType'; -describe('AccountProperty', () => { +import { RestrictionType } from '../../../src/model/account/RestrictionType'; +describe('AccountRestriction', () => { - it('should createComplete an AccountProperty object', () => { - const accountPropertyDTO = { - propertyType: PropertyType.AllowAddress, + it('should createComplete an AccountRestriction object', () => { + const accountRestrictionDTO = { + restrictionType: RestrictionType.AllowAddress, values: ['906415867F121D037AF447E711B0F5E4D52EBBF066D96860EB'], }; - const accountProperty = new AccountProperty( - accountPropertyDTO.propertyType, - accountPropertyDTO.values.map((value) => { + const accountRestriction = new AccountRestriction( + accountRestrictionDTO.restrictionType, + accountRestrictionDTO.values.map((value) => { return Address.createFromEncoded(value); }), ); - expect(accountProperty.propertyType).to.be.equal(accountPropertyDTO.propertyType); - deepEqual(accountProperty.values.length, accountPropertyDTO.values.length); + expect(accountRestriction.restrictionType).to.be.equal(accountRestrictionDTO.restrictionType); + deepEqual(accountRestriction.values.length, accountRestrictionDTO.values.length); }); }); diff --git a/test/model/account/AccountRestrictions.spec.ts b/test/model/account/AccountRestrictions.spec.ts new file mode 100644 index 0000000000..1ad76d7daa --- /dev/null +++ b/test/model/account/AccountRestrictions.spec.ts @@ -0,0 +1,53 @@ +/* + * Copyright 2018 NEM + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +import {deepEqual} from 'assert'; +import {expect} from 'chai'; +import {Address} from '../../../src/model/account/Address'; +import { AccountRestrictions, RestrictionModificationType, RestrictionType, AccountRestriction } from '../../../src/model/model'; + +describe('AccountRestrictions', () => { + + it('should createComplete an AccountRestrictions object', () => { + const accountRestrictionsDTO = { + address: Address.createFromEncoded('9050B9837EFAB4BBE8A4B9BB32D812F9885C00D8FC1650E142'), + restrictions: [{ + restrictionType: RestrictionType.AllowAddress, + values: [{modificationType: RestrictionModificationType.Add, + value: 'SDUP5PLHDXKBX3UU5Q52LAY4WYEKGEWC6IB3VBFM', + }], + }], + }; + + const accountRestrictions = new AccountRestrictions( + accountRestrictionsDTO.address, + accountRestrictionsDTO.restrictions.map((r) => { + return new AccountRestriction( + r.restrictionType, + r.values, + ); + }), + ); + + expect(accountRestrictions.address).to.be.equal(accountRestrictionsDTO.address); + deepEqual(accountRestrictions.restrictions.length, accountRestrictionsDTO.restrictions.length); + deepEqual(accountRestrictions.restrictions[0].restrictionType, accountRestrictionsDTO.restrictions[0].restrictionType); + deepEqual(accountRestrictions.restrictions[0].values.length, accountRestrictionsDTO.restrictions[0].values.length); + deepEqual((accountRestrictions.restrictions[0].values[0] as any).modificationType, + accountRestrictionsDTO.restrictions[0].values[0].modificationType); + deepEqual((accountRestrictions.restrictions[0].values[0] as any).value, accountRestrictionsDTO.restrictions[0].values[0].value); + }); +}); diff --git a/test/model/account/AccountRestrictionsInfo.spec.ts b/test/model/account/AccountRestrictionsInfo.spec.ts new file mode 100644 index 0000000000..01ac4771f9 --- /dev/null +++ b/test/model/account/AccountRestrictionsInfo.spec.ts @@ -0,0 +1,57 @@ +/* + * Copyright 2018 NEM + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +import {deepEqual} from 'assert'; +import { AccountRestriction } from '../../../src/model/account/AccountRestriction'; +import { AccountRestrictions } from '../../../src/model/account/AccountRestrictions'; +import { AccountRestrictionsInfo } from '../../../src/model/account/AccountRestrictionsInfo'; +import {Address} from '../../../src/model/account/Address'; +import { RestrictionModificationType } from '../../../src/model/account/RestrictionModificationType'; +import { RestrictionType } from '../../../src/model/account/RestrictionType'; + +describe('AccountRestrictionsInfo', () => { + + it('should createComplete an AccountRestrictionsInfo object', () => { + + const accountRestrictionsInfoDTO = { + meta: {id: '12345'}, + accountRestrictions: { + address: '9050B9837EFAB4BBE8A4B9BB32D812F9885C00D8FC1650E142', + restrictions: [{ + restrictionType: RestrictionType.AllowAddress, + values: [{modificationType: RestrictionModificationType.Add, + value: 'SDUP5PLHDXKBX3UU5Q52LAY4WYEKGEWC6IB3VBFM', + }], + }], + }, + }; + + const accountRestrictionsInfo = new AccountRestrictionsInfo( + accountRestrictionsInfoDTO.meta, + new AccountRestrictions(Address.createFromEncoded(accountRestrictionsInfoDTO.accountRestrictions.address), + accountRestrictionsInfoDTO.accountRestrictions.restrictions.map((prop) => + new AccountRestriction(prop.restrictionType, prop.values))), + ); + + deepEqual(accountRestrictionsInfo.meta.id, accountRestrictionsInfoDTO.meta.id); + deepEqual(accountRestrictionsInfo.accountRestrictions.address, + Address.createFromEncoded(accountRestrictionsInfoDTO.accountRestrictions.address)); + deepEqual(accountRestrictionsInfo.accountRestrictions.restrictions.length, + accountRestrictionsInfoDTO.accountRestrictions.restrictions.length); + deepEqual(accountRestrictionsInfo.accountRestrictions.restrictions[0].values[0], + accountRestrictionsInfoDTO.accountRestrictions.restrictions[0].values[0]); + }); +}); diff --git a/test/model/transaction/AccountPropertyTransaction.spec.ts b/test/model/transaction/AccountPropertyTransaction.spec.ts deleted file mode 100644 index 80eb1ff029..0000000000 --- a/test/model/transaction/AccountPropertyTransaction.spec.ts +++ /dev/null @@ -1,257 +0,0 @@ -/* - * Copyright 2019 NEM - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -import {expect} from 'chai'; -import {Account} from '../../../src/model/account/Account'; -import {Address} from '../../../src/model/account/Address'; -import { PropertyModificationType } from '../../../src/model/account/PropertyModificationType'; -import { PropertyType } from '../../../src/model/account/PropertyType'; -import {NetworkType} from '../../../src/model/blockchain/NetworkType'; -import {MosaicId} from '../../../src/model/mosaic/MosaicId'; -import { AccountPropertyModification } from '../../../src/model/transaction/AccountPropertyModification'; -import {AccountPropertyTransaction} from '../../../src/model/transaction/AccountPropertyTransaction'; -import {Deadline} from '../../../src/model/transaction/Deadline'; -import { TransactionType } from '../../../src/model/transaction/TransactionType'; -import {UInt64} from '../../../src/model/UInt64'; -import {TestingAccount} from '../../conf/conf.spec'; - -describe('AccountPropertyTransaction', () => { - let account: Account; - const generationHash = '57F7DA205008026C776CB6AED843393F04CD458E0AA2D9F1D5F31A402072B2D6'; - before(() => { - account = TestingAccount; - }); - it('should create address property filter', () => { - const address = Address.createFromRawAddress('SBILTA367K2LX2FEXG5TFWAS7GEFYAGY7QLFBYKC'); - const addressPropertyFilter = AccountPropertyModification.createForAddress( - PropertyModificationType.Add, - address, - ); - expect(addressPropertyFilter.modificationType).to.be.equal(PropertyModificationType.Add); - expect(addressPropertyFilter.value).to.be.equal(address.plain()); - }); - - it('should create mosaic property filter', () => { - const mosaicId = new MosaicId([2262289484, 3405110546]); - const mosaicPropertyFilter = AccountPropertyModification.createForMosaic( - PropertyModificationType.Add, - mosaicId, - ); - expect(mosaicPropertyFilter.modificationType).to.be.equal(PropertyModificationType.Add); - expect(mosaicPropertyFilter.value[0]).to.be.equal(mosaicId.id.lower); - expect(mosaicPropertyFilter.value[1]).to.be.equal(mosaicId.id.higher); - }); - - it('should create entity type property filter', () => { - const entityType = TransactionType.ADDRESS_ALIAS; - const entityTypePropertyFilter = AccountPropertyModification.createForEntityType( - PropertyModificationType.Add, - entityType, - ); - expect(entityTypePropertyFilter.modificationType).to.be.equal(PropertyModificationType.Add); - expect(entityTypePropertyFilter.value).to.be.equal(entityType); - }); - - describe('size', () => { - it('should return 148 for ModifyAccountPropertyAddressTransaction transaction byte size with 1 modification', () => { - const address = Address.createFromRawAddress('SBILTA367K2LX2FEXG5TFWAS7GEFYAGY7QLFBYKC'); - const addressPropertyFilter = AccountPropertyModification.createForAddress( - PropertyModificationType.Add, - address, - ); - const addressPropertyTransaction = AccountPropertyTransaction.createAddressPropertyModificationTransaction( - Deadline.create(), - PropertyType.AllowAddress, - [addressPropertyFilter], - NetworkType.MIJIN_TEST, - ); - - expect(addressPropertyTransaction.size).to.be.equal(148); - }); - - it('should return 131 for ModifyAccountPropertyMosaicTransaction transaction byte size with 1 modification', () => { - const mosaicId = new MosaicId([2262289484, 3405110546]); - const mosaicPropertyFilter = AccountPropertyModification.createForMosaic( - PropertyModificationType.Add, - mosaicId, - ); - const mosaicPropertyTransaction = AccountPropertyTransaction.createMosaicPropertyModificationTransaction( - Deadline.create(), - PropertyType.AllowMosaic, - [mosaicPropertyFilter], - NetworkType.MIJIN_TEST, - ); - expect(mosaicPropertyTransaction.size).to.be.equal(131); - }); - - it('should return 125 for ModifyAccountPropertyEntityTypeTransaction transaction byte size with 1 modification', () => { - const entityType = TransactionType.ADDRESS_ALIAS; - const entityTypePropertyFilter = AccountPropertyModification.createForEntityType( - PropertyModificationType.Add, - entityType, - ); - const entityTypePropertyTransaction = AccountPropertyTransaction.createEntityTypePropertyModificationTransaction( - Deadline.create(), - PropertyType.AllowTransaction, - [entityTypePropertyFilter], - NetworkType.MIJIN_TEST, - ); - expect(entityTypePropertyTransaction.size).to.be.equal(125); - }); - }); - - it('should default maxFee field be set to 0', () => { - const address = Address.createFromRawAddress('SBILTA367K2LX2FEXG5TFWAS7GEFYAGY7QLFBYKC'); - const addressPropertyFilter = AccountPropertyModification.createForAddress( - PropertyModificationType.Add, - address, - ); - const addressPropertyTransaction = AccountPropertyTransaction.createAddressPropertyModificationTransaction( - Deadline.create(), - PropertyType.AllowAddress, - [addressPropertyFilter], - NetworkType.MIJIN_TEST, - ); - - expect(addressPropertyTransaction.maxFee.higher).to.be.equal(0); - expect(addressPropertyTransaction.maxFee.lower).to.be.equal(0); - }); - - it('should filled maxFee override transaction maxFee', () => { - const address = Address.createFromRawAddress('SBILTA367K2LX2FEXG5TFWAS7GEFYAGY7QLFBYKC'); - const addressPropertyFilter = AccountPropertyModification.createForAddress( - PropertyModificationType.Add, - address, - ); - const addressPropertyTransaction = AccountPropertyTransaction.createAddressPropertyModificationTransaction( - Deadline.create(), - PropertyType.AllowAddress, - [addressPropertyFilter], - NetworkType.MIJIN_TEST, - new UInt64([1, 0]), - ); - - expect(addressPropertyTransaction.maxFee.higher).to.be.equal(0); - expect(addressPropertyTransaction.maxFee.lower).to.be.equal(1); - }); - - it('should create address property transaction', () => { - - const address = Address.createFromRawAddress('SBILTA367K2LX2FEXG5TFWAS7GEFYAGY7QLFBYKC'); - const addressPropertyFilter = AccountPropertyModification.createForAddress( - PropertyModificationType.Add, - address, - ); - const addressPropertyTransaction = AccountPropertyTransaction.createAddressPropertyModificationTransaction( - Deadline.create(), - PropertyType.AllowAddress, - [addressPropertyFilter], - NetworkType.MIJIN_TEST, - ); - - const signedTransaction = addressPropertyTransaction.signWith(account, generationHash); - - expect(signedTransaction.payload.substring( - 240, - signedTransaction.payload.length, - )).to.be.equal('0101009050B9837EFAB4BBE8A4B9BB32D812F9885C00D8FC1650E142'); - - }); - - it('should throw exception when create address property transaction with wrong type', () => { - - const address = Address.createFromRawAddress('SBILTA367K2LX2FEXG5TFWAS7GEFYAGY7QLFBYKC'); - const addressPropertyFilter = AccountPropertyModification.createForAddress( - PropertyModificationType.Add, - address, - ); - - expect(() => { - AccountPropertyTransaction.createAddressPropertyModificationTransaction( - Deadline.create(), - PropertyType.Sentinel, - [addressPropertyFilter], - NetworkType.MIJIN_TEST, - ); - }).to.throw(Error, 'Property type is not allowed.'); - - }); - - it('should create mosaic property transaction', () => { - - const mosaicId = new MosaicId([2262289484, 3405110546]); - const mosaicPropertyFilter = AccountPropertyModification.createForMosaic( - PropertyModificationType.Add, - mosaicId, - ); - const mosaicPropertyTransaction = AccountPropertyTransaction.createMosaicPropertyModificationTransaction( - Deadline.create(), - PropertyType.AllowMosaic, - [mosaicPropertyFilter], - NetworkType.MIJIN_TEST, - ); - - const signedTransaction = mosaicPropertyTransaction.signWith(account, generationHash); - - expect(signedTransaction.payload.substring( - 240, - signedTransaction.payload.length, - )).to.be.equal('0201004CCCD78612DDF5CA'); - - }); - - it('should throw exception when create mosaic property transaction with wrong type', () => { - - const mosaicId = new MosaicId([2262289484, 3405110546]); - const mosaicPropertyFilter = AccountPropertyModification.createForMosaic( - PropertyModificationType.Add, - mosaicId, - ); - - expect(() => { - AccountPropertyTransaction.createMosaicPropertyModificationTransaction( - Deadline.create(), - PropertyType.Sentinel, - [mosaicPropertyFilter], - NetworkType.MIJIN_TEST, - ); - }).to.throw(Error, 'Property type is not allowed.'); - - }); - - it('should create entity type property transaction', () => { - - const entityType = TransactionType.ADDRESS_ALIAS; - const entityTypePropertyFilter = AccountPropertyModification.createForEntityType( - PropertyModificationType.Add, - entityType, - ); - const entityTypePropertyTransaction = AccountPropertyTransaction.createEntityTypePropertyModificationTransaction( - Deadline.create(), - PropertyType.AllowTransaction, - [entityTypePropertyFilter], - NetworkType.MIJIN_TEST, - ); - - const signedTransaction = entityTypePropertyTransaction.signWith(account, generationHash); - - expect(signedTransaction.payload.substring( - 240, - signedTransaction.payload.length, - )).to.be.equal('0401004E42'); - - }); -}); diff --git a/test/model/transaction/AccountRestrictionTransaction.spec.ts b/test/model/transaction/AccountRestrictionTransaction.spec.ts new file mode 100644 index 0000000000..04ef489a07 --- /dev/null +++ b/test/model/transaction/AccountRestrictionTransaction.spec.ts @@ -0,0 +1,257 @@ +/* + * Copyright 2019 NEM + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +import {expect} from 'chai'; +import {Account} from '../../../src/model/account/Account'; +import {Address} from '../../../src/model/account/Address'; +import { RestrictionModificationType } from '../../../src/model/account/RestrictionModificationType'; +import { RestrictionType } from '../../../src/model/account/RestrictionType'; +import {NetworkType} from '../../../src/model/blockchain/NetworkType'; +import {MosaicId} from '../../../src/model/mosaic/MosaicId'; +import { AccountRestrictionModification } from '../../../src/model/transaction/AccountRestrictionModification'; +import {AccountRestrictionTransaction} from '../../../src/model/transaction/AccountRestrictionTransaction'; +import {Deadline} from '../../../src/model/transaction/Deadline'; +import { TransactionType } from '../../../src/model/transaction/TransactionType'; +import {UInt64} from '../../../src/model/UInt64'; +import {TestingAccount} from '../../conf/conf.spec'; + +describe('AccountRestrictionTransaction', () => { + let account: Account; + const generationHash = '57F7DA205008026C776CB6AED843393F04CD458E0AA2D9F1D5F31A402072B2D6'; + before(() => { + account = TestingAccount; + }); + it('should create address restriction filter', () => { + const address = Address.createFromRawAddress('SBILTA367K2LX2FEXG5TFWAS7GEFYAGY7QLFBYKC'); + const addressRestrictionFilter = AccountRestrictionModification.createForAddress( + RestrictionModificationType.Add, + address, + ); + expect(addressRestrictionFilter.modificationType).to.be.equal(RestrictionModificationType.Add); + expect(addressRestrictionFilter.value).to.be.equal(address.plain()); + }); + + it('should create mosaic restriction filter', () => { + const mosaicId = new MosaicId([2262289484, 3405110546]); + const mosaicRestrictionFilter = AccountRestrictionModification.createForMosaic( + RestrictionModificationType.Add, + mosaicId, + ); + expect(mosaicRestrictionFilter.modificationType).to.be.equal(RestrictionModificationType.Add); + expect(mosaicRestrictionFilter.value[0]).to.be.equal(mosaicId.id.lower); + expect(mosaicRestrictionFilter.value[1]).to.be.equal(mosaicId.id.higher); + }); + + it('should create operation restriction filter', () => { + const operation = TransactionType.ADDRESS_ALIAS; + const operationRestrictionFilter = AccountRestrictionModification.createForOperation( + RestrictionModificationType.Add, + operation, + ); + expect(operationRestrictionFilter.modificationType).to.be.equal(RestrictionModificationType.Add); + expect(operationRestrictionFilter.value).to.be.equal(operation); + }); + + describe('size', () => { + it('should return 148 for AccountAddressRestrictionModificationTransaction transaction byte size with 1 modification', () => { + const address = Address.createFromRawAddress('SBILTA367K2LX2FEXG5TFWAS7GEFYAGY7QLFBYKC'); + const addressRestrictionFilter = AccountRestrictionModification.createForAddress( + RestrictionModificationType.Add, + address, + ); + const addressRestrictionTransaction = AccountRestrictionTransaction.createAddressRestrictionModificationTransaction( + Deadline.create(), + RestrictionType.AllowAddress, + [addressRestrictionFilter], + NetworkType.MIJIN_TEST, + ); + + expect(addressRestrictionTransaction.size).to.be.equal(148); + }); + + it('should return 131 for AccountMosaicRestrictionModificationTransaction transaction byte size with 1 modification', () => { + const mosaicId = new MosaicId([2262289484, 3405110546]); + const mosaicRestrictionFilter = AccountRestrictionModification.createForMosaic( + RestrictionModificationType.Add, + mosaicId, + ); + const mosaicRestrictionTransaction = AccountRestrictionTransaction.createMosaicRestrictionModificationTransaction( + Deadline.create(), + RestrictionType.AllowMosaic, + [mosaicRestrictionFilter], + NetworkType.MIJIN_TEST, + ); + expect(mosaicRestrictionTransaction.size).to.be.equal(131); + }); + + it('should return 125 for AccountOperationRestrictionModificationTransaction transaction byte size with 1 modification', () => { + const operation = TransactionType.ADDRESS_ALIAS; + const operationRestrictionFilter = AccountRestrictionModification.createForOperation( + RestrictionModificationType.Add, + operation, + ); + const operationRestrictionTransaction = AccountRestrictionTransaction.createOperationRestrictionModificationTransaction( + Deadline.create(), + RestrictionType.AllowTransaction, + [operationRestrictionFilter], + NetworkType.MIJIN_TEST, + ); + expect(operationRestrictionTransaction.size).to.be.equal(125); + }); + }); + + it('should default maxFee field be set to 0', () => { + const address = Address.createFromRawAddress('SBILTA367K2LX2FEXG5TFWAS7GEFYAGY7QLFBYKC'); + const addressRestrictionFilter = AccountRestrictionModification.createForAddress( + RestrictionModificationType.Add, + address, + ); + const addressRestrictionTransaction = AccountRestrictionTransaction.createAddressRestrictionModificationTransaction( + Deadline.create(), + RestrictionType.AllowAddress, + [addressRestrictionFilter], + NetworkType.MIJIN_TEST, + ); + + expect(addressRestrictionTransaction.maxFee.higher).to.be.equal(0); + expect(addressRestrictionTransaction.maxFee.lower).to.be.equal(0); + }); + + it('should filled maxFee override transaction maxFee', () => { + const address = Address.createFromRawAddress('SBILTA367K2LX2FEXG5TFWAS7GEFYAGY7QLFBYKC'); + const addressRestrictionFilter = AccountRestrictionModification.createForAddress( + RestrictionModificationType.Add, + address, + ); + const addressRestrictionTransaction = AccountRestrictionTransaction.createAddressRestrictionModificationTransaction( + Deadline.create(), + RestrictionType.AllowAddress, + [addressRestrictionFilter], + NetworkType.MIJIN_TEST, + new UInt64([1, 0]), + ); + + expect(addressRestrictionTransaction.maxFee.higher).to.be.equal(0); + expect(addressRestrictionTransaction.maxFee.lower).to.be.equal(1); + }); + + it('should create address restriction transaction', () => { + + const address = Address.createFromRawAddress('SBILTA367K2LX2FEXG5TFWAS7GEFYAGY7QLFBYKC'); + const addressRestrictionFilter = AccountRestrictionModification.createForAddress( + RestrictionModificationType.Add, + address, + ); + const addressRestrictionTransaction = AccountRestrictionTransaction.createAddressRestrictionModificationTransaction( + Deadline.create(), + RestrictionType.AllowAddress, + [addressRestrictionFilter], + NetworkType.MIJIN_TEST, + ); + + const signedTransaction = addressRestrictionTransaction.signWith(account, generationHash); + + expect(signedTransaction.payload.substring( + 240, + signedTransaction.payload.length, + )).to.be.equal('0101009050B9837EFAB4BBE8A4B9BB32D812F9885C00D8FC1650E142'); + + }); + + it('should throw exception when create address restriction transaction with wrong type', () => { + + const address = Address.createFromRawAddress('SBILTA367K2LX2FEXG5TFWAS7GEFYAGY7QLFBYKC'); + const addressRestrictionFilter = AccountRestrictionModification.createForAddress( + RestrictionModificationType.Add, + address, + ); + + expect(() => { + AccountRestrictionTransaction.createAddressRestrictionModificationTransaction( + Deadline.create(), + RestrictionType.Sentinel, + [addressRestrictionFilter], + NetworkType.MIJIN_TEST, + ); + }).to.throw(Error, 'Restriction type is not allowed.'); + + }); + + it('should create mosaic restriction transaction', () => { + + const mosaicId = new MosaicId([2262289484, 3405110546]); + const mosaicRestrictionFilter = AccountRestrictionModification.createForMosaic( + RestrictionModificationType.Add, + mosaicId, + ); + const mosaicRestrictionTransaction = AccountRestrictionTransaction.createMosaicRestrictionModificationTransaction( + Deadline.create(), + RestrictionType.AllowMosaic, + [mosaicRestrictionFilter], + NetworkType.MIJIN_TEST, + ); + + const signedTransaction = mosaicRestrictionTransaction.signWith(account, generationHash); + + expect(signedTransaction.payload.substring( + 240, + signedTransaction.payload.length, + )).to.be.equal('0201004CCCD78612DDF5CA'); + + }); + + it('should throw exception when create mosaic restriction transaction with wrong type', () => { + + const mosaicId = new MosaicId([2262289484, 3405110546]); + const mosaicRestrictionFilter = AccountRestrictionModification.createForMosaic( + RestrictionModificationType.Add, + mosaicId, + ); + + expect(() => { + AccountRestrictionTransaction.createMosaicRestrictionModificationTransaction( + Deadline.create(), + RestrictionType.Sentinel, + [mosaicRestrictionFilter], + NetworkType.MIJIN_TEST, + ); + }).to.throw(Error, 'Restriction type is not allowed.'); + + }); + + it('should create operation restriction transaction', () => { + + const operation = TransactionType.ADDRESS_ALIAS; + const operationRestrictionFilter = AccountRestrictionModification.createForOperation( + RestrictionModificationType.Add, + operation, + ); + const operationRestrictionTransaction = AccountRestrictionTransaction.createOperationRestrictionModificationTransaction( + Deadline.create(), + RestrictionType.AllowTransaction, + [operationRestrictionFilter], + NetworkType.MIJIN_TEST, + ); + + const signedTransaction = operationRestrictionTransaction.signWith(account, generationHash); + + expect(signedTransaction.payload.substring( + 240, + signedTransaction.payload.length, + )).to.be.equal('0401004E42'); + + }); +}); diff --git a/test/model/transaction/AggregateTransaction.spec.ts b/test/model/transaction/AggregateTransaction.spec.ts index 3290fcdc24..571df9defe 100644 --- a/test/model/transaction/AggregateTransaction.spec.ts +++ b/test/model/transaction/AggregateTransaction.spec.ts @@ -16,6 +16,7 @@ import {expect} from 'chai'; import {ChronoUnit} from 'js-joda'; +import { TransactionMapping } from '../../../src/core/utils/TransactionMapping'; import {CreateTransactionFromDTO} from '../../../src/infrastructure/transaction/CreateTransactionFromDTO'; import {Account} from '../../../src/model/account/Account'; import {Address} from '../../../src/model/account/Address'; @@ -27,6 +28,8 @@ import {MosaicProperties} from '../../../src/model/mosaic/MosaicProperties'; import {MosaicSupplyType} from '../../../src/model/mosaic/MosaicSupplyType'; import { NetworkCurrencyMosaic } from '../../../src/model/mosaic/NetworkCurrencyMosaic'; import {AggregateTransaction} from '../../../src/model/transaction/AggregateTransaction'; +import { CosignatureSignedTransaction } from '../../../src/model/transaction/CosignatureSignedTransaction'; +import { CosignatureTransaction } from '../../../src/model/transaction/CosignatureTransaction'; import {Deadline} from '../../../src/model/transaction/Deadline'; import {ModifyMultisigAccountTransaction} from '../../../src/model/transaction/ModifyMultisigAccountTransaction'; import {MosaicDefinitionTransaction} from '../../../src/model/transaction/MosaicDefinitionTransaction'; @@ -35,6 +38,7 @@ import {MultisigCosignatoryModification} from '../../../src/model/transaction/Mu import {MultisigCosignatoryModificationType} from '../../../src/model/transaction/MultisigCosignatoryModificationType'; import {PlainMessage} from '../../../src/model/transaction/PlainMessage'; import {RegisterNamespaceTransaction} from '../../../src/model/transaction/RegisterNamespaceTransaction'; +import { TransactionType } from '../../../src/model/transaction/TransactionType'; import {TransferTransaction} from '../../../src/model/transaction/TransferTransaction'; import {UInt64} from '../../../src/model/UInt64'; import {Cosignatory2Account, CosignatoryAccount, MultisigAccount, TestingAccount} from '../../conf/conf.spec'; @@ -80,7 +84,7 @@ describe('AggregateTransaction', () => { [transferTransaction.toAggregate(account.publicAccount)], NetworkType.MIJIN_TEST, [], - new UInt64([1, 0]) + new UInt64([1, 0]), ); expect(aggregateTransaction.maxFee.higher).to.be.equal(0); @@ -382,6 +386,65 @@ describe('AggregateTransaction', () => { }).to.throw(Error, 'Inner transaction cannot be an aggregated transaction.'); }); + it('Should create signed transaction with cosignatories - Aggregated Complete', () => { + /** + * https://github.com/nemtech/nem2-sdk-typescript-javascript/issues/112 + */ + const accountAlice = TestingAccount; + const accountBob = CosignatoryAccount; + const accountCarol = Cosignatory2Account; + + const AtoBTx = TransferTransaction.create(Deadline.create(), + accountBob.address, + [], + PlainMessage.create('a to b'), + NetworkType.MIJIN_TEST); + const BtoATx = TransferTransaction.create(Deadline.create(), + accountAlice.address, + [], + PlainMessage.create('b to a'), + NetworkType.MIJIN_TEST); + const CtoATx = TransferTransaction.create(Deadline.create(), + accountAlice.address, + [], + PlainMessage.create('c to a'), + NetworkType.MIJIN_TEST); + + // 01. Alice creates the aggregated tx and serialize it, Then payload send to Bob & Carol + const aggregateTransactionPayload = AggregateTransaction.createComplete( + Deadline.create(), + [ + AtoBTx.toAggregate(accountAlice.publicAccount), + BtoATx.toAggregate(accountBob.publicAccount), + CtoATx.toAggregate(accountCarol.publicAccount)], + NetworkType.MIJIN_TEST, + [], + ).serialize(); + + // 02.1 Bob cosigns the tx and sends it back to Alice + const signedTxBob = CosignatureTransaction.signTransactionPayload(accountBob, aggregateTransactionPayload, generationHash); + + // 02.2 Carol cosigns the tx and sends it back to Alice + const signedTxCarol = CosignatureTransaction.signTransactionPayload(accountCarol, aggregateTransactionPayload, generationHash); + + // 03. Alice collects the cosignatures, recreate, sign, and announces the transaction + + // First Alice need to append cosignatories to current transaction. + const cosignatureSignedTransactions = [ + new CosignatureSignedTransaction(signedTxBob.parentHash, signedTxBob.signature, signedTxBob.signer), + new CosignatureSignedTransaction(signedTxCarol.parentHash, signedTxCarol.signature, signedTxCarol.signer), + ]; + + const recreatedTx = TransactionMapping.createFromPayload(aggregateTransactionPayload) as AggregateTransaction; + + const signedTransaction = recreatedTx.signTransactionGivenSignatures(accountAlice, cosignatureSignedTransactions, generationHash); + + expect(signedTransaction.type).to.be.equal(TransactionType.AGGREGATE_COMPLETE); + expect(signedTransaction.signer).to.be.equal(accountAlice.publicKey); + expect(signedTransaction.payload.indexOf(accountBob.publicKey) > -1).to.be.true; + expect(signedTransaction.payload.indexOf(accountCarol.publicKey) > -1).to.be.true; + }); + describe('size', () => { it('should return 282 for AggregateTransaction byte size with TransferTransaction with 1 mosaic and message NEM', () => { const transaction = TransferTransaction.create( @@ -402,4 +465,4 @@ describe('AggregateTransaction', () => { expect(aggregateTransaction.size).to.be.equal(120 + 4 + 158); }); }); -}); +}); \ No newline at end of file diff --git a/test/model/transaction/CosignatureTransaction.spec.ts b/test/model/transaction/CosignatureTransaction.spec.ts index 7c9a270780..b3f8de15af 100644 --- a/test/model/transaction/CosignatureTransaction.spec.ts +++ b/test/model/transaction/CosignatureTransaction.spec.ts @@ -17,13 +17,17 @@ import {expect} from 'chai'; import {CreateTransactionFromDTO} from '../../../src/infrastructure/transaction/CreateTransactionFromDTO'; import {Account} from '../../../src/model/account/Account'; +import { NetworkType } from '../../../src/model/blockchain/NetworkType'; import {AggregateTransaction} from '../../../src/model/transaction/AggregateTransaction'; import {CosignatureTransaction} from '../../../src/model/transaction/CosignatureTransaction'; +import { Deadline } from '../../../src/model/transaction/Deadline'; +import { PlainMessage } from '../../../src/model/transaction/PlainMessage'; +import { TransferTransaction } from '../../../src/model/transaction/TransferTransaction'; import {TestingAccount} from '../../conf/conf.spec'; describe('CosignatureTransaction', () => { let account: Account; - + const generationHash = '57F7DA205008026C776CB6AED843393F04CD458E0AA2D9F1D5F31A402072B2D6'; before(() => { account = TestingAccount; }); @@ -112,4 +116,17 @@ describe('CosignatureTransaction', () => { '93D2F8522C8DEAC74BEFBCB61AF6414ADF27B2176D6A24FEF612AA6DB2F562176A11C46BA6D5E05430042CB5705'); expect(cosignatureSignedTransaction.signer).to.be.equal(account.publicKey); }); + + it('should sign a transaction with transaction payload', () => { + const txPayload = TransferTransaction.create(Deadline.create(), + account.address, + [], + PlainMessage.create('a to b'), + NetworkType.MIJIN_TEST).serialize(); + + const signedTx = CosignatureTransaction.signTransactionPayload(account, txPayload, generationHash); + + expect(signedTx.signer).to.be.equal('C2F93346E27CE6AD1A9F8F5E3066F8326593A406BDF357ACB041E2F9AB402EFE'); + expect(signedTx.signer).to.be.equal(account.publicKey); + }); });