diff --git a/package-lock.json b/package-lock.json
index 23d28f283b..a7618ee191 100644
--- a/package-lock.json
+++ b/package-lock.json
@@ -751,6 +751,11 @@
"resolved": "https://registry.npmjs.org/caseless/-/caseless-0.12.0.tgz",
"integrity": "sha1-G2gcIf+EAzyCZUMJBolCDRhxUdw="
},
+ "catbuffer": {
+ "version": "0.0.6-SNAPSHOT",
+ "resolved": "https://registry.npmjs.org/catbuffer/-/catbuffer-0.0.6-SNAPSHOT.tgz",
+ "integrity": "sha512-ipok0XX035s4kMMa/3317u5JzTaE1qS61ZkyB8YMJp/UizGQ7GawwExImDKYp5obzmIw/k5Q/lgrp9UJ0YJuOA=="
+ },
"chai": {
"version": "4.1.2",
"resolved": "https://registry.npmjs.org/chai/-/chai-4.1.2.tgz",
@@ -3716,7 +3721,7 @@
},
"is-fullwidth-code-point": {
"version": "2.0.0",
- "resolved": false,
+ "resolved": "",
"integrity": "sha1-o7MKXE8ZkYMWeqq5O+764937ZU8=",
"dev": true
},
@@ -3754,7 +3759,7 @@
},
"which-module": {
"version": "2.0.0",
- "resolved": false,
+ "resolved": "",
"integrity": "sha1-2e8H3Od7mQK4o6j6SzHD4/fm6Ho=",
"dev": true
},
diff --git a/package.json b/package.json
index 86597a6e6b..ddd14e1ceb 100644
--- a/package.json
+++ b/package.json
@@ -58,6 +58,7 @@
},
"dependencies": {
"bluebird": "^3.5.5",
+ "catbuffer": "0.0.6-SNAPSHOT",
"crypto-js": "^3.1.9-1",
"js-joda": "^1.6.2",
"js-sha256": "^0.9.0",
diff --git a/src/infrastructure/catbuffer/AccountAddressRestrictionTransactionBodyBuilder.ts b/src/infrastructure/catbuffer/AccountAddressRestrictionTransactionBodyBuilder.ts
deleted file mode 100644
index c3cddcb5dd..0000000000
--- a/src/infrastructure/catbuffer/AccountAddressRestrictionTransactionBodyBuilder.ts
+++ /dev/null
@@ -1,162 +0,0 @@
-// tslint:disable: jsdoc-format
-/**
-*** Copyright (c) 2016-present,
-*** Jaguar0625, gimre, BloodyRookie, Tech Bureau, Corp. All rights reserved.
-***
-*** This file is part of Catapult.
-***
-*** Catapult is free software: you can redistribute it and/or modify
-*** it under the terms of the GNU Lesser General Public License as published by
-*** the Free Software Foundation, either version 3 of the License, or
-*** (at your option) any later version.
-***
-*** Catapult is distributed in the hope that it will be useful,
-*** but WITHOUT ANY WARRANTY; without even the implied warranty of
-*** MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-*** GNU Lesser General Public License for more details.
-***
-*** You should have received a copy of the GNU Lesser General Public License
-*** along with Catapult. If not, see .
-**/
-
-import { GeneratorUtils } from './GeneratorUtils';
-import { UnresolvedAddressDto } from './UnresolvedAddressDto';
-
-/** Binary layout for an account address restriction transaction. */
-export class AccountAddressRestrictionTransactionBodyBuilder {
- /** Account restriction flags. */
- restrictionFlags: number;
- /** Reserved padding to align restrictionAdditions on 8-byte boundary. */
- accountRestrictionTransactionBody_Reserved1: number;
- /** Account restriction additions. */
- restrictionAdditions: UnresolvedAddressDto[];
- /** Account restriction deletions. */
- restrictionDeletions: UnresolvedAddressDto[];
-
- /**
- * Constructor.
- *
- * @param restrictionFlags Account restriction flags.
- * @param restrictionAdditions Account restriction additions.
- * @param restrictionDeletions Account restriction deletions.
- */
- // tslint:disable-next-line: max-line-length
- public constructor(restrictionFlags: number, restrictionAdditions: UnresolvedAddressDto[], restrictionDeletions: UnresolvedAddressDto[]) {
- this.restrictionFlags = restrictionFlags;
- this.accountRestrictionTransactionBody_Reserved1 = 0;
- this.restrictionAdditions = restrictionAdditions;
- this.restrictionDeletions = restrictionDeletions;
- }
-
- /**
- * Creates an instance of AccountAddressRestrictionTransactionBodyBuilder from binary payload.
- *
- * @param payload Byte payload to use to serialize the object.
- * @return Instance of AccountAddressRestrictionTransactionBodyBuilder.
- */
- public static loadFromBinary(payload: Uint8Array): AccountAddressRestrictionTransactionBodyBuilder {
- const byteArray = Array.from(payload);
- const restrictionFlags = GeneratorUtils.bufferToUint(GeneratorUtils.getBytes(Uint8Array.from(byteArray), 2));
- byteArray.splice(0, 2);
- const restrictionAdditionsCount = GeneratorUtils.bufferToUint(GeneratorUtils.getBytes(Uint8Array.from(byteArray), 1));
- byteArray.splice(0, 1);
- const restrictionDeletionsCount = GeneratorUtils.bufferToUint(GeneratorUtils.getBytes(Uint8Array.from(byteArray), 1));
- byteArray.splice(0, 1);
- // tslint:disable-next-line: max-line-length
- const accountRestrictionTransactionBody_Reserved1 = GeneratorUtils.bufferToUint(GeneratorUtils.getBytes(Uint8Array.from(byteArray), 4));
- byteArray.splice(0, 4);
- const restrictionAdditions: UnresolvedAddressDto[] = [];
- for (let i = 0; i < restrictionAdditionsCount; i++) {
- const item = UnresolvedAddressDto.loadFromBinary(Uint8Array.from(byteArray));
- restrictionAdditions.push(item);
- byteArray.splice(0, item.getSize());
- }
- const restrictionDeletions: UnresolvedAddressDto[] = [];
- for (let i = 0; i < restrictionDeletionsCount; i++) {
- const item = UnresolvedAddressDto.loadFromBinary(Uint8Array.from(byteArray));
- restrictionDeletions.push(item);
- byteArray.splice(0, item.getSize());
- }
- // tslint:disable-next-line: max-line-length
- return new AccountAddressRestrictionTransactionBodyBuilder(restrictionFlags, restrictionAdditions, restrictionDeletions);
- }
-
- /**
- * Gets account restriction flags.
- *
- * @return Account restriction flags.
- */
- public getRestrictionFlags(): number {
- return this.restrictionFlags;
- }
-
- /**
- * Gets reserved padding to align restrictionAdditions on 8-byte boundary.
- *
- * @return Reserved padding to align restrictionAdditions on 8-byte boundary.
- */
- public getAccountRestrictionTransactionBody_Reserved1(): number {
- return this.accountRestrictionTransactionBody_Reserved1;
- }
-
- /**
- * Gets account restriction additions.
- *
- * @return Account restriction additions.
- */
- public getRestrictionAdditions(): UnresolvedAddressDto[] {
- return this.restrictionAdditions;
- }
-
- /**
- * Gets account restriction deletions.
- *
- * @return Account restriction deletions.
- */
- public getRestrictionDeletions(): UnresolvedAddressDto[] {
- return this.restrictionDeletions;
- }
-
- /**
- * Gets the size of the object.
- *
- * @return Size in bytes.
- */
- public getSize(): number {
- let size = 0;
- size += 2; // restrictionFlags
- size += 1; // restrictionAdditionsCount
- size += 1; // restrictionDeletionsCount
- size += 4; // accountRestrictionTransactionBody_Reserved1
- this.restrictionAdditions.forEach((o) => size += o.getSize());
- this.restrictionDeletions.forEach((o) => size += o.getSize());
- return size;
- }
-
- /**
- * Serializes an object to bytes.
- *
- * @return Serialized bytes.
- */
- public serialize(): Uint8Array {
- let newArray = Uint8Array.from([]);
- const restrictionFlagsBytes = GeneratorUtils.uintToBuffer(this.getRestrictionFlags(), 2);
- newArray = GeneratorUtils.concatTypedArrays(newArray, restrictionFlagsBytes);
- const restrictionAdditionsCountBytes = GeneratorUtils.uintToBuffer(this.restrictionAdditions.length, 1);
- newArray = GeneratorUtils.concatTypedArrays(newArray, restrictionAdditionsCountBytes);
- const restrictionDeletionsCountBytes = GeneratorUtils.uintToBuffer(this.restrictionDeletions.length, 1);
- newArray = GeneratorUtils.concatTypedArrays(newArray, restrictionDeletionsCountBytes);
- // tslint:disable-next-line: max-line-length
- const accountRestrictionTransactionBody_Reserved1Bytes = GeneratorUtils.uintToBuffer(this.getAccountRestrictionTransactionBody_Reserved1(), 4);
- newArray = GeneratorUtils.concatTypedArrays(newArray, accountRestrictionTransactionBody_Reserved1Bytes);
- this.restrictionAdditions.forEach((item) => {
- const restrictionAdditionsBytes = item.serialize();
- newArray = GeneratorUtils.concatTypedArrays(newArray, restrictionAdditionsBytes);
- });
- this.restrictionDeletions.forEach((item) => {
- const restrictionDeletionsBytes = item.serialize();
- newArray = GeneratorUtils.concatTypedArrays(newArray, restrictionDeletionsBytes);
- });
- return newArray;
- }
-}
diff --git a/src/infrastructure/catbuffer/AccountAddressRestrictionTransactionBuilder.ts b/src/infrastructure/catbuffer/AccountAddressRestrictionTransactionBuilder.ts
deleted file mode 100644
index 9233c5f45e..0000000000
--- a/src/infrastructure/catbuffer/AccountAddressRestrictionTransactionBuilder.ts
+++ /dev/null
@@ -1,136 +0,0 @@
-// tslint:disable: jsdoc-format
-/**
-*** Copyright (c) 2016-present,
-*** Jaguar0625, gimre, BloodyRookie, Tech Bureau, Corp. All rights reserved.
-***
-*** This file is part of Catapult.
-***
-*** Catapult is free software: you can redistribute it and/or modify
-*** it under the terms of the GNU Lesser General Public License as published by
-*** the Free Software Foundation, either version 3 of the License, or
-*** (at your option) any later version.
-***
-*** Catapult is distributed in the hope that it will be useful,
-*** but WITHOUT ANY WARRANTY; without even the implied warranty of
-*** MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-*** GNU Lesser General Public License for more details.
-***
-*** You should have received a copy of the GNU Lesser General Public License
-*** along with Catapult. If not, see .
-**/
-
-import { AccountAddressRestrictionTransactionBodyBuilder } from './AccountAddressRestrictionTransactionBodyBuilder';
-import { AmountDto } from './AmountDto';
-import { EntityTypeDto } from './EntityTypeDto';
-import { GeneratorUtils } from './GeneratorUtils';
-import { KeyDto } from './KeyDto';
-import { NetworkTypeDto } from './NetworkTypeDto';
-import { SignatureDto } from './SignatureDto';
-import { TimestampDto } from './TimestampDto';
-import { TransactionBuilder } from './TransactionBuilder';
-import { UnresolvedAddressDto } from './UnresolvedAddressDto';
-
-/** Binary layout for a non-embedded account address restriction transaction. */
-export class AccountAddressRestrictionTransactionBuilder extends TransactionBuilder {
- /** Account address restriction transaction body. */
- accountAddressRestrictionTransactionBody: AccountAddressRestrictionTransactionBodyBuilder;
-
- /**
- * Constructor.
- *
- * @param signature Entity signature.
- * @param signerPublicKey Entity signer's public key.
- * @param version Entity version.
- * @param network Entity network.
- * @param type Entity type.
- * @param fee Transaction fee.
- * @param deadline Transaction deadline.
- * @param restrictionFlags Account restriction flags.
- * @param restrictionAdditions Account restriction additions.
- * @param restrictionDeletions Account restriction deletions.
- */
- // tslint:disable-next-line: max-line-length
- public constructor(signature: SignatureDto, signerPublicKey: KeyDto, version: number, network: NetworkTypeDto, type: EntityTypeDto, fee: AmountDto, deadline: TimestampDto, restrictionFlags: number, restrictionAdditions: UnresolvedAddressDto[], restrictionDeletions: UnresolvedAddressDto[]) {
- super(signature, signerPublicKey, version, network, type, fee, deadline);
- // tslint:disable-next-line: max-line-length
- this.accountAddressRestrictionTransactionBody = new AccountAddressRestrictionTransactionBodyBuilder(restrictionFlags, restrictionAdditions, restrictionDeletions);
- }
-
- /**
- * Creates an instance of AccountAddressRestrictionTransactionBuilder from binary payload.
- *
- * @param payload Byte payload to use to serialize the object.
- * @return Instance of AccountAddressRestrictionTransactionBuilder.
- */
- public static loadFromBinary(payload: Uint8Array): AccountAddressRestrictionTransactionBuilder {
- const byteArray = Array.from(payload);
- const superObject = TransactionBuilder.loadFromBinary(Uint8Array.from(byteArray));
- byteArray.splice(0, superObject.getSize());
- // tslint:disable-next-line: max-line-length
- const accountAddressRestrictionTransactionBody = AccountAddressRestrictionTransactionBodyBuilder.loadFromBinary(Uint8Array.from(byteArray));
- byteArray.splice(0, accountAddressRestrictionTransactionBody.getSize());
- // tslint:disable-next-line: max-line-length
- return new AccountAddressRestrictionTransactionBuilder(superObject.signature, superObject.signerPublicKey, superObject.version, superObject.network, superObject.type, superObject.fee, superObject.deadline, accountAddressRestrictionTransactionBody.restrictionFlags, accountAddressRestrictionTransactionBody.restrictionAdditions, accountAddressRestrictionTransactionBody.restrictionDeletions);
- }
-
- /**
- * Gets account restriction flags.
- *
- * @return Account restriction flags.
- */
- public getRestrictionFlags(): number {
- return this.accountAddressRestrictionTransactionBody.getRestrictionFlags();
- }
-
- /**
- * Gets reserved padding to align restrictionAdditions on 8-byte boundary.
- *
- * @return Reserved padding to align restrictionAdditions on 8-byte boundary.
- */
- public getAccountRestrictionTransactionBody_Reserved1(): number {
- return this.accountAddressRestrictionTransactionBody.getAccountRestrictionTransactionBody_Reserved1();
- }
-
- /**
- * Gets account restriction additions.
- *
- * @return Account restriction additions.
- */
- public getRestrictionAdditions(): UnresolvedAddressDto[] {
- return this.accountAddressRestrictionTransactionBody.getRestrictionAdditions();
- }
-
- /**
- * Gets account restriction deletions.
- *
- * @return Account restriction deletions.
- */
- public getRestrictionDeletions(): UnresolvedAddressDto[] {
- return this.accountAddressRestrictionTransactionBody.getRestrictionDeletions();
- }
-
- /**
- * Gets the size of the object.
- *
- * @return Size in bytes.
- */
- public getSize(): number {
- let size: number = super.getSize();
- size += this.accountAddressRestrictionTransactionBody.getSize();
- return size;
- }
-
- /**
- * Serializes an object to bytes.
- *
- * @return Serialized bytes.
- */
- public serialize(): Uint8Array {
- let newArray = Uint8Array.from([]);
- const superBytes = super.serialize();
- newArray = GeneratorUtils.concatTypedArrays(newArray, superBytes);
- const accountAddressRestrictionTransactionBodyBytes = this.accountAddressRestrictionTransactionBody.serialize();
- newArray = GeneratorUtils.concatTypedArrays(newArray, accountAddressRestrictionTransactionBodyBytes);
- return newArray;
- }
-}
diff --git a/src/infrastructure/catbuffer/AccountLinkActionDto.ts b/src/infrastructure/catbuffer/AccountLinkActionDto.ts
deleted file mode 100644
index 196ab88465..0000000000
--- a/src/infrastructure/catbuffer/AccountLinkActionDto.ts
+++ /dev/null
@@ -1,29 +0,0 @@
-// tslint:disable: jsdoc-format
-/**
-*** Copyright (c) 2016-present,
-*** Jaguar0625, gimre, BloodyRookie, Tech Bureau, Corp. All rights reserved.
-***
-*** This file is part of Catapult.
-***
-*** Catapult is free software: you can redistribute it and/or modify
-*** it under the terms of the GNU Lesser General Public License as published by
-*** the Free Software Foundation, either version 3 of the License, or
-*** (at your option) any later version.
-***
-*** Catapult is distributed in the hope that it will be useful,
-*** but WITHOUT ANY WARRANTY; without even the implied warranty of
-*** MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-*** GNU Lesser General Public License for more details.
-***
-*** You should have received a copy of the GNU Lesser General Public License
-*** along with Catapult. If not, see .
-**/
-
-
-/** Enumeration of account link actions. */
-export enum AccountLinkActionDto {
- /** Unlink account. */
- UNLINK = 0,
- /** Link account. */
- LINK = 1,
-}
diff --git a/src/infrastructure/catbuffer/AccountLinkTransactionBodyBuilder.ts b/src/infrastructure/catbuffer/AccountLinkTransactionBodyBuilder.ts
deleted file mode 100644
index 2b85496f6a..0000000000
--- a/src/infrastructure/catbuffer/AccountLinkTransactionBodyBuilder.ts
+++ /dev/null
@@ -1,102 +0,0 @@
-// tslint:disable: jsdoc-format
-/**
-*** Copyright (c) 2016-present,
-*** Jaguar0625, gimre, BloodyRookie, Tech Bureau, Corp. All rights reserved.
-***
-*** This file is part of Catapult.
-***
-*** Catapult is free software: you can redistribute it and/or modify
-*** it under the terms of the GNU Lesser General Public License as published by
-*** the Free Software Foundation, either version 3 of the License, or
-*** (at your option) any later version.
-***
-*** Catapult is distributed in the hope that it will be useful,
-*** but WITHOUT ANY WARRANTY; without even the implied warranty of
-*** MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-*** GNU Lesser General Public License for more details.
-***
-*** You should have received a copy of the GNU Lesser General Public License
-*** along with Catapult. If not, see .
-**/
-
-import { AccountLinkActionDto } from './AccountLinkActionDto';
-import { GeneratorUtils } from './GeneratorUtils';
-import { KeyDto } from './KeyDto';
-
-/** Binary layout for an account link transaction. */
-export class AccountLinkTransactionBodyBuilder {
- /** Remote public key. */
- remotePublicKey: KeyDto;
- /** Account link action. */
- linkAction: AccountLinkActionDto;
-
- /**
- * Constructor.
- *
- * @param remotePublicKey Remote public key.
- * @param linkAction Account link action.
- */
- public constructor(remotePublicKey: KeyDto, linkAction: AccountLinkActionDto) {
- this.remotePublicKey = remotePublicKey;
- this.linkAction = linkAction;
- }
-
- /**
- * Creates an instance of AccountLinkTransactionBodyBuilder from binary payload.
- *
- * @param payload Byte payload to use to serialize the object.
- * @return Instance of AccountLinkTransactionBodyBuilder.
- */
- public static loadFromBinary(payload: Uint8Array): AccountLinkTransactionBodyBuilder {
- const byteArray = Array.from(payload);
- const remotePublicKey = KeyDto.loadFromBinary(Uint8Array.from(byteArray));
- byteArray.splice(0, remotePublicKey.getSize());
- const linkAction = GeneratorUtils.bufferToUint(GeneratorUtils.getBytes(Uint8Array.from(byteArray), 1));
- byteArray.splice(0, 1);
- return new AccountLinkTransactionBodyBuilder(remotePublicKey, linkAction);
- }
-
- /**
- * Gets remote public key.
- *
- * @return Remote public key.
- */
- public getRemotePublicKey(): KeyDto {
- return this.remotePublicKey;
- }
-
- /**
- * Gets account link action.
- *
- * @return Account link action.
- */
- public getLinkAction(): AccountLinkActionDto {
- return this.linkAction;
- }
-
- /**
- * Gets the size of the object.
- *
- * @return Size in bytes.
- */
- public getSize(): number {
- let size = 0;
- size += this.remotePublicKey.getSize();
- size += 1; // linkAction
- return size;
- }
-
- /**
- * Serializes an object to bytes.
- *
- * @return Serialized bytes.
- */
- public serialize(): Uint8Array {
- let newArray = Uint8Array.from([]);
- const remotePublicKeyBytes = this.remotePublicKey.serialize();
- newArray = GeneratorUtils.concatTypedArrays(newArray, remotePublicKeyBytes);
- const linkActionBytes = GeneratorUtils.uintToBuffer(this.linkAction, 1);
- newArray = GeneratorUtils.concatTypedArrays(newArray, linkActionBytes);
- return newArray;
- }
-}
diff --git a/src/infrastructure/catbuffer/AccountLinkTransactionBuilder.ts b/src/infrastructure/catbuffer/AccountLinkTransactionBuilder.ts
deleted file mode 100644
index d4b50f1f5f..0000000000
--- a/src/infrastructure/catbuffer/AccountLinkTransactionBuilder.ts
+++ /dev/null
@@ -1,115 +0,0 @@
-// tslint:disable: jsdoc-format
-/**
-*** Copyright (c) 2016-present,
-*** Jaguar0625, gimre, BloodyRookie, Tech Bureau, Corp. All rights reserved.
-***
-*** This file is part of Catapult.
-***
-*** Catapult is free software: you can redistribute it and/or modify
-*** it under the terms of the GNU Lesser General Public License as published by
-*** the Free Software Foundation, either version 3 of the License, or
-*** (at your option) any later version.
-***
-*** Catapult is distributed in the hope that it will be useful,
-*** but WITHOUT ANY WARRANTY; without even the implied warranty of
-*** MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-*** GNU Lesser General Public License for more details.
-***
-*** You should have received a copy of the GNU Lesser General Public License
-*** along with Catapult. If not, see .
-**/
-
-import { AccountLinkActionDto } from './AccountLinkActionDto';
-import { AccountLinkTransactionBodyBuilder } from './AccountLinkTransactionBodyBuilder';
-import { AmountDto } from './AmountDto';
-import { EntityTypeDto } from './EntityTypeDto';
-import { GeneratorUtils } from './GeneratorUtils';
-import { KeyDto } from './KeyDto';
-import { NetworkTypeDto } from './NetworkTypeDto';
-import { SignatureDto } from './SignatureDto';
-import { TimestampDto } from './TimestampDto';
-import { TransactionBuilder } from './TransactionBuilder';
-
-/** Binary layout for a non-embedded account link transaction. */
-export class AccountLinkTransactionBuilder extends TransactionBuilder {
- /** Account link transaction body. */
- accountLinkTransactionBody: AccountLinkTransactionBodyBuilder;
-
- /**
- * Constructor.
- *
- * @param signature Entity signature.
- * @param signerPublicKey Entity signer's public key.
- * @param version Entity version.
- * @param network Entity network.
- * @param type Entity type.
- * @param fee Transaction fee.
- * @param deadline Transaction deadline.
- * @param remotePublicKey Remote public key.
- * @param linkAction Account link action.
- */
- // tslint:disable-next-line: max-line-length
- public constructor(signature: SignatureDto, signerPublicKey: KeyDto, version: number, network: NetworkTypeDto, type: EntityTypeDto, fee: AmountDto, deadline: TimestampDto, remotePublicKey: KeyDto, linkAction: AccountLinkActionDto) {
- super(signature, signerPublicKey, version, network, type, fee, deadline);
- this.accountLinkTransactionBody = new AccountLinkTransactionBodyBuilder(remotePublicKey, linkAction);
- }
-
- /**
- * Creates an instance of AccountLinkTransactionBuilder from binary payload.
- *
- * @param payload Byte payload to use to serialize the object.
- * @return Instance of AccountLinkTransactionBuilder.
- */
- public static loadFromBinary(payload: Uint8Array): AccountLinkTransactionBuilder {
- const byteArray = Array.from(payload);
- const superObject = TransactionBuilder.loadFromBinary(Uint8Array.from(byteArray));
- byteArray.splice(0, superObject.getSize());
- const accountLinkTransactionBody = AccountLinkTransactionBodyBuilder.loadFromBinary(Uint8Array.from(byteArray));
- byteArray.splice(0, accountLinkTransactionBody.getSize());
- // tslint:disable-next-line: max-line-length
- return new AccountLinkTransactionBuilder(superObject.signature, superObject.signerPublicKey, superObject.version, superObject.network, superObject.type, superObject.fee, superObject.deadline, accountLinkTransactionBody.remotePublicKey, accountLinkTransactionBody.linkAction);
- }
-
- /**
- * Gets remote public key.
- *
- * @return Remote public key.
- */
- public getRemotePublicKey(): KeyDto {
- return this.accountLinkTransactionBody.getRemotePublicKey();
- }
-
- /**
- * Gets account link action.
- *
- * @return Account link action.
- */
- public getLinkAction(): AccountLinkActionDto {
- return this.accountLinkTransactionBody.getLinkAction();
- }
-
- /**
- * Gets the size of the object.
- *
- * @return Size in bytes.
- */
- public getSize(): number {
- let size: number = super.getSize();
- size += this.accountLinkTransactionBody.getSize();
- return size;
- }
-
- /**
- * Serializes an object to bytes.
- *
- * @return Serialized bytes.
- */
- public serialize(): Uint8Array {
- let newArray = Uint8Array.from([]);
- const superBytes = super.serialize();
- newArray = GeneratorUtils.concatTypedArrays(newArray, superBytes);
- const accountLinkTransactionBodyBytes = this.accountLinkTransactionBody.serialize();
- newArray = GeneratorUtils.concatTypedArrays(newArray, accountLinkTransactionBodyBytes);
- return newArray;
- }
-}
diff --git a/src/infrastructure/catbuffer/AccountMetadataTransactionBodyBuilder.ts b/src/infrastructure/catbuffer/AccountMetadataTransactionBodyBuilder.ts
deleted file mode 100644
index 32353f22c9..0000000000
--- a/src/infrastructure/catbuffer/AccountMetadataTransactionBodyBuilder.ts
+++ /dev/null
@@ -1,147 +0,0 @@
-// tslint:disable: jsdoc-format
-/**
-*** Copyright (c) 2016-present,
-*** Jaguar0625, gimre, BloodyRookie, Tech Bureau, Corp. All rights reserved.
-***
-*** This file is part of Catapult.
-***
-*** Catapult is free software: you can redistribute it and/or modify
-*** it under the terms of the GNU Lesser General Public License as published by
-*** the Free Software Foundation, either version 3 of the License, or
-*** (at your option) any later version.
-***
-*** Catapult is distributed in the hope that it will be useful,
-*** but WITHOUT ANY WARRANTY; without even the implied warranty of
-*** MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-*** GNU Lesser General Public License for more details.
-***
-*** You should have received a copy of the GNU Lesser General Public License
-*** along with Catapult. If not, see .
-**/
-
-import { GeneratorUtils } from './GeneratorUtils';
-import { KeyDto } from './KeyDto';
-
-/** Binary layout for an account metadata transaction. */
-export class AccountMetadataTransactionBodyBuilder {
- /** Metadata target public key. */
- targetPublicKey: KeyDto;
- /** Metadata key scoped to source, target and type. */
- scopedMetadataKey: number[];
- /** Change in value size in bytes. */
- valueSizeDelta: number;
- /** Difference between existing value and new value \note when there is no existing value, new value is same this value \note when there is an existing value, new value is calculated as xor(previous-value, value). */
- value: Uint8Array;
-
- /**
- * Constructor.
- *
- * @param targetPublicKey Metadata target public key.
- * @param scopedMetadataKey Metadata key scoped to source, target and type.
- * @param valueSizeDelta Change in value size in bytes.
- * @param value Difference between existing value and new value.
- * @note when there is no existing value, new value is same this value.
- * @note when there is an existing value, new value is calculated as xor(previous-value, value).
- */
- public constructor(targetPublicKey: KeyDto, scopedMetadataKey: number[], valueSizeDelta: number, value: Uint8Array) {
- this.targetPublicKey = targetPublicKey;
- this.scopedMetadataKey = scopedMetadataKey;
- this.valueSizeDelta = valueSizeDelta;
- this.value = value;
- }
-
- /**
- * Creates an instance of AccountMetadataTransactionBodyBuilder from binary payload.
- *
- * @param payload Byte payload to use to serialize the object.
- * @return Instance of AccountMetadataTransactionBodyBuilder.
- */
- public static loadFromBinary(payload: Uint8Array): AccountMetadataTransactionBodyBuilder {
- const byteArray = Array.from(payload);
- const targetPublicKey = KeyDto.loadFromBinary(Uint8Array.from(byteArray));
- byteArray.splice(0, targetPublicKey.getSize());
- const scopedMetadataKey = GeneratorUtils.bufferToUint64(GeneratorUtils.getBytes(Uint8Array.from(byteArray), 8));
- byteArray.splice(0, 8);
- const valueSizeDelta = GeneratorUtils.bufferToUint(GeneratorUtils.getBytes(Uint8Array.from(byteArray), 2));
- byteArray.splice(0, 2);
- const valueSize = GeneratorUtils.bufferToUint(GeneratorUtils.getBytes(Uint8Array.from(byteArray), 2));
- byteArray.splice(0, 2);
- const value = GeneratorUtils.getBytes(Uint8Array.from(byteArray), valueSize);
- byteArray.splice(0, valueSize);
- return new AccountMetadataTransactionBodyBuilder(targetPublicKey, scopedMetadataKey, valueSizeDelta, value);
- }
-
- /**
- * Gets metadata target public key.
- *
- * @return Metadata target public key.
- */
- public getTargetPublicKey(): KeyDto {
- return this.targetPublicKey;
- }
-
- /**
- * Gets metadata key scoped to source, target and type.
- *
- * @return Metadata key scoped to source, target and type.
- */
- public getScopedMetadataKey(): number[] {
- return this.scopedMetadataKey;
- }
-
- /**
- * Gets change in value size in bytes.
- *
- * @return Change in value size in bytes.
- */
- public getValueSizeDelta(): number {
- return this.valueSizeDelta;
- }
-
- /**
- * Gets difference between existing value and new value.
- * @note when there is no existing value, new value is same this value.
- * @note when there is an existing value, new value is calculated as xor(previous-value, value).
- *
- * @return Difference between existing value and new value.
- * @note when there is no existing value, new value is same this value.
- * @note when there is an existing value, new value is calculated as xor(previous-value, value).
- */
- public getValue(): Uint8Array {
- return this.value;
- }
-
- /**
- * Gets the size of the object.
- *
- * @return Size in bytes.
- */
- public getSize(): number {
- let size = 0;
- size += this.targetPublicKey.getSize();
- size += 8; // scopedMetadataKey
- size += 2; // valueSizeDelta
- size += 2; // valueSize
- size += this.value.length;
- return size;
- }
-
- /**
- * Serializes an object to bytes.
- *
- * @return Serialized bytes.
- */
- public serialize(): Uint8Array {
- let newArray = Uint8Array.from([]);
- const targetPublicKeyBytes = this.targetPublicKey.serialize();
- newArray = GeneratorUtils.concatTypedArrays(newArray, targetPublicKeyBytes);
- const scopedMetadataKeyBytes = GeneratorUtils.uint64ToBuffer(this.getScopedMetadataKey());
- newArray = GeneratorUtils.concatTypedArrays(newArray, scopedMetadataKeyBytes);
- const valueSizeDeltaBytes = GeneratorUtils.uintToBuffer(this.getValueSizeDelta(), 2);
- newArray = GeneratorUtils.concatTypedArrays(newArray, valueSizeDeltaBytes);
- const valueSizeBytes = GeneratorUtils.uintToBuffer(this.value.length, 2);
- newArray = GeneratorUtils.concatTypedArrays(newArray, valueSizeBytes);
- newArray = GeneratorUtils.concatTypedArrays(newArray, this.value);
- return newArray;
- }
-}
diff --git a/src/infrastructure/catbuffer/AccountMetadataTransactionBuilder.ts b/src/infrastructure/catbuffer/AccountMetadataTransactionBuilder.ts
deleted file mode 100644
index 6034b59dd7..0000000000
--- a/src/infrastructure/catbuffer/AccountMetadataTransactionBuilder.ts
+++ /dev/null
@@ -1,141 +0,0 @@
-// tslint:disable: jsdoc-format
-/**
-*** Copyright (c) 2016-present,
-*** Jaguar0625, gimre, BloodyRookie, Tech Bureau, Corp. All rights reserved.
-***
-*** This file is part of Catapult.
-***
-*** Catapult is free software: you can redistribute it and/or modify
-*** it under the terms of the GNU Lesser General Public License as published by
-*** the Free Software Foundation, either version 3 of the License, or
-*** (at your option) any later version.
-***
-*** Catapult is distributed in the hope that it will be useful,
-*** but WITHOUT ANY WARRANTY; without even the implied warranty of
-*** MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-*** GNU Lesser General Public License for more details.
-***
-*** You should have received a copy of the GNU Lesser General Public License
-*** along with Catapult. If not, see .
-**/
-
-import { AccountMetadataTransactionBodyBuilder } from './AccountMetadataTransactionBodyBuilder';
-import { AmountDto } from './AmountDto';
-import { EntityTypeDto } from './EntityTypeDto';
-import { GeneratorUtils } from './GeneratorUtils';
-import { KeyDto } from './KeyDto';
-import { NetworkTypeDto } from './NetworkTypeDto';
-import { SignatureDto } from './SignatureDto';
-import { TimestampDto } from './TimestampDto';
-import { TransactionBuilder } from './TransactionBuilder';
-
-/** Binary layout for a non-embedded account metadata transaction. */
-export class AccountMetadataTransactionBuilder extends TransactionBuilder {
- /** Account metadata transaction body. */
- accountMetadataTransactionBody: AccountMetadataTransactionBodyBuilder;
-
- /**
- * Constructor.
- *
- * @param signature Entity signature.
- * @param signerPublicKey Entity signer's public key.
- * @param version Entity version.
- * @param network Entity network.
- * @param type Entity type.
- * @param fee Transaction fee.
- * @param deadline Transaction deadline.
- * @param targetPublicKey Metadata target public key.
- * @param scopedMetadataKey Metadata key scoped to source, target and type.
- * @param valueSizeDelta Change in value size in bytes.
- * @param value Difference between existing value and new value.
- * @note when there is no existing value, new value is same this value.
- * @note when there is an existing value, new value is calculated as xor(previous-value, value).
- */
- // tslint:disable-next-line: max-line-length
- public constructor(signature: SignatureDto, signerPublicKey: KeyDto, version: number, network: NetworkTypeDto, type: EntityTypeDto, fee: AmountDto, deadline: TimestampDto, targetPublicKey: KeyDto, scopedMetadataKey: number[], valueSizeDelta: number, value: Uint8Array) {
- super(signature, signerPublicKey, version, network, type, fee, deadline);
- // tslint:disable-next-line: max-line-length
- this.accountMetadataTransactionBody = new AccountMetadataTransactionBodyBuilder(targetPublicKey, scopedMetadataKey, valueSizeDelta, value);
- }
-
- /**
- * Creates an instance of AccountMetadataTransactionBuilder from binary payload.
- *
- * @param payload Byte payload to use to serialize the object.
- * @return Instance of AccountMetadataTransactionBuilder.
- */
- public static loadFromBinary(payload: Uint8Array): AccountMetadataTransactionBuilder {
- const byteArray = Array.from(payload);
- const superObject = TransactionBuilder.loadFromBinary(Uint8Array.from(byteArray));
- byteArray.splice(0, superObject.getSize());
- const accountMetadataTransactionBody = AccountMetadataTransactionBodyBuilder.loadFromBinary(Uint8Array.from(byteArray));
- byteArray.splice(0, accountMetadataTransactionBody.getSize());
- // tslint:disable-next-line: max-line-length
- return new AccountMetadataTransactionBuilder(superObject.signature, superObject.signerPublicKey, superObject.version, superObject.network, superObject.type, superObject.fee, superObject.deadline, accountMetadataTransactionBody.targetPublicKey, accountMetadataTransactionBody.scopedMetadataKey, accountMetadataTransactionBody.valueSizeDelta, accountMetadataTransactionBody.value);
- }
-
- /**
- * Gets metadata target public key.
- *
- * @return Metadata target public key.
- */
- public getTargetPublicKey(): KeyDto {
- return this.accountMetadataTransactionBody.getTargetPublicKey();
- }
-
- /**
- * Gets metadata key scoped to source, target and type.
- *
- * @return Metadata key scoped to source, target and type.
- */
- public getScopedMetadataKey(): number[] {
- return this.accountMetadataTransactionBody.getScopedMetadataKey();
- }
-
- /**
- * Gets change in value size in bytes.
- *
- * @return Change in value size in bytes.
- */
- public getValueSizeDelta(): number {
- return this.accountMetadataTransactionBody.getValueSizeDelta();
- }
-
- /**
- * Gets difference between existing value and new value.
- * @note when there is no existing value, new value is same this value.
- * @note when there is an existing value, new value is calculated as xor(previous-value, value).
- *
- * @return Difference between existing value and new value.
- * @note when there is no existing value, new value is same this value.
- * @note when there is an existing value, new value is calculated as xor(previous-value, value).
- */
- public getValue(): Uint8Array {
- return this.accountMetadataTransactionBody.getValue();
- }
-
- /**
- * Gets the size of the object.
- *
- * @return Size in bytes.
- */
- public getSize(): number {
- let size: number = super.getSize();
- size += this.accountMetadataTransactionBody.getSize();
- return size;
- }
-
- /**
- * Serializes an object to bytes.
- *
- * @return Serialized bytes.
- */
- public serialize(): Uint8Array {
- let newArray = Uint8Array.from([]);
- const superBytes = super.serialize();
- newArray = GeneratorUtils.concatTypedArrays(newArray, superBytes);
- const accountMetadataTransactionBodyBytes = this.accountMetadataTransactionBody.serialize();
- newArray = GeneratorUtils.concatTypedArrays(newArray, accountMetadataTransactionBodyBytes);
- return newArray;
- }
-}
diff --git a/src/infrastructure/catbuffer/AccountMosaicRestrictionTransactionBodyBuilder.ts b/src/infrastructure/catbuffer/AccountMosaicRestrictionTransactionBodyBuilder.ts
deleted file mode 100644
index 65473458c9..0000000000
--- a/src/infrastructure/catbuffer/AccountMosaicRestrictionTransactionBodyBuilder.ts
+++ /dev/null
@@ -1,161 +0,0 @@
-// tslint:disable: jsdoc-format
-/**
-*** Copyright (c) 2016-present,
-*** Jaguar0625, gimre, BloodyRookie, Tech Bureau, Corp. All rights reserved.
-***
-*** This file is part of Catapult.
-***
-*** Catapult is free software: you can redistribute it and/or modify
-*** it under the terms of the GNU Lesser General Public License as published by
-*** the Free Software Foundation, either version 3 of the License, or
-*** (at your option) any later version.
-***
-*** Catapult is distributed in the hope that it will be useful,
-*** but WITHOUT ANY WARRANTY; without even the implied warranty of
-*** MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-*** GNU Lesser General Public License for more details.
-***
-*** You should have received a copy of the GNU Lesser General Public License
-*** along with Catapult. If not, see .
-**/
-
-import { GeneratorUtils } from './GeneratorUtils';
-import { UnresolvedMosaicIdDto } from './UnresolvedMosaicIdDto';
-
-/** Binary layout for an account mosaic restriction transaction. */
-export class AccountMosaicRestrictionTransactionBodyBuilder {
- /** Account restriction flags. */
- restrictionFlags: number;
- /** Reserved padding to align restrictionAdditions on 8-byte boundary. */
- accountRestrictionTransactionBody_Reserved1: number;
- /** Account restriction additions. */
- restrictionAdditions: UnresolvedMosaicIdDto[];
- /** Account restriction deletions. */
- restrictionDeletions: UnresolvedMosaicIdDto[];
-
- /**
- * Constructor.
- *
- * @param restrictionFlags Account restriction flags.
- * @param restrictionAdditions Account restriction additions.
- * @param restrictionDeletions Account restriction deletions.
- */
- // tslint:disable-next-line: max-line-length
- public constructor(restrictionFlags: number, restrictionAdditions: UnresolvedMosaicIdDto[], restrictionDeletions: UnresolvedMosaicIdDto[]) {
- this.restrictionFlags = restrictionFlags;
- this.accountRestrictionTransactionBody_Reserved1 = 0;
- this.restrictionAdditions = restrictionAdditions;
- this.restrictionDeletions = restrictionDeletions;
- }
-
- /**
- * Creates an instance of AccountMosaicRestrictionTransactionBodyBuilder from binary payload.
- *
- * @param payload Byte payload to use to serialize the object.
- * @return Instance of AccountMosaicRestrictionTransactionBodyBuilder.
- */
- public static loadFromBinary(payload: Uint8Array): AccountMosaicRestrictionTransactionBodyBuilder {
- const byteArray = Array.from(payload);
- const restrictionFlags = GeneratorUtils.bufferToUint(GeneratorUtils.getBytes(Uint8Array.from(byteArray), 2));
- byteArray.splice(0, 2);
- const restrictionAdditionsCount = GeneratorUtils.bufferToUint(GeneratorUtils.getBytes(Uint8Array.from(byteArray), 1));
- byteArray.splice(0, 1);
- const restrictionDeletionsCount = GeneratorUtils.bufferToUint(GeneratorUtils.getBytes(Uint8Array.from(byteArray), 1));
- byteArray.splice(0, 1);
- // tslint:disable-next-line: max-line-length
- const accountRestrictionTransactionBody_Reserved1 = GeneratorUtils.bufferToUint(GeneratorUtils.getBytes(Uint8Array.from(byteArray), 4));
- byteArray.splice(0, 4);
- const restrictionAdditions: UnresolvedMosaicIdDto[] = [];
- for (let i = 0; i < restrictionAdditionsCount; i++) {
- const item = UnresolvedMosaicIdDto.loadFromBinary(Uint8Array.from(byteArray));
- restrictionAdditions.push(item);
- byteArray.splice(0, item.getSize());
- }
- const restrictionDeletions: UnresolvedMosaicIdDto[] = [];
- for (let i = 0; i < restrictionDeletionsCount; i++) {
- const item = UnresolvedMosaicIdDto.loadFromBinary(Uint8Array.from(byteArray));
- restrictionDeletions.push(item);
- byteArray.splice(0, item.getSize());
- }
- return new AccountMosaicRestrictionTransactionBodyBuilder(restrictionFlags, restrictionAdditions, restrictionDeletions);
- }
-
- /**
- * Gets account restriction flags.
- *
- * @return Account restriction flags.
- */
- public getRestrictionFlags(): number {
- return this.restrictionFlags;
- }
-
- /**
- * Gets reserved padding to align restrictionAdditions on 8-byte boundary.
- *
- * @return Reserved padding to align restrictionAdditions on 8-byte boundary.
- */
- public getAccountRestrictionTransactionBody_Reserved1(): number {
- return this.accountRestrictionTransactionBody_Reserved1;
- }
-
- /**
- * Gets account restriction additions.
- *
- * @return Account restriction additions.
- */
- public getRestrictionAdditions(): UnresolvedMosaicIdDto[] {
- return this.restrictionAdditions;
- }
-
- /**
- * Gets account restriction deletions.
- *
- * @return Account restriction deletions.
- */
- public getRestrictionDeletions(): UnresolvedMosaicIdDto[] {
- return this.restrictionDeletions;
- }
-
- /**
- * Gets the size of the object.
- *
- * @return Size in bytes.
- */
- public getSize(): number {
- let size = 0;
- size += 2; // restrictionFlags
- size += 1; // restrictionAdditionsCount
- size += 1; // restrictionDeletionsCount
- size += 4; // accountRestrictionTransactionBody_Reserved1
- this.restrictionAdditions.forEach((o) => size += o.getSize());
- this.restrictionDeletions.forEach((o) => size += o.getSize());
- return size;
- }
-
- /**
- * Serializes an object to bytes.
- *
- * @return Serialized bytes.
- */
- public serialize(): Uint8Array {
- let newArray = Uint8Array.from([]);
- const restrictionFlagsBytes = GeneratorUtils.uintToBuffer(this.getRestrictionFlags(), 2);
- newArray = GeneratorUtils.concatTypedArrays(newArray, restrictionFlagsBytes);
- const restrictionAdditionsCountBytes = GeneratorUtils.uintToBuffer(this.restrictionAdditions.length, 1);
- newArray = GeneratorUtils.concatTypedArrays(newArray, restrictionAdditionsCountBytes);
- const restrictionDeletionsCountBytes = GeneratorUtils.uintToBuffer(this.restrictionDeletions.length, 1);
- newArray = GeneratorUtils.concatTypedArrays(newArray, restrictionDeletionsCountBytes);
- // tslint:disable-next-line: max-line-length
- const accountRestrictionTransactionBody_Reserved1Bytes = GeneratorUtils.uintToBuffer(this.getAccountRestrictionTransactionBody_Reserved1(), 4);
- newArray = GeneratorUtils.concatTypedArrays(newArray, accountRestrictionTransactionBody_Reserved1Bytes);
- this.restrictionAdditions.forEach((item) => {
- const restrictionAdditionsBytes = item.serialize();
- newArray = GeneratorUtils.concatTypedArrays(newArray, restrictionAdditionsBytes);
- });
- this.restrictionDeletions.forEach((item) => {
- const restrictionDeletionsBytes = item.serialize();
- newArray = GeneratorUtils.concatTypedArrays(newArray, restrictionDeletionsBytes);
- });
- return newArray;
- }
-}
diff --git a/src/infrastructure/catbuffer/AccountMosaicRestrictionTransactionBuilder.ts b/src/infrastructure/catbuffer/AccountMosaicRestrictionTransactionBuilder.ts
deleted file mode 100644
index f85cc552ba..0000000000
--- a/src/infrastructure/catbuffer/AccountMosaicRestrictionTransactionBuilder.ts
+++ /dev/null
@@ -1,136 +0,0 @@
-// tslint:disable: jsdoc-format
-/**
-*** Copyright (c) 2016-present,
-*** Jaguar0625, gimre, BloodyRookie, Tech Bureau, Corp. All rights reserved.
-***
-*** This file is part of Catapult.
-***
-*** Catapult is free software: you can redistribute it and/or modify
-*** it under the terms of the GNU Lesser General Public License as published by
-*** the Free Software Foundation, either version 3 of the License, or
-*** (at your option) any later version.
-***
-*** Catapult is distributed in the hope that it will be useful,
-*** but WITHOUT ANY WARRANTY; without even the implied warranty of
-*** MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-*** GNU Lesser General Public License for more details.
-***
-*** You should have received a copy of the GNU Lesser General Public License
-*** along with Catapult. If not, see .
-**/
-
-import { AccountMosaicRestrictionTransactionBodyBuilder } from './AccountMosaicRestrictionTransactionBodyBuilder';
-import { AmountDto } from './AmountDto';
-import { EntityTypeDto } from './EntityTypeDto';
-import { GeneratorUtils } from './GeneratorUtils';
-import { KeyDto } from './KeyDto';
-import { NetworkTypeDto } from './NetworkTypeDto';
-import { SignatureDto } from './SignatureDto';
-import { TimestampDto } from './TimestampDto';
-import { TransactionBuilder } from './TransactionBuilder';
-import { UnresolvedMosaicIdDto } from './UnresolvedMosaicIdDto';
-
-/** Binary layout for a non-embedded account mosaic restriction transaction. */
-export class AccountMosaicRestrictionTransactionBuilder extends TransactionBuilder {
- /** Account mosaic restriction transaction body. */
- accountMosaicRestrictionTransactionBody: AccountMosaicRestrictionTransactionBodyBuilder;
-
- /**
- * Constructor.
- *
- * @param signature Entity signature.
- * @param signerPublicKey Entity signer's public key.
- * @param version Entity version.
- * @param network Entity network.
- * @param type Entity type.
- * @param fee Transaction fee.
- * @param deadline Transaction deadline.
- * @param restrictionFlags Account restriction flags.
- * @param restrictionAdditions Account restriction additions.
- * @param restrictionDeletions Account restriction deletions.
- */
- // tslint:disable-next-line: max-line-length
- public constructor(signature: SignatureDto, signerPublicKey: KeyDto, version: number, network: NetworkTypeDto, type: EntityTypeDto, fee: AmountDto, deadline: TimestampDto, restrictionFlags: number, restrictionAdditions: UnresolvedMosaicIdDto[], restrictionDeletions: UnresolvedMosaicIdDto[]) {
- super(signature, signerPublicKey, version, network, type, fee, deadline);
- // tslint:disable-next-line: max-line-length
- this.accountMosaicRestrictionTransactionBody = new AccountMosaicRestrictionTransactionBodyBuilder(restrictionFlags, restrictionAdditions, restrictionDeletions);
- }
-
- /**
- * Creates an instance of AccountMosaicRestrictionTransactionBuilder from binary payload.
- *
- * @param payload Byte payload to use to serialize the object.
- * @return Instance of AccountMosaicRestrictionTransactionBuilder.
- */
- public static loadFromBinary(payload: Uint8Array): AccountMosaicRestrictionTransactionBuilder {
- const byteArray = Array.from(payload);
- const superObject = TransactionBuilder.loadFromBinary(Uint8Array.from(byteArray));
- byteArray.splice(0, superObject.getSize());
- // tslint:disable-next-line: max-line-length
- const accountMosaicRestrictionTransactionBody = AccountMosaicRestrictionTransactionBodyBuilder.loadFromBinary(Uint8Array.from(byteArray));
- byteArray.splice(0, accountMosaicRestrictionTransactionBody.getSize());
- // tslint:disable-next-line: max-line-length
- return new AccountMosaicRestrictionTransactionBuilder(superObject.signature, superObject.signerPublicKey, superObject.version, superObject.network, superObject.type, superObject.fee, superObject.deadline, accountMosaicRestrictionTransactionBody.restrictionFlags, accountMosaicRestrictionTransactionBody.restrictionAdditions, accountMosaicRestrictionTransactionBody.restrictionDeletions);
- }
-
- /**
- * Gets account restriction flags.
- *
- * @return Account restriction flags.
- */
- public getRestrictionFlags(): number {
- return this.accountMosaicRestrictionTransactionBody.getRestrictionFlags();
- }
-
- /**
- * Gets reserved padding to align restrictionAdditions on 8-byte boundary.
- *
- * @return Reserved padding to align restrictionAdditions on 8-byte boundary.
- */
- public getAccountRestrictionTransactionBody_Reserved1(): number {
- return this.accountMosaicRestrictionTransactionBody.getAccountRestrictionTransactionBody_Reserved1();
- }
-
- /**
- * Gets account restriction additions.
- *
- * @return Account restriction additions.
- */
- public getRestrictionAdditions(): UnresolvedMosaicIdDto[] {
- return this.accountMosaicRestrictionTransactionBody.getRestrictionAdditions();
- }
-
- /**
- * Gets account restriction deletions.
- *
- * @return Account restriction deletions.
- */
- public getRestrictionDeletions(): UnresolvedMosaicIdDto[] {
- return this.accountMosaicRestrictionTransactionBody.getRestrictionDeletions();
- }
-
- /**
- * Gets the size of the object.
- *
- * @return Size in bytes.
- */
- public getSize(): number {
- let size: number = super.getSize();
- size += this.accountMosaicRestrictionTransactionBody.getSize();
- return size;
- }
-
- /**
- * Serializes an object to bytes.
- *
- * @return Serialized bytes.
- */
- public serialize(): Uint8Array {
- let newArray = Uint8Array.from([]);
- const superBytes = super.serialize();
- newArray = GeneratorUtils.concatTypedArrays(newArray, superBytes);
- const accountMosaicRestrictionTransactionBodyBytes = this.accountMosaicRestrictionTransactionBody.serialize();
- newArray = GeneratorUtils.concatTypedArrays(newArray, accountMosaicRestrictionTransactionBodyBytes);
- return newArray;
- }
-}
diff --git a/src/infrastructure/catbuffer/AccountOperationRestrictionTransactionBodyBuilder.ts b/src/infrastructure/catbuffer/AccountOperationRestrictionTransactionBodyBuilder.ts
deleted file mode 100644
index 15b6285fb6..0000000000
--- a/src/infrastructure/catbuffer/AccountOperationRestrictionTransactionBodyBuilder.ts
+++ /dev/null
@@ -1,160 +0,0 @@
-// tslint:disable: jsdoc-format
-/**
-*** Copyright (c) 2016-present,
-*** Jaguar0625, gimre, BloodyRookie, Tech Bureau, Corp. All rights reserved.
-***
-*** This file is part of Catapult.
-***
-*** Catapult is free software: you can redistribute it and/or modify
-*** it under the terms of the GNU Lesser General Public License as published by
-*** the Free Software Foundation, either version 3 of the License, or
-*** (at your option) any later version.
-***
-*** Catapult is distributed in the hope that it will be useful,
-*** but WITHOUT ANY WARRANTY; without even the implied warranty of
-*** MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-*** GNU Lesser General Public License for more details.
-***
-*** You should have received a copy of the GNU Lesser General Public License
-*** along with Catapult. If not, see .
-**/
-
-import { GeneratorUtils } from './GeneratorUtils';
-
-/** Binary layout for an account operation restriction transaction. */
-export class AccountOperationRestrictionTransactionBodyBuilder {
- /** Account restriction flags. */
- restrictionFlags: number;
- /** Reserved padding to align restrictionAdditions on 8-byte boundary. */
- accountRestrictionTransactionBody_Reserved1: number;
- /** Account restriction additions. */
- restrictionAdditions: number[];
- /** Account restriction deletions. */
- restrictionDeletions: number[];
-
- /**
- * Constructor.
- *
- * @param restrictionFlags Account restriction flags.
- * @param restrictionAdditions Account restriction additions.
- * @param restrictionDeletions Account restriction deletions.
- */
- public constructor(restrictionFlags: number, restrictionAdditions: number[], restrictionDeletions: number[]) {
- this.restrictionFlags = restrictionFlags;
- this.accountRestrictionTransactionBody_Reserved1 = 0;
- this.restrictionAdditions = restrictionAdditions;
- this.restrictionDeletions = restrictionDeletions;
- }
-
- /**
- * Creates an instance of AccountOperationRestrictionTransactionBodyBuilder from binary payload.
- *
- * @param payload Byte payload to use to serialize the object.
- * @return Instance of AccountOperationRestrictionTransactionBodyBuilder.
- */
- public static loadFromBinary(payload: Uint8Array): AccountOperationRestrictionTransactionBodyBuilder {
- const byteArray = Array.from(payload);
- const restrictionFlags = GeneratorUtils.bufferToUint(GeneratorUtils.getBytes(Uint8Array.from(byteArray), 2));
- byteArray.splice(0, 2);
- const restrictionAdditionsCount = GeneratorUtils.bufferToUint(GeneratorUtils.getBytes(Uint8Array.from(byteArray), 1));
- byteArray.splice(0, 1);
- const restrictionDeletionsCount = GeneratorUtils.bufferToUint(GeneratorUtils.getBytes(Uint8Array.from(byteArray), 1));
- byteArray.splice(0, 1);
- // tslint:disable-next-line: max-line-length
- const accountRestrictionTransactionBody_Reserved1 = GeneratorUtils.bufferToUint(GeneratorUtils.getBytes(Uint8Array.from(byteArray), 4));
- byteArray.splice(0, 4);
- const restrictionAdditions: number[] = [];
- for (let i = 0; i < restrictionAdditionsCount; i++) {
- const item = GeneratorUtils.bufferToUint(GeneratorUtils.getBytes(Uint8Array.from(byteArray), 2));
- restrictionAdditions.push(item);
- byteArray.splice(0, 2);
- }
- const restrictionDeletions: number[] = [];
- for (let i = 0; i < restrictionDeletionsCount; i++) {
- const item = GeneratorUtils.bufferToUint(GeneratorUtils.getBytes(Uint8Array.from(byteArray), 2));
- restrictionDeletions.push(item);
- byteArray.splice(0, 2);
- }
- // tslint:disable-next-line: max-line-length
- return new AccountOperationRestrictionTransactionBodyBuilder(restrictionFlags, restrictionAdditions, restrictionDeletions);
- }
-
- /**
- * Gets account restriction flags.
- *
- * @return Account restriction flags.
- */
- public getRestrictionFlags(): number {
- return this.restrictionFlags;
- }
-
- /**
- * Gets reserved padding to align restrictionAdditions on 8-byte boundary.
- *
- * @return Reserved padding to align restrictionAdditions on 8-byte boundary.
- */
- public getAccountRestrictionTransactionBody_Reserved1(): number {
- return this.accountRestrictionTransactionBody_Reserved1;
- }
-
- /**
- * Gets account restriction additions.
- *
- * @return Account restriction additions.
- */
- public getRestrictionAdditions(): number[] {
- return this.restrictionAdditions;
- }
-
- /**
- * Gets account restriction deletions.
- *
- * @return Account restriction deletions.
- */
- public getRestrictionDeletions(): number[] {
- return this.restrictionDeletions;
- }
-
- /**
- * Gets the size of the object.
- *
- * @return Size in bytes.
- */
- public getSize(): number {
- let size = 0;
- size += 2; // restrictionFlags
- size += 1; // restrictionAdditionsCount
- size += 1; // restrictionDeletionsCount
- size += 4; // accountRestrictionTransactionBody_Reserved1
- this.restrictionAdditions.forEach(() => size += 2);
- this.restrictionDeletions.forEach(() => size += 2);
- return size;
- }
-
- /**
- * Serializes an object to bytes.
- *
- * @return Serialized bytes.
- */
- public serialize(): Uint8Array {
- let newArray = Uint8Array.from([]);
- const restrictionFlagsBytes = GeneratorUtils.uintToBuffer(this.getRestrictionFlags(), 2);
- newArray = GeneratorUtils.concatTypedArrays(newArray, restrictionFlagsBytes);
- const restrictionAdditionsCountBytes = GeneratorUtils.uintToBuffer(this.restrictionAdditions.length, 1);
- newArray = GeneratorUtils.concatTypedArrays(newArray, restrictionAdditionsCountBytes);
- const restrictionDeletionsCountBytes = GeneratorUtils.uintToBuffer(this.restrictionDeletions.length, 1);
- newArray = GeneratorUtils.concatTypedArrays(newArray, restrictionDeletionsCountBytes);
- // tslint:disable-next-line: max-line-length
- const accountRestrictionTransactionBody_Reserved1Bytes = GeneratorUtils.uintToBuffer(this.getAccountRestrictionTransactionBody_Reserved1(), 4);
- newArray = GeneratorUtils.concatTypedArrays(newArray, accountRestrictionTransactionBody_Reserved1Bytes);
- this.restrictionAdditions.forEach((item) => {
- const restrictionAdditionsBytes = GeneratorUtils.uintToBuffer(item, 2);
- newArray = GeneratorUtils.concatTypedArrays(newArray, restrictionAdditionsBytes);
- });
- this.restrictionDeletions.forEach((item) => {
- const restrictionDeletionsBytes = GeneratorUtils.uintToBuffer(item, 2);
- newArray = GeneratorUtils.concatTypedArrays(newArray, restrictionDeletionsBytes);
- });
- return newArray;
- }
-}
diff --git a/src/infrastructure/catbuffer/AccountOperationRestrictionTransactionBuilder.ts b/src/infrastructure/catbuffer/AccountOperationRestrictionTransactionBuilder.ts
deleted file mode 100644
index 67becb8a0a..0000000000
--- a/src/infrastructure/catbuffer/AccountOperationRestrictionTransactionBuilder.ts
+++ /dev/null
@@ -1,135 +0,0 @@
-// tslint:disable: jsdoc-format
-/**
-*** Copyright (c) 2016-present,
-*** Jaguar0625, gimre, BloodyRookie, Tech Bureau, Corp. All rights reserved.
-***
-*** This file is part of Catapult.
-***
-*** Catapult is free software: you can redistribute it and/or modify
-*** it under the terms of the GNU Lesser General Public License as published by
-*** the Free Software Foundation, either version 3 of the License, or
-*** (at your option) any later version.
-***
-*** Catapult is distributed in the hope that it will be useful,
-*** but WITHOUT ANY WARRANTY; without even the implied warranty of
-*** MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-*** GNU Lesser General Public License for more details.
-***
-*** You should have received a copy of the GNU Lesser General Public License
-*** along with Catapult. If not, see .
-**/
-
-import { AccountOperationRestrictionTransactionBodyBuilder } from './AccountOperationRestrictionTransactionBodyBuilder';
-import { AmountDto } from './AmountDto';
-import { EntityTypeDto } from './EntityTypeDto';
-import { GeneratorUtils } from './GeneratorUtils';
-import { KeyDto } from './KeyDto';
-import { NetworkTypeDto } from './NetworkTypeDto';
-import { SignatureDto } from './SignatureDto';
-import { TimestampDto } from './TimestampDto';
-import { TransactionBuilder } from './TransactionBuilder';
-
-/** Binary layout for a non-embedded account operation restriction transaction. */
-export class AccountOperationRestrictionTransactionBuilder extends TransactionBuilder {
- /** Account operation restriction transaction body. */
- accountOperationRestrictionTransactionBody: AccountOperationRestrictionTransactionBodyBuilder;
-
- /**
- * Constructor.
- *
- * @param signature Entity signature.
- * @param signerPublicKey Entity signer's public key.
- * @param version Entity version.
- * @param network Entity network.
- * @param type Entity type.
- * @param fee Transaction fee.
- * @param deadline Transaction deadline.
- * @param restrictionFlags Account restriction flags.
- * @param restrictionAdditions Account restriction additions.
- * @param restrictionDeletions Account restriction deletions.
- */
- // tslint:disable-next-line: max-line-length
- public constructor(signature: SignatureDto, signerPublicKey: KeyDto, version: number, network: NetworkTypeDto, type: EntityTypeDto, fee: AmountDto, deadline: TimestampDto, restrictionFlags: number, restrictionAdditions: number[], restrictionDeletions: number[]) {
- super(signature, signerPublicKey, version, network, type, fee, deadline);
- // tslint:disable-next-line: max-line-length
- this.accountOperationRestrictionTransactionBody = new AccountOperationRestrictionTransactionBodyBuilder(restrictionFlags, restrictionAdditions, restrictionDeletions);
- }
-
- /**
- * Creates an instance of AccountOperationRestrictionTransactionBuilder from binary payload.
- *
- * @param payload Byte payload to use to serialize the object.
- * @return Instance of AccountOperationRestrictionTransactionBuilder.
- */
- public static loadFromBinary(payload: Uint8Array): AccountOperationRestrictionTransactionBuilder {
- const byteArray = Array.from(payload);
- const superObject = TransactionBuilder.loadFromBinary(Uint8Array.from(byteArray));
- byteArray.splice(0, superObject.getSize());
- // tslint:disable-next-line: max-line-length
- const accountOperationRestrictionTransactionBody = AccountOperationRestrictionTransactionBodyBuilder.loadFromBinary(Uint8Array.from(byteArray));
- byteArray.splice(0, accountOperationRestrictionTransactionBody.getSize());
- // tslint:disable-next-line: max-line-length
- return new AccountOperationRestrictionTransactionBuilder(superObject.signature, superObject.signerPublicKey, superObject.version, superObject.network, superObject.type, superObject.fee, superObject.deadline, accountOperationRestrictionTransactionBody.restrictionFlags, accountOperationRestrictionTransactionBody.restrictionAdditions, accountOperationRestrictionTransactionBody.restrictionDeletions);
- }
-
- /**
- * Gets account restriction flags.
- *
- * @return Account restriction flags.
- */
- public getRestrictionFlags(): number {
- return this.accountOperationRestrictionTransactionBody.getRestrictionFlags();
- }
-
- /**
- * Gets reserved padding to align restrictionAdditions on 8-byte boundary.
- *
- * @return Reserved padding to align restrictionAdditions on 8-byte boundary.
- */
- public getAccountRestrictionTransactionBody_Reserved1(): number {
- return this.accountOperationRestrictionTransactionBody.getAccountRestrictionTransactionBody_Reserved1();
- }
-
- /**
- * Gets account restriction additions.
- *
- * @return Account restriction additions.
- */
- public getRestrictionAdditions(): number[] {
- return this.accountOperationRestrictionTransactionBody.getRestrictionAdditions();
- }
-
- /**
- * Gets account restriction deletions.
- *
- * @return Account restriction deletions.
- */
- public getRestrictionDeletions(): number[] {
- return this.accountOperationRestrictionTransactionBody.getRestrictionDeletions();
- }
-
- /**
- * Gets the size of the object.
- *
- * @return Size in bytes.
- */
- public getSize(): number {
- let size: number = super.getSize();
- size += this.accountOperationRestrictionTransactionBody.getSize();
- return size;
- }
-
- /**
- * Serializes an object to bytes.
- *
- * @return Serialized bytes.
- */
- public serialize(): Uint8Array {
- let newArray = Uint8Array.from([]);
- const superBytes = super.serialize();
- newArray = GeneratorUtils.concatTypedArrays(newArray, superBytes);
- const accountOperationRestrictionTransactionBodyBytes = this.accountOperationRestrictionTransactionBody.serialize();
- newArray = GeneratorUtils.concatTypedArrays(newArray, accountOperationRestrictionTransactionBodyBytes);
- return newArray;
- }
-}
diff --git a/src/infrastructure/catbuffer/AccountRestrictionFlagsDto.ts b/src/infrastructure/catbuffer/AccountRestrictionFlagsDto.ts
deleted file mode 100644
index 1d8ad32edc..0000000000
--- a/src/infrastructure/catbuffer/AccountRestrictionFlagsDto.ts
+++ /dev/null
@@ -1,35 +0,0 @@
-// tslint:disable: jsdoc-format
-/**
-*** Copyright (c) 2016-present,
-*** Jaguar0625, gimre, BloodyRookie, Tech Bureau, Corp. All rights reserved.
-***
-*** This file is part of Catapult.
-***
-*** Catapult is free software: you can redistribute it and/or modify
-*** it under the terms of the GNU Lesser General Public License as published by
-*** the Free Software Foundation, either version 3 of the License, or
-*** (at your option) any later version.
-***
-*** Catapult is distributed in the hope that it will be useful,
-*** but WITHOUT ANY WARRANTY; without even the implied warranty of
-*** MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-*** GNU Lesser General Public License for more details.
-***
-*** You should have received a copy of the GNU Lesser General Public License
-*** along with Catapult. If not, see .
-**/
-
-
-/** Enumeration of account restriction flags. */
-export enum AccountRestrictionFlagsDto {
- /** Restriction type is an address. */
- ADDRESS = 1,
- /** Restriction type is a mosaic identifier. */
- MOSAIC_ID = 2,
- /** Restriction type is a transaction type. */
- TRANSACTION_TYPE = 4,
- /** Restriction is interpreted as outgoing. */
- OUTGOING = 16384,
- /** Restriction is interpreted as blocking operation. */
- BLOCK = 32768,
-}
diff --git a/src/infrastructure/catbuffer/AddressAliasTransactionBodyBuilder.ts b/src/infrastructure/catbuffer/AddressAliasTransactionBodyBuilder.ts
deleted file mode 100644
index e1d52f1aed..0000000000
--- a/src/infrastructure/catbuffer/AddressAliasTransactionBodyBuilder.ts
+++ /dev/null
@@ -1,121 +0,0 @@
-// tslint:disable: jsdoc-format
-/**
-*** Copyright (c) 2016-present,
-*** Jaguar0625, gimre, BloodyRookie, Tech Bureau, Corp. All rights reserved.
-***
-*** This file is part of Catapult.
-***
-*** Catapult is free software: you can redistribute it and/or modify
-*** it under the terms of the GNU Lesser General Public License as published by
-*** the Free Software Foundation, either version 3 of the License, or
-*** (at your option) any later version.
-***
-*** Catapult is distributed in the hope that it will be useful,
-*** but WITHOUT ANY WARRANTY; without even the implied warranty of
-*** MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-*** GNU Lesser General Public License for more details.
-***
-*** You should have received a copy of the GNU Lesser General Public License
-*** along with Catapult. If not, see .
-**/
-
-import { AddressDto } from './AddressDto';
-import { AliasActionDto } from './AliasActionDto';
-import { GeneratorUtils } from './GeneratorUtils';
-import { NamespaceIdDto } from './NamespaceIdDto';
-
-/** Binary layout for an address alias transaction. */
-export class AddressAliasTransactionBodyBuilder {
- /** Identifier of the namespace that will become an alias. */
- namespaceId: NamespaceIdDto;
- /** Aliased address. */
- address: AddressDto;
- /** Alias action. */
- aliasAction: AliasActionDto;
-
- /**
- * Constructor.
- *
- * @param namespaceId Identifier of the namespace that will become an alias.
- * @param address Aliased address.
- * @param aliasAction Alias action.
- */
- public constructor(namespaceId: NamespaceIdDto, address: AddressDto, aliasAction: AliasActionDto) {
- this.namespaceId = namespaceId;
- this.address = address;
- this.aliasAction = aliasAction;
- }
-
- /**
- * Creates an instance of AddressAliasTransactionBodyBuilder from binary payload.
- *
- * @param payload Byte payload to use to serialize the object.
- * @return Instance of AddressAliasTransactionBodyBuilder.
- */
- public static loadFromBinary(payload: Uint8Array): AddressAliasTransactionBodyBuilder {
- const byteArray = Array.from(payload);
- const namespaceId = NamespaceIdDto.loadFromBinary(Uint8Array.from(byteArray));
- byteArray.splice(0, namespaceId.getSize());
- const address = AddressDto.loadFromBinary(Uint8Array.from(byteArray));
- byteArray.splice(0, address.getSize());
- const aliasAction = GeneratorUtils.bufferToUint(GeneratorUtils.getBytes(Uint8Array.from(byteArray), 1));
- byteArray.splice(0, 1);
- return new AddressAliasTransactionBodyBuilder(namespaceId, address, aliasAction);
- }
-
- /**
- * Gets identifier of the namespace that will become an alias.
- *
- * @return Identifier of the namespace that will become an alias.
- */
- public getNamespaceId(): NamespaceIdDto {
- return this.namespaceId;
- }
-
- /**
- * Gets aliased address.
- *
- * @return Aliased address.
- */
- public getAddress(): AddressDto {
- return this.address;
- }
-
- /**
- * Gets alias action.
- *
- * @return Alias action.
- */
- public getAliasAction(): AliasActionDto {
- return this.aliasAction;
- }
-
- /**
- * Gets the size of the object.
- *
- * @return Size in bytes.
- */
- public getSize(): number {
- let size = 0;
- size += this.namespaceId.getSize();
- size += this.address.getSize();
- size += 1; // aliasAction
- return size;
- }
-
- /**
- * Serializes an object to bytes.
- *
- * @return Serialized bytes.
- */
- public serialize(): Uint8Array {
- let newArray = Uint8Array.from([]);
- const namespaceIdBytes = this.namespaceId.serialize();
- newArray = GeneratorUtils.concatTypedArrays(newArray, namespaceIdBytes);
- const addressBytes = this.address.serialize();
- newArray = GeneratorUtils.concatTypedArrays(newArray, addressBytes);
- const aliasActionBytes = GeneratorUtils.uintToBuffer(this.aliasAction, 1);
- newArray = GeneratorUtils.concatTypedArrays(newArray, aliasActionBytes);
- return newArray;
- }
-}
diff --git a/src/infrastructure/catbuffer/AddressAliasTransactionBuilder.ts b/src/infrastructure/catbuffer/AddressAliasTransactionBuilder.ts
deleted file mode 100644
index 43b0f52312..0000000000
--- a/src/infrastructure/catbuffer/AddressAliasTransactionBuilder.ts
+++ /dev/null
@@ -1,127 +0,0 @@
-// tslint:disable: jsdoc-format
-/**
-*** Copyright (c) 2016-present,
-*** Jaguar0625, gimre, BloodyRookie, Tech Bureau, Corp. All rights reserved.
-***
-*** This file is part of Catapult.
-***
-*** Catapult is free software: you can redistribute it and/or modify
-*** it under the terms of the GNU Lesser General Public License as published by
-*** the Free Software Foundation, either version 3 of the License, or
-*** (at your option) any later version.
-***
-*** Catapult is distributed in the hope that it will be useful,
-*** but WITHOUT ANY WARRANTY; without even the implied warranty of
-*** MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-*** GNU Lesser General Public License for more details.
-***
-*** You should have received a copy of the GNU Lesser General Public License
-*** along with Catapult. If not, see .
-**/
-
-import { AddressAliasTransactionBodyBuilder } from './AddressAliasTransactionBodyBuilder';
-import { AddressDto } from './AddressDto';
-import { AliasActionDto } from './AliasActionDto';
-import { AmountDto } from './AmountDto';
-import { EntityTypeDto } from './EntityTypeDto';
-import { GeneratorUtils } from './GeneratorUtils';
-import { KeyDto } from './KeyDto';
-import { NamespaceIdDto } from './NamespaceIdDto';
-import { NetworkTypeDto } from './NetworkTypeDto';
-import { SignatureDto } from './SignatureDto';
-import { TimestampDto } from './TimestampDto';
-import { TransactionBuilder } from './TransactionBuilder';
-
-/** Binary layout for a non-embedded address alias transaction. */
-export class AddressAliasTransactionBuilder extends TransactionBuilder {
- /** Address alias transaction body. */
- addressAliasTransactionBody: AddressAliasTransactionBodyBuilder;
-
- /**
- * Constructor.
- *
- * @param signature Entity signature.
- * @param signerPublicKey Entity signer's public key.
- * @param version Entity version.
- * @param network Entity network.
- * @param type Entity type.
- * @param fee Transaction fee.
- * @param deadline Transaction deadline.
- * @param namespaceId Identifier of the namespace that will become an alias.
- * @param address Aliased address.
- * @param aliasAction Alias action.
- */
- // tslint:disable-next-line: max-line-length
- public constructor(signature: SignatureDto, signerPublicKey: KeyDto, version: number, network: NetworkTypeDto, type: EntityTypeDto, fee: AmountDto, deadline: TimestampDto, namespaceId: NamespaceIdDto, address: AddressDto, aliasAction: AliasActionDto) {
- super(signature, signerPublicKey, version, network, type, fee, deadline);
- this.addressAliasTransactionBody = new AddressAliasTransactionBodyBuilder(namespaceId, address, aliasAction);
- }
-
- /**
- * Creates an instance of AddressAliasTransactionBuilder from binary payload.
- *
- * @param payload Byte payload to use to serialize the object.
- * @return Instance of AddressAliasTransactionBuilder.
- */
- public static loadFromBinary(payload: Uint8Array): AddressAliasTransactionBuilder {
- const byteArray = Array.from(payload);
- const superObject = TransactionBuilder.loadFromBinary(Uint8Array.from(byteArray));
- byteArray.splice(0, superObject.getSize());
- const addressAliasTransactionBody = AddressAliasTransactionBodyBuilder.loadFromBinary(Uint8Array.from(byteArray));
- byteArray.splice(0, addressAliasTransactionBody.getSize());
- // tslint:disable-next-line: max-line-length
- return new AddressAliasTransactionBuilder(superObject.signature, superObject.signerPublicKey, superObject.version, superObject.network, superObject.type, superObject.fee, superObject.deadline, addressAliasTransactionBody.namespaceId, addressAliasTransactionBody.address, addressAliasTransactionBody.aliasAction);
- }
-
- /**
- * Gets identifier of the namespace that will become an alias.
- *
- * @return Identifier of the namespace that will become an alias.
- */
- public getNamespaceId(): NamespaceIdDto {
- return this.addressAliasTransactionBody.getNamespaceId();
- }
-
- /**
- * Gets aliased address.
- *
- * @return Aliased address.
- */
- public getAddress(): AddressDto {
- return this.addressAliasTransactionBody.getAddress();
- }
-
- /**
- * Gets alias action.
- *
- * @return Alias action.
- */
- public getAliasAction(): AliasActionDto {
- return this.addressAliasTransactionBody.getAliasAction();
- }
-
- /**
- * Gets the size of the object.
- *
- * @return Size in bytes.
- */
- public getSize(): number {
- let size: number = super.getSize();
- size += this.addressAliasTransactionBody.getSize();
- return size;
- }
-
- /**
- * Serializes an object to bytes.
- *
- * @return Serialized bytes.
- */
- public serialize(): Uint8Array {
- let newArray = Uint8Array.from([]);
- const superBytes = super.serialize();
- newArray = GeneratorUtils.concatTypedArrays(newArray, superBytes);
- const addressAliasTransactionBodyBytes = this.addressAliasTransactionBody.serialize();
- newArray = GeneratorUtils.concatTypedArrays(newArray, addressAliasTransactionBodyBytes);
- return newArray;
- }
-}
diff --git a/src/infrastructure/catbuffer/AddressDto.ts b/src/infrastructure/catbuffer/AddressDto.ts
deleted file mode 100644
index 16214f53dc..0000000000
--- a/src/infrastructure/catbuffer/AddressDto.ts
+++ /dev/null
@@ -1,79 +0,0 @@
-// tslint:disable: jsdoc-format
-/**
-*** Copyright (c) 2016-present,
-*** Jaguar0625, gimre, BloodyRookie, Tech Bureau, Corp. All rights reserved.
-***
-*** This file is part of Catapult.
-***
-*** Catapult is free software: you can redistribute it and/or modify
-*** it under the terms of the GNU Lesser General Public License as published by
-*** the Free Software Foundation, either version 3 of the License, or
-*** (at your option) any later version.
-***
-*** Catapult is distributed in the hope that it will be useful,
-*** but WITHOUT ANY WARRANTY; without even the implied warranty of
-*** MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-*** GNU Lesser General Public License for more details.
-***
-*** You should have received a copy of the GNU Lesser General Public License
-*** along with Catapult. If not, see .
-**/
-
-import { GeneratorUtils } from './GeneratorUtils';
-
-/** Address. */
-export class AddressDto {
- /** Address. */
- address: Uint8Array;
-
- /**
- * Constructor.
- *
- * @param address Address.
- */
- constructor(address: Uint8Array) {
- this.address = address;
- }
-
- /**
- * Creates an instance of AddressDto from binary payload.
- *
- * @param payload Byte payload to use to serialize the object.
- * @return Instance of AddressDto.
- */
- public static loadFromBinary(payload: Uint8Array): AddressDto {
- const byteArray = Array.from(payload);
- const address = GeneratorUtils.getBytes(Uint8Array.from(byteArray), 25);
- byteArray.splice(0, 25);
- return new AddressDto(address);
- }
-
- /**
- * Gets Address.
- *
- * @return Address.
- */
- public getAddress(): Uint8Array {
- return this.address;
- }
-
- /**
- * Gets the size of the object.
- *
- * @return Size in bytes.
- */
- public getSize(): number {
- return 25;
- }
-
- /**
- * Serializes an object to bytes.
- *
- * @return Serialized bytes.
- */
- public serialize(): Uint8Array {
- let newArray = Uint8Array.from([]);
- newArray = GeneratorUtils.concatTypedArrays(newArray, this.address);
- return newArray;
- }
-}
diff --git a/src/infrastructure/catbuffer/AggregateBondedTransactionBuilder.ts b/src/infrastructure/catbuffer/AggregateBondedTransactionBuilder.ts
deleted file mode 100644
index ba3b56b75f..0000000000
--- a/src/infrastructure/catbuffer/AggregateBondedTransactionBuilder.ts
+++ /dev/null
@@ -1,136 +0,0 @@
-// tslint:disable: jsdoc-format
-/**
-*** Copyright (c) 2016-present,
-*** Jaguar0625, gimre, BloodyRookie, Tech Bureau, Corp. All rights reserved.
-***
-*** This file is part of Catapult.
-***
-*** Catapult is free software: you can redistribute it and/or modify
-*** it under the terms of the GNU Lesser General Public License as published by
-*** the Free Software Foundation, either version 3 of the License, or
-*** (at your option) any later version.
-***
-*** Catapult is distributed in the hope that it will be useful,
-*** but WITHOUT ANY WARRANTY; without even the implied warranty of
-*** MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-*** GNU Lesser General Public License for more details.
-***
-*** You should have received a copy of the GNU Lesser General Public License
-*** along with Catapult. If not, see .
-**/
-
-import { AggregateTransactionBodyBuilder } from './AggregateTransactionBodyBuilder';
-import { AmountDto } from './AmountDto';
-import { CosignatureBuilder } from './CosignatureBuilder';
-import { EmbeddedTransactionBuilder } from './EmbeddedTransactionBuilder';
-import { EntityTypeDto } from './EntityTypeDto';
-import { GeneratorUtils } from './GeneratorUtils';
-import { Hash256Dto } from './Hash256Dto';
-import { KeyDto } from './KeyDto';
-import { NetworkTypeDto } from './NetworkTypeDto';
-import { SignatureDto } from './SignatureDto';
-import { TimestampDto } from './TimestampDto';
-import { TransactionBuilder } from './TransactionBuilder';
-
-/** Binary layout for an aggregate bonded transaction. */
-export class AggregateBondedTransactionBuilder extends TransactionBuilder {
- /** Aggregate transaction body. */
- aggregateTransactionBody: AggregateTransactionBodyBuilder;
-
- /**
- * Constructor.
- *
- * @param signature Entity signature.
- * @param signerPublicKey Entity signer's public key.
- * @param version Entity version.
- * @param network Entity network.
- * @param type Entity type.
- * @param fee Transaction fee.
- * @param deadline Transaction deadline.
- * @param transactionsHash Aggregate hash of an aggregate's transactions.
- * @param transactions Sub-transaction data (transactions are variable sized and payload size is in bytes).
- * @param cosignatures Cosignatures data (fills remaining body space after transactions).
- */
- // tslint:disable-next-line: max-line-length
- public constructor(signature: SignatureDto, signerPublicKey: KeyDto, version: number, network: NetworkTypeDto, type: EntityTypeDto, fee: AmountDto, deadline: TimestampDto, transactionsHash: Hash256Dto, transactions: EmbeddedTransactionBuilder[], cosignatures: CosignatureBuilder[]) {
- super(signature, signerPublicKey, version, network, type, fee, deadline);
- this.aggregateTransactionBody = new AggregateTransactionBodyBuilder(transactionsHash, transactions, cosignatures);
- }
-
- /**
- * Creates an instance of AggregateBondedTransactionBuilder from binary payload.
- *
- * @param payload Byte payload to use to serialize the object.
- * @return Instance of AggregateBondedTransactionBuilder.
- */
- public static loadFromBinary(payload: Uint8Array): AggregateBondedTransactionBuilder {
- const byteArray = Array.from(payload);
- const superObject = TransactionBuilder.loadFromBinary(Uint8Array.from(byteArray));
- byteArray.splice(0, superObject.getSize());
- const aggregateTransactionBody = AggregateTransactionBodyBuilder.loadFromBinary(Uint8Array.from(byteArray));
- byteArray.splice(0, aggregateTransactionBody.getSize());
- // tslint:disable-next-line: max-line-length
- return new AggregateBondedTransactionBuilder(superObject.signature, superObject.signerPublicKey, superObject.version, superObject.network, superObject.type, superObject.fee, superObject.deadline, aggregateTransactionBody.transactionsHash, aggregateTransactionBody.transactions, aggregateTransactionBody.cosignatures);
- }
-
- /**
- * Gets aggregate hash of an aggregate's transactions.
- *
- * @return Aggregate hash of an aggregate's transactions.
- */
- public getTransactionsHash(): Hash256Dto {
- return this.aggregateTransactionBody.getTransactionsHash();
- }
-
- /**
- * Gets reserved padding to align end of AggregateTransactionHeader on 8-byte boundary.
- *
- * @return Reserved padding to align end of AggregateTransactionHeader on 8-byte boundary.
- */
- public getAggregateTransactionHeader_Reserved1(): number {
- return this.aggregateTransactionBody.getAggregateTransactionHeader_Reserved1();
- }
-
- /**
- * Gets sub-transaction data (transactions are variable sized and payload size is in bytes).
- *
- * @return Sub-transaction data (transactions are variable sized and payload size is in bytes).
- */
- public getTransactions(): EmbeddedTransactionBuilder[] {
- return this.aggregateTransactionBody.getTransactions();
- }
-
- /**
- * Gets cosignatures data (fills remaining body space after transactions).
- *
- * @return Cosignatures data (fills remaining body space after transactions).
- */
- public getCosignatures(): CosignatureBuilder[] {
- return this.aggregateTransactionBody.getCosignatures();
- }
-
- /**
- * Gets the size of the object.
- *
- * @return Size in bytes.
- */
- public getSize(): number {
- let size: number = super.getSize();
- size += this.aggregateTransactionBody.getSize();
- return size;
- }
-
- /**
- * Serializes an object to bytes.
- *
- * @return Serialized bytes.
- */
- public serialize(): Uint8Array {
- let newArray = Uint8Array.from([]);
- const superBytes = super.serialize();
- newArray = GeneratorUtils.concatTypedArrays(newArray, superBytes);
- const aggregateTransactionBodyBytes = this.aggregateTransactionBody.serialize();
- newArray = GeneratorUtils.concatTypedArrays(newArray, aggregateTransactionBodyBytes);
- return newArray;
- }
-}
diff --git a/src/infrastructure/catbuffer/AggregateCompleteTransactionBuilder.ts b/src/infrastructure/catbuffer/AggregateCompleteTransactionBuilder.ts
deleted file mode 100644
index f6b6e0983e..0000000000
--- a/src/infrastructure/catbuffer/AggregateCompleteTransactionBuilder.ts
+++ /dev/null
@@ -1,136 +0,0 @@
-// tslint:disable: jsdoc-format
-/**
-*** Copyright (c) 2016-present,
-*** Jaguar0625, gimre, BloodyRookie, Tech Bureau, Corp. All rights reserved.
-***
-*** This file is part of Catapult.
-***
-*** Catapult is free software: you can redistribute it and/or modify
-*** it under the terms of the GNU Lesser General Public License as published by
-*** the Free Software Foundation, either version 3 of the License, or
-*** (at your option) any later version.
-***
-*** Catapult is distributed in the hope that it will be useful,
-*** but WITHOUT ANY WARRANTY; without even the implied warranty of
-*** MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-*** GNU Lesser General Public License for more details.
-***
-*** You should have received a copy of the GNU Lesser General Public License
-*** along with Catapult. If not, see .
-**/
-
-import { AggregateTransactionBodyBuilder } from './AggregateTransactionBodyBuilder';
-import { AmountDto } from './AmountDto';
-import { CosignatureBuilder } from './CosignatureBuilder';
-import { EmbeddedTransactionBuilder } from './EmbeddedTransactionBuilder';
-import { EntityTypeDto } from './EntityTypeDto';
-import { GeneratorUtils } from './GeneratorUtils';
-import { Hash256Dto } from './Hash256Dto';
-import { KeyDto } from './KeyDto';
-import { NetworkTypeDto } from './NetworkTypeDto';
-import { SignatureDto } from './SignatureDto';
-import { TimestampDto } from './TimestampDto';
-import { TransactionBuilder } from './TransactionBuilder';
-
-/** Binary layout for an aggregate complete transaction. */
-export class AggregateCompleteTransactionBuilder extends TransactionBuilder {
- /** Aggregate transaction body. */
- aggregateTransactionBody: AggregateTransactionBodyBuilder;
-
- /**
- * Constructor.
- *
- * @param signature Entity signature.
- * @param signerPublicKey Entity signer's public key.
- * @param version Entity version.
- * @param network Entity network.
- * @param type Entity type.
- * @param fee Transaction fee.
- * @param deadline Transaction deadline.
- * @param transactionsHash Aggregate hash of an aggregate's transactions.
- * @param transactions Sub-transaction data (transactions are variable sized and payload size is in bytes).
- * @param cosignatures Cosignatures data (fills remaining body space after transactions).
- */
- // tslint:disable-next-line: max-line-length
- public constructor(signature: SignatureDto, signerPublicKey: KeyDto, version: number, network: NetworkTypeDto, type: EntityTypeDto, fee: AmountDto, deadline: TimestampDto, transactionsHash: Hash256Dto, transactions: EmbeddedTransactionBuilder[], cosignatures: CosignatureBuilder[]) {
- super(signature, signerPublicKey, version, network, type, fee, deadline);
- this.aggregateTransactionBody = new AggregateTransactionBodyBuilder(transactionsHash, transactions, cosignatures);
- }
-
- /**
- * Creates an instance of AggregateCompleteTransactionBuilder from binary payload.
- *
- * @param payload Byte payload to use to serialize the object.
- * @return Instance of AggregateCompleteTransactionBuilder.
- */
- public static loadFromBinary(payload: Uint8Array): AggregateCompleteTransactionBuilder {
- const byteArray = Array.from(payload);
- const superObject = TransactionBuilder.loadFromBinary(Uint8Array.from(byteArray));
- byteArray.splice(0, superObject.getSize());
- const aggregateTransactionBody = AggregateTransactionBodyBuilder.loadFromBinary(Uint8Array.from(byteArray));
- byteArray.splice(0, aggregateTransactionBody.getSize());
- // tslint:disable-next-line: max-line-length
- return new AggregateCompleteTransactionBuilder(superObject.signature, superObject.signerPublicKey, superObject.version, superObject.network, superObject.type, superObject.fee, superObject.deadline, aggregateTransactionBody.transactionsHash, aggregateTransactionBody.transactions, aggregateTransactionBody.cosignatures);
- }
-
- /**
- * Gets aggregate hash of an aggregate's transactions.
- *
- * @return Aggregate hash of an aggregate's transactions.
- */
- public getTransactionsHash(): Hash256Dto {
- return this.aggregateTransactionBody.getTransactionsHash();
- }
-
- /**
- * Gets reserved padding to align end of AggregateTransactionHeader on 8-byte boundary.
- *
- * @return Reserved padding to align end of AggregateTransactionHeader on 8-byte boundary.
- */
- public getAggregateTransactionHeader_Reserved1(): number {
- return this.aggregateTransactionBody.getAggregateTransactionHeader_Reserved1();
- }
-
- /**
- * Gets sub-transaction data (transactions are variable sized and payload size is in bytes).
- *
- * @return Sub-transaction data (transactions are variable sized and payload size is in bytes).
- */
- public getTransactions(): EmbeddedTransactionBuilder[] {
- return this.aggregateTransactionBody.getTransactions();
- }
-
- /**
- * Gets cosignatures data (fills remaining body space after transactions).
- *
- * @return Cosignatures data (fills remaining body space after transactions).
- */
- public getCosignatures(): CosignatureBuilder[] {
- return this.aggregateTransactionBody.getCosignatures();
- }
-
- /**
- * Gets the size of the object.
- *
- * @return Size in bytes.
- */
- public getSize(): number {
- let size: number = super.getSize();
- size += this.aggregateTransactionBody.getSize();
- return size;
- }
-
- /**
- * Serializes an object to bytes.
- *
- * @return Serialized bytes.
- */
- public serialize(): Uint8Array {
- let newArray = Uint8Array.from([]);
- const superBytes = super.serialize();
- newArray = GeneratorUtils.concatTypedArrays(newArray, superBytes);
- const aggregateTransactionBodyBytes = this.aggregateTransactionBody.serialize();
- newArray = GeneratorUtils.concatTypedArrays(newArray, aggregateTransactionBodyBytes);
- return newArray;
- }
-}
diff --git a/src/infrastructure/catbuffer/AggregateTransactionBodyBuilder.ts b/src/infrastructure/catbuffer/AggregateTransactionBodyBuilder.ts
deleted file mode 100644
index 5dd2492e47..0000000000
--- a/src/infrastructure/catbuffer/AggregateTransactionBodyBuilder.ts
+++ /dev/null
@@ -1,166 +0,0 @@
-// tslint:disable: jsdoc-format
-/**
-*** Copyright (c) 2016-present,
-*** Jaguar0625, gimre, BloodyRookie, Tech Bureau, Corp. All rights reserved.
-***
-*** This file is part of Catapult.
-***
-*** Catapult is free software: you can redistribute it and/or modify
-*** it under the terms of the GNU Lesser General Public License as published by
-*** the Free Software Foundation, either version 3 of the License, or
-*** (at your option) any later version.
-***
-*** Catapult is distributed in the hope that it will be useful,
-*** but WITHOUT ANY WARRANTY; without even the implied warranty of
-*** MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-*** GNU Lesser General Public License for more details.
-***
-*** You should have received a copy of the GNU Lesser General Public License
-*** along with Catapult. If not, see .
-**/
-
-import { CosignatureBuilder } from './CosignatureBuilder';
-import { EmbeddedTransactionBuilder } from './EmbeddedTransactionBuilder';
-import { EmbeddedTransactionHelper } from './EmbeddedTransactionHelper';
-import { GeneratorUtils } from './GeneratorUtils';
-import { Hash256Dto } from './Hash256Dto';
-
-/** Binary layout for an aggregate transaction. */
-export class AggregateTransactionBodyBuilder {
- /** Aggregate hash of an aggregate's transactions. */
- transactionsHash: Hash256Dto;
- /** Reserved padding to align end of AggregateTransactionHeader on 8-byte boundary. */
- aggregateTransactionHeader_Reserved1: number;
- /** Sub-transaction data (transactions are variable sized and payload size is in bytes). */
- transactions: EmbeddedTransactionBuilder[];
- /** Cosignatures data (fills remaining body space after transactions). */
- cosignatures: CosignatureBuilder[];
-
- /**
- * Constructor.
- *
- * @param transactionsHash Aggregate hash of an aggregate's transactions.
- * @param transactions Sub-transaction data (transactions are variable sized and payload size is in bytes).
- * @param cosignatures Cosignatures data (fills remaining body space after transactions).
- */
- // tslint:disable-next-line: max-line-length
- public constructor(transactionsHash: Hash256Dto, transactions: EmbeddedTransactionBuilder[], cosignatures: CosignatureBuilder[]) {
- this.transactionsHash = transactionsHash;
- this.aggregateTransactionHeader_Reserved1 = 0;
- this.transactions = transactions;
- this.cosignatures = cosignatures;
- }
-
- /**
- * Creates an instance of AggregateTransactionBodyBuilder from binary payload.
- *
- * @param payload Byte payload to use to serialize the object.
- * @return Instance of AggregateTransactionBodyBuilder.
- */
- public static loadFromBinary(payload: Uint8Array): AggregateTransactionBodyBuilder {
- const byteArray = Array.from(payload);
- const transactionsHash = Hash256Dto.loadFromBinary(Uint8Array.from(byteArray));
- byteArray.splice(0, transactionsHash.getSize());
- const payloadSize = GeneratorUtils.bufferToUint(GeneratorUtils.getBytes(Uint8Array.from(byteArray), 4));
- byteArray.splice(0, 4);
- // tslint:disable-next-line: max-line-length
- const aggregateTransactionHeader_Reserved1 = GeneratorUtils.bufferToUint(GeneratorUtils.getBytes(Uint8Array.from(byteArray), 4));
- byteArray.splice(0, 4);
- let transactionsByteSize = payloadSize;
- const transactions: EmbeddedTransactionBuilder[] = [];
- while (transactionsByteSize > 0) {
- const item = EmbeddedTransactionHelper.loadFromBinary(Uint8Array.from(byteArray));
- transactions.push(item);
- const itemSize = item.getSize() + GeneratorUtils.getTransactionPaddingSize(item.getSize(), 8);
- transactionsByteSize -= itemSize;
- byteArray.splice(0, itemSize);
- }
- let cosignaturesByteSize = byteArray.length;
- const cosignatures: CosignatureBuilder[] = [];
- while (cosignaturesByteSize > 0) {
- const item = CosignatureBuilder.loadFromBinary(Uint8Array.from(byteArray));
- cosignatures.push(item);
- const itemSize = item.getSize();
- cosignaturesByteSize -= itemSize;
- byteArray.splice(0, itemSize);
- }
- return new AggregateTransactionBodyBuilder(transactionsHash, transactions, cosignatures);
- }
-
- /**
- * Gets aggregate hash of an aggregate's transactions.
- *
- * @return Aggregate hash of an aggregate's transactions.
- */
- public getTransactionsHash(): Hash256Dto {
- return this.transactionsHash;
- }
-
- /**
- * Gets reserved padding to align end of AggregateTransactionHeader on 8-byte boundary.
- *
- * @return Reserved padding to align end of AggregateTransactionHeader on 8-byte boundary.
- */
- public getAggregateTransactionHeader_Reserved1(): number {
- return this.aggregateTransactionHeader_Reserved1;
- }
-
- /**
- * Gets sub-transaction data (transactions are variable sized and payload size is in bytes).
- *
- * @return Sub-transaction data (transactions are variable sized and payload size is in bytes).
- */
- public getTransactions(): EmbeddedTransactionBuilder[] {
- return this.transactions;
- }
-
- /**
- * Gets cosignatures data (fills remaining body space after transactions).
- *
- * @return Cosignatures data (fills remaining body space after transactions).
- */
- public getCosignatures(): CosignatureBuilder[] {
- return this.cosignatures;
- }
-
- /**
- * Gets the size of the object.
- *
- * @return Size in bytes.
- */
- public getSize(): number {
- let size = 0;
- size += this.transactionsHash.getSize();
- size += 4; // payloadSize
- size += 4; // aggregateTransactionHeader_Reserved1
- this.transactions.forEach((o) => size += EmbeddedTransactionHelper.serialize(o).length);
- this.cosignatures.forEach((o) => size += o.getSize());
- return size;
- }
-
- /**
- * Serializes an object to bytes.
- *
- * @return Serialized bytes.
- */
- public serialize(): Uint8Array {
- let newArray = Uint8Array.from([]);
- const transactionsHashBytes = this.transactionsHash.serialize();
- newArray = GeneratorUtils.concatTypedArrays(newArray, transactionsHashBytes);
- // tslint:disable-next-line: max-line-length
- const payloadSizeBytes = GeneratorUtils.uintToBuffer(EmbeddedTransactionHelper.getEmbeddedTransactionSize(this.transactions), 4);
- newArray = GeneratorUtils.concatTypedArrays(newArray, payloadSizeBytes);
- // tslint:disable-next-line: max-line-length
- const aggregateTransactionHeader_Reserved1Bytes = GeneratorUtils.uintToBuffer(this.getAggregateTransactionHeader_Reserved1(), 4);
- newArray = GeneratorUtils.concatTypedArrays(newArray, aggregateTransactionHeader_Reserved1Bytes);
- this.transactions.forEach((item) => {
- const transactionsBytes = EmbeddedTransactionHelper.serialize(item);
- newArray = GeneratorUtils.concatTypedArrays(newArray, transactionsBytes);
- });
- this.cosignatures.forEach((item) => {
- const cosignaturesBytes = item.serialize();
- newArray = GeneratorUtils.concatTypedArrays(newArray, cosignaturesBytes);
- });
- return newArray;
- }
-}
diff --git a/src/infrastructure/catbuffer/AliasActionDto.ts b/src/infrastructure/catbuffer/AliasActionDto.ts
deleted file mode 100644
index 58cd769ca8..0000000000
--- a/src/infrastructure/catbuffer/AliasActionDto.ts
+++ /dev/null
@@ -1,29 +0,0 @@
-// tslint:disable: jsdoc-format
-/**
-*** Copyright (c) 2016-present,
-*** Jaguar0625, gimre, BloodyRookie, Tech Bureau, Corp. All rights reserved.
-***
-*** This file is part of Catapult.
-***
-*** Catapult is free software: you can redistribute it and/or modify
-*** it under the terms of the GNU Lesser General Public License as published by
-*** the Free Software Foundation, either version 3 of the License, or
-*** (at your option) any later version.
-***
-*** Catapult is distributed in the hope that it will be useful,
-*** but WITHOUT ANY WARRANTY; without even the implied warranty of
-*** MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-*** GNU Lesser General Public License for more details.
-***
-*** You should have received a copy of the GNU Lesser General Public License
-*** along with Catapult. If not, see .
-**/
-
-
-/** Enumeration of alias actions. */
-export enum AliasActionDto {
- /** Unlink alias. */
- UNLINK = 0,
- /** Link alias. */
- LINK = 1,
-}
diff --git a/src/infrastructure/catbuffer/AmountDto.ts b/src/infrastructure/catbuffer/AmountDto.ts
deleted file mode 100644
index b1e3c31731..0000000000
--- a/src/infrastructure/catbuffer/AmountDto.ts
+++ /dev/null
@@ -1,80 +0,0 @@
-// tslint:disable: jsdoc-format
-/**
-*** Copyright (c) 2016-present,
-*** Jaguar0625, gimre, BloodyRookie, Tech Bureau, Corp. All rights reserved.
-***
-*** This file is part of Catapult.
-***
-*** Catapult is free software: you can redistribute it and/or modify
-*** it under the terms of the GNU Lesser General Public License as published by
-*** the Free Software Foundation, either version 3 of the License, or
-*** (at your option) any later version.
-***
-*** Catapult is distributed in the hope that it will be useful,
-*** but WITHOUT ANY WARRANTY; without even the implied warranty of
-*** MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-*** GNU Lesser General Public License for more details.
-***
-*** You should have received a copy of the GNU Lesser General Public License
-*** along with Catapult. If not, see .
-**/
-
-import { GeneratorUtils } from './GeneratorUtils';
-
-/** Amount. */
-export class AmountDto {
- /** Amount. */
- amount: number[];
-
- /**
- * Constructor.
- *
- * @param amount Amount.
- */
- constructor(amount: number[]) {
- this.amount = amount;
- }
-
- /**
- * Creates an instance of AmountDto from binary payload.
- *
- * @param payload Byte payload to use to serialize the object.
- * @return Instance of AmountDto.
- */
- public static loadFromBinary(payload: Uint8Array): AmountDto {
- const byteArray = Array.from(payload);
- const amount = GeneratorUtils.bufferToUint64(GeneratorUtils.getBytes(Uint8Array.from(byteArray), 8));
- byteArray.splice(0, 8);
- return new AmountDto(amount);
- }
-
- /**
- * Gets Amount.
- *
- * @return Amount.
- */
- public getAmount(): number[] {
- return this.amount;
- }
-
- /**
- * Gets the size of the object.
- *
- * @return Size in bytes.
- */
- public getSize(): number {
- return 8;
- }
-
- /**
- * Serializes an object to bytes.
- *
- * @return Serialized bytes.
- */
- public serialize(): Uint8Array {
- let newArray = Uint8Array.from([]);
- const amountBytes = GeneratorUtils.uint64ToBuffer(this.getAmount());
- newArray = GeneratorUtils.concatTypedArrays(newArray, amountBytes);
- return newArray;
- }
-}
diff --git a/src/infrastructure/catbuffer/BalanceChangeReceiptBuilder.ts b/src/infrastructure/catbuffer/BalanceChangeReceiptBuilder.ts
deleted file mode 100644
index 7670f20e0f..0000000000
--- a/src/infrastructure/catbuffer/BalanceChangeReceiptBuilder.ts
+++ /dev/null
@@ -1,111 +0,0 @@
-// tslint:disable: jsdoc-format
-/**
-*** Copyright (c) 2016-present,
-*** Jaguar0625, gimre, BloodyRookie, Tech Bureau, Corp. All rights reserved.
-***
-*** This file is part of Catapult.
-***
-*** Catapult is free software: you can redistribute it and/or modify
-*** it under the terms of the GNU Lesser General Public License as published by
-*** the Free Software Foundation, either version 3 of the License, or
-*** (at your option) any later version.
-***
-*** Catapult is distributed in the hope that it will be useful,
-*** but WITHOUT ANY WARRANTY; without even the implied warranty of
-*** MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-*** GNU Lesser General Public License for more details.
-***
-*** You should have received a copy of the GNU Lesser General Public License
-*** along with Catapult. If not, see .
-**/
-
-import { GeneratorUtils } from './GeneratorUtils';
-import { KeyDto } from './KeyDto';
-import { MosaicBuilder } from './MosaicBuilder';
-import { ReceiptBuilder } from './ReceiptBuilder';
-import { ReceiptTypeDto } from './ReceiptTypeDto';
-
-/** Binary layout for a balance change receipt. */
-export class BalanceChangeReceiptBuilder extends ReceiptBuilder {
- /** Mosaic. */
- mosaic: MosaicBuilder;
- /** Account public key. */
- targetPublicKey: KeyDto;
-
- /**
- * Constructor.
- *
- * @param version Receipt version.
- * @param type Receipt type.
- * @param mosaic Mosaic.
- * @param targetPublicKey Account public key.
- */
- public constructor(version: number, type: ReceiptTypeDto, mosaic: MosaicBuilder, targetPublicKey: KeyDto) {
- super(version, type);
- this.mosaic = mosaic;
- this.targetPublicKey = targetPublicKey;
- }
-
- /**
- * Creates an instance of BalanceChangeReceiptBuilder from binary payload.
- *
- * @param payload Byte payload to use to serialize the object.
- * @return Instance of BalanceChangeReceiptBuilder.
- */
- public static loadFromBinary(payload: Uint8Array): BalanceChangeReceiptBuilder {
- const byteArray = Array.from(payload);
- const superObject = ReceiptBuilder.loadFromBinary(Uint8Array.from(byteArray));
- byteArray.splice(0, superObject.getSize());
- const mosaic = MosaicBuilder.loadFromBinary(Uint8Array.from(byteArray));
- byteArray.splice(0, mosaic.getSize());
- const targetPublicKey = KeyDto.loadFromBinary(Uint8Array.from(byteArray));
- byteArray.splice(0, targetPublicKey.getSize());
- return new BalanceChangeReceiptBuilder(superObject.version, superObject.type, mosaic, targetPublicKey);
- }
-
- /**
- * Gets mosaic.
- *
- * @return Mosaic.
- */
- public getMosaic(): MosaicBuilder {
- return this.mosaic;
- }
-
- /**
- * Gets account public key.
- *
- * @return Account public key.
- */
- public getTargetPublicKey(): KeyDto {
- return this.targetPublicKey;
- }
-
- /**
- * Gets the size of the object.
- *
- * @return Size in bytes.
- */
- public getSize(): number {
- let size: number = super.getSize();
- size += this.mosaic.getSize();
- size += this.targetPublicKey.getSize();
- return size;
- }
-
- /**
- * Serializes an object to bytes.
- *
- * @return Serialized bytes.
- */
- public serialize(): Uint8Array {
- let newArray = Uint8Array.from([]);
- const superBytes = super.serialize();
- newArray = GeneratorUtils.concatTypedArrays(newArray, superBytes);
- const mosaicBytes = this.mosaic.serialize();
- newArray = GeneratorUtils.concatTypedArrays(newArray, mosaicBytes);
- const targetPublicKeyBytes = this.targetPublicKey.serialize();
- newArray = GeneratorUtils.concatTypedArrays(newArray, targetPublicKeyBytes);
- return newArray;
- }
-}
diff --git a/src/infrastructure/catbuffer/BalanceTransferReceiptBuilder.ts b/src/infrastructure/catbuffer/BalanceTransferReceiptBuilder.ts
deleted file mode 100644
index 89215dc6c1..0000000000
--- a/src/infrastructure/catbuffer/BalanceTransferReceiptBuilder.ts
+++ /dev/null
@@ -1,132 +0,0 @@
-// tslint:disable: jsdoc-format
-/**
-*** Copyright (c) 2016-present,
-*** Jaguar0625, gimre, BloodyRookie, Tech Bureau, Corp. All rights reserved.
-***
-*** This file is part of Catapult.
-***
-*** Catapult is free software: you can redistribute it and/or modify
-*** it under the terms of the GNU Lesser General Public License as published by
-*** the Free Software Foundation, either version 3 of the License, or
-*** (at your option) any later version.
-***
-*** Catapult is distributed in the hope that it will be useful,
-*** but WITHOUT ANY WARRANTY; without even the implied warranty of
-*** MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-*** GNU Lesser General Public License for more details.
-***
-*** You should have received a copy of the GNU Lesser General Public License
-*** along with Catapult. If not, see .
-**/
-
-import { AddressDto } from './AddressDto';
-import { GeneratorUtils } from './GeneratorUtils';
-import { KeyDto } from './KeyDto';
-import { MosaicBuilder } from './MosaicBuilder';
-import { ReceiptBuilder } from './ReceiptBuilder';
-import { ReceiptTypeDto } from './ReceiptTypeDto';
-
-/** Binary layout for a balance transfer receipt. */
-export class BalanceTransferReceiptBuilder extends ReceiptBuilder {
- /** Mosaic. */
- mosaic: MosaicBuilder;
- /** Mosaic sender public key. */
- senderPublicKey: KeyDto;
- /** Mosaic recipient address. */
- recipientAddress: AddressDto;
-
- /**
- * Constructor.
- *
- * @param version Receipt version.
- * @param type Receipt type.
- * @param mosaic Mosaic.
- * @param senderPublicKey Mosaic sender public key.
- * @param recipientAddress Mosaic recipient address.
- */
- // tslint:disable-next-line: max-line-length
- public constructor(version: number, type: ReceiptTypeDto, mosaic: MosaicBuilder, senderPublicKey: KeyDto, recipientAddress: AddressDto) {
- super(version, type);
- this.mosaic = mosaic;
- this.senderPublicKey = senderPublicKey;
- this.recipientAddress = recipientAddress;
- }
-
- /**
- * Creates an instance of BalanceTransferReceiptBuilder from binary payload.
- *
- * @param payload Byte payload to use to serialize the object.
- * @return Instance of BalanceTransferReceiptBuilder.
- */
- public static loadFromBinary(payload: Uint8Array): BalanceTransferReceiptBuilder {
- const byteArray = Array.from(payload);
- const superObject = ReceiptBuilder.loadFromBinary(Uint8Array.from(byteArray));
- byteArray.splice(0, superObject.getSize());
- const mosaic = MosaicBuilder.loadFromBinary(Uint8Array.from(byteArray));
- byteArray.splice(0, mosaic.getSize());
- const senderPublicKey = KeyDto.loadFromBinary(Uint8Array.from(byteArray));
- byteArray.splice(0, senderPublicKey.getSize());
- const recipientAddress = AddressDto.loadFromBinary(Uint8Array.from(byteArray));
- byteArray.splice(0, recipientAddress.getSize());
- // tslint:disable-next-line: max-line-length
- return new BalanceTransferReceiptBuilder(superObject.version, superObject.type, mosaic, senderPublicKey, recipientAddress);
- }
-
- /**
- * Gets mosaic.
- *
- * @return Mosaic.
- */
- public getMosaic(): MosaicBuilder {
- return this.mosaic;
- }
-
- /**
- * Gets mosaic sender public key.
- *
- * @return Mosaic sender public key.
- */
- public getSenderPublicKey(): KeyDto {
- return this.senderPublicKey;
- }
-
- /**
- * Gets mosaic recipient address.
- *
- * @return Mosaic recipient address.
- */
- public getRecipientAddress(): AddressDto {
- return this.recipientAddress;
- }
-
- /**
- * Gets the size of the object.
- *
- * @return Size in bytes.
- */
- public getSize(): number {
- let size: number = super.getSize();
- size += this.mosaic.getSize();
- size += this.senderPublicKey.getSize();
- size += this.recipientAddress.getSize();
- return size;
- }
-
- /**
- * Serializes an object to bytes.
- *
- * @return Serialized bytes.
- */
- public serialize(): Uint8Array {
- let newArray = Uint8Array.from([]);
- const superBytes = super.serialize();
- newArray = GeneratorUtils.concatTypedArrays(newArray, superBytes);
- const mosaicBytes = this.mosaic.serialize();
- newArray = GeneratorUtils.concatTypedArrays(newArray, mosaicBytes);
- const senderPublicKeyBytes = this.senderPublicKey.serialize();
- newArray = GeneratorUtils.concatTypedArrays(newArray, senderPublicKeyBytes);
- const recipientAddressBytes = this.recipientAddress.serialize();
- newArray = GeneratorUtils.concatTypedArrays(newArray, recipientAddressBytes);
- return newArray;
- }
-}
diff --git a/src/infrastructure/catbuffer/BlockDurationDto.ts b/src/infrastructure/catbuffer/BlockDurationDto.ts
deleted file mode 100644
index dfc232ebdc..0000000000
--- a/src/infrastructure/catbuffer/BlockDurationDto.ts
+++ /dev/null
@@ -1,80 +0,0 @@
-// tslint:disable: jsdoc-format
-/**
-*** Copyright (c) 2016-present,
-*** Jaguar0625, gimre, BloodyRookie, Tech Bureau, Corp. All rights reserved.
-***
-*** This file is part of Catapult.
-***
-*** Catapult is free software: you can redistribute it and/or modify
-*** it under the terms of the GNU Lesser General Public License as published by
-*** the Free Software Foundation, either version 3 of the License, or
-*** (at your option) any later version.
-***
-*** Catapult is distributed in the hope that it will be useful,
-*** but WITHOUT ANY WARRANTY; without even the implied warranty of
-*** MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-*** GNU Lesser General Public License for more details.
-***
-*** You should have received a copy of the GNU Lesser General Public License
-*** along with Catapult. If not, see .
-**/
-
-import { GeneratorUtils } from './GeneratorUtils';
-
-/** Block duration. */
-export class BlockDurationDto {
- /** Block duration. */
- blockDuration: number[];
-
- /**
- * Constructor.
- *
- * @param blockDuration Block duration.
- */
- constructor(blockDuration: number[]) {
- this.blockDuration = blockDuration;
- }
-
- /**
- * Creates an instance of BlockDurationDto from binary payload.
- *
- * @param payload Byte payload to use to serialize the object.
- * @return Instance of BlockDurationDto.
- */
- public static loadFromBinary(payload: Uint8Array): BlockDurationDto {
- const byteArray = Array.from(payload);
- const blockDuration = GeneratorUtils.bufferToUint64(GeneratorUtils.getBytes(Uint8Array.from(byteArray), 8));
- byteArray.splice(0, 8);
- return new BlockDurationDto(blockDuration);
- }
-
- /**
- * Gets Block duration.
- *
- * @return Block duration.
- */
- public getBlockDuration(): number[] {
- return this.blockDuration;
- }
-
- /**
- * Gets the size of the object.
- *
- * @return Size in bytes.
- */
- public getSize(): number {
- return 8;
- }
-
- /**
- * Serializes an object to bytes.
- *
- * @return Serialized bytes.
- */
- public serialize(): Uint8Array {
- let newArray = Uint8Array.from([]);
- const blockDurationBytes = GeneratorUtils.uint64ToBuffer(this.getBlockDuration());
- newArray = GeneratorUtils.concatTypedArrays(newArray, blockDurationBytes);
- return newArray;
- }
-}
diff --git a/src/infrastructure/catbuffer/BlockFeeMultiplierDto.ts b/src/infrastructure/catbuffer/BlockFeeMultiplierDto.ts
deleted file mode 100644
index 0e95c97ff0..0000000000
--- a/src/infrastructure/catbuffer/BlockFeeMultiplierDto.ts
+++ /dev/null
@@ -1,80 +0,0 @@
-// tslint:disable: jsdoc-format
-/**
-*** Copyright (c) 2016-present,
-*** Jaguar0625, gimre, BloodyRookie, Tech Bureau, Corp. All rights reserved.
-***
-*** This file is part of Catapult.
-***
-*** Catapult is free software: you can redistribute it and/or modify
-*** it under the terms of the GNU Lesser General Public License as published by
-*** the Free Software Foundation, either version 3 of the License, or
-*** (at your option) any later version.
-***
-*** Catapult is distributed in the hope that it will be useful,
-*** but WITHOUT ANY WARRANTY; without even the implied warranty of
-*** MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-*** GNU Lesser General Public License for more details.
-***
-*** You should have received a copy of the GNU Lesser General Public License
-*** along with Catapult. If not, see .
-**/
-
-import { GeneratorUtils } from './GeneratorUtils';
-
-/** Block fee multiplier. */
-export class BlockFeeMultiplierDto {
- /** Block fee multiplier. */
- blockFeeMultiplier: number;
-
- /**
- * Constructor.
- *
- * @param blockFeeMultiplier Block fee multiplier.
- */
- constructor(blockFeeMultiplier: number) {
- this.blockFeeMultiplier = blockFeeMultiplier;
- }
-
- /**
- * Creates an instance of BlockFeeMultiplierDto from binary payload.
- *
- * @param payload Byte payload to use to serialize the object.
- * @return Instance of BlockFeeMultiplierDto.
- */
- public static loadFromBinary(payload: Uint8Array): BlockFeeMultiplierDto {
- const byteArray = Array.from(payload);
- const blockFeeMultiplier = GeneratorUtils.bufferToUint(GeneratorUtils.getBytes(Uint8Array.from(byteArray), 4));
- byteArray.splice(0, 4);
- return new BlockFeeMultiplierDto(blockFeeMultiplier);
- }
-
- /**
- * Gets Block fee multiplier.
- *
- * @return Block fee multiplier.
- */
- public getBlockFeeMultiplier(): number {
- return this.blockFeeMultiplier;
- }
-
- /**
- * Gets the size of the object.
- *
- * @return Size in bytes.
- */
- public getSize(): number {
- return 4;
- }
-
- /**
- * Serializes an object to bytes.
- *
- * @return Serialized bytes.
- */
- public serialize(): Uint8Array {
- let newArray = Uint8Array.from([]);
- const blockFeeMultiplierBytes = GeneratorUtils.uintToBuffer(this.getBlockFeeMultiplier(), 4);
- newArray = GeneratorUtils.concatTypedArrays(newArray, blockFeeMultiplierBytes);
- return newArray;
- }
-}
diff --git a/src/infrastructure/catbuffer/BlockHeaderBuilder.ts b/src/infrastructure/catbuffer/BlockHeaderBuilder.ts
deleted file mode 100644
index eb693aa3fa..0000000000
--- a/src/infrastructure/catbuffer/BlockHeaderBuilder.ts
+++ /dev/null
@@ -1,387 +0,0 @@
-// tslint:disable: jsdoc-format
-/**
-*** Copyright (c) 2016-present,
-*** Jaguar0625, gimre, BloodyRookie, Tech Bureau, Corp. All rights reserved.
-***
-*** This file is part of Catapult.
-***
-*** Catapult is free software: you can redistribute it and/or modify
-*** it under the terms of the GNU Lesser General Public License as published by
-*** the Free Software Foundation, either version 3 of the License, or
-*** (at your option) any later version.
-***
-*** Catapult is distributed in the hope that it will be useful,
-*** but WITHOUT ANY WARRANTY; without even the implied warranty of
-*** MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-*** GNU Lesser General Public License for more details.
-***
-*** You should have received a copy of the GNU Lesser General Public License
-*** along with Catapult. If not, see .
-**/
-
-import { BlockFeeMultiplierDto } from './BlockFeeMultiplierDto';
-import { DifficultyDto } from './DifficultyDto';
-import { EntityTypeDto } from './EntityTypeDto';
-import { GeneratorUtils } from './GeneratorUtils';
-import { Hash256Dto } from './Hash256Dto';
-import { HeightDto } from './HeightDto';
-import { KeyDto } from './KeyDto';
-import { NetworkTypeDto } from './NetworkTypeDto';
-import { SignatureDto } from './SignatureDto';
-import { TimestampDto } from './TimestampDto';
-
-/** Binary layout for a block header. */
-export class BlockHeaderBuilder {
- /** Entity size. */
- size = 0;
- /** Reserved padding to align Signature on 8-byte boundary. */
- verifiableEntityHeader_Reserved1: number;
- /** Entity signature. */
- signature: SignatureDto;
- /** Entity signer's public key. */
- signerPublicKey: KeyDto;
- /** Reserved padding to align end of EntityBody on 8-byte boundary. */
- entityBody_Reserved1: number;
- /** Entity version. */
- version: number;
- /** Entity network. */
- network: NetworkTypeDto;
- /** Entity type. */
- type: EntityTypeDto;
- /** Block height. */
- height: HeightDto;
- /** Number of milliseconds elapsed since creation of nemesis block. */
- timestamp: TimestampDto;
- /** Block difficulty. */
- difficulty: DifficultyDto;
- /** Previous block hash. */
- previousBlockHash: Hash256Dto;
- /** Hash of the transactions in this block. */
- transactionsHash: Hash256Dto;
- /** Hash of the receipts generated by this block. */
- receiptsHash: Hash256Dto;
- /** Hash of the global chain state at this block. */
- stateHash: Hash256Dto;
- /** Beneficiary public key designated by harvester. */
- beneficiaryPublicKey: KeyDto;
- /** Fee multiplier applied to block transactions. */
- feeMultiplier: BlockFeeMultiplierDto;
- /** Reserved padding to align end of BlockHeader on 8-byte boundary. */
- blockHeader_Reserved1: number;
-
- /**
- * Constructor.
- *
- * @param signature Entity signature.
- * @param signerPublicKey Entity signer's public key.
- * @param version Entity version.
- * @param network Entity network.
- * @param type Entity type.
- * @param height Block height.
- * @param timestamp Number of milliseconds elapsed since creation of nemesis block.
- * @param difficulty Block difficulty.
- * @param previousBlockHash Previous block hash.
- * @param transactionsHash Hash of the transactions in this block.
- * @param receiptsHash Hash of the receipts generated by this block.
- * @param stateHash Hash of the global chain state at this block.
- * @param beneficiaryPublicKey Beneficiary public key designated by harvester.
- * @param feeMultiplier Fee multiplier applied to block transactions.
- */
- // tslint:disable-next-line: max-line-length
- public constructor(signature: SignatureDto, signerPublicKey: KeyDto, version: number, network: NetworkTypeDto, type: EntityTypeDto, height: HeightDto, timestamp: TimestampDto, difficulty: DifficultyDto, previousBlockHash: Hash256Dto, transactionsHash: Hash256Dto, receiptsHash: Hash256Dto, stateHash: Hash256Dto, beneficiaryPublicKey: KeyDto, feeMultiplier: BlockFeeMultiplierDto) {
- this.verifiableEntityHeader_Reserved1 = 0;
- this.signature = signature;
- this.signerPublicKey = signerPublicKey;
- this.entityBody_Reserved1 = 0;
- this.version = version;
- this.network = network;
- this.type = type;
- this.height = height;
- this.timestamp = timestamp;
- this.difficulty = difficulty;
- this.previousBlockHash = previousBlockHash;
- this.transactionsHash = transactionsHash;
- this.receiptsHash = receiptsHash;
- this.stateHash = stateHash;
- this.beneficiaryPublicKey = beneficiaryPublicKey;
- this.feeMultiplier = feeMultiplier;
- this.blockHeader_Reserved1 = 0;
- }
-
- /**
- * Creates an instance of BlockHeaderBuilder from binary payload.
- *
- * @param payload Byte payload to use to serialize the object.
- * @return Instance of BlockHeaderBuilder.
- */
- public static loadFromBinary(payload: Uint8Array): BlockHeaderBuilder {
- const byteArray = Array.from(payload);
- const size = GeneratorUtils.bufferToUint(GeneratorUtils.getBytes(Uint8Array.from(byteArray), 4));
- byteArray.splice(0, 4);
- // tslint:disable-next-line: max-line-length
- const verifiableEntityHeader_Reserved1 = GeneratorUtils.bufferToUint(GeneratorUtils.getBytes(Uint8Array.from(byteArray), 4));
- byteArray.splice(0, 4);
- const signature = SignatureDto.loadFromBinary(Uint8Array.from(byteArray));
- byteArray.splice(0, signature.getSize());
- const signerPublicKey = KeyDto.loadFromBinary(Uint8Array.from(byteArray));
- byteArray.splice(0, signerPublicKey.getSize());
- const entityBody_Reserved1 = GeneratorUtils.bufferToUint(GeneratorUtils.getBytes(Uint8Array.from(byteArray), 4));
- byteArray.splice(0, 4);
- const version = GeneratorUtils.bufferToUint(GeneratorUtils.getBytes(Uint8Array.from(byteArray), 1));
- byteArray.splice(0, 1);
- const network = GeneratorUtils.bufferToUint(GeneratorUtils.getBytes(Uint8Array.from(byteArray), 1));
- byteArray.splice(0, 1);
- const type = GeneratorUtils.bufferToUint(GeneratorUtils.getBytes(Uint8Array.from(byteArray), 2));
- byteArray.splice(0, 2);
- const height = HeightDto.loadFromBinary(Uint8Array.from(byteArray));
- byteArray.splice(0, height.getSize());
- const timestamp = TimestampDto.loadFromBinary(Uint8Array.from(byteArray));
- byteArray.splice(0, timestamp.getSize());
- const difficulty = DifficultyDto.loadFromBinary(Uint8Array.from(byteArray));
- byteArray.splice(0, difficulty.getSize());
- const previousBlockHash = Hash256Dto.loadFromBinary(Uint8Array.from(byteArray));
- byteArray.splice(0, previousBlockHash.getSize());
- const transactionsHash = Hash256Dto.loadFromBinary(Uint8Array.from(byteArray));
- byteArray.splice(0, transactionsHash.getSize());
- const receiptsHash = Hash256Dto.loadFromBinary(Uint8Array.from(byteArray));
- byteArray.splice(0, receiptsHash.getSize());
- const stateHash = Hash256Dto.loadFromBinary(Uint8Array.from(byteArray));
- byteArray.splice(0, stateHash.getSize());
- const beneficiaryPublicKey = KeyDto.loadFromBinary(Uint8Array.from(byteArray));
- byteArray.splice(0, beneficiaryPublicKey.getSize());
- const feeMultiplier = BlockFeeMultiplierDto.loadFromBinary(Uint8Array.from(byteArray));
- byteArray.splice(0, feeMultiplier.getSize());
- const blockHeader_Reserved1 = GeneratorUtils.bufferToUint(GeneratorUtils.getBytes(Uint8Array.from(byteArray), 4));
- byteArray.splice(0, 4);
- // tslint:disable-next-line: max-line-length
- return new BlockHeaderBuilder(signature, signerPublicKey, version, network, type, height, timestamp, difficulty, previousBlockHash, transactionsHash, receiptsHash, stateHash, beneficiaryPublicKey, feeMultiplier);
- }
-
- /**
- * Gets reserved padding to align Signature on 8-byte boundary.
- *
- * @return Reserved padding to align Signature on 8-byte boundary.
- */
- public getVerifiableEntityHeader_Reserved1(): number {
- return this.verifiableEntityHeader_Reserved1;
- }
-
- /**
- * Gets entity signature.
- *
- * @return Entity signature.
- */
- public getSignature(): SignatureDto {
- return this.signature;
- }
-
- /**
- * Gets entity signer's public key.
- *
- * @return Entity signer's public key.
- */
- public getSignerPublicKey(): KeyDto {
- return this.signerPublicKey;
- }
-
- /**
- * Gets reserved padding to align end of EntityBody on 8-byte boundary.
- *
- * @return Reserved padding to align end of EntityBody on 8-byte boundary.
- */
- public getEntityBody_Reserved1(): number {
- return this.entityBody_Reserved1;
- }
-
- /**
- * Gets entity version.
- *
- * @return Entity version.
- */
- public getVersion(): number {
- return this.version;
- }
-
- /**
- * Gets entity network.
- *
- * @return Entity network.
- */
- public getNetwork(): NetworkTypeDto {
- return this.network;
- }
-
- /**
- * Gets entity type.
- *
- * @return Entity type.
- */
- public getType(): EntityTypeDto {
- return this.type;
- }
-
- /**
- * Gets block height.
- *
- * @return Block height.
- */
- public getHeight(): HeightDto {
- return this.height;
- }
-
- /**
- * Gets number of milliseconds elapsed since creation of nemesis block.
- *
- * @return Number of milliseconds elapsed since creation of nemesis block.
- */
- public getTimestamp(): TimestampDto {
- return this.timestamp;
- }
-
- /**
- * Gets block difficulty.
- *
- * @return Block difficulty.
- */
- public getDifficulty(): DifficultyDto {
- return this.difficulty;
- }
-
- /**
- * Gets previous block hash.
- *
- * @return Previous block hash.
- */
- public getPreviousBlockHash(): Hash256Dto {
- return this.previousBlockHash;
- }
-
- /**
- * Gets hash of the transactions in this block.
- *
- * @return Hash of the transactions in this block.
- */
- public getTransactionsHash(): Hash256Dto {
- return this.transactionsHash;
- }
-
- /**
- * Gets hash of the receipts generated by this block.
- *
- * @return Hash of the receipts generated by this block.
- */
- public getReceiptsHash(): Hash256Dto {
- return this.receiptsHash;
- }
-
- /**
- * Gets hash of the global chain state at this block.
- *
- * @return Hash of the global chain state at this block.
- */
- public getStateHash(): Hash256Dto {
- return this.stateHash;
- }
-
- /**
- * Gets beneficiary public key designated by harvester.
- *
- * @return Beneficiary public key designated by harvester.
- */
- public getBeneficiaryPublicKey(): KeyDto {
- return this.beneficiaryPublicKey;
- }
-
- /**
- * Gets fee multiplier applied to block transactions.
- *
- * @return Fee multiplier applied to block transactions.
- */
- public getFeeMultiplier(): BlockFeeMultiplierDto {
- return this.feeMultiplier;
- }
-
- /**
- * Gets reserved padding to align end of BlockHeader on 8-byte boundary.
- *
- * @return Reserved padding to align end of BlockHeader on 8-byte boundary.
- */
- public getBlockHeader_Reserved1(): number {
- return this.blockHeader_Reserved1;
- }
-
- /**
- * Gets the size of the object.
- *
- * @return Size in bytes.
- */
- public getSize(): number {
- let size = 0;
- size += 4; // size
- size += 4; // verifiableEntityHeader_Reserved1
- size += this.signature.getSize();
- size += this.signerPublicKey.getSize();
- size += 4; // entityBody_Reserved1
- size += 1; // version
- size += 1; // network
- size += 2; // type
- size += this.height.getSize();
- size += this.timestamp.getSize();
- size += this.difficulty.getSize();
- size += this.previousBlockHash.getSize();
- size += this.transactionsHash.getSize();
- size += this.receiptsHash.getSize();
- size += this.stateHash.getSize();
- size += this.beneficiaryPublicKey.getSize();
- size += this.feeMultiplier.getSize();
- size += 4; // blockHeader_Reserved1
- return size;
- }
-
- /**
- * Serializes an object to bytes.
- *
- * @return Serialized bytes.
- */
- public serialize(): Uint8Array {
- let newArray = Uint8Array.from([]);
- const sizeBytes = GeneratorUtils.uintToBuffer(this.getSize(), 4);
- newArray = GeneratorUtils.concatTypedArrays(newArray, sizeBytes);
- // tslint:disable-next-line: max-line-length
- const verifiableEntityHeader_Reserved1Bytes = GeneratorUtils.uintToBuffer(this.getVerifiableEntityHeader_Reserved1(), 4);
- newArray = GeneratorUtils.concatTypedArrays(newArray, verifiableEntityHeader_Reserved1Bytes);
- const signatureBytes = this.signature.serialize();
- newArray = GeneratorUtils.concatTypedArrays(newArray, signatureBytes);
- const signerPublicKeyBytes = this.signerPublicKey.serialize();
- newArray = GeneratorUtils.concatTypedArrays(newArray, signerPublicKeyBytes);
- const entityBody_Reserved1Bytes = GeneratorUtils.uintToBuffer(this.getEntityBody_Reserved1(), 4);
- newArray = GeneratorUtils.concatTypedArrays(newArray, entityBody_Reserved1Bytes);
- const versionBytes = GeneratorUtils.uintToBuffer(this.getVersion(), 1);
- newArray = GeneratorUtils.concatTypedArrays(newArray, versionBytes);
- const networkBytes = GeneratorUtils.uintToBuffer(this.network, 1);
- newArray = GeneratorUtils.concatTypedArrays(newArray, networkBytes);
- const typeBytes = GeneratorUtils.uintToBuffer(this.type, 2);
- newArray = GeneratorUtils.concatTypedArrays(newArray, typeBytes);
- const heightBytes = this.height.serialize();
- newArray = GeneratorUtils.concatTypedArrays(newArray, heightBytes);
- const timestampBytes = this.timestamp.serialize();
- newArray = GeneratorUtils.concatTypedArrays(newArray, timestampBytes);
- const difficultyBytes = this.difficulty.serialize();
- newArray = GeneratorUtils.concatTypedArrays(newArray, difficultyBytes);
- const previousBlockHashBytes = this.previousBlockHash.serialize();
- newArray = GeneratorUtils.concatTypedArrays(newArray, previousBlockHashBytes);
- const transactionsHashBytes = this.transactionsHash.serialize();
- newArray = GeneratorUtils.concatTypedArrays(newArray, transactionsHashBytes);
- const receiptsHashBytes = this.receiptsHash.serialize();
- newArray = GeneratorUtils.concatTypedArrays(newArray, receiptsHashBytes);
- const stateHashBytes = this.stateHash.serialize();
- newArray = GeneratorUtils.concatTypedArrays(newArray, stateHashBytes);
- const beneficiaryPublicKeyBytes = this.beneficiaryPublicKey.serialize();
- newArray = GeneratorUtils.concatTypedArrays(newArray, beneficiaryPublicKeyBytes);
- const feeMultiplierBytes = this.feeMultiplier.serialize();
- newArray = GeneratorUtils.concatTypedArrays(newArray, feeMultiplierBytes);
- const blockHeader_Reserved1Bytes = GeneratorUtils.uintToBuffer(this.getBlockHeader_Reserved1(), 4);
- newArray = GeneratorUtils.concatTypedArrays(newArray, blockHeader_Reserved1Bytes);
- return newArray;
- }
-}
diff --git a/src/infrastructure/catbuffer/CosignatureBuilder.ts b/src/infrastructure/catbuffer/CosignatureBuilder.ts
deleted file mode 100644
index 3c1978b04a..0000000000
--- a/src/infrastructure/catbuffer/CosignatureBuilder.ts
+++ /dev/null
@@ -1,102 +0,0 @@
-// tslint:disable: jsdoc-format
-/**
-*** Copyright (c) 2016-present,
-*** Jaguar0625, gimre, BloodyRookie, Tech Bureau, Corp. All rights reserved.
-***
-*** This file is part of Catapult.
-***
-*** Catapult is free software: you can redistribute it and/or modify
-*** it under the terms of the GNU Lesser General Public License as published by
-*** the Free Software Foundation, either version 3 of the License, or
-*** (at your option) any later version.
-***
-*** Catapult is distributed in the hope that it will be useful,
-*** but WITHOUT ANY WARRANTY; without even the implied warranty of
-*** MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-*** GNU Lesser General Public License for more details.
-***
-*** You should have received a copy of the GNU Lesser General Public License
-*** along with Catapult. If not, see .
-**/
-
-import { GeneratorUtils } from './GeneratorUtils';
-import { KeyDto } from './KeyDto';
-import { SignatureDto } from './SignatureDto';
-
-/** Cosignature attached to an aggregate transaction. */
-export class CosignatureBuilder {
- /** Cosigner public key. */
- signerPublicKey: KeyDto;
- /** Cosigner signature. */
- signature: SignatureDto;
-
- /**
- * Constructor.
- *
- * @param signerPublicKey Cosigner public key.
- * @param signature Cosigner signature.
- */
- public constructor(signerPublicKey: KeyDto, signature: SignatureDto) {
- this.signerPublicKey = signerPublicKey;
- this.signature = signature;
- }
-
- /**
- * Creates an instance of CosignatureBuilder from binary payload.
- *
- * @param payload Byte payload to use to serialize the object.
- * @return Instance of CosignatureBuilder.
- */
- public static loadFromBinary(payload: Uint8Array): CosignatureBuilder {
- const byteArray = Array.from(payload);
- const signerPublicKey = KeyDto.loadFromBinary(Uint8Array.from(byteArray));
- byteArray.splice(0, signerPublicKey.getSize());
- const signature = SignatureDto.loadFromBinary(Uint8Array.from(byteArray));
- byteArray.splice(0, signature.getSize());
- return new CosignatureBuilder(signerPublicKey, signature);
- }
-
- /**
- * Gets cosigner public key.
- *
- * @return Cosigner public key.
- */
- public getSignerPublicKey(): KeyDto {
- return this.signerPublicKey;
- }
-
- /**
- * Gets cosigner signature.
- *
- * @return Cosigner signature.
- */
- public getSignature(): SignatureDto {
- return this.signature;
- }
-
- /**
- * Gets the size of the object.
- *
- * @return Size in bytes.
- */
- public getSize(): number {
- let size = 0;
- size += this.signerPublicKey.getSize();
- size += this.signature.getSize();
- return size;
- }
-
- /**
- * Serializes an object to bytes.
- *
- * @return Serialized bytes.
- */
- public serialize(): Uint8Array {
- let newArray = Uint8Array.from([]);
- const signerPublicKeyBytes = this.signerPublicKey.serialize();
- newArray = GeneratorUtils.concatTypedArrays(newArray, signerPublicKeyBytes);
- const signatureBytes = this.signature.serialize();
- newArray = GeneratorUtils.concatTypedArrays(newArray, signatureBytes);
- return newArray;
- }
-}
diff --git a/src/infrastructure/catbuffer/DetachedCosignatureBuilder.ts b/src/infrastructure/catbuffer/DetachedCosignatureBuilder.ts
deleted file mode 100644
index 7cf65ab230..0000000000
--- a/src/infrastructure/catbuffer/DetachedCosignatureBuilder.ts
+++ /dev/null
@@ -1,93 +0,0 @@
-// tslint:disable: jsdoc-format
-/**
-*** Copyright (c) 2016-present,
-*** Jaguar0625, gimre, BloodyRookie, Tech Bureau, Corp. All rights reserved.
-***
-*** This file is part of Catapult.
-***
-*** Catapult is free software: you can redistribute it and/or modify
-*** it under the terms of the GNU Lesser General Public License as published by
-*** the Free Software Foundation, either version 3 of the License, or
-*** (at your option) any later version.
-***
-*** Catapult is distributed in the hope that it will be useful,
-*** but WITHOUT ANY WARRANTY; without even the implied warranty of
-*** MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-*** GNU Lesser General Public License for more details.
-***
-*** You should have received a copy of the GNU Lesser General Public License
-*** along with Catapult. If not, see .
-**/
-
-import { CosignatureBuilder } from './CosignatureBuilder';
-import { GeneratorUtils } from './GeneratorUtils';
-import { Hash256Dto } from './Hash256Dto';
-import { KeyDto } from './KeyDto';
-import { SignatureDto } from './SignatureDto';
-
-/** Cosignature detached from an aggregate transaction. */
-export class DetachedCosignatureBuilder extends CosignatureBuilder {
- /** Hash of the aggregate transaction that is signed by this cosignature. */
- parentHash: Hash256Dto;
-
- /**
- * Constructor.
- *
- * @param signerPublicKey Cosigner public key.
- * @param signature Cosigner signature.
- * @param parentHash Hash of the aggregate transaction that is signed by this cosignature.
- */
- public constructor(signerPublicKey: KeyDto, signature: SignatureDto, parentHash: Hash256Dto) {
- super(signerPublicKey, signature);
- this.parentHash = parentHash;
- }
-
- /**
- * Creates an instance of DetachedCosignatureBuilder from binary payload.
- *
- * @param payload Byte payload to use to serialize the object.
- * @return Instance of DetachedCosignatureBuilder.
- */
- public static loadFromBinary(payload: Uint8Array): DetachedCosignatureBuilder {
- const byteArray = Array.from(payload);
- const superObject = CosignatureBuilder.loadFromBinary(Uint8Array.from(byteArray));
- byteArray.splice(0, superObject.getSize());
- const parentHash = Hash256Dto.loadFromBinary(Uint8Array.from(byteArray));
- byteArray.splice(0, parentHash.getSize());
- return new DetachedCosignatureBuilder(superObject.signerPublicKey, superObject.signature, parentHash);
- }
-
- /**
- * Gets hash of the aggregate transaction that is signed by this cosignature.
- *
- * @return Hash of the aggregate transaction that is signed by this cosignature.
- */
- public getParentHash(): Hash256Dto {
- return this.parentHash;
- }
-
- /**
- * Gets the size of the object.
- *
- * @return Size in bytes.
- */
- public getSize(): number {
- let size: number = super.getSize();
- size += this.parentHash.getSize();
- return size;
- }
-
- /**
- * Serializes an object to bytes.
- *
- * @return Serialized bytes.
- */
- public serialize(): Uint8Array {
- let newArray = Uint8Array.from([]);
- const superBytes = super.serialize();
- newArray = GeneratorUtils.concatTypedArrays(newArray, superBytes);
- const parentHashBytes = this.parentHash.serialize();
- newArray = GeneratorUtils.concatTypedArrays(newArray, parentHashBytes);
- return newArray;
- }
-}
diff --git a/src/infrastructure/catbuffer/DifficultyDto.ts b/src/infrastructure/catbuffer/DifficultyDto.ts
deleted file mode 100644
index 07189e4190..0000000000
--- a/src/infrastructure/catbuffer/DifficultyDto.ts
+++ /dev/null
@@ -1,80 +0,0 @@
-// tslint:disable: jsdoc-format
-/**
-*** Copyright (c) 2016-present,
-*** Jaguar0625, gimre, BloodyRookie, Tech Bureau, Corp. All rights reserved.
-***
-*** This file is part of Catapult.
-***
-*** Catapult is free software: you can redistribute it and/or modify
-*** it under the terms of the GNU Lesser General Public License as published by
-*** the Free Software Foundation, either version 3 of the License, or
-*** (at your option) any later version.
-***
-*** Catapult is distributed in the hope that it will be useful,
-*** but WITHOUT ANY WARRANTY; without even the implied warranty of
-*** MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-*** GNU Lesser General Public License for more details.
-***
-*** You should have received a copy of the GNU Lesser General Public License
-*** along with Catapult. If not, see .
-**/
-
-import { GeneratorUtils } from './GeneratorUtils';
-
-/** Difficulty. */
-export class DifficultyDto {
- /** Difficulty. */
- difficulty: number[];
-
- /**
- * Constructor.
- *
- * @param difficulty Difficulty.
- */
- constructor(difficulty: number[]) {
- this.difficulty = difficulty;
- }
-
- /**
- * Creates an instance of DifficultyDto from binary payload.
- *
- * @param payload Byte payload to use to serialize the object.
- * @return Instance of DifficultyDto.
- */
- public static loadFromBinary(payload: Uint8Array): DifficultyDto {
- const byteArray = Array.from(payload);
- const difficulty = GeneratorUtils.bufferToUint64(GeneratorUtils.getBytes(Uint8Array.from(byteArray), 8));
- byteArray.splice(0, 8);
- return new DifficultyDto(difficulty);
- }
-
- /**
- * Gets Difficulty.
- *
- * @return Difficulty.
- */
- public getDifficulty(): number[] {
- return this.difficulty;
- }
-
- /**
- * Gets the size of the object.
- *
- * @return Size in bytes.
- */
- public getSize(): number {
- return 8;
- }
-
- /**
- * Serializes an object to bytes.
- *
- * @return Serialized bytes.
- */
- public serialize(): Uint8Array {
- let newArray = Uint8Array.from([]);
- const difficultyBytes = GeneratorUtils.uint64ToBuffer(this.getDifficulty());
- newArray = GeneratorUtils.concatTypedArrays(newArray, difficultyBytes);
- return newArray;
- }
-}
diff --git a/src/infrastructure/catbuffer/EmbeddedAccountAddressRestrictionTransactionBuilder.ts b/src/infrastructure/catbuffer/EmbeddedAccountAddressRestrictionTransactionBuilder.ts
deleted file mode 100644
index 6d927eb598..0000000000
--- a/src/infrastructure/catbuffer/EmbeddedAccountAddressRestrictionTransactionBuilder.ts
+++ /dev/null
@@ -1,130 +0,0 @@
-// tslint:disable: jsdoc-format
-/**
-*** Copyright (c) 2016-present,
-*** Jaguar0625, gimre, BloodyRookie, Tech Bureau, Corp. All rights reserved.
-***
-*** This file is part of Catapult.
-***
-*** Catapult is free software: you can redistribute it and/or modify
-*** it under the terms of the GNU Lesser General Public License as published by
-*** the Free Software Foundation, either version 3 of the License, or
-*** (at your option) any later version.
-***
-*** Catapult is distributed in the hope that it will be useful,
-*** but WITHOUT ANY WARRANTY; without even the implied warranty of
-*** MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-*** GNU Lesser General Public License for more details.
-***
-*** You should have received a copy of the GNU Lesser General Public License
-*** along with Catapult. If not, see .
-**/
-
-import { AccountAddressRestrictionTransactionBodyBuilder } from './AccountAddressRestrictionTransactionBodyBuilder';
-import { EmbeddedTransactionBuilder } from './EmbeddedTransactionBuilder';
-import { EntityTypeDto } from './EntityTypeDto';
-import { GeneratorUtils } from './GeneratorUtils';
-import { KeyDto } from './KeyDto';
-import { NetworkTypeDto } from './NetworkTypeDto';
-import { UnresolvedAddressDto } from './UnresolvedAddressDto';
-
-/** Binary layout for an embedded account address restriction transaction. */
-export class EmbeddedAccountAddressRestrictionTransactionBuilder extends EmbeddedTransactionBuilder {
- /** Account address restriction transaction body. */
- accountAddressRestrictionTransactionBody: AccountAddressRestrictionTransactionBodyBuilder;
-
- /**
- * Constructor.
- *
- * @param signerPublicKey Entity signer's public key.
- * @param version Entity version.
- * @param network Entity network.
- * @param type Entity type.
- * @param restrictionFlags Account restriction flags.
- * @param restrictionAdditions Account restriction additions.
- * @param restrictionDeletions Account restriction deletions.
- */
- // tslint:disable-next-line: max-line-length
- public constructor(signerPublicKey: KeyDto, version: number, network: NetworkTypeDto, type: EntityTypeDto, restrictionFlags: number, restrictionAdditions: UnresolvedAddressDto[], restrictionDeletions: UnresolvedAddressDto[]) {
- super(signerPublicKey, version, network, type);
- // tslint:disable-next-line: max-line-length
- this.accountAddressRestrictionTransactionBody = new AccountAddressRestrictionTransactionBodyBuilder(restrictionFlags, restrictionAdditions, restrictionDeletions);
- }
-
- /**
- * Creates an instance of EmbeddedAccountAddressRestrictionTransactionBuilder from binary payload.
- *
- * @param payload Byte payload to use to serialize the object.
- * @return Instance of EmbeddedAccountAddressRestrictionTransactionBuilder.
- */
- public static loadFromBinary(payload: Uint8Array): EmbeddedAccountAddressRestrictionTransactionBuilder {
- const byteArray = Array.from(payload);
- const superObject = EmbeddedTransactionBuilder.loadFromBinary(Uint8Array.from(byteArray));
- byteArray.splice(0, superObject.getSize());
- // tslint:disable-next-line: max-line-length
- const accountAddressRestrictionTransactionBody = AccountAddressRestrictionTransactionBodyBuilder.loadFromBinary(Uint8Array.from(byteArray));
- byteArray.splice(0, accountAddressRestrictionTransactionBody.getSize());
- // tslint:disable-next-line: max-line-length
- return new EmbeddedAccountAddressRestrictionTransactionBuilder(superObject.signerPublicKey, superObject.version, superObject.network, superObject.type, accountAddressRestrictionTransactionBody.restrictionFlags, accountAddressRestrictionTransactionBody.restrictionAdditions, accountAddressRestrictionTransactionBody.restrictionDeletions);
- }
-
- /**
- * Gets account restriction flags.
- *
- * @return Account restriction flags.
- */
- public getRestrictionFlags(): number {
- return this.accountAddressRestrictionTransactionBody.getRestrictionFlags();
- }
-
- /**
- * Gets reserved padding to align restrictionAdditions on 8-byte boundary.
- *
- * @return Reserved padding to align restrictionAdditions on 8-byte boundary.
- */
- public getAccountRestrictionTransactionBody_Reserved1(): number {
- return this.accountAddressRestrictionTransactionBody.getAccountRestrictionTransactionBody_Reserved1();
- }
-
- /**
- * Gets account restriction additions.
- *
- * @return Account restriction additions.
- */
- public getRestrictionAdditions(): UnresolvedAddressDto[] {
- return this.accountAddressRestrictionTransactionBody.getRestrictionAdditions();
- }
-
- /**
- * Gets account restriction deletions.
- *
- * @return Account restriction deletions.
- */
- public getRestrictionDeletions(): UnresolvedAddressDto[] {
- return this.accountAddressRestrictionTransactionBody.getRestrictionDeletions();
- }
-
- /**
- * Gets the size of the object.
- *
- * @return Size in bytes.
- */
- public getSize(): number {
- let size: number = super.getSize();
- size += this.accountAddressRestrictionTransactionBody.getSize();
- return size;
- }
-
- /**
- * Serializes an object to bytes.
- *
- * @return Serialized bytes.
- */
- public serialize(): Uint8Array {
- let newArray = Uint8Array.from([]);
- const superBytes = super.serialize();
- newArray = GeneratorUtils.concatTypedArrays(newArray, superBytes);
- const accountAddressRestrictionTransactionBodyBytes = this.accountAddressRestrictionTransactionBody.serialize();
- newArray = GeneratorUtils.concatTypedArrays(newArray, accountAddressRestrictionTransactionBodyBytes);
- return newArray;
- }
-}
diff --git a/src/infrastructure/catbuffer/EmbeddedAccountLinkTransactionBuilder.ts b/src/infrastructure/catbuffer/EmbeddedAccountLinkTransactionBuilder.ts
deleted file mode 100644
index cee7c7b711..0000000000
--- a/src/infrastructure/catbuffer/EmbeddedAccountLinkTransactionBuilder.ts
+++ /dev/null
@@ -1,109 +0,0 @@
-// tslint:disable: jsdoc-format
-/**
-*** Copyright (c) 2016-present,
-*** Jaguar0625, gimre, BloodyRookie, Tech Bureau, Corp. All rights reserved.
-***
-*** This file is part of Catapult.
-***
-*** Catapult is free software: you can redistribute it and/or modify
-*** it under the terms of the GNU Lesser General Public License as published by
-*** the Free Software Foundation, either version 3 of the License, or
-*** (at your option) any later version.
-***
-*** Catapult is distributed in the hope that it will be useful,
-*** but WITHOUT ANY WARRANTY; without even the implied warranty of
-*** MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-*** GNU Lesser General Public License for more details.
-***
-*** You should have received a copy of the GNU Lesser General Public License
-*** along with Catapult. If not, see .
-**/
-
-import { AccountLinkActionDto } from './AccountLinkActionDto';
-import { AccountLinkTransactionBodyBuilder } from './AccountLinkTransactionBodyBuilder';
-import { EmbeddedTransactionBuilder } from './EmbeddedTransactionBuilder';
-import { EntityTypeDto } from './EntityTypeDto';
-import { GeneratorUtils } from './GeneratorUtils';
-import { KeyDto } from './KeyDto';
-import { NetworkTypeDto } from './NetworkTypeDto';
-
-/** Binary layout for an embedded account link transaction. */
-export class EmbeddedAccountLinkTransactionBuilder extends EmbeddedTransactionBuilder {
- /** Account link transaction body. */
- accountLinkTransactionBody: AccountLinkTransactionBodyBuilder;
-
- /**
- * Constructor.
- *
- * @param signerPublicKey Entity signer's public key.
- * @param version Entity version.
- * @param network Entity network.
- * @param type Entity type.
- * @param remotePublicKey Remote public key.
- * @param linkAction Account link action.
- */
- // tslint:disable-next-line: max-line-length
- public constructor(signerPublicKey: KeyDto, version: number, network: NetworkTypeDto, type: EntityTypeDto, remotePublicKey: KeyDto, linkAction: AccountLinkActionDto) {
- super(signerPublicKey, version, network, type);
- this.accountLinkTransactionBody = new AccountLinkTransactionBodyBuilder(remotePublicKey, linkAction);
- }
-
- /**
- * Creates an instance of EmbeddedAccountLinkTransactionBuilder from binary payload.
- *
- * @param payload Byte payload to use to serialize the object.
- * @return Instance of EmbeddedAccountLinkTransactionBuilder.
- */
- public static loadFromBinary(payload: Uint8Array): EmbeddedAccountLinkTransactionBuilder {
- const byteArray = Array.from(payload);
- const superObject = EmbeddedTransactionBuilder.loadFromBinary(Uint8Array.from(byteArray));
- byteArray.splice(0, superObject.getSize());
- const accountLinkTransactionBody = AccountLinkTransactionBodyBuilder.loadFromBinary(Uint8Array.from(byteArray));
- byteArray.splice(0, accountLinkTransactionBody.getSize());
- // tslint:disable-next-line: max-line-length
- return new EmbeddedAccountLinkTransactionBuilder(superObject.signerPublicKey, superObject.version, superObject.network, superObject.type, accountLinkTransactionBody.remotePublicKey, accountLinkTransactionBody.linkAction);
- }
-
- /**
- * Gets remote public key.
- *
- * @return Remote public key.
- */
- public getRemotePublicKey(): KeyDto {
- return this.accountLinkTransactionBody.getRemotePublicKey();
- }
-
- /**
- * Gets account link action.
- *
- * @return Account link action.
- */
- public getLinkAction(): AccountLinkActionDto {
- return this.accountLinkTransactionBody.getLinkAction();
- }
-
- /**
- * Gets the size of the object.
- *
- * @return Size in bytes.
- */
- public getSize(): number {
- let size: number = super.getSize();
- size += this.accountLinkTransactionBody.getSize();
- return size;
- }
-
- /**
- * Serializes an object to bytes.
- *
- * @return Serialized bytes.
- */
- public serialize(): Uint8Array {
- let newArray = Uint8Array.from([]);
- const superBytes = super.serialize();
- newArray = GeneratorUtils.concatTypedArrays(newArray, superBytes);
- const accountLinkTransactionBodyBytes = this.accountLinkTransactionBody.serialize();
- newArray = GeneratorUtils.concatTypedArrays(newArray, accountLinkTransactionBodyBytes);
- return newArray;
- }
-}
diff --git a/src/infrastructure/catbuffer/EmbeddedAccountMetadataTransactionBuilder.ts b/src/infrastructure/catbuffer/EmbeddedAccountMetadataTransactionBuilder.ts
deleted file mode 100644
index c8cb39c4de..0000000000
--- a/src/infrastructure/catbuffer/EmbeddedAccountMetadataTransactionBuilder.ts
+++ /dev/null
@@ -1,135 +0,0 @@
-// tslint:disable: jsdoc-format
-/**
-*** Copyright (c) 2016-present,
-*** Jaguar0625, gimre, BloodyRookie, Tech Bureau, Corp. All rights reserved.
-***
-*** This file is part of Catapult.
-***
-*** Catapult is free software: you can redistribute it and/or modify
-*** it under the terms of the GNU Lesser General Public License as published by
-*** the Free Software Foundation, either version 3 of the License, or
-*** (at your option) any later version.
-***
-*** Catapult is distributed in the hope that it will be useful,
-*** but WITHOUT ANY WARRANTY; without even the implied warranty of
-*** MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-*** GNU Lesser General Public License for more details.
-***
-*** You should have received a copy of the GNU Lesser General Public License
-*** along with Catapult. If not, see .
-**/
-
-import { AccountMetadataTransactionBodyBuilder } from './AccountMetadataTransactionBodyBuilder';
-import { EmbeddedTransactionBuilder } from './EmbeddedTransactionBuilder';
-import { EntityTypeDto } from './EntityTypeDto';
-import { GeneratorUtils } from './GeneratorUtils';
-import { KeyDto } from './KeyDto';
-import { NetworkTypeDto } from './NetworkTypeDto';
-
-/** Binary layout for an embedded account metadata transaction. */
-export class EmbeddedAccountMetadataTransactionBuilder extends EmbeddedTransactionBuilder {
- /** Account metadata transaction body. */
- accountMetadataTransactionBody: AccountMetadataTransactionBodyBuilder;
-
- /**
- * Constructor.
- *
- * @param signerPublicKey Entity signer's public key.
- * @param version Entity version.
- * @param network Entity network.
- * @param type Entity type.
- * @param targetPublicKey Metadata target public key.
- * @param scopedMetadataKey Metadata key scoped to source, target and type.
- * @param valueSizeDelta Change in value size in bytes.
- * @param value Difference between existing value and new value.
- * @note when there is no existing value, new value is same this value.
- * @note when there is an existing value, new value is calculated as xor(previous-value, value).
- */
- // tslint:disable-next-line: max-line-length
- public constructor(signerPublicKey: KeyDto, version: number, network: NetworkTypeDto, type: EntityTypeDto, targetPublicKey: KeyDto, scopedMetadataKey: number[], valueSizeDelta: number, value: Uint8Array) {
- super(signerPublicKey, version, network, type);
- // tslint:disable-next-line: max-line-length
- this.accountMetadataTransactionBody = new AccountMetadataTransactionBodyBuilder(targetPublicKey, scopedMetadataKey, valueSizeDelta, value);
- }
-
- /**
- * Creates an instance of EmbeddedAccountMetadataTransactionBuilder from binary payload.
- *
- * @param payload Byte payload to use to serialize the object.
- * @return Instance of EmbeddedAccountMetadataTransactionBuilder.
- */
- public static loadFromBinary(payload: Uint8Array): EmbeddedAccountMetadataTransactionBuilder {
- const byteArray = Array.from(payload);
- const superObject = EmbeddedTransactionBuilder.loadFromBinary(Uint8Array.from(byteArray));
- byteArray.splice(0, superObject.getSize());
- const accountMetadataTransactionBody = AccountMetadataTransactionBodyBuilder.loadFromBinary(Uint8Array.from(byteArray));
- byteArray.splice(0, accountMetadataTransactionBody.getSize());
- // tslint:disable-next-line: max-line-length
- return new EmbeddedAccountMetadataTransactionBuilder(superObject.signerPublicKey, superObject.version, superObject.network, superObject.type, accountMetadataTransactionBody.targetPublicKey, accountMetadataTransactionBody.scopedMetadataKey, accountMetadataTransactionBody.valueSizeDelta, accountMetadataTransactionBody.value);
- }
-
- /**
- * Gets metadata target public key.
- *
- * @return Metadata target public key.
- */
- public getTargetPublicKey(): KeyDto {
- return this.accountMetadataTransactionBody.getTargetPublicKey();
- }
-
- /**
- * Gets metadata key scoped to source, target and type.
- *
- * @return Metadata key scoped to source, target and type.
- */
- public getScopedMetadataKey(): number[] {
- return this.accountMetadataTransactionBody.getScopedMetadataKey();
- }
-
- /**
- * Gets change in value size in bytes.
- *
- * @return Change in value size in bytes.
- */
- public getValueSizeDelta(): number {
- return this.accountMetadataTransactionBody.getValueSizeDelta();
- }
-
- /**
- * Gets difference between existing value and new value.
- * @note when there is no existing value, new value is same this value.
- * @note when there is an existing value, new value is calculated as xor(previous-value, value).
- *
- * @return Difference between existing value and new value.
- * @note when there is no existing value, new value is same this value.
- * @note when there is an existing value, new value is calculated as xor(previous-value, value).
- */
- public getValue(): Uint8Array {
- return this.accountMetadataTransactionBody.getValue();
- }
-
- /**
- * Gets the size of the object.
- *
- * @return Size in bytes.
- */
- public getSize(): number {
- let size: number = super.getSize();
- size += this.accountMetadataTransactionBody.getSize();
- return size;
- }
-
- /**
- * Serializes an object to bytes.
- *
- * @return Serialized bytes.
- */
- public serialize(): Uint8Array {
- let newArray = Uint8Array.from([]);
- const superBytes = super.serialize();
- newArray = GeneratorUtils.concatTypedArrays(newArray, superBytes);
- const accountMetadataTransactionBodyBytes = this.accountMetadataTransactionBody.serialize();
- newArray = GeneratorUtils.concatTypedArrays(newArray, accountMetadataTransactionBodyBytes);
- return newArray;
- }
-}
diff --git a/src/infrastructure/catbuffer/EmbeddedAccountMosaicRestrictionTransactionBuilder.ts b/src/infrastructure/catbuffer/EmbeddedAccountMosaicRestrictionTransactionBuilder.ts
deleted file mode 100644
index 316d5cf95e..0000000000
--- a/src/infrastructure/catbuffer/EmbeddedAccountMosaicRestrictionTransactionBuilder.ts
+++ /dev/null
@@ -1,130 +0,0 @@
-// tslint:disable: jsdoc-format
-/**
-*** Copyright (c) 2016-present,
-*** Jaguar0625, gimre, BloodyRookie, Tech Bureau, Corp. All rights reserved.
-***
-*** This file is part of Catapult.
-***
-*** Catapult is free software: you can redistribute it and/or modify
-*** it under the terms of the GNU Lesser General Public License as published by
-*** the Free Software Foundation, either version 3 of the License, or
-*** (at your option) any later version.
-***
-*** Catapult is distributed in the hope that it will be useful,
-*** but WITHOUT ANY WARRANTY; without even the implied warranty of
-*** MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-*** GNU Lesser General Public License for more details.
-***
-*** You should have received a copy of the GNU Lesser General Public License
-*** along with Catapult. If not, see .
-**/
-
-import { AccountMosaicRestrictionTransactionBodyBuilder } from './AccountMosaicRestrictionTransactionBodyBuilder';
-import { EmbeddedTransactionBuilder } from './EmbeddedTransactionBuilder';
-import { EntityTypeDto } from './EntityTypeDto';
-import { GeneratorUtils } from './GeneratorUtils';
-import { KeyDto } from './KeyDto';
-import { NetworkTypeDto } from './NetworkTypeDto';
-import { UnresolvedMosaicIdDto } from './UnresolvedMosaicIdDto';
-
-/** Binary layout for an embedded account mosaic restriction transaction. */
-export class EmbeddedAccountMosaicRestrictionTransactionBuilder extends EmbeddedTransactionBuilder {
- /** Account mosaic restriction transaction body. */
- accountMosaicRestrictionTransactionBody: AccountMosaicRestrictionTransactionBodyBuilder;
-
- /**
- * Constructor.
- *
- * @param signerPublicKey Entity signer's public key.
- * @param version Entity version.
- * @param network Entity network.
- * @param type Entity type.
- * @param restrictionFlags Account restriction flags.
- * @param restrictionAdditions Account restriction additions.
- * @param restrictionDeletions Account restriction deletions.
- */
- // tslint:disable-next-line: max-line-length
- public constructor(signerPublicKey: KeyDto, version: number, network: NetworkTypeDto, type: EntityTypeDto, restrictionFlags: number, restrictionAdditions: UnresolvedMosaicIdDto[], restrictionDeletions: UnresolvedMosaicIdDto[]) {
- super(signerPublicKey, version, network, type);
- // tslint:disable-next-line: max-line-length
- this.accountMosaicRestrictionTransactionBody = new AccountMosaicRestrictionTransactionBodyBuilder(restrictionFlags, restrictionAdditions, restrictionDeletions);
- }
-
- /**
- * Creates an instance of EmbeddedAccountMosaicRestrictionTransactionBuilder from binary payload.
- *
- * @param payload Byte payload to use to serialize the object.
- * @return Instance of EmbeddedAccountMosaicRestrictionTransactionBuilder.
- */
- public static loadFromBinary(payload: Uint8Array): EmbeddedAccountMosaicRestrictionTransactionBuilder {
- const byteArray = Array.from(payload);
- const superObject = EmbeddedTransactionBuilder.loadFromBinary(Uint8Array.from(byteArray));
- byteArray.splice(0, superObject.getSize());
- // tslint:disable-next-line: max-line-length
- const accountMosaicRestrictionTransactionBody = AccountMosaicRestrictionTransactionBodyBuilder.loadFromBinary(Uint8Array.from(byteArray));
- byteArray.splice(0, accountMosaicRestrictionTransactionBody.getSize());
- // tslint:disable-next-line: max-line-length
- return new EmbeddedAccountMosaicRestrictionTransactionBuilder(superObject.signerPublicKey, superObject.version, superObject.network, superObject.type, accountMosaicRestrictionTransactionBody.restrictionFlags, accountMosaicRestrictionTransactionBody.restrictionAdditions, accountMosaicRestrictionTransactionBody.restrictionDeletions);
- }
-
- /**
- * Gets account restriction flags.
- *
- * @return Account restriction flags.
- */
- public getRestrictionFlags(): number {
- return this.accountMosaicRestrictionTransactionBody.getRestrictionFlags();
- }
-
- /**
- * Gets reserved padding to align restrictionAdditions on 8-byte boundary.
- *
- * @return Reserved padding to align restrictionAdditions on 8-byte boundary.
- */
- public getAccountRestrictionTransactionBody_Reserved1(): number {
- return this.accountMosaicRestrictionTransactionBody.getAccountRestrictionTransactionBody_Reserved1();
- }
-
- /**
- * Gets account restriction additions.
- *
- * @return Account restriction additions.
- */
- public getRestrictionAdditions(): UnresolvedMosaicIdDto[] {
- return this.accountMosaicRestrictionTransactionBody.getRestrictionAdditions();
- }
-
- /**
- * Gets account restriction deletions.
- *
- * @return Account restriction deletions.
- */
- public getRestrictionDeletions(): UnresolvedMosaicIdDto[] {
- return this.accountMosaicRestrictionTransactionBody.getRestrictionDeletions();
- }
-
- /**
- * Gets the size of the object.
- *
- * @return Size in bytes.
- */
- public getSize(): number {
- let size: number = super.getSize();
- size += this.accountMosaicRestrictionTransactionBody.getSize();
- return size;
- }
-
- /**
- * Serializes an object to bytes.
- *
- * @return Serialized bytes.
- */
- public serialize(): Uint8Array {
- let newArray = Uint8Array.from([]);
- const superBytes = super.serialize();
- newArray = GeneratorUtils.concatTypedArrays(newArray, superBytes);
- const accountMosaicRestrictionTransactionBodyBytes = this.accountMosaicRestrictionTransactionBody.serialize();
- newArray = GeneratorUtils.concatTypedArrays(newArray, accountMosaicRestrictionTransactionBodyBytes);
- return newArray;
- }
-}
diff --git a/src/infrastructure/catbuffer/EmbeddedAccountOperationRestrictionTransactionBuilder.ts b/src/infrastructure/catbuffer/EmbeddedAccountOperationRestrictionTransactionBuilder.ts
deleted file mode 100644
index 23e52b3ceb..0000000000
--- a/src/infrastructure/catbuffer/EmbeddedAccountOperationRestrictionTransactionBuilder.ts
+++ /dev/null
@@ -1,129 +0,0 @@
-// tslint:disable: jsdoc-format
-/**
-*** Copyright (c) 2016-present,
-*** Jaguar0625, gimre, BloodyRookie, Tech Bureau, Corp. All rights reserved.
-***
-*** This file is part of Catapult.
-***
-*** Catapult is free software: you can redistribute it and/or modify
-*** it under the terms of the GNU Lesser General Public License as published by
-*** the Free Software Foundation, either version 3 of the License, or
-*** (at your option) any later version.
-***
-*** Catapult is distributed in the hope that it will be useful,
-*** but WITHOUT ANY WARRANTY; without even the implied warranty of
-*** MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-*** GNU Lesser General Public License for more details.
-***
-*** You should have received a copy of the GNU Lesser General Public License
-*** along with Catapult. If not, see .
-**/
-
-import { AccountOperationRestrictionTransactionBodyBuilder } from './AccountOperationRestrictionTransactionBodyBuilder';
-import { EmbeddedTransactionBuilder } from './EmbeddedTransactionBuilder';
-import { EntityTypeDto } from './EntityTypeDto';
-import { GeneratorUtils } from './GeneratorUtils';
-import { KeyDto } from './KeyDto';
-import { NetworkTypeDto } from './NetworkTypeDto';
-
-/** Binary layout for an embedded account operation restriction transaction. */
-export class EmbeddedAccountOperationRestrictionTransactionBuilder extends EmbeddedTransactionBuilder {
- /** Account operation restriction transaction body. */
- accountOperationRestrictionTransactionBody: AccountOperationRestrictionTransactionBodyBuilder;
-
- /**
- * Constructor.
- *
- * @param signerPublicKey Entity signer's public key.
- * @param version Entity version.
- * @param network Entity network.
- * @param type Entity type.
- * @param restrictionFlags Account restriction flags.
- * @param restrictionAdditions Account restriction additions.
- * @param restrictionDeletions Account restriction deletions.
- */
- // tslint:disable-next-line: max-line-length
- public constructor(signerPublicKey: KeyDto, version: number, network: NetworkTypeDto, type: EntityTypeDto, restrictionFlags: number, restrictionAdditions: number[], restrictionDeletions: number[]) {
- super(signerPublicKey, version, network, type);
- // tslint:disable-next-line: max-line-length
- this.accountOperationRestrictionTransactionBody = new AccountOperationRestrictionTransactionBodyBuilder(restrictionFlags, restrictionAdditions, restrictionDeletions);
- }
-
- /**
- * Creates an instance of EmbeddedAccountOperationRestrictionTransactionBuilder from binary payload.
- *
- * @param payload Byte payload to use to serialize the object.
- * @return Instance of EmbeddedAccountOperationRestrictionTransactionBuilder.
- */
- public static loadFromBinary(payload: Uint8Array): EmbeddedAccountOperationRestrictionTransactionBuilder {
- const byteArray = Array.from(payload);
- const superObject = EmbeddedTransactionBuilder.loadFromBinary(Uint8Array.from(byteArray));
- byteArray.splice(0, superObject.getSize());
- // tslint:disable-next-line: max-line-length
- const accountOperationRestrictionTransactionBody = AccountOperationRestrictionTransactionBodyBuilder.loadFromBinary(Uint8Array.from(byteArray));
- byteArray.splice(0, accountOperationRestrictionTransactionBody.getSize());
- // tslint:disable-next-line: max-line-length
- return new EmbeddedAccountOperationRestrictionTransactionBuilder(superObject.signerPublicKey, superObject.version, superObject.network, superObject.type, accountOperationRestrictionTransactionBody.restrictionFlags, accountOperationRestrictionTransactionBody.restrictionAdditions, accountOperationRestrictionTransactionBody.restrictionDeletions);
- }
-
- /**
- * Gets account restriction flags.
- *
- * @return Account restriction flags.
- */
- public getRestrictionFlags(): number {
- return this.accountOperationRestrictionTransactionBody.getRestrictionFlags();
- }
-
- /**
- * Gets reserved padding to align restrictionAdditions on 8-byte boundary.
- *
- * @return Reserved padding to align restrictionAdditions on 8-byte boundary.
- */
- public getAccountRestrictionTransactionBody_Reserved1(): number {
- return this.accountOperationRestrictionTransactionBody.getAccountRestrictionTransactionBody_Reserved1();
- }
-
- /**
- * Gets account restriction additions.
- *
- * @return Account restriction additions.
- */
- public getRestrictionAdditions(): number[] {
- return this.accountOperationRestrictionTransactionBody.getRestrictionAdditions();
- }
-
- /**
- * Gets account restriction deletions.
- *
- * @return Account restriction deletions.
- */
- public getRestrictionDeletions(): number[] {
- return this.accountOperationRestrictionTransactionBody.getRestrictionDeletions();
- }
-
- /**
- * Gets the size of the object.
- *
- * @return Size in bytes.
- */
- public getSize(): number {
- let size: number = super.getSize();
- size += this.accountOperationRestrictionTransactionBody.getSize();
- return size;
- }
-
- /**
- * Serializes an object to bytes.
- *
- * @return Serialized bytes.
- */
- public serialize(): Uint8Array {
- let newArray = Uint8Array.from([]);
- const superBytes = super.serialize();
- newArray = GeneratorUtils.concatTypedArrays(newArray, superBytes);
- const accountOperationRestrictionTransactionBodyBytes = this.accountOperationRestrictionTransactionBody.serialize();
- newArray = GeneratorUtils.concatTypedArrays(newArray, accountOperationRestrictionTransactionBodyBytes);
- return newArray;
- }
-}
diff --git a/src/infrastructure/catbuffer/EmbeddedAddressAliasTransactionBuilder.ts b/src/infrastructure/catbuffer/EmbeddedAddressAliasTransactionBuilder.ts
deleted file mode 100644
index ba689cee5a..0000000000
--- a/src/infrastructure/catbuffer/EmbeddedAddressAliasTransactionBuilder.ts
+++ /dev/null
@@ -1,121 +0,0 @@
-// tslint:disable: jsdoc-format
-/**
-*** Copyright (c) 2016-present,
-*** Jaguar0625, gimre, BloodyRookie, Tech Bureau, Corp. All rights reserved.
-***
-*** This file is part of Catapult.
-***
-*** Catapult is free software: you can redistribute it and/or modify
-*** it under the terms of the GNU Lesser General Public License as published by
-*** the Free Software Foundation, either version 3 of the License, or
-*** (at your option) any later version.
-***
-*** Catapult is distributed in the hope that it will be useful,
-*** but WITHOUT ANY WARRANTY; without even the implied warranty of
-*** MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-*** GNU Lesser General Public License for more details.
-***
-*** You should have received a copy of the GNU Lesser General Public License
-*** along with Catapult. If not, see .
-**/
-
-import { AddressAliasTransactionBodyBuilder } from './AddressAliasTransactionBodyBuilder';
-import { AddressDto } from './AddressDto';
-import { AliasActionDto } from './AliasActionDto';
-import { EmbeddedTransactionBuilder } from './EmbeddedTransactionBuilder';
-import { EntityTypeDto } from './EntityTypeDto';
-import { GeneratorUtils } from './GeneratorUtils';
-import { KeyDto } from './KeyDto';
-import { NamespaceIdDto } from './NamespaceIdDto';
-import { NetworkTypeDto } from './NetworkTypeDto';
-
-/** Binary layout for an embedded address alias transaction. */
-export class EmbeddedAddressAliasTransactionBuilder extends EmbeddedTransactionBuilder {
- /** Address alias transaction body. */
- addressAliasTransactionBody: AddressAliasTransactionBodyBuilder;
-
- /**
- * Constructor.
- *
- * @param signerPublicKey Entity signer's public key.
- * @param version Entity version.
- * @param network Entity network.
- * @param type Entity type.
- * @param namespaceId Identifier of the namespace that will become an alias.
- * @param address Aliased address.
- * @param aliasAction Alias action.
- */
- // tslint:disable-next-line: max-line-length
- public constructor(signerPublicKey: KeyDto, version: number, network: NetworkTypeDto, type: EntityTypeDto, namespaceId: NamespaceIdDto, address: AddressDto, aliasAction: AliasActionDto) {
- super(signerPublicKey, version, network, type);
- this.addressAliasTransactionBody = new AddressAliasTransactionBodyBuilder(namespaceId, address, aliasAction);
- }
-
- /**
- * Creates an instance of EmbeddedAddressAliasTransactionBuilder from binary payload.
- *
- * @param payload Byte payload to use to serialize the object.
- * @return Instance of EmbeddedAddressAliasTransactionBuilder.
- */
- public static loadFromBinary(payload: Uint8Array): EmbeddedAddressAliasTransactionBuilder {
- const byteArray = Array.from(payload);
- const superObject = EmbeddedTransactionBuilder.loadFromBinary(Uint8Array.from(byteArray));
- byteArray.splice(0, superObject.getSize());
- const addressAliasTransactionBody = AddressAliasTransactionBodyBuilder.loadFromBinary(Uint8Array.from(byteArray));
- byteArray.splice(0, addressAliasTransactionBody.getSize());
- // tslint:disable-next-line: max-line-length
- return new EmbeddedAddressAliasTransactionBuilder(superObject.signerPublicKey, superObject.version, superObject.network, superObject.type, addressAliasTransactionBody.namespaceId, addressAliasTransactionBody.address, addressAliasTransactionBody.aliasAction);
- }
-
- /**
- * Gets identifier of the namespace that will become an alias.
- *
- * @return Identifier of the namespace that will become an alias.
- */
- public getNamespaceId(): NamespaceIdDto {
- return this.addressAliasTransactionBody.getNamespaceId();
- }
-
- /**
- * Gets aliased address.
- *
- * @return Aliased address.
- */
- public getAddress(): AddressDto {
- return this.addressAliasTransactionBody.getAddress();
- }
-
- /**
- * Gets alias action.
- *
- * @return Alias action.
- */
- public getAliasAction(): AliasActionDto {
- return this.addressAliasTransactionBody.getAliasAction();
- }
-
- /**
- * Gets the size of the object.
- *
- * @return Size in bytes.
- */
- public getSize(): number {
- let size: number = super.getSize();
- size += this.addressAliasTransactionBody.getSize();
- return size;
- }
-
- /**
- * Serializes an object to bytes.
- *
- * @return Serialized bytes.
- */
- public serialize(): Uint8Array {
- let newArray = Uint8Array.from([]);
- const superBytes = super.serialize();
- newArray = GeneratorUtils.concatTypedArrays(newArray, superBytes);
- const addressAliasTransactionBodyBytes = this.addressAliasTransactionBody.serialize();
- newArray = GeneratorUtils.concatTypedArrays(newArray, addressAliasTransactionBodyBytes);
- return newArray;
- }
-}
diff --git a/src/infrastructure/catbuffer/EmbeddedHashLockTransactionBuilder.ts b/src/infrastructure/catbuffer/EmbeddedHashLockTransactionBuilder.ts
deleted file mode 100644
index c70e35f754..0000000000
--- a/src/infrastructure/catbuffer/EmbeddedHashLockTransactionBuilder.ts
+++ /dev/null
@@ -1,121 +0,0 @@
-// tslint:disable: jsdoc-format
-/**
-*** Copyright (c) 2016-present,
-*** Jaguar0625, gimre, BloodyRookie, Tech Bureau, Corp. All rights reserved.
-***
-*** This file is part of Catapult.
-***
-*** Catapult is free software: you can redistribute it and/or modify
-*** it under the terms of the GNU Lesser General Public License as published by
-*** the Free Software Foundation, either version 3 of the License, or
-*** (at your option) any later version.
-***
-*** Catapult is distributed in the hope that it will be useful,
-*** but WITHOUT ANY WARRANTY; without even the implied warranty of
-*** MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-*** GNU Lesser General Public License for more details.
-***
-*** You should have received a copy of the GNU Lesser General Public License
-*** along with Catapult. If not, see .
-**/
-
-import { BlockDurationDto } from './BlockDurationDto';
-import { EmbeddedTransactionBuilder } from './EmbeddedTransactionBuilder';
-import { EntityTypeDto } from './EntityTypeDto';
-import { GeneratorUtils } from './GeneratorUtils';
-import { Hash256Dto } from './Hash256Dto';
-import { HashLockTransactionBodyBuilder } from './HashLockTransactionBodyBuilder';
-import { KeyDto } from './KeyDto';
-import { NetworkTypeDto } from './NetworkTypeDto';
-import { UnresolvedMosaicBuilder } from './UnresolvedMosaicBuilder';
-
-/** Binary layout for an embedded hash lock transaction. */
-export class EmbeddedHashLockTransactionBuilder extends EmbeddedTransactionBuilder {
- /** Hash lock transaction body. */
- hashLockTransactionBody: HashLockTransactionBodyBuilder;
-
- /**
- * Constructor.
- *
- * @param signerPublicKey Entity signer's public key.
- * @param version Entity version.
- * @param network Entity network.
- * @param type Entity type.
- * @param mosaic Lock mosaic.
- * @param duration Number of blocks for which a lock should be valid.
- * @param hash Lock hash.
- */
- // tslint:disable-next-line: max-line-length
- public constructor(signerPublicKey: KeyDto, version: number, network: NetworkTypeDto, type: EntityTypeDto, mosaic: UnresolvedMosaicBuilder, duration: BlockDurationDto, hash: Hash256Dto) {
- super(signerPublicKey, version, network, type);
- this.hashLockTransactionBody = new HashLockTransactionBodyBuilder(mosaic, duration, hash);
- }
-
- /**
- * Creates an instance of EmbeddedHashLockTransactionBuilder from binary payload.
- *
- * @param payload Byte payload to use to serialize the object.
- * @return Instance of EmbeddedHashLockTransactionBuilder.
- */
- public static loadFromBinary(payload: Uint8Array): EmbeddedHashLockTransactionBuilder {
- const byteArray = Array.from(payload);
- const superObject = EmbeddedTransactionBuilder.loadFromBinary(Uint8Array.from(byteArray));
- byteArray.splice(0, superObject.getSize());
- const hashLockTransactionBody = HashLockTransactionBodyBuilder.loadFromBinary(Uint8Array.from(byteArray));
- byteArray.splice(0, hashLockTransactionBody.getSize());
- // tslint:disable-next-line: max-line-length
- return new EmbeddedHashLockTransactionBuilder(superObject.signerPublicKey, superObject.version, superObject.network, superObject.type, hashLockTransactionBody.mosaic, hashLockTransactionBody.duration, hashLockTransactionBody.hash);
- }
-
- /**
- * Gets lock mosaic.
- *
- * @return Lock mosaic.
- */
- public getMosaic(): UnresolvedMosaicBuilder {
- return this.hashLockTransactionBody.getMosaic();
- }
-
- /**
- * Gets number of blocks for which a lock should be valid.
- *
- * @return Number of blocks for which a lock should be valid.
- */
- public getDuration(): BlockDurationDto {
- return this.hashLockTransactionBody.getDuration();
- }
-
- /**
- * Gets lock hash.
- *
- * @return Lock hash.
- */
- public getHash(): Hash256Dto {
- return this.hashLockTransactionBody.getHash();
- }
-
- /**
- * Gets the size of the object.
- *
- * @return Size in bytes.
- */
- public getSize(): number {
- let size: number = super.getSize();
- size += this.hashLockTransactionBody.getSize();
- return size;
- }
-
- /**
- * Serializes an object to bytes.
- *
- * @return Serialized bytes.
- */
- public serialize(): Uint8Array {
- let newArray = Uint8Array.from([]);
- const superBytes = super.serialize();
- newArray = GeneratorUtils.concatTypedArrays(newArray, superBytes);
- const hashLockTransactionBodyBytes = this.hashLockTransactionBody.serialize();
- newArray = GeneratorUtils.concatTypedArrays(newArray, hashLockTransactionBodyBytes);
- return newArray;
- }
-}
diff --git a/src/infrastructure/catbuffer/EmbeddedMosaicAddressRestrictionTransactionBuilder.ts b/src/infrastructure/catbuffer/EmbeddedMosaicAddressRestrictionTransactionBuilder.ts
deleted file mode 100644
index 7405c7abc4..0000000000
--- a/src/infrastructure/catbuffer/EmbeddedMosaicAddressRestrictionTransactionBuilder.ts
+++ /dev/null
@@ -1,142 +0,0 @@
-// tslint:disable: jsdoc-format
-/**
-*** Copyright (c) 2016-present,
-*** Jaguar0625, gimre, BloodyRookie, Tech Bureau, Corp. All rights reserved.
-***
-*** This file is part of Catapult.
-***
-*** Catapult is free software: you can redistribute it and/or modify
-*** it under the terms of the GNU Lesser General Public License as published by
-*** the Free Software Foundation, either version 3 of the License, or
-*** (at your option) any later version.
-***
-*** Catapult is distributed in the hope that it will be useful,
-*** but WITHOUT ANY WARRANTY; without even the implied warranty of
-*** MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-*** GNU Lesser General Public License for more details.
-***
-*** You should have received a copy of the GNU Lesser General Public License
-*** along with Catapult. If not, see .
-**/
-
-import { EmbeddedTransactionBuilder } from './EmbeddedTransactionBuilder';
-import { EntityTypeDto } from './EntityTypeDto';
-import { GeneratorUtils } from './GeneratorUtils';
-import { KeyDto } from './KeyDto';
-import { MosaicAddressRestrictionTransactionBodyBuilder } from './MosaicAddressRestrictionTransactionBodyBuilder';
-import { NetworkTypeDto } from './NetworkTypeDto';
-import { UnresolvedAddressDto } from './UnresolvedAddressDto';
-import { UnresolvedMosaicIdDto } from './UnresolvedMosaicIdDto';
-
-/** Binary layout for an embedded mosaic address restriction transaction. */
-export class EmbeddedMosaicAddressRestrictionTransactionBuilder extends EmbeddedTransactionBuilder {
- /** Mosaic address restriction transaction body. */
- mosaicAddressRestrictionTransactionBody: MosaicAddressRestrictionTransactionBodyBuilder;
-
- /**
- * Constructor.
- *
- * @param signerPublicKey Entity signer's public key.
- * @param version Entity version.
- * @param network Entity network.
- * @param type Entity type.
- * @param mosaicId Identifier of the mosaic to which the restriction applies.
- * @param restrictionKey Restriction key.
- * @param previousRestrictionValue Previous restriction value.
- * @param newRestrictionValue New restriction value.
- * @param targetAddress Address being restricted.
- */
- // tslint:disable-next-line: max-line-length
- public constructor(signerPublicKey: KeyDto, version: number, network: NetworkTypeDto, type: EntityTypeDto, mosaicId: UnresolvedMosaicIdDto, restrictionKey: number[], previousRestrictionValue: number[], newRestrictionValue: number[], targetAddress: UnresolvedAddressDto) {
- super(signerPublicKey, version, network, type);
- // tslint:disable-next-line: max-line-length
- this.mosaicAddressRestrictionTransactionBody = new MosaicAddressRestrictionTransactionBodyBuilder(mosaicId, restrictionKey, previousRestrictionValue, newRestrictionValue, targetAddress);
- }
-
- /**
- * Creates an instance of EmbeddedMosaicAddressRestrictionTransactionBuilder from binary payload.
- *
- * @param payload Byte payload to use to serialize the object.
- * @return Instance of EmbeddedMosaicAddressRestrictionTransactionBuilder.
- */
- public static loadFromBinary(payload: Uint8Array): EmbeddedMosaicAddressRestrictionTransactionBuilder {
- const byteArray = Array.from(payload);
- const superObject = EmbeddedTransactionBuilder.loadFromBinary(Uint8Array.from(byteArray));
- byteArray.splice(0, superObject.getSize());
- // tslint:disable-next-line: max-line-length
- const mosaicAddressRestrictionTransactionBody = MosaicAddressRestrictionTransactionBodyBuilder.loadFromBinary(Uint8Array.from(byteArray));
- byteArray.splice(0, mosaicAddressRestrictionTransactionBody.getSize());
- // tslint:disable-next-line: max-line-length
- return new EmbeddedMosaicAddressRestrictionTransactionBuilder(superObject.signerPublicKey, superObject.version, superObject.network, superObject.type, mosaicAddressRestrictionTransactionBody.mosaicId, mosaicAddressRestrictionTransactionBody.restrictionKey, mosaicAddressRestrictionTransactionBody.previousRestrictionValue, mosaicAddressRestrictionTransactionBody.newRestrictionValue, mosaicAddressRestrictionTransactionBody.targetAddress);
- }
-
- /**
- * Gets identifier of the mosaic to which the restriction applies.
- *
- * @return Identifier of the mosaic to which the restriction applies.
- */
- public getMosaicId(): UnresolvedMosaicIdDto {
- return this.mosaicAddressRestrictionTransactionBody.getMosaicId();
- }
-
- /**
- * Gets restriction key.
- *
- * @return Restriction key.
- */
- public getRestrictionKey(): number[] {
- return this.mosaicAddressRestrictionTransactionBody.getRestrictionKey();
- }
-
- /**
- * Gets previous restriction value.
- *
- * @return Previous restriction value.
- */
- public getPreviousRestrictionValue(): number[] {
- return this.mosaicAddressRestrictionTransactionBody.getPreviousRestrictionValue();
- }
-
- /**
- * Gets new restriction value.
- *
- * @return New restriction value.
- */
- public getNewRestrictionValue(): number[] {
- return this.mosaicAddressRestrictionTransactionBody.getNewRestrictionValue();
- }
-
- /**
- * Gets address being restricted.
- *
- * @return Address being restricted.
- */
- public getTargetAddress(): UnresolvedAddressDto {
- return this.mosaicAddressRestrictionTransactionBody.getTargetAddress();
- }
-
- /**
- * Gets the size of the object.
- *
- * @return Size in bytes.
- */
- public getSize(): number {
- let size: number = super.getSize();
- size += this.mosaicAddressRestrictionTransactionBody.getSize();
- return size;
- }
-
- /**
- * Serializes an object to bytes.
- *
- * @return Serialized bytes.
- */
- public serialize(): Uint8Array {
- let newArray = Uint8Array.from([]);
- const superBytes = super.serialize();
- newArray = GeneratorUtils.concatTypedArrays(newArray, superBytes);
- const mosaicAddressRestrictionTransactionBodyBytes = this.mosaicAddressRestrictionTransactionBody.serialize();
- newArray = GeneratorUtils.concatTypedArrays(newArray, mosaicAddressRestrictionTransactionBodyBytes);
- return newArray;
- }
-}
diff --git a/src/infrastructure/catbuffer/EmbeddedMosaicAliasTransactionBuilder.ts b/src/infrastructure/catbuffer/EmbeddedMosaicAliasTransactionBuilder.ts
deleted file mode 100644
index 59db1bdece..0000000000
--- a/src/infrastructure/catbuffer/EmbeddedMosaicAliasTransactionBuilder.ts
+++ /dev/null
@@ -1,121 +0,0 @@
-// tslint:disable: jsdoc-format
-/**
-*** Copyright (c) 2016-present,
-*** Jaguar0625, gimre, BloodyRookie, Tech Bureau, Corp. All rights reserved.
-***
-*** This file is part of Catapult.
-***
-*** Catapult is free software: you can redistribute it and/or modify
-*** it under the terms of the GNU Lesser General Public License as published by
-*** the Free Software Foundation, either version 3 of the License, or
-*** (at your option) any later version.
-***
-*** Catapult is distributed in the hope that it will be useful,
-*** but WITHOUT ANY WARRANTY; without even the implied warranty of
-*** MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-*** GNU Lesser General Public License for more details.
-***
-*** You should have received a copy of the GNU Lesser General Public License
-*** along with Catapult. If not, see .
-**/
-
-import { AliasActionDto } from './AliasActionDto';
-import { EmbeddedTransactionBuilder } from './EmbeddedTransactionBuilder';
-import { EntityTypeDto } from './EntityTypeDto';
-import { GeneratorUtils } from './GeneratorUtils';
-import { KeyDto } from './KeyDto';
-import { MosaicAliasTransactionBodyBuilder } from './MosaicAliasTransactionBodyBuilder';
-import { MosaicIdDto } from './MosaicIdDto';
-import { NamespaceIdDto } from './NamespaceIdDto';
-import { NetworkTypeDto } from './NetworkTypeDto';
-
-/** Binary layout for an embedded mosaic alias transaction. */
-export class EmbeddedMosaicAliasTransactionBuilder extends EmbeddedTransactionBuilder {
- /** Mosaic alias transaction body. */
- mosaicAliasTransactionBody: MosaicAliasTransactionBodyBuilder;
-
- /**
- * Constructor.
- *
- * @param signerPublicKey Entity signer's public key.
- * @param version Entity version.
- * @param network Entity network.
- * @param type Entity type.
- * @param namespaceId Identifier of the namespace that will become an alias.
- * @param mosaicId Aliased mosaic identifier.
- * @param aliasAction Alias action.
- */
- // tslint:disable-next-line: max-line-length
- public constructor(signerPublicKey: KeyDto, version: number, network: NetworkTypeDto, type: EntityTypeDto, namespaceId: NamespaceIdDto, mosaicId: MosaicIdDto, aliasAction: AliasActionDto) {
- super(signerPublicKey, version, network, type);
- this.mosaicAliasTransactionBody = new MosaicAliasTransactionBodyBuilder(namespaceId, mosaicId, aliasAction);
- }
-
- /**
- * Creates an instance of EmbeddedMosaicAliasTransactionBuilder from binary payload.
- *
- * @param payload Byte payload to use to serialize the object.
- * @return Instance of EmbeddedMosaicAliasTransactionBuilder.
- */
- public static loadFromBinary(payload: Uint8Array): EmbeddedMosaicAliasTransactionBuilder {
- const byteArray = Array.from(payload);
- const superObject = EmbeddedTransactionBuilder.loadFromBinary(Uint8Array.from(byteArray));
- byteArray.splice(0, superObject.getSize());
- const mosaicAliasTransactionBody = MosaicAliasTransactionBodyBuilder.loadFromBinary(Uint8Array.from(byteArray));
- byteArray.splice(0, mosaicAliasTransactionBody.getSize());
- // tslint:disable-next-line: max-line-length
- return new EmbeddedMosaicAliasTransactionBuilder(superObject.signerPublicKey, superObject.version, superObject.network, superObject.type, mosaicAliasTransactionBody.namespaceId, mosaicAliasTransactionBody.mosaicId, mosaicAliasTransactionBody.aliasAction);
- }
-
- /**
- * Gets identifier of the namespace that will become an alias.
- *
- * @return Identifier of the namespace that will become an alias.
- */
- public getNamespaceId(): NamespaceIdDto {
- return this.mosaicAliasTransactionBody.getNamespaceId();
- }
-
- /**
- * Gets aliased mosaic identifier.
- *
- * @return Aliased mosaic identifier.
- */
- public getMosaicId(): MosaicIdDto {
- return this.mosaicAliasTransactionBody.getMosaicId();
- }
-
- /**
- * Gets alias action.
- *
- * @return Alias action.
- */
- public getAliasAction(): AliasActionDto {
- return this.mosaicAliasTransactionBody.getAliasAction();
- }
-
- /**
- * Gets the size of the object.
- *
- * @return Size in bytes.
- */
- public getSize(): number {
- let size: number = super.getSize();
- size += this.mosaicAliasTransactionBody.getSize();
- return size;
- }
-
- /**
- * Serializes an object to bytes.
- *
- * @return Serialized bytes.
- */
- public serialize(): Uint8Array {
- let newArray = Uint8Array.from([]);
- const superBytes = super.serialize();
- newArray = GeneratorUtils.concatTypedArrays(newArray, superBytes);
- const mosaicAliasTransactionBodyBytes = this.mosaicAliasTransactionBody.serialize();
- newArray = GeneratorUtils.concatTypedArrays(newArray, mosaicAliasTransactionBodyBytes);
- return newArray;
- }
-}
diff --git a/src/infrastructure/catbuffer/EmbeddedMosaicDefinitionTransactionBuilder.ts b/src/infrastructure/catbuffer/EmbeddedMosaicDefinitionTransactionBuilder.ts
deleted file mode 100644
index 1d86f46ae7..0000000000
--- a/src/infrastructure/catbuffer/EmbeddedMosaicDefinitionTransactionBuilder.ts
+++ /dev/null
@@ -1,143 +0,0 @@
-// tslint:disable: jsdoc-format
-/**
-*** Copyright (c) 2016-present,
-*** Jaguar0625, gimre, BloodyRookie, Tech Bureau, Corp. All rights reserved.
-***
-*** This file is part of Catapult.
-***
-*** Catapult is free software: you can redistribute it and/or modify
-*** it under the terms of the GNU Lesser General Public License as published by
-*** the Free Software Foundation, either version 3 of the License, or
-*** (at your option) any later version.
-***
-*** Catapult is distributed in the hope that it will be useful,
-*** but WITHOUT ANY WARRANTY; without even the implied warranty of
-*** MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-*** GNU Lesser General Public License for more details.
-***
-*** You should have received a copy of the GNU Lesser General Public License
-*** along with Catapult. If not, see .
-**/
-
-import { BlockDurationDto } from './BlockDurationDto';
-import { EmbeddedTransactionBuilder } from './EmbeddedTransactionBuilder';
-import { EntityTypeDto } from './EntityTypeDto';
-import { GeneratorUtils } from './GeneratorUtils';
-import { KeyDto } from './KeyDto';
-import { MosaicDefinitionTransactionBodyBuilder } from './MosaicDefinitionTransactionBodyBuilder';
-import { MosaicIdDto } from './MosaicIdDto';
-import { MosaicNonceDto } from './MosaicNonceDto';
-import { NetworkTypeDto } from './NetworkTypeDto';
-
-/** Binary layout for an embedded mosaic definition transaction. */
-export class EmbeddedMosaicDefinitionTransactionBuilder extends EmbeddedTransactionBuilder {
- /** Mosaic definition transaction body. */
- mosaicDefinitionTransactionBody: MosaicDefinitionTransactionBodyBuilder;
-
- /**
- * Constructor.
- *
- * @param signerPublicKey Entity signer's public key.
- * @param version Entity version.
- * @param network Entity network.
- * @param type Entity type.
- * @param id Mosaic identifier.
- * @param duration Mosaic duration.
- * @param nonce Mosaic nonce.
- * @param flags Mosaic flags.
- * @param divisibility Mosaic divisibility.
- */
- // tslint:disable-next-line: max-line-length
- public constructor(signerPublicKey: KeyDto, version: number, network: NetworkTypeDto, type: EntityTypeDto, id: MosaicIdDto, duration: BlockDurationDto, nonce: MosaicNonceDto, flags: number, divisibility: number) {
- super(signerPublicKey, version, network, type);
- // tslint:disable-next-line: max-line-length
- this.mosaicDefinitionTransactionBody = new MosaicDefinitionTransactionBodyBuilder(id, duration, nonce, flags, divisibility);
- }
-
- /**
- * Creates an instance of EmbeddedMosaicDefinitionTransactionBuilder from binary payload.
- *
- * @param payload Byte payload to use to serialize the object.
- * @return Instance of EmbeddedMosaicDefinitionTransactionBuilder.
- */
- public static loadFromBinary(payload: Uint8Array): EmbeddedMosaicDefinitionTransactionBuilder {
- const byteArray = Array.from(payload);
- const superObject = EmbeddedTransactionBuilder.loadFromBinary(Uint8Array.from(byteArray));
- byteArray.splice(0, superObject.getSize());
- // tslint:disable-next-line: max-line-length
- const mosaicDefinitionTransactionBody = MosaicDefinitionTransactionBodyBuilder.loadFromBinary(Uint8Array.from(byteArray));
- byteArray.splice(0, mosaicDefinitionTransactionBody.getSize());
- // tslint:disable-next-line: max-line-length
- return new EmbeddedMosaicDefinitionTransactionBuilder(superObject.signerPublicKey, superObject.version, superObject.network, superObject.type, mosaicDefinitionTransactionBody.id, mosaicDefinitionTransactionBody.duration, mosaicDefinitionTransactionBody.nonce, mosaicDefinitionTransactionBody.flags, mosaicDefinitionTransactionBody.divisibility);
- }
-
- /**
- * Gets mosaic identifier.
- *
- * @return Mosaic identifier.
- */
- public getId(): MosaicIdDto {
- return this.mosaicDefinitionTransactionBody.getId();
- }
-
- /**
- * Gets mosaic duration.
- *
- * @return Mosaic duration.
- */
- public getDuration(): BlockDurationDto {
- return this.mosaicDefinitionTransactionBody.getDuration();
- }
-
- /**
- * Gets mosaic nonce.
- *
- * @return Mosaic nonce.
- */
- public getNonce(): MosaicNonceDto {
- return this.mosaicDefinitionTransactionBody.getNonce();
- }
-
- /**
- * Gets mosaic flags.
- *
- * @return Mosaic flags.
- */
- public getFlags(): number {
- return this.mosaicDefinitionTransactionBody.getFlags();
- }
-
- /**
- * Gets mosaic divisibility.
- *
- * @return Mosaic divisibility.
- */
- public getDivisibility(): number {
- return this.mosaicDefinitionTransactionBody.getDivisibility();
- }
-
- /**
- * Gets the size of the object.
- *
- * @return Size in bytes.
- */
- public getSize(): number {
- let size: number = super.getSize();
- size += this.mosaicDefinitionTransactionBody.getSize();
- return size;
- }
-
- /**
- * Serializes an object to bytes.
- *
- * @return Serialized bytes.
- */
- public serialize(): Uint8Array {
- let newArray = Uint8Array.from([]);
- const superBytes = super.serialize();
- newArray = GeneratorUtils.concatTypedArrays(newArray, superBytes);
- const mosaicDefinitionTransactionBodyBytes = this.mosaicDefinitionTransactionBody.serialize();
- newArray = GeneratorUtils.concatTypedArrays(newArray, mosaicDefinitionTransactionBodyBytes);
- return newArray;
- }
-}
diff --git a/src/infrastructure/catbuffer/EmbeddedMosaicGlobalRestrictionTransactionBuilder.ts b/src/infrastructure/catbuffer/EmbeddedMosaicGlobalRestrictionTransactionBuilder.ts
deleted file mode 100644
index e4813007d5..0000000000
--- a/src/infrastructure/catbuffer/EmbeddedMosaicGlobalRestrictionTransactionBuilder.ts
+++ /dev/null
@@ -1,162 +0,0 @@
-// tslint:disable: jsdoc-format
-/**
-*** Copyright (c) 2016-present,
-*** Jaguar0625, gimre, BloodyRookie, Tech Bureau, Corp. All rights reserved.
-***
-*** This file is part of Catapult.
-***
-*** Catapult is free software: you can redistribute it and/or modify
-*** it under the terms of the GNU Lesser General Public License as published by
-*** the Free Software Foundation, either version 3 of the License, or
-*** (at your option) any later version.
-***
-*** Catapult is distributed in the hope that it will be useful,
-*** but WITHOUT ANY WARRANTY; without even the implied warranty of
-*** MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-*** GNU Lesser General Public License for more details.
-***
-*** You should have received a copy of the GNU Lesser General Public License
-*** along with Catapult. If not, see .
-**/
-
-import { EmbeddedTransactionBuilder } from './EmbeddedTransactionBuilder';
-import { EntityTypeDto } from './EntityTypeDto';
-import { GeneratorUtils } from './GeneratorUtils';
-import { KeyDto } from './KeyDto';
-import { MosaicGlobalRestrictionTransactionBodyBuilder } from './MosaicGlobalRestrictionTransactionBodyBuilder';
-import { MosaicRestrictionTypeDto } from './MosaicRestrictionTypeDto';
-import { NetworkTypeDto } from './NetworkTypeDto';
-import { UnresolvedMosaicIdDto } from './UnresolvedMosaicIdDto';
-
-/** Binary layout for an embedded mosaic global restriction transaction. */
-export class EmbeddedMosaicGlobalRestrictionTransactionBuilder extends EmbeddedTransactionBuilder {
- /** Mosaic global restriction transaction body. */
- mosaicGlobalRestrictionTransactionBody: MosaicGlobalRestrictionTransactionBodyBuilder;
-
- /**
- * Constructor.
- *
- * @param signerPublicKey Entity signer's public key.
- * @param version Entity version.
- * @param network Entity network.
- * @param type Entity type.
- * @param mosaicId Identifier of the mosaic being restricted.
- * @param referenceMosaicId Identifier of the mosaic providing the restriction key.
- * @param restrictionKey Restriction key relative to the reference mosaic identifier.
- * @param previousRestrictionValue Previous restriction value.
- * @param newRestrictionValue New restriction value.
- * @param previousRestrictionType Previous restriction type.
- * @param newRestrictionType New restriction type.
- */
- // tslint:disable-next-line: max-line-length
- public constructor(signerPublicKey: KeyDto, version: number, network: NetworkTypeDto, type: EntityTypeDto, mosaicId: UnresolvedMosaicIdDto, referenceMosaicId: UnresolvedMosaicIdDto, restrictionKey: number[], previousRestrictionValue: number[], newRestrictionValue: number[], previousRestrictionType: MosaicRestrictionTypeDto, newRestrictionType: MosaicRestrictionTypeDto) {
- super(signerPublicKey, version, network, type);
- // tslint:disable-next-line: max-line-length
- this.mosaicGlobalRestrictionTransactionBody = new MosaicGlobalRestrictionTransactionBodyBuilder(mosaicId, referenceMosaicId, restrictionKey, previousRestrictionValue, newRestrictionValue, previousRestrictionType, newRestrictionType);
- }
-
- /**
- * Creates an instance of EmbeddedMosaicGlobalRestrictionTransactionBuilder from binary payload.
- *
- * @param payload Byte payload to use to serialize the object.
- * @return Instance of EmbeddedMosaicGlobalRestrictionTransactionBuilder.
- */
- public static loadFromBinary(payload: Uint8Array): EmbeddedMosaicGlobalRestrictionTransactionBuilder {
- const byteArray = Array.from(payload);
- const superObject = EmbeddedTransactionBuilder.loadFromBinary(Uint8Array.from(byteArray));
- byteArray.splice(0, superObject.getSize());
- // tslint:disable-next-line: max-line-length
- const mosaicGlobalRestrictionTransactionBody = MosaicGlobalRestrictionTransactionBodyBuilder.loadFromBinary(Uint8Array.from(byteArray));
- byteArray.splice(0, mosaicGlobalRestrictionTransactionBody.getSize());
- // tslint:disable-next-line: max-line-length
- return new EmbeddedMosaicGlobalRestrictionTransactionBuilder(superObject.signerPublicKey, superObject.version, superObject.network, superObject.type, mosaicGlobalRestrictionTransactionBody.mosaicId, mosaicGlobalRestrictionTransactionBody.referenceMosaicId, mosaicGlobalRestrictionTransactionBody.restrictionKey, mosaicGlobalRestrictionTransactionBody.previousRestrictionValue, mosaicGlobalRestrictionTransactionBody.newRestrictionValue, mosaicGlobalRestrictionTransactionBody.previousRestrictionType, mosaicGlobalRestrictionTransactionBody.newRestrictionType);
- }
-
- /**
- * Gets identifier of the mosaic being restricted.
- *
- * @return Identifier of the mosaic being restricted.
- */
- public getMosaicId(): UnresolvedMosaicIdDto {
- return this.mosaicGlobalRestrictionTransactionBody.getMosaicId();
- }
-
- /**
- * Gets identifier of the mosaic providing the restriction key.
- *
- * @return Identifier of the mosaic providing the restriction key.
- */
- public getReferenceMosaicId(): UnresolvedMosaicIdDto {
- return this.mosaicGlobalRestrictionTransactionBody.getReferenceMosaicId();
- }
-
- /**
- * Gets restriction key relative to the reference mosaic identifier.
- *
- * @return Restriction key relative to the reference mosaic identifier.
- */
- public getRestrictionKey(): number[] {
- return this.mosaicGlobalRestrictionTransactionBody.getRestrictionKey();
- }
-
- /**
- * Gets previous restriction value.
- *
- * @return Previous restriction value.
- */
- public getPreviousRestrictionValue(): number[] {
- return this.mosaicGlobalRestrictionTransactionBody.getPreviousRestrictionValue();
- }
-
- /**
- * Gets new restriction value.
- *
- * @return New restriction value.
- */
- public getNewRestrictionValue(): number[] {
- return this.mosaicGlobalRestrictionTransactionBody.getNewRestrictionValue();
- }
-
- /**
- * Gets previous restriction type.
- *
- * @return Previous restriction type.
- */
- public getPreviousRestrictionType(): MosaicRestrictionTypeDto {
- return this.mosaicGlobalRestrictionTransactionBody.getPreviousRestrictionType();
- }
-
- /**
- * Gets new restriction type.
- *
- * @return New restriction type.
- */
- public getNewRestrictionType(): MosaicRestrictionTypeDto {
- return this.mosaicGlobalRestrictionTransactionBody.getNewRestrictionType();
- }
-
- /**
- * Gets the size of the object.
- *
- * @return Size in bytes.
- */
- public getSize(): number {
- let size: number = super.getSize();
- size += this.mosaicGlobalRestrictionTransactionBody.getSize();
- return size;
- }
-
- /**
- * Serializes an object to bytes.
- *
- * @return Serialized bytes.
- */
- public serialize(): Uint8Array {
- let newArray = Uint8Array.from([]);
- const superBytes = super.serialize();
- newArray = GeneratorUtils.concatTypedArrays(newArray, superBytes);
- const mosaicGlobalRestrictionTransactionBodyBytes = this.mosaicGlobalRestrictionTransactionBody.serialize();
- newArray = GeneratorUtils.concatTypedArrays(newArray, mosaicGlobalRestrictionTransactionBodyBytes);
- return newArray;
- }
-}
diff --git a/src/infrastructure/catbuffer/EmbeddedMosaicMetadataTransactionBuilder.ts b/src/infrastructure/catbuffer/EmbeddedMosaicMetadataTransactionBuilder.ts
deleted file mode 100644
index a304ee3333..0000000000
--- a/src/infrastructure/catbuffer/EmbeddedMosaicMetadataTransactionBuilder.ts
+++ /dev/null
@@ -1,146 +0,0 @@
-// tslint:disable: jsdoc-format
-/**
-*** Copyright (c) 2016-present,
-*** Jaguar0625, gimre, BloodyRookie, Tech Bureau, Corp. All rights reserved.
-***
-*** This file is part of Catapult.
-***
-*** Catapult is free software: you can redistribute it and/or modify
-*** it under the terms of the GNU Lesser General Public License as published by
-*** the Free Software Foundation, either version 3 of the License, or
-*** (at your option) any later version.
-***
-*** Catapult is distributed in the hope that it will be useful,
-*** but WITHOUT ANY WARRANTY; without even the implied warranty of
-*** MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-*** GNU Lesser General Public License for more details.
-***
-*** You should have received a copy of the GNU Lesser General Public License
-*** along with Catapult. If not, see .
-**/
-
-import { EmbeddedTransactionBuilder } from './EmbeddedTransactionBuilder';
-import { EntityTypeDto } from './EntityTypeDto';
-import { GeneratorUtils } from './GeneratorUtils';
-import { KeyDto } from './KeyDto';
-import { MosaicMetadataTransactionBodyBuilder } from './MosaicMetadataTransactionBodyBuilder';
-import { NetworkTypeDto } from './NetworkTypeDto';
-import { UnresolvedMosaicIdDto } from './UnresolvedMosaicIdDto';
-
-/** Binary layout for an embedded mosaic metadata transaction. */
-export class EmbeddedMosaicMetadataTransactionBuilder extends EmbeddedTransactionBuilder {
- /** Mosaic metadata transaction body. */
- mosaicMetadataTransactionBody: MosaicMetadataTransactionBodyBuilder;
-
- /**
- * Constructor.
- *
- * @param signerPublicKey Entity signer's public key.
- * @param version Entity version.
- * @param network Entity network.
- * @param type Entity type.
- * @param targetPublicKey Metadata target public key.
- * @param scopedMetadataKey Metadata key scoped to source, target and type.
- * @param targetMosaicId Target mosaic identifier.
- * @param valueSizeDelta Change in value size in bytes.
- * @param value Difference between existing value and new value.
- * @note when there is no existing value, new value is same this value.
- * @note when there is an existing value, new value is calculated as xor(previous-value, value).
- */
- // tslint:disable-next-line: max-line-length
- public constructor(signerPublicKey: KeyDto, version: number, network: NetworkTypeDto, type: EntityTypeDto, targetPublicKey: KeyDto, scopedMetadataKey: number[], targetMosaicId: UnresolvedMosaicIdDto, valueSizeDelta: number, value: Uint8Array) {
- super(signerPublicKey, version, network, type);
- // tslint:disable-next-line: max-line-length
- this.mosaicMetadataTransactionBody = new MosaicMetadataTransactionBodyBuilder(targetPublicKey, scopedMetadataKey, targetMosaicId, valueSizeDelta, value);
- }
-
- /**
- * Creates an instance of EmbeddedMosaicMetadataTransactionBuilder from binary payload.
- *
- * @param payload Byte payload to use to serialize the object.
- * @return Instance of EmbeddedMosaicMetadataTransactionBuilder.
- */
- public static loadFromBinary(payload: Uint8Array): EmbeddedMosaicMetadataTransactionBuilder {
- const byteArray = Array.from(payload);
- const superObject = EmbeddedTransactionBuilder.loadFromBinary(Uint8Array.from(byteArray));
- byteArray.splice(0, superObject.getSize());
- const mosaicMetadataTransactionBody = MosaicMetadataTransactionBodyBuilder.loadFromBinary(Uint8Array.from(byteArray));
- byteArray.splice(0, mosaicMetadataTransactionBody.getSize());
- // tslint:disable-next-line: max-line-length
- return new EmbeddedMosaicMetadataTransactionBuilder(superObject.signerPublicKey, superObject.version, superObject.network, superObject.type, mosaicMetadataTransactionBody.targetPublicKey, mosaicMetadataTransactionBody.scopedMetadataKey, mosaicMetadataTransactionBody.targetMosaicId, mosaicMetadataTransactionBody.valueSizeDelta, mosaicMetadataTransactionBody.value);
- }
-
- /**
- * Gets metadata target public key.
- *
- * @return Metadata target public key.
- */
- public getTargetPublicKey(): KeyDto {
- return this.mosaicMetadataTransactionBody.getTargetPublicKey();
- }
-
- /**
- * Gets metadata key scoped to source, target and type.
- *
- * @return Metadata key scoped to source, target and type.
- */
- public getScopedMetadataKey(): number[] {
- return this.mosaicMetadataTransactionBody.getScopedMetadataKey();
- }
-
- /**
- * Gets target mosaic identifier.
- *
- * @return Target mosaic identifier.
- */
- public getTargetMosaicId(): UnresolvedMosaicIdDto {
- return this.mosaicMetadataTransactionBody.getTargetMosaicId();
- }
-
- /**
- * Gets change in value size in bytes.
- *
- * @return Change in value size in bytes.
- */
- public getValueSizeDelta(): number {
- return this.mosaicMetadataTransactionBody.getValueSizeDelta();
- }
-
- /**
- * Gets difference between existing value and new value.
- * @note when there is no existing value, new value is same this value.
- * @note when there is an existing value, new value is calculated as xor(previous-value, value).
- *
- * @return Difference between existing value and new value.
- * @note when there is no existing value, new value is same this value.
- * @note when there is an existing value, new value is calculated as xor(previous-value, value).
- */
- public getValue(): Uint8Array {
- return this.mosaicMetadataTransactionBody.getValue();
- }
-
- /**
- * Gets the size of the object.
- *
- * @return Size in bytes.
- */
- public getSize(): number {
- let size: number = super.getSize();
- size += this.mosaicMetadataTransactionBody.getSize();
- return size;
- }
-
- /**
- * Serializes an object to bytes.
- *
- * @return Serialized bytes.
- */
- public serialize(): Uint8Array {
- let newArray = Uint8Array.from([]);
- const superBytes = super.serialize();
- newArray = GeneratorUtils.concatTypedArrays(newArray, superBytes);
- const mosaicMetadataTransactionBodyBytes = this.mosaicMetadataTransactionBody.serialize();
- newArray = GeneratorUtils.concatTypedArrays(newArray, mosaicMetadataTransactionBodyBytes);
- return newArray;
- }
-}
diff --git a/src/infrastructure/catbuffer/EmbeddedMosaicSupplyChangeTransactionBuilder.ts b/src/infrastructure/catbuffer/EmbeddedMosaicSupplyChangeTransactionBuilder.ts
deleted file mode 100644
index 8dbb987213..0000000000
--- a/src/infrastructure/catbuffer/EmbeddedMosaicSupplyChangeTransactionBuilder.ts
+++ /dev/null
@@ -1,122 +0,0 @@
-// tslint:disable: jsdoc-format
-/**
-*** Copyright (c) 2016-present,
-*** Jaguar0625, gimre, BloodyRookie, Tech Bureau, Corp. All rights reserved.
-***
-*** This file is part of Catapult.
-***
-*** Catapult is free software: you can redistribute it and/or modify
-*** it under the terms of the GNU Lesser General Public License as published by
-*** the Free Software Foundation, either version 3 of the License, or
-*** (at your option) any later version.
-***
-*** Catapult is distributed in the hope that it will be useful,
-*** but WITHOUT ANY WARRANTY; without even the implied warranty of
-*** MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-*** GNU Lesser General Public License for more details.
-***
-*** You should have received a copy of the GNU Lesser General Public License
-*** along with Catapult. If not, see .
-**/
-
-import { AmountDto } from './AmountDto';
-import { EmbeddedTransactionBuilder } from './EmbeddedTransactionBuilder';
-import { EntityTypeDto } from './EntityTypeDto';
-import { GeneratorUtils } from './GeneratorUtils';
-import { KeyDto } from './KeyDto';
-import { MosaicSupplyChangeActionDto } from './MosaicSupplyChangeActionDto';
-import { MosaicSupplyChangeTransactionBodyBuilder } from './MosaicSupplyChangeTransactionBodyBuilder';
-import { NetworkTypeDto } from './NetworkTypeDto';
-import { UnresolvedMosaicIdDto } from './UnresolvedMosaicIdDto';
-
-/** Binary layout for an embedded mosaic supply change transaction. */
-export class EmbeddedMosaicSupplyChangeTransactionBuilder extends EmbeddedTransactionBuilder {
- /** Mosaic supply change transaction body. */
- mosaicSupplyChangeTransactionBody: MosaicSupplyChangeTransactionBodyBuilder;
-
- /**
- * Constructor.
- *
- * @param signerPublicKey Entity signer's public key.
- * @param version Entity version.
- * @param network Entity network.
- * @param type Entity type.
- * @param mosaicId Affected mosaic identifier.
- * @param delta Change amount.
- * @param action Supply change action.
- */
- // tslint:disable-next-line: max-line-length
- public constructor(signerPublicKey: KeyDto, version: number, network: NetworkTypeDto, type: EntityTypeDto, mosaicId: UnresolvedMosaicIdDto, delta: AmountDto, action: MosaicSupplyChangeActionDto) {
- super(signerPublicKey, version, network, type);
- this.mosaicSupplyChangeTransactionBody = new MosaicSupplyChangeTransactionBodyBuilder(mosaicId, delta, action);
- }
-
- /**
- * Creates an instance of EmbeddedMosaicSupplyChangeTransactionBuilder from binary payload.
- *
- * @param payload Byte payload to use to serialize the object.
- * @return Instance of EmbeddedMosaicSupplyChangeTransactionBuilder.
- */
- public static loadFromBinary(payload: Uint8Array): EmbeddedMosaicSupplyChangeTransactionBuilder {
- const byteArray = Array.from(payload);
- const superObject = EmbeddedTransactionBuilder.loadFromBinary(Uint8Array.from(byteArray));
- byteArray.splice(0, superObject.getSize());
- // tslint:disable-next-line: max-line-length
- const mosaicSupplyChangeTransactionBody = MosaicSupplyChangeTransactionBodyBuilder.loadFromBinary(Uint8Array.from(byteArray));
- byteArray.splice(0, mosaicSupplyChangeTransactionBody.getSize());
- // tslint:disable-next-line: max-line-length
- return new EmbeddedMosaicSupplyChangeTransactionBuilder(superObject.signerPublicKey, superObject.version, superObject.network, superObject.type, mosaicSupplyChangeTransactionBody.mosaicId, mosaicSupplyChangeTransactionBody.delta, mosaicSupplyChangeTransactionBody.action);
- }
-
- /**
- * Gets affected mosaic identifier.
- *
- * @return Affected mosaic identifier.
- */
- public getMosaicId(): UnresolvedMosaicIdDto {
- return this.mosaicSupplyChangeTransactionBody.getMosaicId();
- }
-
- /**
- * Gets change amount.
- *
- * @return Change amount.
- */
- public getDelta(): AmountDto {
- return this.mosaicSupplyChangeTransactionBody.getDelta();
- }
-
- /**
- * Gets supply change action.
- *
- * @return Supply change action.
- */
- public getAction(): MosaicSupplyChangeActionDto {
- return this.mosaicSupplyChangeTransactionBody.getAction();
- }
-
- /**
- * Gets the size of the object.
- *
- * @return Size in bytes.
- */
- public getSize(): number {
- let size: number = super.getSize();
- size += this.mosaicSupplyChangeTransactionBody.getSize();
- return size;
- }
-
- /**
- * Serializes an object to bytes.
- *
- * @return Serialized bytes.
- */
- public serialize(): Uint8Array {
- let newArray = Uint8Array.from([]);
- const superBytes = super.serialize();
- newArray = GeneratorUtils.concatTypedArrays(newArray, superBytes);
- const mosaicSupplyChangeTransactionBodyBytes = this.mosaicSupplyChangeTransactionBody.serialize();
- newArray = GeneratorUtils.concatTypedArrays(newArray, mosaicSupplyChangeTransactionBodyBytes);
- return newArray;
- }
-}
diff --git a/src/infrastructure/catbuffer/EmbeddedMultisigAccountModificationTransactionBuilder.ts b/src/infrastructure/catbuffer/EmbeddedMultisigAccountModificationTransactionBuilder.ts
deleted file mode 100644
index f91585908f..0000000000
--- a/src/infrastructure/catbuffer/EmbeddedMultisigAccountModificationTransactionBuilder.ts
+++ /dev/null
@@ -1,139 +0,0 @@
-// tslint:disable: jsdoc-format
-/**
-*** Copyright (c) 2016-present,
-*** Jaguar0625, gimre, BloodyRookie, Tech Bureau, Corp. All rights reserved.
-***
-*** This file is part of Catapult.
-***
-*** Catapult is free software: you can redistribute it and/or modify
-*** it under the terms of the GNU Lesser General Public License as published by
-*** the Free Software Foundation, either version 3 of the License, or
-*** (at your option) any later version.
-***
-*** Catapult is distributed in the hope that it will be useful,
-*** but WITHOUT ANY WARRANTY; without even the implied warranty of
-*** MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-*** GNU Lesser General Public License for more details.
-***
-*** You should have received a copy of the GNU Lesser General Public License
-*** along with Catapult. If not, see .
-**/
-
-import { EmbeddedTransactionBuilder } from './EmbeddedTransactionBuilder';
-import { EntityTypeDto } from './EntityTypeDto';
-import { GeneratorUtils } from './GeneratorUtils';
-import { KeyDto } from './KeyDto';
-import { MultisigAccountModificationTransactionBodyBuilder } from './MultisigAccountModificationTransactionBodyBuilder';
-import { NetworkTypeDto } from './NetworkTypeDto';
-
-/** Binary layout for an embedded multisig account modification transaction. */
-export class EmbeddedMultisigAccountModificationTransactionBuilder extends EmbeddedTransactionBuilder {
- /** Multisig account modification transaction body. */
- multisigAccountModificationTransactionBody: MultisigAccountModificationTransactionBodyBuilder;
-
- /**
- * Constructor.
- *
- * @param signerPublicKey Entity signer's public key.
- * @param version Entity version.
- * @param network Entity network.
- * @param type Entity type.
- * @param minRemovalDelta Relative change of the minimal number of cosignatories required when removing an account.
- * @param minApprovalDelta Relative change of the minimal number of cosignatories required when approving a transaction.
- * @param publicKeyAdditions Cosignatory public key additions.
- * @param publicKeyDeletions Cosignatory public key deletions.
- */
- // tslint:disable-next-line: max-line-length
- public constructor(signerPublicKey: KeyDto, version: number, network: NetworkTypeDto, type: EntityTypeDto, minRemovalDelta: number, minApprovalDelta: number, publicKeyAdditions: KeyDto[], publicKeyDeletions: KeyDto[]) {
- super(signerPublicKey, version, network, type);
- // tslint:disable-next-line: max-line-length
- this.multisigAccountModificationTransactionBody = new MultisigAccountModificationTransactionBodyBuilder(minRemovalDelta, minApprovalDelta, publicKeyAdditions, publicKeyDeletions);
- }
-
- /**
- * Creates an instance of EmbeddedMultisigAccountModificationTransactionBuilder from binary payload.
- *
- * @param payload Byte payload to use to serialize the object.
- * @return Instance of EmbeddedMultisigAccountModificationTransactionBuilder.
- */
- public static loadFromBinary(payload: Uint8Array): EmbeddedMultisigAccountModificationTransactionBuilder {
- const byteArray = Array.from(payload);
- const superObject = EmbeddedTransactionBuilder.loadFromBinary(Uint8Array.from(byteArray));
- byteArray.splice(0, superObject.getSize());
- // tslint:disable-next-line: max-line-length
- const multisigAccountModificationTransactionBody = MultisigAccountModificationTransactionBodyBuilder.loadFromBinary(Uint8Array.from(byteArray));
- byteArray.splice(0, multisigAccountModificationTransactionBody.getSize());
- // tslint:disable-next-line: max-line-length
- return new EmbeddedMultisigAccountModificationTransactionBuilder(superObject.signerPublicKey, superObject.version, superObject.network, superObject.type, multisigAccountModificationTransactionBody.minRemovalDelta, multisigAccountModificationTransactionBody.minApprovalDelta, multisigAccountModificationTransactionBody.publicKeyAdditions, multisigAccountModificationTransactionBody.publicKeyDeletions);
- }
-
- /**
- * Gets relative change of the minimal number of cosignatories required when removing an account.
- *
- * @return Relative change of the minimal number of cosignatories required when removing an account.
- */
- public getMinRemovalDelta(): number {
- return this.multisigAccountModificationTransactionBody.getMinRemovalDelta();
- }
-
- /**
- * Gets relative change of the minimal number of cosignatories required when approving a transaction.
- *
- * @return Relative change of the minimal number of cosignatories required when approving a transaction.
- */
- public getMinApprovalDelta(): number {
- return this.multisigAccountModificationTransactionBody.getMinApprovalDelta();
- }
-
- /**
- * Gets reserved padding to align publicKeyAdditions on 8-byte boundary.
- *
- * @return Reserved padding to align publicKeyAdditions on 8-byte boundary.
- */
- public getMultisigAccountModificationTransactionBody_Reserved1(): number {
- return this.multisigAccountModificationTransactionBody.getMultisigAccountModificationTransactionBody_Reserved1();
- }
-
- /**
- * Gets cosignatory public key additions.
- *
- * @return Cosignatory public key additions.
- */
- public getPublicKeyAdditions(): KeyDto[] {
- return this.multisigAccountModificationTransactionBody.getPublicKeyAdditions();
- }
-
- /**
- * Gets cosignatory public key deletions.
- *
- * @return Cosignatory public key deletions.
- */
- public getPublicKeyDeletions(): KeyDto[] {
- return this.multisigAccountModificationTransactionBody.getPublicKeyDeletions();
- }
-
- /**
- * Gets the size of the object.
- *
- * @return Size in bytes.
- */
- public getSize(): number {
- let size: number = super.getSize();
- size += this.multisigAccountModificationTransactionBody.getSize();
- return size;
- }
-
- /**
- * Serializes an object to bytes.
- *
- * @return Serialized bytes.
- */
- public serialize(): Uint8Array {
- let newArray = Uint8Array.from([]);
- const superBytes = super.serialize();
- newArray = GeneratorUtils.concatTypedArrays(newArray, superBytes);
- const multisigAccountModificationTransactionBodyBytes = this.multisigAccountModificationTransactionBody.serialize();
- newArray = GeneratorUtils.concatTypedArrays(newArray, multisigAccountModificationTransactionBodyBytes);
- return newArray;
- }
-}
diff --git a/src/infrastructure/catbuffer/EmbeddedNamespaceMetadataTransactionBuilder.ts b/src/infrastructure/catbuffer/EmbeddedNamespaceMetadataTransactionBuilder.ts
deleted file mode 100644
index b3ebde931a..0000000000
--- a/src/infrastructure/catbuffer/EmbeddedNamespaceMetadataTransactionBuilder.ts
+++ /dev/null
@@ -1,147 +0,0 @@
-// tslint:disable: jsdoc-format
-/**
-*** Copyright (c) 2016-present,
-*** Jaguar0625, gimre, BloodyRookie, Tech Bureau, Corp. All rights reserved.
-***
-*** This file is part of Catapult.
-***
-*** Catapult is free software: you can redistribute it and/or modify
-*** it under the terms of the GNU Lesser General Public License as published by
-*** the Free Software Foundation, either version 3 of the License, or
-*** (at your option) any later version.
-***
-*** Catapult is distributed in the hope that it will be useful,
-*** but WITHOUT ANY WARRANTY; without even the implied warranty of
-*** MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-*** GNU Lesser General Public License for more details.
-***
-*** You should have received a copy of the GNU Lesser General Public License
-*** along with Catapult. If not, see .
-**/
-
-import { EmbeddedTransactionBuilder } from './EmbeddedTransactionBuilder';
-import { EntityTypeDto } from './EntityTypeDto';
-import { GeneratorUtils } from './GeneratorUtils';
-import { KeyDto } from './KeyDto';
-import { NamespaceIdDto } from './NamespaceIdDto';
-import { NamespaceMetadataTransactionBodyBuilder } from './NamespaceMetadataTransactionBodyBuilder';
-import { NetworkTypeDto } from './NetworkTypeDto';
-
-/** Binary layout for an embedded namespace metadata transaction. */
-export class EmbeddedNamespaceMetadataTransactionBuilder extends EmbeddedTransactionBuilder {
- /** Namespace metadata transaction body. */
- namespaceMetadataTransactionBody: NamespaceMetadataTransactionBodyBuilder;
-
- /**
- * Constructor.
- *
- * @param signerPublicKey Entity signer's public key.
- * @param version Entity version.
- * @param network Entity network.
- * @param type Entity type.
- * @param targetPublicKey Metadata target public key.
- * @param scopedMetadataKey Metadata key scoped to source, target and type.
- * @param targetNamespaceId Target namespace identifier.
- * @param valueSizeDelta Change in value size in bytes.
- * @param value Difference between existing value and new value.
- * @note when there is no existing value, new value is same this value.
- * @note when there is an existing value, new value is calculated as xor(previous-value, value).
- */
- // tslint:disable-next-line: max-line-length
- public constructor(signerPublicKey: KeyDto, version: number, network: NetworkTypeDto, type: EntityTypeDto, targetPublicKey: KeyDto, scopedMetadataKey: number[], targetNamespaceId: NamespaceIdDto, valueSizeDelta: number, value: Uint8Array) {
- super(signerPublicKey, version, network, type);
- // tslint:disable-next-line: max-line-length
- this.namespaceMetadataTransactionBody = new NamespaceMetadataTransactionBodyBuilder(targetPublicKey, scopedMetadataKey, targetNamespaceId, valueSizeDelta, value);
- }
-
- /**
- * Creates an instance of EmbeddedNamespaceMetadataTransactionBuilder from binary payload.
- *
- * @param payload Byte payload to use to serialize the object.
- * @return Instance of EmbeddedNamespaceMetadataTransactionBuilder.
- */
- public static loadFromBinary(payload: Uint8Array): EmbeddedNamespaceMetadataTransactionBuilder {
- const byteArray = Array.from(payload);
- const superObject = EmbeddedTransactionBuilder.loadFromBinary(Uint8Array.from(byteArray));
- byteArray.splice(0, superObject.getSize());
- // tslint:disable-next-line: max-line-length
- const namespaceMetadataTransactionBody = NamespaceMetadataTransactionBodyBuilder.loadFromBinary(Uint8Array.from(byteArray));
- byteArray.splice(0, namespaceMetadataTransactionBody.getSize());
- // tslint:disable-next-line: max-line-length
- return new EmbeddedNamespaceMetadataTransactionBuilder(superObject.signerPublicKey, superObject.version, superObject.network, superObject.type, namespaceMetadataTransactionBody.targetPublicKey, namespaceMetadataTransactionBody.scopedMetadataKey, namespaceMetadataTransactionBody.targetNamespaceId, namespaceMetadataTransactionBody.valueSizeDelta, namespaceMetadataTransactionBody.value);
- }
-
- /**
- * Gets metadata target public key.
- *
- * @return Metadata target public key.
- */
- public getTargetPublicKey(): KeyDto {
- return this.namespaceMetadataTransactionBody.getTargetPublicKey();
- }
-
- /**
- * Gets metadata key scoped to source, target and type.
- *
- * @return Metadata key scoped to source, target and type.
- */
- public getScopedMetadataKey(): number[] {
- return this.namespaceMetadataTransactionBody.getScopedMetadataKey();
- }
-
- /**
- * Gets target namespace identifier.
- *
- * @return Target namespace identifier.
- */
- public getTargetNamespaceId(): NamespaceIdDto {
- return this.namespaceMetadataTransactionBody.getTargetNamespaceId();
- }
-
- /**
- * Gets change in value size in bytes.
- *
- * @return Change in value size in bytes.
- */
- public getValueSizeDelta(): number {
- return this.namespaceMetadataTransactionBody.getValueSizeDelta();
- }
-
- /**
- * Gets difference between existing value and new value.
- * @note when there is no existing value, new value is same this value.
- * @note when there is an existing value, new value is calculated as xor(previous-value, value).
- *
- * @return Difference between existing value and new value.
- * @note when there is no existing value, new value is same this value.
- * @note when there is an existing value, new value is calculated as xor(previous-value, value).
- */
- public getValue(): Uint8Array {
- return this.namespaceMetadataTransactionBody.getValue();
- }
-
- /**
- * Gets the size of the object.
- *
- * @return Size in bytes.
- */
- public getSize(): number {
- let size: number = super.getSize();
- size += this.namespaceMetadataTransactionBody.getSize();
- return size;
- }
-
- /**
- * Serializes an object to bytes.
- *
- * @return Serialized bytes.
- */
- public serialize(): Uint8Array {
- let newArray = Uint8Array.from([]);
- const superBytes = super.serialize();
- newArray = GeneratorUtils.concatTypedArrays(newArray, superBytes);
- const namespaceMetadataTransactionBodyBytes = this.namespaceMetadataTransactionBody.serialize();
- newArray = GeneratorUtils.concatTypedArrays(newArray, namespaceMetadataTransactionBodyBytes);
- return newArray;
- }
-}
diff --git a/src/infrastructure/catbuffer/EmbeddedNamespaceRegistrationTransactionBuilder.ts b/src/infrastructure/catbuffer/EmbeddedNamespaceRegistrationTransactionBuilder.ts
deleted file mode 100644
index 46d64e43c7..0000000000
--- a/src/infrastructure/catbuffer/EmbeddedNamespaceRegistrationTransactionBuilder.ts
+++ /dev/null
@@ -1,145 +0,0 @@
-// tslint:disable: jsdoc-format
-/**
-*** Copyright (c) 2016-present,
-*** Jaguar0625, gimre, BloodyRookie, Tech Bureau, Corp. All rights reserved.
-***
-*** This file is part of Catapult.
-***
-*** Catapult is free software: you can redistribute it and/or modify
-*** it under the terms of the GNU Lesser General Public License as published by
-*** the Free Software Foundation, either version 3 of the License, or
-*** (at your option) any later version.
-***
-*** Catapult is distributed in the hope that it will be useful,
-*** but WITHOUT ANY WARRANTY; without even the implied warranty of
-*** MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-*** GNU Lesser General Public License for more details.
-***
-*** You should have received a copy of the GNU Lesser General Public License
-*** along with Catapult. If not, see .
-**/
-
-import { BlockDurationDto } from './BlockDurationDto';
-import { EmbeddedTransactionBuilder } from './EmbeddedTransactionBuilder';
-import { EntityTypeDto } from './EntityTypeDto';
-import { GeneratorUtils } from './GeneratorUtils';
-import { KeyDto } from './KeyDto';
-import { NamespaceIdDto } from './NamespaceIdDto';
-import { NamespaceRegistrationTransactionBodyBuilder } from './NamespaceRegistrationTransactionBodyBuilder';
-import { NamespaceRegistrationTypeDto } from './NamespaceRegistrationTypeDto';
-import { NetworkTypeDto } from './NetworkTypeDto';
-
-/** Binary layout for an embedded namespace registration transaction. */
-export class EmbeddedNamespaceRegistrationTransactionBuilder extends EmbeddedTransactionBuilder {
- /** Namespace registration transaction body. */
- namespaceRegistrationTransactionBody: NamespaceRegistrationTransactionBodyBuilder;
-
- /**
- * Constructor.
- *
- * @param signerPublicKey Entity signer's public key.
- * @param version Entity version.
- * @param network Entity network.
- * @param type Entity type.
- * @param duration Namespace duration.
- * @param parentId Parent namespace identifier.
- * @param id Namespace identifier.
- * @param name Namespace name.
- */
- // tslint:disable-next-line: max-line-length
- public constructor(signerPublicKey: KeyDto, version: number, network: NetworkTypeDto, type: EntityTypeDto, id: NamespaceIdDto, name: Uint8Array, duration?: BlockDurationDto, parentId?: NamespaceIdDto) {
- super(signerPublicKey, version, network, type);
- if ((duration && parentId) || (!duration && !parentId)) {
- throw new Error('Invalid conditional parameters');
- }
- // tslint:disable-next-line: max-line-length
- this.namespaceRegistrationTransactionBody = new NamespaceRegistrationTransactionBodyBuilder(id, name, duration, parentId);
- }
-
- /**
- * Creates an instance of EmbeddedNamespaceRegistrationTransactionBuilder from binary payload.
- *
- * @param payload Byte payload to use to serialize the object.
- * @return Instance of EmbeddedNamespaceRegistrationTransactionBuilder.
- */
- public static loadFromBinary(payload: Uint8Array): EmbeddedNamespaceRegistrationTransactionBuilder {
- const byteArray = Array.from(payload);
- const superObject = EmbeddedTransactionBuilder.loadFromBinary(Uint8Array.from(byteArray));
- byteArray.splice(0, superObject.getSize());
- // tslint:disable-next-line: max-line-length
- const namespaceRegistrationTransactionBody = NamespaceRegistrationTransactionBodyBuilder.loadFromBinary(Uint8Array.from(byteArray));
- byteArray.splice(0, namespaceRegistrationTransactionBody.getSize());
- // tslint:disable-next-line: max-line-length
- return new EmbeddedNamespaceRegistrationTransactionBuilder(superObject.signerPublicKey, superObject.version, superObject.network, superObject.type, namespaceRegistrationTransactionBody.id, namespaceRegistrationTransactionBody.name, namespaceRegistrationTransactionBody.duration, namespaceRegistrationTransactionBody.parentId);
- }
-
- /**
- * Gets namespace duration.
- *
- * @return Namespace duration.
- */
- public getDuration(): BlockDurationDto | undefined {
- return this.namespaceRegistrationTransactionBody.getDuration();
- }
-
- /**
- * Gets parent namespace identifier.
- *
- * @return Parent namespace identifier.
- */
- public getParentId(): NamespaceIdDto | undefined {
- return this.namespaceRegistrationTransactionBody.getParentId();
- }
-
- /**
- * Gets namespace identifier.
- *
- * @return Namespace identifier.
- */
- public getId(): NamespaceIdDto {
- return this.namespaceRegistrationTransactionBody.getId();
- }
-
- /**
- * Gets namespace registration type.
- *
- * @return Namespace registration type.
- */
- public getRegistrationType(): NamespaceRegistrationTypeDto {
- return this.namespaceRegistrationTransactionBody.getRegistrationType();
- }
-
- /**
- * Gets namespace name.
- *
- * @return Namespace name.
- */
- public getName(): Uint8Array {
- return this.namespaceRegistrationTransactionBody.getName();
- }
-
- /**
- * Gets the size of the object.
- *
- * @return Size in bytes.
- */
- public getSize(): number {
- let size: number = super.getSize();
- size += this.namespaceRegistrationTransactionBody.getSize();
- return size;
- }
-
- /**
- * Serializes an object to bytes.
- *
- * @return Serialized bytes.
- */
- public serialize(): Uint8Array {
- let newArray = Uint8Array.from([]);
- const superBytes = super.serialize();
- newArray = GeneratorUtils.concatTypedArrays(newArray, superBytes);
- const namespaceRegistrationTransactionBodyBytes = this.namespaceRegistrationTransactionBody.serialize();
- newArray = GeneratorUtils.concatTypedArrays(newArray, namespaceRegistrationTransactionBodyBytes);
- return newArray;
- }
-}
diff --git a/src/infrastructure/catbuffer/EmbeddedSecretLockTransactionBuilder.ts b/src/infrastructure/catbuffer/EmbeddedSecretLockTransactionBuilder.ts
deleted file mode 100644
index 09aaa4fe6f..0000000000
--- a/src/infrastructure/catbuffer/EmbeddedSecretLockTransactionBuilder.ts
+++ /dev/null
@@ -1,144 +0,0 @@
-// tslint:disable: jsdoc-format
-/**
-*** Copyright (c) 2016-present,
-*** Jaguar0625, gimre, BloodyRookie, Tech Bureau, Corp. All rights reserved.
-***
-*** This file is part of Catapult.
-***
-*** Catapult is free software: you can redistribute it and/or modify
-*** it under the terms of the GNU Lesser General Public License as published by
-*** the Free Software Foundation, either version 3 of the License, or
-*** (at your option) any later version.
-***
-*** Catapult is distributed in the hope that it will be useful,
-*** but WITHOUT ANY WARRANTY; without even the implied warranty of
-*** MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-*** GNU Lesser General Public License for more details.
-***
-*** You should have received a copy of the GNU Lesser General Public License
-*** along with Catapult. If not, see .
-**/
-
-import { BlockDurationDto } from './BlockDurationDto';
-import { EmbeddedTransactionBuilder } from './EmbeddedTransactionBuilder';
-import { EntityTypeDto } from './EntityTypeDto';
-import { GeneratorUtils } from './GeneratorUtils';
-import { Hash256Dto } from './Hash256Dto';
-import { KeyDto } from './KeyDto';
-import { LockHashAlgorithmDto } from './LockHashAlgorithmDto';
-import { NetworkTypeDto } from './NetworkTypeDto';
-import { SecretLockTransactionBodyBuilder } from './SecretLockTransactionBodyBuilder';
-import { UnresolvedAddressDto } from './UnresolvedAddressDto';
-import { UnresolvedMosaicBuilder } from './UnresolvedMosaicBuilder';
-
-/** Binary layout for an embedded secret lock transaction. */
-export class EmbeddedSecretLockTransactionBuilder extends EmbeddedTransactionBuilder {
- /** Secret lock transaction body. */
- secretLockTransactionBody: SecretLockTransactionBodyBuilder;
-
- /**
- * Constructor.
- *
- * @param signerPublicKey Entity signer's public key.
- * @param version Entity version.
- * @param network Entity network.
- * @param type Entity type.
- * @param secret Secret.
- * @param mosaic Locked mosaic.
- * @param duration Number of blocks for which a lock should be valid.
- * @param hashAlgorithm Hash algorithm.
- * @param recipientAddress Locked mosaic recipient address.
- */
- // tslint:disable-next-line: max-line-length
- public constructor(signerPublicKey: KeyDto, version: number, network: NetworkTypeDto, type: EntityTypeDto, secret: Hash256Dto, mosaic: UnresolvedMosaicBuilder, duration: BlockDurationDto, hashAlgorithm: LockHashAlgorithmDto, recipientAddress: UnresolvedAddressDto) {
- super(signerPublicKey, version, network, type);
- // tslint:disable-next-line: max-line-length
- this.secretLockTransactionBody = new SecretLockTransactionBodyBuilder(secret, mosaic, duration, hashAlgorithm, recipientAddress);
- }
-
- /**
- * Creates an instance of EmbeddedSecretLockTransactionBuilder from binary payload.
- *
- * @param payload Byte payload to use to serialize the object.
- * @return Instance of EmbeddedSecretLockTransactionBuilder.
- */
- public static loadFromBinary(payload: Uint8Array): EmbeddedSecretLockTransactionBuilder {
- const byteArray = Array.from(payload);
- const superObject = EmbeddedTransactionBuilder.loadFromBinary(Uint8Array.from(byteArray));
- byteArray.splice(0, superObject.getSize());
- const secretLockTransactionBody = SecretLockTransactionBodyBuilder.loadFromBinary(Uint8Array.from(byteArray));
- byteArray.splice(0, secretLockTransactionBody.getSize());
- // tslint:disable-next-line: max-line-length
- return new EmbeddedSecretLockTransactionBuilder(superObject.signerPublicKey, superObject.version, superObject.network, superObject.type, secretLockTransactionBody.secret, secretLockTransactionBody.mosaic, secretLockTransactionBody.duration, secretLockTransactionBody.hashAlgorithm, secretLockTransactionBody.recipientAddress);
- }
-
- /**
- * Gets secret.
- *
- * @return Secret.
- */
- public getSecret(): Hash256Dto {
- return this.secretLockTransactionBody.getSecret();
- }
-
- /**
- * Gets locked mosaic.
- *
- * @return Locked mosaic.
- */
- public getMosaic(): UnresolvedMosaicBuilder {
- return this.secretLockTransactionBody.getMosaic();
- }
-
- /**
- * Gets number of blocks for which a lock should be valid.
- *
- * @return Number of blocks for which a lock should be valid.
- */
- public getDuration(): BlockDurationDto {
- return this.secretLockTransactionBody.getDuration();
- }
-
- /**
- * Gets hash algorithm.
- *
- * @return Hash algorithm.
- */
- public getHashAlgorithm(): LockHashAlgorithmDto {
- return this.secretLockTransactionBody.getHashAlgorithm();
- }
-
- /**
- * Gets locked mosaic recipient address.
- *
- * @return Locked mosaic recipient address.
- */
- public getRecipientAddress(): UnresolvedAddressDto {
- return this.secretLockTransactionBody.getRecipientAddress();
- }
-
- /**
- * Gets the size of the object.
- *
- * @return Size in bytes.
- */
- public getSize(): number {
- let size: number = super.getSize();
- size += this.secretLockTransactionBody.getSize();
- return size;
- }
-
- /**
- * Serializes an object to bytes.
- *
- * @return Serialized bytes.
- */
- public serialize(): Uint8Array {
- let newArray = Uint8Array.from([]);
- const superBytes = super.serialize();
- newArray = GeneratorUtils.concatTypedArrays(newArray, superBytes);
- const secretLockTransactionBodyBytes = this.secretLockTransactionBody.serialize();
- newArray = GeneratorUtils.concatTypedArrays(newArray, secretLockTransactionBodyBytes);
- return newArray;
- }
-}
diff --git a/src/infrastructure/catbuffer/EmbeddedSecretProofTransactionBuilder.ts b/src/infrastructure/catbuffer/EmbeddedSecretProofTransactionBuilder.ts
deleted file mode 100644
index d694154b4e..0000000000
--- a/src/infrastructure/catbuffer/EmbeddedSecretProofTransactionBuilder.ts
+++ /dev/null
@@ -1,131 +0,0 @@
-// tslint:disable: jsdoc-format
-/**
-*** Copyright (c) 2016-present,
-*** Jaguar0625, gimre, BloodyRookie, Tech Bureau, Corp. All rights reserved.
-***
-*** This file is part of Catapult.
-***
-*** Catapult is free software: you can redistribute it and/or modify
-*** it under the terms of the GNU Lesser General Public License as published by
-*** the Free Software Foundation, either version 3 of the License, or
-*** (at your option) any later version.
-***
-*** Catapult is distributed in the hope that it will be useful,
-*** but WITHOUT ANY WARRANTY; without even the implied warranty of
-*** MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-*** GNU Lesser General Public License for more details.
-***
-*** You should have received a copy of the GNU Lesser General Public License
-*** along with Catapult. If not, see .
-**/
-
-import { EmbeddedTransactionBuilder } from './EmbeddedTransactionBuilder';
-import { EntityTypeDto } from './EntityTypeDto';
-import { GeneratorUtils } from './GeneratorUtils';
-import { Hash256Dto } from './Hash256Dto';
-import { KeyDto } from './KeyDto';
-import { LockHashAlgorithmDto } from './LockHashAlgorithmDto';
-import { NetworkTypeDto } from './NetworkTypeDto';
-import { SecretProofTransactionBodyBuilder } from './SecretProofTransactionBodyBuilder';
-import { UnresolvedAddressDto } from './UnresolvedAddressDto';
-
-/** Binary layout for an embedded secret proof transaction. */
-export class EmbeddedSecretProofTransactionBuilder extends EmbeddedTransactionBuilder {
- /** Secret proof transaction body. */
- secretProofTransactionBody: SecretProofTransactionBodyBuilder;
-
- /**
- * Constructor.
- *
- * @param signerPublicKey Entity signer's public key.
- * @param version Entity version.
- * @param network Entity network.
- * @param type Entity type.
- * @param secret Secret.
- * @param hashAlgorithm Hash algorithm.
- * @param recipientAddress Locked mosaic recipient address.
- * @param proof Proof data.
- */
- // tslint:disable-next-line: max-line-length
- public constructor(signerPublicKey: KeyDto, version: number, network: NetworkTypeDto, type: EntityTypeDto, secret: Hash256Dto, hashAlgorithm: LockHashAlgorithmDto, recipientAddress: UnresolvedAddressDto, proof: Uint8Array) {
- super(signerPublicKey, version, network, type);
- this.secretProofTransactionBody = new SecretProofTransactionBodyBuilder(secret, hashAlgorithm, recipientAddress, proof);
- }
-
- /**
- * Creates an instance of EmbeddedSecretProofTransactionBuilder from binary payload.
- *
- * @param payload Byte payload to use to serialize the object.
- * @return Instance of EmbeddedSecretProofTransactionBuilder.
- */
- public static loadFromBinary(payload: Uint8Array): EmbeddedSecretProofTransactionBuilder {
- const byteArray = Array.from(payload);
- const superObject = EmbeddedTransactionBuilder.loadFromBinary(Uint8Array.from(byteArray));
- byteArray.splice(0, superObject.getSize());
- const secretProofTransactionBody = SecretProofTransactionBodyBuilder.loadFromBinary(Uint8Array.from(byteArray));
- byteArray.splice(0, secretProofTransactionBody.getSize());
- // tslint:disable-next-line: max-line-length
- return new EmbeddedSecretProofTransactionBuilder(superObject.signerPublicKey, superObject.version, superObject.network, superObject.type, secretProofTransactionBody.secret, secretProofTransactionBody.hashAlgorithm, secretProofTransactionBody.recipientAddress, secretProofTransactionBody.proof);
- }
-
- /**
- * Gets secret.
- *
- * @return Secret.
- */
- public getSecret(): Hash256Dto {
- return this.secretProofTransactionBody.getSecret();
- }
-
- /**
- * Gets hash algorithm.
- *
- * @return Hash algorithm.
- */
- public getHashAlgorithm(): LockHashAlgorithmDto {
- return this.secretProofTransactionBody.getHashAlgorithm();
- }
-
- /**
- * Gets locked mosaic recipient address.
- *
- * @return Locked mosaic recipient address.
- */
- public getRecipientAddress(): UnresolvedAddressDto {
- return this.secretProofTransactionBody.getRecipientAddress();
- }
-
- /**
- * Gets proof data.
- *
- * @return Proof data.
- */
- public getProof(): Uint8Array {
- return this.secretProofTransactionBody.getProof();
- }
-
- /**
- * Gets the size of the object.
- *
- * @return Size in bytes.
- */
- public getSize(): number {
- let size: number = super.getSize();
- size += this.secretProofTransactionBody.getSize();
- return size;
- }
-
- /**
- * Serializes an object to bytes.
- *
- * @return Serialized bytes.
- */
- public serialize(): Uint8Array {
- let newArray = Uint8Array.from([]);
- const superBytes = super.serialize();
- newArray = GeneratorUtils.concatTypedArrays(newArray, superBytes);
- const secretProofTransactionBodyBytes = this.secretProofTransactionBody.serialize();
- newArray = GeneratorUtils.concatTypedArrays(newArray, secretProofTransactionBodyBytes);
- return newArray;
- }
-}
diff --git a/src/infrastructure/catbuffer/EmbeddedTransactionBuilder.ts b/src/infrastructure/catbuffer/EmbeddedTransactionBuilder.ts
deleted file mode 100644
index a37847df55..0000000000
--- a/src/infrastructure/catbuffer/EmbeddedTransactionBuilder.ts
+++ /dev/null
@@ -1,182 +0,0 @@
-// tslint:disable: jsdoc-format
-/**
-*** Copyright (c) 2016-present,
-*** Jaguar0625, gimre, BloodyRookie, Tech Bureau, Corp. All rights reserved.
-***
-*** This file is part of Catapult.
-***
-*** Catapult is free software: you can redistribute it and/or modify
-*** it under the terms of the GNU Lesser General Public License as published by
-*** the Free Software Foundation, either version 3 of the License, or
-*** (at your option) any later version.
-***
-*** Catapult is distributed in the hope that it will be useful,
-*** but WITHOUT ANY WARRANTY; without even the implied warranty of
-*** MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-*** GNU Lesser General Public License for more details.
-***
-*** You should have received a copy of the GNU Lesser General Public License
-*** along with Catapult. If not, see .
-**/
-
-import { EntityTypeDto } from './EntityTypeDto';
-import { GeneratorUtils } from './GeneratorUtils';
-import { KeyDto } from './KeyDto';
-import { NetworkTypeDto } from './NetworkTypeDto';
-
-/** Binary layout for an embedded transaction. */
-export class EmbeddedTransactionBuilder {
- /** Entity size. */
- size = 0;
- /** Reserved padding to align end of EmbeddedTransactionHeader on 8-byte boundary. */
- embeddedTransactionHeader_Reserved1: number;
- /** Entity signer's public key. */
- signerPublicKey: KeyDto;
- /** Reserved padding to align end of EntityBody on 8-byte boundary. */
- entityBody_Reserved1: number;
- /** Entity version. */
- version: number;
- /** Entity network. */
- network: NetworkTypeDto;
- /** Entity type. */
- type: EntityTypeDto;
-
- /**
- * Constructor.
- *
- * @param signerPublicKey Entity signer's public key.
- * @param version Entity version.
- * @param network Entity network.
- * @param type Entity type.
- */
- public constructor(signerPublicKey: KeyDto, version: number, network: NetworkTypeDto, type: EntityTypeDto) {
- this.embeddedTransactionHeader_Reserved1 = 0;
- this.signerPublicKey = signerPublicKey;
- this.entityBody_Reserved1 = 0;
- this.version = version;
- this.network = network;
- this.type = type;
- }
-
- /**
- * Creates an instance of EmbeddedTransactionBuilder from binary payload.
- *
- * @param payload Byte payload to use to serialize the object.
- * @return Instance of EmbeddedTransactionBuilder.
- */
- public static loadFromBinary(payload: Uint8Array): EmbeddedTransactionBuilder {
- const byteArray = Array.from(payload);
- const size = GeneratorUtils.bufferToUint(GeneratorUtils.getBytes(Uint8Array.from(byteArray), 4));
- byteArray.splice(0, 4);
- // tslint:disable-next-line: max-line-length
- const embeddedTransactionHeader_Reserved1 = GeneratorUtils.bufferToUint(GeneratorUtils.getBytes(Uint8Array.from(byteArray), 4));
- byteArray.splice(0, 4);
- const signerPublicKey = KeyDto.loadFromBinary(Uint8Array.from(byteArray));
- byteArray.splice(0, signerPublicKey.getSize());
- const entityBody_Reserved1 = GeneratorUtils.bufferToUint(GeneratorUtils.getBytes(Uint8Array.from(byteArray), 4));
- byteArray.splice(0, 4);
- const version = GeneratorUtils.bufferToUint(GeneratorUtils.getBytes(Uint8Array.from(byteArray), 1));
- byteArray.splice(0, 1);
- const network = GeneratorUtils.bufferToUint(GeneratorUtils.getBytes(Uint8Array.from(byteArray), 1));
- byteArray.splice(0, 1);
- const type = GeneratorUtils.bufferToUint(GeneratorUtils.getBytes(Uint8Array.from(byteArray), 2));
- byteArray.splice(0, 2);
- return new EmbeddedTransactionBuilder(signerPublicKey, version, network, type);
- }
-
- /**
- * Gets reserved padding to align end of EmbeddedTransactionHeader on 8-byte boundary.
- *
- * @return Reserved padding to align end of EmbeddedTransactionHeader on 8-byte boundary.
- */
- public getEmbeddedTransactionHeader_Reserved1(): number {
- return this.embeddedTransactionHeader_Reserved1;
- }
-
- /**
- * Gets entity signer's public key.
- *
- * @return Entity signer's public key.
- */
- public getSignerPublicKey(): KeyDto {
- return this.signerPublicKey;
- }
-
- /**
- * Gets reserved padding to align end of EntityBody on 8-byte boundary.
- *
- * @return Reserved padding to align end of EntityBody on 8-byte boundary.
- */
- public getEntityBody_Reserved1(): number {
- return this.entityBody_Reserved1;
- }
-
- /**
- * Gets entity version.
- *
- * @return Entity version.
- */
- public getVersion(): number {
- return this.version;
- }
-
- /**
- * Gets entity network.
- *
- * @return Entity network.
- */
- public getNetwork(): NetworkTypeDto {
- return this.network;
- }
-
- /**
- * Gets entity type.
- *
- * @return Entity type.
- */
- public getType(): EntityTypeDto {
- return this.type;
- }
-
- /**
- * Gets the size of the object.
- *
- * @return Size in bytes.
- */
- public getSize(): number {
- let size = 0;
- size += 4; // size
- size += 4; // embeddedTransactionHeader_Reserved1
- size += this.signerPublicKey.getSize();
- size += 4; // entityBody_Reserved1
- size += 1; // version
- size += 1; // network
- size += 2; // type
- return size;
- }
-
- /**
- * Serializes an object to bytes.
- *
- * @return Serialized bytes.
- */
- public serialize(): Uint8Array {
- let newArray = Uint8Array.from([]);
- const sizeBytes = GeneratorUtils.uintToBuffer(this.getSize(), 4);
- newArray = GeneratorUtils.concatTypedArrays(newArray, sizeBytes);
- // tslint:disable-next-line: max-line-length
- const embeddedTransactionHeader_Reserved1Bytes = GeneratorUtils.uintToBuffer(this.getEmbeddedTransactionHeader_Reserved1(), 4);
- newArray = GeneratorUtils.concatTypedArrays(newArray, embeddedTransactionHeader_Reserved1Bytes);
- const signerPublicKeyBytes = this.signerPublicKey.serialize();
- newArray = GeneratorUtils.concatTypedArrays(newArray, signerPublicKeyBytes);
- const entityBody_Reserved1Bytes = GeneratorUtils.uintToBuffer(this.getEntityBody_Reserved1(), 4);
- newArray = GeneratorUtils.concatTypedArrays(newArray, entityBody_Reserved1Bytes);
- const versionBytes = GeneratorUtils.uintToBuffer(this.getVersion(), 1);
- newArray = GeneratorUtils.concatTypedArrays(newArray, versionBytes);
- const networkBytes = GeneratorUtils.uintToBuffer(this.network, 1);
- newArray = GeneratorUtils.concatTypedArrays(newArray, networkBytes);
- const typeBytes = GeneratorUtils.uintToBuffer(this.type, 2);
- newArray = GeneratorUtils.concatTypedArrays(newArray, typeBytes);
- return newArray;
- }
-}
diff --git a/src/infrastructure/catbuffer/EmbeddedTransactionHelper.ts b/src/infrastructure/catbuffer/EmbeddedTransactionHelper.ts
deleted file mode 100644
index 196a0ae451..0000000000
--- a/src/infrastructure/catbuffer/EmbeddedTransactionHelper.ts
+++ /dev/null
@@ -1,102 +0,0 @@
-// tslint:disable: jsdoc-format
-/**
-*** Copyright (c) 2016-present,
-*** Jaguar0625, gimre, BloodyRookie, Tech Bureau, Corp. All rights reserved.
-***
-*** This file is part of Catapult.
-***
-*** Catapult is free software: you can redistribute it and/or modify
-*** it under the terms of the GNU Lesser General Public License as published by
-*** the Free Software Foundation, either version 3 of the License, or
-*** (at your option) any later version.
-***
-*** Catapult is distributed in the hope that it will be useful,
-*** but WITHOUT ANY WARRANTY; without even the implied warranty of
-*** MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-*** GNU Lesser General Public License for more details.
-***
-*** You should have received a copy of the GNU Lesser General Public License
-*** along with Catapult. If not, see .
-**/
-
-import { EmbeddedAccountAddressRestrictionTransactionBuilder } from './EmbeddedAccountAddressRestrictionTransactionBuilder';
-import { EmbeddedAccountLinkTransactionBuilder } from './EmbeddedAccountLinkTransactionBuilder';
-import { EmbeddedAccountMetadataTransactionBuilder } from './EmbeddedAccountMetadataTransactionBuilder';
-import { EmbeddedAccountMosaicRestrictionTransactionBuilder } from './EmbeddedAccountMosaicRestrictionTransactionBuilder';
-import { EmbeddedAccountOperationRestrictionTransactionBuilder } from './EmbeddedAccountOperationRestrictionTransactionBuilder';
-import { EmbeddedAddressAliasTransactionBuilder } from './EmbeddedAddressAliasTransactionBuilder';
-import { EmbeddedHashLockTransactionBuilder } from './EmbeddedHashLockTransactionBuilder';
-import { EmbeddedMosaicAddressRestrictionTransactionBuilder } from './EmbeddedMosaicAddressRestrictionTransactionBuilder';
-import { EmbeddedMosaicAliasTransactionBuilder } from './EmbeddedMosaicAliasTransactionBuilder';
-import { EmbeddedMosaicDefinitionTransactionBuilder } from './EmbeddedMosaicDefinitionTransactionBuilder';
-import { EmbeddedMosaicGlobalRestrictionTransactionBuilder } from './EmbeddedMosaicGlobalRestrictionTransactionBuilder';
-import { EmbeddedMosaicMetadataTransactionBuilder } from './EmbeddedMosaicMetadataTransactionBuilder';
-import { EmbeddedMosaicSupplyChangeTransactionBuilder } from './EmbeddedMosaicSupplyChangeTransactionBuilder';
-import { EmbeddedMultisigAccountModificationTransactionBuilder } from './EmbeddedMultisigAccountModificationTransactionBuilder';
-import { EmbeddedNamespaceMetadataTransactionBuilder } from './EmbeddedNamespaceMetadataTransactionBuilder';
-import { EmbeddedNamespaceRegistrationTransactionBuilder } from './EmbeddedNamespaceRegistrationTransactionBuilder';
-import { EmbeddedSecretLockTransactionBuilder } from './EmbeddedSecretLockTransactionBuilder';
-import { EmbeddedSecretProofTransactionBuilder } from './EmbeddedSecretProofTransactionBuilder';
-import { EmbeddedTransactionBuilder } from './EmbeddedTransactionBuilder';
-import { EmbeddedTransferTransactionBuilder } from './EmbeddedTransferTransactionBuilder';
-import { EntityTypeDto } from './EntityTypeDto';
-import { GeneratorUtils } from './GeneratorUtils';
-
-export class EmbeddedTransactionHelper {
-
- public static serialize(transaction: EmbeddedTransactionBuilder): Uint8Array {
- const byte = transaction.serialize();
- const padding = new Uint8Array(GeneratorUtils.getTransactionPaddingSize(byte.length, 8));
- return GeneratorUtils.concatTypedArrays(byte, padding);
- }
-
- public static loadFromBinary(bytes: Uint8Array): EmbeddedTransactionBuilder {
- const header = EmbeddedTransactionBuilder.loadFromBinary(bytes);
- switch (header.getType()) {
- case EntityTypeDto.TRANSFER_TRANSACTION_BUILDER:
- return EmbeddedTransferTransactionBuilder.loadFromBinary(bytes);
- case EntityTypeDto.ACCOUNT_LINK_TRANSACTION_BUILDER:
- return EmbeddedAccountLinkTransactionBuilder.loadFromBinary(bytes);
- case EntityTypeDto.HASH_LOCK_TRANSACTION_BUILDER:
- return EmbeddedHashLockTransactionBuilder.loadFromBinary(bytes);
- case EntityTypeDto.SECRET_LOCK_TRANSACTION_BUILDER:
- return EmbeddedSecretLockTransactionBuilder.loadFromBinary(bytes);
- case EntityTypeDto.SECRET_PROOF_TRANSACTION_BUILDER:
- return EmbeddedSecretProofTransactionBuilder.loadFromBinary(bytes);
- case EntityTypeDto.ACCOUNT_METADATA_TRANSACTION_BUILDER:
- return EmbeddedAccountMetadataTransactionBuilder.loadFromBinary(bytes);
- case EntityTypeDto.MOSAIC_METADATA_TRANSACTION_BUILDER:
- return EmbeddedMosaicMetadataTransactionBuilder.loadFromBinary(bytes);
- case EntityTypeDto.NAMESPACE_METADATA_TRANSACTION_BUILDER:
- return EmbeddedNamespaceMetadataTransactionBuilder.loadFromBinary(bytes);
- case EntityTypeDto.MOSAIC_DEFINITION_TRANSACTION_BUILDER:
- return EmbeddedMosaicDefinitionTransactionBuilder.loadFromBinary(bytes);
- case EntityTypeDto.MOSAIC_SUPPLY_CHANGE_TRANSACTION_BUILDER:
- return EmbeddedMosaicSupplyChangeTransactionBuilder.loadFromBinary(bytes);
- case EntityTypeDto.MULTISIG_ACCOUNT_MODIFICATION_TRANSACTION_BUILDER:
- return EmbeddedMultisigAccountModificationTransactionBuilder.loadFromBinary(bytes);
- case EntityTypeDto.ADDRESS_ALIAS_TRANSACTION_BUILDER:
- return EmbeddedAddressAliasTransactionBuilder.loadFromBinary(bytes);
- case EntityTypeDto.MOSAIC_ALIAS_TRANSACTION_BUILDER:
- return EmbeddedMosaicAliasTransactionBuilder.loadFromBinary(bytes);
- case EntityTypeDto.NAMESPACE_REGISTRATION_TRANSACTION_BUILDER:
- return EmbeddedNamespaceRegistrationTransactionBuilder.loadFromBinary(bytes);
- case EntityTypeDto.ACCOUNT_ADDRESS_RESTRICTION_TRANSACTION_BUILDER:
- return EmbeddedAccountAddressRestrictionTransactionBuilder.loadFromBinary(bytes);
- case EntityTypeDto.ACCOUNT_MOSAIC_RESTRICTION_TRANSACTION_BUILDER:
- return EmbeddedAccountMosaicRestrictionTransactionBuilder.loadFromBinary(bytes);
- case EntityTypeDto.ACCOUNT_OPERATION_RESTRICTION_TRANSACTION_BUILDER:
- return EmbeddedAccountOperationRestrictionTransactionBuilder.loadFromBinary(bytes);
- case EntityTypeDto.MOSAIC_ADDRESS_RESTRICTION_TRANSACTION_BUILDER:
- return EmbeddedMosaicAddressRestrictionTransactionBuilder.loadFromBinary(bytes);
- case EntityTypeDto.MOSAIC_GLOBAL_RESTRICTION_TRANSACTION_BUILDER:
- return EmbeddedMosaicGlobalRestrictionTransactionBuilder.loadFromBinary(bytes);
- default:
- throw new Error(`Transaction type: ${header.getType()} not recognized.`);
- }
- }
-
- public static getEmbeddedTransactionSize(transactions: EmbeddedTransactionBuilder[]): number {
- return transactions.map((o) => EmbeddedTransactionHelper.serialize(o).length).reduce((a, b) => a + b, 0);
- }
-}
diff --git a/src/infrastructure/catbuffer/EmbeddedTransferTransactionBuilder.ts b/src/infrastructure/catbuffer/EmbeddedTransferTransactionBuilder.ts
deleted file mode 100644
index 1f69de9dd7..0000000000
--- a/src/infrastructure/catbuffer/EmbeddedTransferTransactionBuilder.ts
+++ /dev/null
@@ -1,129 +0,0 @@
-// tslint:disable: jsdoc-format
-/**
-*** Copyright (c) 2016-present,
-*** Jaguar0625, gimre, BloodyRookie, Tech Bureau, Corp. All rights reserved.
-***
-*** This file is part of Catapult.
-***
-*** Catapult is free software: you can redistribute it and/or modify
-*** it under the terms of the GNU Lesser General Public License as published by
-*** the Free Software Foundation, either version 3 of the License, or
-*** (at your option) any later version.
-***
-*** Catapult is distributed in the hope that it will be useful,
-*** but WITHOUT ANY WARRANTY; without even the implied warranty of
-*** MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-*** GNU Lesser General Public License for more details.
-***
-*** You should have received a copy of the GNU Lesser General Public License
-*** along with Catapult. If not, see .
-**/
-
-import { EmbeddedTransactionBuilder } from './EmbeddedTransactionBuilder';
-import { EntityTypeDto } from './EntityTypeDto';
-import { GeneratorUtils } from './GeneratorUtils';
-import { KeyDto } from './KeyDto';
-import { NetworkTypeDto } from './NetworkTypeDto';
-import { TransferTransactionBodyBuilder } from './TransferTransactionBodyBuilder';
-import { UnresolvedAddressDto } from './UnresolvedAddressDto';
-import { UnresolvedMosaicBuilder } from './UnresolvedMosaicBuilder';
-
-/** Binary layout for an embedded transfer transaction. */
-export class EmbeddedTransferTransactionBuilder extends EmbeddedTransactionBuilder {
- /** Transfer transaction body. */
- transferTransactionBody: TransferTransactionBodyBuilder;
-
- /**
- * Constructor.
- *
- * @param signerPublicKey Entity signer's public key.
- * @param version Entity version.
- * @param network Entity network.
- * @param type Entity type.
- * @param recipientAddress Recipient address.
- * @param mosaics Attached mosaics.
- * @param message Attached message.
- */
- // tslint:disable-next-line: max-line-length
- public constructor(signerPublicKey: KeyDto, version: number, network: NetworkTypeDto, type: EntityTypeDto, recipientAddress: UnresolvedAddressDto, mosaics: UnresolvedMosaicBuilder[], message: Uint8Array) {
- super(signerPublicKey, version, network, type);
- this.transferTransactionBody = new TransferTransactionBodyBuilder(recipientAddress, mosaics, message);
- }
-
- /**
- * Creates an instance of EmbeddedTransferTransactionBuilder from binary payload.
- *
- * @param payload Byte payload to use to serialize the object.
- * @return Instance of EmbeddedTransferTransactionBuilder.
- */
- public static loadFromBinary(payload: Uint8Array): EmbeddedTransferTransactionBuilder {
- const byteArray = Array.from(payload);
- const superObject = EmbeddedTransactionBuilder.loadFromBinary(Uint8Array.from(byteArray));
- byteArray.splice(0, superObject.getSize());
- const transferTransactionBody = TransferTransactionBodyBuilder.loadFromBinary(Uint8Array.from(byteArray));
- byteArray.splice(0, transferTransactionBody.getSize());
- // tslint:disable-next-line: max-line-length
- return new EmbeddedTransferTransactionBuilder(superObject.signerPublicKey, superObject.version, superObject.network, superObject.type, transferTransactionBody.recipientAddress, transferTransactionBody.mosaics, transferTransactionBody.message);
- }
-
- /**
- * Gets recipient address.
- *
- * @return Recipient address.
- */
- public getRecipientAddress(): UnresolvedAddressDto {
- return this.transferTransactionBody.getRecipientAddress();
- }
-
- /**
- * Gets reserved padding to align mosaics on 8-byte boundary.
- *
- * @return Reserved padding to align mosaics on 8-byte boundary.
- */
- public getTransferTransactionBody_Reserved1(): number {
- return this.transferTransactionBody.getTransferTransactionBody_Reserved1();
- }
-
- /**
- * Gets attached mosaics.
- *
- * @return Attached mosaics.
- */
- public getMosaics(): UnresolvedMosaicBuilder[] {
- return this.transferTransactionBody.getMosaics();
- }
-
- /**
- * Gets attached message.
- *
- * @return Attached message.
- */
- public getMessage(): Uint8Array {
- return this.transferTransactionBody.getMessage();
- }
-
- /**
- * Gets the size of the object.
- *
- * @return Size in bytes.
- */
- public getSize(): number {
- let size: number = super.getSize();
- size += this.transferTransactionBody.getSize();
- return size;
- }
-
- /**
- * Serializes an object to bytes.
- *
- * @return Serialized bytes.
- */
- public serialize(): Uint8Array {
- let newArray = Uint8Array.from([]);
- const superBytes = super.serialize();
- newArray = GeneratorUtils.concatTypedArrays(newArray, superBytes);
- const transferTransactionBodyBytes = this.transferTransactionBody.serialize();
- newArray = GeneratorUtils.concatTypedArrays(newArray, transferTransactionBodyBytes);
- return newArray;
- }
-}
diff --git a/src/infrastructure/catbuffer/EntityTypeDto.ts b/src/infrastructure/catbuffer/EntityTypeDto.ts
deleted file mode 100644
index 4399620a5c..0000000000
--- a/src/infrastructure/catbuffer/EntityTypeDto.ts
+++ /dev/null
@@ -1,69 +0,0 @@
-// tslint:disable: jsdoc-format
-/**
-*** Copyright (c) 2016-present,
-*** Jaguar0625, gimre, BloodyRookie, Tech Bureau, Corp. All rights reserved.
-***
-*** This file is part of Catapult.
-***
-*** Catapult is free software: you can redistribute it and/or modify
-*** it under the terms of the GNU Lesser General Public License as published by
-*** the Free Software Foundation, either version 3 of the License, or
-*** (at your option) any later version.
-***
-*** Catapult is distributed in the hope that it will be useful,
-*** but WITHOUT ANY WARRANTY; without even the implied warranty of
-*** MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-*** GNU Lesser General Public License for more details.
-***
-*** You should have received a copy of the GNU Lesser General Public License
-*** along with Catapult. If not, see .
-**/
-
-
-/** Enumeration of entity types. */
-export enum EntityTypeDto {
- /** Reserved entity type. */
- RESERVED = 0,
- /** Transfer transaction builder. */
- TRANSFER_TRANSACTION_BUILDER = 16724,
- /** Account link transaction builder. */
- ACCOUNT_LINK_TRANSACTION_BUILDER = 16716,
- /** Hash lock transaction builder. */
- HASH_LOCK_TRANSACTION_BUILDER = 16712,
- /** Secret lock transaction builder. */
- SECRET_LOCK_TRANSACTION_BUILDER = 16722,
- /** Secret proof transaction builder. */
- SECRET_PROOF_TRANSACTION_BUILDER = 16978,
- /** Account metadata transaction builder. */
- ACCOUNT_METADATA_TRANSACTION_BUILDER = 16708,
- /** Mosaic metadata transaction builder. */
- MOSAIC_METADATA_TRANSACTION_BUILDER = 16964,
- /** Namespace metadata transaction builder. */
- NAMESPACE_METADATA_TRANSACTION_BUILDER = 17220,
- /** Mosaic definition transaction builder. */
- MOSAIC_DEFINITION_TRANSACTION_BUILDER = 16717,
- /** Mosaic supply change transaction builder. */
- MOSAIC_SUPPLY_CHANGE_TRANSACTION_BUILDER = 16973,
- /** Multisig account modification transaction builder. */
- MULTISIG_ACCOUNT_MODIFICATION_TRANSACTION_BUILDER = 16725,
- /** Address alias transaction builder. */
- ADDRESS_ALIAS_TRANSACTION_BUILDER = 16974,
- /** Mosaic alias transaction builder. */
- MOSAIC_ALIAS_TRANSACTION_BUILDER = 17230,
- /** Namespace registration transaction builder. */
- NAMESPACE_REGISTRATION_TRANSACTION_BUILDER = 16718,
- /** Account address restriction transaction builder. */
- ACCOUNT_ADDRESS_RESTRICTION_TRANSACTION_BUILDER = 16720,
- /** Account mosaic restriction transaction builder. */
- ACCOUNT_MOSAIC_RESTRICTION_TRANSACTION_BUILDER = 16976,
- /** Account operation restriction transaction builder. */
- ACCOUNT_OPERATION_RESTRICTION_TRANSACTION_BUILDER = 17232,
- /** Mosaic address restriction transaction builder. */
- MOSAIC_ADDRESS_RESTRICTION_TRANSACTION_BUILDER = 16977,
- /** Mosaic global restriction transaction builder. */
- MOSAIC_GLOBAL_RESTRICTION_TRANSACTION_BUILDER = 16721,
- /** Aggregate complete transaction builder. */
- AGGREGATE_COMPLETE_TRANSACTION_BUILDER = 16705,
- /** Aggregate bonded transaction builder. */
- AGGREGATE_BONDED_TRANSACTION_BUILDER = 16961,
-}
diff --git a/src/infrastructure/catbuffer/GeneratorUtils.ts b/src/infrastructure/catbuffer/GeneratorUtils.ts
deleted file mode 100644
index 74399315e0..0000000000
--- a/src/infrastructure/catbuffer/GeneratorUtils.ts
+++ /dev/null
@@ -1,157 +0,0 @@
-// tslint:disable: jsdoc-format
-/**
-*** Copyright (c) 2016-present,
-*** Jaguar0625, gimre, BloodyRookie, Tech Bureau, Corp. All rights reserved.
-***
-*** This file is part of Catapult.
-***
-*** Catapult is free software: you can redistribute it and/or modify
-*** it under the terms of the GNU Lesser General Public License as published by
-*** the Free Software Foundation, either version 3 of the License, or
-*** (at your option) any later version.
-***
-*** Catapult is distributed in the hope that it will be useful,
-*** but WITHOUT ANY WARRANTY; without even the implied warranty of
-*** MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-*** GNU Lesser General Public License for more details.
-***
-*** You should have received a copy of the GNU Lesser General Public License
-*** along with Catapult. If not, see .
-**/
-
-/**
- * Generator utility class.
- */
-export class GeneratorUtils {
-
- /**
- * Convert a UInt8Array input into an array of 2 numbers.
- * Numbers in the returned array are cast to UInt32.
- * @param {Uint8Array} input A uint8 array.
- * @returns {number[]} The uint64 representation of the input.
- */
- public static bufferToUint64(input: Uint8Array): number[] {
- if (8 !== input.length) {
- throw Error(`byte array has unexpected size '${input.length}'`);
- }
- input = input.reverse();
- const view = new DataView(input.buffer);
- return [view.getUint32(4), view.getUint32(0)];
- }
-
- /**
- * Read 4 bytes as a uint32 value from buffer bytes starting at given index.
- * @param {Uint8Array} bytes A uint8 array.
- * @param {number} index Index.
- * @returns {number} 32bits integer.
- */
- public static readUint32At(bytes: Uint8Array, index: number): number {
- return (bytes[index] + (bytes[index + 1] << 8) + (bytes[index + 2] << 16) + (bytes[index + 3] << 24)) >>> 0;
- }
-
- /**
- * Convert uint value into buffer
- * @param {number} uintValue A uint8 array.
- * @param {number} bufferSize Buffer size.
- * @returns {Uint8Array}
- */
- public static uintToBuffer(uintValue: number, bufferSize: number): Uint8Array {
- const buffer = new ArrayBuffer(bufferSize);
- const dataView = new DataView(buffer);
- try {
- if (1 === bufferSize) {
- dataView.setUint8(0, uintValue);
- } else if (2 === bufferSize) {
- dataView.setUint16(0, uintValue, true);
- } else if (4 === bufferSize) {
- dataView.setUint32(0, uintValue, true);
- } else {
- throw new Error('Unexpected bufferSize');
- }
- return new Uint8Array(buffer);
- }
- catch (e) {
- throw new Error(`Converting uint value ${uintValue} into buffer with error: ${e}`);
- }
- }
-
- /**
- * Convert uint8 array buffer into number
- * @param {Uint8Array} buffer A uint8 array.
- * @returns {number}
- */
- public static bufferToUint(buffer: Uint8Array): number {
- const dataView = new DataView(buffer.buffer);
- try {
- if (1 === buffer.byteLength) {
- return dataView.getUint8(0);
- } else if (2 === buffer.byteLength) {
- return dataView.getUint16(0, true);
- } else if (4 === buffer.byteLength) {
- return dataView.getUint32(0, true);
- }
- throw new Error('Unexpected buffer size');
- }
- catch (e) {
- throw new Error(`Converting buffer into number with error: ${e}`);
- }
- }
-
- /**
- * Convert unit64 into buffer
- * @param {number} uintValue Uint64 (number[]).
- * @returns {Uint8Array}
- */
- public static uint64ToBuffer(uintValue: number[]): Uint8Array {
- const uint32Array = new Uint32Array(uintValue);
- return new Uint8Array(uint32Array.buffer);
- }
-
- /**
- * Concatenate two arrays
- * @param {Uint8Array} array1 A Uint8Array.
- * @param {Uint8Array} array2 A Uint8Array.
- * @returns {Uint8Array}
- */
- public static concatTypedArrays(array1: Uint8Array, array2: Uint8Array): Uint8Array {
- const newArray = new Uint8Array(array1.length + array2.length);
- newArray.set(array1);
- newArray.set(array2, array1.length);
- return newArray;
- }
-
- /** Converts an unsigned byte to a signed byte with the same binary representation.
- * @param {number} input An unsigned byte.
- * @returns {number} A signed byte with the same binary representation as the input.
- *
- */
- public static uint8ToInt8 = (input: number): number => {
- if (0xFF < input) {
- throw Error(`input '${input}' is out of range`);
- }
- return input << 24 >> 24;
- }
-
- /** Get bytes by given sub array size.
- * @param {Uint8Array} binary Binary bytes array.
- * @param {number} size Subarray size.
- * @returns {Uint8Array}
- *
- */
- public static getBytes(binary: Uint8Array, size: number): Uint8Array {
- if (size > binary.length) {
- throw new RangeError();
- }
- const bytes = binary.slice(0, size);
- return bytes;
- }
-
- /**
- * Gets the padding size that rounds up \a size to the next multiple of \a alignment.
- * @param size Inner transaction size
- * @param alignment Next multiple alignment
- */
- public static getTransactionPaddingSize(size: number, alignment: number): number {
- return 0 === size % alignment ? 0 : alignment - (size % alignment);
- }
-}
diff --git a/src/infrastructure/catbuffer/Hash256Dto.ts b/src/infrastructure/catbuffer/Hash256Dto.ts
deleted file mode 100644
index 0f09dfda19..0000000000
--- a/src/infrastructure/catbuffer/Hash256Dto.ts
+++ /dev/null
@@ -1,79 +0,0 @@
-// tslint:disable: jsdoc-format
-/**
-*** Copyright (c) 2016-present,
-*** Jaguar0625, gimre, BloodyRookie, Tech Bureau, Corp. All rights reserved.
-***
-*** This file is part of Catapult.
-***
-*** Catapult is free software: you can redistribute it and/or modify
-*** it under the terms of the GNU Lesser General Public License as published by
-*** the Free Software Foundation, either version 3 of the License, or
-*** (at your option) any later version.
-***
-*** Catapult is distributed in the hope that it will be useful,
-*** but WITHOUT ANY WARRANTY; without even the implied warranty of
-*** MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-*** GNU Lesser General Public License for more details.
-***
-*** You should have received a copy of the GNU Lesser General Public License
-*** along with Catapult. If not, see .
-**/
-
-import { GeneratorUtils } from './GeneratorUtils';
-
-/** Hash256. */
-export class Hash256Dto {
- /** Hash256. */
- hash256: Uint8Array;
-
- /**
- * Constructor.
- *
- * @param hash256 Hash256.
- */
- constructor(hash256: Uint8Array) {
- this.hash256 = hash256;
- }
-
- /**
- * Creates an instance of Hash256Dto from binary payload.
- *
- * @param payload Byte payload to use to serialize the object.
- * @return Instance of Hash256Dto.
- */
- public static loadFromBinary(payload: Uint8Array): Hash256Dto {
- const byteArray = Array.from(payload);
- const hash256 = GeneratorUtils.getBytes(Uint8Array.from(byteArray), 32);
- byteArray.splice(0, 32);
- return new Hash256Dto(hash256);
- }
-
- /**
- * Gets Hash256.
- *
- * @return Hash256.
- */
- public getHash256(): Uint8Array {
- return this.hash256;
- }
-
- /**
- * Gets the size of the object.
- *
- * @return Size in bytes.
- */
- public getSize(): number {
- return 32;
- }
-
- /**
- * Serializes an object to bytes.
- *
- * @return Serialized bytes.
- */
- public serialize(): Uint8Array {
- let newArray = Uint8Array.from([]);
- newArray = GeneratorUtils.concatTypedArrays(newArray, this.hash256);
- return newArray;
- }
-}
diff --git a/src/infrastructure/catbuffer/Hash512Dto.ts b/src/infrastructure/catbuffer/Hash512Dto.ts
deleted file mode 100644
index 1455eb7623..0000000000
--- a/src/infrastructure/catbuffer/Hash512Dto.ts
+++ /dev/null
@@ -1,79 +0,0 @@
-// tslint:disable: jsdoc-format
-/**
-*** Copyright (c) 2016-present,
-*** Jaguar0625, gimre, BloodyRookie, Tech Bureau, Corp. All rights reserved.
-***
-*** This file is part of Catapult.
-***
-*** Catapult is free software: you can redistribute it and/or modify
-*** it under the terms of the GNU Lesser General Public License as published by
-*** the Free Software Foundation, either version 3 of the License, or
-*** (at your option) any later version.
-***
-*** Catapult is distributed in the hope that it will be useful,
-*** but WITHOUT ANY WARRANTY; without even the implied warranty of
-*** MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-*** GNU Lesser General Public License for more details.
-***
-*** You should have received a copy of the GNU Lesser General Public License
-*** along with Catapult. If not, see .
-**/
-
-import { GeneratorUtils } from './GeneratorUtils';
-
-/** Hash512. */
-export class Hash512Dto {
- /** Hash512. */
- hash512: Uint8Array;
-
- /**
- * Constructor.
- *
- * @param hash512 Hash512.
- */
- constructor(hash512: Uint8Array) {
- this.hash512 = hash512;
- }
-
- /**
- * Creates an instance of Hash512Dto from binary payload.
- *
- * @param payload Byte payload to use to serialize the object.
- * @return Instance of Hash512Dto.
- */
- public static loadFromBinary(payload: Uint8Array): Hash512Dto {
- const byteArray = Array.from(payload);
- const hash512 = GeneratorUtils.getBytes(Uint8Array.from(byteArray), 64);
- byteArray.splice(0, 64);
- return new Hash512Dto(hash512);
- }
-
- /**
- * Gets Hash512.
- *
- * @return Hash512.
- */
- public getHash512(): Uint8Array {
- return this.hash512;
- }
-
- /**
- * Gets the size of the object.
- *
- * @return Size in bytes.
- */
- public getSize(): number {
- return 64;
- }
-
- /**
- * Serializes an object to bytes.
- *
- * @return Serialized bytes.
- */
- public serialize(): Uint8Array {
- let newArray = Uint8Array.from([]);
- newArray = GeneratorUtils.concatTypedArrays(newArray, this.hash512);
- return newArray;
- }
-}
diff --git a/src/infrastructure/catbuffer/HashLockTransactionBodyBuilder.ts b/src/infrastructure/catbuffer/HashLockTransactionBodyBuilder.ts
deleted file mode 100644
index 26d8158335..0000000000
--- a/src/infrastructure/catbuffer/HashLockTransactionBodyBuilder.ts
+++ /dev/null
@@ -1,121 +0,0 @@
-// tslint:disable: jsdoc-format
-/**
-*** Copyright (c) 2016-present,
-*** Jaguar0625, gimre, BloodyRookie, Tech Bureau, Corp. All rights reserved.
-***
-*** This file is part of Catapult.
-***
-*** Catapult is free software: you can redistribute it and/or modify
-*** it under the terms of the GNU Lesser General Public License as published by
-*** the Free Software Foundation, either version 3 of the License, or
-*** (at your option) any later version.
-***
-*** Catapult is distributed in the hope that it will be useful,
-*** but WITHOUT ANY WARRANTY; without even the implied warranty of
-*** MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-*** GNU Lesser General Public License for more details.
-***
-*** You should have received a copy of the GNU Lesser General Public License
-*** along with Catapult. If not, see .
-**/
-
-import { BlockDurationDto } from './BlockDurationDto';
-import { GeneratorUtils } from './GeneratorUtils';
-import { Hash256Dto } from './Hash256Dto';
-import { UnresolvedMosaicBuilder } from './UnresolvedMosaicBuilder';
-
-/** Binary layout for a hash lock transaction. */
-export class HashLockTransactionBodyBuilder {
- /** Lock mosaic. */
- mosaic: UnresolvedMosaicBuilder;
- /** Number of blocks for which a lock should be valid. */
- duration: BlockDurationDto;
- /** Lock hash. */
- hash: Hash256Dto;
-
- /**
- * Constructor.
- *
- * @param mosaic Lock mosaic.
- * @param duration Number of blocks for which a lock should be valid.
- * @param hash Lock hash.
- */
- public constructor(mosaic: UnresolvedMosaicBuilder, duration: BlockDurationDto, hash: Hash256Dto) {
- this.mosaic = mosaic;
- this.duration = duration;
- this.hash = hash;
- }
-
- /**
- * Creates an instance of HashLockTransactionBodyBuilder from binary payload.
- *
- * @param payload Byte payload to use to serialize the object.
- * @return Instance of HashLockTransactionBodyBuilder.
- */
- public static loadFromBinary(payload: Uint8Array): HashLockTransactionBodyBuilder {
- const byteArray = Array.from(payload);
- const mosaic = UnresolvedMosaicBuilder.loadFromBinary(Uint8Array.from(byteArray));
- byteArray.splice(0, mosaic.getSize());
- const duration = BlockDurationDto.loadFromBinary(Uint8Array.from(byteArray));
- byteArray.splice(0, duration.getSize());
- const hash = Hash256Dto.loadFromBinary(Uint8Array.from(byteArray));
- byteArray.splice(0, hash.getSize());
- return new HashLockTransactionBodyBuilder(mosaic, duration, hash);
- }
-
- /**
- * Gets lock mosaic.
- *
- * @return Lock mosaic.
- */
- public getMosaic(): UnresolvedMosaicBuilder {
- return this.mosaic;
- }
-
- /**
- * Gets number of blocks for which a lock should be valid.
- *
- * @return Number of blocks for which a lock should be valid.
- */
- public getDuration(): BlockDurationDto {
- return this.duration;
- }
-
- /**
- * Gets lock hash.
- *
- * @return Lock hash.
- */
- public getHash(): Hash256Dto {
- return this.hash;
- }
-
- /**
- * Gets the size of the object.
- *
- * @return Size in bytes.
- */
- public getSize(): number {
- let size = 0;
- size += this.mosaic.getSize();
- size += this.duration.getSize();
- size += this.hash.getSize();
- return size;
- }
-
- /**
- * Serializes an object to bytes.
- *
- * @return Serialized bytes.
- */
- public serialize(): Uint8Array {
- let newArray = Uint8Array.from([]);
- const mosaicBytes = this.mosaic.serialize();
- newArray = GeneratorUtils.concatTypedArrays(newArray, mosaicBytes);
- const durationBytes = this.duration.serialize();
- newArray = GeneratorUtils.concatTypedArrays(newArray, durationBytes);
- const hashBytes = this.hash.serialize();
- newArray = GeneratorUtils.concatTypedArrays(newArray, hashBytes);
- return newArray;
- }
-}
diff --git a/src/infrastructure/catbuffer/HashLockTransactionBuilder.ts b/src/infrastructure/catbuffer/HashLockTransactionBuilder.ts
deleted file mode 100644
index e0fa90a301..0000000000
--- a/src/infrastructure/catbuffer/HashLockTransactionBuilder.ts
+++ /dev/null
@@ -1,127 +0,0 @@
-// tslint:disable: jsdoc-format
-/**
-*** Copyright (c) 2016-present,
-*** Jaguar0625, gimre, BloodyRookie, Tech Bureau, Corp. All rights reserved.
-***
-*** This file is part of Catapult.
-***
-*** Catapult is free software: you can redistribute it and/or modify
-*** it under the terms of the GNU Lesser General Public License as published by
-*** the Free Software Foundation, either version 3 of the License, or
-*** (at your option) any later version.
-***
-*** Catapult is distributed in the hope that it will be useful,
-*** but WITHOUT ANY WARRANTY; without even the implied warranty of
-*** MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-*** GNU Lesser General Public License for more details.
-***
-*** You should have received a copy of the GNU Lesser General Public License
-*** along with Catapult. If not, see .
-**/
-
-import { AmountDto } from './AmountDto';
-import { BlockDurationDto } from './BlockDurationDto';
-import { EntityTypeDto } from './EntityTypeDto';
-import { GeneratorUtils } from './GeneratorUtils';
-import { Hash256Dto } from './Hash256Dto';
-import { HashLockTransactionBodyBuilder } from './HashLockTransactionBodyBuilder';
-import { KeyDto } from './KeyDto';
-import { NetworkTypeDto } from './NetworkTypeDto';
-import { SignatureDto } from './SignatureDto';
-import { TimestampDto } from './TimestampDto';
-import { TransactionBuilder } from './TransactionBuilder';
-import { UnresolvedMosaicBuilder } from './UnresolvedMosaicBuilder';
-
-/** Binary layout for a non-embedded hash lock transaction. */
-export class HashLockTransactionBuilder extends TransactionBuilder {
- /** Hash lock transaction body. */
- hashLockTransactionBody: HashLockTransactionBodyBuilder;
-
- /**
- * Constructor.
- *
- * @param signature Entity signature.
- * @param signerPublicKey Entity signer's public key.
- * @param version Entity version.
- * @param network Entity network.
- * @param type Entity type.
- * @param fee Transaction fee.
- * @param deadline Transaction deadline.
- * @param mosaic Lock mosaic.
- * @param duration Number of blocks for which a lock should be valid.
- * @param hash Lock hash.
- */
- // tslint:disable-next-line: max-line-length
- public constructor(signature: SignatureDto, signerPublicKey: KeyDto, version: number, network: NetworkTypeDto, type: EntityTypeDto, fee: AmountDto, deadline: TimestampDto, mosaic: UnresolvedMosaicBuilder, duration: BlockDurationDto, hash: Hash256Dto) {
- super(signature, signerPublicKey, version, network, type, fee, deadline);
- this.hashLockTransactionBody = new HashLockTransactionBodyBuilder(mosaic, duration, hash);
- }
-
- /**
- * Creates an instance of HashLockTransactionBuilder from binary payload.
- *
- * @param payload Byte payload to use to serialize the object.
- * @return Instance of HashLockTransactionBuilder.
- */
- public static loadFromBinary(payload: Uint8Array): HashLockTransactionBuilder {
- const byteArray = Array.from(payload);
- const superObject = TransactionBuilder.loadFromBinary(Uint8Array.from(byteArray));
- byteArray.splice(0, superObject.getSize());
- const hashLockTransactionBody = HashLockTransactionBodyBuilder.loadFromBinary(Uint8Array.from(byteArray));
- byteArray.splice(0, hashLockTransactionBody.getSize());
- // tslint:disable-next-line: max-line-length
- return new HashLockTransactionBuilder(superObject.signature, superObject.signerPublicKey, superObject.version, superObject.network, superObject.type, superObject.fee, superObject.deadline, hashLockTransactionBody.mosaic, hashLockTransactionBody.duration, hashLockTransactionBody.hash);
- }
-
- /**
- * Gets lock mosaic.
- *
- * @return Lock mosaic.
- */
- public getMosaic(): UnresolvedMosaicBuilder {
- return this.hashLockTransactionBody.getMosaic();
- }
-
- /**
- * Gets number of blocks for which a lock should be valid.
- *
- * @return Number of blocks for which a lock should be valid.
- */
- public getDuration(): BlockDurationDto {
- return this.hashLockTransactionBody.getDuration();
- }
-
- /**
- * Gets lock hash.
- *
- * @return Lock hash.
- */
- public getHash(): Hash256Dto {
- return this.hashLockTransactionBody.getHash();
- }
-
- /**
- * Gets the size of the object.
- *
- * @return Size in bytes.
- */
- public getSize(): number {
- let size: number = super.getSize();
- size += this.hashLockTransactionBody.getSize();
- return size;
- }
-
- /**
- * Serializes an object to bytes.
- *
- * @return Serialized bytes.
- */
- public serialize(): Uint8Array {
- let newArray = Uint8Array.from([]);
- const superBytes = super.serialize();
- newArray = GeneratorUtils.concatTypedArrays(newArray, superBytes);
- const hashLockTransactionBodyBytes = this.hashLockTransactionBody.serialize();
- newArray = GeneratorUtils.concatTypedArrays(newArray, hashLockTransactionBodyBytes);
- return newArray;
- }
-}
diff --git a/src/infrastructure/catbuffer/HeightDto.ts b/src/infrastructure/catbuffer/HeightDto.ts
deleted file mode 100644
index be209d4aca..0000000000
--- a/src/infrastructure/catbuffer/HeightDto.ts
+++ /dev/null
@@ -1,80 +0,0 @@
-// tslint:disable: jsdoc-format
-/**
-*** Copyright (c) 2016-present,
-*** Jaguar0625, gimre, BloodyRookie, Tech Bureau, Corp. All rights reserved.
-***
-*** This file is part of Catapult.
-***
-*** Catapult is free software: you can redistribute it and/or modify
-*** it under the terms of the GNU Lesser General Public License as published by
-*** the Free Software Foundation, either version 3 of the License, or
-*** (at your option) any later version.
-***
-*** Catapult is distributed in the hope that it will be useful,
-*** but WITHOUT ANY WARRANTY; without even the implied warranty of
-*** MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-*** GNU Lesser General Public License for more details.
-***
-*** You should have received a copy of the GNU Lesser General Public License
-*** along with Catapult. If not, see .
-**/
-
-import { GeneratorUtils } from './GeneratorUtils';
-
-/** Height. */
-export class HeightDto {
- /** Height. */
- height: number[];
-
- /**
- * Constructor.
- *
- * @param height Height.
- */
- constructor(height: number[]) {
- this.height = height;
- }
-
- /**
- * Creates an instance of HeightDto from binary payload.
- *
- * @param payload Byte payload to use to serialize the object.
- * @return Instance of HeightDto.
- */
- public static loadFromBinary(payload: Uint8Array): HeightDto {
- const byteArray = Array.from(payload);
- const height = GeneratorUtils.bufferToUint64(GeneratorUtils.getBytes(Uint8Array.from(byteArray), 8));
- byteArray.splice(0, 8);
- return new HeightDto(height);
- }
-
- /**
- * Gets Height.
- *
- * @return Height.
- */
- public getHeight(): number[] {
- return this.height;
- }
-
- /**
- * Gets the size of the object.
- *
- * @return Size in bytes.
- */
- public getSize(): number {
- return 8;
- }
-
- /**
- * Serializes an object to bytes.
- *
- * @return Serialized bytes.
- */
- public serialize(): Uint8Array {
- let newArray = Uint8Array.from([]);
- const heightBytes = GeneratorUtils.uint64ToBuffer(this.getHeight());
- newArray = GeneratorUtils.concatTypedArrays(newArray, heightBytes);
- return newArray;
- }
-}
diff --git a/src/infrastructure/catbuffer/InflationReceiptBuilder.ts b/src/infrastructure/catbuffer/InflationReceiptBuilder.ts
deleted file mode 100644
index d9d12527ec..0000000000
--- a/src/infrastructure/catbuffer/InflationReceiptBuilder.ts
+++ /dev/null
@@ -1,92 +0,0 @@
-// tslint:disable: jsdoc-format
-/**
-*** Copyright (c) 2016-present,
-*** Jaguar0625, gimre, BloodyRookie, Tech Bureau, Corp. All rights reserved.
-***
-*** This file is part of Catapult.
-***
-*** Catapult is free software: you can redistribute it and/or modify
-*** it under the terms of the GNU Lesser General Public License as published by
-*** the Free Software Foundation, either version 3 of the License, or
-*** (at your option) any later version.
-***
-*** Catapult is distributed in the hope that it will be useful,
-*** but WITHOUT ANY WARRANTY; without even the implied warranty of
-*** MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-*** GNU Lesser General Public License for more details.
-***
-*** You should have received a copy of the GNU Lesser General Public License
-*** along with Catapult. If not, see .
-**/
-
-import { GeneratorUtils } from './GeneratorUtils';
-import { MosaicBuilder } from './MosaicBuilder';
-import { ReceiptBuilder } from './ReceiptBuilder';
-import { ReceiptTypeDto } from './ReceiptTypeDto';
-
-/** Binary layout for an inflation receipt. */
-export class InflationReceiptBuilder extends ReceiptBuilder {
- /** Mosaic. */
- mosaic: MosaicBuilder;
-
- /**
- * Constructor.
- *
- * @param version Receipt version.
- * @param type Receipt type.
- * @param mosaic Mosaic.
- */
- public constructor(version: number, type: ReceiptTypeDto, mosaic: MosaicBuilder) {
- super(version, type);
- this.mosaic = mosaic;
- }
-
- /**
- * Creates an instance of InflationReceiptBuilder from binary payload.
- *
- * @param payload Byte payload to use to serialize the object.
- * @return Instance of InflationReceiptBuilder.
- */
- public static loadFromBinary(payload: Uint8Array): InflationReceiptBuilder {
- const byteArray = Array.from(payload);
- const superObject = ReceiptBuilder.loadFromBinary(Uint8Array.from(byteArray));
- byteArray.splice(0, superObject.getSize());
- const mosaic = MosaicBuilder.loadFromBinary(Uint8Array.from(byteArray));
- byteArray.splice(0, mosaic.getSize());
- return new InflationReceiptBuilder(superObject.version, superObject.type, mosaic);
- }
-
- /**
- * Gets mosaic.
- *
- * @return Mosaic.
- */
- public getMosaic(): MosaicBuilder {
- return this.mosaic;
- }
-
- /**
- * Gets the size of the object.
- *
- * @return Size in bytes.
- */
- public getSize(): number {
- let size: number = super.getSize();
- size += this.mosaic.getSize();
- return size;
- }
-
- /**
- * Serializes an object to bytes.
- *
- * @return Serialized bytes.
- */
- public serialize(): Uint8Array {
- let newArray = Uint8Array.from([]);
- const superBytes = super.serialize();
- newArray = GeneratorUtils.concatTypedArrays(newArray, superBytes);
- const mosaicBytes = this.mosaic.serialize();
- newArray = GeneratorUtils.concatTypedArrays(newArray, mosaicBytes);
- return newArray;
- }
-}
diff --git a/src/infrastructure/catbuffer/KeyDto.ts b/src/infrastructure/catbuffer/KeyDto.ts
deleted file mode 100644
index ea1fb55242..0000000000
--- a/src/infrastructure/catbuffer/KeyDto.ts
+++ /dev/null
@@ -1,79 +0,0 @@
-// tslint:disable: jsdoc-format
-/**
-*** Copyright (c) 2016-present,
-*** Jaguar0625, gimre, BloodyRookie, Tech Bureau, Corp. All rights reserved.
-***
-*** This file is part of Catapult.
-***
-*** Catapult is free software: you can redistribute it and/or modify
-*** it under the terms of the GNU Lesser General Public License as published by
-*** the Free Software Foundation, either version 3 of the License, or
-*** (at your option) any later version.
-***
-*** Catapult is distributed in the hope that it will be useful,
-*** but WITHOUT ANY WARRANTY; without even the implied warranty of
-*** MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-*** GNU Lesser General Public License for more details.
-***
-*** You should have received a copy of the GNU Lesser General Public License
-*** along with Catapult. If not, see .
-**/
-
-import { GeneratorUtils } from './GeneratorUtils';
-
-/** Key. */
-export class KeyDto {
- /** Key. */
- key: Uint8Array;
-
- /**
- * Constructor.
- *
- * @param key Key.
- */
- constructor(key: Uint8Array) {
- this.key = key;
- }
-
- /**
- * Creates an instance of KeyDto from binary payload.
- *
- * @param payload Byte payload to use to serialize the object.
- * @return Instance of KeyDto.
- */
- public static loadFromBinary(payload: Uint8Array): KeyDto {
- const byteArray = Array.from(payload);
- const key = GeneratorUtils.getBytes(Uint8Array.from(byteArray), 32);
- byteArray.splice(0, 32);
- return new KeyDto(key);
- }
-
- /**
- * Gets Key.
- *
- * @return Key.
- */
- public getKey(): Uint8Array {
- return this.key;
- }
-
- /**
- * Gets the size of the object.
- *
- * @return Size in bytes.
- */
- public getSize(): number {
- return 32;
- }
-
- /**
- * Serializes an object to bytes.
- *
- * @return Serialized bytes.
- */
- public serialize(): Uint8Array {
- let newArray = Uint8Array.from([]);
- newArray = GeneratorUtils.concatTypedArrays(newArray, this.key);
- return newArray;
- }
-}
diff --git a/src/infrastructure/catbuffer/LockHashAlgorithmDto.ts b/src/infrastructure/catbuffer/LockHashAlgorithmDto.ts
deleted file mode 100644
index 46ed416098..0000000000
--- a/src/infrastructure/catbuffer/LockHashAlgorithmDto.ts
+++ /dev/null
@@ -1,33 +0,0 @@
-// tslint:disable: jsdoc-format
-/**
-*** Copyright (c) 2016-present,
-*** Jaguar0625, gimre, BloodyRookie, Tech Bureau, Corp. All rights reserved.
-***
-*** This file is part of Catapult.
-***
-*** Catapult is free software: you can redistribute it and/or modify
-*** it under the terms of the GNU Lesser General Public License as published by
-*** the Free Software Foundation, either version 3 of the License, or
-*** (at your option) any later version.
-***
-*** Catapult is distributed in the hope that it will be useful,
-*** but WITHOUT ANY WARRANTY; without even the implied warranty of
-*** MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-*** GNU Lesser General Public License for more details.
-***
-*** You should have received a copy of the GNU Lesser General Public License
-*** along with Catapult. If not, see .
-**/
-
-
-/** Enumeration of lock hash algorithms. */
-export enum LockHashAlgorithmDto {
- /** Input is hashed using sha-3 256. */
- SHA3_256 = 0,
- /** Input is hashed using keccak 256. */
- KECCAK_256 = 1,
- /** Input is hashed twice: first with sha-256 and then with ripemd-160 (bitcoin's OP_HASH160). */
- HASH_160 = 2,
- /** Input is hashed twice with sha-256 (bitcoin's OP_HASH256). */
- HASH_256 = 3,
-}
diff --git a/src/infrastructure/catbuffer/MosaicAddressRestrictionTransactionBodyBuilder.ts b/src/infrastructure/catbuffer/MosaicAddressRestrictionTransactionBodyBuilder.ts
deleted file mode 100644
index 5a87c47671..0000000000
--- a/src/infrastructure/catbuffer/MosaicAddressRestrictionTransactionBodyBuilder.ts
+++ /dev/null
@@ -1,158 +0,0 @@
-// tslint:disable: jsdoc-format
-/**
-*** Copyright (c) 2016-present,
-*** Jaguar0625, gimre, BloodyRookie, Tech Bureau, Corp. All rights reserved.
-***
-*** This file is part of Catapult.
-***
-*** Catapult is free software: you can redistribute it and/or modify
-*** it under the terms of the GNU Lesser General Public License as published by
-*** the Free Software Foundation, either version 3 of the License, or
-*** (at your option) any later version.
-***
-*** Catapult is distributed in the hope that it will be useful,
-*** but WITHOUT ANY WARRANTY; without even the implied warranty of
-*** MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-*** GNU Lesser General Public License for more details.
-***
-*** You should have received a copy of the GNU Lesser General Public License
-*** along with Catapult. If not, see .
-**/
-
-import { GeneratorUtils } from './GeneratorUtils';
-import { UnresolvedAddressDto } from './UnresolvedAddressDto';
-import { UnresolvedMosaicIdDto } from './UnresolvedMosaicIdDto';
-
-/** Binary layout for a mosaic address restriction transaction. */
-export class MosaicAddressRestrictionTransactionBodyBuilder {
- /** Identifier of the mosaic to which the restriction applies. */
- mosaicId: UnresolvedMosaicIdDto;
- /** Restriction key. */
- restrictionKey: number[];
- /** Previous restriction value. */
- previousRestrictionValue: number[];
- /** New restriction value. */
- newRestrictionValue: number[];
- /** Address being restricted. */
- targetAddress: UnresolvedAddressDto;
-
- /**
- * Constructor.
- *
- * @param mosaicId Identifier of the mosaic to which the restriction applies.
- * @param restrictionKey Restriction key.
- * @param previousRestrictionValue Previous restriction value.
- * @param newRestrictionValue New restriction value.
- * @param targetAddress Address being restricted.
- */
- // tslint:disable-next-line: max-line-length
- public constructor(mosaicId: UnresolvedMosaicIdDto, restrictionKey: number[], previousRestrictionValue: number[], newRestrictionValue: number[], targetAddress: UnresolvedAddressDto) {
- this.mosaicId = mosaicId;
- this.restrictionKey = restrictionKey;
- this.previousRestrictionValue = previousRestrictionValue;
- this.newRestrictionValue = newRestrictionValue;
- this.targetAddress = targetAddress;
- }
-
- /**
- * Creates an instance of MosaicAddressRestrictionTransactionBodyBuilder from binary payload.
- *
- * @param payload Byte payload to use to serialize the object.
- * @return Instance of MosaicAddressRestrictionTransactionBodyBuilder.
- */
- public static loadFromBinary(payload: Uint8Array): MosaicAddressRestrictionTransactionBodyBuilder {
- const byteArray = Array.from(payload);
- const mosaicId = UnresolvedMosaicIdDto.loadFromBinary(Uint8Array.from(byteArray));
- byteArray.splice(0, mosaicId.getSize());
- const restrictionKey = GeneratorUtils.bufferToUint64(GeneratorUtils.getBytes(Uint8Array.from(byteArray), 8));
- byteArray.splice(0, 8);
- const previousRestrictionValue = GeneratorUtils.bufferToUint64(GeneratorUtils.getBytes(Uint8Array.from(byteArray), 8));
- byteArray.splice(0, 8);
- const newRestrictionValue = GeneratorUtils.bufferToUint64(GeneratorUtils.getBytes(Uint8Array.from(byteArray), 8));
- byteArray.splice(0, 8);
- const targetAddress = UnresolvedAddressDto.loadFromBinary(Uint8Array.from(byteArray));
- byteArray.splice(0, targetAddress.getSize());
- // tslint:disable-next-line: max-line-length
- return new MosaicAddressRestrictionTransactionBodyBuilder(mosaicId, restrictionKey, previousRestrictionValue, newRestrictionValue, targetAddress);
- }
-
- /**
- * Gets identifier of the mosaic to which the restriction applies.
- *
- * @return Identifier of the mosaic to which the restriction applies.
- */
- public getMosaicId(): UnresolvedMosaicIdDto {
- return this.mosaicId;
- }
-
- /**
- * Gets restriction key.
- *
- * @return Restriction key.
- */
- public getRestrictionKey(): number[] {
- return this.restrictionKey;
- }
-
- /**
- * Gets previous restriction value.
- *
- * @return Previous restriction value.
- */
- public getPreviousRestrictionValue(): number[] {
- return this.previousRestrictionValue;
- }
-
- /**
- * Gets new restriction value.
- *
- * @return New restriction value.
- */
- public getNewRestrictionValue(): number[] {
- return this.newRestrictionValue;
- }
-
- /**
- * Gets address being restricted.
- *
- * @return Address being restricted.
- */
- public getTargetAddress(): UnresolvedAddressDto {
- return this.targetAddress;
- }
-
- /**
- * Gets the size of the object.
- *
- * @return Size in bytes.
- */
- public getSize(): number {
- let size = 0;
- size += this.mosaicId.getSize();
- size += 8; // restrictionKey
- size += 8; // previousRestrictionValue
- size += 8; // newRestrictionValue
- size += this.targetAddress.getSize();
- return size;
- }
-
- /**
- * Serializes an object to bytes.
- *
- * @return Serialized bytes.
- */
- public serialize(): Uint8Array {
- let newArray = Uint8Array.from([]);
- const mosaicIdBytes = this.mosaicId.serialize();
- newArray = GeneratorUtils.concatTypedArrays(newArray, mosaicIdBytes);
- const restrictionKeyBytes = GeneratorUtils.uint64ToBuffer(this.getRestrictionKey());
- newArray = GeneratorUtils.concatTypedArrays(newArray, restrictionKeyBytes);
- const previousRestrictionValueBytes = GeneratorUtils.uint64ToBuffer(this.getPreviousRestrictionValue());
- newArray = GeneratorUtils.concatTypedArrays(newArray, previousRestrictionValueBytes);
- const newRestrictionValueBytes = GeneratorUtils.uint64ToBuffer(this.getNewRestrictionValue());
- newArray = GeneratorUtils.concatTypedArrays(newArray, newRestrictionValueBytes);
- const targetAddressBytes = this.targetAddress.serialize();
- newArray = GeneratorUtils.concatTypedArrays(newArray, targetAddressBytes);
- return newArray;
- }
-}
diff --git a/src/infrastructure/catbuffer/MosaicAddressRestrictionTransactionBuilder.ts b/src/infrastructure/catbuffer/MosaicAddressRestrictionTransactionBuilder.ts
deleted file mode 100644
index 4506255e14..0000000000
--- a/src/infrastructure/catbuffer/MosaicAddressRestrictionTransactionBuilder.ts
+++ /dev/null
@@ -1,148 +0,0 @@
-// tslint:disable: jsdoc-format
-/**
-*** Copyright (c) 2016-present,
-*** Jaguar0625, gimre, BloodyRookie, Tech Bureau, Corp. All rights reserved.
-***
-*** This file is part of Catapult.
-***
-*** Catapult is free software: you can redistribute it and/or modify
-*** it under the terms of the GNU Lesser General Public License as published by
-*** the Free Software Foundation, either version 3 of the License, or
-*** (at your option) any later version.
-***
-*** Catapult is distributed in the hope that it will be useful,
-*** but WITHOUT ANY WARRANTY; without even the implied warranty of
-*** MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-*** GNU Lesser General Public License for more details.
-***
-*** You should have received a copy of the GNU Lesser General Public License
-*** along with Catapult. If not, see .
-**/
-
-import { AmountDto } from './AmountDto';
-import { EntityTypeDto } from './EntityTypeDto';
-import { GeneratorUtils } from './GeneratorUtils';
-import { KeyDto } from './KeyDto';
-import { MosaicAddressRestrictionTransactionBodyBuilder } from './MosaicAddressRestrictionTransactionBodyBuilder';
-import { NetworkTypeDto } from './NetworkTypeDto';
-import { SignatureDto } from './SignatureDto';
-import { TimestampDto } from './TimestampDto';
-import { TransactionBuilder } from './TransactionBuilder';
-import { UnresolvedAddressDto } from './UnresolvedAddressDto';
-import { UnresolvedMosaicIdDto } from './UnresolvedMosaicIdDto';
-
-/** Binary layout for a non-embedded mosaic address restriction transaction. */
-export class MosaicAddressRestrictionTransactionBuilder extends TransactionBuilder {
- /** Mosaic address restriction transaction body. */
- mosaicAddressRestrictionTransactionBody: MosaicAddressRestrictionTransactionBodyBuilder;
-
- /**
- * Constructor.
- *
- * @param signature Entity signature.
- * @param signerPublicKey Entity signer's public key.
- * @param version Entity version.
- * @param network Entity network.
- * @param type Entity type.
- * @param fee Transaction fee.
- * @param deadline Transaction deadline.
- * @param mosaicId Identifier of the mosaic to which the restriction applies.
- * @param restrictionKey Restriction key.
- * @param previousRestrictionValue Previous restriction value.
- * @param newRestrictionValue New restriction value.
- * @param targetAddress Address being restricted.
- */
- // tslint:disable-next-line: max-line-length
- public constructor(signature: SignatureDto, signerPublicKey: KeyDto, version: number, network: NetworkTypeDto, type: EntityTypeDto, fee: AmountDto, deadline: TimestampDto, mosaicId: UnresolvedMosaicIdDto, restrictionKey: number[], previousRestrictionValue: number[], newRestrictionValue: number[], targetAddress: UnresolvedAddressDto) {
- super(signature, signerPublicKey, version, network, type, fee, deadline);
- // tslint:disable-next-line: max-line-length
- this.mosaicAddressRestrictionTransactionBody = new MosaicAddressRestrictionTransactionBodyBuilder(mosaicId, restrictionKey, previousRestrictionValue, newRestrictionValue, targetAddress);
- }
-
- /**
- * Creates an instance of MosaicAddressRestrictionTransactionBuilder from binary payload.
- *
- * @param payload Byte payload to use to serialize the object.
- * @return Instance of MosaicAddressRestrictionTransactionBuilder.
- */
- public static loadFromBinary(payload: Uint8Array): MosaicAddressRestrictionTransactionBuilder {
- const byteArray = Array.from(payload);
- const superObject = TransactionBuilder.loadFromBinary(Uint8Array.from(byteArray));
- byteArray.splice(0, superObject.getSize());
- // tslint:disable-next-line: max-line-length
- const mosaicAddressRestrictionTransactionBody = MosaicAddressRestrictionTransactionBodyBuilder.loadFromBinary(Uint8Array.from(byteArray));
- byteArray.splice(0, mosaicAddressRestrictionTransactionBody.getSize());
- // tslint:disable-next-line: max-line-length
- return new MosaicAddressRestrictionTransactionBuilder(superObject.signature, superObject.signerPublicKey, superObject.version, superObject.network, superObject.type, superObject.fee, superObject.deadline, mosaicAddressRestrictionTransactionBody.mosaicId, mosaicAddressRestrictionTransactionBody.restrictionKey, mosaicAddressRestrictionTransactionBody.previousRestrictionValue, mosaicAddressRestrictionTransactionBody.newRestrictionValue, mosaicAddressRestrictionTransactionBody.targetAddress);
- }
-
- /**
- * Gets identifier of the mosaic to which the restriction applies.
- *
- * @return Identifier of the mosaic to which the restriction applies.
- */
- public getMosaicId(): UnresolvedMosaicIdDto {
- return this.mosaicAddressRestrictionTransactionBody.getMosaicId();
- }
-
- /**
- * Gets restriction key.
- *
- * @return Restriction key.
- */
- public getRestrictionKey(): number[] {
- return this.mosaicAddressRestrictionTransactionBody.getRestrictionKey();
- }
-
- /**
- * Gets previous restriction value.
- *
- * @return Previous restriction value.
- */
- public getPreviousRestrictionValue(): number[] {
- return this.mosaicAddressRestrictionTransactionBody.getPreviousRestrictionValue();
- }
-
- /**
- * Gets new restriction value.
- *
- * @return New restriction value.
- */
- public getNewRestrictionValue(): number[] {
- return this.mosaicAddressRestrictionTransactionBody.getNewRestrictionValue();
- }
-
- /**
- * Gets address being restricted.
- *
- * @return Address being restricted.
- */
- public getTargetAddress(): UnresolvedAddressDto {
- return this.mosaicAddressRestrictionTransactionBody.getTargetAddress();
- }
-
- /**
- * Gets the size of the object.
- *
- * @return Size in bytes.
- */
- public getSize(): number {
- let size: number = super.getSize();
- size += this.mosaicAddressRestrictionTransactionBody.getSize();
- return size;
- }
-
- /**
- * Serializes an object to bytes.
- *
- * @return Serialized bytes.
- */
- public serialize(): Uint8Array {
- let newArray = Uint8Array.from([]);
- const superBytes = super.serialize();
- newArray = GeneratorUtils.concatTypedArrays(newArray, superBytes);
- const mosaicAddressRestrictionTransactionBodyBytes = this.mosaicAddressRestrictionTransactionBody.serialize();
- newArray = GeneratorUtils.concatTypedArrays(newArray, mosaicAddressRestrictionTransactionBodyBytes);
- return newArray;
- }
-}
diff --git a/src/infrastructure/catbuffer/MosaicAliasTransactionBodyBuilder.ts b/src/infrastructure/catbuffer/MosaicAliasTransactionBodyBuilder.ts
deleted file mode 100644
index b38244e806..0000000000
--- a/src/infrastructure/catbuffer/MosaicAliasTransactionBodyBuilder.ts
+++ /dev/null
@@ -1,121 +0,0 @@
-// tslint:disable: jsdoc-format
-/**
-*** Copyright (c) 2016-present,
-*** Jaguar0625, gimre, BloodyRookie, Tech Bureau, Corp. All rights reserved.
-***
-*** This file is part of Catapult.
-***
-*** Catapult is free software: you can redistribute it and/or modify
-*** it under the terms of the GNU Lesser General Public License as published by
-*** the Free Software Foundation, either version 3 of the License, or
-*** (at your option) any later version.
-***
-*** Catapult is distributed in the hope that it will be useful,
-*** but WITHOUT ANY WARRANTY; without even the implied warranty of
-*** MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-*** GNU Lesser General Public License for more details.
-***
-*** You should have received a copy of the GNU Lesser General Public License
-*** along with Catapult. If not, see .
-**/
-
-import { AliasActionDto } from './AliasActionDto';
-import { GeneratorUtils } from './GeneratorUtils';
-import { MosaicIdDto } from './MosaicIdDto';
-import { NamespaceIdDto } from './NamespaceIdDto';
-
-/** Binary layout for an mosaic alias transaction. */
-export class MosaicAliasTransactionBodyBuilder {
- /** Identifier of the namespace that will become an alias. */
- namespaceId: NamespaceIdDto;
- /** Aliased mosaic identifier. */
- mosaicId: MosaicIdDto;
- /** Alias action. */
- aliasAction: AliasActionDto;
-
- /**
- * Constructor.
- *
- * @param namespaceId Identifier of the namespace that will become an alias.
- * @param mosaicId Aliased mosaic identifier.
- * @param aliasAction Alias action.
- */
- public constructor(namespaceId: NamespaceIdDto, mosaicId: MosaicIdDto, aliasAction: AliasActionDto) {
- this.namespaceId = namespaceId;
- this.mosaicId = mosaicId;
- this.aliasAction = aliasAction;
- }
-
- /**
- * Creates an instance of MosaicAliasTransactionBodyBuilder from binary payload.
- *
- * @param payload Byte payload to use to serialize the object.
- * @return Instance of MosaicAliasTransactionBodyBuilder.
- */
- public static loadFromBinary(payload: Uint8Array): MosaicAliasTransactionBodyBuilder {
- const byteArray = Array.from(payload);
- const namespaceId = NamespaceIdDto.loadFromBinary(Uint8Array.from(byteArray));
- byteArray.splice(0, namespaceId.getSize());
- const mosaicId = MosaicIdDto.loadFromBinary(Uint8Array.from(byteArray));
- byteArray.splice(0, mosaicId.getSize());
- const aliasAction = GeneratorUtils.bufferToUint(GeneratorUtils.getBytes(Uint8Array.from(byteArray), 1));
- byteArray.splice(0, 1);
- return new MosaicAliasTransactionBodyBuilder(namespaceId, mosaicId, aliasAction);
- }
-
- /**
- * Gets identifier of the namespace that will become an alias.
- *
- * @return Identifier of the namespace that will become an alias.
- */
- public getNamespaceId(): NamespaceIdDto {
- return this.namespaceId;
- }
-
- /**
- * Gets aliased mosaic identifier.
- *
- * @return Aliased mosaic identifier.
- */
- public getMosaicId(): MosaicIdDto {
- return this.mosaicId;
- }
-
- /**
- * Gets alias action.
- *
- * @return Alias action.
- */
- public getAliasAction(): AliasActionDto {
- return this.aliasAction;
- }
-
- /**
- * Gets the size of the object.
- *
- * @return Size in bytes.
- */
- public getSize(): number {
- let size = 0;
- size += this.namespaceId.getSize();
- size += this.mosaicId.getSize();
- size += 1; // aliasAction
- return size;
- }
-
- /**
- * Serializes an object to bytes.
- *
- * @return Serialized bytes.
- */
- public serialize(): Uint8Array {
- let newArray = Uint8Array.from([]);
- const namespaceIdBytes = this.namespaceId.serialize();
- newArray = GeneratorUtils.concatTypedArrays(newArray, namespaceIdBytes);
- const mosaicIdBytes = this.mosaicId.serialize();
- newArray = GeneratorUtils.concatTypedArrays(newArray, mosaicIdBytes);
- const aliasActionBytes = GeneratorUtils.uintToBuffer(this.aliasAction, 1);
- newArray = GeneratorUtils.concatTypedArrays(newArray, aliasActionBytes);
- return newArray;
- }
-}
diff --git a/src/infrastructure/catbuffer/MosaicAliasTransactionBuilder.ts b/src/infrastructure/catbuffer/MosaicAliasTransactionBuilder.ts
deleted file mode 100644
index db4a48372b..0000000000
--- a/src/infrastructure/catbuffer/MosaicAliasTransactionBuilder.ts
+++ /dev/null
@@ -1,127 +0,0 @@
-// tslint:disable: jsdoc-format
-/**
-*** Copyright (c) 2016-present,
-*** Jaguar0625, gimre, BloodyRookie, Tech Bureau, Corp. All rights reserved.
-***
-*** This file is part of Catapult.
-***
-*** Catapult is free software: you can redistribute it and/or modify
-*** it under the terms of the GNU Lesser General Public License as published by
-*** the Free Software Foundation, either version 3 of the License, or
-*** (at your option) any later version.
-***
-*** Catapult is distributed in the hope that it will be useful,
-*** but WITHOUT ANY WARRANTY; without even the implied warranty of
-*** MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-*** GNU Lesser General Public License for more details.
-***
-*** You should have received a copy of the GNU Lesser General Public License
-*** along with Catapult. If not, see .
-**/
-
-import { AliasActionDto } from './AliasActionDto';
-import { AmountDto } from './AmountDto';
-import { EntityTypeDto } from './EntityTypeDto';
-import { GeneratorUtils } from './GeneratorUtils';
-import { KeyDto } from './KeyDto';
-import { MosaicAliasTransactionBodyBuilder } from './MosaicAliasTransactionBodyBuilder';
-import { MosaicIdDto } from './MosaicIdDto';
-import { NamespaceIdDto } from './NamespaceIdDto';
-import { NetworkTypeDto } from './NetworkTypeDto';
-import { SignatureDto } from './SignatureDto';
-import { TimestampDto } from './TimestampDto';
-import { TransactionBuilder } from './TransactionBuilder';
-
-/** Binary layout for a non-embedded mosaic alias transaction. */
-export class MosaicAliasTransactionBuilder extends TransactionBuilder {
- /** Mosaic alias transaction body. */
- mosaicAliasTransactionBody: MosaicAliasTransactionBodyBuilder;
-
- /**
- * Constructor.
- *
- * @param signature Entity signature.
- * @param signerPublicKey Entity signer's public key.
- * @param version Entity version.
- * @param network Entity network.
- * @param type Entity type.
- * @param fee Transaction fee.
- * @param deadline Transaction deadline.
- * @param namespaceId Identifier of the namespace that will become an alias.
- * @param mosaicId Aliased mosaic identifier.
- * @param aliasAction Alias action.
- */
- // tslint:disable-next-line: max-line-length
- public constructor(signature: SignatureDto, signerPublicKey: KeyDto, version: number, network: NetworkTypeDto, type: EntityTypeDto, fee: AmountDto, deadline: TimestampDto, namespaceId: NamespaceIdDto, mosaicId: MosaicIdDto, aliasAction: AliasActionDto) {
- super(signature, signerPublicKey, version, network, type, fee, deadline);
- this.mosaicAliasTransactionBody = new MosaicAliasTransactionBodyBuilder(namespaceId, mosaicId, aliasAction);
- }
-
- /**
- * Creates an instance of MosaicAliasTransactionBuilder from binary payload.
- *
- * @param payload Byte payload to use to serialize the object.
- * @return Instance of MosaicAliasTransactionBuilder.
- */
- public static loadFromBinary(payload: Uint8Array): MosaicAliasTransactionBuilder {
- const byteArray = Array.from(payload);
- const superObject = TransactionBuilder.loadFromBinary(Uint8Array.from(byteArray));
- byteArray.splice(0, superObject.getSize());
- const mosaicAliasTransactionBody = MosaicAliasTransactionBodyBuilder.loadFromBinary(Uint8Array.from(byteArray));
- byteArray.splice(0, mosaicAliasTransactionBody.getSize());
- // tslint:disable-next-line: max-line-length
- return new MosaicAliasTransactionBuilder(superObject.signature, superObject.signerPublicKey, superObject.version, superObject.network, superObject.type, superObject.fee, superObject.deadline, mosaicAliasTransactionBody.namespaceId, mosaicAliasTransactionBody.mosaicId, mosaicAliasTransactionBody.aliasAction);
- }
-
- /**
- * Gets identifier of the namespace that will become an alias.
- *
- * @return Identifier of the namespace that will become an alias.
- */
- public getNamespaceId(): NamespaceIdDto {
- return this.mosaicAliasTransactionBody.getNamespaceId();
- }
-
- /**
- * Gets aliased mosaic identifier.
- *
- * @return Aliased mosaic identifier.
- */
- public getMosaicId(): MosaicIdDto {
- return this.mosaicAliasTransactionBody.getMosaicId();
- }
-
- /**
- * Gets alias action.
- *
- * @return Alias action.
- */
- public getAliasAction(): AliasActionDto {
- return this.mosaicAliasTransactionBody.getAliasAction();
- }
-
- /**
- * Gets the size of the object.
- *
- * @return Size in bytes.
- */
- public getSize(): number {
- let size: number = super.getSize();
- size += this.mosaicAliasTransactionBody.getSize();
- return size;
- }
-
- /**
- * Serializes an object to bytes.
- *
- * @return Serialized bytes.
- */
- public serialize(): Uint8Array {
- let newArray = Uint8Array.from([]);
- const superBytes = super.serialize();
- newArray = GeneratorUtils.concatTypedArrays(newArray, superBytes);
- const mosaicAliasTransactionBodyBytes = this.mosaicAliasTransactionBody.serialize();
- newArray = GeneratorUtils.concatTypedArrays(newArray, mosaicAliasTransactionBodyBytes);
- return newArray;
- }
-}
diff --git a/src/infrastructure/catbuffer/MosaicBuilder.ts b/src/infrastructure/catbuffer/MosaicBuilder.ts
deleted file mode 100644
index dc2ac60e87..0000000000
--- a/src/infrastructure/catbuffer/MosaicBuilder.ts
+++ /dev/null
@@ -1,102 +0,0 @@
-// tslint:disable: jsdoc-format
-/**
-*** Copyright (c) 2016-present,
-*** Jaguar0625, gimre, BloodyRookie, Tech Bureau, Corp. All rights reserved.
-***
-*** This file is part of Catapult.
-***
-*** Catapult is free software: you can redistribute it and/or modify
-*** it under the terms of the GNU Lesser General Public License as published by
-*** the Free Software Foundation, either version 3 of the License, or
-*** (at your option) any later version.
-***
-*** Catapult is distributed in the hope that it will be useful,
-*** but WITHOUT ANY WARRANTY; without even the implied warranty of
-*** MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-*** GNU Lesser General Public License for more details.
-***
-*** You should have received a copy of the GNU Lesser General Public License
-*** along with Catapult. If not, see .
-**/
-
-import { AmountDto } from './AmountDto';
-import { GeneratorUtils } from './GeneratorUtils';
-import { MosaicIdDto } from './MosaicIdDto';
-
-/** Binary layout for a mosaic. */
-export class MosaicBuilder {
- /** Mosaic identifier. */
- mosaicId: MosaicIdDto;
- /** Mosaic amount. */
- amount: AmountDto;
-
- /**
- * Constructor.
- *
- * @param mosaicId Mosaic identifier.
- * @param amount Mosaic amount.
- */
- public constructor(mosaicId: MosaicIdDto, amount: AmountDto) {
- this.mosaicId = mosaicId;
- this.amount = amount;
- }
-
- /**
- * Creates an instance of MosaicBuilder from binary payload.
- *
- * @param payload Byte payload to use to serialize the object.
- * @return Instance of MosaicBuilder.
- */
- public static loadFromBinary(payload: Uint8Array): MosaicBuilder {
- const byteArray = Array.from(payload);
- const mosaicId = MosaicIdDto.loadFromBinary(Uint8Array.from(byteArray));
- byteArray.splice(0, mosaicId.getSize());
- const amount = AmountDto.loadFromBinary(Uint8Array.from(byteArray));
- byteArray.splice(0, amount.getSize());
- return new MosaicBuilder(mosaicId, amount);
- }
-
- /**
- * Gets mosaic identifier.
- *
- * @return Mosaic identifier.
- */
- public getMosaicId(): MosaicIdDto {
- return this.mosaicId;
- }
-
- /**
- * Gets mosaic amount.
- *
- * @return Mosaic amount.
- */
- public getAmount(): AmountDto {
- return this.amount;
- }
-
- /**
- * Gets the size of the object.
- *
- * @return Size in bytes.
- */
- public getSize(): number {
- let size = 0;
- size += this.mosaicId.getSize();
- size += this.amount.getSize();
- return size;
- }
-
- /**
- * Serializes an object to bytes.
- *
- * @return Serialized bytes.
- */
- public serialize(): Uint8Array {
- let newArray = Uint8Array.from([]);
- const mosaicIdBytes = this.mosaicId.serialize();
- newArray = GeneratorUtils.concatTypedArrays(newArray, mosaicIdBytes);
- const amountBytes = this.amount.serialize();
- newArray = GeneratorUtils.concatTypedArrays(newArray, amountBytes);
- return newArray;
- }
-}
diff --git a/src/infrastructure/catbuffer/MosaicDefinitionTransactionBodyBuilder.ts b/src/infrastructure/catbuffer/MosaicDefinitionTransactionBodyBuilder.ts
deleted file mode 100644
index 02d495e600..0000000000
--- a/src/infrastructure/catbuffer/MosaicDefinitionTransactionBodyBuilder.ts
+++ /dev/null
@@ -1,158 +0,0 @@
-// tslint:disable: jsdoc-format
-/**
-*** Copyright (c) 2016-present,
-*** Jaguar0625, gimre, BloodyRookie, Tech Bureau, Corp. All rights reserved.
-***
-*** This file is part of Catapult.
-***
-*** Catapult is free software: you can redistribute it and/or modify
-*** it under the terms of the GNU Lesser General Public License as published by
-*** the Free Software Foundation, either version 3 of the License, or
-*** (at your option) any later version.
-***
-*** Catapult is distributed in the hope that it will be useful,
-*** but WITHOUT ANY WARRANTY; without even the implied warranty of
-*** MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-*** GNU Lesser General Public License for more details.
-***
-*** You should have received a copy of the GNU Lesser General Public License
-*** along with Catapult. If not, see .
-**/
-
-import { BlockDurationDto } from './BlockDurationDto';
-import { GeneratorUtils } from './GeneratorUtils';
-import { MosaicIdDto } from './MosaicIdDto';
-import { MosaicNonceDto } from './MosaicNonceDto';
-
-/** Binary layout for a mosaic definition transaction. */
-export class MosaicDefinitionTransactionBodyBuilder {
- /** Mosaic identifier. */
- id: MosaicIdDto;
- /** Mosaic duration. */
- duration: BlockDurationDto;
- /** Mosaic nonce. */
- nonce: MosaicNonceDto;
- /** Mosaic flags. */
- flags: number;
- /** Mosaic divisibility. */
- divisibility: number;
-
- /**
- * Constructor.
- *
- * @param id Mosaic identifier.
- * @param duration Mosaic duration.
- * @param nonce Mosaic nonce.
- * @param flags Mosaic flags.
- * @param divisibility Mosaic divisibility.
- */
- // tslint:disable-next-line: max-line-length
- public constructor(id: MosaicIdDto, duration: BlockDurationDto, nonce: MosaicNonceDto, flags: number, divisibility: number) {
- this.id = id;
- this.duration = duration;
- this.nonce = nonce;
- this.flags = flags;
- this.divisibility = divisibility;
- }
-
- /**
- * Creates an instance of MosaicDefinitionTransactionBodyBuilder from binary payload.
- *
- * @param payload Byte payload to use to serialize the object.
- * @return Instance of MosaicDefinitionTransactionBodyBuilder.
- */
- public static loadFromBinary(payload: Uint8Array): MosaicDefinitionTransactionBodyBuilder {
- const byteArray = Array.from(payload);
- const id = MosaicIdDto.loadFromBinary(Uint8Array.from(byteArray));
- byteArray.splice(0, id.getSize());
- const duration = BlockDurationDto.loadFromBinary(Uint8Array.from(byteArray));
- byteArray.splice(0, duration.getSize());
- const nonce = MosaicNonceDto.loadFromBinary(Uint8Array.from(byteArray));
- byteArray.splice(0, nonce.getSize());
- const flags = GeneratorUtils.bufferToUint(GeneratorUtils.getBytes(Uint8Array.from(byteArray), 1));
- byteArray.splice(0, 1);
- const divisibility = GeneratorUtils.bufferToUint(GeneratorUtils.getBytes(Uint8Array.from(byteArray), 1));
- byteArray.splice(0, 1);
- return new MosaicDefinitionTransactionBodyBuilder(id, duration, nonce, flags, divisibility);
- }
-
- /**
- * Gets mosaic identifier.
- *
- * @return Mosaic identifier.
- */
- public getId(): MosaicIdDto {
- return this.id;
- }
-
- /**
- * Gets mosaic duration.
- *
- * @return Mosaic duration.
- */
- public getDuration(): BlockDurationDto {
- return this.duration;
- }
-
- /**
- * Gets mosaic nonce.
- *
- * @return Mosaic nonce.
- */
- public getNonce(): MosaicNonceDto {
- return this.nonce;
- }
-
- /**
- * Gets mosaic flags.
- *
- * @return Mosaic flags.
- */
- public getFlags(): number {
- return this.flags;
- }
-
- /**
- * Gets mosaic divisibility.
- *
- * @return Mosaic divisibility.
- */
- public getDivisibility(): number {
- return this.divisibility;
- }
-
- /**
- * Gets the size of the object.
- *
- * @return Size in bytes.
- */
- public getSize(): number {
- let size = 0;
- size += this.id.getSize();
- size += this.duration.getSize();
- size += this.nonce.getSize();
- size += 1; // flags
- size += 1; // divisibility
- return size;
- }
-
- /**
- * Serializes an object to bytes.
- *
- * @return Serialized bytes.
- */
- public serialize(): Uint8Array {
- let newArray = Uint8Array.from([]);
- const idBytes = this.id.serialize();
- newArray = GeneratorUtils.concatTypedArrays(newArray, idBytes);
- const durationBytes = this.duration.serialize();
- newArray = GeneratorUtils.concatTypedArrays(newArray, durationBytes);
- const nonceBytes = this.nonce.serialize();
- newArray = GeneratorUtils.concatTypedArrays(newArray, nonceBytes);
- const flagsBytes = GeneratorUtils.uintToBuffer(this.getFlags(), 1);
- newArray = GeneratorUtils.concatTypedArrays(newArray, flagsBytes);
- const divisibilityBytes = GeneratorUtils.uintToBuffer(this.getDivisibility(), 1);
- newArray = GeneratorUtils.concatTypedArrays(newArray, divisibilityBytes);
- return newArray;
- }
-}
diff --git a/src/infrastructure/catbuffer/MosaicDefinitionTransactionBuilder.ts b/src/infrastructure/catbuffer/MosaicDefinitionTransactionBuilder.ts
deleted file mode 100644
index a0492a09cf..0000000000
--- a/src/infrastructure/catbuffer/MosaicDefinitionTransactionBuilder.ts
+++ /dev/null
@@ -1,149 +0,0 @@
-// tslint:disable: jsdoc-format
-/**
-*** Copyright (c) 2016-present,
-*** Jaguar0625, gimre, BloodyRookie, Tech Bureau, Corp. All rights reserved.
-***
-*** This file is part of Catapult.
-***
-*** Catapult is free software: you can redistribute it and/or modify
-*** it under the terms of the GNU Lesser General Public License as published by
-*** the Free Software Foundation, either version 3 of the License, or
-*** (at your option) any later version.
-***
-*** Catapult is distributed in the hope that it will be useful,
-*** but WITHOUT ANY WARRANTY; without even the implied warranty of
-*** MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-*** GNU Lesser General Public License for more details.
-***
-*** You should have received a copy of the GNU Lesser General Public License
-*** along with Catapult. If not, see .
-**/
-
-import { AmountDto } from './AmountDto';
-import { BlockDurationDto } from './BlockDurationDto';
-import { EntityTypeDto } from './EntityTypeDto';
-import { GeneratorUtils } from './GeneratorUtils';
-import { KeyDto } from './KeyDto';
-import { MosaicDefinitionTransactionBodyBuilder } from './MosaicDefinitionTransactionBodyBuilder';
-import { MosaicIdDto } from './MosaicIdDto';
-import { MosaicNonceDto } from './MosaicNonceDto';
-import { NetworkTypeDto } from './NetworkTypeDto';
-import { SignatureDto } from './SignatureDto';
-import { TimestampDto } from './TimestampDto';
-import { TransactionBuilder } from './TransactionBuilder';
-
-/** Binary layout for a non-embedded mosaic definition transaction. */
-export class MosaicDefinitionTransactionBuilder extends TransactionBuilder {
- /** Mosaic definition transaction body. */
- mosaicDefinitionTransactionBody: MosaicDefinitionTransactionBodyBuilder;
-
- /**
- * Constructor.
- *
- * @param signature Entity signature.
- * @param signerPublicKey Entity signer's public key.
- * @param version Entity version.
- * @param network Entity network.
- * @param type Entity type.
- * @param fee Transaction fee.
- * @param deadline Transaction deadline.
- * @param id Mosaic identifier.
- * @param duration Mosaic duration.
- * @param nonce Mosaic nonce.
- * @param flags Mosaic flags.
- * @param divisibility Mosaic divisibility.
- */
- // tslint:disable-next-line: max-line-length
- public constructor(signature: SignatureDto, signerPublicKey: KeyDto, version: number, network: NetworkTypeDto, type: EntityTypeDto, fee: AmountDto, deadline: TimestampDto, id: MosaicIdDto, duration: BlockDurationDto, nonce: MosaicNonceDto, flags: number, divisibility: number) {
- super(signature, signerPublicKey, version, network, type, fee, deadline);
- // tslint:disable-next-line: max-line-length
- this.mosaicDefinitionTransactionBody = new MosaicDefinitionTransactionBodyBuilder(id, duration, nonce, flags, divisibility);
- }
-
- /**
- * Creates an instance of MosaicDefinitionTransactionBuilder from binary payload.
- *
- * @param payload Byte payload to use to serialize the object.
- * @return Instance of MosaicDefinitionTransactionBuilder.
- */
- public static loadFromBinary(payload: Uint8Array): MosaicDefinitionTransactionBuilder {
- const byteArray = Array.from(payload);
- const superObject = TransactionBuilder.loadFromBinary(Uint8Array.from(byteArray));
- byteArray.splice(0, superObject.getSize());
- // tslint:disable-next-line: max-line-length
- const mosaicDefinitionTransactionBody = MosaicDefinitionTransactionBodyBuilder.loadFromBinary(Uint8Array.from(byteArray));
- byteArray.splice(0, mosaicDefinitionTransactionBody.getSize());
- // tslint:disable-next-line: max-line-length
- return new MosaicDefinitionTransactionBuilder(superObject.signature, superObject.signerPublicKey, superObject.version, superObject.network, superObject.type, superObject.fee, superObject.deadline, mosaicDefinitionTransactionBody.id, mosaicDefinitionTransactionBody.duration, mosaicDefinitionTransactionBody.nonce, mosaicDefinitionTransactionBody.flags, mosaicDefinitionTransactionBody.divisibility);
- }
-
- /**
- * Gets mosaic identifier.
- *
- * @return Mosaic identifier.
- */
- public getId(): MosaicIdDto {
- return this.mosaicDefinitionTransactionBody.getId();
- }
-
- /**
- * Gets mosaic duration.
- *
- * @return Mosaic duration.
- */
- public getDuration(): BlockDurationDto {
- return this.mosaicDefinitionTransactionBody.getDuration();
- }
-
- /**
- * Gets mosaic nonce.
- *
- * @return Mosaic nonce.
- */
- public getNonce(): MosaicNonceDto {
- return this.mosaicDefinitionTransactionBody.getNonce();
- }
-
- /**
- * Gets mosaic flags.
- *
- * @return Mosaic flags.
- */
- public getFlags(): number {
- return this.mosaicDefinitionTransactionBody.getFlags();
- }
-
- /**
- * Gets mosaic divisibility.
- *
- * @return Mosaic divisibility.
- */
- public getDivisibility(): number {
- return this.mosaicDefinitionTransactionBody.getDivisibility();
- }
-
- /**
- * Gets the size of the object.
- *
- * @return Size in bytes.
- */
- public getSize(): number {
- let size: number = super.getSize();
- size += this.mosaicDefinitionTransactionBody.getSize();
- return size;
- }
-
- /**
- * Serializes an object to bytes.
- *
- * @return Serialized bytes.
- */
- public serialize(): Uint8Array {
- let newArray = Uint8Array.from([]);
- const superBytes = super.serialize();
- newArray = GeneratorUtils.concatTypedArrays(newArray, superBytes);
- const mosaicDefinitionTransactionBodyBytes = this.mosaicDefinitionTransactionBody.serialize();
- newArray = GeneratorUtils.concatTypedArrays(newArray, mosaicDefinitionTransactionBodyBytes);
- return newArray;
- }
-}
diff --git a/src/infrastructure/catbuffer/MosaicExpiryReceiptBuilder.ts b/src/infrastructure/catbuffer/MosaicExpiryReceiptBuilder.ts
deleted file mode 100644
index 3940e509e5..0000000000
--- a/src/infrastructure/catbuffer/MosaicExpiryReceiptBuilder.ts
+++ /dev/null
@@ -1,92 +0,0 @@
-// tslint:disable: jsdoc-format
-/**
-*** Copyright (c) 2016-present,
-*** Jaguar0625, gimre, BloodyRookie, Tech Bureau, Corp. All rights reserved.
-***
-*** This file is part of Catapult.
-***
-*** Catapult is free software: you can redistribute it and/or modify
-*** it under the terms of the GNU Lesser General Public License as published by
-*** the Free Software Foundation, either version 3 of the License, or
-*** (at your option) any later version.
-***
-*** Catapult is distributed in the hope that it will be useful,
-*** but WITHOUT ANY WARRANTY; without even the implied warranty of
-*** MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-*** GNU Lesser General Public License for more details.
-***
-*** You should have received a copy of the GNU Lesser General Public License
-*** along with Catapult. If not, see .
-**/
-
-import { GeneratorUtils } from './GeneratorUtils';
-import { MosaicIdDto } from './MosaicIdDto';
-import { ReceiptBuilder } from './ReceiptBuilder';
-import { ReceiptTypeDto } from './ReceiptTypeDto';
-
-/** Binary layout for a mosaic expiry receipt. */
-export class MosaicExpiryReceiptBuilder extends ReceiptBuilder {
- /** Expiring mosaic id. */
- artifactId: MosaicIdDto;
-
- /**
- * Constructor.
- *
- * @param version Receipt version.
- * @param type Receipt type.
- * @param artifactId Expiring mosaic id.
- */
- public constructor(version: number, type: ReceiptTypeDto, artifactId: MosaicIdDto) {
- super(version, type);
- this.artifactId = artifactId;
- }
-
- /**
- * Creates an instance of MosaicExpiryReceiptBuilder from binary payload.
- *
- * @param payload Byte payload to use to serialize the object.
- * @return Instance of MosaicExpiryReceiptBuilder.
- */
- public static loadFromBinary(payload: Uint8Array): MosaicExpiryReceiptBuilder {
- const byteArray = Array.from(payload);
- const superObject = ReceiptBuilder.loadFromBinary(Uint8Array.from(byteArray));
- byteArray.splice(0, superObject.getSize());
- const artifactId = MosaicIdDto.loadFromBinary(Uint8Array.from(byteArray));
- byteArray.splice(0, artifactId.getSize());
- return new MosaicExpiryReceiptBuilder(superObject.version, superObject.type, artifactId);
- }
-
- /**
- * Gets expiring mosaic id.
- *
- * @return Expiring mosaic id.
- */
- public getArtifactId(): MosaicIdDto {
- return this.artifactId;
- }
-
- /**
- * Gets the size of the object.
- *
- * @return Size in bytes.
- */
- public getSize(): number {
- let size: number = super.getSize();
- size += this.artifactId.getSize();
- return size;
- }
-
- /**
- * Serializes an object to bytes.
- *
- * @return Serialized bytes.
- */
- public serialize(): Uint8Array {
- let newArray = Uint8Array.from([]);
- const superBytes = super.serialize();
- newArray = GeneratorUtils.concatTypedArrays(newArray, superBytes);
- const artifactIdBytes = this.artifactId.serialize();
- newArray = GeneratorUtils.concatTypedArrays(newArray, artifactIdBytes);
- return newArray;
- }
-}
diff --git a/src/infrastructure/catbuffer/MosaicFlagsDto.ts b/src/infrastructure/catbuffer/MosaicFlagsDto.ts
deleted file mode 100644
index 11a740ab03..0000000000
--- a/src/infrastructure/catbuffer/MosaicFlagsDto.ts
+++ /dev/null
@@ -1,33 +0,0 @@
-// tslint:disable: jsdoc-format
-/**
-*** Copyright (c) 2016-present,
-*** Jaguar0625, gimre, BloodyRookie, Tech Bureau, Corp. All rights reserved.
-***
-*** This file is part of Catapult.
-***
-*** Catapult is free software: you can redistribute it and/or modify
-*** it under the terms of the GNU Lesser General Public License as published by
-*** the Free Software Foundation, either version 3 of the License, or
-*** (at your option) any later version.
-***
-*** Catapult is distributed in the hope that it will be useful,
-*** but WITHOUT ANY WARRANTY; without even the implied warranty of
-*** MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-*** GNU Lesser General Public License for more details.
-***
-*** You should have received a copy of the GNU Lesser General Public License
-*** along with Catapult. If not, see .
-**/
-
-
-/** Enumeration of mosaic property flags. */
-export enum MosaicFlagsDto {
- /** No flags present. */
- NONE = 0,
- /** Mosaic supports supply changes even when mosaic owner owns partial supply. */
- SUPPLY_MUTABLE = 1,
- /** Mosaic supports transfers between arbitrary accounts \note when not set, mosaic can only be transferred to and from mosaic owner. */
- TRANSFERABLE = 2,
- /** Mosaic supports custom restrictions configured by mosaic owner. */
- RESTRICTABLE = 4,
-}
diff --git a/src/infrastructure/catbuffer/MosaicGlobalRestrictionTransactionBodyBuilder.ts b/src/infrastructure/catbuffer/MosaicGlobalRestrictionTransactionBodyBuilder.ts
deleted file mode 100644
index 1a868e3300..0000000000
--- a/src/infrastructure/catbuffer/MosaicGlobalRestrictionTransactionBodyBuilder.ts
+++ /dev/null
@@ -1,194 +0,0 @@
-// tslint:disable: jsdoc-format
-/**
-*** Copyright (c) 2016-present,
-*** Jaguar0625, gimre, BloodyRookie, Tech Bureau, Corp. All rights reserved.
-***
-*** This file is part of Catapult.
-***
-*** Catapult is free software: you can redistribute it and/or modify
-*** it under the terms of the GNU Lesser General Public License as published by
-*** the Free Software Foundation, either version 3 of the License, or
-*** (at your option) any later version.
-***
-*** Catapult is distributed in the hope that it will be useful,
-*** but WITHOUT ANY WARRANTY; without even the implied warranty of
-*** MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-*** GNU Lesser General Public License for more details.
-***
-*** You should have received a copy of the GNU Lesser General Public License
-*** along with Catapult. If not, see .
-**/
-
-import { GeneratorUtils } from './GeneratorUtils';
-import { MosaicRestrictionTypeDto } from './MosaicRestrictionTypeDto';
-import { UnresolvedMosaicIdDto } from './UnresolvedMosaicIdDto';
-
-/** Binary layout for a mosaic global restriction transaction. */
-export class MosaicGlobalRestrictionTransactionBodyBuilder {
- /** Identifier of the mosaic being restricted. */
- mosaicId: UnresolvedMosaicIdDto;
- /** Identifier of the mosaic providing the restriction key. */
- referenceMosaicId: UnresolvedMosaicIdDto;
- /** Restriction key relative to the reference mosaic identifier. */
- restrictionKey: number[];
- /** Previous restriction value. */
- previousRestrictionValue: number[];
- /** New restriction value. */
- newRestrictionValue: number[];
- /** Previous restriction type. */
- previousRestrictionType: MosaicRestrictionTypeDto;
- /** New restriction type. */
- newRestrictionType: MosaicRestrictionTypeDto;
-
- /**
- * Constructor.
- *
- * @param mosaicId Identifier of the mosaic being restricted.
- * @param referenceMosaicId Identifier of the mosaic providing the restriction key.
- * @param restrictionKey Restriction key relative to the reference mosaic identifier.
- * @param previousRestrictionValue Previous restriction value.
- * @param newRestrictionValue New restriction value.
- * @param previousRestrictionType Previous restriction type.
- * @param newRestrictionType New restriction type.
- */
- // tslint:disable-next-line: max-line-length
- public constructor(mosaicId: UnresolvedMosaicIdDto, referenceMosaicId: UnresolvedMosaicIdDto, restrictionKey: number[], previousRestrictionValue: number[], newRestrictionValue: number[], previousRestrictionType: MosaicRestrictionTypeDto, newRestrictionType: MosaicRestrictionTypeDto) {
- this.mosaicId = mosaicId;
- this.referenceMosaicId = referenceMosaicId;
- this.restrictionKey = restrictionKey;
- this.previousRestrictionValue = previousRestrictionValue;
- this.newRestrictionValue = newRestrictionValue;
- this.previousRestrictionType = previousRestrictionType;
- this.newRestrictionType = newRestrictionType;
- }
-
- /**
- * Creates an instance of MosaicGlobalRestrictionTransactionBodyBuilder from binary payload.
- *
- * @param payload Byte payload to use to serialize the object.
- * @return Instance of MosaicGlobalRestrictionTransactionBodyBuilder.
- */
- public static loadFromBinary(payload: Uint8Array): MosaicGlobalRestrictionTransactionBodyBuilder {
- const byteArray = Array.from(payload);
- const mosaicId = UnresolvedMosaicIdDto.loadFromBinary(Uint8Array.from(byteArray));
- byteArray.splice(0, mosaicId.getSize());
- const referenceMosaicId = UnresolvedMosaicIdDto.loadFromBinary(Uint8Array.from(byteArray));
- byteArray.splice(0, referenceMosaicId.getSize());
- const restrictionKey = GeneratorUtils.bufferToUint64(GeneratorUtils.getBytes(Uint8Array.from(byteArray), 8));
- byteArray.splice(0, 8);
- const previousRestrictionValue = GeneratorUtils.bufferToUint64(GeneratorUtils.getBytes(Uint8Array.from(byteArray), 8));
- byteArray.splice(0, 8);
- const newRestrictionValue = GeneratorUtils.bufferToUint64(GeneratorUtils.getBytes(Uint8Array.from(byteArray), 8));
- byteArray.splice(0, 8);
- const previousRestrictionType = GeneratorUtils.bufferToUint(GeneratorUtils.getBytes(Uint8Array.from(byteArray), 1));
- byteArray.splice(0, 1);
- const newRestrictionType = GeneratorUtils.bufferToUint(GeneratorUtils.getBytes(Uint8Array.from(byteArray), 1));
- byteArray.splice(0, 1);
- // tslint:disable-next-line: max-line-length
- return new MosaicGlobalRestrictionTransactionBodyBuilder(mosaicId, referenceMosaicId, restrictionKey, previousRestrictionValue, newRestrictionValue, previousRestrictionType, newRestrictionType);
- }
-
- /**
- * Gets identifier of the mosaic being restricted.
- *
- * @return Identifier of the mosaic being restricted.
- */
- public getMosaicId(): UnresolvedMosaicIdDto {
- return this.mosaicId;
- }
-
- /**
- * Gets identifier of the mosaic providing the restriction key.
- *
- * @return Identifier of the mosaic providing the restriction key.
- */
- public getReferenceMosaicId(): UnresolvedMosaicIdDto {
- return this.referenceMosaicId;
- }
-
- /**
- * Gets restriction key relative to the reference mosaic identifier.
- *
- * @return Restriction key relative to the reference mosaic identifier.
- */
- public getRestrictionKey(): number[] {
- return this.restrictionKey;
- }
-
- /**
- * Gets previous restriction value.
- *
- * @return Previous restriction value.
- */
- public getPreviousRestrictionValue(): number[] {
- return this.previousRestrictionValue;
- }
-
- /**
- * Gets new restriction value.
- *
- * @return New restriction value.
- */
- public getNewRestrictionValue(): number[] {
- return this.newRestrictionValue;
- }
-
- /**
- * Gets previous restriction type.
- *
- * @return Previous restriction type.
- */
- public getPreviousRestrictionType(): MosaicRestrictionTypeDto {
- return this.previousRestrictionType;
- }
-
- /**
- * Gets new restriction type.
- *
- * @return New restriction type.
- */
- public getNewRestrictionType(): MosaicRestrictionTypeDto {
- return this.newRestrictionType;
- }
-
- /**
- * Gets the size of the object.
- *
- * @return Size in bytes.
- */
- public getSize(): number {
- let size = 0;
- size += this.mosaicId.getSize();
- size += this.referenceMosaicId.getSize();
- size += 8; // restrictionKey
- size += 8; // previousRestrictionValue
- size += 8; // newRestrictionValue
- size += 1; // previousRestrictionType
- size += 1; // newRestrictionType
- return size;
- }
-
- /**
- * Serializes an object to bytes.
- *
- * @return Serialized bytes.
- */
- public serialize(): Uint8Array {
- let newArray = Uint8Array.from([]);
- const mosaicIdBytes = this.mosaicId.serialize();
- newArray = GeneratorUtils.concatTypedArrays(newArray, mosaicIdBytes);
- const referenceMosaicIdBytes = this.referenceMosaicId.serialize();
- newArray = GeneratorUtils.concatTypedArrays(newArray, referenceMosaicIdBytes);
- const restrictionKeyBytes = GeneratorUtils.uint64ToBuffer(this.getRestrictionKey());
- newArray = GeneratorUtils.concatTypedArrays(newArray, restrictionKeyBytes);
- const previousRestrictionValueBytes = GeneratorUtils.uint64ToBuffer(this.getPreviousRestrictionValue());
- newArray = GeneratorUtils.concatTypedArrays(newArray, previousRestrictionValueBytes);
- const newRestrictionValueBytes = GeneratorUtils.uint64ToBuffer(this.getNewRestrictionValue());
- newArray = GeneratorUtils.concatTypedArrays(newArray, newRestrictionValueBytes);
- const previousRestrictionTypeBytes = GeneratorUtils.uintToBuffer(this.previousRestrictionType, 1);
- newArray = GeneratorUtils.concatTypedArrays(newArray, previousRestrictionTypeBytes);
- const newRestrictionTypeBytes = GeneratorUtils.uintToBuffer(this.newRestrictionType, 1);
- newArray = GeneratorUtils.concatTypedArrays(newArray, newRestrictionTypeBytes);
- return newArray;
- }
-}
diff --git a/src/infrastructure/catbuffer/MosaicGlobalRestrictionTransactionBuilder.ts b/src/infrastructure/catbuffer/MosaicGlobalRestrictionTransactionBuilder.ts
deleted file mode 100644
index 38d901b70c..0000000000
--- a/src/infrastructure/catbuffer/MosaicGlobalRestrictionTransactionBuilder.ts
+++ /dev/null
@@ -1,168 +0,0 @@
-// tslint:disable: jsdoc-format
-/**
-*** Copyright (c) 2016-present,
-*** Jaguar0625, gimre, BloodyRookie, Tech Bureau, Corp. All rights reserved.
-***
-*** This file is part of Catapult.
-***
-*** Catapult is free software: you can redistribute it and/or modify
-*** it under the terms of the GNU Lesser General Public License as published by
-*** the Free Software Foundation, either version 3 of the License, or
-*** (at your option) any later version.
-***
-*** Catapult is distributed in the hope that it will be useful,
-*** but WITHOUT ANY WARRANTY; without even the implied warranty of
-*** MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-*** GNU Lesser General Public License for more details.
-***
-*** You should have received a copy of the GNU Lesser General Public License
-*** along with Catapult. If not, see .
-**/
-
-import { AmountDto } from './AmountDto';
-import { EntityTypeDto } from './EntityTypeDto';
-import { GeneratorUtils } from './GeneratorUtils';
-import { KeyDto } from './KeyDto';
-import { MosaicGlobalRestrictionTransactionBodyBuilder } from './MosaicGlobalRestrictionTransactionBodyBuilder';
-import { MosaicRestrictionTypeDto } from './MosaicRestrictionTypeDto';
-import { NetworkTypeDto } from './NetworkTypeDto';
-import { SignatureDto } from './SignatureDto';
-import { TimestampDto } from './TimestampDto';
-import { TransactionBuilder } from './TransactionBuilder';
-import { UnresolvedMosaicIdDto } from './UnresolvedMosaicIdDto';
-
-/** Binary layout for a non-embedded mosaic global restriction transaction. */
-export class MosaicGlobalRestrictionTransactionBuilder extends TransactionBuilder {
- /** Mosaic global restriction transaction body. */
- mosaicGlobalRestrictionTransactionBody: MosaicGlobalRestrictionTransactionBodyBuilder;
-
- /**
- * Constructor.
- *
- * @param signature Entity signature.
- * @param signerPublicKey Entity signer's public key.
- * @param version Entity version.
- * @param network Entity network.
- * @param type Entity type.
- * @param fee Transaction fee.
- * @param deadline Transaction deadline.
- * @param mosaicId Identifier of the mosaic being restricted.
- * @param referenceMosaicId Identifier of the mosaic providing the restriction key.
- * @param restrictionKey Restriction key relative to the reference mosaic identifier.
- * @param previousRestrictionValue Previous restriction value.
- * @param newRestrictionValue New restriction value.
- * @param previousRestrictionType Previous restriction type.
- * @param newRestrictionType New restriction type.
- */
- // tslint:disable-next-line: max-line-length
- public constructor(signature: SignatureDto, signerPublicKey: KeyDto, version: number, network: NetworkTypeDto, type: EntityTypeDto, fee: AmountDto, deadline: TimestampDto, mosaicId: UnresolvedMosaicIdDto, referenceMosaicId: UnresolvedMosaicIdDto, restrictionKey: number[], previousRestrictionValue: number[], newRestrictionValue: number[], previousRestrictionType: MosaicRestrictionTypeDto, newRestrictionType: MosaicRestrictionTypeDto) {
- super(signature, signerPublicKey, version, network, type, fee, deadline);
- // tslint:disable-next-line: max-line-length
- this.mosaicGlobalRestrictionTransactionBody = new MosaicGlobalRestrictionTransactionBodyBuilder(mosaicId, referenceMosaicId, restrictionKey, previousRestrictionValue, newRestrictionValue, previousRestrictionType, newRestrictionType);
- }
-
- /**
- * Creates an instance of MosaicGlobalRestrictionTransactionBuilder from binary payload.
- *
- * @param payload Byte payload to use to serialize the object.
- * @return Instance of MosaicGlobalRestrictionTransactionBuilder.
- */
- public static loadFromBinary(payload: Uint8Array): MosaicGlobalRestrictionTransactionBuilder {
- const byteArray = Array.from(payload);
- const superObject = TransactionBuilder.loadFromBinary(Uint8Array.from(byteArray));
- byteArray.splice(0, superObject.getSize());
- // tslint:disable-next-line: max-line-length
- const mosaicGlobalRestrictionTransactionBody = MosaicGlobalRestrictionTransactionBodyBuilder.loadFromBinary(Uint8Array.from(byteArray));
- byteArray.splice(0, mosaicGlobalRestrictionTransactionBody.getSize());
- // tslint:disable-next-line: max-line-length
- return new MosaicGlobalRestrictionTransactionBuilder(superObject.signature, superObject.signerPublicKey, superObject.version, superObject.network, superObject.type, superObject.fee, superObject.deadline, mosaicGlobalRestrictionTransactionBody.mosaicId, mosaicGlobalRestrictionTransactionBody.referenceMosaicId, mosaicGlobalRestrictionTransactionBody.restrictionKey, mosaicGlobalRestrictionTransactionBody.previousRestrictionValue, mosaicGlobalRestrictionTransactionBody.newRestrictionValue, mosaicGlobalRestrictionTransactionBody.previousRestrictionType, mosaicGlobalRestrictionTransactionBody.newRestrictionType);
- }
-
- /**
- * Gets identifier of the mosaic being restricted.
- *
- * @return Identifier of the mosaic being restricted.
- */
- public getMosaicId(): UnresolvedMosaicIdDto {
- return this.mosaicGlobalRestrictionTransactionBody.getMosaicId();
- }
-
- /**
- * Gets identifier of the mosaic providing the restriction key.
- *
- * @return Identifier of the mosaic providing the restriction key.
- */
- public getReferenceMosaicId(): UnresolvedMosaicIdDto {
- return this.mosaicGlobalRestrictionTransactionBody.getReferenceMosaicId();
- }
-
- /**
- * Gets restriction key relative to the reference mosaic identifier.
- *
- * @return Restriction key relative to the reference mosaic identifier.
- */
- public getRestrictionKey(): number[] {
- return this.mosaicGlobalRestrictionTransactionBody.getRestrictionKey();
- }
-
- /**
- * Gets previous restriction value.
- *
- * @return Previous restriction value.
- */
- public getPreviousRestrictionValue(): number[] {
- return this.mosaicGlobalRestrictionTransactionBody.getPreviousRestrictionValue();
- }
-
- /**
- * Gets new restriction value.
- *
- * @return New restriction value.
- */
- public getNewRestrictionValue(): number[] {
- return this.mosaicGlobalRestrictionTransactionBody.getNewRestrictionValue();
- }
-
- /**
- * Gets previous restriction type.
- *
- * @return Previous restriction type.
- */
- public getPreviousRestrictionType(): MosaicRestrictionTypeDto {
- return this.mosaicGlobalRestrictionTransactionBody.getPreviousRestrictionType();
- }
-
- /**
- * Gets new restriction type.
- *
- * @return New restriction type.
- */
- public getNewRestrictionType(): MosaicRestrictionTypeDto {
- return this.mosaicGlobalRestrictionTransactionBody.getNewRestrictionType();
- }
-
- /**
- * Gets the size of the object.
- *
- * @return Size in bytes.
- */
- public getSize(): number {
- let size: number = super.getSize();
- size += this.mosaicGlobalRestrictionTransactionBody.getSize();
- return size;
- }
-
- /**
- * Serializes an object to bytes.
- *
- * @return Serialized bytes.
- */
- public serialize(): Uint8Array {
- let newArray = Uint8Array.from([]);
- const superBytes = super.serialize();
- newArray = GeneratorUtils.concatTypedArrays(newArray, superBytes);
- const mosaicGlobalRestrictionTransactionBodyBytes = this.mosaicGlobalRestrictionTransactionBody.serialize();
- newArray = GeneratorUtils.concatTypedArrays(newArray, mosaicGlobalRestrictionTransactionBodyBytes);
- return newArray;
- }
-}
diff --git a/src/infrastructure/catbuffer/MosaicIdDto.ts b/src/infrastructure/catbuffer/MosaicIdDto.ts
deleted file mode 100644
index dd88e70b01..0000000000
--- a/src/infrastructure/catbuffer/MosaicIdDto.ts
+++ /dev/null
@@ -1,80 +0,0 @@
-// tslint:disable: jsdoc-format
-/**
-*** Copyright (c) 2016-present,
-*** Jaguar0625, gimre, BloodyRookie, Tech Bureau, Corp. All rights reserved.
-***
-*** This file is part of Catapult.
-***
-*** Catapult is free software: you can redistribute it and/or modify
-*** it under the terms of the GNU Lesser General Public License as published by
-*** the Free Software Foundation, either version 3 of the License, or
-*** (at your option) any later version.
-***
-*** Catapult is distributed in the hope that it will be useful,
-*** but WITHOUT ANY WARRANTY; without even the implied warranty of
-*** MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-*** GNU Lesser General Public License for more details.
-***
-*** You should have received a copy of the GNU Lesser General Public License
-*** along with Catapult. If not, see .
-**/
-
-import { GeneratorUtils } from './GeneratorUtils';
-
-/** Mosaic id. */
-export class MosaicIdDto {
- /** Mosaic id. */
- mosaicId: number[];
-
- /**
- * Constructor.
- *
- * @param mosaicId Mosaic id.
- */
- constructor(mosaicId: number[]) {
- this.mosaicId = mosaicId;
- }
-
- /**
- * Creates an instance of MosaicIdDto from binary payload.
- *
- * @param payload Byte payload to use to serialize the object.
- * @return Instance of MosaicIdDto.
- */
- public static loadFromBinary(payload: Uint8Array): MosaicIdDto {
- const byteArray = Array.from(payload);
- const mosaicId = GeneratorUtils.bufferToUint64(GeneratorUtils.getBytes(Uint8Array.from(byteArray), 8));
- byteArray.splice(0, 8);
- return new MosaicIdDto(mosaicId);
- }
-
- /**
- * Gets Mosaic id.
- *
- * @return Mosaic id.
- */
- public getMosaicId(): number[] {
- return this.mosaicId;
- }
-
- /**
- * Gets the size of the object.
- *
- * @return Size in bytes.
- */
- public getSize(): number {
- return 8;
- }
-
- /**
- * Serializes an object to bytes.
- *
- * @return Serialized bytes.
- */
- public serialize(): Uint8Array {
- let newArray = Uint8Array.from([]);
- const mosaicIdBytes = GeneratorUtils.uint64ToBuffer(this.getMosaicId());
- newArray = GeneratorUtils.concatTypedArrays(newArray, mosaicIdBytes);
- return newArray;
- }
-}
diff --git a/src/infrastructure/catbuffer/MosaicMetadataTransactionBodyBuilder.ts b/src/infrastructure/catbuffer/MosaicMetadataTransactionBodyBuilder.ts
deleted file mode 100644
index a4ee75bcbc..0000000000
--- a/src/infrastructure/catbuffer/MosaicMetadataTransactionBodyBuilder.ts
+++ /dev/null
@@ -1,168 +0,0 @@
-// tslint:disable: jsdoc-format
-/**
-*** Copyright (c) 2016-present,
-*** Jaguar0625, gimre, BloodyRookie, Tech Bureau, Corp. All rights reserved.
-***
-*** This file is part of Catapult.
-***
-*** Catapult is free software: you can redistribute it and/or modify
-*** it under the terms of the GNU Lesser General Public License as published by
-*** the Free Software Foundation, either version 3 of the License, or
-*** (at your option) any later version.
-***
-*** Catapult is distributed in the hope that it will be useful,
-*** but WITHOUT ANY WARRANTY; without even the implied warranty of
-*** MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-*** GNU Lesser General Public License for more details.
-***
-*** You should have received a copy of the GNU Lesser General Public License
-*** along with Catapult. If not, see .
-**/
-
-import { GeneratorUtils } from './GeneratorUtils';
-import { KeyDto } from './KeyDto';
-import { UnresolvedMosaicIdDto } from './UnresolvedMosaicIdDto';
-
-/** Binary layout for a mosaic metadata transaction. */
-export class MosaicMetadataTransactionBodyBuilder {
- /** Metadata target public key. */
- targetPublicKey: KeyDto;
- /** Metadata key scoped to source, target and type. */
- scopedMetadataKey: number[];
- /** Target mosaic identifier. */
- targetMosaicId: UnresolvedMosaicIdDto;
- /** Change in value size in bytes. */
- valueSizeDelta: number;
- /** Difference between existing value and new value \note when there is no existing value, new value is same this value \note when there is an existing value, new value is calculated as xor(previous-value, value). */
- value: Uint8Array;
-
- /**
- * Constructor.
- *
- * @param targetPublicKey Metadata target public key.
- * @param scopedMetadataKey Metadata key scoped to source, target and type.
- * @param targetMosaicId Target mosaic identifier.
- * @param valueSizeDelta Change in value size in bytes.
- * @param value Difference between existing value and new value.
- * @note when there is no existing value, new value is same this value.
- * @note when there is an existing value, new value is calculated as xor(previous-value, value).
- */
- // tslint:disable-next-line: max-line-length
- public constructor(targetPublicKey: KeyDto, scopedMetadataKey: number[], targetMosaicId: UnresolvedMosaicIdDto, valueSizeDelta: number, value: Uint8Array) {
- this.targetPublicKey = targetPublicKey;
- this.scopedMetadataKey = scopedMetadataKey;
- this.targetMosaicId = targetMosaicId;
- this.valueSizeDelta = valueSizeDelta;
- this.value = value;
- }
-
- /**
- * Creates an instance of MosaicMetadataTransactionBodyBuilder from binary payload.
- *
- * @param payload Byte payload to use to serialize the object.
- * @return Instance of MosaicMetadataTransactionBodyBuilder.
- */
- public static loadFromBinary(payload: Uint8Array): MosaicMetadataTransactionBodyBuilder {
- const byteArray = Array.from(payload);
- const targetPublicKey = KeyDto.loadFromBinary(Uint8Array.from(byteArray));
- byteArray.splice(0, targetPublicKey.getSize());
- const scopedMetadataKey = GeneratorUtils.bufferToUint64(GeneratorUtils.getBytes(Uint8Array.from(byteArray), 8));
- byteArray.splice(0, 8);
- const targetMosaicId = UnresolvedMosaicIdDto.loadFromBinary(Uint8Array.from(byteArray));
- byteArray.splice(0, targetMosaicId.getSize());
- const valueSizeDelta = GeneratorUtils.bufferToUint(GeneratorUtils.getBytes(Uint8Array.from(byteArray), 2));
- byteArray.splice(0, 2);
- const valueSize = GeneratorUtils.bufferToUint(GeneratorUtils.getBytes(Uint8Array.from(byteArray), 2));
- byteArray.splice(0, 2);
- const value = GeneratorUtils.getBytes(Uint8Array.from(byteArray), valueSize);
- byteArray.splice(0, valueSize);
- // tslint:disable-next-line: max-line-length
- return new MosaicMetadataTransactionBodyBuilder(targetPublicKey, scopedMetadataKey, targetMosaicId, valueSizeDelta, value);
- }
-
- /**
- * Gets metadata target public key.
- *
- * @return Metadata target public key.
- */
- public getTargetPublicKey(): KeyDto {
- return this.targetPublicKey;
- }
-
- /**
- * Gets metadata key scoped to source, target and type.
- *
- * @return Metadata key scoped to source, target and type.
- */
- public getScopedMetadataKey(): number[] {
- return this.scopedMetadataKey;
- }
-
- /**
- * Gets target mosaic identifier.
- *
- * @return Target mosaic identifier.
- */
- public getTargetMosaicId(): UnresolvedMosaicIdDto {
- return this.targetMosaicId;
- }
-
- /**
- * Gets change in value size in bytes.
- *
- * @return Change in value size in bytes.
- */
- public getValueSizeDelta(): number {
- return this.valueSizeDelta;
- }
-
- /**
- * Gets difference between existing value and new value.
- * @note when there is no existing value, new value is same this value.
- * @note when there is an existing value, new value is calculated as xor(previous-value, value).
- *
- * @return Difference between existing value and new value.
- * @note when there is no existing value, new value is same this value.
- * @note when there is an existing value, new value is calculated as xor(previous-value, value).
- */
- public getValue(): Uint8Array {
- return this.value;
- }
-
- /**
- * Gets the size of the object.
- *
- * @return Size in bytes.
- */
- public getSize(): number {
- let size = 0;
- size += this.targetPublicKey.getSize();
- size += 8; // scopedMetadataKey
- size += this.targetMosaicId.getSize();
- size += 2; // valueSizeDelta
- size += 2; // valueSize
- size += this.value.length;
- return size;
- }
-
- /**
- * Serializes an object to bytes.
- *
- * @return Serialized bytes.
- */
- public serialize(): Uint8Array {
- let newArray = Uint8Array.from([]);
- const targetPublicKeyBytes = this.targetPublicKey.serialize();
- newArray = GeneratorUtils.concatTypedArrays(newArray, targetPublicKeyBytes);
- const scopedMetadataKeyBytes = GeneratorUtils.uint64ToBuffer(this.getScopedMetadataKey());
- newArray = GeneratorUtils.concatTypedArrays(newArray, scopedMetadataKeyBytes);
- const targetMosaicIdBytes = this.targetMosaicId.serialize();
- newArray = GeneratorUtils.concatTypedArrays(newArray, targetMosaicIdBytes);
- const valueSizeDeltaBytes = GeneratorUtils.uintToBuffer(this.getValueSizeDelta(), 2);
- newArray = GeneratorUtils.concatTypedArrays(newArray, valueSizeDeltaBytes);
- const valueSizeBytes = GeneratorUtils.uintToBuffer(this.value.length, 2);
- newArray = GeneratorUtils.concatTypedArrays(newArray, valueSizeBytes);
- newArray = GeneratorUtils.concatTypedArrays(newArray, this.value);
- return newArray;
- }
-}
diff --git a/src/infrastructure/catbuffer/MosaicMetadataTransactionBuilder.ts b/src/infrastructure/catbuffer/MosaicMetadataTransactionBuilder.ts
deleted file mode 100644
index 1723367f05..0000000000
--- a/src/infrastructure/catbuffer/MosaicMetadataTransactionBuilder.ts
+++ /dev/null
@@ -1,152 +0,0 @@
-// tslint:disable: jsdoc-format
-/**
-*** Copyright (c) 2016-present,
-*** Jaguar0625, gimre, BloodyRookie, Tech Bureau, Corp. All rights reserved.
-***
-*** This file is part of Catapult.
-***
-*** Catapult is free software: you can redistribute it and/or modify
-*** it under the terms of the GNU Lesser General Public License as published by
-*** the Free Software Foundation, either version 3 of the License, or
-*** (at your option) any later version.
-***
-*** Catapult is distributed in the hope that it will be useful,
-*** but WITHOUT ANY WARRANTY; without even the implied warranty of
-*** MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-*** GNU Lesser General Public License for more details.
-***
-*** You should have received a copy of the GNU Lesser General Public License
-*** along with Catapult. If not, see .
-**/
-
-import { AmountDto } from './AmountDto';
-import { EntityTypeDto } from './EntityTypeDto';
-import { GeneratorUtils } from './GeneratorUtils';
-import { KeyDto } from './KeyDto';
-import { MosaicMetadataTransactionBodyBuilder } from './MosaicMetadataTransactionBodyBuilder';
-import { NetworkTypeDto } from './NetworkTypeDto';
-import { SignatureDto } from './SignatureDto';
-import { TimestampDto } from './TimestampDto';
-import { TransactionBuilder } from './TransactionBuilder';
-import { UnresolvedMosaicIdDto } from './UnresolvedMosaicIdDto';
-
-/** Binary layout for a non-embedded mosaic metadata transaction. */
-export class MosaicMetadataTransactionBuilder extends TransactionBuilder {
- /** Mosaic metadata transaction body. */
- mosaicMetadataTransactionBody: MosaicMetadataTransactionBodyBuilder;
-
- /**
- * Constructor.
- *
- * @param signature Entity signature.
- * @param signerPublicKey Entity signer's public key.
- * @param version Entity version.
- * @param network Entity network.
- * @param type Entity type.
- * @param fee Transaction fee.
- * @param deadline Transaction deadline.
- * @param targetPublicKey Metadata target public key.
- * @param scopedMetadataKey Metadata key scoped to source, target and type.
- * @param targetMosaicId Target mosaic identifier.
- * @param valueSizeDelta Change in value size in bytes.
- * @param value Difference between existing value and new value.
- * @note when there is no existing value, new value is same this value.
- * @note when there is an existing value, new value is calculated as xor(previous-value, value).
- */
- // tslint:disable-next-line: max-line-length
- public constructor(signature: SignatureDto, signerPublicKey: KeyDto, version: number, network: NetworkTypeDto, type: EntityTypeDto, fee: AmountDto, deadline: TimestampDto, targetPublicKey: KeyDto, scopedMetadataKey: number[], targetMosaicId: UnresolvedMosaicIdDto, valueSizeDelta: number, value: Uint8Array) {
- super(signature, signerPublicKey, version, network, type, fee, deadline);
- // tslint:disable-next-line: max-line-length
- this.mosaicMetadataTransactionBody = new MosaicMetadataTransactionBodyBuilder(targetPublicKey, scopedMetadataKey, targetMosaicId, valueSizeDelta, value);
- }
-
- /**
- * Creates an instance of MosaicMetadataTransactionBuilder from binary payload.
- *
- * @param payload Byte payload to use to serialize the object.
- * @return Instance of MosaicMetadataTransactionBuilder.
- */
- public static loadFromBinary(payload: Uint8Array): MosaicMetadataTransactionBuilder {
- const byteArray = Array.from(payload);
- const superObject = TransactionBuilder.loadFromBinary(Uint8Array.from(byteArray));
- byteArray.splice(0, superObject.getSize());
- const mosaicMetadataTransactionBody = MosaicMetadataTransactionBodyBuilder.loadFromBinary(Uint8Array.from(byteArray));
- byteArray.splice(0, mosaicMetadataTransactionBody.getSize());
- // tslint:disable-next-line: max-line-length
- return new MosaicMetadataTransactionBuilder(superObject.signature, superObject.signerPublicKey, superObject.version, superObject.network, superObject.type, superObject.fee, superObject.deadline, mosaicMetadataTransactionBody.targetPublicKey, mosaicMetadataTransactionBody.scopedMetadataKey, mosaicMetadataTransactionBody.targetMosaicId, mosaicMetadataTransactionBody.valueSizeDelta, mosaicMetadataTransactionBody.value);
- }
-
- /**
- * Gets metadata target public key.
- *
- * @return Metadata target public key.
- */
- public getTargetPublicKey(): KeyDto {
- return this.mosaicMetadataTransactionBody.getTargetPublicKey();
- }
-
- /**
- * Gets metadata key scoped to source, target and type.
- *
- * @return Metadata key scoped to source, target and type.
- */
- public getScopedMetadataKey(): number[] {
- return this.mosaicMetadataTransactionBody.getScopedMetadataKey();
- }
-
- /**
- * Gets target mosaic identifier.
- *
- * @return Target mosaic identifier.
- */
- public getTargetMosaicId(): UnresolvedMosaicIdDto {
- return this.mosaicMetadataTransactionBody.getTargetMosaicId();
- }
-
- /**
- * Gets change in value size in bytes.
- *
- * @return Change in value size in bytes.
- */
- public getValueSizeDelta(): number {
- return this.mosaicMetadataTransactionBody.getValueSizeDelta();
- }
-
- /**
- * Gets difference between existing value and new value.
- * @note when there is no existing value, new value is same this value.
- * @note when there is an existing value, new value is calculated as xor(previous-value, value).
- *
- * @return Difference between existing value and new value.
- * @note when there is no existing value, new value is same this value.
- * @note when there is an existing value, new value is calculated as xor(previous-value, value).
- */
- public getValue(): Uint8Array {
- return this.mosaicMetadataTransactionBody.getValue();
- }
-
- /**
- * Gets the size of the object.
- *
- * @return Size in bytes.
- */
- public getSize(): number {
- let size: number = super.getSize();
- size += this.mosaicMetadataTransactionBody.getSize();
- return size;
- }
-
- /**
- * Serializes an object to bytes.
- *
- * @return Serialized bytes.
- */
- public serialize(): Uint8Array {
- let newArray = Uint8Array.from([]);
- const superBytes = super.serialize();
- newArray = GeneratorUtils.concatTypedArrays(newArray, superBytes);
- const mosaicMetadataTransactionBodyBytes = this.mosaicMetadataTransactionBody.serialize();
- newArray = GeneratorUtils.concatTypedArrays(newArray, mosaicMetadataTransactionBodyBytes);
- return newArray;
- }
-}
diff --git a/src/infrastructure/catbuffer/MosaicNonceDto.ts b/src/infrastructure/catbuffer/MosaicNonceDto.ts
deleted file mode 100644
index 82db3703e0..0000000000
--- a/src/infrastructure/catbuffer/MosaicNonceDto.ts
+++ /dev/null
@@ -1,80 +0,0 @@
-// tslint:disable: jsdoc-format
-/**
-*** Copyright (c) 2016-present,
-*** Jaguar0625, gimre, BloodyRookie, Tech Bureau, Corp. All rights reserved.
-***
-*** This file is part of Catapult.
-***
-*** Catapult is free software: you can redistribute it and/or modify
-*** it under the terms of the GNU Lesser General Public License as published by
-*** the Free Software Foundation, either version 3 of the License, or
-*** (at your option) any later version.
-***
-*** Catapult is distributed in the hope that it will be useful,
-*** but WITHOUT ANY WARRANTY; without even the implied warranty of
-*** MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-*** GNU Lesser General Public License for more details.
-***
-*** You should have received a copy of the GNU Lesser General Public License
-*** along with Catapult. If not, see .
-**/
-
-import { GeneratorUtils } from './GeneratorUtils';
-
-/** Mosaic nonce. */
-export class MosaicNonceDto {
- /** Mosaic nonce. */
- mosaicNonce: number;
-
- /**
- * Constructor.
- *
- * @param mosaicNonce Mosaic nonce.
- */
- constructor(mosaicNonce: number) {
- this.mosaicNonce = mosaicNonce;
- }
-
- /**
- * Creates an instance of MosaicNonceDto from binary payload.
- *
- * @param payload Byte payload to use to serialize the object.
- * @return Instance of MosaicNonceDto.
- */
- public static loadFromBinary(payload: Uint8Array): MosaicNonceDto {
- const byteArray = Array.from(payload);
- const mosaicNonce = GeneratorUtils.bufferToUint(GeneratorUtils.getBytes(Uint8Array.from(byteArray), 4));
- byteArray.splice(0, 4);
- return new MosaicNonceDto(mosaicNonce);
- }
-
- /**
- * Gets Mosaic nonce.
- *
- * @return Mosaic nonce.
- */
- public getMosaicNonce(): number {
- return this.mosaicNonce;
- }
-
- /**
- * Gets the size of the object.
- *
- * @return Size in bytes.
- */
- public getSize(): number {
- return 4;
- }
-
- /**
- * Serializes an object to bytes.
- *
- * @return Serialized bytes.
- */
- public serialize(): Uint8Array {
- let newArray = Uint8Array.from([]);
- const mosaicNonceBytes = GeneratorUtils.uintToBuffer(this.getMosaicNonce(), 4);
- newArray = GeneratorUtils.concatTypedArrays(newArray, mosaicNonceBytes);
- return newArray;
- }
-}
diff --git a/src/infrastructure/catbuffer/MosaicRestrictionTypeDto.ts b/src/infrastructure/catbuffer/MosaicRestrictionTypeDto.ts
deleted file mode 100644
index 78b5f8d179..0000000000
--- a/src/infrastructure/catbuffer/MosaicRestrictionTypeDto.ts
+++ /dev/null
@@ -1,39 +0,0 @@
-// tslint:disable: jsdoc-format
-/**
-*** Copyright (c) 2016-present,
-*** Jaguar0625, gimre, BloodyRookie, Tech Bureau, Corp. All rights reserved.
-***
-*** This file is part of Catapult.
-***
-*** Catapult is free software: you can redistribute it and/or modify
-*** it under the terms of the GNU Lesser General Public License as published by
-*** the Free Software Foundation, either version 3 of the License, or
-*** (at your option) any later version.
-***
-*** Catapult is distributed in the hope that it will be useful,
-*** but WITHOUT ANY WARRANTY; without even the implied warranty of
-*** MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-*** GNU Lesser General Public License for more details.
-***
-*** You should have received a copy of the GNU Lesser General Public License
-*** along with Catapult. If not, see .
-**/
-
-
-/** Enumeration of mosaic restriction types. */
-export enum MosaicRestrictionTypeDto {
- /** Uninitialized value indicating no restriction. */
- NONE = 0,
- /** Allow if equal. */
- EQ = 1,
- /** Allow if not equal. */
- NE = 2,
- /** Allow if less than. */
- LT = 3,
- /** Allow if less than or equal. */
- LE = 4,
- /** Allow if greater than. */
- GT = 5,
- /** Allow if greater than or equal. */
- GE = 6,
-}
diff --git a/src/infrastructure/catbuffer/MosaicSupplyChangeActionDto.ts b/src/infrastructure/catbuffer/MosaicSupplyChangeActionDto.ts
deleted file mode 100644
index eafa2d5b4e..0000000000
--- a/src/infrastructure/catbuffer/MosaicSupplyChangeActionDto.ts
+++ /dev/null
@@ -1,29 +0,0 @@
-// tslint:disable: jsdoc-format
-/**
-*** Copyright (c) 2016-present,
-*** Jaguar0625, gimre, BloodyRookie, Tech Bureau, Corp. All rights reserved.
-***
-*** This file is part of Catapult.
-***
-*** Catapult is free software: you can redistribute it and/or modify
-*** it under the terms of the GNU Lesser General Public License as published by
-*** the Free Software Foundation, either version 3 of the License, or
-*** (at your option) any later version.
-***
-*** Catapult is distributed in the hope that it will be useful,
-*** but WITHOUT ANY WARRANTY; without even the implied warranty of
-*** MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-*** GNU Lesser General Public License for more details.
-***
-*** You should have received a copy of the GNU Lesser General Public License
-*** along with Catapult. If not, see .
-**/
-
-
-/** Enumeration of mosaic supply change actions. */
-export enum MosaicSupplyChangeActionDto {
- /** Decreases the supply. */
- DECREASE = 0,
- /** Increases the supply. */
- INCREASE = 1,
-}
diff --git a/src/infrastructure/catbuffer/MosaicSupplyChangeTransactionBodyBuilder.ts b/src/infrastructure/catbuffer/MosaicSupplyChangeTransactionBodyBuilder.ts
deleted file mode 100644
index 8ee846e93e..0000000000
--- a/src/infrastructure/catbuffer/MosaicSupplyChangeTransactionBodyBuilder.ts
+++ /dev/null
@@ -1,121 +0,0 @@
-// tslint:disable: jsdoc-format
-/**
-*** Copyright (c) 2016-present,
-*** Jaguar0625, gimre, BloodyRookie, Tech Bureau, Corp. All rights reserved.
-***
-*** This file is part of Catapult.
-***
-*** Catapult is free software: you can redistribute it and/or modify
-*** it under the terms of the GNU Lesser General Public License as published by
-*** the Free Software Foundation, either version 3 of the License, or
-*** (at your option) any later version.
-***
-*** Catapult is distributed in the hope that it will be useful,
-*** but WITHOUT ANY WARRANTY; without even the implied warranty of
-*** MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-*** GNU Lesser General Public License for more details.
-***
-*** You should have received a copy of the GNU Lesser General Public License
-*** along with Catapult. If not, see .
-**/
-
-import { AmountDto } from './AmountDto';
-import { GeneratorUtils } from './GeneratorUtils';
-import { MosaicSupplyChangeActionDto } from './MosaicSupplyChangeActionDto';
-import { UnresolvedMosaicIdDto } from './UnresolvedMosaicIdDto';
-
-/** Binary layout for a mosaic supply change transaction. */
-export class MosaicSupplyChangeTransactionBodyBuilder {
- /** Affected mosaic identifier. */
- mosaicId: UnresolvedMosaicIdDto;
- /** Change amount. */
- delta: AmountDto;
- /** Supply change action. */
- action: MosaicSupplyChangeActionDto;
-
- /**
- * Constructor.
- *
- * @param mosaicId Affected mosaic identifier.
- * @param delta Change amount.
- * @param action Supply change action.
- */
- public constructor(mosaicId: UnresolvedMosaicIdDto, delta: AmountDto, action: MosaicSupplyChangeActionDto) {
- this.mosaicId = mosaicId;
- this.delta = delta;
- this.action = action;
- }
-
- /**
- * Creates an instance of MosaicSupplyChangeTransactionBodyBuilder from binary payload.
- *
- * @param payload Byte payload to use to serialize the object.
- * @return Instance of MosaicSupplyChangeTransactionBodyBuilder.
- */
- public static loadFromBinary(payload: Uint8Array): MosaicSupplyChangeTransactionBodyBuilder {
- const byteArray = Array.from(payload);
- const mosaicId = UnresolvedMosaicIdDto.loadFromBinary(Uint8Array.from(byteArray));
- byteArray.splice(0, mosaicId.getSize());
- const delta = AmountDto.loadFromBinary(Uint8Array.from(byteArray));
- byteArray.splice(0, delta.getSize());
- const action = GeneratorUtils.bufferToUint(GeneratorUtils.getBytes(Uint8Array.from(byteArray), 1));
- byteArray.splice(0, 1);
- return new MosaicSupplyChangeTransactionBodyBuilder(mosaicId, delta, action);
- }
-
- /**
- * Gets affected mosaic identifier.
- *
- * @return Affected mosaic identifier.
- */
- public getMosaicId(): UnresolvedMosaicIdDto {
- return this.mosaicId;
- }
-
- /**
- * Gets change amount.
- *
- * @return Change amount.
- */
- public getDelta(): AmountDto {
- return this.delta;
- }
-
- /**
- * Gets supply change action.
- *
- * @return Supply change action.
- */
- public getAction(): MosaicSupplyChangeActionDto {
- return this.action;
- }
-
- /**
- * Gets the size of the object.
- *
- * @return Size in bytes.
- */
- public getSize(): number {
- let size = 0;
- size += this.mosaicId.getSize();
- size += this.delta.getSize();
- size += 1; // action
- return size;
- }
-
- /**
- * Serializes an object to bytes.
- *
- * @return Serialized bytes.
- */
- public serialize(): Uint8Array {
- let newArray = Uint8Array.from([]);
- const mosaicIdBytes = this.mosaicId.serialize();
- newArray = GeneratorUtils.concatTypedArrays(newArray, mosaicIdBytes);
- const deltaBytes = this.delta.serialize();
- newArray = GeneratorUtils.concatTypedArrays(newArray, deltaBytes);
- const actionBytes = GeneratorUtils.uintToBuffer(this.action, 1);
- newArray = GeneratorUtils.concatTypedArrays(newArray, actionBytes);
- return newArray;
- }
-}
diff --git a/src/infrastructure/catbuffer/MosaicSupplyChangeTransactionBuilder.ts b/src/infrastructure/catbuffer/MosaicSupplyChangeTransactionBuilder.ts
deleted file mode 100644
index 6fe88898da..0000000000
--- a/src/infrastructure/catbuffer/MosaicSupplyChangeTransactionBuilder.ts
+++ /dev/null
@@ -1,127 +0,0 @@
-// tslint:disable: jsdoc-format
-/**
-*** Copyright (c) 2016-present,
-*** Jaguar0625, gimre, BloodyRookie, Tech Bureau, Corp. All rights reserved.
-***
-*** This file is part of Catapult.
-***
-*** Catapult is free software: you can redistribute it and/or modify
-*** it under the terms of the GNU Lesser General Public License as published by
-*** the Free Software Foundation, either version 3 of the License, or
-*** (at your option) any later version.
-***
-*** Catapult is distributed in the hope that it will be useful,
-*** but WITHOUT ANY WARRANTY; without even the implied warranty of
-*** MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-*** GNU Lesser General Public License for more details.
-***
-*** You should have received a copy of the GNU Lesser General Public License
-*** along with Catapult. If not, see .
-**/
-
-import { AmountDto } from './AmountDto';
-import { EntityTypeDto } from './EntityTypeDto';
-import { GeneratorUtils } from './GeneratorUtils';
-import { KeyDto } from './KeyDto';
-import { MosaicSupplyChangeActionDto } from './MosaicSupplyChangeActionDto';
-import { MosaicSupplyChangeTransactionBodyBuilder } from './MosaicSupplyChangeTransactionBodyBuilder';
-import { NetworkTypeDto } from './NetworkTypeDto';
-import { SignatureDto } from './SignatureDto';
-import { TimestampDto } from './TimestampDto';
-import { TransactionBuilder } from './TransactionBuilder';
-import { UnresolvedMosaicIdDto } from './UnresolvedMosaicIdDto';
-
-/** Binary layout for a non-embedded mosaic supply change transaction. */
-export class MosaicSupplyChangeTransactionBuilder extends TransactionBuilder {
- /** Mosaic supply change transaction body. */
- mosaicSupplyChangeTransactionBody: MosaicSupplyChangeTransactionBodyBuilder;
-
- /**
- * Constructor.
- *
- * @param signature Entity signature.
- * @param signerPublicKey Entity signer's public key.
- * @param version Entity version.
- * @param network Entity network.
- * @param type Entity type.
- * @param fee Transaction fee.
- * @param deadline Transaction deadline.
- * @param mosaicId Affected mosaic identifier.
- * @param delta Change amount.
- * @param action Supply change action.
- */
- // tslint:disable-next-line: max-line-length
- public constructor(signature: SignatureDto, signerPublicKey: KeyDto, version: number, network: NetworkTypeDto, type: EntityTypeDto, fee: AmountDto, deadline: TimestampDto, mosaicId: UnresolvedMosaicIdDto, delta: AmountDto, action: MosaicSupplyChangeActionDto) {
- super(signature, signerPublicKey, version, network, type, fee, deadline);
- this.mosaicSupplyChangeTransactionBody = new MosaicSupplyChangeTransactionBodyBuilder(mosaicId, delta, action);
- }
-
- /**
- * Creates an instance of MosaicSupplyChangeTransactionBuilder from binary payload.
- *
- * @param payload Byte payload to use to serialize the object.
- * @return Instance of MosaicSupplyChangeTransactionBuilder.
- */
- public static loadFromBinary(payload: Uint8Array): MosaicSupplyChangeTransactionBuilder {
- const byteArray = Array.from(payload);
- const superObject = TransactionBuilder.loadFromBinary(Uint8Array.from(byteArray));
- byteArray.splice(0, superObject.getSize());
- // tslint:disable-next-line: max-line-length
- const mosaicSupplyChangeTransactionBody = MosaicSupplyChangeTransactionBodyBuilder.loadFromBinary(Uint8Array.from(byteArray));
- byteArray.splice(0, mosaicSupplyChangeTransactionBody.getSize());
- // tslint:disable-next-line: max-line-length
- return new MosaicSupplyChangeTransactionBuilder(superObject.signature, superObject.signerPublicKey, superObject.version, superObject.network, superObject.type, superObject.fee, superObject.deadline, mosaicSupplyChangeTransactionBody.mosaicId, mosaicSupplyChangeTransactionBody.delta, mosaicSupplyChangeTransactionBody.action);
- }
-
- /**
- * Gets affected mosaic identifier.
- *
- * @return Affected mosaic identifier.
- */
- public getMosaicId(): UnresolvedMosaicIdDto {
- return this.mosaicSupplyChangeTransactionBody.getMosaicId();
- }
-
- /**
- * Gets change amount.
- *
- * @return Change amount.
- */
- public getDelta(): AmountDto {
- return this.mosaicSupplyChangeTransactionBody.getDelta();
- }
-
- /**
- * Gets supply change action.
- *
- * @return Supply change action.
- */
- public getAction(): MosaicSupplyChangeActionDto {
- return this.mosaicSupplyChangeTransactionBody.getAction();
- }
-
- /**
- * Gets the size of the object.
- *
- * @return Size in bytes.
- */
- public getSize(): number {
- let size: number = super.getSize();
- size += this.mosaicSupplyChangeTransactionBody.getSize();
- return size;
- }
-
- /**
- * Serializes an object to bytes.
- *
- * @return Serialized bytes.
- */
- public serialize(): Uint8Array {
- let newArray = Uint8Array.from([]);
- const superBytes = super.serialize();
- newArray = GeneratorUtils.concatTypedArrays(newArray, superBytes);
- const mosaicSupplyChangeTransactionBodyBytes = this.mosaicSupplyChangeTransactionBody.serialize();
- newArray = GeneratorUtils.concatTypedArrays(newArray, mosaicSupplyChangeTransactionBodyBytes);
- return newArray;
- }
-}
diff --git a/src/infrastructure/catbuffer/MultisigAccountModificationTransactionBodyBuilder.ts b/src/infrastructure/catbuffer/MultisigAccountModificationTransactionBodyBuilder.ts
deleted file mode 100644
index 53eb96d56a..0000000000
--- a/src/infrastructure/catbuffer/MultisigAccountModificationTransactionBodyBuilder.ts
+++ /dev/null
@@ -1,180 +0,0 @@
-// tslint:disable: jsdoc-format
-/**
-*** Copyright (c) 2016-present,
-*** Jaguar0625, gimre, BloodyRookie, Tech Bureau, Corp. All rights reserved.
-***
-*** This file is part of Catapult.
-***
-*** Catapult is free software: you can redistribute it and/or modify
-*** it under the terms of the GNU Lesser General Public License as published by
-*** the Free Software Foundation, either version 3 of the License, or
-*** (at your option) any later version.
-***
-*** Catapult is distributed in the hope that it will be useful,
-*** but WITHOUT ANY WARRANTY; without even the implied warranty of
-*** MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-*** GNU Lesser General Public License for more details.
-***
-*** You should have received a copy of the GNU Lesser General Public License
-*** along with Catapult. If not, see .
-**/
-
-import { GeneratorUtils } from './GeneratorUtils';
-import { KeyDto } from './KeyDto';
-
-/** Binary layout for a multisig account modification transaction. */
-export class MultisigAccountModificationTransactionBodyBuilder {
- /** Relative change of the minimal number of cosignatories required when removing an account. */
- minRemovalDelta: number;
- /** Relative change of the minimal number of cosignatories required when approving a transaction. */
- minApprovalDelta: number;
- /** Reserved padding to align publicKeyAdditions on 8-byte boundary. */
- multisigAccountModificationTransactionBody_Reserved1: number;
- /** Cosignatory public key additions. */
- publicKeyAdditions: KeyDto[];
- /** Cosignatory public key deletions. */
- publicKeyDeletions: KeyDto[];
-
- /**
- * Constructor.
- *
- * @param minRemovalDelta Relative change of the minimal number of cosignatories required when removing an account.
- * @param minApprovalDelta Relative change of the minimal number of cosignatories required when approving a transaction.
- * @param publicKeyAdditions Cosignatory public key additions.
- * @param publicKeyDeletions Cosignatory public key deletions.
- */
- // tslint:disable-next-line: max-line-length
- public constructor(minRemovalDelta: number, minApprovalDelta: number, publicKeyAdditions: KeyDto[], publicKeyDeletions: KeyDto[]) {
- this.minRemovalDelta = minRemovalDelta;
- this.minApprovalDelta = minApprovalDelta;
- this.multisigAccountModificationTransactionBody_Reserved1 = 0;
- this.publicKeyAdditions = publicKeyAdditions;
- this.publicKeyDeletions = publicKeyDeletions;
- }
-
- /**
- * Creates an instance of MultisigAccountModificationTransactionBodyBuilder from binary payload.
- *
- * @param payload Byte payload to use to serialize the object.
- * @return Instance of MultisigAccountModificationTransactionBodyBuilder.
- */
- public static loadFromBinary(payload: Uint8Array): MultisigAccountModificationTransactionBodyBuilder {
- const byteArray = Array.from(payload);
- const minRemovalDelta = GeneratorUtils.bufferToUint(GeneratorUtils.getBytes(Uint8Array.from(byteArray), 1));
- byteArray.splice(0, 1);
- const minApprovalDelta = GeneratorUtils.bufferToUint(GeneratorUtils.getBytes(Uint8Array.from(byteArray), 1));
- byteArray.splice(0, 1);
- const publicKeyAdditionsCount = GeneratorUtils.bufferToUint(GeneratorUtils.getBytes(Uint8Array.from(byteArray), 1));
- byteArray.splice(0, 1);
- const publicKeyDeletionsCount = GeneratorUtils.bufferToUint(GeneratorUtils.getBytes(Uint8Array.from(byteArray), 1));
- byteArray.splice(0, 1);
- // tslint:disable-next-line: max-line-length
- const multisigAccountModificationTransactionBody_Reserved1 = GeneratorUtils.bufferToUint(GeneratorUtils.getBytes(Uint8Array.from(byteArray), 4));
- byteArray.splice(0, 4);
- const publicKeyAdditions: KeyDto[] = [];
- for (let i = 0; i < publicKeyAdditionsCount; i++) {
- const item = KeyDto.loadFromBinary(Uint8Array.from(byteArray));
- publicKeyAdditions.push(item);
- byteArray.splice(0, item.getSize());
- }
- const publicKeyDeletions: KeyDto[] = [];
- for (let i = 0; i < publicKeyDeletionsCount; i++) {
- const item = KeyDto.loadFromBinary(Uint8Array.from(byteArray));
- publicKeyDeletions.push(item);
- byteArray.splice(0, item.getSize());
- }
- // tslint:disable-next-line: max-line-length
- return new MultisigAccountModificationTransactionBodyBuilder(minRemovalDelta, minApprovalDelta, publicKeyAdditions, publicKeyDeletions);
- }
-
- /**
- * Gets relative change of the minimal number of cosignatories required when removing an account.
- *
- * @return Relative change of the minimal number of cosignatories required when removing an account.
- */
- public getMinRemovalDelta(): number {
- return this.minRemovalDelta;
- }
-
- /**
- * Gets relative change of the minimal number of cosignatories required when approving a transaction.
- *
- * @return Relative change of the minimal number of cosignatories required when approving a transaction.
- */
- public getMinApprovalDelta(): number {
- return this.minApprovalDelta;
- }
-
- /**
- * Gets reserved padding to align publicKeyAdditions on 8-byte boundary.
- *
- * @return Reserved padding to align publicKeyAdditions on 8-byte boundary.
- */
- public getMultisigAccountModificationTransactionBody_Reserved1(): number {
- return this.multisigAccountModificationTransactionBody_Reserved1;
- }
-
- /**
- * Gets cosignatory public key additions.
- *
- * @return Cosignatory public key additions.
- */
- public getPublicKeyAdditions(): KeyDto[] {
- return this.publicKeyAdditions;
- }
-
- /**
- * Gets cosignatory public key deletions.
- *
- * @return Cosignatory public key deletions.
- */
- public getPublicKeyDeletions(): KeyDto[] {
- return this.publicKeyDeletions;
- }
-
- /**
- * Gets the size of the object.
- *
- * @return Size in bytes.
- */
- public getSize(): number {
- let size = 0;
- size += 1; // minRemovalDelta
- size += 1; // minApprovalDelta
- size += 1; // publicKeyAdditionsCount
- size += 1; // publicKeyDeletionsCount
- size += 4; // multisigAccountModificationTransactionBody_Reserved1
- this.publicKeyAdditions.forEach((o) => size += o.getSize());
- this.publicKeyDeletions.forEach((o) => size += o.getSize());
- return size;
- }
-
- /**
- * Serializes an object to bytes.
- *
- * @return Serialized bytes.
- */
- public serialize(): Uint8Array {
- let newArray = Uint8Array.from([]);
- const minRemovalDeltaBytes = GeneratorUtils.uintToBuffer(this.getMinRemovalDelta(), 1);
- newArray = GeneratorUtils.concatTypedArrays(newArray, minRemovalDeltaBytes);
- const minApprovalDeltaBytes = GeneratorUtils.uintToBuffer(this.getMinApprovalDelta(), 1);
- newArray = GeneratorUtils.concatTypedArrays(newArray, minApprovalDeltaBytes);
- const publicKeyAdditionsCountBytes = GeneratorUtils.uintToBuffer(this.publicKeyAdditions.length, 1);
- newArray = GeneratorUtils.concatTypedArrays(newArray, publicKeyAdditionsCountBytes);
- const publicKeyDeletionsCountBytes = GeneratorUtils.uintToBuffer(this.publicKeyDeletions.length, 1);
- newArray = GeneratorUtils.concatTypedArrays(newArray, publicKeyDeletionsCountBytes);
- // tslint:disable-next-line: max-line-length
- const multisigAccountModificationTransactionBody_Reserved1Bytes = GeneratorUtils.uintToBuffer(this.getMultisigAccountModificationTransactionBody_Reserved1(), 4);
- newArray = GeneratorUtils.concatTypedArrays(newArray, multisigAccountModificationTransactionBody_Reserved1Bytes);
- this.publicKeyAdditions.forEach((item) => {
- const publicKeyAdditionsBytes = item.serialize();
- newArray = GeneratorUtils.concatTypedArrays(newArray, publicKeyAdditionsBytes);
- });
- this.publicKeyDeletions.forEach((item) => {
- const publicKeyDeletionsBytes = item.serialize();
- newArray = GeneratorUtils.concatTypedArrays(newArray, publicKeyDeletionsBytes);
- });
- return newArray;
- }
-}
diff --git a/src/infrastructure/catbuffer/MultisigAccountModificationTransactionBuilder.ts b/src/infrastructure/catbuffer/MultisigAccountModificationTransactionBuilder.ts
deleted file mode 100644
index c853eb46df..0000000000
--- a/src/infrastructure/catbuffer/MultisigAccountModificationTransactionBuilder.ts
+++ /dev/null
@@ -1,145 +0,0 @@
-// tslint:disable: jsdoc-format
-/**
-*** Copyright (c) 2016-present,
-*** Jaguar0625, gimre, BloodyRookie, Tech Bureau, Corp. All rights reserved.
-***
-*** This file is part of Catapult.
-***
-*** Catapult is free software: you can redistribute it and/or modify
-*** it under the terms of the GNU Lesser General Public License as published by
-*** the Free Software Foundation, either version 3 of the License, or
-*** (at your option) any later version.
-***
-*** Catapult is distributed in the hope that it will be useful,
-*** but WITHOUT ANY WARRANTY; without even the implied warranty of
-*** MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-*** GNU Lesser General Public License for more details.
-***
-*** You should have received a copy of the GNU Lesser General Public License
-*** along with Catapult. If not, see .
-**/
-
-import { AmountDto } from './AmountDto';
-import { EntityTypeDto } from './EntityTypeDto';
-import { GeneratorUtils } from './GeneratorUtils';
-import { KeyDto } from './KeyDto';
-import { MultisigAccountModificationTransactionBodyBuilder } from './MultisigAccountModificationTransactionBodyBuilder';
-import { NetworkTypeDto } from './NetworkTypeDto';
-import { SignatureDto } from './SignatureDto';
-import { TimestampDto } from './TimestampDto';
-import { TransactionBuilder } from './TransactionBuilder';
-
-/** Binary layout for a non-embedded multisig account modification transaction. */
-export class MultisigAccountModificationTransactionBuilder extends TransactionBuilder {
- /** Multisig account modification transaction body. */
- multisigAccountModificationTransactionBody: MultisigAccountModificationTransactionBodyBuilder;
-
- /**
- * Constructor.
- *
- * @param signature Entity signature.
- * @param signerPublicKey Entity signer's public key.
- * @param version Entity version.
- * @param network Entity network.
- * @param type Entity type.
- * @param fee Transaction fee.
- * @param deadline Transaction deadline.
- * @param minRemovalDelta Relative change of the minimal number of cosignatories required when removing an account.
- * @param minApprovalDelta Relative change of the minimal number of cosignatories required when approving a transaction.
- * @param publicKeyAdditions Cosignatory public key additions.
- * @param publicKeyDeletions Cosignatory public key deletions.
- */
- // tslint:disable-next-line: max-line-length
- public constructor(signature: SignatureDto, signerPublicKey: KeyDto, version: number, network: NetworkTypeDto, type: EntityTypeDto, fee: AmountDto, deadline: TimestampDto, minRemovalDelta: number, minApprovalDelta: number, publicKeyAdditions: KeyDto[], publicKeyDeletions: KeyDto[]) {
- super(signature, signerPublicKey, version, network, type, fee, deadline);
- // tslint:disable-next-line: max-line-length
- this.multisigAccountModificationTransactionBody = new MultisigAccountModificationTransactionBodyBuilder(minRemovalDelta, minApprovalDelta, publicKeyAdditions, publicKeyDeletions);
- }
-
- /**
- * Creates an instance of MultisigAccountModificationTransactionBuilder from binary payload.
- *
- * @param payload Byte payload to use to serialize the object.
- * @return Instance of MultisigAccountModificationTransactionBuilder.
- */
- public static loadFromBinary(payload: Uint8Array): MultisigAccountModificationTransactionBuilder {
- const byteArray = Array.from(payload);
- const superObject = TransactionBuilder.loadFromBinary(Uint8Array.from(byteArray));
- byteArray.splice(0, superObject.getSize());
- // tslint:disable-next-line: max-line-length
- const multisigAccountModificationTransactionBody = MultisigAccountModificationTransactionBodyBuilder.loadFromBinary(Uint8Array.from(byteArray));
- byteArray.splice(0, multisigAccountModificationTransactionBody.getSize());
- // tslint:disable-next-line: max-line-length
- return new MultisigAccountModificationTransactionBuilder(superObject.signature, superObject.signerPublicKey, superObject.version, superObject.network, superObject.type, superObject.fee, superObject.deadline, multisigAccountModificationTransactionBody.minRemovalDelta, multisigAccountModificationTransactionBody.minApprovalDelta, multisigAccountModificationTransactionBody.publicKeyAdditions, multisigAccountModificationTransactionBody.publicKeyDeletions);
- }
-
- /**
- * Gets relative change of the minimal number of cosignatories required when removing an account.
- *
- * @return Relative change of the minimal number of cosignatories required when removing an account.
- */
- public getMinRemovalDelta(): number {
- return this.multisigAccountModificationTransactionBody.getMinRemovalDelta();
- }
-
- /**
- * Gets relative change of the minimal number of cosignatories required when approving a transaction.
- *
- * @return Relative change of the minimal number of cosignatories required when approving a transaction.
- */
- public getMinApprovalDelta(): number {
- return this.multisigAccountModificationTransactionBody.getMinApprovalDelta();
- }
-
- /**
- * Gets reserved padding to align publicKeyAdditions on 8-byte boundary.
- *
- * @return Reserved padding to align publicKeyAdditions on 8-byte boundary.
- */
- public getMultisigAccountModificationTransactionBody_Reserved1(): number {
- return this.multisigAccountModificationTransactionBody.getMultisigAccountModificationTransactionBody_Reserved1();
- }
-
- /**
- * Gets cosignatory public key additions.
- *
- * @return Cosignatory public key additions.
- */
- public getPublicKeyAdditions(): KeyDto[] {
- return this.multisigAccountModificationTransactionBody.getPublicKeyAdditions();
- }
-
- /**
- * Gets cosignatory public key deletions.
- *
- * @return Cosignatory public key deletions.
- */
- public getPublicKeyDeletions(): KeyDto[] {
- return this.multisigAccountModificationTransactionBody.getPublicKeyDeletions();
- }
-
- /**
- * Gets the size of the object.
- *
- * @return Size in bytes.
- */
- public getSize(): number {
- let size: number = super.getSize();
- size += this.multisigAccountModificationTransactionBody.getSize();
- return size;
- }
-
- /**
- * Serializes an object to bytes.
- *
- * @return Serialized bytes.
- */
- public serialize(): Uint8Array {
- let newArray = Uint8Array.from([]);
- const superBytes = super.serialize();
- newArray = GeneratorUtils.concatTypedArrays(newArray, superBytes);
- const multisigAccountModificationTransactionBodyBytes = this.multisigAccountModificationTransactionBody.serialize();
- newArray = GeneratorUtils.concatTypedArrays(newArray, multisigAccountModificationTransactionBodyBytes);
- return newArray;
- }
-}
diff --git a/src/infrastructure/catbuffer/NamespaceExpiryReceiptBuilder.ts b/src/infrastructure/catbuffer/NamespaceExpiryReceiptBuilder.ts
deleted file mode 100644
index 2573d688a9..0000000000
--- a/src/infrastructure/catbuffer/NamespaceExpiryReceiptBuilder.ts
+++ /dev/null
@@ -1,92 +0,0 @@
-// tslint:disable: jsdoc-format
-/**
-*** Copyright (c) 2016-present,
-*** Jaguar0625, gimre, BloodyRookie, Tech Bureau, Corp. All rights reserved.
-***
-*** This file is part of Catapult.
-***
-*** Catapult is free software: you can redistribute it and/or modify
-*** it under the terms of the GNU Lesser General Public License as published by
-*** the Free Software Foundation, either version 3 of the License, or
-*** (at your option) any later version.
-***
-*** Catapult is distributed in the hope that it will be useful,
-*** but WITHOUT ANY WARRANTY; without even the implied warranty of
-*** MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-*** GNU Lesser General Public License for more details.
-***
-*** You should have received a copy of the GNU Lesser General Public License
-*** along with Catapult. If not, see .
-**/
-
-import { GeneratorUtils } from './GeneratorUtils';
-import { NamespaceIdDto } from './NamespaceIdDto';
-import { ReceiptBuilder } from './ReceiptBuilder';
-import { ReceiptTypeDto } from './ReceiptTypeDto';
-
-/** Binary layout for a namespace expiry receipt. */
-export class NamespaceExpiryReceiptBuilder extends ReceiptBuilder {
- /** Expiring namespace id. */
- artifactId: NamespaceIdDto;
-
- /**
- * Constructor.
- *
- * @param version Receipt version.
- * @param type Receipt type.
- * @param artifactId Expiring namespace id.
- */
- public constructor(version: number, type: ReceiptTypeDto, artifactId: NamespaceIdDto) {
- super(version, type);
- this.artifactId = artifactId;
- }
-
- /**
- * Creates an instance of NamespaceExpiryReceiptBuilder from binary payload.
- *
- * @param payload Byte payload to use to serialize the object.
- * @return Instance of NamespaceExpiryReceiptBuilder.
- */
- public static loadFromBinary(payload: Uint8Array): NamespaceExpiryReceiptBuilder {
- const byteArray = Array.from(payload);
- const superObject = ReceiptBuilder.loadFromBinary(Uint8Array.from(byteArray));
- byteArray.splice(0, superObject.getSize());
- const artifactId = NamespaceIdDto.loadFromBinary(Uint8Array.from(byteArray));
- byteArray.splice(0, artifactId.getSize());
- return new NamespaceExpiryReceiptBuilder(superObject.version, superObject.type, artifactId);
- }
-
- /**
- * Gets expiring namespace id.
- *
- * @return Expiring namespace id.
- */
- public getArtifactId(): NamespaceIdDto {
- return this.artifactId;
- }
-
- /**
- * Gets the size of the object.
- *
- * @return Size in bytes.
- */
- public getSize(): number {
- let size: number = super.getSize();
- size += this.artifactId.getSize();
- return size;
- }
-
- /**
- * Serializes an object to bytes.
- *
- * @return Serialized bytes.
- */
- public serialize(): Uint8Array {
- let newArray = Uint8Array.from([]);
- const superBytes = super.serialize();
- newArray = GeneratorUtils.concatTypedArrays(newArray, superBytes);
- const artifactIdBytes = this.artifactId.serialize();
- newArray = GeneratorUtils.concatTypedArrays(newArray, artifactIdBytes);
- return newArray;
- }
-}
diff --git a/src/infrastructure/catbuffer/NamespaceIdDto.ts b/src/infrastructure/catbuffer/NamespaceIdDto.ts
deleted file mode 100644
index 498f63dbe3..0000000000
--- a/src/infrastructure/catbuffer/NamespaceIdDto.ts
+++ /dev/null
@@ -1,80 +0,0 @@
-// tslint:disable: jsdoc-format
-/**
-*** Copyright (c) 2016-present,
-*** Jaguar0625, gimre, BloodyRookie, Tech Bureau, Corp. All rights reserved.
-***
-*** This file is part of Catapult.
-***
-*** Catapult is free software: you can redistribute it and/or modify
-*** it under the terms of the GNU Lesser General Public License as published by
-*** the Free Software Foundation, either version 3 of the License, or
-*** (at your option) any later version.
-***
-*** Catapult is distributed in the hope that it will be useful,
-*** but WITHOUT ANY WARRANTY; without even the implied warranty of
-*** MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-*** GNU Lesser General Public License for more details.
-***
-*** You should have received a copy of the GNU Lesser General Public License
-*** along with Catapult. If not, see .
-**/
-
-import { GeneratorUtils } from './GeneratorUtils';
-
-/** Namespace id. */
-export class NamespaceIdDto {
- /** Namespace id. */
- namespaceId: number[];
-
- /**
- * Constructor.
- *
- * @param namespaceId Namespace id.
- */
- constructor(namespaceId: number[]) {
- this.namespaceId = namespaceId;
- }
-
- /**
- * Creates an instance of NamespaceIdDto from binary payload.
- *
- * @param payload Byte payload to use to serialize the object.
- * @return Instance of NamespaceIdDto.
- */
- public static loadFromBinary(payload: Uint8Array): NamespaceIdDto {
- const byteArray = Array.from(payload);
- const namespaceId = GeneratorUtils.bufferToUint64(GeneratorUtils.getBytes(Uint8Array.from(byteArray), 8));
- byteArray.splice(0, 8);
- return new NamespaceIdDto(namespaceId);
- }
-
- /**
- * Gets Namespace id.
- *
- * @return Namespace id.
- */
- public getNamespaceId(): number[] {
- return this.namespaceId;
- }
-
- /**
- * Gets the size of the object.
- *
- * @return Size in bytes.
- */
- public getSize(): number {
- return 8;
- }
-
- /**
- * Serializes an object to bytes.
- *
- * @return Serialized bytes.
- */
- public serialize(): Uint8Array {
- let newArray = Uint8Array.from([]);
- const namespaceIdBytes = GeneratorUtils.uint64ToBuffer(this.getNamespaceId());
- newArray = GeneratorUtils.concatTypedArrays(newArray, namespaceIdBytes);
- return newArray;
- }
-}
diff --git a/src/infrastructure/catbuffer/NamespaceMetadataTransactionBodyBuilder.ts b/src/infrastructure/catbuffer/NamespaceMetadataTransactionBodyBuilder.ts
deleted file mode 100644
index f460ab3c25..0000000000
--- a/src/infrastructure/catbuffer/NamespaceMetadataTransactionBodyBuilder.ts
+++ /dev/null
@@ -1,168 +0,0 @@
-// tslint:disable: jsdoc-format
-/**
-*** Copyright (c) 2016-present,
-*** Jaguar0625, gimre, BloodyRookie, Tech Bureau, Corp. All rights reserved.
-***
-*** This file is part of Catapult.
-***
-*** Catapult is free software: you can redistribute it and/or modify
-*** it under the terms of the GNU Lesser General Public License as published by
-*** the Free Software Foundation, either version 3 of the License, or
-*** (at your option) any later version.
-***
-*** Catapult is distributed in the hope that it will be useful,
-*** but WITHOUT ANY WARRANTY; without even the implied warranty of
-*** MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-*** GNU Lesser General Public License for more details.
-***
-*** You should have received a copy of the GNU Lesser General Public License
-*** along with Catapult. If not, see .
-**/
-
-import { GeneratorUtils } from './GeneratorUtils';
-import { KeyDto } from './KeyDto';
-import { NamespaceIdDto } from './NamespaceIdDto';
-
-/** Binary layout for a namespace metadata transaction. */
-export class NamespaceMetadataTransactionBodyBuilder {
- /** Metadata target public key. */
- targetPublicKey: KeyDto;
- /** Metadata key scoped to source, target and type. */
- scopedMetadataKey: number[];
- /** Target namespace identifier. */
- targetNamespaceId: NamespaceIdDto;
- /** Change in value size in bytes. */
- valueSizeDelta: number;
- /** Difference between existing value and new value \note when there is no existing value, new value is same this value \note when there is an existing value, new value is calculated as xor(previous-value, value). */
- value: Uint8Array;
-
- /**
- * Constructor.
- *
- * @param targetPublicKey Metadata target public key.
- * @param scopedMetadataKey Metadata key scoped to source, target and type.
- * @param targetNamespaceId Target namespace identifier.
- * @param valueSizeDelta Change in value size in bytes.
- * @param value Difference between existing value and new value.
- * @note when there is no existing value, new value is same this value.
- * @note when there is an existing value, new value is calculated as xor(previous-value, value).
- */
- // tslint:disable-next-line: max-line-length
- public constructor(targetPublicKey: KeyDto, scopedMetadataKey: number[], targetNamespaceId: NamespaceIdDto, valueSizeDelta: number, value: Uint8Array) {
- this.targetPublicKey = targetPublicKey;
- this.scopedMetadataKey = scopedMetadataKey;
- this.targetNamespaceId = targetNamespaceId;
- this.valueSizeDelta = valueSizeDelta;
- this.value = value;
- }
-
- /**
- * Creates an instance of NamespaceMetadataTransactionBodyBuilder from binary payload.
- *
- * @param payload Byte payload to use to serialize the object.
- * @return Instance of NamespaceMetadataTransactionBodyBuilder.
- */
- public static loadFromBinary(payload: Uint8Array): NamespaceMetadataTransactionBodyBuilder {
- const byteArray = Array.from(payload);
- const targetPublicKey = KeyDto.loadFromBinary(Uint8Array.from(byteArray));
- byteArray.splice(0, targetPublicKey.getSize());
- const scopedMetadataKey = GeneratorUtils.bufferToUint64(GeneratorUtils.getBytes(Uint8Array.from(byteArray), 8));
- byteArray.splice(0, 8);
- const targetNamespaceId = NamespaceIdDto.loadFromBinary(Uint8Array.from(byteArray));
- byteArray.splice(0, targetNamespaceId.getSize());
- const valueSizeDelta = GeneratorUtils.bufferToUint(GeneratorUtils.getBytes(Uint8Array.from(byteArray), 2));
- byteArray.splice(0, 2);
- const valueSize = GeneratorUtils.bufferToUint(GeneratorUtils.getBytes(Uint8Array.from(byteArray), 2));
- byteArray.splice(0, 2);
- const value = GeneratorUtils.getBytes(Uint8Array.from(byteArray), valueSize);
- byteArray.splice(0, valueSize);
- // tslint:disable-next-line: max-line-length
- return new NamespaceMetadataTransactionBodyBuilder(targetPublicKey, scopedMetadataKey, targetNamespaceId, valueSizeDelta, value);
- }
-
- /**
- * Gets metadata target public key.
- *
- * @return Metadata target public key.
- */
- public getTargetPublicKey(): KeyDto {
- return this.targetPublicKey;
- }
-
- /**
- * Gets metadata key scoped to source, target and type.
- *
- * @return Metadata key scoped to source, target and type.
- */
- public getScopedMetadataKey(): number[] {
- return this.scopedMetadataKey;
- }
-
- /**
- * Gets target namespace identifier.
- *
- * @return Target namespace identifier.
- */
- public getTargetNamespaceId(): NamespaceIdDto {
- return this.targetNamespaceId;
- }
-
- /**
- * Gets change in value size in bytes.
- *
- * @return Change in value size in bytes.
- */
- public getValueSizeDelta(): number {
- return this.valueSizeDelta;
- }
-
- /**
- * Gets difference between existing value and new value.
- * @note when there is no existing value, new value is same this value.
- * @note when there is an existing value, new value is calculated as xor(previous-value, value).
- *
- * @return Difference between existing value and new value.
- * @note when there is no existing value, new value is same this value.
- * @note when there is an existing value, new value is calculated as xor(previous-value, value).
- */
- public getValue(): Uint8Array {
- return this.value;
- }
-
- /**
- * Gets the size of the object.
- *
- * @return Size in bytes.
- */
- public getSize(): number {
- let size = 0;
- size += this.targetPublicKey.getSize();
- size += 8; // scopedMetadataKey
- size += this.targetNamespaceId.getSize();
- size += 2; // valueSizeDelta
- size += 2; // valueSize
- size += this.value.length;
- return size;
- }
-
- /**
- * Serializes an object to bytes.
- *
- * @return Serialized bytes.
- */
- public serialize(): Uint8Array {
- let newArray = Uint8Array.from([]);
- const targetPublicKeyBytes = this.targetPublicKey.serialize();
- newArray = GeneratorUtils.concatTypedArrays(newArray, targetPublicKeyBytes);
- const scopedMetadataKeyBytes = GeneratorUtils.uint64ToBuffer(this.getScopedMetadataKey());
- newArray = GeneratorUtils.concatTypedArrays(newArray, scopedMetadataKeyBytes);
- const targetNamespaceIdBytes = this.targetNamespaceId.serialize();
- newArray = GeneratorUtils.concatTypedArrays(newArray, targetNamespaceIdBytes);
- const valueSizeDeltaBytes = GeneratorUtils.uintToBuffer(this.getValueSizeDelta(), 2);
- newArray = GeneratorUtils.concatTypedArrays(newArray, valueSizeDeltaBytes);
- const valueSizeBytes = GeneratorUtils.uintToBuffer(this.value.length, 2);
- newArray = GeneratorUtils.concatTypedArrays(newArray, valueSizeBytes);
- newArray = GeneratorUtils.concatTypedArrays(newArray, this.value);
- return newArray;
- }
-}
diff --git a/src/infrastructure/catbuffer/NamespaceMetadataTransactionBuilder.ts b/src/infrastructure/catbuffer/NamespaceMetadataTransactionBuilder.ts
deleted file mode 100644
index 517f7993a6..0000000000
--- a/src/infrastructure/catbuffer/NamespaceMetadataTransactionBuilder.ts
+++ /dev/null
@@ -1,153 +0,0 @@
-// tslint:disable: jsdoc-format
-/**
-*** Copyright (c) 2016-present,
-*** Jaguar0625, gimre, BloodyRookie, Tech Bureau, Corp. All rights reserved.
-***
-*** This file is part of Catapult.
-***
-*** Catapult is free software: you can redistribute it and/or modify
-*** it under the terms of the GNU Lesser General Public License as published by
-*** the Free Software Foundation, either version 3 of the License, or
-*** (at your option) any later version.
-***
-*** Catapult is distributed in the hope that it will be useful,
-*** but WITHOUT ANY WARRANTY; without even the implied warranty of
-*** MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-*** GNU Lesser General Public License for more details.
-***
-*** You should have received a copy of the GNU Lesser General Public License
-*** along with Catapult. If not, see .
-**/
-
-import { AmountDto } from './AmountDto';
-import { EntityTypeDto } from './EntityTypeDto';
-import { GeneratorUtils } from './GeneratorUtils';
-import { KeyDto } from './KeyDto';
-import { NamespaceIdDto } from './NamespaceIdDto';
-import { NamespaceMetadataTransactionBodyBuilder } from './NamespaceMetadataTransactionBodyBuilder';
-import { NetworkTypeDto } from './NetworkTypeDto';
-import { SignatureDto } from './SignatureDto';
-import { TimestampDto } from './TimestampDto';
-import { TransactionBuilder } from './TransactionBuilder';
-
-/** Binary layout for a non-embedded namespace metadata transaction. */
-export class NamespaceMetadataTransactionBuilder extends TransactionBuilder {
- /** Namespace metadata transaction body. */
- namespaceMetadataTransactionBody: NamespaceMetadataTransactionBodyBuilder;
-
- /**
- * Constructor.
- *
- * @param signature Entity signature.
- * @param signerPublicKey Entity signer's public key.
- * @param version Entity version.
- * @param network Entity network.
- * @param type Entity type.
- * @param fee Transaction fee.
- * @param deadline Transaction deadline.
- * @param targetPublicKey Metadata target public key.
- * @param scopedMetadataKey Metadata key scoped to source, target and type.
- * @param targetNamespaceId Target namespace identifier.
- * @param valueSizeDelta Change in value size in bytes.
- * @param value Difference between existing value and new value.
- * @note when there is no existing value, new value is same this value.
- * @note when there is an existing value, new value is calculated as xor(previous-value, value).
- */
- // tslint:disable-next-line: max-line-length
- public constructor(signature: SignatureDto, signerPublicKey: KeyDto, version: number, network: NetworkTypeDto, type: EntityTypeDto, fee: AmountDto, deadline: TimestampDto, targetPublicKey: KeyDto, scopedMetadataKey: number[], targetNamespaceId: NamespaceIdDto, valueSizeDelta: number, value: Uint8Array) {
- super(signature, signerPublicKey, version, network, type, fee, deadline);
- // tslint:disable-next-line: max-line-length
- this.namespaceMetadataTransactionBody = new NamespaceMetadataTransactionBodyBuilder(targetPublicKey, scopedMetadataKey, targetNamespaceId, valueSizeDelta, value);
- }
-
- /**
- * Creates an instance of NamespaceMetadataTransactionBuilder from binary payload.
- *
- * @param payload Byte payload to use to serialize the object.
- * @return Instance of NamespaceMetadataTransactionBuilder.
- */
- public static loadFromBinary(payload: Uint8Array): NamespaceMetadataTransactionBuilder {
- const byteArray = Array.from(payload);
- const superObject = TransactionBuilder.loadFromBinary(Uint8Array.from(byteArray));
- byteArray.splice(0, superObject.getSize());
- // tslint:disable-next-line: max-line-length
- const namespaceMetadataTransactionBody = NamespaceMetadataTransactionBodyBuilder.loadFromBinary(Uint8Array.from(byteArray));
- byteArray.splice(0, namespaceMetadataTransactionBody.getSize());
- // tslint:disable-next-line: max-line-length
- return new NamespaceMetadataTransactionBuilder(superObject.signature, superObject.signerPublicKey, superObject.version, superObject.network, superObject.type, superObject.fee, superObject.deadline, namespaceMetadataTransactionBody.targetPublicKey, namespaceMetadataTransactionBody.scopedMetadataKey, namespaceMetadataTransactionBody.targetNamespaceId, namespaceMetadataTransactionBody.valueSizeDelta, namespaceMetadataTransactionBody.value);
- }
-
- /**
- * Gets metadata target public key.
- *
- * @return Metadata target public key.
- */
- public getTargetPublicKey(): KeyDto {
- return this.namespaceMetadataTransactionBody.getTargetPublicKey();
- }
-
- /**
- * Gets metadata key scoped to source, target and type.
- *
- * @return Metadata key scoped to source, target and type.
- */
- public getScopedMetadataKey(): number[] {
- return this.namespaceMetadataTransactionBody.getScopedMetadataKey();
- }
-
- /**
- * Gets target namespace identifier.
- *
- * @return Target namespace identifier.
- */
- public getTargetNamespaceId(): NamespaceIdDto {
- return this.namespaceMetadataTransactionBody.getTargetNamespaceId();
- }
-
- /**
- * Gets change in value size in bytes.
- *
- * @return Change in value size in bytes.
- */
- public getValueSizeDelta(): number {
- return this.namespaceMetadataTransactionBody.getValueSizeDelta();
- }
-
- /**
- * Gets difference between existing value and new value.
- * @note when there is no existing value, new value is same this value.
- * @note when there is an existing value, new value is calculated as xor(previous-value, value).
- *
- * @return Difference between existing value and new value.
- * @note when there is no existing value, new value is same this value.
- * @note when there is an existing value, new value is calculated as xor(previous-value, value).
- */
- public getValue(): Uint8Array {
- return this.namespaceMetadataTransactionBody.getValue();
- }
-
- /**
- * Gets the size of the object.
- *
- * @return Size in bytes.
- */
- public getSize(): number {
- let size: number = super.getSize();
- size += this.namespaceMetadataTransactionBody.getSize();
- return size;
- }
-
- /**
- * Serializes an object to bytes.
- *
- * @return Serialized bytes.
- */
- public serialize(): Uint8Array {
- let newArray = Uint8Array.from([]);
- const superBytes = super.serialize();
- newArray = GeneratorUtils.concatTypedArrays(newArray, superBytes);
- const namespaceMetadataTransactionBodyBytes = this.namespaceMetadataTransactionBody.serialize();
- newArray = GeneratorUtils.concatTypedArrays(newArray, namespaceMetadataTransactionBodyBytes);
- return newArray;
- }
-}
diff --git a/src/infrastructure/catbuffer/NamespaceRegistrationTransactionBodyBuilder.ts b/src/infrastructure/catbuffer/NamespaceRegistrationTransactionBodyBuilder.ts
deleted file mode 100644
index a3bc8a70b5..0000000000
--- a/src/infrastructure/catbuffer/NamespaceRegistrationTransactionBodyBuilder.ts
+++ /dev/null
@@ -1,188 +0,0 @@
-// tslint:disable: jsdoc-format
-/**
-*** Copyright (c) 2016-present,
-*** Jaguar0625, gimre, BloodyRookie, Tech Bureau, Corp. All rights reserved.
-***
-*** This file is part of Catapult.
-***
-*** Catapult is free software: you can redistribute it and/or modify
-*** it under the terms of the GNU Lesser General Public License as published by
-*** the Free Software Foundation, either version 3 of the License, or
-*** (at your option) any later version.
-***
-*** Catapult is distributed in the hope that it will be useful,
-*** but WITHOUT ANY WARRANTY; without even the implied warranty of
-*** MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-*** GNU Lesser General Public License for more details.
-***
-*** You should have received a copy of the GNU Lesser General Public License
-*** along with Catapult. If not, see .
-**/
-
-import { BlockDurationDto } from './BlockDurationDto';
-import { GeneratorUtils } from './GeneratorUtils';
-import { NamespaceIdDto } from './NamespaceIdDto';
-import { NamespaceRegistrationTypeDto } from './NamespaceRegistrationTypeDto';
-
-/** Binary layout for a namespace registration transaction. */
-export class NamespaceRegistrationTransactionBodyBuilder {
- /** Namespace duration. */
- duration?: BlockDurationDto;
- /** Parent namespace identifier. */
- parentId?: NamespaceIdDto;
- /** Namespace identifier. */
- id: NamespaceIdDto;
- /** Namespace registration type. */
- registrationType: NamespaceRegistrationTypeDto;
- /** Namespace name. */
- name: Uint8Array;
-
- /**
- * Constructor.
- *
- * @param duration Namespace duration.
- * @param parentId Parent namespace identifier.
- * @param id Namespace identifier.
- * @param name Namespace name.
- */
- public constructor(id: NamespaceIdDto, name: Uint8Array, duration?: BlockDurationDto, parentId?: NamespaceIdDto) {
- if ((duration && parentId) || (!duration && !parentId)) {
- throw new Error('Invalid conditional parameters');
- }
- this.duration = duration;
- this.parentId = parentId;
- this.id = id;
- this.name = name;
- if (duration) {
- this.registrationType = NamespaceRegistrationTypeDto.ROOT;
- }
- if (parentId) {
- this.registrationType = NamespaceRegistrationTypeDto.CHILD;
- }
- }
-
- /**
- * Creates an instance of NamespaceRegistrationTransactionBodyBuilder from binary payload.
- *
- * @param payload Byte payload to use to serialize the object.
- * @return Instance of NamespaceRegistrationTransactionBodyBuilder.
- */
- public static loadFromBinary(payload: Uint8Array): NamespaceRegistrationTransactionBodyBuilder {
- const byteArray = Array.from(payload);
- const registrationTypeConditionBytes = Uint8Array.from(byteArray.slice(0, 8));
- byteArray.splice(0, 8);
- const id = NamespaceIdDto.loadFromBinary(Uint8Array.from(byteArray));
- byteArray.splice(0, id.getSize());
- const registrationType = GeneratorUtils.bufferToUint(GeneratorUtils.getBytes(Uint8Array.from(byteArray), 1));
- byteArray.splice(0, 1);
- const nameSize = GeneratorUtils.bufferToUint(GeneratorUtils.getBytes(Uint8Array.from(byteArray), 1));
- byteArray.splice(0, 1);
- const name = GeneratorUtils.getBytes(Uint8Array.from(byteArray), nameSize);
- byteArray.splice(0, nameSize);
- let duration;
- if (registrationType === NamespaceRegistrationTypeDto.ROOT) {
- duration = BlockDurationDto.loadFromBinary(registrationTypeConditionBytes);
- }
- let parentId;
- if (registrationType === NamespaceRegistrationTypeDto.CHILD) {
- parentId = NamespaceIdDto.loadFromBinary(registrationTypeConditionBytes);
- }
- return new NamespaceRegistrationTransactionBodyBuilder(id, name, duration, parentId);
- }
-
- /**
- * Gets namespace duration.
- *
- * @return Namespace duration.
- */
- public getDuration(): BlockDurationDto | undefined {
- if (this.registrationType !== NamespaceRegistrationTypeDto.ROOT) {
- throw new Error('registrationType is not set to ROOT.');
- }
- return this.duration;
- }
-
- /**
- * Gets parent namespace identifier.
- *
- * @return Parent namespace identifier.
- */
- public getParentId(): NamespaceIdDto | undefined {
- if (this.registrationType !== NamespaceRegistrationTypeDto.CHILD) {
- throw new Error('registrationType is not set to CHILD.');
- }
- return this.parentId;
- }
-
- /**
- * Gets namespace identifier.
- *
- * @return Namespace identifier.
- */
- public getId(): NamespaceIdDto {
- return this.id;
- }
-
- /**
- * Gets namespace registration type.
- *
- * @return Namespace registration type.
- */
- public getRegistrationType(): NamespaceRegistrationTypeDto {
- return this.registrationType;
- }
-
- /**
- * Gets namespace name.
- *
- * @return Namespace name.
- */
- public getName(): Uint8Array {
- return this.name;
- }
-
- /**
- * Gets the size of the object.
- *
- * @return Size in bytes.
- */
- public getSize(): number {
- let size = 0;
- if (this.registrationType === NamespaceRegistrationTypeDto.ROOT) {
- size += this.duration!.getSize();
- }
- if (this.registrationType === NamespaceRegistrationTypeDto.CHILD) {
- size += this.parentId!.getSize();
- }
- size += this.id.getSize();
- size += 1; // registrationType
- size += 1; // nameSize
- size += this.name.length;
- return size;
- }
-
- /**
- * Serializes an object to bytes.
- *
- * @return Serialized bytes.
- */
- public serialize(): Uint8Array {
- let newArray = Uint8Array.from([]);
- if (this.registrationType === NamespaceRegistrationTypeDto.ROOT) {
- const durationBytes = this.duration!.serialize();
- newArray = GeneratorUtils.concatTypedArrays(newArray, durationBytes);
- }
- if (this.registrationType === NamespaceRegistrationTypeDto.CHILD) {
- const parentIdBytes = this.parentId!.serialize();
- newArray = GeneratorUtils.concatTypedArrays(newArray, parentIdBytes);
- }
- const idBytes = this.id.serialize();
- newArray = GeneratorUtils.concatTypedArrays(newArray, idBytes);
- const registrationTypeBytes = GeneratorUtils.uintToBuffer(this.registrationType, 1);
- newArray = GeneratorUtils.concatTypedArrays(newArray, registrationTypeBytes);
- const nameSizeBytes = GeneratorUtils.uintToBuffer(this.name.length, 1);
- newArray = GeneratorUtils.concatTypedArrays(newArray, nameSizeBytes);
- newArray = GeneratorUtils.concatTypedArrays(newArray, this.name);
- return newArray;
- }
-}
diff --git a/src/infrastructure/catbuffer/NamespaceRegistrationTransactionBuilder.ts b/src/infrastructure/catbuffer/NamespaceRegistrationTransactionBuilder.ts
deleted file mode 100644
index ef96eba960..0000000000
--- a/src/infrastructure/catbuffer/NamespaceRegistrationTransactionBuilder.ts
+++ /dev/null
@@ -1,151 +0,0 @@
-// tslint:disable: jsdoc-format
-/**
-*** Copyright (c) 2016-present,
-*** Jaguar0625, gimre, BloodyRookie, Tech Bureau, Corp. All rights reserved.
-***
-*** This file is part of Catapult.
-***
-*** Catapult is free software: you can redistribute it and/or modify
-*** it under the terms of the GNU Lesser General Public License as published by
-*** the Free Software Foundation, either version 3 of the License, or
-*** (at your option) any later version.
-***
-*** Catapult is distributed in the hope that it will be useful,
-*** but WITHOUT ANY WARRANTY; without even the implied warranty of
-*** MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-*** GNU Lesser General Public License for more details.
-***
-*** You should have received a copy of the GNU Lesser General Public License
-*** along with Catapult. If not, see .
-**/
-
-import { AmountDto } from './AmountDto';
-import { BlockDurationDto } from './BlockDurationDto';
-import { EntityTypeDto } from './EntityTypeDto';
-import { GeneratorUtils } from './GeneratorUtils';
-import { KeyDto } from './KeyDto';
-import { NamespaceIdDto } from './NamespaceIdDto';
-import { NamespaceRegistrationTransactionBodyBuilder } from './NamespaceRegistrationTransactionBodyBuilder';
-import { NamespaceRegistrationTypeDto } from './NamespaceRegistrationTypeDto';
-import { NetworkTypeDto } from './NetworkTypeDto';
-import { SignatureDto } from './SignatureDto';
-import { TimestampDto } from './TimestampDto';
-import { TransactionBuilder } from './TransactionBuilder';
-
-/** Binary layout for a non-embedded namespace registration transaction. */
-export class NamespaceRegistrationTransactionBuilder extends TransactionBuilder {
- /** Namespace registration transaction body. */
- namespaceRegistrationTransactionBody: NamespaceRegistrationTransactionBodyBuilder;
-
- /**
- * Constructor.
- *
- * @param signature Entity signature.
- * @param signerPublicKey Entity signer's public key.
- * @param version Entity version.
- * @param network Entity network.
- * @param type Entity type.
- * @param fee Transaction fee.
- * @param deadline Transaction deadline.
- * @param duration Namespace duration.
- * @param parentId Parent namespace identifier.
- * @param id Namespace identifier.
- * @param name Namespace name.
- */
- // tslint:disable-next-line: max-line-length
- public constructor(signature: SignatureDto, signerPublicKey: KeyDto, version: number, network: NetworkTypeDto, type: EntityTypeDto, fee: AmountDto, deadline: TimestampDto, id: NamespaceIdDto, name: Uint8Array, duration?: BlockDurationDto, parentId?: NamespaceIdDto) {
- super(signature, signerPublicKey, version, network, type, fee, deadline);
- if ((duration && parentId) || (!duration && !parentId)) {
- throw new Error('Invalid conditional parameters');
- }
- // tslint:disable-next-line: max-line-length
- this.namespaceRegistrationTransactionBody = new NamespaceRegistrationTransactionBodyBuilder(id, name, duration, parentId);
- }
-
- /**
- * Creates an instance of NamespaceRegistrationTransactionBuilder from binary payload.
- *
- * @param payload Byte payload to use to serialize the object.
- * @return Instance of NamespaceRegistrationTransactionBuilder.
- */
- public static loadFromBinary(payload: Uint8Array): NamespaceRegistrationTransactionBuilder {
- const byteArray = Array.from(payload);
- const superObject = TransactionBuilder.loadFromBinary(Uint8Array.from(byteArray));
- byteArray.splice(0, superObject.getSize());
- // tslint:disable-next-line: max-line-length
- const namespaceRegistrationTransactionBody = NamespaceRegistrationTransactionBodyBuilder.loadFromBinary(Uint8Array.from(byteArray));
- byteArray.splice(0, namespaceRegistrationTransactionBody.getSize());
- // tslint:disable-next-line: max-line-length
- return new NamespaceRegistrationTransactionBuilder(superObject.signature, superObject.signerPublicKey, superObject.version, superObject.network, superObject.type, superObject.fee, superObject.deadline, namespaceRegistrationTransactionBody.id, namespaceRegistrationTransactionBody.name, namespaceRegistrationTransactionBody.duration, namespaceRegistrationTransactionBody.parentId);
- }
-
- /**
- * Gets namespace duration.
- *
- * @return Namespace duration.
- */
- public getDuration(): BlockDurationDto | undefined {
- return this.namespaceRegistrationTransactionBody.getDuration();
- }
-
- /**
- * Gets parent namespace identifier.
- *
- * @return Parent namespace identifier.
- */
- public getParentId(): NamespaceIdDto | undefined {
- return this.namespaceRegistrationTransactionBody.getParentId();
- }
-
- /**
- * Gets namespace identifier.
- *
- * @return Namespace identifier.
- */
- public getId(): NamespaceIdDto {
- return this.namespaceRegistrationTransactionBody.getId();
- }
-
- /**
- * Gets namespace registration type.
- *
- * @return Namespace registration type.
- */
- public getRegistrationType(): NamespaceRegistrationTypeDto {
- return this.namespaceRegistrationTransactionBody.getRegistrationType();
- }
-
- /**
- * Gets namespace name.
- *
- * @return Namespace name.
- */
- public getName(): Uint8Array {
- return this.namespaceRegistrationTransactionBody.getName();
- }
-
- /**
- * Gets the size of the object.
- *
- * @return Size in bytes.
- */
- public getSize(): number {
- let size: number = super.getSize();
- size += this.namespaceRegistrationTransactionBody.getSize();
- return size;
- }
-
- /**
- * Serializes an object to bytes.
- *
- * @return Serialized bytes.
- */
- public serialize(): Uint8Array {
- let newArray = Uint8Array.from([]);
- const superBytes = super.serialize();
- newArray = GeneratorUtils.concatTypedArrays(newArray, superBytes);
- const namespaceRegistrationTransactionBodyBytes = this.namespaceRegistrationTransactionBody.serialize();
- newArray = GeneratorUtils.concatTypedArrays(newArray, namespaceRegistrationTransactionBodyBytes);
- return newArray;
- }
-}
diff --git a/src/infrastructure/catbuffer/NamespaceRegistrationTypeDto.ts b/src/infrastructure/catbuffer/NamespaceRegistrationTypeDto.ts
deleted file mode 100644
index 349db68025..0000000000
--- a/src/infrastructure/catbuffer/NamespaceRegistrationTypeDto.ts
+++ /dev/null
@@ -1,29 +0,0 @@
-// tslint:disable: jsdoc-format
-/**
-*** Copyright (c) 2016-present,
-*** Jaguar0625, gimre, BloodyRookie, Tech Bureau, Corp. All rights reserved.
-***
-*** This file is part of Catapult.
-***
-*** Catapult is free software: you can redistribute it and/or modify
-*** it under the terms of the GNU Lesser General Public License as published by
-*** the Free Software Foundation, either version 3 of the License, or
-*** (at your option) any later version.
-***
-*** Catapult is distributed in the hope that it will be useful,
-*** but WITHOUT ANY WARRANTY; without even the implied warranty of
-*** MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-*** GNU Lesser General Public License for more details.
-***
-*** You should have received a copy of the GNU Lesser General Public License
-*** along with Catapult. If not, see .
-**/
-
-
-/** Enumeration of namespace registration types. */
-export enum NamespaceRegistrationTypeDto {
- /** Root namespace. */
- ROOT = 0,
- /** Child namespace. */
- CHILD = 1,
-}
diff --git a/src/infrastructure/catbuffer/NetworkTypeDto.ts b/src/infrastructure/catbuffer/NetworkTypeDto.ts
deleted file mode 100644
index 20768d4fa9..0000000000
--- a/src/infrastructure/catbuffer/NetworkTypeDto.ts
+++ /dev/null
@@ -1,33 +0,0 @@
-// tslint:disable: jsdoc-format
-/**
-*** Copyright (c) 2016-present,
-*** Jaguar0625, gimre, BloodyRookie, Tech Bureau, Corp. All rights reserved.
-***
-*** This file is part of Catapult.
-***
-*** Catapult is free software: you can redistribute it and/or modify
-*** it under the terms of the GNU Lesser General Public License as published by
-*** the Free Software Foundation, either version 3 of the License, or
-*** (at your option) any later version.
-***
-*** Catapult is distributed in the hope that it will be useful,
-*** but WITHOUT ANY WARRANTY; without even the implied warranty of
-*** MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-*** GNU Lesser General Public License for more details.
-***
-*** You should have received a copy of the GNU Lesser General Public License
-*** along with Catapult. If not, see .
-**/
-
-
-/** Enumeration of network types. */
-export enum NetworkTypeDto {
- /** Public network. */
- PUBLIC = 104,
- /** Public test network. */
- PUBLIC_TEST = 152,
- /** Private network. */
- MIJIN = 96,
- /** Private test network. */
- MIJIN_TEST = 144,
-}
diff --git a/src/infrastructure/catbuffer/ReceiptBuilder.ts b/src/infrastructure/catbuffer/ReceiptBuilder.ts
deleted file mode 100644
index ffe39705cb..0000000000
--- a/src/infrastructure/catbuffer/ReceiptBuilder.ts
+++ /dev/null
@@ -1,106 +0,0 @@
-// tslint:disable: jsdoc-format
-/**
-*** Copyright (c) 2016-present,
-*** Jaguar0625, gimre, BloodyRookie, Tech Bureau, Corp. All rights reserved.
-***
-*** This file is part of Catapult.
-***
-*** Catapult is free software: you can redistribute it and/or modify
-*** it under the terms of the GNU Lesser General Public License as published by
-*** the Free Software Foundation, either version 3 of the License, or
-*** (at your option) any later version.
-***
-*** Catapult is distributed in the hope that it will be useful,
-*** but WITHOUT ANY WARRANTY; without even the implied warranty of
-*** MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-*** GNU Lesser General Public License for more details.
-***
-*** You should have received a copy of the GNU Lesser General Public License
-*** along with Catapult. If not, see .
-**/
-
-import { GeneratorUtils } from './GeneratorUtils';
-import { ReceiptTypeDto } from './ReceiptTypeDto';
-
-/** Binary layout for a receipt entity. */
-export class ReceiptBuilder {
- /** Entity size. */
- size = 0;
- /** Receipt version. */
- version: number;
- /** Receipt type. */
- type: ReceiptTypeDto;
-
- /**
- * Constructor.
- *
- * @param version Receipt version.
- * @param type Receipt type.
- */
- public constructor(version: number, type: ReceiptTypeDto) {
- this.version = version;
- this.type = type;
- }
-
- /**
- * Creates an instance of ReceiptBuilder from binary payload.
- *
- * @param payload Byte payload to use to serialize the object.
- * @return Instance of ReceiptBuilder.
- */
- public static loadFromBinary(payload: Uint8Array): ReceiptBuilder {
- const byteArray = Array.from(payload);
- const size = GeneratorUtils.bufferToUint(GeneratorUtils.getBytes(Uint8Array.from(byteArray), 4));
- byteArray.splice(0, 4);
- const version = GeneratorUtils.bufferToUint(GeneratorUtils.getBytes(Uint8Array.from(byteArray), 2));
- byteArray.splice(0, 2);
- const type = GeneratorUtils.bufferToUint(GeneratorUtils.getBytes(Uint8Array.from(byteArray), 2));
- byteArray.splice(0, 2);
- return new ReceiptBuilder(version, type);
- }
-
- /**
- * Gets receipt version.
- *
- * @return Receipt version.
- */
- public getVersion(): number {
- return this.version;
- }
-
- /**
- * Gets receipt type.
- *
- * @return Receipt type.
- */
- public getType(): ReceiptTypeDto {
- return this.type;
- }
-
- /**
- * Gets the size of the object.
- *
- * @return Size in bytes.
- */
- public getSize(): number {
- let size = 0;
- size += 4; // size
- size += 2; // version
- size += 2; // type
- return size;
- }
-
- /**
- * Serializes an object to bytes.
- *
- * @return Serialized bytes.
- */
- public serialize(): Uint8Array {
- let newArray = Uint8Array.from([]);
- const versionBytes = GeneratorUtils.uintToBuffer(this.getVersion(), 2);
- newArray = GeneratorUtils.concatTypedArrays(newArray, versionBytes);
- const typeBytes = GeneratorUtils.uintToBuffer(this.type, 2);
- newArray = GeneratorUtils.concatTypedArrays(newArray, typeBytes);
- return newArray;
- }
-}
diff --git a/src/infrastructure/catbuffer/ReceiptTypeDto.ts b/src/infrastructure/catbuffer/ReceiptTypeDto.ts
deleted file mode 100644
index f2d4bdc10f..0000000000
--- a/src/infrastructure/catbuffer/ReceiptTypeDto.ts
+++ /dev/null
@@ -1,27 +0,0 @@
-// tslint:disable: jsdoc-format
-/**
-*** Copyright (c) 2016-present,
-*** Jaguar0625, gimre, BloodyRookie, Tech Bureau, Corp. All rights reserved.
-***
-*** This file is part of Catapult.
-***
-*** Catapult is free software: you can redistribute it and/or modify
-*** it under the terms of the GNU Lesser General Public License as published by
-*** the Free Software Foundation, either version 3 of the License, or
-*** (at your option) any later version.
-***
-*** Catapult is distributed in the hope that it will be useful,
-*** but WITHOUT ANY WARRANTY; without even the implied warranty of
-*** MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-*** GNU Lesser General Public License for more details.
-***
-*** You should have received a copy of the GNU Lesser General Public License
-*** along with Catapult. If not, see .
-**/
-
-
-/** Enumeration of receipt types. */
-export enum ReceiptTypeDto {
- /** Reserved receipt type. */
- RESERVED = 0,
-}
diff --git a/src/infrastructure/catbuffer/SecretLockTransactionBodyBuilder.ts b/src/infrastructure/catbuffer/SecretLockTransactionBodyBuilder.ts
deleted file mode 100644
index 98deca49c7..0000000000
--- a/src/infrastructure/catbuffer/SecretLockTransactionBodyBuilder.ts
+++ /dev/null
@@ -1,160 +0,0 @@
-// tslint:disable: jsdoc-format
-/**
-*** Copyright (c) 2016-present,
-*** Jaguar0625, gimre, BloodyRookie, Tech Bureau, Corp. All rights reserved.
-***
-*** This file is part of Catapult.
-***
-*** Catapult is free software: you can redistribute it and/or modify
-*** it under the terms of the GNU Lesser General Public License as published by
-*** the Free Software Foundation, either version 3 of the License, or
-*** (at your option) any later version.
-***
-*** Catapult is distributed in the hope that it will be useful,
-*** but WITHOUT ANY WARRANTY; without even the implied warranty of
-*** MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-*** GNU Lesser General Public License for more details.
-***
-*** You should have received a copy of the GNU Lesser General Public License
-*** along with Catapult. If not, see .
-**/
-
-import { BlockDurationDto } from './BlockDurationDto';
-import { GeneratorUtils } from './GeneratorUtils';
-import { Hash256Dto } from './Hash256Dto';
-import { LockHashAlgorithmDto } from './LockHashAlgorithmDto';
-import { UnresolvedAddressDto } from './UnresolvedAddressDto';
-import { UnresolvedMosaicBuilder } from './UnresolvedMosaicBuilder';
-
-/** Binary layout for a secret lock transaction. */
-export class SecretLockTransactionBodyBuilder {
- /** Secret. */
- secret: Hash256Dto;
- /** Locked mosaic. */
- mosaic: UnresolvedMosaicBuilder;
- /** Number of blocks for which a lock should be valid. */
- duration: BlockDurationDto;
- /** Hash algorithm. */
- hashAlgorithm: LockHashAlgorithmDto;
- /** Locked mosaic recipient address. */
- recipientAddress: UnresolvedAddressDto;
-
- /**
- * Constructor.
- *
- * @param secret Secret.
- * @param mosaic Locked mosaic.
- * @param duration Number of blocks for which a lock should be valid.
- * @param hashAlgorithm Hash algorithm.
- * @param recipientAddress Locked mosaic recipient address.
- */
- // tslint:disable-next-line: max-line-length
- public constructor(secret: Hash256Dto, mosaic: UnresolvedMosaicBuilder, duration: BlockDurationDto, hashAlgorithm: LockHashAlgorithmDto, recipientAddress: UnresolvedAddressDto) {
- this.secret = secret;
- this.mosaic = mosaic;
- this.duration = duration;
- this.hashAlgorithm = hashAlgorithm;
- this.recipientAddress = recipientAddress;
- }
-
- /**
- * Creates an instance of SecretLockTransactionBodyBuilder from binary payload.
- *
- * @param payload Byte payload to use to serialize the object.
- * @return Instance of SecretLockTransactionBodyBuilder.
- */
- public static loadFromBinary(payload: Uint8Array): SecretLockTransactionBodyBuilder {
- const byteArray = Array.from(payload);
- const secret = Hash256Dto.loadFromBinary(Uint8Array.from(byteArray));
- byteArray.splice(0, secret.getSize());
- const mosaic = UnresolvedMosaicBuilder.loadFromBinary(Uint8Array.from(byteArray));
- byteArray.splice(0, mosaic.getSize());
- const duration = BlockDurationDto.loadFromBinary(Uint8Array.from(byteArray));
- byteArray.splice(0, duration.getSize());
- const hashAlgorithm = GeneratorUtils.bufferToUint(GeneratorUtils.getBytes(Uint8Array.from(byteArray), 1));
- byteArray.splice(0, 1);
- const recipientAddress = UnresolvedAddressDto.loadFromBinary(Uint8Array.from(byteArray));
- byteArray.splice(0, recipientAddress.getSize());
- return new SecretLockTransactionBodyBuilder(secret, mosaic, duration, hashAlgorithm, recipientAddress);
- }
-
- /**
- * Gets secret.
- *
- * @return Secret.
- */
- public getSecret(): Hash256Dto {
- return this.secret;
- }
-
- /**
- * Gets locked mosaic.
- *
- * @return Locked mosaic.
- */
- public getMosaic(): UnresolvedMosaicBuilder {
- return this.mosaic;
- }
-
- /**
- * Gets number of blocks for which a lock should be valid.
- *
- * @return Number of blocks for which a lock should be valid.
- */
- public getDuration(): BlockDurationDto {
- return this.duration;
- }
-
- /**
- * Gets hash algorithm.
- *
- * @return Hash algorithm.
- */
- public getHashAlgorithm(): LockHashAlgorithmDto {
- return this.hashAlgorithm;
- }
-
- /**
- * Gets locked mosaic recipient address.
- *
- * @return Locked mosaic recipient address.
- */
- public getRecipientAddress(): UnresolvedAddressDto {
- return this.recipientAddress;
- }
-
- /**
- * Gets the size of the object.
- *
- * @return Size in bytes.
- */
- public getSize(): number {
- let size = 0;
- size += this.secret.getSize();
- size += this.mosaic.getSize();
- size += this.duration.getSize();
- size += 1; // hashAlgorithm
- size += this.recipientAddress.getSize();
- return size;
- }
-
- /**
- * Serializes an object to bytes.
- *
- * @return Serialized bytes.
- */
- public serialize(): Uint8Array {
- let newArray = Uint8Array.from([]);
- const secretBytes = this.secret.serialize();
- newArray = GeneratorUtils.concatTypedArrays(newArray, secretBytes);
- const mosaicBytes = this.mosaic.serialize();
- newArray = GeneratorUtils.concatTypedArrays(newArray, mosaicBytes);
- const durationBytes = this.duration.serialize();
- newArray = GeneratorUtils.concatTypedArrays(newArray, durationBytes);
- const hashAlgorithmBytes = GeneratorUtils.uintToBuffer(this.hashAlgorithm, 1);
- newArray = GeneratorUtils.concatTypedArrays(newArray, hashAlgorithmBytes);
- const recipientAddressBytes = this.recipientAddress.serialize();
- newArray = GeneratorUtils.concatTypedArrays(newArray, recipientAddressBytes);
- return newArray;
- }
-}
diff --git a/src/infrastructure/catbuffer/SecretLockTransactionBuilder.ts b/src/infrastructure/catbuffer/SecretLockTransactionBuilder.ts
deleted file mode 100644
index 3247c7190d..0000000000
--- a/src/infrastructure/catbuffer/SecretLockTransactionBuilder.ts
+++ /dev/null
@@ -1,150 +0,0 @@
-// tslint:disable: jsdoc-format
-/**
-*** Copyright (c) 2016-present,
-*** Jaguar0625, gimre, BloodyRookie, Tech Bureau, Corp. All rights reserved.
-***
-*** This file is part of Catapult.
-***
-*** Catapult is free software: you can redistribute it and/or modify
-*** it under the terms of the GNU Lesser General Public License as published by
-*** the Free Software Foundation, either version 3 of the License, or
-*** (at your option) any later version.
-***
-*** Catapult is distributed in the hope that it will be useful,
-*** but WITHOUT ANY WARRANTY; without even the implied warranty of
-*** MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-*** GNU Lesser General Public License for more details.
-***
-*** You should have received a copy of the GNU Lesser General Public License
-*** along with Catapult. If not, see .
-**/
-
-import { AmountDto } from './AmountDto';
-import { BlockDurationDto } from './BlockDurationDto';
-import { EntityTypeDto } from './EntityTypeDto';
-import { GeneratorUtils } from './GeneratorUtils';
-import { Hash256Dto } from './Hash256Dto';
-import { KeyDto } from './KeyDto';
-import { LockHashAlgorithmDto } from './LockHashAlgorithmDto';
-import { NetworkTypeDto } from './NetworkTypeDto';
-import { SecretLockTransactionBodyBuilder } from './SecretLockTransactionBodyBuilder';
-import { SignatureDto } from './SignatureDto';
-import { TimestampDto } from './TimestampDto';
-import { TransactionBuilder } from './TransactionBuilder';
-import { UnresolvedAddressDto } from './UnresolvedAddressDto';
-import { UnresolvedMosaicBuilder } from './UnresolvedMosaicBuilder';
-
-/** Binary layout for a non-embedded secret lock transaction. */
-export class SecretLockTransactionBuilder extends TransactionBuilder {
- /** Secret lock transaction body. */
- secretLockTransactionBody: SecretLockTransactionBodyBuilder;
-
- /**
- * Constructor.
- *
- * @param signature Entity signature.
- * @param signerPublicKey Entity signer's public key.
- * @param version Entity version.
- * @param network Entity network.
- * @param type Entity type.
- * @param fee Transaction fee.
- * @param deadline Transaction deadline.
- * @param secret Secret.
- * @param mosaic Locked mosaic.
- * @param duration Number of blocks for which a lock should be valid.
- * @param hashAlgorithm Hash algorithm.
- * @param recipientAddress Locked mosaic recipient address.
- */
- // tslint:disable-next-line: max-line-length
- public constructor(signature: SignatureDto, signerPublicKey: KeyDto, version: number, network: NetworkTypeDto, type: EntityTypeDto, fee: AmountDto, deadline: TimestampDto, secret: Hash256Dto, mosaic: UnresolvedMosaicBuilder, duration: BlockDurationDto, hashAlgorithm: LockHashAlgorithmDto, recipientAddress: UnresolvedAddressDto) {
- super(signature, signerPublicKey, version, network, type, fee, deadline);
- // tslint:disable-next-line: max-line-length
- this.secretLockTransactionBody = new SecretLockTransactionBodyBuilder(secret, mosaic, duration, hashAlgorithm, recipientAddress);
- }
-
- /**
- * Creates an instance of SecretLockTransactionBuilder from binary payload.
- *
- * @param payload Byte payload to use to serialize the object.
- * @return Instance of SecretLockTransactionBuilder.
- */
- public static loadFromBinary(payload: Uint8Array): SecretLockTransactionBuilder {
- const byteArray = Array.from(payload);
- const superObject = TransactionBuilder.loadFromBinary(Uint8Array.from(byteArray));
- byteArray.splice(0, superObject.getSize());
- const secretLockTransactionBody = SecretLockTransactionBodyBuilder.loadFromBinary(Uint8Array.from(byteArray));
- byteArray.splice(0, secretLockTransactionBody.getSize());
- // tslint:disable-next-line: max-line-length
- return new SecretLockTransactionBuilder(superObject.signature, superObject.signerPublicKey, superObject.version, superObject.network, superObject.type, superObject.fee, superObject.deadline, secretLockTransactionBody.secret, secretLockTransactionBody.mosaic, secretLockTransactionBody.duration, secretLockTransactionBody.hashAlgorithm, secretLockTransactionBody.recipientAddress);
- }
-
- /**
- * Gets secret.
- *
- * @return Secret.
- */
- public getSecret(): Hash256Dto {
- return this.secretLockTransactionBody.getSecret();
- }
-
- /**
- * Gets locked mosaic.
- *
- * @return Locked mosaic.
- */
- public getMosaic(): UnresolvedMosaicBuilder {
- return this.secretLockTransactionBody.getMosaic();
- }
-
- /**
- * Gets number of blocks for which a lock should be valid.
- *
- * @return Number of blocks for which a lock should be valid.
- */
- public getDuration(): BlockDurationDto {
- return this.secretLockTransactionBody.getDuration();
- }
-
- /**
- * Gets hash algorithm.
- *
- * @return Hash algorithm.
- */
- public getHashAlgorithm(): LockHashAlgorithmDto {
- return this.secretLockTransactionBody.getHashAlgorithm();
- }
-
- /**
- * Gets locked mosaic recipient address.
- *
- * @return Locked mosaic recipient address.
- */
- public getRecipientAddress(): UnresolvedAddressDto {
- return this.secretLockTransactionBody.getRecipientAddress();
- }
-
- /**
- * Gets the size of the object.
- *
- * @return Size in bytes.
- */
- public getSize(): number {
- let size: number = super.getSize();
- size += this.secretLockTransactionBody.getSize();
- return size;
- }
-
- /**
- * Serializes an object to bytes.
- *
- * @return Serialized bytes.
- */
- public serialize(): Uint8Array {
- let newArray = Uint8Array.from([]);
- const superBytes = super.serialize();
- newArray = GeneratorUtils.concatTypedArrays(newArray, superBytes);
- const secretLockTransactionBodyBytes = this.secretLockTransactionBody.serialize();
- newArray = GeneratorUtils.concatTypedArrays(newArray, secretLockTransactionBodyBytes);
- return newArray;
- }
-}
diff --git a/src/infrastructure/catbuffer/SecretProofTransactionBodyBuilder.ts b/src/infrastructure/catbuffer/SecretProofTransactionBodyBuilder.ts
deleted file mode 100644
index 3dddc926d8..0000000000
--- a/src/infrastructure/catbuffer/SecretProofTransactionBodyBuilder.ts
+++ /dev/null
@@ -1,144 +0,0 @@
-// tslint:disable: jsdoc-format
-/**
-*** Copyright (c) 2016-present,
-*** Jaguar0625, gimre, BloodyRookie, Tech Bureau, Corp. All rights reserved.
-***
-*** This file is part of Catapult.
-***
-*** Catapult is free software: you can redistribute it and/or modify
-*** it under the terms of the GNU Lesser General Public License as published by
-*** the Free Software Foundation, either version 3 of the License, or
-*** (at your option) any later version.
-***
-*** Catapult is distributed in the hope that it will be useful,
-*** but WITHOUT ANY WARRANTY; without even the implied warranty of
-*** MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-*** GNU Lesser General Public License for more details.
-***
-*** You should have received a copy of the GNU Lesser General Public License
-*** along with Catapult. If not, see .
-**/
-
-import { GeneratorUtils } from './GeneratorUtils';
-import { Hash256Dto } from './Hash256Dto';
-import { LockHashAlgorithmDto } from './LockHashAlgorithmDto';
-import { UnresolvedAddressDto } from './UnresolvedAddressDto';
-
-/** Binary layout for a secret proof transaction. */
-export class SecretProofTransactionBodyBuilder {
- /** Secret. */
- secret: Hash256Dto;
- /** Hash algorithm. */
- hashAlgorithm: LockHashAlgorithmDto;
- /** Locked mosaic recipient address. */
- recipientAddress: UnresolvedAddressDto;
- /** Proof data. */
- proof: Uint8Array;
-
- /**
- * Constructor.
- *
- * @param secret Secret.
- * @param hashAlgorithm Hash algorithm.
- * @param recipientAddress Locked mosaic recipient address.
- * @param proof Proof data.
- */
- // tslint:disable-next-line: max-line-length
- public constructor(secret: Hash256Dto, hashAlgorithm: LockHashAlgorithmDto, recipientAddress: UnresolvedAddressDto, proof: Uint8Array) {
- this.secret = secret;
- this.hashAlgorithm = hashAlgorithm;
- this.recipientAddress = recipientAddress;
- this.proof = proof;
- }
-
- /**
- * Creates an instance of SecretProofTransactionBodyBuilder from binary payload.
- *
- * @param payload Byte payload to use to serialize the object.
- * @return Instance of SecretProofTransactionBodyBuilder.
- */
- public static loadFromBinary(payload: Uint8Array): SecretProofTransactionBodyBuilder {
- const byteArray = Array.from(payload);
- const secret = Hash256Dto.loadFromBinary(Uint8Array.from(byteArray));
- byteArray.splice(0, secret.getSize());
- const proofSize = GeneratorUtils.bufferToUint(GeneratorUtils.getBytes(Uint8Array.from(byteArray), 2));
- byteArray.splice(0, 2);
- const hashAlgorithm = GeneratorUtils.bufferToUint(GeneratorUtils.getBytes(Uint8Array.from(byteArray), 1));
- byteArray.splice(0, 1);
- const recipientAddress = UnresolvedAddressDto.loadFromBinary(Uint8Array.from(byteArray));
- byteArray.splice(0, recipientAddress.getSize());
- const proof = GeneratorUtils.getBytes(Uint8Array.from(byteArray), proofSize);
- byteArray.splice(0, proofSize);
- return new SecretProofTransactionBodyBuilder(secret, hashAlgorithm, recipientAddress, proof);
- }
-
- /**
- * Gets secret.
- *
- * @return Secret.
- */
- public getSecret(): Hash256Dto {
- return this.secret;
- }
-
- /**
- * Gets hash algorithm.
- *
- * @return Hash algorithm.
- */
- public getHashAlgorithm(): LockHashAlgorithmDto {
- return this.hashAlgorithm;
- }
-
- /**
- * Gets locked mosaic recipient address.
- *
- * @return Locked mosaic recipient address.
- */
- public getRecipientAddress(): UnresolvedAddressDto {
- return this.recipientAddress;
- }
-
- /**
- * Gets proof data.
- *
- * @return Proof data.
- */
- public getProof(): Uint8Array {
- return this.proof;
- }
-
- /**
- * Gets the size of the object.
- *
- * @return Size in bytes.
- */
- public getSize(): number {
- let size = 0;
- size += this.secret.getSize();
- size += 2; // proofSize
- size += 1; // hashAlgorithm
- size += this.recipientAddress.getSize();
- size += this.proof.length;
- return size;
- }
-
- /**
- * Serializes an object to bytes.
- *
- * @return Serialized bytes.
- */
- public serialize(): Uint8Array {
- let newArray = Uint8Array.from([]);
- const secretBytes = this.secret.serialize();
- newArray = GeneratorUtils.concatTypedArrays(newArray, secretBytes);
- const proofSizeBytes = GeneratorUtils.uintToBuffer(this.proof.length, 2);
- newArray = GeneratorUtils.concatTypedArrays(newArray, proofSizeBytes);
- const hashAlgorithmBytes = GeneratorUtils.uintToBuffer(this.hashAlgorithm, 1);
- newArray = GeneratorUtils.concatTypedArrays(newArray, hashAlgorithmBytes);
- const recipientAddressBytes = this.recipientAddress.serialize();
- newArray = GeneratorUtils.concatTypedArrays(newArray, recipientAddressBytes);
- newArray = GeneratorUtils.concatTypedArrays(newArray, this.proof);
- return newArray;
- }
-}
diff --git a/src/infrastructure/catbuffer/SecretProofTransactionBuilder.ts b/src/infrastructure/catbuffer/SecretProofTransactionBuilder.ts
deleted file mode 100644
index 24c5b781c5..0000000000
--- a/src/infrastructure/catbuffer/SecretProofTransactionBuilder.ts
+++ /dev/null
@@ -1,137 +0,0 @@
-// tslint:disable: jsdoc-format
-/**
-*** Copyright (c) 2016-present,
-*** Jaguar0625, gimre, BloodyRookie, Tech Bureau, Corp. All rights reserved.
-***
-*** This file is part of Catapult.
-***
-*** Catapult is free software: you can redistribute it and/or modify
-*** it under the terms of the GNU Lesser General Public License as published by
-*** the Free Software Foundation, either version 3 of the License, or
-*** (at your option) any later version.
-***
-*** Catapult is distributed in the hope that it will be useful,
-*** but WITHOUT ANY WARRANTY; without even the implied warranty of
-*** MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-*** GNU Lesser General Public License for more details.
-***
-*** You should have received a copy of the GNU Lesser General Public License
-*** along with Catapult. If not, see .
-**/
-
-import { AmountDto } from './AmountDto';
-import { EntityTypeDto } from './EntityTypeDto';
-import { GeneratorUtils } from './GeneratorUtils';
-import { Hash256Dto } from './Hash256Dto';
-import { KeyDto } from './KeyDto';
-import { LockHashAlgorithmDto } from './LockHashAlgorithmDto';
-import { NetworkTypeDto } from './NetworkTypeDto';
-import { SecretProofTransactionBodyBuilder } from './SecretProofTransactionBodyBuilder';
-import { SignatureDto } from './SignatureDto';
-import { TimestampDto } from './TimestampDto';
-import { TransactionBuilder } from './TransactionBuilder';
-import { UnresolvedAddressDto } from './UnresolvedAddressDto';
-
-/** Binary layout for a non-embedded secret proof transaction. */
-export class SecretProofTransactionBuilder extends TransactionBuilder {
- /** Secret proof transaction body. */
- secretProofTransactionBody: SecretProofTransactionBodyBuilder;
-
- /**
- * Constructor.
- *
- * @param signature Entity signature.
- * @param signerPublicKey Entity signer's public key.
- * @param version Entity version.
- * @param network Entity network.
- * @param type Entity type.
- * @param fee Transaction fee.
- * @param deadline Transaction deadline.
- * @param secret Secret.
- * @param hashAlgorithm Hash algorithm.
- * @param recipientAddress Locked mosaic recipient address.
- * @param proof Proof data.
- */
- // tslint:disable-next-line: max-line-length
- public constructor(signature: SignatureDto, signerPublicKey: KeyDto, version: number, network: NetworkTypeDto, type: EntityTypeDto, fee: AmountDto, deadline: TimestampDto, secret: Hash256Dto, hashAlgorithm: LockHashAlgorithmDto, recipientAddress: UnresolvedAddressDto, proof: Uint8Array) {
- super(signature, signerPublicKey, version, network, type, fee, deadline);
- this.secretProofTransactionBody = new SecretProofTransactionBodyBuilder(secret, hashAlgorithm, recipientAddress, proof);
- }
-
- /**
- * Creates an instance of SecretProofTransactionBuilder from binary payload.
- *
- * @param payload Byte payload to use to serialize the object.
- * @return Instance of SecretProofTransactionBuilder.
- */
- public static loadFromBinary(payload: Uint8Array): SecretProofTransactionBuilder {
- const byteArray = Array.from(payload);
- const superObject = TransactionBuilder.loadFromBinary(Uint8Array.from(byteArray));
- byteArray.splice(0, superObject.getSize());
- const secretProofTransactionBody = SecretProofTransactionBodyBuilder.loadFromBinary(Uint8Array.from(byteArray));
- byteArray.splice(0, secretProofTransactionBody.getSize());
- // tslint:disable-next-line: max-line-length
- return new SecretProofTransactionBuilder(superObject.signature, superObject.signerPublicKey, superObject.version, superObject.network, superObject.type, superObject.fee, superObject.deadline, secretProofTransactionBody.secret, secretProofTransactionBody.hashAlgorithm, secretProofTransactionBody.recipientAddress, secretProofTransactionBody.proof);
- }
-
- /**
- * Gets secret.
- *
- * @return Secret.
- */
- public getSecret(): Hash256Dto {
- return this.secretProofTransactionBody.getSecret();
- }
-
- /**
- * Gets hash algorithm.
- *
- * @return Hash algorithm.
- */
- public getHashAlgorithm(): LockHashAlgorithmDto {
- return this.secretProofTransactionBody.getHashAlgorithm();
- }
-
- /**
- * Gets locked mosaic recipient address.
- *
- * @return Locked mosaic recipient address.
- */
- public getRecipientAddress(): UnresolvedAddressDto {
- return this.secretProofTransactionBody.getRecipientAddress();
- }
-
- /**
- * Gets proof data.
- *
- * @return Proof data.
- */
- public getProof(): Uint8Array {
- return this.secretProofTransactionBody.getProof();
- }
-
- /**
- * Gets the size of the object.
- *
- * @return Size in bytes.
- */
- public getSize(): number {
- let size: number = super.getSize();
- size += this.secretProofTransactionBody.getSize();
- return size;
- }
-
- /**
- * Serializes an object to bytes.
- *
- * @return Serialized bytes.
- */
- public serialize(): Uint8Array {
- let newArray = Uint8Array.from([]);
- const superBytes = super.serialize();
- newArray = GeneratorUtils.concatTypedArrays(newArray, superBytes);
- const secretProofTransactionBodyBytes = this.secretProofTransactionBody.serialize();
- newArray = GeneratorUtils.concatTypedArrays(newArray, secretProofTransactionBodyBytes);
- return newArray;
- }
-}
diff --git a/src/infrastructure/catbuffer/SignatureDto.ts b/src/infrastructure/catbuffer/SignatureDto.ts
deleted file mode 100644
index 307efb2b50..0000000000
--- a/src/infrastructure/catbuffer/SignatureDto.ts
+++ /dev/null
@@ -1,79 +0,0 @@
-// tslint:disable: jsdoc-format
-/**
-*** Copyright (c) 2016-present,
-*** Jaguar0625, gimre, BloodyRookie, Tech Bureau, Corp. All rights reserved.
-***
-*** This file is part of Catapult.
-***
-*** Catapult is free software: you can redistribute it and/or modify
-*** it under the terms of the GNU Lesser General Public License as published by
-*** the Free Software Foundation, either version 3 of the License, or
-*** (at your option) any later version.
-***
-*** Catapult is distributed in the hope that it will be useful,
-*** but WITHOUT ANY WARRANTY; without even the implied warranty of
-*** MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-*** GNU Lesser General Public License for more details.
-***
-*** You should have received a copy of the GNU Lesser General Public License
-*** along with Catapult. If not, see .
-**/
-
-import { GeneratorUtils } from './GeneratorUtils';
-
-/** Signature. */
-export class SignatureDto {
- /** Signature. */
- signature: Uint8Array;
-
- /**
- * Constructor.
- *
- * @param signature Signature.
- */
- constructor(signature: Uint8Array) {
- this.signature = signature;
- }
-
- /**
- * Creates an instance of SignatureDto from binary payload.
- *
- * @param payload Byte payload to use to serialize the object.
- * @return Instance of SignatureDto.
- */
- public static loadFromBinary(payload: Uint8Array): SignatureDto {
- const byteArray = Array.from(payload);
- const signature = GeneratorUtils.getBytes(Uint8Array.from(byteArray), 64);
- byteArray.splice(0, 64);
- return new SignatureDto(signature);
- }
-
- /**
- * Gets Signature.
- *
- * @return Signature.
- */
- public getSignature(): Uint8Array {
- return this.signature;
- }
-
- /**
- * Gets the size of the object.
- *
- * @return Size in bytes.
- */
- public getSize(): number {
- return 64;
- }
-
- /**
- * Serializes an object to bytes.
- *
- * @return Serialized bytes.
- */
- public serialize(): Uint8Array {
- let newArray = Uint8Array.from([]);
- newArray = GeneratorUtils.concatTypedArrays(newArray, this.signature);
- return newArray;
- }
-}
diff --git a/src/infrastructure/catbuffer/TimestampDto.ts b/src/infrastructure/catbuffer/TimestampDto.ts
deleted file mode 100644
index af3de24b9e..0000000000
--- a/src/infrastructure/catbuffer/TimestampDto.ts
+++ /dev/null
@@ -1,80 +0,0 @@
-// tslint:disable: jsdoc-format
-/**
-*** Copyright (c) 2016-present,
-*** Jaguar0625, gimre, BloodyRookie, Tech Bureau, Corp. All rights reserved.
-***
-*** This file is part of Catapult.
-***
-*** Catapult is free software: you can redistribute it and/or modify
-*** it under the terms of the GNU Lesser General Public License as published by
-*** the Free Software Foundation, either version 3 of the License, or
-*** (at your option) any later version.
-***
-*** Catapult is distributed in the hope that it will be useful,
-*** but WITHOUT ANY WARRANTY; without even the implied warranty of
-*** MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-*** GNU Lesser General Public License for more details.
-***
-*** You should have received a copy of the GNU Lesser General Public License
-*** along with Catapult. If not, see .
-**/
-
-import { GeneratorUtils } from './GeneratorUtils';
-
-/** Timestamp. */
-export class TimestampDto {
- /** Timestamp. */
- timestamp: number[];
-
- /**
- * Constructor.
- *
- * @param timestamp Timestamp.
- */
- constructor(timestamp: number[]) {
- this.timestamp = timestamp;
- }
-
- /**
- * Creates an instance of TimestampDto from binary payload.
- *
- * @param payload Byte payload to use to serialize the object.
- * @return Instance of TimestampDto.
- */
- public static loadFromBinary(payload: Uint8Array): TimestampDto {
- const byteArray = Array.from(payload);
- const timestamp = GeneratorUtils.bufferToUint64(GeneratorUtils.getBytes(Uint8Array.from(byteArray), 8));
- byteArray.splice(0, 8);
- return new TimestampDto(timestamp);
- }
-
- /**
- * Gets Timestamp.
- *
- * @return Timestamp.
- */
- public getTimestamp(): number[] {
- return this.timestamp;
- }
-
- /**
- * Gets the size of the object.
- *
- * @return Size in bytes.
- */
- public getSize(): number {
- return 8;
- }
-
- /**
- * Serializes an object to bytes.
- *
- * @return Serialized bytes.
- */
- public serialize(): Uint8Array {
- let newArray = Uint8Array.from([]);
- const timestampBytes = GeneratorUtils.uint64ToBuffer(this.getTimestamp());
- newArray = GeneratorUtils.concatTypedArrays(newArray, timestampBytes);
- return newArray;
- }
-}
diff --git a/src/infrastructure/catbuffer/TransactionBuilder.ts b/src/infrastructure/catbuffer/TransactionBuilder.ts
deleted file mode 100644
index bb4135ed6a..0000000000
--- a/src/infrastructure/catbuffer/TransactionBuilder.ts
+++ /dev/null
@@ -1,240 +0,0 @@
-// tslint:disable: jsdoc-format
-/**
-*** Copyright (c) 2016-present,
-*** Jaguar0625, gimre, BloodyRookie, Tech Bureau, Corp. All rights reserved.
-***
-*** This file is part of Catapult.
-***
-*** Catapult is free software: you can redistribute it and/or modify
-*** it under the terms of the GNU Lesser General Public License as published by
-*** the Free Software Foundation, either version 3 of the License, or
-*** (at your option) any later version.
-***
-*** Catapult is distributed in the hope that it will be useful,
-*** but WITHOUT ANY WARRANTY; without even the implied warranty of
-*** MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-*** GNU Lesser General Public License for more details.
-***
-*** You should have received a copy of the GNU Lesser General Public License
-*** along with Catapult. If not, see .
-**/
-
-import { AmountDto } from './AmountDto';
-import { EntityTypeDto } from './EntityTypeDto';
-import { GeneratorUtils } from './GeneratorUtils';
-import { KeyDto } from './KeyDto';
-import { NetworkTypeDto } from './NetworkTypeDto';
-import { SignatureDto } from './SignatureDto';
-import { TimestampDto } from './TimestampDto';
-
-/** Binary layout for a transaction. */
-export class TransactionBuilder {
- /** Entity size. */
- size = 0;
- /** Reserved padding to align Signature on 8-byte boundary. */
- verifiableEntityHeader_Reserved1: number;
- /** Entity signature. */
- signature: SignatureDto;
- /** Entity signer's public key. */
- signerPublicKey: KeyDto;
- /** Reserved padding to align end of EntityBody on 8-byte boundary. */
- entityBody_Reserved1: number;
- /** Entity version. */
- version: number;
- /** Entity network. */
- network: NetworkTypeDto;
- /** Entity type. */
- type: EntityTypeDto;
- /** Transaction fee. */
- fee: AmountDto;
- /** Transaction deadline. */
- deadline: TimestampDto;
-
- /**
- * Constructor.
- *
- * @param signature Entity signature.
- * @param signerPublicKey Entity signer's public key.
- * @param version Entity version.
- * @param network Entity network.
- * @param type Entity type.
- * @param fee Transaction fee.
- * @param deadline Transaction deadline.
- */
- // tslint:disable-next-line: max-line-length
- public constructor(signature: SignatureDto, signerPublicKey: KeyDto, version: number, network: NetworkTypeDto, type: EntityTypeDto, fee: AmountDto, deadline: TimestampDto) {
- this.verifiableEntityHeader_Reserved1 = 0;
- this.signature = signature;
- this.signerPublicKey = signerPublicKey;
- this.entityBody_Reserved1 = 0;
- this.version = version;
- this.network = network;
- this.type = type;
- this.fee = fee;
- this.deadline = deadline;
- }
-
- /**
- * Creates an instance of TransactionBuilder from binary payload.
- *
- * @param payload Byte payload to use to serialize the object.
- * @return Instance of TransactionBuilder.
- */
- public static loadFromBinary(payload: Uint8Array): TransactionBuilder {
- const byteArray = Array.from(payload);
- const size = GeneratorUtils.bufferToUint(GeneratorUtils.getBytes(Uint8Array.from(byteArray), 4));
- byteArray.splice(0, 4);
- // tslint:disable-next-line: max-line-length
- const verifiableEntityHeader_Reserved1 = GeneratorUtils.bufferToUint(GeneratorUtils.getBytes(Uint8Array.from(byteArray), 4));
- byteArray.splice(0, 4);
- const signature = SignatureDto.loadFromBinary(Uint8Array.from(byteArray));
- byteArray.splice(0, signature.getSize());
- const signerPublicKey = KeyDto.loadFromBinary(Uint8Array.from(byteArray));
- byteArray.splice(0, signerPublicKey.getSize());
- const entityBody_Reserved1 = GeneratorUtils.bufferToUint(GeneratorUtils.getBytes(Uint8Array.from(byteArray), 4));
- byteArray.splice(0, 4);
- const version = GeneratorUtils.bufferToUint(GeneratorUtils.getBytes(Uint8Array.from(byteArray), 1));
- byteArray.splice(0, 1);
- const network = GeneratorUtils.bufferToUint(GeneratorUtils.getBytes(Uint8Array.from(byteArray), 1));
- byteArray.splice(0, 1);
- const type = GeneratorUtils.bufferToUint(GeneratorUtils.getBytes(Uint8Array.from(byteArray), 2));
- byteArray.splice(0, 2);
- const fee = AmountDto.loadFromBinary(Uint8Array.from(byteArray));
- byteArray.splice(0, fee.getSize());
- const deadline = TimestampDto.loadFromBinary(Uint8Array.from(byteArray));
- byteArray.splice(0, deadline.getSize());
- return new TransactionBuilder(signature, signerPublicKey, version, network, type, fee, deadline);
- }
-
- /**
- * Gets reserved padding to align Signature on 8-byte boundary.
- *
- * @return Reserved padding to align Signature on 8-byte boundary.
- */
- public getVerifiableEntityHeader_Reserved1(): number {
- return this.verifiableEntityHeader_Reserved1;
- }
-
- /**
- * Gets entity signature.
- *
- * @return Entity signature.
- */
- public getSignature(): SignatureDto {
- return this.signature;
- }
-
- /**
- * Gets entity signer's public key.
- *
- * @return Entity signer's public key.
- */
- public getSignerPublicKey(): KeyDto {
- return this.signerPublicKey;
- }
-
- /**
- * Gets reserved padding to align end of EntityBody on 8-byte boundary.
- *
- * @return Reserved padding to align end of EntityBody on 8-byte boundary.
- */
- public getEntityBody_Reserved1(): number {
- return this.entityBody_Reserved1;
- }
-
- /**
- * Gets entity version.
- *
- * @return Entity version.
- */
- public getVersion(): number {
- return this.version;
- }
-
- /**
- * Gets entity network.
- *
- * @return Entity network.
- */
- public getNetwork(): NetworkTypeDto {
- return this.network;
- }
-
- /**
- * Gets entity type.
- *
- * @return Entity type.
- */
- public getType(): EntityTypeDto {
- return this.type;
- }
-
- /**
- * Gets transaction fee.
- *
- * @return Transaction fee.
- */
- public getFee(): AmountDto {
- return this.fee;
- }
-
- /**
- * Gets transaction deadline.
- *
- * @return Transaction deadline.
- */
- public getDeadline(): TimestampDto {
- return this.deadline;
- }
-
- /**
- * Gets the size of the object.
- *
- * @return Size in bytes.
- */
- public getSize(): number {
- let size = 0;
- size += 4; // size
- size += 4; // verifiableEntityHeader_Reserved1
- size += this.signature.getSize();
- size += this.signerPublicKey.getSize();
- size += 4; // entityBody_Reserved1
- size += 1; // version
- size += 1; // network
- size += 2; // type
- size += this.fee.getSize();
- size += this.deadline.getSize();
- return size;
- }
-
- /**
- * Serializes an object to bytes.
- *
- * @return Serialized bytes.
- */
- public serialize(): Uint8Array {
- let newArray = Uint8Array.from([]);
- const sizeBytes = GeneratorUtils.uintToBuffer(this.getSize(), 4);
- newArray = GeneratorUtils.concatTypedArrays(newArray, sizeBytes);
- // tslint:disable-next-line: max-line-length
- const verifiableEntityHeader_Reserved1Bytes = GeneratorUtils.uintToBuffer(this.getVerifiableEntityHeader_Reserved1(), 4);
- newArray = GeneratorUtils.concatTypedArrays(newArray, verifiableEntityHeader_Reserved1Bytes);
- const signatureBytes = this.signature.serialize();
- newArray = GeneratorUtils.concatTypedArrays(newArray, signatureBytes);
- const signerPublicKeyBytes = this.signerPublicKey.serialize();
- newArray = GeneratorUtils.concatTypedArrays(newArray, signerPublicKeyBytes);
- const entityBody_Reserved1Bytes = GeneratorUtils.uintToBuffer(this.getEntityBody_Reserved1(), 4);
- newArray = GeneratorUtils.concatTypedArrays(newArray, entityBody_Reserved1Bytes);
- const versionBytes = GeneratorUtils.uintToBuffer(this.getVersion(), 1);
- newArray = GeneratorUtils.concatTypedArrays(newArray, versionBytes);
- const networkBytes = GeneratorUtils.uintToBuffer(this.network, 1);
- newArray = GeneratorUtils.concatTypedArrays(newArray, networkBytes);
- const typeBytes = GeneratorUtils.uintToBuffer(this.type, 2);
- newArray = GeneratorUtils.concatTypedArrays(newArray, typeBytes);
- const feeBytes = this.fee.serialize();
- newArray = GeneratorUtils.concatTypedArrays(newArray, feeBytes);
- const deadlineBytes = this.deadline.serialize();
- newArray = GeneratorUtils.concatTypedArrays(newArray, deadlineBytes);
- return newArray;
- }
-}
diff --git a/src/infrastructure/catbuffer/TransferTransactionBodyBuilder.ts b/src/infrastructure/catbuffer/TransferTransactionBodyBuilder.ts
deleted file mode 100644
index c2773d01b3..0000000000
--- a/src/infrastructure/catbuffer/TransferTransactionBodyBuilder.ts
+++ /dev/null
@@ -1,154 +0,0 @@
-// tslint:disable: jsdoc-format
-/**
-*** Copyright (c) 2016-present,
-*** Jaguar0625, gimre, BloodyRookie, Tech Bureau, Corp. All rights reserved.
-***
-*** This file is part of Catapult.
-***
-*** Catapult is free software: you can redistribute it and/or modify
-*** it under the terms of the GNU Lesser General Public License as published by
-*** the Free Software Foundation, either version 3 of the License, or
-*** (at your option) any later version.
-***
-*** Catapult is distributed in the hope that it will be useful,
-*** but WITHOUT ANY WARRANTY; without even the implied warranty of
-*** MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-*** GNU Lesser General Public License for more details.
-***
-*** You should have received a copy of the GNU Lesser General Public License
-*** along with Catapult. If not, see .
-**/
-
-import { GeneratorUtils } from './GeneratorUtils';
-import { UnresolvedAddressDto } from './UnresolvedAddressDto';
-import { UnresolvedMosaicBuilder } from './UnresolvedMosaicBuilder';
-
-/** Binary layout for a transfer transaction. */
-export class TransferTransactionBodyBuilder {
- /** Recipient address. */
- recipientAddress: UnresolvedAddressDto;
- /** Reserved padding to align mosaics on 8-byte boundary. */
- transferTransactionBody_Reserved1: number;
- /** Attached mosaics. */
- mosaics: UnresolvedMosaicBuilder[];
- /** Attached message. */
- message: Uint8Array;
-
- /**
- * Constructor.
- *
- * @param recipientAddress Recipient address.
- * @param mosaics Attached mosaics.
- * @param message Attached message.
- */
- public constructor(recipientAddress: UnresolvedAddressDto, mosaics: UnresolvedMosaicBuilder[], message: Uint8Array) {
- this.recipientAddress = recipientAddress;
- this.transferTransactionBody_Reserved1 = 0;
- this.mosaics = mosaics;
- this.message = message;
- }
-
- /**
- * Creates an instance of TransferTransactionBodyBuilder from binary payload.
- *
- * @param payload Byte payload to use to serialize the object.
- * @return Instance of TransferTransactionBodyBuilder.
- */
- public static loadFromBinary(payload: Uint8Array): TransferTransactionBodyBuilder {
- const byteArray = Array.from(payload);
- const recipientAddress = UnresolvedAddressDto.loadFromBinary(Uint8Array.from(byteArray));
- byteArray.splice(0, recipientAddress.getSize());
- const mosaicsCount = GeneratorUtils.bufferToUint(GeneratorUtils.getBytes(Uint8Array.from(byteArray), 1));
- byteArray.splice(0, 1);
- const messageSize = GeneratorUtils.bufferToUint(GeneratorUtils.getBytes(Uint8Array.from(byteArray), 2));
- byteArray.splice(0, 2);
- // tslint:disable-next-line: max-line-length
- const transferTransactionBody_Reserved1 = GeneratorUtils.bufferToUint(GeneratorUtils.getBytes(Uint8Array.from(byteArray), 4));
- byteArray.splice(0, 4);
- const mosaics: UnresolvedMosaicBuilder[] = [];
- for (let i = 0; i < mosaicsCount; i++) {
- const item = UnresolvedMosaicBuilder.loadFromBinary(Uint8Array.from(byteArray));
- mosaics.push(item);
- byteArray.splice(0, item.getSize());
- }
- const message = GeneratorUtils.getBytes(Uint8Array.from(byteArray), messageSize);
- byteArray.splice(0, messageSize);
- return new TransferTransactionBodyBuilder(recipientAddress, mosaics, message);
- }
-
- /**
- * Gets recipient address.
- *
- * @return Recipient address.
- */
- public getRecipientAddress(): UnresolvedAddressDto {
- return this.recipientAddress;
- }
-
- /**
- * Gets reserved padding to align mosaics on 8-byte boundary.
- *
- * @return Reserved padding to align mosaics on 8-byte boundary.
- */
- public getTransferTransactionBody_Reserved1(): number {
- return this.transferTransactionBody_Reserved1;
- }
-
- /**
- * Gets attached mosaics.
- *
- * @return Attached mosaics.
- */
- public getMosaics(): UnresolvedMosaicBuilder[] {
- return this.mosaics;
- }
-
- /**
- * Gets attached message.
- *
- * @return Attached message.
- */
- public getMessage(): Uint8Array {
- return this.message;
- }
-
- /**
- * Gets the size of the object.
- *
- * @return Size in bytes.
- */
- public getSize(): number {
- let size = 0;
- size += this.recipientAddress.getSize();
- size += 1; // mosaicsCount
- size += 2; // messageSize
- size += 4; // transferTransactionBody_Reserved1
- this.mosaics.forEach((o) => size += o.getSize());
- size += this.message.length;
- return size;
- }
-
- /**
- * Serializes an object to bytes.
- *
- * @return Serialized bytes.
- */
- public serialize(): Uint8Array {
- let newArray = Uint8Array.from([]);
- const recipientAddressBytes = this.recipientAddress.serialize();
- newArray = GeneratorUtils.concatTypedArrays(newArray, recipientAddressBytes);
- const mosaicsCountBytes = GeneratorUtils.uintToBuffer(this.mosaics.length, 1);
- newArray = GeneratorUtils.concatTypedArrays(newArray, mosaicsCountBytes);
- const messageSizeBytes = GeneratorUtils.uintToBuffer(this.message.length, 2);
- newArray = GeneratorUtils.concatTypedArrays(newArray, messageSizeBytes);
- // tslint:disable-next-line: max-line-length
- const transferTransactionBody_Reserved1Bytes = GeneratorUtils.uintToBuffer(this.getTransferTransactionBody_Reserved1(), 4);
- newArray = GeneratorUtils.concatTypedArrays(newArray, transferTransactionBody_Reserved1Bytes);
- this.mosaics.forEach((item) => {
- const mosaicsBytes = item.serialize();
- newArray = GeneratorUtils.concatTypedArrays(newArray, mosaicsBytes);
- });
- newArray = GeneratorUtils.concatTypedArrays(newArray, this.message);
- return newArray;
- }
-}
diff --git a/src/infrastructure/catbuffer/TransferTransactionBuilder.ts b/src/infrastructure/catbuffer/TransferTransactionBuilder.ts
deleted file mode 100644
index b531daefc5..0000000000
--- a/src/infrastructure/catbuffer/TransferTransactionBuilder.ts
+++ /dev/null
@@ -1,135 +0,0 @@
-// tslint:disable: jsdoc-format
-/**
-*** Copyright (c) 2016-present,
-*** Jaguar0625, gimre, BloodyRookie, Tech Bureau, Corp. All rights reserved.
-***
-*** This file is part of Catapult.
-***
-*** Catapult is free software: you can redistribute it and/or modify
-*** it under the terms of the GNU Lesser General Public License as published by
-*** the Free Software Foundation, either version 3 of the License, or
-*** (at your option) any later version.
-***
-*** Catapult is distributed in the hope that it will be useful,
-*** but WITHOUT ANY WARRANTY; without even the implied warranty of
-*** MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-*** GNU Lesser General Public License for more details.
-***
-*** You should have received a copy of the GNU Lesser General Public License
-*** along with Catapult. If not, see .
-**/
-
-import { AmountDto } from './AmountDto';
-import { EntityTypeDto } from './EntityTypeDto';
-import { GeneratorUtils } from './GeneratorUtils';
-import { KeyDto } from './KeyDto';
-import { NetworkTypeDto } from './NetworkTypeDto';
-import { SignatureDto } from './SignatureDto';
-import { TimestampDto } from './TimestampDto';
-import { TransactionBuilder } from './TransactionBuilder';
-import { TransferTransactionBodyBuilder } from './TransferTransactionBodyBuilder';
-import { UnresolvedAddressDto } from './UnresolvedAddressDto';
-import { UnresolvedMosaicBuilder } from './UnresolvedMosaicBuilder';
-
-/** Binary layout for a non-embedded transfer transaction. */
-export class TransferTransactionBuilder extends TransactionBuilder {
- /** Transfer transaction body. */
- transferTransactionBody: TransferTransactionBodyBuilder;
-
- /**
- * Constructor.
- *
- * @param signature Entity signature.
- * @param signerPublicKey Entity signer's public key.
- * @param version Entity version.
- * @param network Entity network.
- * @param type Entity type.
- * @param fee Transaction fee.
- * @param deadline Transaction deadline.
- * @param recipientAddress Recipient address.
- * @param mosaics Attached mosaics.
- * @param message Attached message.
- */
- // tslint:disable-next-line: max-line-length
- public constructor(signature: SignatureDto, signerPublicKey: KeyDto, version: number, network: NetworkTypeDto, type: EntityTypeDto, fee: AmountDto, deadline: TimestampDto, recipientAddress: UnresolvedAddressDto, mosaics: UnresolvedMosaicBuilder[], message: Uint8Array) {
- super(signature, signerPublicKey, version, network, type, fee, deadline);
- this.transferTransactionBody = new TransferTransactionBodyBuilder(recipientAddress, mosaics, message);
- }
-
- /**
- * Creates an instance of TransferTransactionBuilder from binary payload.
- *
- * @param payload Byte payload to use to serialize the object.
- * @return Instance of TransferTransactionBuilder.
- */
- public static loadFromBinary(payload: Uint8Array): TransferTransactionBuilder {
- const byteArray = Array.from(payload);
- const superObject = TransactionBuilder.loadFromBinary(Uint8Array.from(byteArray));
- byteArray.splice(0, superObject.getSize());
- const transferTransactionBody = TransferTransactionBodyBuilder.loadFromBinary(Uint8Array.from(byteArray));
- byteArray.splice(0, transferTransactionBody.getSize());
- // tslint:disable-next-line: max-line-length
- return new TransferTransactionBuilder(superObject.signature, superObject.signerPublicKey, superObject.version, superObject.network, superObject.type, superObject.fee, superObject.deadline, transferTransactionBody.recipientAddress, transferTransactionBody.mosaics, transferTransactionBody.message);
- }
-
- /**
- * Gets recipient address.
- *
- * @return Recipient address.
- */
- public getRecipientAddress(): UnresolvedAddressDto {
- return this.transferTransactionBody.getRecipientAddress();
- }
-
- /**
- * Gets reserved padding to align mosaics on 8-byte boundary.
- *
- * @return Reserved padding to align mosaics on 8-byte boundary.
- */
- public getTransferTransactionBody_Reserved1(): number {
- return this.transferTransactionBody.getTransferTransactionBody_Reserved1();
- }
-
- /**
- * Gets attached mosaics.
- *
- * @return Attached mosaics.
- */
- public getMosaics(): UnresolvedMosaicBuilder[] {
- return this.transferTransactionBody.getMosaics();
- }
-
- /**
- * Gets attached message.
- *
- * @return Attached message.
- */
- public getMessage(): Uint8Array {
- return this.transferTransactionBody.getMessage();
- }
-
- /**
- * Gets the size of the object.
- *
- * @return Size in bytes.
- */
- public getSize(): number {
- let size: number = super.getSize();
- size += this.transferTransactionBody.getSize();
- return size;
- }
-
- /**
- * Serializes an object to bytes.
- *
- * @return Serialized bytes.
- */
- public serialize(): Uint8Array {
- let newArray = Uint8Array.from([]);
- const superBytes = super.serialize();
- newArray = GeneratorUtils.concatTypedArrays(newArray, superBytes);
- const transferTransactionBodyBytes = this.transferTransactionBody.serialize();
- newArray = GeneratorUtils.concatTypedArrays(newArray, transferTransactionBodyBytes);
- return newArray;
- }
-}
diff --git a/src/infrastructure/catbuffer/UnresolvedAddressDto.ts b/src/infrastructure/catbuffer/UnresolvedAddressDto.ts
deleted file mode 100644
index 2a0748d76d..0000000000
--- a/src/infrastructure/catbuffer/UnresolvedAddressDto.ts
+++ /dev/null
@@ -1,79 +0,0 @@
-// tslint:disable: jsdoc-format
-/**
-*** Copyright (c) 2016-present,
-*** Jaguar0625, gimre, BloodyRookie, Tech Bureau, Corp. All rights reserved.
-***
-*** This file is part of Catapult.
-***
-*** Catapult is free software: you can redistribute it and/or modify
-*** it under the terms of the GNU Lesser General Public License as published by
-*** the Free Software Foundation, either version 3 of the License, or
-*** (at your option) any later version.
-***
-*** Catapult is distributed in the hope that it will be useful,
-*** but WITHOUT ANY WARRANTY; without even the implied warranty of
-*** MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-*** GNU Lesser General Public License for more details.
-***
-*** You should have received a copy of the GNU Lesser General Public License
-*** along with Catapult. If not, see .
-**/
-
-import { GeneratorUtils } from './GeneratorUtils';
-
-/** Unresolved address. */
-export class UnresolvedAddressDto {
- /** Unresolved address. */
- unresolvedAddress: Uint8Array;
-
- /**
- * Constructor.
- *
- * @param unresolvedAddress Unresolved address.
- */
- constructor(unresolvedAddress: Uint8Array) {
- this.unresolvedAddress = unresolvedAddress;
- }
-
- /**
- * Creates an instance of UnresolvedAddressDto from binary payload.
- *
- * @param payload Byte payload to use to serialize the object.
- * @return Instance of UnresolvedAddressDto.
- */
- public static loadFromBinary(payload: Uint8Array): UnresolvedAddressDto {
- const byteArray = Array.from(payload);
- const unresolvedAddress = GeneratorUtils.getBytes(Uint8Array.from(byteArray), 25);
- byteArray.splice(0, 25);
- return new UnresolvedAddressDto(unresolvedAddress);
- }
-
- /**
- * Gets Unresolved address.
- *
- * @return Unresolved address.
- */
- public getUnresolvedAddress(): Uint8Array {
- return this.unresolvedAddress;
- }
-
- /**
- * Gets the size of the object.
- *
- * @return Size in bytes.
- */
- public getSize(): number {
- return 25;
- }
-
- /**
- * Serializes an object to bytes.
- *
- * @return Serialized bytes.
- */
- public serialize(): Uint8Array {
- let newArray = Uint8Array.from([]);
- newArray = GeneratorUtils.concatTypedArrays(newArray, this.unresolvedAddress);
- return newArray;
- }
-}
diff --git a/src/infrastructure/catbuffer/UnresolvedMosaicBuilder.ts b/src/infrastructure/catbuffer/UnresolvedMosaicBuilder.ts
deleted file mode 100644
index 5091228ad9..0000000000
--- a/src/infrastructure/catbuffer/UnresolvedMosaicBuilder.ts
+++ /dev/null
@@ -1,102 +0,0 @@
-// tslint:disable: jsdoc-format
-/**
-*** Copyright (c) 2016-present,
-*** Jaguar0625, gimre, BloodyRookie, Tech Bureau, Corp. All rights reserved.
-***
-*** This file is part of Catapult.
-***
-*** Catapult is free software: you can redistribute it and/or modify
-*** it under the terms of the GNU Lesser General Public License as published by
-*** the Free Software Foundation, either version 3 of the License, or
-*** (at your option) any later version.
-***
-*** Catapult is distributed in the hope that it will be useful,
-*** but WITHOUT ANY WARRANTY; without even the implied warranty of
-*** MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-*** GNU Lesser General Public License for more details.
-***
-*** You should have received a copy of the GNU Lesser General Public License
-*** along with Catapult. If not, see .
-**/
-
-import { AmountDto } from './AmountDto';
-import { GeneratorUtils } from './GeneratorUtils';
-import { UnresolvedMosaicIdDto } from './UnresolvedMosaicIdDto';
-
-/** Binary layout for an unresolved mosaic. */
-export class UnresolvedMosaicBuilder {
- /** Mosaic identifier. */
- mosaicId: UnresolvedMosaicIdDto;
- /** Mosaic amount. */
- amount: AmountDto;
-
- /**
- * Constructor.
- *
- * @param mosaicId Mosaic identifier.
- * @param amount Mosaic amount.
- */
- public constructor(mosaicId: UnresolvedMosaicIdDto, amount: AmountDto) {
- this.mosaicId = mosaicId;
- this.amount = amount;
- }
-
- /**
- * Creates an instance of UnresolvedMosaicBuilder from binary payload.
- *
- * @param payload Byte payload to use to serialize the object.
- * @return Instance of UnresolvedMosaicBuilder.
- */
- public static loadFromBinary(payload: Uint8Array): UnresolvedMosaicBuilder {
- const byteArray = Array.from(payload);
- const mosaicId = UnresolvedMosaicIdDto.loadFromBinary(Uint8Array.from(byteArray));
- byteArray.splice(0, mosaicId.getSize());
- const amount = AmountDto.loadFromBinary(Uint8Array.from(byteArray));
- byteArray.splice(0, amount.getSize());
- return new UnresolvedMosaicBuilder(mosaicId, amount);
- }
-
- /**
- * Gets mosaic identifier.
- *
- * @return Mosaic identifier.
- */
- public getMosaicId(): UnresolvedMosaicIdDto {
- return this.mosaicId;
- }
-
- /**
- * Gets mosaic amount.
- *
- * @return Mosaic amount.
- */
- public getAmount(): AmountDto {
- return this.amount;
- }
-
- /**
- * Gets the size of the object.
- *
- * @return Size in bytes.
- */
- public getSize(): number {
- let size = 0;
- size += this.mosaicId.getSize();
- size += this.amount.getSize();
- return size;
- }
-
- /**
- * Serializes an object to bytes.
- *
- * @return Serialized bytes.
- */
- public serialize(): Uint8Array {
- let newArray = Uint8Array.from([]);
- const mosaicIdBytes = this.mosaicId.serialize();
- newArray = GeneratorUtils.concatTypedArrays(newArray, mosaicIdBytes);
- const amountBytes = this.amount.serialize();
- newArray = GeneratorUtils.concatTypedArrays(newArray, amountBytes);
- return newArray;
- }
-}
diff --git a/src/infrastructure/catbuffer/UnresolvedMosaicIdDto.ts b/src/infrastructure/catbuffer/UnresolvedMosaicIdDto.ts
deleted file mode 100644
index 8b49a58aea..0000000000
--- a/src/infrastructure/catbuffer/UnresolvedMosaicIdDto.ts
+++ /dev/null
@@ -1,80 +0,0 @@
-// tslint:disable: jsdoc-format
-/**
-*** Copyright (c) 2016-present,
-*** Jaguar0625, gimre, BloodyRookie, Tech Bureau, Corp. All rights reserved.
-***
-*** This file is part of Catapult.
-***
-*** Catapult is free software: you can redistribute it and/or modify
-*** it under the terms of the GNU Lesser General Public License as published by
-*** the Free Software Foundation, either version 3 of the License, or
-*** (at your option) any later version.
-***
-*** Catapult is distributed in the hope that it will be useful,
-*** but WITHOUT ANY WARRANTY; without even the implied warranty of
-*** MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-*** GNU Lesser General Public License for more details.
-***
-*** You should have received a copy of the GNU Lesser General Public License
-*** along with Catapult. If not, see .
-**/
-
-import { GeneratorUtils } from './GeneratorUtils';
-
-/** Unresolved mosaic id. */
-export class UnresolvedMosaicIdDto {
- /** Unresolved mosaic id. */
- unresolvedMosaicId: number[];
-
- /**
- * Constructor.
- *
- * @param unresolvedMosaicId Unresolved mosaic id.
- */
- constructor(unresolvedMosaicId: number[]) {
- this.unresolvedMosaicId = unresolvedMosaicId;
- }
-
- /**
- * Creates an instance of UnresolvedMosaicIdDto from binary payload.
- *
- * @param payload Byte payload to use to serialize the object.
- * @return Instance of UnresolvedMosaicIdDto.
- */
- public static loadFromBinary(payload: Uint8Array): UnresolvedMosaicIdDto {
- const byteArray = Array.from(payload);
- const unresolvedMosaicId = GeneratorUtils.bufferToUint64(GeneratorUtils.getBytes(Uint8Array.from(byteArray), 8));
- byteArray.splice(0, 8);
- return new UnresolvedMosaicIdDto(unresolvedMosaicId);
- }
-
- /**
- * Gets Unresolved mosaic id.
- *
- * @return Unresolved mosaic id.
- */
- public getUnresolvedMosaicId(): number[] {
- return this.unresolvedMosaicId;
- }
-
- /**
- * Gets the size of the object.
- *
- * @return Size in bytes.
- */
- public getSize(): number {
- return 8;
- }
-
- /**
- * Serializes an object to bytes.
- *
- * @return Serialized bytes.
- */
- public serialize(): Uint8Array {
- let newArray = Uint8Array.from([]);
- const unresolvedMosaicIdBytes = GeneratorUtils.uint64ToBuffer(this.getUnresolvedMosaicId());
- newArray = GeneratorUtils.concatTypedArrays(newArray, unresolvedMosaicIdBytes);
- return newArray;
- }
-}
diff --git a/src/infrastructure/transaction/CreateTransactionFromPayload.ts b/src/infrastructure/transaction/CreateTransactionFromPayload.ts
index 968fc2ab33..65f8eba6f7 100644
--- a/src/infrastructure/transaction/CreateTransactionFromPayload.ts
+++ b/src/infrastructure/transaction/CreateTransactionFromPayload.ts
@@ -14,7 +14,7 @@
* limitations under the License.
*/
-import { SignSchema } from '../../core/crypto';
+import { EmbeddedTransactionBuilder, TransactionBuilder } from 'catbuffer';
import { Convert as convert } from '../../core/format';
import { InnerTransaction } from '../../model/model';
import { AccountAddressRestrictionTransaction } from '../../model/transaction/AccountAddressRestrictionTransaction';
@@ -39,8 +39,6 @@ import { SecretProofTransaction } from '../../model/transaction/SecretProofTrans
import { Transaction } from '../../model/transaction/Transaction';
import { TransactionType } from '../../model/transaction/TransactionType';
import { TransferTransaction } from '../../model/transaction/TransferTransaction';
-import { EmbeddedTransactionBuilder } from '../catbuffer/EmbeddedTransactionBuilder';
-import { TransactionBuilder } from '../catbuffer/TransactionBuilder';
/**
* @internal
diff --git a/src/model/receipt/ArtifactExpiryReceipt.ts b/src/model/receipt/ArtifactExpiryReceipt.ts
index a8a14178e4..ce11165122 100644
--- a/src/model/receipt/ArtifactExpiryReceipt.ts
+++ b/src/model/receipt/ArtifactExpiryReceipt.ts
@@ -14,10 +14,7 @@
* limitations under the License.
*/
-import { MosaicExpiryReceiptBuilder } from '../../infrastructure/catbuffer/MosaicExpiryReceiptBuilder';
-import { MosaicIdDto } from '../../infrastructure/catbuffer/MosaicIdDto';
-import { NamespaceExpiryReceiptBuilder } from '../../infrastructure/catbuffer/NamespaceExpiryReceiptBuilder';
-import { NamespaceIdDto } from '../../infrastructure/catbuffer/NamespaceIdDto';
+import { MosaicExpiryReceiptBuilder, MosaicIdDto, NamespaceExpiryReceiptBuilder, NamespaceIdDto } from 'catbuffer';
import { MosaicId } from '../mosaic/MosaicId';
import { NamespaceId } from '../namespace/NamespaceId';
import { Receipt } from './Receipt';
diff --git a/src/model/receipt/BalanceChangeReceipt.ts b/src/model/receipt/BalanceChangeReceipt.ts
index 7c11b72690..51e837c916 100644
--- a/src/model/receipt/BalanceChangeReceipt.ts
+++ b/src/model/receipt/BalanceChangeReceipt.ts
@@ -14,12 +14,8 @@
* limitations under the License.
*/
+import { AmountDto, BalanceChangeReceiptBuilder, KeyDto, MosaicBuilder, MosaicIdDto } from 'catbuffer';
import { Convert } from '../../core/format/Convert';
-import { AmountDto } from '../../infrastructure/catbuffer/AmountDto';
-import { BalanceChangeReceiptBuilder } from '../../infrastructure/catbuffer/BalanceChangeReceiptBuilder';
-import { KeyDto } from '../../infrastructure/catbuffer/KeyDto';
-import { MosaicBuilder } from '../../infrastructure/catbuffer/MosaicBuilder';
-import { MosaicIdDto } from '../../infrastructure/catbuffer/MosaicIdDto';
import { PublicAccount } from '../account/PublicAccount';
import { MosaicId } from '../mosaic/MosaicId';
import { UInt64 } from '../UInt64';
diff --git a/src/model/receipt/BalanceTransferReceipt.ts b/src/model/receipt/BalanceTransferReceipt.ts
index 4b11cc53f0..7cfdd6a299 100644
--- a/src/model/receipt/BalanceTransferReceipt.ts
+++ b/src/model/receipt/BalanceTransferReceipt.ts
@@ -14,14 +14,9 @@
* limitations under the License.
*/
+import { AddressDto, AmountDto, BalanceTransferReceiptBuilder, KeyDto, MosaicBuilder, MosaicIdDto } from 'catbuffer';
import { Convert } from '../../core/format/Convert';
import { UnresolvedMapping } from '../../core/utils/UnresolvedMapping';
-import { AddressDto } from '../../infrastructure/catbuffer/AddressDto';
-import { AmountDto } from '../../infrastructure/catbuffer/AmountDto';
-import { BalanceTransferReceiptBuilder } from '../../infrastructure/catbuffer/BalanceTransferReceiptBuilder';
-import { KeyDto } from '../../infrastructure/catbuffer/KeyDto';
-import { MosaicBuilder } from '../../infrastructure/catbuffer/MosaicBuilder';
-import { MosaicIdDto } from '../../infrastructure/catbuffer/MosaicIdDto';
import { Address } from '../account/Address';
import { PublicAccount } from '../account/PublicAccount';
import { MosaicId } from '../mosaic/MosaicId';
diff --git a/src/model/receipt/InflationReceipt.ts b/src/model/receipt/InflationReceipt.ts
index f9e217043d..54bb8ebc5c 100644
--- a/src/model/receipt/InflationReceipt.ts
+++ b/src/model/receipt/InflationReceipt.ts
@@ -14,10 +14,7 @@
* limitations under the License.
*/
-import { AmountDto } from '../../infrastructure/catbuffer/AmountDto';
-import { InflationReceiptBuilder } from '../../infrastructure/catbuffer/InflationReceiptBuilder';
-import { MosaicBuilder } from '../../infrastructure/catbuffer/MosaicBuilder';
-import { MosaicIdDto } from '../../infrastructure/catbuffer/MosaicIdDto';
+import { AmountDto, InflationReceiptBuilder, MosaicBuilder, MosaicIdDto } from 'catbuffer';
import { MosaicId } from '../mosaic/MosaicId';
import { UInt64 } from '../UInt64';
import { Receipt } from './Receipt';
diff --git a/src/model/receipt/ReceiptSource.ts b/src/model/receipt/ReceiptSource.ts
index 508422d12c..6e292811f6 100644
--- a/src/model/receipt/ReceiptSource.ts
+++ b/src/model/receipt/ReceiptSource.ts
@@ -1,5 +1,4 @@
-import { Convert } from '../../core/format/Convert';
-import { GeneratorUtils } from '../../infrastructure/catbuffer/GeneratorUtils';
+import { GeneratorUtils } from 'catbuffer';
/*
* Copyright 2019 NEM
diff --git a/src/model/receipt/ResolutionEntry.ts b/src/model/receipt/ResolutionEntry.ts
index c908b84fc3..8b93bbd7d1 100644
--- a/src/model/receipt/ResolutionEntry.ts
+++ b/src/model/receipt/ResolutionEntry.ts
@@ -14,8 +14,8 @@
* limitations under the License.
*/
+import { GeneratorUtils } from 'catbuffer';
import { RawAddress } from '../../core/format/RawAddress';
-import { GeneratorUtils } from '../../infrastructure/catbuffer/GeneratorUtils';
import { Address } from '../account/Address';
import { MosaicId } from '../mosaic/MosaicId';
import { UInt64 } from '../UInt64';
diff --git a/src/model/receipt/ResolutionStatement.ts b/src/model/receipt/ResolutionStatement.ts
index 141e4ebadf..5a3b50492a 100644
--- a/src/model/receipt/ResolutionStatement.ts
+++ b/src/model/receipt/ResolutionStatement.ts
@@ -14,9 +14,9 @@
* limitations under the License.
*/
+import { GeneratorUtils } from 'catbuffer';
import { sha3_256 } from 'js-sha3';
import { UnresolvedMapping } from '../../core/utils/UnresolvedMapping';
-import { GeneratorUtils } from '../../infrastructure/catbuffer/GeneratorUtils';
import { Address } from '../account/Address';
import { NetworkType } from '../blockchain/NetworkType';
import { MosaicId } from '../mosaic/MosaicId';
diff --git a/src/model/receipt/TransactionStatement.ts b/src/model/receipt/TransactionStatement.ts
index 3b75aee85d..35d7c42ae8 100644
--- a/src/model/receipt/TransactionStatement.ts
+++ b/src/model/receipt/TransactionStatement.ts
@@ -14,9 +14,8 @@
* limitations under the License.
*/
+import { GeneratorUtils } from 'catbuffer';
import { sha3_256 } from 'js-sha3';
-import { Convert } from '../../core/format/Convert';
-import { GeneratorUtils } from '../../infrastructure/catbuffer/GeneratorUtils';
import { UInt64 } from '../UInt64';
import { Receipt } from './Receipt';
import { ReceiptSource } from './ReceiptSource';
diff --git a/src/model/transaction/AccountAddressRestrictionTransaction.ts b/src/model/transaction/AccountAddressRestrictionTransaction.ts
index 52cdf79951..4a00a44dc2 100644
--- a/src/model/transaction/AccountAddressRestrictionTransaction.ts
+++ b/src/model/transaction/AccountAddressRestrictionTransaction.ts
@@ -14,19 +14,19 @@
* limitations under the License.
*/
+import {
+ AccountAddressRestrictionTransactionBuilder,
+ AmountDto,
+ EmbeddedAccountAddressRestrictionTransactionBuilder,
+ EmbeddedTransactionBuilder,
+ KeyDto,
+ SignatureDto,
+ TimestampDto,
+ UnresolvedAddressDto
+} from 'catbuffer';
import { Convert } from '../../core/format';
import { DtoMapping } from '../../core/utils/DtoMapping';
import { UnresolvedMapping } from '../../core/utils/UnresolvedMapping';
-import { AccountAddressRestrictionTransactionBuilder } from '../../infrastructure/catbuffer/AccountAddressRestrictionTransactionBuilder';
-import { AmountDto } from '../../infrastructure/catbuffer/AmountDto';
-import {
- EmbeddedAccountAddressRestrictionTransactionBuilder,
-} from '../../infrastructure/catbuffer/EmbeddedAccountAddressRestrictionTransactionBuilder';
-import { EmbeddedTransactionBuilder } from '../../infrastructure/catbuffer/EmbeddedTransactionBuilder';
-import { KeyDto } from '../../infrastructure/catbuffer/KeyDto';
-import { SignatureDto } from '../../infrastructure/catbuffer/SignatureDto';
-import { TimestampDto } from '../../infrastructure/catbuffer/TimestampDto';
-import { UnresolvedAddressDto } from '../../infrastructure/catbuffer/UnresolvedAddressDto';
import { Address } from '../account/Address';
import { PublicAccount } from '../account/PublicAccount';
import { NetworkType } from '../blockchain/NetworkType';
diff --git a/src/model/transaction/AccountLinkTransaction.ts b/src/model/transaction/AccountLinkTransaction.ts
index 2374266254..69910fcbee 100644
--- a/src/model/transaction/AccountLinkTransaction.ts
+++ b/src/model/transaction/AccountLinkTransaction.ts
@@ -14,14 +14,16 @@
* limitations under the License.
*/
+import {
+ AccountLinkTransactionBuilder,
+ AmountDto,
+ EmbeddedAccountLinkTransactionBuilder,
+ EmbeddedTransactionBuilder,
+ KeyDto,
+ SignatureDto,
+ TimestampDto
+} from 'catbuffer';
import { Convert } from '../../core/format';
-import { AccountLinkTransactionBuilder } from '../../infrastructure/catbuffer/AccountLinkTransactionBuilder';
-import { AmountDto } from '../../infrastructure/catbuffer/AmountDto';
-import { EmbeddedAccountLinkTransactionBuilder } from '../../infrastructure/catbuffer/EmbeddedAccountLinkTransactionBuilder';
-import { EmbeddedTransactionBuilder } from '../../infrastructure/catbuffer/EmbeddedTransactionBuilder';
-import { KeyDto } from '../../infrastructure/catbuffer/KeyDto';
-import { SignatureDto } from '../../infrastructure/catbuffer/SignatureDto';
-import { TimestampDto } from '../../infrastructure/catbuffer/TimestampDto';
import { PublicAccount } from '../account/PublicAccount';
import { NetworkType } from '../blockchain/NetworkType';
import { UInt64 } from '../UInt64';
diff --git a/src/model/transaction/AccountMetadataTransaction.ts b/src/model/transaction/AccountMetadataTransaction.ts
index d01429d3af..0d34b17d3d 100644
--- a/src/model/transaction/AccountMetadataTransaction.ts
+++ b/src/model/transaction/AccountMetadataTransaction.ts
@@ -14,14 +14,16 @@
* limitations under the License.
*/
+import {
+ AccountMetadataTransactionBuilder,
+ AmountDto,
+ EmbeddedAccountMetadataTransactionBuilder,
+ EmbeddedTransactionBuilder,
+ KeyDto,
+ SignatureDto,
+ TimestampDto
+} from 'catbuffer';
import { Convert } from '../../core/format';
-import { AccountMetadataTransactionBuilder } from '../../infrastructure/catbuffer/AccountMetadataTransactionBuilder';
-import { AmountDto } from '../../infrastructure/catbuffer/AmountDto';
-import { EmbeddedAccountMetadataTransactionBuilder } from '../../infrastructure/catbuffer/EmbeddedAccountMetadataTransactionBuilder';
-import { EmbeddedTransactionBuilder } from '../../infrastructure/catbuffer/EmbeddedTransactionBuilder';
-import { KeyDto } from '../../infrastructure/catbuffer/KeyDto';
-import { SignatureDto } from '../../infrastructure/catbuffer/SignatureDto';
-import { TimestampDto } from '../../infrastructure/catbuffer/TimestampDto';
import { PublicAccount } from '../account/PublicAccount';
import { NetworkType } from '../blockchain/NetworkType';
import { UInt64 } from '../UInt64';
diff --git a/src/model/transaction/AccountMosaicRestrictionTransaction.ts b/src/model/transaction/AccountMosaicRestrictionTransaction.ts
index d3b8902b53..b3fc9c4183 100644
--- a/src/model/transaction/AccountMosaicRestrictionTransaction.ts
+++ b/src/model/transaction/AccountMosaicRestrictionTransaction.ts
@@ -14,19 +14,19 @@
* limitations under the License.
*/
+import {
+ AccountMosaicRestrictionTransactionBuilder,
+ AmountDto,
+ EmbeddedAccountMosaicRestrictionTransactionBuilder,
+ EmbeddedTransactionBuilder,
+ KeyDto,
+ SignatureDto,
+ TimestampDto,
+ UnresolvedMosaicIdDto
+} from 'catbuffer';
import { Convert } from '../../core/format';
import { DtoMapping } from '../../core/utils/DtoMapping';
import { UnresolvedMapping } from '../../core/utils/UnresolvedMapping';
-import { AccountMosaicRestrictionTransactionBuilder } from '../../infrastructure/catbuffer/AccountMosaicRestrictionTransactionBuilder';
-import { AmountDto } from '../../infrastructure/catbuffer/AmountDto';
-import {
- EmbeddedAccountMosaicRestrictionTransactionBuilder,
-} from '../../infrastructure/catbuffer/EmbeddedAccountMosaicRestrictionTransactionBuilder';
-import { EmbeddedTransactionBuilder } from '../../infrastructure/catbuffer/EmbeddedTransactionBuilder';
-import { KeyDto } from '../../infrastructure/catbuffer/KeyDto';
-import { SignatureDto } from '../../infrastructure/catbuffer/SignatureDto';
-import { TimestampDto } from '../../infrastructure/catbuffer/TimestampDto';
-import { UnresolvedMosaicIdDto } from '../../infrastructure/catbuffer/UnresolvedMosaicIdDto';
import { PublicAccount } from '../account/PublicAccount';
import { NetworkType } from '../blockchain/NetworkType';
import { MosaicId } from '../mosaic/MosaicId';
diff --git a/src/model/transaction/AccountOperationRestrictionTransaction.ts b/src/model/transaction/AccountOperationRestrictionTransaction.ts
index 1dc508e493..9f8cb0e1c0 100644
--- a/src/model/transaction/AccountOperationRestrictionTransaction.ts
+++ b/src/model/transaction/AccountOperationRestrictionTransaction.ts
@@ -14,18 +14,16 @@
* limitations under the License.
*/
-import { Convert } from '../../core/format';
import {
AccountOperationRestrictionTransactionBuilder,
-} from '../../infrastructure/catbuffer/AccountOperationRestrictionTransactionBuilder';
-import { AmountDto } from '../../infrastructure/catbuffer/AmountDto';
-import {
+ AmountDto,
EmbeddedAccountOperationRestrictionTransactionBuilder,
-} from '../../infrastructure/catbuffer/EmbeddedAccountOperationRestrictionTransactionBuilder';
-import { EmbeddedTransactionBuilder } from '../../infrastructure/catbuffer/EmbeddedTransactionBuilder';
-import { KeyDto } from '../../infrastructure/catbuffer/KeyDto';
-import { SignatureDto } from '../../infrastructure/catbuffer/SignatureDto';
-import { TimestampDto } from '../../infrastructure/catbuffer/TimestampDto';
+ EmbeddedTransactionBuilder,
+ KeyDto,
+ SignatureDto,
+ TimestampDto,
+} from 'catbuffer';
+import { Convert } from '../../core/format';
import { PublicAccount } from '../account/PublicAccount';
import { NetworkType } from '../blockchain/NetworkType';
import { AccountRestrictionFlags } from '../restriction/AccountRestrictionType';
diff --git a/src/model/transaction/AddressAliasTransaction.ts b/src/model/transaction/AddressAliasTransaction.ts
index 2ee1a238ac..2708a48d49 100644
--- a/src/model/transaction/AddressAliasTransaction.ts
+++ b/src/model/transaction/AddressAliasTransaction.ts
@@ -14,16 +14,18 @@
* limitations under the License.
*/
+import {
+ AddressAliasTransactionBuilder,
+ AddressDto,
+ AmountDto,
+ EmbeddedAddressAliasTransactionBuilder,
+ EmbeddedTransactionBuilder,
+ KeyDto,
+ NamespaceIdDto,
+ SignatureDto,
+ TimestampDto
+} from 'catbuffer';
import { Convert, RawAddress } from '../../core/format';
-import { AddressAliasTransactionBuilder } from '../../infrastructure/catbuffer/AddressAliasTransactionBuilder';
-import { AddressDto } from '../../infrastructure/catbuffer/AddressDto';
-import { AmountDto } from '../../infrastructure/catbuffer/AmountDto';
-import { EmbeddedAddressAliasTransactionBuilder } from '../../infrastructure/catbuffer/EmbeddedAddressAliasTransactionBuilder';
-import { EmbeddedTransactionBuilder } from '../../infrastructure/catbuffer/EmbeddedTransactionBuilder';
-import { KeyDto } from '../../infrastructure/catbuffer/KeyDto';
-import { NamespaceIdDto } from '../../infrastructure/catbuffer/NamespaceIdDto';
-import { SignatureDto } from '../../infrastructure/catbuffer/SignatureDto';
-import { TimestampDto } from '../../infrastructure/catbuffer/TimestampDto';
import { Address } from '../account/Address';
import { PublicAccount } from '../account/PublicAccount';
import { NetworkType } from '../blockchain/NetworkType';
diff --git a/src/model/transaction/AggregateTransaction.ts b/src/model/transaction/AggregateTransaction.ts
index 073f85ada0..c5c6ed98e2 100644
--- a/src/model/transaction/AggregateTransaction.ts
+++ b/src/model/transaction/AggregateTransaction.ts
@@ -14,35 +14,37 @@
* limitations under the License.
*/
-import {KeyPair, MerkleHashBuilder, SHA3Hasher, SignSchema} from '../../core/crypto';
-import {Convert} from '../../core/format';
+import {
+ AggregateBondedTransactionBuilder,
+ AggregateCompleteTransactionBuilder,
+ AmountDto,
+ CosignatureBuilder,
+ EmbeddedTransactionBuilder,
+ EmbeddedTransactionHelper,
+ GeneratorUtils,
+ Hash256Dto,
+ KeyDto,
+ SignatureDto,
+ TimestampDto
+} from 'catbuffer';
+import { KeyPair, MerkleHashBuilder, SHA3Hasher, SignSchema } from '../../core/crypto';
+import { Convert } from '../../core/format';
import { DtoMapping } from '../../core/utils/DtoMapping';
-import {AggregateBondedTransactionBuilder} from '../../infrastructure/catbuffer/AggregateBondedTransactionBuilder';
-import {AggregateCompleteTransactionBuilder} from '../../infrastructure/catbuffer/AggregateCompleteTransactionBuilder';
-import {AmountDto} from '../../infrastructure/catbuffer/AmountDto';
-import {CosignatureBuilder} from '../../infrastructure/catbuffer/CosignatureBuilder';
-import { EmbeddedTransactionBuilder } from '../../infrastructure/catbuffer/EmbeddedTransactionBuilder';
-import { EmbeddedTransactionHelper } from '../../infrastructure/catbuffer/EmbeddedTransactionHelper';
-import {GeneratorUtils} from '../../infrastructure/catbuffer/GeneratorUtils';
-import { Hash256Dto } from '../../infrastructure/catbuffer/Hash256Dto';
-import {KeyDto} from '../../infrastructure/catbuffer/KeyDto';
-import {SignatureDto} from '../../infrastructure/catbuffer/SignatureDto';
-import {TimestampDto} from '../../infrastructure/catbuffer/TimestampDto';
-import {CreateTransactionFromPayload} from '../../infrastructure/transaction/CreateTransactionFromPayload';
-import {Account} from '../account/Account';
-import {PublicAccount} from '../account/PublicAccount';
-import {NetworkType} from '../blockchain/NetworkType';
+import { CreateTransactionFromPayload } from '../../infrastructure/transaction/CreateTransactionFromPayload';
+import { Account } from '../account/Account';
+import { PublicAccount } from '../account/PublicAccount';
+import { NetworkType } from '../blockchain/NetworkType';
import { Statement } from '../receipt/Statement';
-import {UInt64} from '../UInt64';
-import {AggregateTransactionCosignature} from './AggregateTransactionCosignature';
-import {CosignatureSignedTransaction} from './CosignatureSignedTransaction';
-import {Deadline} from './Deadline';
-import {InnerTransaction} from './InnerTransaction';
-import {SignedTransaction} from './SignedTransaction';
-import {Transaction} from './Transaction';
-import {TransactionInfo} from './TransactionInfo';
-import {TransactionType} from './TransactionType';
-import {TransactionVersion} from './TransactionVersion';
+import { UInt64 } from '../UInt64';
+import { AggregateTransactionCosignature } from './AggregateTransactionCosignature';
+import { CosignatureSignedTransaction } from './CosignatureSignedTransaction';
+import { Deadline } from './Deadline';
+import { InnerTransaction } from './InnerTransaction';
+import { SignedTransaction } from './SignedTransaction';
+import { Transaction } from './Transaction';
+import { TransactionInfo } from './TransactionInfo';
+import { TransactionType } from './TransactionType';
+import { TransactionVersion } from './TransactionVersion';
/**
* Aggregate innerTransactions contain multiple innerTransactions that can be initiated by different accounts.
diff --git a/src/model/transaction/LockFundsTransaction.ts b/src/model/transaction/LockFundsTransaction.ts
index 70ffdb661c..c3d74601c0 100644
--- a/src/model/transaction/LockFundsTransaction.ts
+++ b/src/model/transaction/LockFundsTransaction.ts
@@ -14,19 +14,21 @@
* limitations under the License.
*/
+import {
+ AmountDto,
+ BlockDurationDto,
+ EmbeddedHashLockTransactionBuilder,
+ EmbeddedTransactionBuilder,
+ Hash256Dto,
+ HashLockTransactionBuilder,
+ KeyDto,
+ SignatureDto,
+ TimestampDto,
+ UnresolvedMosaicBuilder,
+ UnresolvedMosaicIdDto
+} from 'catbuffer';
import { Convert } from '../../core/format';
import { DtoMapping } from '../../core/utils/DtoMapping';
-import { AmountDto } from '../../infrastructure/catbuffer/AmountDto';
-import { BlockDurationDto } from '../../infrastructure/catbuffer/BlockDurationDto';
-import { EmbeddedHashLockTransactionBuilder } from '../../infrastructure/catbuffer/EmbeddedHashLockTransactionBuilder';
-import { EmbeddedTransactionBuilder } from '../../infrastructure/catbuffer/EmbeddedTransactionBuilder';
-import { Hash256Dto } from '../../infrastructure/catbuffer/Hash256Dto';
-import { HashLockTransactionBuilder } from '../../infrastructure/catbuffer/HashLockTransactionBuilder';
-import { KeyDto } from '../../infrastructure/catbuffer/KeyDto';
-import { SignatureDto } from '../../infrastructure/catbuffer/SignatureDto';
-import { TimestampDto } from '../../infrastructure/catbuffer/TimestampDto';
-import { UnresolvedMosaicBuilder } from '../../infrastructure/catbuffer/UnresolvedMosaicBuilder';
-import { UnresolvedMosaicIdDto } from '../../infrastructure/catbuffer/UnresolvedMosaicIdDto';
import { PublicAccount } from '../account/PublicAccount';
import { NetworkType } from '../blockchain/NetworkType';
import { Mosaic } from '../mosaic/Mosaic';
diff --git a/src/model/transaction/MosaicAddressRestrictionTransaction.ts b/src/model/transaction/MosaicAddressRestrictionTransaction.ts
index f5a36bfa76..ca0fa027a8 100644
--- a/src/model/transaction/MosaicAddressRestrictionTransaction.ts
+++ b/src/model/transaction/MosaicAddressRestrictionTransaction.ts
@@ -14,20 +14,20 @@
* limitations under the License.
*/
+import {
+ AmountDto,
+ EmbeddedMosaicAddressRestrictionTransactionBuilder,
+ EmbeddedTransactionBuilder,
+ KeyDto,
+ MosaicAddressRestrictionTransactionBuilder,
+ SignatureDto,
+ TimestampDto,
+ UnresolvedAddressDto,
+ UnresolvedMosaicIdDto
+} from 'catbuffer';
import { Convert } from '../../core/format';
import { DtoMapping } from '../../core/utils/DtoMapping';
import { UnresolvedMapping } from '../../core/utils/UnresolvedMapping';
-import { AmountDto } from '../../infrastructure/catbuffer/AmountDto';
-import {
- EmbeddedMosaicAddressRestrictionTransactionBuilder,
-} from '../../infrastructure/catbuffer/EmbeddedMosaicAddressRestrictionTransactionBuilder';
-import { EmbeddedTransactionBuilder } from '../../infrastructure/catbuffer/EmbeddedTransactionBuilder';
-import { KeyDto } from '../../infrastructure/catbuffer/KeyDto';
-import { MosaicAddressRestrictionTransactionBuilder } from '../../infrastructure/catbuffer/MosaicAddressRestrictionTransactionBuilder';
-import { SignatureDto } from '../../infrastructure/catbuffer/SignatureDto';
-import { TimestampDto } from '../../infrastructure/catbuffer/TimestampDto';
-import { UnresolvedAddressDto } from '../../infrastructure/catbuffer/UnresolvedAddressDto';
-import { UnresolvedMosaicIdDto } from '../../infrastructure/catbuffer/UnresolvedMosaicIdDto';
import { Address } from '../account/Address';
import { PublicAccount } from '../account/PublicAccount';
import { NetworkType } from '../blockchain/NetworkType';
diff --git a/src/model/transaction/MosaicAliasTransaction.ts b/src/model/transaction/MosaicAliasTransaction.ts
index 238e8b1fbd..6660849fd8 100644
--- a/src/model/transaction/MosaicAliasTransaction.ts
+++ b/src/model/transaction/MosaicAliasTransaction.ts
@@ -14,16 +14,18 @@
* limitations under the License.
*/
+import {
+ AmountDto,
+ EmbeddedMosaicAliasTransactionBuilder,
+ EmbeddedTransactionBuilder,
+ KeyDto,
+ MosaicAliasTransactionBuilder,
+ MosaicIdDto,
+ NamespaceIdDto,
+ SignatureDto,
+ TimestampDto
+} from 'catbuffer';
import { Convert } from '../../core/format';
-import { AmountDto } from '../../infrastructure/catbuffer/AmountDto';
-import { EmbeddedMosaicAliasTransactionBuilder } from '../../infrastructure/catbuffer/EmbeddedMosaicAliasTransactionBuilder';
-import { EmbeddedTransactionBuilder } from '../../infrastructure/catbuffer/EmbeddedTransactionBuilder';
-import { KeyDto } from '../../infrastructure/catbuffer/KeyDto';
-import { MosaicAliasTransactionBuilder } from '../../infrastructure/catbuffer/MosaicAliasTransactionBuilder';
-import { MosaicIdDto } from '../../infrastructure/catbuffer/MosaicIdDto';
-import { NamespaceIdDto } from '../../infrastructure/catbuffer/NamespaceIdDto';
-import { SignatureDto } from '../../infrastructure/catbuffer/SignatureDto';
-import { TimestampDto } from '../../infrastructure/catbuffer/TimestampDto';
import { PublicAccount } from '../account/PublicAccount';
import { NetworkType } from '../blockchain/NetworkType';
import { MosaicId } from '../mosaic/MosaicId';
diff --git a/src/model/transaction/MosaicDefinitionTransaction.ts b/src/model/transaction/MosaicDefinitionTransaction.ts
index 5b3fe0754b..66b0693bc6 100644
--- a/src/model/transaction/MosaicDefinitionTransaction.ts
+++ b/src/model/transaction/MosaicDefinitionTransaction.ts
@@ -14,18 +14,20 @@
* limitations under the License.
*/
+import {
+ AmountDto,
+ BlockDurationDto,
+ EmbeddedMosaicDefinitionTransactionBuilder,
+ EmbeddedTransactionBuilder,
+ GeneratorUtils,
+ KeyDto,
+ MosaicDefinitionTransactionBuilder,
+ MosaicIdDto,
+ MosaicNonceDto,
+ SignatureDto,
+ TimestampDto
+} from 'catbuffer';
import { Convert } from '../../core/format';
-import { AmountDto } from '../../infrastructure/catbuffer/AmountDto';
-import { BlockDurationDto } from '../../infrastructure/catbuffer/BlockDurationDto';
-import { EmbeddedMosaicDefinitionTransactionBuilder } from '../../infrastructure/catbuffer/EmbeddedMosaicDefinitionTransactionBuilder';
-import { EmbeddedTransactionBuilder } from '../../infrastructure/catbuffer/EmbeddedTransactionBuilder';
-import { GeneratorUtils } from '../../infrastructure/catbuffer/GeneratorUtils';
-import { KeyDto } from '../../infrastructure/catbuffer/KeyDto';
-import { MosaicDefinitionTransactionBuilder } from '../../infrastructure/catbuffer/MosaicDefinitionTransactionBuilder';
-import { MosaicIdDto } from '../../infrastructure/catbuffer/MosaicIdDto';
-import { MosaicNonceDto } from '../../infrastructure/catbuffer/MosaicNonceDto';
-import { SignatureDto } from '../../infrastructure/catbuffer/SignatureDto';
-import { TimestampDto } from '../../infrastructure/catbuffer/TimestampDto';
import { PublicAccount } from '../account/PublicAccount';
import { NetworkType } from '../blockchain/NetworkType';
import { MosaicFlags } from '../mosaic/MosaicFlags';
diff --git a/src/model/transaction/MosaicGlobalRestrictionTransaction.ts b/src/model/transaction/MosaicGlobalRestrictionTransaction.ts
index f4b1969e3d..3525e37238 100644
--- a/src/model/transaction/MosaicGlobalRestrictionTransaction.ts
+++ b/src/model/transaction/MosaicGlobalRestrictionTransaction.ts
@@ -14,19 +14,19 @@
* limitations under the License.
*/
+import {
+ AmountDto,
+ EmbeddedMosaicGlobalRestrictionTransactionBuilder,
+ EmbeddedTransactionBuilder,
+ KeyDto,
+ MosaicGlobalRestrictionTransactionBuilder,
+ SignatureDto,
+ TimestampDto,
+ UnresolvedMosaicIdDto
+} from 'catbuffer';
import { Convert } from '../../core/format';
import { DtoMapping } from '../../core/utils/DtoMapping';
import { UnresolvedMapping } from '../../core/utils/UnresolvedMapping';
-import { AmountDto } from '../../infrastructure/catbuffer/AmountDto';
-import {
- EmbeddedMosaicGlobalRestrictionTransactionBuilder,
-} from '../../infrastructure/catbuffer/EmbeddedMosaicGlobalRestrictionTransactionBuilder';
-import { EmbeddedTransactionBuilder } from '../../infrastructure/catbuffer/EmbeddedTransactionBuilder';
-import { KeyDto } from '../../infrastructure/catbuffer/KeyDto';
-import { MosaicGlobalRestrictionTransactionBuilder } from '../../infrastructure/catbuffer/MosaicGlobalRestrictionTransactionBuilder';
-import { SignatureDto } from '../../infrastructure/catbuffer/SignatureDto';
-import { TimestampDto } from '../../infrastructure/catbuffer/TimestampDto';
-import { UnresolvedMosaicIdDto } from '../../infrastructure/catbuffer/UnresolvedMosaicIdDto';
import { PublicAccount } from '../account/PublicAccount';
import { NetworkType } from '../blockchain/NetworkType';
import { MosaicId } from '../mosaic/MosaicId';
diff --git a/src/model/transaction/MosaicMetadataTransaction.ts b/src/model/transaction/MosaicMetadataTransaction.ts
index e48c636085..cae70a797e 100644
--- a/src/model/transaction/MosaicMetadataTransaction.ts
+++ b/src/model/transaction/MosaicMetadataTransaction.ts
@@ -14,17 +14,19 @@
* limitations under the License.
*/
+import {
+ AmountDto,
+ EmbeddedMosaicMetadataTransactionBuilder,
+ EmbeddedTransactionBuilder,
+ KeyDto,
+ MosaicMetadataTransactionBuilder,
+ SignatureDto,
+ TimestampDto,
+ UnresolvedMosaicIdDto
+} from 'catbuffer';
import { Convert } from '../../core/format';
import { DtoMapping } from '../../core/utils/DtoMapping';
import { UnresolvedMapping } from '../../core/utils/UnresolvedMapping';
-import { AmountDto } from '../../infrastructure/catbuffer/AmountDto';
-import { EmbeddedMosaicMetadataTransactionBuilder } from '../../infrastructure/catbuffer/EmbeddedMosaicMetadataTransactionBuilder';
-import { EmbeddedTransactionBuilder } from '../../infrastructure/catbuffer/EmbeddedTransactionBuilder';
-import { KeyDto } from '../../infrastructure/catbuffer/KeyDto';
-import { MosaicMetadataTransactionBuilder } from '../../infrastructure/catbuffer/MosaicMetadataTransactionBuilder';
-import { SignatureDto } from '../../infrastructure/catbuffer/SignatureDto';
-import { TimestampDto } from '../../infrastructure/catbuffer/TimestampDto';
-import { UnresolvedMosaicIdDto } from '../../infrastructure/catbuffer/UnresolvedMosaicIdDto';
import { PublicAccount } from '../account/PublicAccount';
import { NetworkType } from '../blockchain/NetworkType';
import { MosaicId } from '../mosaic/MosaicId';
diff --git a/src/model/transaction/MosaicSupplyChangeTransaction.ts b/src/model/transaction/MosaicSupplyChangeTransaction.ts
index 93484992a9..70e4887b00 100644
--- a/src/model/transaction/MosaicSupplyChangeTransaction.ts
+++ b/src/model/transaction/MosaicSupplyChangeTransaction.ts
@@ -14,17 +14,19 @@
* limitations under the License.
*/
+import {
+ AmountDto,
+ EmbeddedMosaicSupplyChangeTransactionBuilder,
+ EmbeddedTransactionBuilder,
+ KeyDto,
+ MosaicSupplyChangeTransactionBuilder,
+ SignatureDto,
+ TimestampDto,
+ UnresolvedMosaicIdDto
+} from 'catbuffer';
import { Convert } from '../../core/format';
import { DtoMapping } from '../../core/utils/DtoMapping';
import { UnresolvedMapping } from '../../core/utils/UnresolvedMapping';
-import { AmountDto } from '../../infrastructure/catbuffer/AmountDto';
-import { EmbeddedMosaicSupplyChangeTransactionBuilder } from '../../infrastructure/catbuffer/EmbeddedMosaicSupplyChangeTransactionBuilder';
-import { EmbeddedTransactionBuilder } from '../../infrastructure/catbuffer/EmbeddedTransactionBuilder';
-import { KeyDto } from '../../infrastructure/catbuffer/KeyDto';
-import { MosaicSupplyChangeTransactionBuilder } from '../../infrastructure/catbuffer/MosaicSupplyChangeTransactionBuilder';
-import { SignatureDto } from '../../infrastructure/catbuffer/SignatureDto';
-import { TimestampDto } from '../../infrastructure/catbuffer/TimestampDto';
-import { UnresolvedMosaicIdDto } from '../../infrastructure/catbuffer/UnresolvedMosaicIdDto';
import { PublicAccount } from '../account/PublicAccount';
import { NetworkType } from '../blockchain/NetworkType';
import { MosaicId } from '../mosaic/MosaicId';
diff --git a/src/model/transaction/MultisigAccountModificationTransaction.ts b/src/model/transaction/MultisigAccountModificationTransaction.ts
index fcaefd7fcf..a677906534 100644
--- a/src/model/transaction/MultisigAccountModificationTransaction.ts
+++ b/src/model/transaction/MultisigAccountModificationTransaction.ts
@@ -14,17 +14,16 @@
* limitations under the License.
*/
-import { Convert } from '../../core/format';
-import { AmountDto } from '../../infrastructure/catbuffer/AmountDto';
import {
+ AmountDto,
EmbeddedMultisigAccountModificationTransactionBuilder,
-} from '../../infrastructure/catbuffer/EmbeddedMultisigAccountModificationTransactionBuilder';
-import { EmbeddedTransactionBuilder } from '../../infrastructure/catbuffer/EmbeddedTransactionBuilder';
-import { KeyDto } from '../../infrastructure/catbuffer/KeyDto';
-import {MultisigAccountModificationTransactionBuilder,
-} from '../../infrastructure/catbuffer/MultisigAccountModificationTransactionBuilder';
-import { SignatureDto } from '../../infrastructure/catbuffer/SignatureDto';
-import { TimestampDto } from '../../infrastructure/catbuffer/TimestampDto';
+ EmbeddedTransactionBuilder,
+ KeyDto,
+ MultisigAccountModificationTransactionBuilder,
+ SignatureDto,
+ TimestampDto
+} from 'catbuffer';
+import { Convert } from '../../core/format';
import { PublicAccount } from '../account/PublicAccount';
import { NetworkType } from '../blockchain/NetworkType';
import { UInt64 } from '../UInt64';
diff --git a/src/model/transaction/NamespaceMetadataTransaction.ts b/src/model/transaction/NamespaceMetadataTransaction.ts
index 36e80f13e3..1a3cc7b7c3 100644
--- a/src/model/transaction/NamespaceMetadataTransaction.ts
+++ b/src/model/transaction/NamespaceMetadataTransaction.ts
@@ -14,15 +14,17 @@
* limitations under the License.
*/
+import {
+ AmountDto,
+ EmbeddedNamespaceMetadataTransactionBuilder,
+ EmbeddedTransactionBuilder,
+ KeyDto,
+ NamespaceIdDto,
+ NamespaceMetadataTransactionBuilder,
+ SignatureDto,
+ TimestampDto
+} from 'catbuffer';
import { Convert } from '../../core/format';
-import { AmountDto } from '../../infrastructure/catbuffer/AmountDto';
-import { EmbeddedNamespaceMetadataTransactionBuilder } from '../../infrastructure/catbuffer/EmbeddedNamespaceMetadataTransactionBuilder';
-import { EmbeddedTransactionBuilder } from '../../infrastructure/catbuffer/EmbeddedTransactionBuilder';
-import { KeyDto } from '../../infrastructure/catbuffer/KeyDto';
-import { NamespaceIdDto } from '../../infrastructure/catbuffer/NamespaceIdDto';
-import { NamespaceMetadataTransactionBuilder } from '../../infrastructure/catbuffer/NamespaceMetadataTransactionBuilder';
-import { SignatureDto } from '../../infrastructure/catbuffer/SignatureDto';
-import { TimestampDto } from '../../infrastructure/catbuffer/TimestampDto';
import { PublicAccount } from '../account/PublicAccount';
import { NetworkType } from '../blockchain/NetworkType';
import { NamespaceId } from '../namespace/NamespaceId';
diff --git a/src/model/transaction/NamespaceRegistrationTransaction.ts b/src/model/transaction/NamespaceRegistrationTransaction.ts
index cad026814e..f661b07d50 100644
--- a/src/model/transaction/NamespaceRegistrationTransaction.ts
+++ b/src/model/transaction/NamespaceRegistrationTransaction.ts
@@ -14,19 +14,19 @@
* limitations under the License.
*/
-import { Convert, Convert as convert } from '../../core/format';
-import { AmountDto } from '../../infrastructure/catbuffer/AmountDto';
-import { BlockDurationDto } from '../../infrastructure/catbuffer/BlockDurationDto';
import {
+ AmountDto,
+ BlockDurationDto,
EmbeddedNamespaceRegistrationTransactionBuilder,
-} from '../../infrastructure/catbuffer/EmbeddedNamespaceRegistrationTransactionBuilder';
-import { EmbeddedTransactionBuilder } from '../../infrastructure/catbuffer/EmbeddedTransactionBuilder';
-import { KeyDto } from '../../infrastructure/catbuffer/KeyDto';
-import { NamespaceIdDto } from '../../infrastructure/catbuffer/NamespaceIdDto';
-import { NamespaceRegistrationTransactionBuilder } from '../../infrastructure/catbuffer/NamespaceRegistrationTransactionBuilder';
-import { SignatureDto } from '../../infrastructure/catbuffer/SignatureDto';
-import { TimestampDto } from '../../infrastructure/catbuffer/TimestampDto';
-import {NamespaceMosaicIdGenerator} from '../../infrastructure/transaction/NamespaceMosaicIdGenerator';
+ EmbeddedTransactionBuilder,
+ KeyDto,
+ NamespaceIdDto,
+ NamespaceRegistrationTransactionBuilder,
+ SignatureDto,
+ TimestampDto
+} from 'catbuffer';
+import { Convert, Convert as convert } from '../../core/format';
+import { NamespaceMosaicIdGenerator } from '../../infrastructure/transaction/NamespaceMosaicIdGenerator';
import { PublicAccount } from '../account/PublicAccount';
import { NetworkType } from '../blockchain/NetworkType';
import { NamespaceId } from '../namespace/NamespaceId';
diff --git a/src/model/transaction/SecretLockTransaction.ts b/src/model/transaction/SecretLockTransaction.ts
index 944c2d3039..a7f99783e8 100644
--- a/src/model/transaction/SecretLockTransaction.ts
+++ b/src/model/transaction/SecretLockTransaction.ts
@@ -13,21 +13,23 @@
* See the License for the specific language governing permissions and
* limitations under the License.
*/
+import {
+ AmountDto,
+ BlockDurationDto,
+ EmbeddedSecretLockTransactionBuilder,
+ EmbeddedTransactionBuilder,
+ Hash256Dto,
+ KeyDto,
+ SecretLockTransactionBuilder,
+ SignatureDto,
+ TimestampDto,
+ UnresolvedAddressDto,
+ UnresolvedMosaicBuilder,
+ UnresolvedMosaicIdDto
+} from 'catbuffer';
import { Convert, Convert as convert } from '../../core/format';
import { DtoMapping } from '../../core/utils/DtoMapping';
import { UnresolvedMapping } from '../../core/utils/UnresolvedMapping';
-import { AmountDto } from '../../infrastructure/catbuffer/AmountDto';
-import { BlockDurationDto } from '../../infrastructure/catbuffer/BlockDurationDto';
-import { EmbeddedSecretLockTransactionBuilder } from '../../infrastructure/catbuffer/EmbeddedSecretLockTransactionBuilder';
-import { EmbeddedTransactionBuilder } from '../../infrastructure/catbuffer/EmbeddedTransactionBuilder';
-import { Hash256Dto } from '../../infrastructure/catbuffer/Hash256Dto';
-import { KeyDto } from '../../infrastructure/catbuffer/KeyDto';
-import { SecretLockTransactionBuilder } from '../../infrastructure/catbuffer/SecretLockTransactionBuilder';
-import { SignatureDto } from '../../infrastructure/catbuffer/SignatureDto';
-import { TimestampDto } from '../../infrastructure/catbuffer/TimestampDto';
-import { UnresolvedAddressDto } from '../../infrastructure/catbuffer/UnresolvedAddressDto';
-import { UnresolvedMosaicBuilder } from '../../infrastructure/catbuffer/UnresolvedMosaicBuilder';
-import { UnresolvedMosaicIdDto } from '../../infrastructure/catbuffer/UnresolvedMosaicIdDto';
import { Address } from '../account/Address';
import { PublicAccount } from '../account/PublicAccount';
import { NetworkType } from '../blockchain/NetworkType';
diff --git a/src/model/transaction/SecretProofTransaction.ts b/src/model/transaction/SecretProofTransaction.ts
index 201e491f71..eeed45dbb5 100644
--- a/src/model/transaction/SecretProofTransaction.ts
+++ b/src/model/transaction/SecretProofTransaction.ts
@@ -14,18 +14,20 @@
* limitations under the License.
*/
+import {
+ AmountDto,
+ EmbeddedSecretProofTransactionBuilder,
+ EmbeddedTransactionBuilder,
+ Hash256Dto,
+ KeyDto,
+ SecretProofTransactionBuilder,
+ SignatureDto,
+ TimestampDto,
+ UnresolvedAddressDto
+} from 'catbuffer';
import { Convert, Convert as convert } from '../../core/format';
import { DtoMapping } from '../../core/utils/DtoMapping';
import { UnresolvedMapping } from '../../core/utils/UnresolvedMapping';
-import { AmountDto } from '../../infrastructure/catbuffer/AmountDto';
-import { EmbeddedSecretProofTransactionBuilder } from '../../infrastructure/catbuffer/EmbeddedSecretProofTransactionBuilder';
-import { EmbeddedTransactionBuilder } from '../../infrastructure/catbuffer/EmbeddedTransactionBuilder';
-import { Hash256Dto } from '../../infrastructure/catbuffer/Hash256Dto';
-import { KeyDto } from '../../infrastructure/catbuffer/KeyDto';
-import { SecretProofTransactionBuilder } from '../../infrastructure/catbuffer/SecretProofTransactionBuilder';
-import { SignatureDto } from '../../infrastructure/catbuffer/SignatureDto';
-import { TimestampDto } from '../../infrastructure/catbuffer/TimestampDto';
-import { UnresolvedAddressDto } from '../../infrastructure/catbuffer/UnresolvedAddressDto';
import { Address } from '../account/Address';
import { PublicAccount } from '../account/PublicAccount';
import { NetworkType } from '../blockchain/NetworkType';
diff --git a/src/model/transaction/Transaction.ts b/src/model/transaction/Transaction.ts
index 49db64de8e..cd28128a5d 100644
--- a/src/model/transaction/Transaction.ts
+++ b/src/model/transaction/Transaction.ts
@@ -14,11 +14,10 @@
* limitations under the License.
*/
+import { EmbeddedTransactionBuilder, EmbeddedTransactionHelper } from 'catbuffer';
import { KeyPair, SHA3Hasher, SignSchema } from '../../core/crypto';
import { Convert } from '../../core/format';
import { DtoMapping } from '../../core/utils/DtoMapping';
-import { EmbeddedTransactionBuilder } from '../../infrastructure/catbuffer/EmbeddedTransactionBuilder';
-import { EmbeddedTransactionHelper } from '../../infrastructure/catbuffer/EmbeddedTransactionHelper';
import { SerializeTransactionToJSON } from '../../infrastructure/transaction/SerializeTransactionToJSON';
import { Account } from '../account/Account';
import { PublicAccount } from '../account/PublicAccount';
diff --git a/src/model/transaction/TransferTransaction.ts b/src/model/transaction/TransferTransaction.ts
index 7ea9cb13db..4fdb21ed37 100644
--- a/src/model/transaction/TransferTransaction.ts
+++ b/src/model/transaction/TransferTransaction.ts
@@ -14,38 +14,40 @@
* limitations under the License.
*/
+import {
+ AmountDto,
+ EmbeddedTransactionBuilder,
+ EmbeddedTransferTransactionBuilder,
+ GeneratorUtils,
+ KeyDto,
+ SignatureDto,
+ TimestampDto,
+ TransferTransactionBuilder,
+ UnresolvedAddressDto,
+ UnresolvedMosaicBuilder,
+ UnresolvedMosaicIdDto
+} from 'catbuffer';
import * as Long from 'long';
-import {Convert} from '../../core/format';
-import {UnresolvedMapping} from '../../core/utils/UnresolvedMapping';
-import {AmountDto} from '../../infrastructure/catbuffer/AmountDto';
-import { EmbeddedTransactionBuilder } from '../../infrastructure/catbuffer/EmbeddedTransactionBuilder';
-import {EmbeddedTransferTransactionBuilder} from '../../infrastructure/catbuffer/EmbeddedTransferTransactionBuilder';
-import {GeneratorUtils} from '../../infrastructure/catbuffer/GeneratorUtils';
-import {KeyDto} from '../../infrastructure/catbuffer/KeyDto';
-import {SignatureDto} from '../../infrastructure/catbuffer/SignatureDto';
-import {TimestampDto} from '../../infrastructure/catbuffer/TimestampDto';
-import {TransferTransactionBuilder} from '../../infrastructure/catbuffer/TransferTransactionBuilder';
-import {UnresolvedAddressDto} from '../../infrastructure/catbuffer/UnresolvedAddressDto';
-import {UnresolvedMosaicBuilder} from '../../infrastructure/catbuffer/UnresolvedMosaicBuilder';
-import {UnresolvedMosaicIdDto} from '../../infrastructure/catbuffer/UnresolvedMosaicIdDto';
-import {Address} from '../account/Address';
-import {PublicAccount} from '../account/PublicAccount';
-import {NetworkType} from '../blockchain/NetworkType';
-import {EncryptedMessage} from '../message/EncryptedMessage';
-import {Message} from '../message/Message';
-import {MessageType} from '../message/MessageType';
-import {PlainMessage} from '../message/PlainMessage';
-import {Mosaic} from '../mosaic/Mosaic';
-import {NamespaceId} from '../namespace/NamespaceId';
-import { Statement } from '../receipt/Statement';
-import {UInt64} from '../UInt64';
-import {Deadline} from './Deadline';
-import {InnerTransaction} from './InnerTransaction';
-import {Transaction} from './Transaction';
-import {TransactionInfo} from './TransactionInfo';
-import {TransactionType} from './TransactionType';
-import {TransactionVersion} from './TransactionVersion';
+import { Convert } from '../../core/format';
import { DtoMapping } from '../../core/utils/DtoMapping';
+import { UnresolvedMapping } from '../../core/utils/UnresolvedMapping';
+import { Address } from '../account/Address';
+import { PublicAccount } from '../account/PublicAccount';
+import { NetworkType } from '../blockchain/NetworkType';
+import { EncryptedMessage } from '../message/EncryptedMessage';
+import { Message } from '../message/Message';
+import { MessageType } from '../message/MessageType';
+import { PlainMessage } from '../message/PlainMessage';
+import { Mosaic } from '../mosaic/Mosaic';
+import { NamespaceId } from '../namespace/NamespaceId';
+import { Statement } from '../receipt/Statement';
+import { UInt64 } from '../UInt64';
+import { Deadline } from './Deadline';
+import { InnerTransaction } from './InnerTransaction';
+import { Transaction } from './Transaction';
+import { TransactionInfo } from './TransactionInfo';
+import { TransactionType } from './TransactionType';
+import { TransactionVersion } from './TransactionVersion';
/**
* Transfer transactions contain data about transfers of mosaics and message to another account.
diff --git a/test/model/transaction/Transaction.spec.ts b/test/model/transaction/Transaction.spec.ts
index 04fb2e28b3..fbaed26069 100644
--- a/test/model/transaction/Transaction.spec.ts
+++ b/test/model/transaction/Transaction.spec.ts
@@ -14,10 +14,9 @@
* limitations under the License.
*/
+import { EmbeddedTransactionBuilder } from 'catbuffer';
import { expect } from 'chai';
-import { Observable } from 'rxjs/internal/Observable';
import { Convert } from '../../../src/core/format/Convert';
-import { EmbeddedTransactionBuilder } from '../../../src/infrastructure/catbuffer/EmbeddedTransactionBuilder';
import { Account } from '../../../src/model/account/Account';
import { Address } from '../../../src/model/account/Address';
import { NetworkType } from '../../../src/model/blockchain/NetworkType';