From 3c507324d70ed84d6837ea95a15d36a4242df7d4 Mon Sep 17 00:00:00 2001 From: Steven Liu Date: Mon, 2 Sep 2019 16:07:19 +0100 Subject: [PATCH 01/10] Applied Elephant3 catbuffer codes --- ...untAddressRestrictionTransactionBuilder.ts | 8 +- .../AccountLinkTransactionBodyBuilder.ts | 30 +++---- .../AccountLinkTransactionBuilder.ts | 20 ++--- .../AccountMetadataTransactionBuilder.ts | 8 +- ...ountMosaicRestrictionTransactionBuilder.ts | 8 +- ...tOperationRestrictionTransactionBuilder.ts | 8 +- .../AddressAliasTransactionBuilder.ts | 8 +- .../AggregateBondedTransactionBuilder.ts | 8 +- .../AggregateCompleteTransactionBuilder.ts | 8 +- .../catbuffer/CosignatureBuilder.ts | 24 +++--- .../catbuffer/DetachedCosignatureBuilder.ts | 8 +- ...untAddressRestrictionTransactionBuilder.ts | 8 +- .../EmbeddedAccountLinkTransactionBuilder.ts | 20 ++--- ...beddedAccountMetadataTransactionBuilder.ts | 8 +- ...ountMosaicRestrictionTransactionBuilder.ts | 8 +- ...tOperationRestrictionTransactionBuilder.ts | 8 +- .../EmbeddedAddressAliasTransactionBuilder.ts | 8 +- .../EmbeddedHashLockTransactionBuilder.ts | 8 +- ...aicAddressRestrictionTransactionBuilder.ts | 8 +- .../EmbeddedMosaicAliasTransactionBuilder.ts | 8 +- ...eddedMosaicDefinitionTransactionBuilder.ts | 8 +- ...saicGlobalRestrictionTransactionBuilder.ts | 8 +- ...mbeddedMosaicMetadataTransactionBuilder.ts | 8 +- ...dedMosaicSupplyChangeTransactionBuilder.ts | 8 +- ...igAccountModificationTransactionBuilder.ts | 8 +- ...ddedNamespaceMetadataTransactionBuilder.ts | 8 +- ...NamespaceRegistrationTransactionBuilder.ts | 8 +- .../EmbeddedSecretLockTransactionBuilder.ts | 20 ++--- .../EmbeddedSecretProofTransactionBuilder.ts | 20 ++--- .../catbuffer/EmbeddedTransactionBuilder.ts | 24 +++--- .../EmbeddedTransferTransactionBuilder.ts | 26 +++---- src/infrastructure/catbuffer/EntityTypeDto.ts | 78 +------------------ .../catbuffer/HashLockTransactionBuilder.ts | 8 +- ...aicAddressRestrictionTransactionBuilder.ts | 8 +- .../MosaicAliasTransactionBuilder.ts | 8 +- .../MosaicDefinitionTransactionBuilder.ts | 8 +- ...saicGlobalRestrictionTransactionBuilder.ts | 8 +- .../MosaicMetadataTransactionBuilder.ts | 8 +- .../MosaicSupplyChangeTransactionBuilder.ts | 8 +- ...igAccountModificationTransactionBuilder.ts | 8 +- .../NamespaceMetadataTransactionBuilder.ts | 8 +- ...NamespaceRegistrationTransactionBuilder.ts | 8 +- .../SecretLockTransactionBodyBuilder.ts | 30 +++---- .../catbuffer/SecretLockTransactionBuilder.ts | 20 ++--- .../SecretProofTransactionBodyBuilder.ts | 30 +++---- .../SecretProofTransactionBuilder.ts | 20 ++--- .../catbuffer/TransactionBuilder.ts | 24 +++--- .../TransferTransactionBodyBuilder.ts | 38 ++++----- .../catbuffer/TransferTransactionBuilder.ts | 26 +++---- .../AccountAddressRestrictionTransaction.ts | 2 +- .../transaction/AccountLinkTransaction.ts | 4 +- .../transaction/AccountMetadataTransaction.ts | 2 +- .../AccountMosaicRestrictionTransaction.ts | 2 +- .../AccountOperationRestrictionTransaction.ts | 2 +- .../transaction/AddressAliasTransaction.ts | 2 +- src/model/transaction/LockFundsTransaction.ts | 2 +- .../ModifyMultisigAccountTransaction.ts | 2 +- .../MosaicAddressRestrictionTransaction.ts | 2 +- .../transaction/MosaicAliasTransaction.ts | 2 +- .../MosaicDefinitionTransaction.ts | 2 +- .../MosaicGlobalRestrictionTransaction.ts | 2 +- .../transaction/MosaicMetadataTransaction.ts | 2 +- .../MosaicSupplyChangeTransaction.ts | 2 +- .../NamespaceMetadataTransaction.ts | 2 +- .../RegisterNamespaceTransaction.ts | 2 +- .../transaction/SecretLockTransaction.ts | 4 +- .../transaction/SecretProofTransaction.ts | 4 +- src/model/transaction/TransferTransaction.ts | 4 +- 68 files changed, 343 insertions(+), 417 deletions(-) diff --git a/src/infrastructure/catbuffer/AccountAddressRestrictionTransactionBuilder.ts b/src/infrastructure/catbuffer/AccountAddressRestrictionTransactionBuilder.ts index a20f98b7c6..6e8f296dbf 100644 --- a/src/infrastructure/catbuffer/AccountAddressRestrictionTransactionBuilder.ts +++ b/src/infrastructure/catbuffer/AccountAddressRestrictionTransactionBuilder.ts @@ -39,7 +39,7 @@ export class AccountAddressRestrictionTransactionBuilder extends TransactionBuil * Constructor. * * @param signature Entity signature. - * @param signer Entity signer's public key. + * @param signerPublicKey Entity signer's public key. * @param version Entity version. * @param type Entity type. * @param fee Transaction fee. @@ -48,8 +48,8 @@ export class AccountAddressRestrictionTransactionBuilder extends TransactionBuil * @param modifications Account restriction modifications. */ // tslint:disable-next-line: max-line-length - public constructor(signature: SignatureDto, signer: KeyDto, version: number, type: EntityTypeDto, fee: AmountDto, deadline: TimestampDto, restrictionType: AccountRestrictionTypeDto, modifications: AccountAddressRestrictionModificationBuilder[]) { - super(signature, signer, version, type, fee, deadline); + public constructor(signature: SignatureDto, signerPublicKey: KeyDto, version: number, type: EntityTypeDto, fee: AmountDto, deadline: TimestampDto, restrictionType: AccountRestrictionTypeDto, modifications: AccountAddressRestrictionModificationBuilder[]) { + super(signature, signerPublicKey, version, type, fee, deadline); // tslint:disable-next-line: max-line-length this.accountAddressRestrictionTransactionBody = new AccountAddressRestrictionTransactionBodyBuilder(restrictionType, modifications); } @@ -68,7 +68,7 @@ export class AccountAddressRestrictionTransactionBuilder extends TransactionBuil 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.signer, superObject.version, superObject.type, superObject.fee, superObject.deadline, accountAddressRestrictionTransactionBody.restrictionType, accountAddressRestrictionTransactionBody.modifications); + return new AccountAddressRestrictionTransactionBuilder(superObject.signature, superObject.signerPublicKey, superObject.version, superObject.type, superObject.fee, superObject.deadline, accountAddressRestrictionTransactionBody.restrictionType, accountAddressRestrictionTransactionBody.modifications); } /** diff --git a/src/infrastructure/catbuffer/AccountLinkTransactionBodyBuilder.ts b/src/infrastructure/catbuffer/AccountLinkTransactionBodyBuilder.ts index bddb0b8579..2b85496f6a 100644 --- a/src/infrastructure/catbuffer/AccountLinkTransactionBodyBuilder.ts +++ b/src/infrastructure/catbuffer/AccountLinkTransactionBodyBuilder.ts @@ -25,19 +25,19 @@ import { KeyDto } from './KeyDto'; /** Binary layout for an account link transaction. */ export class AccountLinkTransactionBodyBuilder { - /** Remote account public key. */ - remoteAccountPublicKey: KeyDto; + /** Remote public key. */ + remotePublicKey: KeyDto; /** Account link action. */ linkAction: AccountLinkActionDto; /** * Constructor. * - * @param remoteAccountPublicKey Remote account public key. + * @param remotePublicKey Remote public key. * @param linkAction Account link action. */ - public constructor(remoteAccountPublicKey: KeyDto, linkAction: AccountLinkActionDto) { - this.remoteAccountPublicKey = remoteAccountPublicKey; + public constructor(remotePublicKey: KeyDto, linkAction: AccountLinkActionDto) { + this.remotePublicKey = remotePublicKey; this.linkAction = linkAction; } @@ -49,20 +49,20 @@ export class AccountLinkTransactionBodyBuilder { */ public static loadFromBinary(payload: Uint8Array): AccountLinkTransactionBodyBuilder { const byteArray = Array.from(payload); - const remoteAccountPublicKey = KeyDto.loadFromBinary(Uint8Array.from(byteArray)); - byteArray.splice(0, remoteAccountPublicKey.getSize()); + 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(remoteAccountPublicKey, linkAction); + return new AccountLinkTransactionBodyBuilder(remotePublicKey, linkAction); } /** - * Gets remote account public key. + * Gets remote public key. * - * @return Remote account public key. + * @return Remote public key. */ - public getRemoteAccountPublicKey(): KeyDto { - return this.remoteAccountPublicKey; + public getRemotePublicKey(): KeyDto { + return this.remotePublicKey; } /** @@ -81,7 +81,7 @@ export class AccountLinkTransactionBodyBuilder { */ public getSize(): number { let size = 0; - size += this.remoteAccountPublicKey.getSize(); + size += this.remotePublicKey.getSize(); size += 1; // linkAction return size; } @@ -93,8 +93,8 @@ export class AccountLinkTransactionBodyBuilder { */ public serialize(): Uint8Array { let newArray = Uint8Array.from([]); - const remoteAccountPublicKeyBytes = this.remoteAccountPublicKey.serialize(); - newArray = GeneratorUtils.concatTypedArrays(newArray, remoteAccountPublicKeyBytes); + 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 index 13aecd9155..670a44e631 100644 --- a/src/infrastructure/catbuffer/AccountLinkTransactionBuilder.ts +++ b/src/infrastructure/catbuffer/AccountLinkTransactionBuilder.ts @@ -38,18 +38,18 @@ export class AccountLinkTransactionBuilder extends TransactionBuilder { * Constructor. * * @param signature Entity signature. - * @param signer Entity signer's public key. + * @param signerPublicKey Entity signer's public key. * @param version Entity version. * @param type Entity type. * @param fee Transaction fee. * @param deadline Transaction deadline. - * @param remoteAccountPublicKey Remote account public key. + * @param remotePublicKey Remote public key. * @param linkAction Account link action. */ // tslint:disable-next-line: max-line-length - public constructor(signature: SignatureDto, signer: KeyDto, version: number, type: EntityTypeDto, fee: AmountDto, deadline: TimestampDto, remoteAccountPublicKey: KeyDto, linkAction: AccountLinkActionDto) { - super(signature, signer, version, type, fee, deadline); - this.accountLinkTransactionBody = new AccountLinkTransactionBodyBuilder(remoteAccountPublicKey, linkAction); + public constructor(signature: SignatureDto, signerPublicKey: KeyDto, version: number, type: EntityTypeDto, fee: AmountDto, deadline: TimestampDto, remotePublicKey: KeyDto, linkAction: AccountLinkActionDto) { + super(signature, signerPublicKey, version, type, fee, deadline); + this.accountLinkTransactionBody = new AccountLinkTransactionBodyBuilder(remotePublicKey, linkAction); } /** @@ -65,16 +65,16 @@ export class AccountLinkTransactionBuilder extends TransactionBuilder { 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.signer, superObject.version, superObject.type, superObject.fee, superObject.deadline, accountLinkTransactionBody.remoteAccountPublicKey, accountLinkTransactionBody.linkAction); + return new AccountLinkTransactionBuilder(superObject.signature, superObject.signerPublicKey, superObject.version, superObject.type, superObject.fee, superObject.deadline, accountLinkTransactionBody.remotePublicKey, accountLinkTransactionBody.linkAction); } /** - * Gets remote account public key. + * Gets remote public key. * - * @return Remote account public key. + * @return Remote public key. */ - public getRemoteAccountPublicKey(): KeyDto { - return this.accountLinkTransactionBody.getRemoteAccountPublicKey(); + public getRemotePublicKey(): KeyDto { + return this.accountLinkTransactionBody.getRemotePublicKey(); } /** diff --git a/src/infrastructure/catbuffer/AccountMetadataTransactionBuilder.ts b/src/infrastructure/catbuffer/AccountMetadataTransactionBuilder.ts index 84daaea40a..5d28de8f5c 100644 --- a/src/infrastructure/catbuffer/AccountMetadataTransactionBuilder.ts +++ b/src/infrastructure/catbuffer/AccountMetadataTransactionBuilder.ts @@ -37,7 +37,7 @@ export class AccountMetadataTransactionBuilder extends TransactionBuilder { * Constructor. * * @param signature Entity signature. - * @param signer Entity signer's public key. + * @param signerPublicKey Entity signer's public key. * @param version Entity version. * @param type Entity type. * @param fee Transaction fee. @@ -50,8 +50,8 @@ export class AccountMetadataTransactionBuilder extends TransactionBuilder { * @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, signer: KeyDto, version: number, type: EntityTypeDto, fee: AmountDto, deadline: TimestampDto, targetPublicKey: KeyDto, scopedMetadataKey: number[], valueSizeDelta: number, value: Uint8Array) { - super(signature, signer, version, type, fee, deadline); + public constructor(signature: SignatureDto, signerPublicKey: KeyDto, version: number, type: EntityTypeDto, fee: AmountDto, deadline: TimestampDto, targetPublicKey: KeyDto, scopedMetadataKey: number[], valueSizeDelta: number, value: Uint8Array) { + super(signature, signerPublicKey, version, type, fee, deadline); // tslint:disable-next-line: max-line-length this.accountMetadataTransactionBody = new AccountMetadataTransactionBodyBuilder(targetPublicKey, scopedMetadataKey, valueSizeDelta, value); } @@ -69,7 +69,7 @@ export class AccountMetadataTransactionBuilder extends TransactionBuilder { 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.signer, superObject.version, superObject.type, superObject.fee, superObject.deadline, accountMetadataTransactionBody.targetPublicKey, accountMetadataTransactionBody.scopedMetadataKey, accountMetadataTransactionBody.valueSizeDelta, accountMetadataTransactionBody.value); + return new AccountMetadataTransactionBuilder(superObject.signature, superObject.signerPublicKey, superObject.version, superObject.type, superObject.fee, superObject.deadline, accountMetadataTransactionBody.targetPublicKey, accountMetadataTransactionBody.scopedMetadataKey, accountMetadataTransactionBody.valueSizeDelta, accountMetadataTransactionBody.value); } /** diff --git a/src/infrastructure/catbuffer/AccountMosaicRestrictionTransactionBuilder.ts b/src/infrastructure/catbuffer/AccountMosaicRestrictionTransactionBuilder.ts index 8b2f79a57e..84630c9b67 100644 --- a/src/infrastructure/catbuffer/AccountMosaicRestrictionTransactionBuilder.ts +++ b/src/infrastructure/catbuffer/AccountMosaicRestrictionTransactionBuilder.ts @@ -39,7 +39,7 @@ export class AccountMosaicRestrictionTransactionBuilder extends TransactionBuild * Constructor. * * @param signature Entity signature. - * @param signer Entity signer's public key. + * @param signerPublicKey Entity signer's public key. * @param version Entity version. * @param type Entity type. * @param fee Transaction fee. @@ -48,8 +48,8 @@ export class AccountMosaicRestrictionTransactionBuilder extends TransactionBuild * @param modifications Account restriction modifications. */ // tslint:disable-next-line: max-line-length - public constructor(signature: SignatureDto, signer: KeyDto, version: number, type: EntityTypeDto, fee: AmountDto, deadline: TimestampDto, restrictionType: AccountRestrictionTypeDto, modifications: AccountMosaicRestrictionModificationBuilder[]) { - super(signature, signer, version, type, fee, deadline); + public constructor(signature: SignatureDto, signerPublicKey: KeyDto, version: number, type: EntityTypeDto, fee: AmountDto, deadline: TimestampDto, restrictionType: AccountRestrictionTypeDto, modifications: AccountMosaicRestrictionModificationBuilder[]) { + super(signature, signerPublicKey, version, type, fee, deadline); // tslint:disable-next-line: max-line-length this.accountMosaicRestrictionTransactionBody = new AccountMosaicRestrictionTransactionBodyBuilder(restrictionType, modifications); } @@ -68,7 +68,7 @@ export class AccountMosaicRestrictionTransactionBuilder extends TransactionBuild 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.signer, superObject.version, superObject.type, superObject.fee, superObject.deadline, accountMosaicRestrictionTransactionBody.restrictionType, accountMosaicRestrictionTransactionBody.modifications); + return new AccountMosaicRestrictionTransactionBuilder(superObject.signature, superObject.signerPublicKey, superObject.version, superObject.type, superObject.fee, superObject.deadline, accountMosaicRestrictionTransactionBody.restrictionType, accountMosaicRestrictionTransactionBody.modifications); } /** diff --git a/src/infrastructure/catbuffer/AccountOperationRestrictionTransactionBuilder.ts b/src/infrastructure/catbuffer/AccountOperationRestrictionTransactionBuilder.ts index 2f5795b732..769bca1acd 100644 --- a/src/infrastructure/catbuffer/AccountOperationRestrictionTransactionBuilder.ts +++ b/src/infrastructure/catbuffer/AccountOperationRestrictionTransactionBuilder.ts @@ -39,7 +39,7 @@ export class AccountOperationRestrictionTransactionBuilder extends TransactionBu * Constructor. * * @param signature Entity signature. - * @param signer Entity signer's public key. + * @param signerPublicKey Entity signer's public key. * @param version Entity version. * @param type Entity type. * @param fee Transaction fee. @@ -48,8 +48,8 @@ export class AccountOperationRestrictionTransactionBuilder extends TransactionBu * @param modifications Account restriction modifications. */ // tslint:disable-next-line: max-line-length - public constructor(signature: SignatureDto, signer: KeyDto, version: number, type: EntityTypeDto, fee: AmountDto, deadline: TimestampDto, restrictionType: AccountRestrictionTypeDto, modifications: AccountOperationRestrictionModificationBuilder[]) { - super(signature, signer, version, type, fee, deadline); + public constructor(signature: SignatureDto, signerPublicKey: KeyDto, version: number, type: EntityTypeDto, fee: AmountDto, deadline: TimestampDto, restrictionType: AccountRestrictionTypeDto, modifications: AccountOperationRestrictionModificationBuilder[]) { + super(signature, signerPublicKey, version, type, fee, deadline); // tslint:disable-next-line: max-line-length this.accountOperationRestrictionTransactionBody = new AccountOperationRestrictionTransactionBodyBuilder(restrictionType, modifications); } @@ -68,7 +68,7 @@ export class AccountOperationRestrictionTransactionBuilder extends TransactionBu 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.signer, superObject.version, superObject.type, superObject.fee, superObject.deadline, accountOperationRestrictionTransactionBody.restrictionType, accountOperationRestrictionTransactionBody.modifications); + return new AccountOperationRestrictionTransactionBuilder(superObject.signature, superObject.signerPublicKey, superObject.version, superObject.type, superObject.fee, superObject.deadline, accountOperationRestrictionTransactionBody.restrictionType, accountOperationRestrictionTransactionBody.modifications); } /** diff --git a/src/infrastructure/catbuffer/AddressAliasTransactionBuilder.ts b/src/infrastructure/catbuffer/AddressAliasTransactionBuilder.ts index a1b64702cc..00afeec058 100644 --- a/src/infrastructure/catbuffer/AddressAliasTransactionBuilder.ts +++ b/src/infrastructure/catbuffer/AddressAliasTransactionBuilder.ts @@ -40,7 +40,7 @@ export class AddressAliasTransactionBuilder extends TransactionBuilder { * Constructor. * * @param signature Entity signature. - * @param signer Entity signer's public key. + * @param signerPublicKey Entity signer's public key. * @param version Entity version. * @param type Entity type. * @param fee Transaction fee. @@ -50,8 +50,8 @@ export class AddressAliasTransactionBuilder extends TransactionBuilder { * @param address Aliased address. */ // tslint:disable-next-line: max-line-length - public constructor(signature: SignatureDto, signer: KeyDto, version: number, type: EntityTypeDto, fee: AmountDto, deadline: TimestampDto, aliasAction: AliasActionDto, namespaceId: NamespaceIdDto, address: AddressDto) { - super(signature, signer, version, type, fee, deadline); + public constructor(signature: SignatureDto, signerPublicKey: KeyDto, version: number, type: EntityTypeDto, fee: AmountDto, deadline: TimestampDto, aliasAction: AliasActionDto, namespaceId: NamespaceIdDto, address: AddressDto) { + super(signature, signerPublicKey, version, type, fee, deadline); this.addressAliasTransactionBody = new AddressAliasTransactionBodyBuilder(aliasAction, namespaceId, address); } @@ -68,7 +68,7 @@ export class AddressAliasTransactionBuilder extends TransactionBuilder { 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.signer, superObject.version, superObject.type, superObject.fee, superObject.deadline, addressAliasTransactionBody.aliasAction, addressAliasTransactionBody.namespaceId, addressAliasTransactionBody.address); + return new AddressAliasTransactionBuilder(superObject.signature, superObject.signerPublicKey, superObject.version, superObject.type, superObject.fee, superObject.deadline, addressAliasTransactionBody.aliasAction, addressAliasTransactionBody.namespaceId, addressAliasTransactionBody.address); } /** diff --git a/src/infrastructure/catbuffer/AggregateBondedTransactionBuilder.ts b/src/infrastructure/catbuffer/AggregateBondedTransactionBuilder.ts index af3e1e2ed0..b39ee1522e 100644 --- a/src/infrastructure/catbuffer/AggregateBondedTransactionBuilder.ts +++ b/src/infrastructure/catbuffer/AggregateBondedTransactionBuilder.ts @@ -37,7 +37,7 @@ export class AggregateBondedTransactionBuilder extends TransactionBuilder { * Constructor. * * @param signature Entity signature. - * @param signer Entity signer's public key. + * @param signerPublicKey Entity signer's public key. * @param version Entity version. * @param type Entity type. * @param fee Transaction fee. @@ -46,8 +46,8 @@ export class AggregateBondedTransactionBuilder extends TransactionBuilder { * @param cosignatures Cosignatures data (fills remaining body space after transactions). */ // tslint:disable-next-line: max-line-length - public constructor(signature: SignatureDto, signer: KeyDto, version: number, type: EntityTypeDto, fee: AmountDto, deadline: TimestampDto, transactions: Uint8Array, cosignatures: Uint8Array) { - super(signature, signer, version, type, fee, deadline); + public constructor(signature: SignatureDto, signerPublicKey: KeyDto, version: number, type: EntityTypeDto, fee: AmountDto, deadline: TimestampDto, transactions: Uint8Array, cosignatures: Uint8Array) { + super(signature, signerPublicKey, version, type, fee, deadline); this.aggregateTransactionBody = new AggregateTransactionBodyBuilder(transactions, cosignatures); } @@ -64,7 +64,7 @@ export class AggregateBondedTransactionBuilder extends TransactionBuilder { 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.signer, superObject.version, superObject.type, superObject.fee, superObject.deadline, aggregateTransactionBody.transactions, aggregateTransactionBody.cosignatures); + return new AggregateBondedTransactionBuilder(superObject.signature, superObject.signerPublicKey, superObject.version, superObject.type, superObject.fee, superObject.deadline, aggregateTransactionBody.transactions, aggregateTransactionBody.cosignatures); } /** diff --git a/src/infrastructure/catbuffer/AggregateCompleteTransactionBuilder.ts b/src/infrastructure/catbuffer/AggregateCompleteTransactionBuilder.ts index a68fd86f07..d4fd286441 100644 --- a/src/infrastructure/catbuffer/AggregateCompleteTransactionBuilder.ts +++ b/src/infrastructure/catbuffer/AggregateCompleteTransactionBuilder.ts @@ -37,7 +37,7 @@ export class AggregateCompleteTransactionBuilder extends TransactionBuilder { * Constructor. * * @param signature Entity signature. - * @param signer Entity signer's public key. + * @param signerPublicKey Entity signer's public key. * @param version Entity version. * @param type Entity type. * @param fee Transaction fee. @@ -46,8 +46,8 @@ export class AggregateCompleteTransactionBuilder extends TransactionBuilder { * @param cosignatures Cosignatures data (fills remaining body space after transactions). */ // tslint:disable-next-line: max-line-length - public constructor(signature: SignatureDto, signer: KeyDto, version: number, type: EntityTypeDto, fee: AmountDto, deadline: TimestampDto, transactions: Uint8Array, cosignatures: Uint8Array) { - super(signature, signer, version, type, fee, deadline); + public constructor(signature: SignatureDto, signerPublicKey: KeyDto, version: number, type: EntityTypeDto, fee: AmountDto, deadline: TimestampDto, transactions: Uint8Array, cosignatures: Uint8Array) { + super(signature, signerPublicKey, version, type, fee, deadline); this.aggregateTransactionBody = new AggregateTransactionBodyBuilder(transactions, cosignatures); } @@ -64,7 +64,7 @@ export class AggregateCompleteTransactionBuilder extends TransactionBuilder { 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.signer, superObject.version, superObject.type, superObject.fee, superObject.deadline, aggregateTransactionBody.transactions, aggregateTransactionBody.cosignatures); + return new AggregateCompleteTransactionBuilder(superObject.signature, superObject.signerPublicKey, superObject.version, superObject.type, superObject.fee, superObject.deadline, aggregateTransactionBody.transactions, aggregateTransactionBody.cosignatures); } /** diff --git a/src/infrastructure/catbuffer/CosignatureBuilder.ts b/src/infrastructure/catbuffer/CosignatureBuilder.ts index 447524c2f6..3c1978b04a 100644 --- a/src/infrastructure/catbuffer/CosignatureBuilder.ts +++ b/src/infrastructure/catbuffer/CosignatureBuilder.ts @@ -26,18 +26,18 @@ import { SignatureDto } from './SignatureDto'; /** Cosignature attached to an aggregate transaction. */ export class CosignatureBuilder { /** Cosigner public key. */ - signer: KeyDto; + signerPublicKey: KeyDto; /** Cosigner signature. */ signature: SignatureDto; /** * Constructor. * - * @param signer Cosigner public key. + * @param signerPublicKey Cosigner public key. * @param signature Cosigner signature. */ - public constructor(signer: KeyDto, signature: SignatureDto) { - this.signer = signer; + public constructor(signerPublicKey: KeyDto, signature: SignatureDto) { + this.signerPublicKey = signerPublicKey; this.signature = signature; } @@ -49,11 +49,11 @@ export class CosignatureBuilder { */ public static loadFromBinary(payload: Uint8Array): CosignatureBuilder { const byteArray = Array.from(payload); - const signer = KeyDto.loadFromBinary(Uint8Array.from(byteArray)); - byteArray.splice(0, signer.getSize()); + 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(signer, signature); + return new CosignatureBuilder(signerPublicKey, signature); } /** @@ -61,8 +61,8 @@ export class CosignatureBuilder { * * @return Cosigner public key. */ - public getSigner(): KeyDto { - return this.signer; + public getSignerPublicKey(): KeyDto { + return this.signerPublicKey; } /** @@ -81,7 +81,7 @@ export class CosignatureBuilder { */ public getSize(): number { let size = 0; - size += this.signer.getSize(); + size += this.signerPublicKey.getSize(); size += this.signature.getSize(); return size; } @@ -93,8 +93,8 @@ export class CosignatureBuilder { */ public serialize(): Uint8Array { let newArray = Uint8Array.from([]); - const signerBytes = this.signer.serialize(); - newArray = GeneratorUtils.concatTypedArrays(newArray, signerBytes); + 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 index f10107ee30..7cf65ab230 100644 --- a/src/infrastructure/catbuffer/DetachedCosignatureBuilder.ts +++ b/src/infrastructure/catbuffer/DetachedCosignatureBuilder.ts @@ -33,12 +33,12 @@ export class DetachedCosignatureBuilder extends CosignatureBuilder { /** * Constructor. * - * @param signer Cosigner public key. + * @param signerPublicKey Cosigner public key. * @param signature Cosigner signature. * @param parentHash Hash of the aggregate transaction that is signed by this cosignature. */ - public constructor(signer: KeyDto, signature: SignatureDto, parentHash: Hash256Dto) { - super(signer, signature); + public constructor(signerPublicKey: KeyDto, signature: SignatureDto, parentHash: Hash256Dto) { + super(signerPublicKey, signature); this.parentHash = parentHash; } @@ -54,7 +54,7 @@ export class DetachedCosignatureBuilder extends CosignatureBuilder { byteArray.splice(0, superObject.getSize()); const parentHash = Hash256Dto.loadFromBinary(Uint8Array.from(byteArray)); byteArray.splice(0, parentHash.getSize()); - return new DetachedCosignatureBuilder(superObject.signer, superObject.signature, parentHash); + return new DetachedCosignatureBuilder(superObject.signerPublicKey, superObject.signature, parentHash); } /** diff --git a/src/infrastructure/catbuffer/EmbeddedAccountAddressRestrictionTransactionBuilder.ts b/src/infrastructure/catbuffer/EmbeddedAccountAddressRestrictionTransactionBuilder.ts index af18bf390d..33e41cf7b6 100644 --- a/src/infrastructure/catbuffer/EmbeddedAccountAddressRestrictionTransactionBuilder.ts +++ b/src/infrastructure/catbuffer/EmbeddedAccountAddressRestrictionTransactionBuilder.ts @@ -35,15 +35,15 @@ export class EmbeddedAccountAddressRestrictionTransactionBuilder extends Embedde /** * Constructor. * - * @param signer Entity signer's public key. + * @param signerPublicKey Entity signer's public key. * @param version Entity version. * @param type Entity type. * @param restrictionType Account restriction type. * @param modifications Account restriction modifications. */ // tslint:disable-next-line: max-line-length - public constructor(signer: KeyDto, version: number, type: EntityTypeDto, restrictionType: AccountRestrictionTypeDto, modifications: AccountAddressRestrictionModificationBuilder[]) { - super(signer, version, type); + public constructor(signerPublicKey: KeyDto, version: number, type: EntityTypeDto, restrictionType: AccountRestrictionTypeDto, modifications: AccountAddressRestrictionModificationBuilder[]) { + super(signerPublicKey, version, type); // tslint:disable-next-line: max-line-length this.accountAddressRestrictionTransactionBody = new AccountAddressRestrictionTransactionBodyBuilder(restrictionType, modifications); } @@ -62,7 +62,7 @@ export class EmbeddedAccountAddressRestrictionTransactionBuilder extends Embedde const accountAddressRestrictionTransactionBody = AccountAddressRestrictionTransactionBodyBuilder.loadFromBinary(Uint8Array.from(byteArray)); byteArray.splice(0, accountAddressRestrictionTransactionBody.getSize()); // tslint:disable-next-line: max-line-length - return new EmbeddedAccountAddressRestrictionTransactionBuilder(superObject.signer, superObject.version, superObject.type, accountAddressRestrictionTransactionBody.restrictionType, accountAddressRestrictionTransactionBody.modifications); + return new EmbeddedAccountAddressRestrictionTransactionBuilder(superObject.signerPublicKey, superObject.version, superObject.type, accountAddressRestrictionTransactionBody.restrictionType, accountAddressRestrictionTransactionBody.modifications); } /** diff --git a/src/infrastructure/catbuffer/EmbeddedAccountLinkTransactionBuilder.ts b/src/infrastructure/catbuffer/EmbeddedAccountLinkTransactionBuilder.ts index c2219f36bb..7e452c409c 100644 --- a/src/infrastructure/catbuffer/EmbeddedAccountLinkTransactionBuilder.ts +++ b/src/infrastructure/catbuffer/EmbeddedAccountLinkTransactionBuilder.ts @@ -34,16 +34,16 @@ export class EmbeddedAccountLinkTransactionBuilder extends EmbeddedTransactionBu /** * Constructor. * - * @param signer Entity signer's public key. + * @param signerPublicKey Entity signer's public key. * @param version Entity version. * @param type Entity type. - * @param remoteAccountPublicKey Remote account public key. + * @param remotePublicKey Remote public key. * @param linkAction Account link action. */ // tslint:disable-next-line: max-line-length - public constructor(signer: KeyDto, version: number, type: EntityTypeDto, remoteAccountPublicKey: KeyDto, linkAction: AccountLinkActionDto) { - super(signer, version, type); - this.accountLinkTransactionBody = new AccountLinkTransactionBodyBuilder(remoteAccountPublicKey, linkAction); + public constructor(signerPublicKey: KeyDto, version: number, type: EntityTypeDto, remotePublicKey: KeyDto, linkAction: AccountLinkActionDto) { + super(signerPublicKey, version, type); + this.accountLinkTransactionBody = new AccountLinkTransactionBodyBuilder(remotePublicKey, linkAction); } /** @@ -59,16 +59,16 @@ export class EmbeddedAccountLinkTransactionBuilder extends EmbeddedTransactionBu const accountLinkTransactionBody = AccountLinkTransactionBodyBuilder.loadFromBinary(Uint8Array.from(byteArray)); byteArray.splice(0, accountLinkTransactionBody.getSize()); // tslint:disable-next-line: max-line-length - return new EmbeddedAccountLinkTransactionBuilder(superObject.signer, superObject.version, superObject.type, accountLinkTransactionBody.remoteAccountPublicKey, accountLinkTransactionBody.linkAction); + return new EmbeddedAccountLinkTransactionBuilder(superObject.signerPublicKey, superObject.version, superObject.type, accountLinkTransactionBody.remotePublicKey, accountLinkTransactionBody.linkAction); } /** - * Gets remote account public key. + * Gets remote public key. * - * @return Remote account public key. + * @return Remote public key. */ - public getRemoteAccountPublicKey(): KeyDto { - return this.accountLinkTransactionBody.getRemoteAccountPublicKey(); + public getRemotePublicKey(): KeyDto { + return this.accountLinkTransactionBody.getRemotePublicKey(); } /** diff --git a/src/infrastructure/catbuffer/EmbeddedAccountMetadataTransactionBuilder.ts b/src/infrastructure/catbuffer/EmbeddedAccountMetadataTransactionBuilder.ts index ec9f33ca7f..38aef8c3ea 100644 --- a/src/infrastructure/catbuffer/EmbeddedAccountMetadataTransactionBuilder.ts +++ b/src/infrastructure/catbuffer/EmbeddedAccountMetadataTransactionBuilder.ts @@ -33,7 +33,7 @@ export class EmbeddedAccountMetadataTransactionBuilder extends EmbeddedTransacti /** * Constructor. * - * @param signer Entity signer's public key. + * @param signerPublicKey Entity signer's public key. * @param version Entity version. * @param type Entity type. * @param targetPublicKey Metadata target public key. @@ -44,8 +44,8 @@ export class EmbeddedAccountMetadataTransactionBuilder extends EmbeddedTransacti * @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(signer: KeyDto, version: number, type: EntityTypeDto, targetPublicKey: KeyDto, scopedMetadataKey: number[], valueSizeDelta: number, value: Uint8Array) { - super(signer, version, type); + public constructor(signerPublicKey: KeyDto, version: number, type: EntityTypeDto, targetPublicKey: KeyDto, scopedMetadataKey: number[], valueSizeDelta: number, value: Uint8Array) { + super(signerPublicKey, version, type); // tslint:disable-next-line: max-line-length this.accountMetadataTransactionBody = new AccountMetadataTransactionBodyBuilder(targetPublicKey, scopedMetadataKey, valueSizeDelta, value); } @@ -63,7 +63,7 @@ export class EmbeddedAccountMetadataTransactionBuilder extends EmbeddedTransacti const accountMetadataTransactionBody = AccountMetadataTransactionBodyBuilder.loadFromBinary(Uint8Array.from(byteArray)); byteArray.splice(0, accountMetadataTransactionBody.getSize()); // tslint:disable-next-line: max-line-length - return new EmbeddedAccountMetadataTransactionBuilder(superObject.signer, superObject.version, superObject.type, accountMetadataTransactionBody.targetPublicKey, accountMetadataTransactionBody.scopedMetadataKey, accountMetadataTransactionBody.valueSizeDelta, accountMetadataTransactionBody.value); + return new EmbeddedAccountMetadataTransactionBuilder(superObject.signerPublicKey, superObject.version, superObject.type, accountMetadataTransactionBody.targetPublicKey, accountMetadataTransactionBody.scopedMetadataKey, accountMetadataTransactionBody.valueSizeDelta, accountMetadataTransactionBody.value); } /** diff --git a/src/infrastructure/catbuffer/EmbeddedAccountMosaicRestrictionTransactionBuilder.ts b/src/infrastructure/catbuffer/EmbeddedAccountMosaicRestrictionTransactionBuilder.ts index d97d085545..52944fbcb7 100644 --- a/src/infrastructure/catbuffer/EmbeddedAccountMosaicRestrictionTransactionBuilder.ts +++ b/src/infrastructure/catbuffer/EmbeddedAccountMosaicRestrictionTransactionBuilder.ts @@ -35,15 +35,15 @@ export class EmbeddedAccountMosaicRestrictionTransactionBuilder extends Embedded /** * Constructor. * - * @param signer Entity signer's public key. + * @param signerPublicKey Entity signer's public key. * @param version Entity version. * @param type Entity type. * @param restrictionType Account restriction type. * @param modifications Account restriction modifications. */ // tslint:disable-next-line: max-line-length - public constructor(signer: KeyDto, version: number, type: EntityTypeDto, restrictionType: AccountRestrictionTypeDto, modifications: AccountMosaicRestrictionModificationBuilder[]) { - super(signer, version, type); + public constructor(signerPublicKey: KeyDto, version: number, type: EntityTypeDto, restrictionType: AccountRestrictionTypeDto, modifications: AccountMosaicRestrictionModificationBuilder[]) { + super(signerPublicKey, version, type); // tslint:disable-next-line: max-line-length this.accountMosaicRestrictionTransactionBody = new AccountMosaicRestrictionTransactionBodyBuilder(restrictionType, modifications); } @@ -62,7 +62,7 @@ export class EmbeddedAccountMosaicRestrictionTransactionBuilder extends Embedded const accountMosaicRestrictionTransactionBody = AccountMosaicRestrictionTransactionBodyBuilder.loadFromBinary(Uint8Array.from(byteArray)); byteArray.splice(0, accountMosaicRestrictionTransactionBody.getSize()); // tslint:disable-next-line: max-line-length - return new EmbeddedAccountMosaicRestrictionTransactionBuilder(superObject.signer, superObject.version, superObject.type, accountMosaicRestrictionTransactionBody.restrictionType, accountMosaicRestrictionTransactionBody.modifications); + return new EmbeddedAccountMosaicRestrictionTransactionBuilder(superObject.signerPublicKey, superObject.version, superObject.type, accountMosaicRestrictionTransactionBody.restrictionType, accountMosaicRestrictionTransactionBody.modifications); } /** diff --git a/src/infrastructure/catbuffer/EmbeddedAccountOperationRestrictionTransactionBuilder.ts b/src/infrastructure/catbuffer/EmbeddedAccountOperationRestrictionTransactionBuilder.ts index c4de2fb15c..83440a09bc 100644 --- a/src/infrastructure/catbuffer/EmbeddedAccountOperationRestrictionTransactionBuilder.ts +++ b/src/infrastructure/catbuffer/EmbeddedAccountOperationRestrictionTransactionBuilder.ts @@ -35,15 +35,15 @@ export class EmbeddedAccountOperationRestrictionTransactionBuilder extends Embed /** * Constructor. * - * @param signer Entity signer's public key. + * @param signerPublicKey Entity signer's public key. * @param version Entity version. * @param type Entity type. * @param restrictionType Account restriction type. * @param modifications Account restriction modifications. */ // tslint:disable-next-line: max-line-length - public constructor(signer: KeyDto, version: number, type: EntityTypeDto, restrictionType: AccountRestrictionTypeDto, modifications: AccountOperationRestrictionModificationBuilder[]) { - super(signer, version, type); + public constructor(signerPublicKey: KeyDto, version: number, type: EntityTypeDto, restrictionType: AccountRestrictionTypeDto, modifications: AccountOperationRestrictionModificationBuilder[]) { + super(signerPublicKey, version, type); // tslint:disable-next-line: max-line-length this.accountOperationRestrictionTransactionBody = new AccountOperationRestrictionTransactionBodyBuilder(restrictionType, modifications); } @@ -62,7 +62,7 @@ export class EmbeddedAccountOperationRestrictionTransactionBuilder extends Embed const accountOperationRestrictionTransactionBody = AccountOperationRestrictionTransactionBodyBuilder.loadFromBinary(Uint8Array.from(byteArray)); byteArray.splice(0, accountOperationRestrictionTransactionBody.getSize()); // tslint:disable-next-line: max-line-length - return new EmbeddedAccountOperationRestrictionTransactionBuilder(superObject.signer, superObject.version, superObject.type, accountOperationRestrictionTransactionBody.restrictionType, accountOperationRestrictionTransactionBody.modifications); + return new EmbeddedAccountOperationRestrictionTransactionBuilder(superObject.signerPublicKey, superObject.version, superObject.type, accountOperationRestrictionTransactionBody.restrictionType, accountOperationRestrictionTransactionBody.modifications); } /** diff --git a/src/infrastructure/catbuffer/EmbeddedAddressAliasTransactionBuilder.ts b/src/infrastructure/catbuffer/EmbeddedAddressAliasTransactionBuilder.ts index 7532500571..01cf461a77 100644 --- a/src/infrastructure/catbuffer/EmbeddedAddressAliasTransactionBuilder.ts +++ b/src/infrastructure/catbuffer/EmbeddedAddressAliasTransactionBuilder.ts @@ -36,7 +36,7 @@ export class EmbeddedAddressAliasTransactionBuilder extends EmbeddedTransactionB /** * Constructor. * - * @param signer Entity signer's public key. + * @param signerPublicKey Entity signer's public key. * @param version Entity version. * @param type Entity type. * @param aliasAction Alias action. @@ -44,8 +44,8 @@ export class EmbeddedAddressAliasTransactionBuilder extends EmbeddedTransactionB * @param address Aliased address. */ // tslint:disable-next-line: max-line-length - public constructor(signer: KeyDto, version: number, type: EntityTypeDto, aliasAction: AliasActionDto, namespaceId: NamespaceIdDto, address: AddressDto) { - super(signer, version, type); + public constructor(signerPublicKey: KeyDto, version: number, type: EntityTypeDto, aliasAction: AliasActionDto, namespaceId: NamespaceIdDto, address: AddressDto) { + super(signerPublicKey, version, type); this.addressAliasTransactionBody = new AddressAliasTransactionBodyBuilder(aliasAction, namespaceId, address); } @@ -62,7 +62,7 @@ export class EmbeddedAddressAliasTransactionBuilder extends EmbeddedTransactionB const addressAliasTransactionBody = AddressAliasTransactionBodyBuilder.loadFromBinary(Uint8Array.from(byteArray)); byteArray.splice(0, addressAliasTransactionBody.getSize()); // tslint:disable-next-line: max-line-length - return new EmbeddedAddressAliasTransactionBuilder(superObject.signer, superObject.version, superObject.type, addressAliasTransactionBody.aliasAction, addressAliasTransactionBody.namespaceId, addressAliasTransactionBody.address); + return new EmbeddedAddressAliasTransactionBuilder(superObject.signerPublicKey, superObject.version, superObject.type, addressAliasTransactionBody.aliasAction, addressAliasTransactionBody.namespaceId, addressAliasTransactionBody.address); } /** diff --git a/src/infrastructure/catbuffer/EmbeddedHashLockTransactionBuilder.ts b/src/infrastructure/catbuffer/EmbeddedHashLockTransactionBuilder.ts index e91a7e98b4..fdf2853498 100644 --- a/src/infrastructure/catbuffer/EmbeddedHashLockTransactionBuilder.ts +++ b/src/infrastructure/catbuffer/EmbeddedHashLockTransactionBuilder.ts @@ -36,7 +36,7 @@ export class EmbeddedHashLockTransactionBuilder extends EmbeddedTransactionBuild /** * Constructor. * - * @param signer Entity signer's public key. + * @param signerPublicKey Entity signer's public key. * @param version Entity version. * @param type Entity type. * @param mosaic Lock mosaic. @@ -44,8 +44,8 @@ export class EmbeddedHashLockTransactionBuilder extends EmbeddedTransactionBuild * @param hash Lock hash. */ // tslint:disable-next-line: max-line-length - public constructor(signer: KeyDto, version: number, type: EntityTypeDto, mosaic: UnresolvedMosaicBuilder, duration: BlockDurationDto, hash: Hash256Dto) { - super(signer, version, type); + public constructor(signerPublicKey: KeyDto, version: number, type: EntityTypeDto, mosaic: UnresolvedMosaicBuilder, duration: BlockDurationDto, hash: Hash256Dto) { + super(signerPublicKey, version, type); this.hashLockTransactionBody = new HashLockTransactionBodyBuilder(mosaic, duration, hash); } @@ -62,7 +62,7 @@ export class EmbeddedHashLockTransactionBuilder extends EmbeddedTransactionBuild const hashLockTransactionBody = HashLockTransactionBodyBuilder.loadFromBinary(Uint8Array.from(byteArray)); byteArray.splice(0, hashLockTransactionBody.getSize()); // tslint:disable-next-line: max-line-length - return new EmbeddedHashLockTransactionBuilder(superObject.signer, superObject.version, superObject.type, hashLockTransactionBody.mosaic, hashLockTransactionBody.duration, hashLockTransactionBody.hash); + return new EmbeddedHashLockTransactionBuilder(superObject.signerPublicKey, superObject.version, superObject.type, hashLockTransactionBody.mosaic, hashLockTransactionBody.duration, hashLockTransactionBody.hash); } /** diff --git a/src/infrastructure/catbuffer/EmbeddedMosaicAddressRestrictionTransactionBuilder.ts b/src/infrastructure/catbuffer/EmbeddedMosaicAddressRestrictionTransactionBuilder.ts index ead5de2075..41b79f9e5a 100644 --- a/src/infrastructure/catbuffer/EmbeddedMosaicAddressRestrictionTransactionBuilder.ts +++ b/src/infrastructure/catbuffer/EmbeddedMosaicAddressRestrictionTransactionBuilder.ts @@ -35,7 +35,7 @@ export class EmbeddedMosaicAddressRestrictionTransactionBuilder extends Embedded /** * Constructor. * - * @param signer Entity signer's public key. + * @param signerPublicKey Entity signer's public key. * @param version Entity version. * @param type Entity type. * @param mosaicId Identifier of the mosaic to which the restriction applies. @@ -45,8 +45,8 @@ export class EmbeddedMosaicAddressRestrictionTransactionBuilder extends Embedded * @param newRestrictionValue New restriction value. */ // tslint:disable-next-line: max-line-length - public constructor(signer: KeyDto, version: number, type: EntityTypeDto, mosaicId: UnresolvedMosaicIdDto, restrictionKey: number[], targetAddress: UnresolvedAddressDto, previousRestrictionValue: number[], newRestrictionValue: number[]) { - super(signer, version, type); + public constructor(signerPublicKey: KeyDto, version: number, type: EntityTypeDto, mosaicId: UnresolvedMosaicIdDto, restrictionKey: number[], targetAddress: UnresolvedAddressDto, previousRestrictionValue: number[], newRestrictionValue: number[]) { + super(signerPublicKey, version, type); // tslint:disable-next-line: max-line-length this.mosaicAddressRestrictionTransactionBody = new MosaicAddressRestrictionTransactionBodyBuilder(mosaicId, restrictionKey, targetAddress, previousRestrictionValue, newRestrictionValue); } @@ -65,7 +65,7 @@ export class EmbeddedMosaicAddressRestrictionTransactionBuilder extends Embedded const mosaicAddressRestrictionTransactionBody = MosaicAddressRestrictionTransactionBodyBuilder.loadFromBinary(Uint8Array.from(byteArray)); byteArray.splice(0, mosaicAddressRestrictionTransactionBody.getSize()); // tslint:disable-next-line: max-line-length - return new EmbeddedMosaicAddressRestrictionTransactionBuilder(superObject.signer, superObject.version, superObject.type, mosaicAddressRestrictionTransactionBody.mosaicId, mosaicAddressRestrictionTransactionBody.restrictionKey, mosaicAddressRestrictionTransactionBody.targetAddress, mosaicAddressRestrictionTransactionBody.previousRestrictionValue, mosaicAddressRestrictionTransactionBody.newRestrictionValue); + return new EmbeddedMosaicAddressRestrictionTransactionBuilder(superObject.signerPublicKey, superObject.version, superObject.type, mosaicAddressRestrictionTransactionBody.mosaicId, mosaicAddressRestrictionTransactionBody.restrictionKey, mosaicAddressRestrictionTransactionBody.targetAddress, mosaicAddressRestrictionTransactionBody.previousRestrictionValue, mosaicAddressRestrictionTransactionBody.newRestrictionValue); } /** diff --git a/src/infrastructure/catbuffer/EmbeddedMosaicAliasTransactionBuilder.ts b/src/infrastructure/catbuffer/EmbeddedMosaicAliasTransactionBuilder.ts index 635b59964f..e5647bcafb 100644 --- a/src/infrastructure/catbuffer/EmbeddedMosaicAliasTransactionBuilder.ts +++ b/src/infrastructure/catbuffer/EmbeddedMosaicAliasTransactionBuilder.ts @@ -36,7 +36,7 @@ export class EmbeddedMosaicAliasTransactionBuilder extends EmbeddedTransactionBu /** * Constructor. * - * @param signer Entity signer's public key. + * @param signerPublicKey Entity signer's public key. * @param version Entity version. * @param type Entity type. * @param aliasAction Alias action. @@ -44,8 +44,8 @@ export class EmbeddedMosaicAliasTransactionBuilder extends EmbeddedTransactionBu * @param mosaicId Aliased mosaic identifier. */ // tslint:disable-next-line: max-line-length - public constructor(signer: KeyDto, version: number, type: EntityTypeDto, aliasAction: AliasActionDto, namespaceId: NamespaceIdDto, mosaicId: MosaicIdDto) { - super(signer, version, type); + public constructor(signerPublicKey: KeyDto, version: number, type: EntityTypeDto, aliasAction: AliasActionDto, namespaceId: NamespaceIdDto, mosaicId: MosaicIdDto) { + super(signerPublicKey, version, type); this.mosaicAliasTransactionBody = new MosaicAliasTransactionBodyBuilder(aliasAction, namespaceId, mosaicId); } @@ -62,7 +62,7 @@ export class EmbeddedMosaicAliasTransactionBuilder extends EmbeddedTransactionBu const mosaicAliasTransactionBody = MosaicAliasTransactionBodyBuilder.loadFromBinary(Uint8Array.from(byteArray)); byteArray.splice(0, mosaicAliasTransactionBody.getSize()); // tslint:disable-next-line: max-line-length - return new EmbeddedMosaicAliasTransactionBuilder(superObject.signer, superObject.version, superObject.type, mosaicAliasTransactionBody.aliasAction, mosaicAliasTransactionBody.namespaceId, mosaicAliasTransactionBody.mosaicId); + return new EmbeddedMosaicAliasTransactionBuilder(superObject.signerPublicKey, superObject.version, superObject.type, mosaicAliasTransactionBody.aliasAction, mosaicAliasTransactionBody.namespaceId, mosaicAliasTransactionBody.mosaicId); } /** diff --git a/src/infrastructure/catbuffer/EmbeddedMosaicDefinitionTransactionBuilder.ts b/src/infrastructure/catbuffer/EmbeddedMosaicDefinitionTransactionBuilder.ts index ad46a89813..a0f9e37f32 100644 --- a/src/infrastructure/catbuffer/EmbeddedMosaicDefinitionTransactionBuilder.ts +++ b/src/infrastructure/catbuffer/EmbeddedMosaicDefinitionTransactionBuilder.ts @@ -36,7 +36,7 @@ export class EmbeddedMosaicDefinitionTransactionBuilder extends EmbeddedTransact /** * Constructor. * - * @param signer Entity signer's public key. + * @param signerPublicKey Entity signer's public key. * @param version Entity version. * @param type Entity type. * @param nonce Mosaic nonce. @@ -46,8 +46,8 @@ export class EmbeddedMosaicDefinitionTransactionBuilder extends EmbeddedTransact * @param duration Mosaic duration. */ // tslint:disable-next-line: max-line-length - public constructor(signer: KeyDto, version: number, type: EntityTypeDto, nonce: MosaicNonceDto, id: MosaicIdDto, flags: number, divisibility: number, duration: BlockDurationDto) { - super(signer, version, type); + public constructor(signerPublicKey: KeyDto, version: number, type: EntityTypeDto, nonce: MosaicNonceDto, id: MosaicIdDto, flags: number, divisibility: number, duration: BlockDurationDto) { + super(signerPublicKey, version, type); // tslint:disable-next-line: max-line-length this.mosaicDefinitionTransactionBody = new MosaicDefinitionTransactionBodyBuilder(nonce, id, flags, divisibility, duration); } @@ -66,7 +66,7 @@ export class EmbeddedMosaicDefinitionTransactionBuilder extends EmbeddedTransact const mosaicDefinitionTransactionBody = MosaicDefinitionTransactionBodyBuilder.loadFromBinary(Uint8Array.from(byteArray)); byteArray.splice(0, mosaicDefinitionTransactionBody.getSize()); // tslint:disable-next-line: max-line-length - return new EmbeddedMosaicDefinitionTransactionBuilder(superObject.signer, superObject.version, superObject.type, mosaicDefinitionTransactionBody.nonce, mosaicDefinitionTransactionBody.id, mosaicDefinitionTransactionBody.flags, mosaicDefinitionTransactionBody.divisibility, mosaicDefinitionTransactionBody.duration); + return new EmbeddedMosaicDefinitionTransactionBuilder(superObject.signerPublicKey, superObject.version, superObject.type, mosaicDefinitionTransactionBody.nonce, mosaicDefinitionTransactionBody.id, mosaicDefinitionTransactionBody.flags, mosaicDefinitionTransactionBody.divisibility, mosaicDefinitionTransactionBody.duration); } /** diff --git a/src/infrastructure/catbuffer/EmbeddedMosaicGlobalRestrictionTransactionBuilder.ts b/src/infrastructure/catbuffer/EmbeddedMosaicGlobalRestrictionTransactionBuilder.ts index 224df49b31..2bf8c534ba 100644 --- a/src/infrastructure/catbuffer/EmbeddedMosaicGlobalRestrictionTransactionBuilder.ts +++ b/src/infrastructure/catbuffer/EmbeddedMosaicGlobalRestrictionTransactionBuilder.ts @@ -35,7 +35,7 @@ export class EmbeddedMosaicGlobalRestrictionTransactionBuilder extends EmbeddedT /** * Constructor. * - * @param signer Entity signer's public key. + * @param signerPublicKey Entity signer's public key. * @param version Entity version. * @param type Entity type. * @param mosaicId Identifier of the mosaic being restricted. @@ -47,8 +47,8 @@ export class EmbeddedMosaicGlobalRestrictionTransactionBuilder extends EmbeddedT * @param newRestrictionType New restriction type. */ // tslint:disable-next-line: max-line-length - public constructor(signer: KeyDto, version: number, type: EntityTypeDto, mosaicId: UnresolvedMosaicIdDto, referenceMosaicId: UnresolvedMosaicIdDto, restrictionKey: number[], previousRestrictionValue: number[], previousRestrictionType: MosaicRestrictionTypeDto, newRestrictionValue: number[], newRestrictionType: MosaicRestrictionTypeDto) { - super(signer, version, type); + public constructor(signerPublicKey: KeyDto, version: number, type: EntityTypeDto, mosaicId: UnresolvedMosaicIdDto, referenceMosaicId: UnresolvedMosaicIdDto, restrictionKey: number[], previousRestrictionValue: number[], previousRestrictionType: MosaicRestrictionTypeDto, newRestrictionValue: number[], newRestrictionType: MosaicRestrictionTypeDto) { + super(signerPublicKey, version, type); // tslint:disable-next-line: max-line-length this.mosaicGlobalRestrictionTransactionBody = new MosaicGlobalRestrictionTransactionBodyBuilder(mosaicId, referenceMosaicId, restrictionKey, previousRestrictionValue, previousRestrictionType, newRestrictionValue, newRestrictionType); } @@ -67,7 +67,7 @@ export class EmbeddedMosaicGlobalRestrictionTransactionBuilder extends EmbeddedT const mosaicGlobalRestrictionTransactionBody = MosaicGlobalRestrictionTransactionBodyBuilder.loadFromBinary(Uint8Array.from(byteArray)); byteArray.splice(0, mosaicGlobalRestrictionTransactionBody.getSize()); // tslint:disable-next-line: max-line-length - return new EmbeddedMosaicGlobalRestrictionTransactionBuilder(superObject.signer, superObject.version, superObject.type, mosaicGlobalRestrictionTransactionBody.mosaicId, mosaicGlobalRestrictionTransactionBody.referenceMosaicId, mosaicGlobalRestrictionTransactionBody.restrictionKey, mosaicGlobalRestrictionTransactionBody.previousRestrictionValue, mosaicGlobalRestrictionTransactionBody.previousRestrictionType, mosaicGlobalRestrictionTransactionBody.newRestrictionValue, mosaicGlobalRestrictionTransactionBody.newRestrictionType); + return new EmbeddedMosaicGlobalRestrictionTransactionBuilder(superObject.signerPublicKey, superObject.version, superObject.type, mosaicGlobalRestrictionTransactionBody.mosaicId, mosaicGlobalRestrictionTransactionBody.referenceMosaicId, mosaicGlobalRestrictionTransactionBody.restrictionKey, mosaicGlobalRestrictionTransactionBody.previousRestrictionValue, mosaicGlobalRestrictionTransactionBody.previousRestrictionType, mosaicGlobalRestrictionTransactionBody.newRestrictionValue, mosaicGlobalRestrictionTransactionBody.newRestrictionType); } /** diff --git a/src/infrastructure/catbuffer/EmbeddedMosaicMetadataTransactionBuilder.ts b/src/infrastructure/catbuffer/EmbeddedMosaicMetadataTransactionBuilder.ts index 378bec0bf3..ee3f3b5622 100644 --- a/src/infrastructure/catbuffer/EmbeddedMosaicMetadataTransactionBuilder.ts +++ b/src/infrastructure/catbuffer/EmbeddedMosaicMetadataTransactionBuilder.ts @@ -34,7 +34,7 @@ export class EmbeddedMosaicMetadataTransactionBuilder extends EmbeddedTransactio /** * Constructor. * - * @param signer Entity signer's public key. + * @param signerPublicKey Entity signer's public key. * @param version Entity version. * @param type Entity type. * @param targetPublicKey Metadata target public key. @@ -46,8 +46,8 @@ export class EmbeddedMosaicMetadataTransactionBuilder extends EmbeddedTransactio * @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(signer: KeyDto, version: number, type: EntityTypeDto, targetPublicKey: KeyDto, scopedMetadataKey: number[], targetMosaicId: UnresolvedMosaicIdDto, valueSizeDelta: number, value: Uint8Array) { - super(signer, version, type); + public constructor(signerPublicKey: KeyDto, version: number, type: EntityTypeDto, targetPublicKey: KeyDto, scopedMetadataKey: number[], targetMosaicId: UnresolvedMosaicIdDto, valueSizeDelta: number, value: Uint8Array) { + super(signerPublicKey, version, type); // tslint:disable-next-line: max-line-length this.mosaicMetadataTransactionBody = new MosaicMetadataTransactionBodyBuilder(targetPublicKey, scopedMetadataKey, targetMosaicId, valueSizeDelta, value); } @@ -65,7 +65,7 @@ export class EmbeddedMosaicMetadataTransactionBuilder extends EmbeddedTransactio const mosaicMetadataTransactionBody = MosaicMetadataTransactionBodyBuilder.loadFromBinary(Uint8Array.from(byteArray)); byteArray.splice(0, mosaicMetadataTransactionBody.getSize()); // tslint:disable-next-line: max-line-length - return new EmbeddedMosaicMetadataTransactionBuilder(superObject.signer, superObject.version, superObject.type, mosaicMetadataTransactionBody.targetPublicKey, mosaicMetadataTransactionBody.scopedMetadataKey, mosaicMetadataTransactionBody.targetMosaicId, mosaicMetadataTransactionBody.valueSizeDelta, mosaicMetadataTransactionBody.value); + return new EmbeddedMosaicMetadataTransactionBuilder(superObject.signerPublicKey, superObject.version, superObject.type, mosaicMetadataTransactionBody.targetPublicKey, mosaicMetadataTransactionBody.scopedMetadataKey, mosaicMetadataTransactionBody.targetMosaicId, mosaicMetadataTransactionBody.valueSizeDelta, mosaicMetadataTransactionBody.value); } /** diff --git a/src/infrastructure/catbuffer/EmbeddedMosaicSupplyChangeTransactionBuilder.ts b/src/infrastructure/catbuffer/EmbeddedMosaicSupplyChangeTransactionBuilder.ts index 6f66b59522..b307461d00 100644 --- a/src/infrastructure/catbuffer/EmbeddedMosaicSupplyChangeTransactionBuilder.ts +++ b/src/infrastructure/catbuffer/EmbeddedMosaicSupplyChangeTransactionBuilder.ts @@ -36,7 +36,7 @@ export class EmbeddedMosaicSupplyChangeTransactionBuilder extends EmbeddedTransa /** * Constructor. * - * @param signer Entity signer's public key. + * @param signerPublicKey Entity signer's public key. * @param version Entity version. * @param type Entity type. * @param mosaicId Affected mosaic identifier. @@ -44,8 +44,8 @@ export class EmbeddedMosaicSupplyChangeTransactionBuilder extends EmbeddedTransa * @param delta Change amount. */ // tslint:disable-next-line: max-line-length - public constructor(signer: KeyDto, version: number, type: EntityTypeDto, mosaicId: UnresolvedMosaicIdDto, action: MosaicSupplyChangeActionDto, delta: AmountDto) { - super(signer, version, type); + public constructor(signerPublicKey: KeyDto, version: number, type: EntityTypeDto, mosaicId: UnresolvedMosaicIdDto, action: MosaicSupplyChangeActionDto, delta: AmountDto) { + super(signerPublicKey, version, type); this.mosaicSupplyChangeTransactionBody = new MosaicSupplyChangeTransactionBodyBuilder(mosaicId, action, delta); } @@ -63,7 +63,7 @@ export class EmbeddedMosaicSupplyChangeTransactionBuilder extends EmbeddedTransa const mosaicSupplyChangeTransactionBody = MosaicSupplyChangeTransactionBodyBuilder.loadFromBinary(Uint8Array.from(byteArray)); byteArray.splice(0, mosaicSupplyChangeTransactionBody.getSize()); // tslint:disable-next-line: max-line-length - return new EmbeddedMosaicSupplyChangeTransactionBuilder(superObject.signer, superObject.version, superObject.type, mosaicSupplyChangeTransactionBody.mosaicId, mosaicSupplyChangeTransactionBody.action, mosaicSupplyChangeTransactionBody.delta); + return new EmbeddedMosaicSupplyChangeTransactionBuilder(superObject.signerPublicKey, superObject.version, superObject.type, mosaicSupplyChangeTransactionBody.mosaicId, mosaicSupplyChangeTransactionBody.action, mosaicSupplyChangeTransactionBody.delta); } /** diff --git a/src/infrastructure/catbuffer/EmbeddedMultisigAccountModificationTransactionBuilder.ts b/src/infrastructure/catbuffer/EmbeddedMultisigAccountModificationTransactionBuilder.ts index b2de331994..ad465dd585 100644 --- a/src/infrastructure/catbuffer/EmbeddedMultisigAccountModificationTransactionBuilder.ts +++ b/src/infrastructure/catbuffer/EmbeddedMultisigAccountModificationTransactionBuilder.ts @@ -34,7 +34,7 @@ export class EmbeddedMultisigAccountModificationTransactionBuilder extends Embed /** * Constructor. * - * @param signer Entity signer's public key. + * @param signerPublicKey Entity signer's public key. * @param version Entity version. * @param type Entity type. * @param minRemovalDelta Relative change of the minimal number of cosignatories required when removing an account. @@ -42,8 +42,8 @@ export class EmbeddedMultisigAccountModificationTransactionBuilder extends Embed * @param modifications Attached cosignatory modifications. */ // tslint:disable-next-line: max-line-length - public constructor(signer: KeyDto, version: number, type: EntityTypeDto, minRemovalDelta: number, minApprovalDelta: number, modifications: CosignatoryModificationBuilder[]) { - super(signer, version, type); + public constructor(signerPublicKey: KeyDto, version: number, type: EntityTypeDto, minRemovalDelta: number, minApprovalDelta: number, modifications: CosignatoryModificationBuilder[]) { + super(signerPublicKey, version, type); // tslint:disable-next-line: max-line-length this.multisigAccountModificationTransactionBody = new MultisigAccountModificationTransactionBodyBuilder(minRemovalDelta, minApprovalDelta, modifications); } @@ -62,7 +62,7 @@ export class EmbeddedMultisigAccountModificationTransactionBuilder extends Embed const multisigAccountModificationTransactionBody = MultisigAccountModificationTransactionBodyBuilder.loadFromBinary(Uint8Array.from(byteArray)); byteArray.splice(0, multisigAccountModificationTransactionBody.getSize()); // tslint:disable-next-line: max-line-length - return new EmbeddedMultisigAccountModificationTransactionBuilder(superObject.signer, superObject.version, superObject.type, multisigAccountModificationTransactionBody.minRemovalDelta, multisigAccountModificationTransactionBody.minApprovalDelta, multisigAccountModificationTransactionBody.modifications); + return new EmbeddedMultisigAccountModificationTransactionBuilder(superObject.signerPublicKey, superObject.version, superObject.type, multisigAccountModificationTransactionBody.minRemovalDelta, multisigAccountModificationTransactionBody.minApprovalDelta, multisigAccountModificationTransactionBody.modifications); } /** diff --git a/src/infrastructure/catbuffer/EmbeddedNamespaceMetadataTransactionBuilder.ts b/src/infrastructure/catbuffer/EmbeddedNamespaceMetadataTransactionBuilder.ts index 1d4bbe606c..14e1f84bd0 100644 --- a/src/infrastructure/catbuffer/EmbeddedNamespaceMetadataTransactionBuilder.ts +++ b/src/infrastructure/catbuffer/EmbeddedNamespaceMetadataTransactionBuilder.ts @@ -34,7 +34,7 @@ export class EmbeddedNamespaceMetadataTransactionBuilder extends EmbeddedTransac /** * Constructor. * - * @param signer Entity signer's public key. + * @param signerPublicKey Entity signer's public key. * @param version Entity version. * @param type Entity type. * @param targetPublicKey Metadata target public key. @@ -46,8 +46,8 @@ export class EmbeddedNamespaceMetadataTransactionBuilder extends EmbeddedTransac * @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(signer: KeyDto, version: number, type: EntityTypeDto, targetPublicKey: KeyDto, scopedMetadataKey: number[], targetNamespaceId: NamespaceIdDto, valueSizeDelta: number, value: Uint8Array) { - super(signer, version, type); + public constructor(signerPublicKey: KeyDto, version: number, type: EntityTypeDto, targetPublicKey: KeyDto, scopedMetadataKey: number[], targetNamespaceId: NamespaceIdDto, valueSizeDelta: number, value: Uint8Array) { + super(signerPublicKey, version, type); // tslint:disable-next-line: max-line-length this.namespaceMetadataTransactionBody = new NamespaceMetadataTransactionBodyBuilder(targetPublicKey, scopedMetadataKey, targetNamespaceId, valueSizeDelta, value); } @@ -66,7 +66,7 @@ export class EmbeddedNamespaceMetadataTransactionBuilder extends EmbeddedTransac const namespaceMetadataTransactionBody = NamespaceMetadataTransactionBodyBuilder.loadFromBinary(Uint8Array.from(byteArray)); byteArray.splice(0, namespaceMetadataTransactionBody.getSize()); // tslint:disable-next-line: max-line-length - return new EmbeddedNamespaceMetadataTransactionBuilder(superObject.signer, superObject.version, superObject.type, namespaceMetadataTransactionBody.targetPublicKey, namespaceMetadataTransactionBody.scopedMetadataKey, namespaceMetadataTransactionBody.targetNamespaceId, namespaceMetadataTransactionBody.valueSizeDelta, namespaceMetadataTransactionBody.value); + return new EmbeddedNamespaceMetadataTransactionBuilder(superObject.signerPublicKey, superObject.version, superObject.type, namespaceMetadataTransactionBody.targetPublicKey, namespaceMetadataTransactionBody.scopedMetadataKey, namespaceMetadataTransactionBody.targetNamespaceId, namespaceMetadataTransactionBody.valueSizeDelta, namespaceMetadataTransactionBody.value); } /** diff --git a/src/infrastructure/catbuffer/EmbeddedNamespaceRegistrationTransactionBuilder.ts b/src/infrastructure/catbuffer/EmbeddedNamespaceRegistrationTransactionBuilder.ts index 29d51b3fb1..ddde9af0b3 100644 --- a/src/infrastructure/catbuffer/EmbeddedNamespaceRegistrationTransactionBuilder.ts +++ b/src/infrastructure/catbuffer/EmbeddedNamespaceRegistrationTransactionBuilder.ts @@ -36,7 +36,7 @@ export class EmbeddedNamespaceRegistrationTransactionBuilder extends EmbeddedTra /** * Constructor. * - * @param signer Entity signer's public key. + * @param signerPublicKey Entity signer's public key. * @param version Entity version. * @param type Entity type. * @param duration Namespace duration. @@ -45,8 +45,8 @@ export class EmbeddedNamespaceRegistrationTransactionBuilder extends EmbeddedTra * @param name Namespace name. */ // tslint:disable-next-line: max-line-length - public constructor(signer: KeyDto, version: number, type: EntityTypeDto, id: NamespaceIdDto, name: Uint8Array, duration?: BlockDurationDto, parentId?: NamespaceIdDto) { - super(signer, version, type); + public constructor(signerPublicKey: KeyDto, version: number, type: EntityTypeDto, id: NamespaceIdDto, name: Uint8Array, duration?: BlockDurationDto, parentId?: NamespaceIdDto) { + super(signerPublicKey, version, type); if ((duration && parentId) || (!duration && !parentId)) { throw new Error('Invalid conditional parameters'); } @@ -68,7 +68,7 @@ export class EmbeddedNamespaceRegistrationTransactionBuilder extends EmbeddedTra const namespaceRegistrationTransactionBody = NamespaceRegistrationTransactionBodyBuilder.loadFromBinary(Uint8Array.from(byteArray)); byteArray.splice(0, namespaceRegistrationTransactionBody.getSize()); // tslint:disable-next-line: max-line-length - return new EmbeddedNamespaceRegistrationTransactionBuilder(superObject.signer, superObject.version, superObject.type, namespaceRegistrationTransactionBody.id, namespaceRegistrationTransactionBody.name, namespaceRegistrationTransactionBody.duration, namespaceRegistrationTransactionBody.parentId); + return new EmbeddedNamespaceRegistrationTransactionBuilder(superObject.signerPublicKey, superObject.version, superObject.type, namespaceRegistrationTransactionBody.id, namespaceRegistrationTransactionBody.name, namespaceRegistrationTransactionBody.duration, namespaceRegistrationTransactionBody.parentId); } /** diff --git a/src/infrastructure/catbuffer/EmbeddedSecretLockTransactionBuilder.ts b/src/infrastructure/catbuffer/EmbeddedSecretLockTransactionBuilder.ts index e8f4c80213..887c3240d9 100644 --- a/src/infrastructure/catbuffer/EmbeddedSecretLockTransactionBuilder.ts +++ b/src/infrastructure/catbuffer/EmbeddedSecretLockTransactionBuilder.ts @@ -38,20 +38,20 @@ export class EmbeddedSecretLockTransactionBuilder extends EmbeddedTransactionBui /** * Constructor. * - * @param signer Entity signer's public key. + * @param signerPublicKey Entity signer's public key. * @param version Entity version. * @param type Entity type. * @param mosaic Locked mosaic. * @param duration Number of blocks for which a lock should be valid. * @param hashAlgorithm Hash algorithm. * @param secret Secret. - * @param recipient Locked mosaic recipient. + * @param recipientAddress Locked mosaic recipient address. */ // tslint:disable-next-line: max-line-length - public constructor(signer: KeyDto, version: number, type: EntityTypeDto, mosaic: UnresolvedMosaicBuilder, duration: BlockDurationDto, hashAlgorithm: LockHashAlgorithmDto, secret: Hash256Dto, recipient: UnresolvedAddressDto) { - super(signer, version, type); + public constructor(signerPublicKey: KeyDto, version: number, type: EntityTypeDto, mosaic: UnresolvedMosaicBuilder, duration: BlockDurationDto, hashAlgorithm: LockHashAlgorithmDto, secret: Hash256Dto, recipientAddress: UnresolvedAddressDto) { + super(signerPublicKey, version, type); // tslint:disable-next-line: max-line-length - this.secretLockTransactionBody = new SecretLockTransactionBodyBuilder(mosaic, duration, hashAlgorithm, secret, recipient); + this.secretLockTransactionBody = new SecretLockTransactionBodyBuilder(mosaic, duration, hashAlgorithm, secret, recipientAddress); } /** @@ -67,7 +67,7 @@ export class EmbeddedSecretLockTransactionBuilder extends EmbeddedTransactionBui const secretLockTransactionBody = SecretLockTransactionBodyBuilder.loadFromBinary(Uint8Array.from(byteArray)); byteArray.splice(0, secretLockTransactionBody.getSize()); // tslint:disable-next-line: max-line-length - return new EmbeddedSecretLockTransactionBuilder(superObject.signer, superObject.version, superObject.type, secretLockTransactionBody.mosaic, secretLockTransactionBody.duration, secretLockTransactionBody.hashAlgorithm, secretLockTransactionBody.secret, secretLockTransactionBody.recipient); + return new EmbeddedSecretLockTransactionBuilder(superObject.signerPublicKey, superObject.version, superObject.type, secretLockTransactionBody.mosaic, secretLockTransactionBody.duration, secretLockTransactionBody.hashAlgorithm, secretLockTransactionBody.secret, secretLockTransactionBody.recipientAddress); } /** @@ -107,12 +107,12 @@ export class EmbeddedSecretLockTransactionBuilder extends EmbeddedTransactionBui } /** - * Gets locked mosaic recipient. + * Gets locked mosaic recipient address. * - * @return Locked mosaic recipient. + * @return Locked mosaic recipient address. */ - public getRecipient(): UnresolvedAddressDto { - return this.secretLockTransactionBody.getRecipient(); + public getRecipientAddress(): UnresolvedAddressDto { + return this.secretLockTransactionBody.getRecipientAddress(); } /** diff --git a/src/infrastructure/catbuffer/EmbeddedSecretProofTransactionBuilder.ts b/src/infrastructure/catbuffer/EmbeddedSecretProofTransactionBuilder.ts index 58d0df9188..c2b3e66d70 100644 --- a/src/infrastructure/catbuffer/EmbeddedSecretProofTransactionBuilder.ts +++ b/src/infrastructure/catbuffer/EmbeddedSecretProofTransactionBuilder.ts @@ -36,18 +36,18 @@ export class EmbeddedSecretProofTransactionBuilder extends EmbeddedTransactionBu /** * Constructor. * - * @param signer Entity signer's public key. + * @param signerPublicKey Entity signer's public key. * @param version Entity version. * @param type Entity type. * @param hashAlgorithm Hash algorithm. * @param secret Secret. - * @param recipient Recipient. + * @param recipientAddress Locked mosaic recipient address. * @param proof Proof data. */ // tslint:disable-next-line: max-line-length - public constructor(signer: KeyDto, version: number, type: EntityTypeDto, hashAlgorithm: LockHashAlgorithmDto, secret: Hash256Dto, recipient: UnresolvedAddressDto, proof: Uint8Array) { - super(signer, version, type); - this.secretProofTransactionBody = new SecretProofTransactionBodyBuilder(hashAlgorithm, secret, recipient, proof); + public constructor(signerPublicKey: KeyDto, version: number, type: EntityTypeDto, hashAlgorithm: LockHashAlgorithmDto, secret: Hash256Dto, recipientAddress: UnresolvedAddressDto, proof: Uint8Array) { + super(signerPublicKey, version, type); + this.secretProofTransactionBody = new SecretProofTransactionBodyBuilder(hashAlgorithm, secret, recipientAddress, proof); } /** @@ -63,7 +63,7 @@ export class EmbeddedSecretProofTransactionBuilder extends EmbeddedTransactionBu const secretProofTransactionBody = SecretProofTransactionBodyBuilder.loadFromBinary(Uint8Array.from(byteArray)); byteArray.splice(0, secretProofTransactionBody.getSize()); // tslint:disable-next-line: max-line-length - return new EmbeddedSecretProofTransactionBuilder(superObject.signer, superObject.version, superObject.type, secretProofTransactionBody.hashAlgorithm, secretProofTransactionBody.secret, secretProofTransactionBody.recipient, secretProofTransactionBody.proof); + return new EmbeddedSecretProofTransactionBuilder(superObject.signerPublicKey, superObject.version, superObject.type, secretProofTransactionBody.hashAlgorithm, secretProofTransactionBody.secret, secretProofTransactionBody.recipientAddress, secretProofTransactionBody.proof); } /** @@ -85,12 +85,12 @@ export class EmbeddedSecretProofTransactionBuilder extends EmbeddedTransactionBu } /** - * Gets recipient. + * Gets locked mosaic recipient address. * - * @return Recipient. + * @return Locked mosaic recipient address. */ - public getRecipient(): UnresolvedAddressDto { - return this.secretProofTransactionBody.getRecipient(); + public getRecipientAddress(): UnresolvedAddressDto { + return this.secretProofTransactionBody.getRecipientAddress(); } /** diff --git a/src/infrastructure/catbuffer/EmbeddedTransactionBuilder.ts b/src/infrastructure/catbuffer/EmbeddedTransactionBuilder.ts index 836a8cda5d..e38985b0ed 100644 --- a/src/infrastructure/catbuffer/EmbeddedTransactionBuilder.ts +++ b/src/infrastructure/catbuffer/EmbeddedTransactionBuilder.ts @@ -28,7 +28,7 @@ export class EmbeddedTransactionBuilder { /** Entity size. */ size = 0; /** Entity signer's public key. */ - signer: KeyDto; + signerPublicKey: KeyDto; /** Entity version. */ version: number; /** Entity type. */ @@ -37,12 +37,12 @@ export class EmbeddedTransactionBuilder { /** * Constructor. * - * @param signer Entity signer's public key. + * @param signerPublicKey Entity signer's public key. * @param version Entity version. * @param type Entity type. */ - public constructor(signer: KeyDto, version: number, type: EntityTypeDto) { - this.signer = signer; + public constructor(signerPublicKey: KeyDto, version: number, type: EntityTypeDto) { + this.signerPublicKey = signerPublicKey; this.version = version; this.type = type; } @@ -57,13 +57,13 @@ export class EmbeddedTransactionBuilder { const byteArray = Array.from(payload); const size = GeneratorUtils.bufferToUint(GeneratorUtils.getBytes(Uint8Array.from(byteArray), 4)); byteArray.splice(0, 4); - const signer = KeyDto.loadFromBinary(Uint8Array.from(byteArray)); - byteArray.splice(0, signer.getSize()); + const signerPublicKey = KeyDto.loadFromBinary(Uint8Array.from(byteArray)); + byteArray.splice(0, signerPublicKey.getSize()); 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 EmbeddedTransactionBuilder(signer, version, type); + return new EmbeddedTransactionBuilder(signerPublicKey, version, type); } /** @@ -71,8 +71,8 @@ export class EmbeddedTransactionBuilder { * * @return Entity signer's public key. */ - public getSigner(): KeyDto { - return this.signer; + public getSignerPublicKey(): KeyDto { + return this.signerPublicKey; } /** @@ -101,7 +101,7 @@ export class EmbeddedTransactionBuilder { public getSize(): number { let size = 0; size += 4; // size - size += this.signer.getSize(); + size += this.signerPublicKey.getSize(); size += 2; // version size += 2; // type return size; @@ -116,8 +116,8 @@ export class EmbeddedTransactionBuilder { let newArray = Uint8Array.from([]); const sizeBytes = GeneratorUtils.uintToBuffer(this.getSize(), 4); newArray = GeneratorUtils.concatTypedArrays(newArray, sizeBytes); - const signerBytes = this.signer.serialize(); - newArray = GeneratorUtils.concatTypedArrays(newArray, signerBytes); + const signerPublicKeyBytes = this.signerPublicKey.serialize(); + newArray = GeneratorUtils.concatTypedArrays(newArray, signerPublicKeyBytes); const versionBytes = GeneratorUtils.uintToBuffer(this.getVersion(), 2); newArray = GeneratorUtils.concatTypedArrays(newArray, versionBytes); const typeBytes = GeneratorUtils.uintToBuffer(this.type, 2); diff --git a/src/infrastructure/catbuffer/EmbeddedTransferTransactionBuilder.ts b/src/infrastructure/catbuffer/EmbeddedTransferTransactionBuilder.ts index f4402345ef..9eb23931af 100644 --- a/src/infrastructure/catbuffer/EmbeddedTransferTransactionBuilder.ts +++ b/src/infrastructure/catbuffer/EmbeddedTransferTransactionBuilder.ts @@ -35,17 +35,17 @@ export class EmbeddedTransferTransactionBuilder extends EmbeddedTransactionBuild /** * Constructor. * - * @param signer Entity signer's public key. + * @param signerPublicKey Entity signer's public key. * @param version Entity version. * @param type Entity type. - * @param recipient Transaction recipient. - * @param message Transaction message. + * @param recipientAddress Recipient address. + * @param message Attached message. * @param mosaics Attached mosaics. */ // tslint:disable-next-line: max-line-length - public constructor(signer: KeyDto, version: number, type: EntityTypeDto, recipient: UnresolvedAddressDto, message: Uint8Array, mosaics: UnresolvedMosaicBuilder[]) { - super(signer, version, type); - this.transferTransactionBody = new TransferTransactionBodyBuilder(recipient, message, mosaics); + public constructor(signerPublicKey: KeyDto, version: number, type: EntityTypeDto, recipientAddress: UnresolvedAddressDto, message: Uint8Array, mosaics: UnresolvedMosaicBuilder[]) { + super(signerPublicKey, version, type); + this.transferTransactionBody = new TransferTransactionBodyBuilder(recipientAddress, message, mosaics); } /** @@ -61,22 +61,22 @@ export class EmbeddedTransferTransactionBuilder extends EmbeddedTransactionBuild const transferTransactionBody = TransferTransactionBodyBuilder.loadFromBinary(Uint8Array.from(byteArray)); byteArray.splice(0, transferTransactionBody.getSize()); // tslint:disable-next-line: max-line-length - return new EmbeddedTransferTransactionBuilder(superObject.signer, superObject.version, superObject.type, transferTransactionBody.recipient, transferTransactionBody.message, transferTransactionBody.mosaics); + return new EmbeddedTransferTransactionBuilder(superObject.signerPublicKey, superObject.version, superObject.type, transferTransactionBody.recipientAddress, transferTransactionBody.message, transferTransactionBody.mosaics); } /** - * Gets transaction recipient. + * Gets recipient address. * - * @return Transaction recipient. + * @return Recipient address. */ - public getRecipient(): UnresolvedAddressDto { - return this.transferTransactionBody.getRecipient(); + public getRecipientAddress(): UnresolvedAddressDto { + return this.transferTransactionBody.getRecipientAddress(); } /** - * Gets transaction message. + * Gets attached message. * - * @return Transaction message. + * @return Attached message. */ public getMessage(): Uint8Array { return this.transferTransactionBody.getMessage(); diff --git a/src/infrastructure/catbuffer/EntityTypeDto.ts b/src/infrastructure/catbuffer/EntityTypeDto.ts index 56350b2507..cbbf804d10 100644 --- a/src/infrastructure/catbuffer/EntityTypeDto.ts +++ b/src/infrastructure/catbuffer/EntityTypeDto.ts @@ -24,80 +24,6 @@ export enum EntityTypeDto { /** Reserved entity type. */ RESERVED = 0, - /** - * Account address restriction transaction. - */ - ACCOUNT_ADDRESS_RESTRICTION_TRANSACTION = 0x4150, - /** - * Account metadata transaction - */ - ACCOUNT_METADATA_TRANSACTION = 0x4144, - /** - * Account mosaic restriction transaction. - */ - ACCOUNT_MOSAIC_RESTRICTION_TRANSACTION = 0x4250, - /** - * Account operation restriction transaction. - */ - ACCOUNT_OPERATION_RESTRICTION_TRANSACTION = 0x4350, - /** - * Account link transaction. - */ - ACCOUNT_LINK_TRANSACTION = 0x414C, - /** - * Address alias transaction. - */ - ADDRESS_ALIAS_TRANSACTION = 0x424E, - /** - * Aggregate bonded transaction. - */ - AGGREGATE_BONDED_TRANSACTION = 0x4241, - /** - * Aggregate complete transaction. - */ - AGGREGATE_COMPLETE_TRANSACTION = 0x4141, - /** - * Hash lock transaction. - */ - HASH_LOCK_TRANSACTION = 0x4148, - /** - * Modify multisig account transaction. - */ - MODIFY_MULTISIG_ACCOUNT_TRANSACTION = 0x4155, - /** - * Mosaic definition transaction. - */ - MOSAIC_DEFINITION_TRANSACTION = 0x414D, - /** - * Mosaic metadata transaction. - */ - MOSAIC_METADATA_TRANSACTION = 0x4244, - /** - * Mosaic supply change transaction. - */ - MOSAIC_SUPPLY_CHANGE_TRANSACTION = 0x424D, - /** - * Mosaic alias transaction. - */ - MOSAIC_ALIAS_TRANSACTION = 0x434E, - /** - * Namespace metadata transaction. - */ - NAMESPACE_METADATA_TRANSACTION = 0x4344, - /** - * Register namespace transaction. - */ - REGISTER_NAMESPACE_TRANSACTION = 0x414E, - /** - * Secret lock transaction. - */ - SECRET_LOCK_TRANSACTION = 0x4152, - /** - * Secret Proof transaction. - */ - SECRET_PROOF_TRANSACTION = 0x4252, - /** - * Transfer transaction. - */ - TRANSFER_TRANSACTION = 0x4154, + /** Transfer transaction builder. */ + TRANSFER_TRANSACTION_BUILDER = 16724, } diff --git a/src/infrastructure/catbuffer/HashLockTransactionBuilder.ts b/src/infrastructure/catbuffer/HashLockTransactionBuilder.ts index b6c5b9643f..1f7f2e8480 100644 --- a/src/infrastructure/catbuffer/HashLockTransactionBuilder.ts +++ b/src/infrastructure/catbuffer/HashLockTransactionBuilder.ts @@ -40,7 +40,7 @@ export class HashLockTransactionBuilder extends TransactionBuilder { * Constructor. * * @param signature Entity signature. - * @param signer Entity signer's public key. + * @param signerPublicKey Entity signer's public key. * @param version Entity version. * @param type Entity type. * @param fee Transaction fee. @@ -50,8 +50,8 @@ export class HashLockTransactionBuilder extends TransactionBuilder { * @param hash Lock hash. */ // tslint:disable-next-line: max-line-length - public constructor(signature: SignatureDto, signer: KeyDto, version: number, type: EntityTypeDto, fee: AmountDto, deadline: TimestampDto, mosaic: UnresolvedMosaicBuilder, duration: BlockDurationDto, hash: Hash256Dto) { - super(signature, signer, version, type, fee, deadline); + public constructor(signature: SignatureDto, signerPublicKey: KeyDto, version: number, type: EntityTypeDto, fee: AmountDto, deadline: TimestampDto, mosaic: UnresolvedMosaicBuilder, duration: BlockDurationDto, hash: Hash256Dto) { + super(signature, signerPublicKey, version, type, fee, deadline); this.hashLockTransactionBody = new HashLockTransactionBodyBuilder(mosaic, duration, hash); } @@ -68,7 +68,7 @@ export class HashLockTransactionBuilder extends TransactionBuilder { 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.signer, superObject.version, superObject.type, superObject.fee, superObject.deadline, hashLockTransactionBody.mosaic, hashLockTransactionBody.duration, hashLockTransactionBody.hash); + return new HashLockTransactionBuilder(superObject.signature, superObject.signerPublicKey, superObject.version, superObject.type, superObject.fee, superObject.deadline, hashLockTransactionBody.mosaic, hashLockTransactionBody.duration, hashLockTransactionBody.hash); } /** diff --git a/src/infrastructure/catbuffer/MosaicAddressRestrictionTransactionBuilder.ts b/src/infrastructure/catbuffer/MosaicAddressRestrictionTransactionBuilder.ts index ba0d6b5d7e..4eb5fda989 100644 --- a/src/infrastructure/catbuffer/MosaicAddressRestrictionTransactionBuilder.ts +++ b/src/infrastructure/catbuffer/MosaicAddressRestrictionTransactionBuilder.ts @@ -39,7 +39,7 @@ export class MosaicAddressRestrictionTransactionBuilder extends TransactionBuild * Constructor. * * @param signature Entity signature. - * @param signer Entity signer's public key. + * @param signerPublicKey Entity signer's public key. * @param version Entity version. * @param type Entity type. * @param fee Transaction fee. @@ -51,8 +51,8 @@ export class MosaicAddressRestrictionTransactionBuilder extends TransactionBuild * @param newRestrictionValue New restriction value. */ // tslint:disable-next-line: max-line-length - public constructor(signature: SignatureDto, signer: KeyDto, version: number, type: EntityTypeDto, fee: AmountDto, deadline: TimestampDto, mosaicId: UnresolvedMosaicIdDto, restrictionKey: number[], targetAddress: UnresolvedAddressDto, previousRestrictionValue: number[], newRestrictionValue: number[]) { - super(signature, signer, version, type, fee, deadline); + public constructor(signature: SignatureDto, signerPublicKey: KeyDto, version: number, type: EntityTypeDto, fee: AmountDto, deadline: TimestampDto, mosaicId: UnresolvedMosaicIdDto, restrictionKey: number[], targetAddress: UnresolvedAddressDto, previousRestrictionValue: number[], newRestrictionValue: number[]) { + super(signature, signerPublicKey, version, type, fee, deadline); // tslint:disable-next-line: max-line-length this.mosaicAddressRestrictionTransactionBody = new MosaicAddressRestrictionTransactionBodyBuilder(mosaicId, restrictionKey, targetAddress, previousRestrictionValue, newRestrictionValue); } @@ -71,7 +71,7 @@ export class MosaicAddressRestrictionTransactionBuilder extends TransactionBuild 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.signer, superObject.version, superObject.type, superObject.fee, superObject.deadline, mosaicAddressRestrictionTransactionBody.mosaicId, mosaicAddressRestrictionTransactionBody.restrictionKey, mosaicAddressRestrictionTransactionBody.targetAddress, mosaicAddressRestrictionTransactionBody.previousRestrictionValue, mosaicAddressRestrictionTransactionBody.newRestrictionValue); + return new MosaicAddressRestrictionTransactionBuilder(superObject.signature, superObject.signerPublicKey, superObject.version, superObject.type, superObject.fee, superObject.deadline, mosaicAddressRestrictionTransactionBody.mosaicId, mosaicAddressRestrictionTransactionBody.restrictionKey, mosaicAddressRestrictionTransactionBody.targetAddress, mosaicAddressRestrictionTransactionBody.previousRestrictionValue, mosaicAddressRestrictionTransactionBody.newRestrictionValue); } /** diff --git a/src/infrastructure/catbuffer/MosaicAliasTransactionBuilder.ts b/src/infrastructure/catbuffer/MosaicAliasTransactionBuilder.ts index d126fef24c..6de22d7696 100644 --- a/src/infrastructure/catbuffer/MosaicAliasTransactionBuilder.ts +++ b/src/infrastructure/catbuffer/MosaicAliasTransactionBuilder.ts @@ -40,7 +40,7 @@ export class MosaicAliasTransactionBuilder extends TransactionBuilder { * Constructor. * * @param signature Entity signature. - * @param signer Entity signer's public key. + * @param signerPublicKey Entity signer's public key. * @param version Entity version. * @param type Entity type. * @param fee Transaction fee. @@ -50,8 +50,8 @@ export class MosaicAliasTransactionBuilder extends TransactionBuilder { * @param mosaicId Aliased mosaic identifier. */ // tslint:disable-next-line: max-line-length - public constructor(signature: SignatureDto, signer: KeyDto, version: number, type: EntityTypeDto, fee: AmountDto, deadline: TimestampDto, aliasAction: AliasActionDto, namespaceId: NamespaceIdDto, mosaicId: MosaicIdDto) { - super(signature, signer, version, type, fee, deadline); + public constructor(signature: SignatureDto, signerPublicKey: KeyDto, version: number, type: EntityTypeDto, fee: AmountDto, deadline: TimestampDto, aliasAction: AliasActionDto, namespaceId: NamespaceIdDto, mosaicId: MosaicIdDto) { + super(signature, signerPublicKey, version, type, fee, deadline); this.mosaicAliasTransactionBody = new MosaicAliasTransactionBodyBuilder(aliasAction, namespaceId, mosaicId); } @@ -68,7 +68,7 @@ export class MosaicAliasTransactionBuilder extends TransactionBuilder { 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.signer, superObject.version, superObject.type, superObject.fee, superObject.deadline, mosaicAliasTransactionBody.aliasAction, mosaicAliasTransactionBody.namespaceId, mosaicAliasTransactionBody.mosaicId); + return new MosaicAliasTransactionBuilder(superObject.signature, superObject.signerPublicKey, superObject.version, superObject.type, superObject.fee, superObject.deadline, mosaicAliasTransactionBody.aliasAction, mosaicAliasTransactionBody.namespaceId, mosaicAliasTransactionBody.mosaicId); } /** diff --git a/src/infrastructure/catbuffer/MosaicDefinitionTransactionBuilder.ts b/src/infrastructure/catbuffer/MosaicDefinitionTransactionBuilder.ts index a32b33b5d9..4cd0b309ee 100644 --- a/src/infrastructure/catbuffer/MosaicDefinitionTransactionBuilder.ts +++ b/src/infrastructure/catbuffer/MosaicDefinitionTransactionBuilder.ts @@ -40,7 +40,7 @@ export class MosaicDefinitionTransactionBuilder extends TransactionBuilder { * Constructor. * * @param signature Entity signature. - * @param signer Entity signer's public key. + * @param signerPublicKey Entity signer's public key. * @param version Entity version. * @param type Entity type. * @param fee Transaction fee. @@ -52,8 +52,8 @@ export class MosaicDefinitionTransactionBuilder extends TransactionBuilder { * @param duration Mosaic duration. */ // tslint:disable-next-line: max-line-length - public constructor(signature: SignatureDto, signer: KeyDto, version: number, type: EntityTypeDto, fee: AmountDto, deadline: TimestampDto, nonce: MosaicNonceDto, id: MosaicIdDto, flags: number, divisibility: number, duration: BlockDurationDto) { - super(signature, signer, version, type, fee, deadline); + public constructor(signature: SignatureDto, signerPublicKey: KeyDto, version: number, type: EntityTypeDto, fee: AmountDto, deadline: TimestampDto, nonce: MosaicNonceDto, id: MosaicIdDto, flags: number, divisibility: number, duration: BlockDurationDto) { + super(signature, signerPublicKey, version, type, fee, deadline); // tslint:disable-next-line: max-line-length this.mosaicDefinitionTransactionBody = new MosaicDefinitionTransactionBodyBuilder(nonce, id, flags, divisibility, duration); } @@ -72,7 +72,7 @@ export class MosaicDefinitionTransactionBuilder extends TransactionBuilder { 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.signer, superObject.version, superObject.type, superObject.fee, superObject.deadline, mosaicDefinitionTransactionBody.nonce, mosaicDefinitionTransactionBody.id, mosaicDefinitionTransactionBody.flags, mosaicDefinitionTransactionBody.divisibility, mosaicDefinitionTransactionBody.duration); + return new MosaicDefinitionTransactionBuilder(superObject.signature, superObject.signerPublicKey, superObject.version, superObject.type, superObject.fee, superObject.deadline, mosaicDefinitionTransactionBody.nonce, mosaicDefinitionTransactionBody.id, mosaicDefinitionTransactionBody.flags, mosaicDefinitionTransactionBody.divisibility, mosaicDefinitionTransactionBody.duration); } /** diff --git a/src/infrastructure/catbuffer/MosaicGlobalRestrictionTransactionBuilder.ts b/src/infrastructure/catbuffer/MosaicGlobalRestrictionTransactionBuilder.ts index e84414e6e2..4b51c494d5 100644 --- a/src/infrastructure/catbuffer/MosaicGlobalRestrictionTransactionBuilder.ts +++ b/src/infrastructure/catbuffer/MosaicGlobalRestrictionTransactionBuilder.ts @@ -39,7 +39,7 @@ export class MosaicGlobalRestrictionTransactionBuilder extends TransactionBuilde * Constructor. * * @param signature Entity signature. - * @param signer Entity signer's public key. + * @param signerPublicKey Entity signer's public key. * @param version Entity version. * @param type Entity type. * @param fee Transaction fee. @@ -53,8 +53,8 @@ export class MosaicGlobalRestrictionTransactionBuilder extends TransactionBuilde * @param newRestrictionType New restriction type. */ // tslint:disable-next-line: max-line-length - public constructor(signature: SignatureDto, signer: KeyDto, version: number, type: EntityTypeDto, fee: AmountDto, deadline: TimestampDto, mosaicId: UnresolvedMosaicIdDto, referenceMosaicId: UnresolvedMosaicIdDto, restrictionKey: number[], previousRestrictionValue: number[], previousRestrictionType: MosaicRestrictionTypeDto, newRestrictionValue: number[], newRestrictionType: MosaicRestrictionTypeDto) { - super(signature, signer, version, type, fee, deadline); + public constructor(signature: SignatureDto, signerPublicKey: KeyDto, version: number, type: EntityTypeDto, fee: AmountDto, deadline: TimestampDto, mosaicId: UnresolvedMosaicIdDto, referenceMosaicId: UnresolvedMosaicIdDto, restrictionKey: number[], previousRestrictionValue: number[], previousRestrictionType: MosaicRestrictionTypeDto, newRestrictionValue: number[], newRestrictionType: MosaicRestrictionTypeDto) { + super(signature, signerPublicKey, version, type, fee, deadline); // tslint:disable-next-line: max-line-length this.mosaicGlobalRestrictionTransactionBody = new MosaicGlobalRestrictionTransactionBodyBuilder(mosaicId, referenceMosaicId, restrictionKey, previousRestrictionValue, previousRestrictionType, newRestrictionValue, newRestrictionType); } @@ -73,7 +73,7 @@ export class MosaicGlobalRestrictionTransactionBuilder extends TransactionBuilde 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.signer, superObject.version, superObject.type, superObject.fee, superObject.deadline, mosaicGlobalRestrictionTransactionBody.mosaicId, mosaicGlobalRestrictionTransactionBody.referenceMosaicId, mosaicGlobalRestrictionTransactionBody.restrictionKey, mosaicGlobalRestrictionTransactionBody.previousRestrictionValue, mosaicGlobalRestrictionTransactionBody.previousRestrictionType, mosaicGlobalRestrictionTransactionBody.newRestrictionValue, mosaicGlobalRestrictionTransactionBody.newRestrictionType); + return new MosaicGlobalRestrictionTransactionBuilder(superObject.signature, superObject.signerPublicKey, superObject.version, superObject.type, superObject.fee, superObject.deadline, mosaicGlobalRestrictionTransactionBody.mosaicId, mosaicGlobalRestrictionTransactionBody.referenceMosaicId, mosaicGlobalRestrictionTransactionBody.restrictionKey, mosaicGlobalRestrictionTransactionBody.previousRestrictionValue, mosaicGlobalRestrictionTransactionBody.previousRestrictionType, mosaicGlobalRestrictionTransactionBody.newRestrictionValue, mosaicGlobalRestrictionTransactionBody.newRestrictionType); } /** diff --git a/src/infrastructure/catbuffer/MosaicMetadataTransactionBuilder.ts b/src/infrastructure/catbuffer/MosaicMetadataTransactionBuilder.ts index 1a5866a030..cccf50dcd5 100644 --- a/src/infrastructure/catbuffer/MosaicMetadataTransactionBuilder.ts +++ b/src/infrastructure/catbuffer/MosaicMetadataTransactionBuilder.ts @@ -38,7 +38,7 @@ export class MosaicMetadataTransactionBuilder extends TransactionBuilder { * Constructor. * * @param signature Entity signature. - * @param signer Entity signer's public key. + * @param signerPublicKey Entity signer's public key. * @param version Entity version. * @param type Entity type. * @param fee Transaction fee. @@ -52,8 +52,8 @@ export class MosaicMetadataTransactionBuilder extends TransactionBuilder { * @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, signer: KeyDto, version: number, type: EntityTypeDto, fee: AmountDto, deadline: TimestampDto, targetPublicKey: KeyDto, scopedMetadataKey: number[], targetMosaicId: UnresolvedMosaicIdDto, valueSizeDelta: number, value: Uint8Array) { - super(signature, signer, version, type, fee, deadline); + public constructor(signature: SignatureDto, signerPublicKey: KeyDto, version: number, type: EntityTypeDto, fee: AmountDto, deadline: TimestampDto, targetPublicKey: KeyDto, scopedMetadataKey: number[], targetMosaicId: UnresolvedMosaicIdDto, valueSizeDelta: number, value: Uint8Array) { + super(signature, signerPublicKey, version, type, fee, deadline); // tslint:disable-next-line: max-line-length this.mosaicMetadataTransactionBody = new MosaicMetadataTransactionBodyBuilder(targetPublicKey, scopedMetadataKey, targetMosaicId, valueSizeDelta, value); } @@ -71,7 +71,7 @@ export class MosaicMetadataTransactionBuilder extends TransactionBuilder { 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.signer, superObject.version, superObject.type, superObject.fee, superObject.deadline, mosaicMetadataTransactionBody.targetPublicKey, mosaicMetadataTransactionBody.scopedMetadataKey, mosaicMetadataTransactionBody.targetMosaicId, mosaicMetadataTransactionBody.valueSizeDelta, mosaicMetadataTransactionBody.value); + return new MosaicMetadataTransactionBuilder(superObject.signature, superObject.signerPublicKey, superObject.version, superObject.type, superObject.fee, superObject.deadline, mosaicMetadataTransactionBody.targetPublicKey, mosaicMetadataTransactionBody.scopedMetadataKey, mosaicMetadataTransactionBody.targetMosaicId, mosaicMetadataTransactionBody.valueSizeDelta, mosaicMetadataTransactionBody.value); } /** diff --git a/src/infrastructure/catbuffer/MosaicSupplyChangeTransactionBuilder.ts b/src/infrastructure/catbuffer/MosaicSupplyChangeTransactionBuilder.ts index ae1c675729..f5b43dbb3c 100644 --- a/src/infrastructure/catbuffer/MosaicSupplyChangeTransactionBuilder.ts +++ b/src/infrastructure/catbuffer/MosaicSupplyChangeTransactionBuilder.ts @@ -39,7 +39,7 @@ export class MosaicSupplyChangeTransactionBuilder extends TransactionBuilder { * Constructor. * * @param signature Entity signature. - * @param signer Entity signer's public key. + * @param signerPublicKey Entity signer's public key. * @param version Entity version. * @param type Entity type. * @param fee Transaction fee. @@ -49,8 +49,8 @@ export class MosaicSupplyChangeTransactionBuilder extends TransactionBuilder { * @param delta Change amount. */ // tslint:disable-next-line: max-line-length - public constructor(signature: SignatureDto, signer: KeyDto, version: number, type: EntityTypeDto, fee: AmountDto, deadline: TimestampDto, mosaicId: UnresolvedMosaicIdDto, action: MosaicSupplyChangeActionDto, delta: AmountDto) { - super(signature, signer, version, type, fee, deadline); + public constructor(signature: SignatureDto, signerPublicKey: KeyDto, version: number, type: EntityTypeDto, fee: AmountDto, deadline: TimestampDto, mosaicId: UnresolvedMosaicIdDto, action: MosaicSupplyChangeActionDto, delta: AmountDto) { + super(signature, signerPublicKey, version, type, fee, deadline); this.mosaicSupplyChangeTransactionBody = new MosaicSupplyChangeTransactionBodyBuilder(mosaicId, action, delta); } @@ -68,7 +68,7 @@ export class MosaicSupplyChangeTransactionBuilder extends TransactionBuilder { 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.signer, superObject.version, superObject.type, superObject.fee, superObject.deadline, mosaicSupplyChangeTransactionBody.mosaicId, mosaicSupplyChangeTransactionBody.action, mosaicSupplyChangeTransactionBody.delta); + return new MosaicSupplyChangeTransactionBuilder(superObject.signature, superObject.signerPublicKey, superObject.version, superObject.type, superObject.fee, superObject.deadline, mosaicSupplyChangeTransactionBody.mosaicId, mosaicSupplyChangeTransactionBody.action, mosaicSupplyChangeTransactionBody.delta); } /** diff --git a/src/infrastructure/catbuffer/MultisigAccountModificationTransactionBuilder.ts b/src/infrastructure/catbuffer/MultisigAccountModificationTransactionBuilder.ts index 4405bdc6ca..84ba905207 100644 --- a/src/infrastructure/catbuffer/MultisigAccountModificationTransactionBuilder.ts +++ b/src/infrastructure/catbuffer/MultisigAccountModificationTransactionBuilder.ts @@ -38,7 +38,7 @@ export class MultisigAccountModificationTransactionBuilder extends TransactionBu * Constructor. * * @param signature Entity signature. - * @param signer Entity signer's public key. + * @param signerPublicKey Entity signer's public key. * @param version Entity version. * @param type Entity type. * @param fee Transaction fee. @@ -48,8 +48,8 @@ export class MultisigAccountModificationTransactionBuilder extends TransactionBu * @param modifications Attached cosignatory modifications. */ // tslint:disable-next-line: max-line-length - public constructor(signature: SignatureDto, signer: KeyDto, version: number, type: EntityTypeDto, fee: AmountDto, deadline: TimestampDto, minRemovalDelta: number, minApprovalDelta: number, modifications: CosignatoryModificationBuilder[]) { - super(signature, signer, version, type, fee, deadline); + public constructor(signature: SignatureDto, signerPublicKey: KeyDto, version: number, type: EntityTypeDto, fee: AmountDto, deadline: TimestampDto, minRemovalDelta: number, minApprovalDelta: number, modifications: CosignatoryModificationBuilder[]) { + super(signature, signerPublicKey, version, type, fee, deadline); // tslint:disable-next-line: max-line-length this.multisigAccountModificationTransactionBody = new MultisigAccountModificationTransactionBodyBuilder(minRemovalDelta, minApprovalDelta, modifications); } @@ -68,7 +68,7 @@ export class MultisigAccountModificationTransactionBuilder extends TransactionBu 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.signer, superObject.version, superObject.type, superObject.fee, superObject.deadline, multisigAccountModificationTransactionBody.minRemovalDelta, multisigAccountModificationTransactionBody.minApprovalDelta, multisigAccountModificationTransactionBody.modifications); + return new MultisigAccountModificationTransactionBuilder(superObject.signature, superObject.signerPublicKey, superObject.version, superObject.type, superObject.fee, superObject.deadline, multisigAccountModificationTransactionBody.minRemovalDelta, multisigAccountModificationTransactionBody.minApprovalDelta, multisigAccountModificationTransactionBody.modifications); } /** diff --git a/src/infrastructure/catbuffer/NamespaceMetadataTransactionBuilder.ts b/src/infrastructure/catbuffer/NamespaceMetadataTransactionBuilder.ts index 6b4b2e4885..f3b2671774 100644 --- a/src/infrastructure/catbuffer/NamespaceMetadataTransactionBuilder.ts +++ b/src/infrastructure/catbuffer/NamespaceMetadataTransactionBuilder.ts @@ -38,7 +38,7 @@ export class NamespaceMetadataTransactionBuilder extends TransactionBuilder { * Constructor. * * @param signature Entity signature. - * @param signer Entity signer's public key. + * @param signerPublicKey Entity signer's public key. * @param version Entity version. * @param type Entity type. * @param fee Transaction fee. @@ -52,8 +52,8 @@ export class NamespaceMetadataTransactionBuilder extends TransactionBuilder { * @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, signer: KeyDto, version: number, type: EntityTypeDto, fee: AmountDto, deadline: TimestampDto, targetPublicKey: KeyDto, scopedMetadataKey: number[], targetNamespaceId: NamespaceIdDto, valueSizeDelta: number, value: Uint8Array) { - super(signature, signer, version, type, fee, deadline); + public constructor(signature: SignatureDto, signerPublicKey: KeyDto, version: number, type: EntityTypeDto, fee: AmountDto, deadline: TimestampDto, targetPublicKey: KeyDto, scopedMetadataKey: number[], targetNamespaceId: NamespaceIdDto, valueSizeDelta: number, value: Uint8Array) { + super(signature, signerPublicKey, version, type, fee, deadline); // tslint:disable-next-line: max-line-length this.namespaceMetadataTransactionBody = new NamespaceMetadataTransactionBodyBuilder(targetPublicKey, scopedMetadataKey, targetNamespaceId, valueSizeDelta, value); } @@ -72,7 +72,7 @@ export class NamespaceMetadataTransactionBuilder extends TransactionBuilder { 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.signer, superObject.version, superObject.type, superObject.fee, superObject.deadline, namespaceMetadataTransactionBody.targetPublicKey, namespaceMetadataTransactionBody.scopedMetadataKey, namespaceMetadataTransactionBody.targetNamespaceId, namespaceMetadataTransactionBody.valueSizeDelta, namespaceMetadataTransactionBody.value); + return new NamespaceMetadataTransactionBuilder(superObject.signature, superObject.signerPublicKey, superObject.version, superObject.type, superObject.fee, superObject.deadline, namespaceMetadataTransactionBody.targetPublicKey, namespaceMetadataTransactionBody.scopedMetadataKey, namespaceMetadataTransactionBody.targetNamespaceId, namespaceMetadataTransactionBody.valueSizeDelta, namespaceMetadataTransactionBody.value); } /** diff --git a/src/infrastructure/catbuffer/NamespaceRegistrationTransactionBuilder.ts b/src/infrastructure/catbuffer/NamespaceRegistrationTransactionBuilder.ts index a9e96db248..a385636df8 100644 --- a/src/infrastructure/catbuffer/NamespaceRegistrationTransactionBuilder.ts +++ b/src/infrastructure/catbuffer/NamespaceRegistrationTransactionBuilder.ts @@ -40,7 +40,7 @@ export class NamespaceRegistrationTransactionBuilder extends TransactionBuilder * Constructor. * * @param signature Entity signature. - * @param signer Entity signer's public key. + * @param signerPublicKey Entity signer's public key. * @param version Entity version. * @param type Entity type. * @param fee Transaction fee. @@ -51,8 +51,8 @@ export class NamespaceRegistrationTransactionBuilder extends TransactionBuilder * @param name Namespace name. */ // tslint:disable-next-line: max-line-length - public constructor(signature: SignatureDto, signer: KeyDto, version: number, type: EntityTypeDto, fee: AmountDto, deadline: TimestampDto, id: NamespaceIdDto, name: Uint8Array, duration?: BlockDurationDto, parentId?: NamespaceIdDto) { - super(signature, signer, version, type, fee, deadline); + public constructor(signature: SignatureDto, signerPublicKey: KeyDto, version: number, type: EntityTypeDto, fee: AmountDto, deadline: TimestampDto, id: NamespaceIdDto, name: Uint8Array, duration?: BlockDurationDto, parentId?: NamespaceIdDto) { + super(signature, signerPublicKey, version, type, fee, deadline); if ((duration && parentId) || (!duration && !parentId)) { throw new Error('Invalid conditional parameters'); } @@ -74,7 +74,7 @@ export class NamespaceRegistrationTransactionBuilder extends TransactionBuilder 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.signer, superObject.version, superObject.type, superObject.fee, superObject.deadline, namespaceRegistrationTransactionBody.id, namespaceRegistrationTransactionBody.name, namespaceRegistrationTransactionBody.duration, namespaceRegistrationTransactionBody.parentId); + return new NamespaceRegistrationTransactionBuilder(superObject.signature, superObject.signerPublicKey, superObject.version, superObject.type, superObject.fee, superObject.deadline, namespaceRegistrationTransactionBody.id, namespaceRegistrationTransactionBody.name, namespaceRegistrationTransactionBody.duration, namespaceRegistrationTransactionBody.parentId); } /** diff --git a/src/infrastructure/catbuffer/SecretLockTransactionBodyBuilder.ts b/src/infrastructure/catbuffer/SecretLockTransactionBodyBuilder.ts index a38da76d77..5fe75cce36 100644 --- a/src/infrastructure/catbuffer/SecretLockTransactionBodyBuilder.ts +++ b/src/infrastructure/catbuffer/SecretLockTransactionBodyBuilder.ts @@ -36,8 +36,8 @@ export class SecretLockTransactionBodyBuilder { hashAlgorithm: LockHashAlgorithmDto; /** Secret. */ secret: Hash256Dto; - /** Locked mosaic recipient. */ - recipient: UnresolvedAddressDto; + /** Locked mosaic recipient address. */ + recipientAddress: UnresolvedAddressDto; /** * Constructor. @@ -46,15 +46,15 @@ export class SecretLockTransactionBodyBuilder { * @param duration Number of blocks for which a lock should be valid. * @param hashAlgorithm Hash algorithm. * @param secret Secret. - * @param recipient Locked mosaic recipient. + * @param recipientAddress Locked mosaic recipient address. */ // tslint:disable-next-line: max-line-length - public constructor(mosaic: UnresolvedMosaicBuilder, duration: BlockDurationDto, hashAlgorithm: LockHashAlgorithmDto, secret: Hash256Dto, recipient: UnresolvedAddressDto) { + public constructor(mosaic: UnresolvedMosaicBuilder, duration: BlockDurationDto, hashAlgorithm: LockHashAlgorithmDto, secret: Hash256Dto, recipientAddress: UnresolvedAddressDto) { this.mosaic = mosaic; this.duration = duration; this.hashAlgorithm = hashAlgorithm; this.secret = secret; - this.recipient = recipient; + this.recipientAddress = recipientAddress; } /** @@ -73,9 +73,9 @@ export class SecretLockTransactionBodyBuilder { byteArray.splice(0, 1); const secret = Hash256Dto.loadFromBinary(Uint8Array.from(byteArray)); byteArray.splice(0, secret.getSize()); - const recipient = UnresolvedAddressDto.loadFromBinary(Uint8Array.from(byteArray)); - byteArray.splice(0, recipient.getSize()); - return new SecretLockTransactionBodyBuilder(mosaic, duration, hashAlgorithm, secret, recipient); + const recipientAddress = UnresolvedAddressDto.loadFromBinary(Uint8Array.from(byteArray)); + byteArray.splice(0, recipientAddress.getSize()); + return new SecretLockTransactionBodyBuilder(mosaic, duration, hashAlgorithm, secret, recipientAddress); } /** @@ -115,12 +115,12 @@ export class SecretLockTransactionBodyBuilder { } /** - * Gets locked mosaic recipient. + * Gets locked mosaic recipient address. * - * @return Locked mosaic recipient. + * @return Locked mosaic recipient address. */ - public getRecipient(): UnresolvedAddressDto { - return this.recipient; + public getRecipientAddress(): UnresolvedAddressDto { + return this.recipientAddress; } /** @@ -134,7 +134,7 @@ export class SecretLockTransactionBodyBuilder { size += this.duration.getSize(); size += 1; // hashAlgorithm size += this.secret.getSize(); - size += this.recipient.getSize(); + size += this.recipientAddress.getSize(); return size; } @@ -153,8 +153,8 @@ export class SecretLockTransactionBodyBuilder { newArray = GeneratorUtils.concatTypedArrays(newArray, hashAlgorithmBytes); const secretBytes = this.secret.serialize(); newArray = GeneratorUtils.concatTypedArrays(newArray, secretBytes); - const recipientBytes = this.recipient.serialize(); - newArray = GeneratorUtils.concatTypedArrays(newArray, recipientBytes); + 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 index 3f99ae1dd0..d7be7aa2c9 100644 --- a/src/infrastructure/catbuffer/SecretLockTransactionBuilder.ts +++ b/src/infrastructure/catbuffer/SecretLockTransactionBuilder.ts @@ -42,7 +42,7 @@ export class SecretLockTransactionBuilder extends TransactionBuilder { * Constructor. * * @param signature Entity signature. - * @param signer Entity signer's public key. + * @param signerPublicKey Entity signer's public key. * @param version Entity version. * @param type Entity type. * @param fee Transaction fee. @@ -51,13 +51,13 @@ export class SecretLockTransactionBuilder extends TransactionBuilder { * @param duration Number of blocks for which a lock should be valid. * @param hashAlgorithm Hash algorithm. * @param secret Secret. - * @param recipient Locked mosaic recipient. + * @param recipientAddress Locked mosaic recipient address. */ // tslint:disable-next-line: max-line-length - public constructor(signature: SignatureDto, signer: KeyDto, version: number, type: EntityTypeDto, fee: AmountDto, deadline: TimestampDto, mosaic: UnresolvedMosaicBuilder, duration: BlockDurationDto, hashAlgorithm: LockHashAlgorithmDto, secret: Hash256Dto, recipient: UnresolvedAddressDto) { - super(signature, signer, version, type, fee, deadline); + public constructor(signature: SignatureDto, signerPublicKey: KeyDto, version: number, type: EntityTypeDto, fee: AmountDto, deadline: TimestampDto, mosaic: UnresolvedMosaicBuilder, duration: BlockDurationDto, hashAlgorithm: LockHashAlgorithmDto, secret: Hash256Dto, recipientAddress: UnresolvedAddressDto) { + super(signature, signerPublicKey, version, type, fee, deadline); // tslint:disable-next-line: max-line-length - this.secretLockTransactionBody = new SecretLockTransactionBodyBuilder(mosaic, duration, hashAlgorithm, secret, recipient); + this.secretLockTransactionBody = new SecretLockTransactionBodyBuilder(mosaic, duration, hashAlgorithm, secret, recipientAddress); } /** @@ -73,7 +73,7 @@ export class SecretLockTransactionBuilder extends TransactionBuilder { 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.signer, superObject.version, superObject.type, superObject.fee, superObject.deadline, secretLockTransactionBody.mosaic, secretLockTransactionBody.duration, secretLockTransactionBody.hashAlgorithm, secretLockTransactionBody.secret, secretLockTransactionBody.recipient); + return new SecretLockTransactionBuilder(superObject.signature, superObject.signerPublicKey, superObject.version, superObject.type, superObject.fee, superObject.deadline, secretLockTransactionBody.mosaic, secretLockTransactionBody.duration, secretLockTransactionBody.hashAlgorithm, secretLockTransactionBody.secret, secretLockTransactionBody.recipientAddress); } /** @@ -113,12 +113,12 @@ export class SecretLockTransactionBuilder extends TransactionBuilder { } /** - * Gets locked mosaic recipient. + * Gets locked mosaic recipient address. * - * @return Locked mosaic recipient. + * @return Locked mosaic recipient address. */ - public getRecipient(): UnresolvedAddressDto { - return this.secretLockTransactionBody.getRecipient(); + public getRecipientAddress(): UnresolvedAddressDto { + return this.secretLockTransactionBody.getRecipientAddress(); } /** diff --git a/src/infrastructure/catbuffer/SecretProofTransactionBodyBuilder.ts b/src/infrastructure/catbuffer/SecretProofTransactionBodyBuilder.ts index ba7a2a1fa2..ab9516cd7c 100644 --- a/src/infrastructure/catbuffer/SecretProofTransactionBodyBuilder.ts +++ b/src/infrastructure/catbuffer/SecretProofTransactionBodyBuilder.ts @@ -30,8 +30,8 @@ export class SecretProofTransactionBodyBuilder { hashAlgorithm: LockHashAlgorithmDto; /** Secret. */ secret: Hash256Dto; - /** Recipient. */ - recipient: UnresolvedAddressDto; + /** Locked mosaic recipient address. */ + recipientAddress: UnresolvedAddressDto; /** Proof data. */ proof: Uint8Array; @@ -40,14 +40,14 @@ export class SecretProofTransactionBodyBuilder { * * @param hashAlgorithm Hash algorithm. * @param secret Secret. - * @param recipient Recipient. + * @param recipientAddress Locked mosaic recipient address. * @param proof Proof data. */ // tslint:disable-next-line: max-line-length - public constructor(hashAlgorithm: LockHashAlgorithmDto, secret: Hash256Dto, recipient: UnresolvedAddressDto, proof: Uint8Array) { + public constructor(hashAlgorithm: LockHashAlgorithmDto, secret: Hash256Dto, recipientAddress: UnresolvedAddressDto, proof: Uint8Array) { this.hashAlgorithm = hashAlgorithm; this.secret = secret; - this.recipient = recipient; + this.recipientAddress = recipientAddress; this.proof = proof; } @@ -63,13 +63,13 @@ export class SecretProofTransactionBodyBuilder { byteArray.splice(0, 1); const secret = Hash256Dto.loadFromBinary(Uint8Array.from(byteArray)); byteArray.splice(0, secret.getSize()); - const recipient = UnresolvedAddressDto.loadFromBinary(Uint8Array.from(byteArray)); - byteArray.splice(0, recipient.getSize()); + const recipientAddress = UnresolvedAddressDto.loadFromBinary(Uint8Array.from(byteArray)); + byteArray.splice(0, recipientAddress.getSize()); const proofSize = GeneratorUtils.bufferToUint(GeneratorUtils.getBytes(Uint8Array.from(byteArray), 2)); byteArray.splice(0, 2); const proof = GeneratorUtils.getBytes(Uint8Array.from(byteArray), proofSize); byteArray.splice(0, proofSize); - return new SecretProofTransactionBodyBuilder(hashAlgorithm, secret, recipient, proof); + return new SecretProofTransactionBodyBuilder(hashAlgorithm, secret, recipientAddress, proof); } /** @@ -91,12 +91,12 @@ export class SecretProofTransactionBodyBuilder { } /** - * Gets recipient. + * Gets locked mosaic recipient address. * - * @return Recipient. + * @return Locked mosaic recipient address. */ - public getRecipient(): UnresolvedAddressDto { - return this.recipient; + public getRecipientAddress(): UnresolvedAddressDto { + return this.recipientAddress; } /** @@ -117,7 +117,7 @@ export class SecretProofTransactionBodyBuilder { let size = 0; size += 1; // hashAlgorithm size += this.secret.getSize(); - size += this.recipient.getSize(); + size += this.recipientAddress.getSize(); size += 2; // proofSize size += this.proof.length; return size; @@ -134,8 +134,8 @@ export class SecretProofTransactionBodyBuilder { newArray = GeneratorUtils.concatTypedArrays(newArray, hashAlgorithmBytes); const secretBytes = this.secret.serialize(); newArray = GeneratorUtils.concatTypedArrays(newArray, secretBytes); - const recipientBytes = this.recipient.serialize(); - newArray = GeneratorUtils.concatTypedArrays(newArray, recipientBytes); + const recipientAddressBytes = this.recipientAddress.serialize(); + newArray = GeneratorUtils.concatTypedArrays(newArray, recipientAddressBytes); const proofSizeBytes = GeneratorUtils.uintToBuffer(this.proof.length, 2); newArray = GeneratorUtils.concatTypedArrays(newArray, proofSizeBytes); newArray = GeneratorUtils.concatTypedArrays(newArray, this.proof); diff --git a/src/infrastructure/catbuffer/SecretProofTransactionBuilder.ts b/src/infrastructure/catbuffer/SecretProofTransactionBuilder.ts index 445a74e418..df0d5e1d71 100644 --- a/src/infrastructure/catbuffer/SecretProofTransactionBuilder.ts +++ b/src/infrastructure/catbuffer/SecretProofTransactionBuilder.ts @@ -40,20 +40,20 @@ export class SecretProofTransactionBuilder extends TransactionBuilder { * Constructor. * * @param signature Entity signature. - * @param signer Entity signer's public key. + * @param signerPublicKey Entity signer's public key. * @param version Entity version. * @param type Entity type. * @param fee Transaction fee. * @param deadline Transaction deadline. * @param hashAlgorithm Hash algorithm. * @param secret Secret. - * @param recipient Recipient. + * @param recipientAddress Locked mosaic recipient address. * @param proof Proof data. */ // tslint:disable-next-line: max-line-length - public constructor(signature: SignatureDto, signer: KeyDto, version: number, type: EntityTypeDto, fee: AmountDto, deadline: TimestampDto, hashAlgorithm: LockHashAlgorithmDto, secret: Hash256Dto, recipient: UnresolvedAddressDto, proof: Uint8Array) { - super(signature, signer, version, type, fee, deadline); - this.secretProofTransactionBody = new SecretProofTransactionBodyBuilder(hashAlgorithm, secret, recipient, proof); + public constructor(signature: SignatureDto, signerPublicKey: KeyDto, version: number, type: EntityTypeDto, fee: AmountDto, deadline: TimestampDto, hashAlgorithm: LockHashAlgorithmDto, secret: Hash256Dto, recipientAddress: UnresolvedAddressDto, proof: Uint8Array) { + super(signature, signerPublicKey, version, type, fee, deadline); + this.secretProofTransactionBody = new SecretProofTransactionBodyBuilder(hashAlgorithm, secret, recipientAddress, proof); } /** @@ -69,7 +69,7 @@ export class SecretProofTransactionBuilder extends TransactionBuilder { 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.signer, superObject.version, superObject.type, superObject.fee, superObject.deadline, secretProofTransactionBody.hashAlgorithm, secretProofTransactionBody.secret, secretProofTransactionBody.recipient, secretProofTransactionBody.proof); + return new SecretProofTransactionBuilder(superObject.signature, superObject.signerPublicKey, superObject.version, superObject.type, superObject.fee, superObject.deadline, secretProofTransactionBody.hashAlgorithm, secretProofTransactionBody.secret, secretProofTransactionBody.recipientAddress, secretProofTransactionBody.proof); } /** @@ -91,12 +91,12 @@ export class SecretProofTransactionBuilder extends TransactionBuilder { } /** - * Gets recipient. + * Gets locked mosaic recipient address. * - * @return Recipient. + * @return Locked mosaic recipient address. */ - public getRecipient(): UnresolvedAddressDto { - return this.secretProofTransactionBody.getRecipient(); + public getRecipientAddress(): UnresolvedAddressDto { + return this.secretProofTransactionBody.getRecipientAddress(); } /** diff --git a/src/infrastructure/catbuffer/TransactionBuilder.ts b/src/infrastructure/catbuffer/TransactionBuilder.ts index e50a3024be..91e829ee39 100644 --- a/src/infrastructure/catbuffer/TransactionBuilder.ts +++ b/src/infrastructure/catbuffer/TransactionBuilder.ts @@ -33,7 +33,7 @@ export class TransactionBuilder { /** Entity signature. */ signature: SignatureDto; /** Entity signer's public key. */ - signer: KeyDto; + signerPublicKey: KeyDto; /** Entity version. */ version: number; /** Entity type. */ @@ -47,16 +47,16 @@ export class TransactionBuilder { * Constructor. * * @param signature Entity signature. - * @param signer Entity signer's public key. + * @param signerPublicKey Entity signer's public key. * @param version Entity version. * @param type Entity type. * @param fee Transaction fee. * @param deadline Transaction deadline. */ // tslint:disable-next-line: max-line-length - public constructor(signature: SignatureDto, signer: KeyDto, version: number, type: EntityTypeDto, fee: AmountDto, deadline: TimestampDto) { + public constructor(signature: SignatureDto, signerPublicKey: KeyDto, version: number, type: EntityTypeDto, fee: AmountDto, deadline: TimestampDto) { this.signature = signature; - this.signer = signer; + this.signerPublicKey = signerPublicKey; this.version = version; this.type = type; this.fee = fee; @@ -75,8 +75,8 @@ export class TransactionBuilder { byteArray.splice(0, 4); const signature = SignatureDto.loadFromBinary(Uint8Array.from(byteArray)); byteArray.splice(0, signature.getSize()); - const signer = KeyDto.loadFromBinary(Uint8Array.from(byteArray)); - byteArray.splice(0, signer.getSize()); + const signerPublicKey = KeyDto.loadFromBinary(Uint8Array.from(byteArray)); + byteArray.splice(0, signerPublicKey.getSize()); const version = GeneratorUtils.bufferToUint(GeneratorUtils.getBytes(Uint8Array.from(byteArray), 2)); byteArray.splice(0, 2); const type = GeneratorUtils.bufferToUint(GeneratorUtils.getBytes(Uint8Array.from(byteArray), 2)); @@ -85,7 +85,7 @@ export class TransactionBuilder { byteArray.splice(0, fee.getSize()); const deadline = TimestampDto.loadFromBinary(Uint8Array.from(byteArray)); byteArray.splice(0, deadline.getSize()); - return new TransactionBuilder(signature, signer, version, type, fee, deadline); + return new TransactionBuilder(signature, signerPublicKey, version, type, fee, deadline); } /** @@ -102,8 +102,8 @@ export class TransactionBuilder { * * @return Entity signer's public key. */ - public getSigner(): KeyDto { - return this.signer; + public getSignerPublicKey(): KeyDto { + return this.signerPublicKey; } /** @@ -151,7 +151,7 @@ export class TransactionBuilder { let size = 0; size += 4; // size size += this.signature.getSize(); - size += this.signer.getSize(); + size += this.signerPublicKey.getSize(); size += 2; // version size += 2; // type size += this.fee.getSize(); @@ -170,8 +170,8 @@ export class TransactionBuilder { newArray = GeneratorUtils.concatTypedArrays(newArray, sizeBytes); const signatureBytes = this.signature.serialize(); newArray = GeneratorUtils.concatTypedArrays(newArray, signatureBytes); - const signerBytes = this.signer.serialize(); - newArray = GeneratorUtils.concatTypedArrays(newArray, signerBytes); + const signerPublicKeyBytes = this.signerPublicKey.serialize(); + newArray = GeneratorUtils.concatTypedArrays(newArray, signerPublicKeyBytes); const versionBytes = GeneratorUtils.uintToBuffer(this.getVersion(), 2); newArray = GeneratorUtils.concatTypedArrays(newArray, versionBytes); const typeBytes = GeneratorUtils.uintToBuffer(this.type, 2); diff --git a/src/infrastructure/catbuffer/TransferTransactionBodyBuilder.ts b/src/infrastructure/catbuffer/TransferTransactionBodyBuilder.ts index e0ee7daed1..31ad85eada 100644 --- a/src/infrastructure/catbuffer/TransferTransactionBodyBuilder.ts +++ b/src/infrastructure/catbuffer/TransferTransactionBodyBuilder.ts @@ -25,9 +25,9 @@ import { UnresolvedMosaicBuilder } from './UnresolvedMosaicBuilder'; /** Binary layout for a transfer transaction. */ export class TransferTransactionBodyBuilder { - /** Transaction recipient. */ - recipient: UnresolvedAddressDto; - /** Transaction message. */ + /** Recipient address. */ + recipientAddress: UnresolvedAddressDto; + /** Attached message. */ message: Uint8Array; /** Attached mosaics. */ mosaics: UnresolvedMosaicBuilder[]; @@ -35,12 +35,12 @@ export class TransferTransactionBodyBuilder { /** * Constructor. * - * @param recipient Transaction recipient. - * @param message Transaction message. + * @param recipientAddress Recipient address. + * @param message Attached message. * @param mosaics Attached mosaics. */ - public constructor(recipient: UnresolvedAddressDto, message: Uint8Array, mosaics: UnresolvedMosaicBuilder[]) { - this.recipient = recipient; + public constructor(recipientAddress: UnresolvedAddressDto, message: Uint8Array, mosaics: UnresolvedMosaicBuilder[]) { + this.recipientAddress = recipientAddress; this.message = message; this.mosaics = mosaics; } @@ -53,8 +53,8 @@ export class TransferTransactionBodyBuilder { */ public static loadFromBinary(payload: Uint8Array): TransferTransactionBodyBuilder { const byteArray = Array.from(payload); - const recipient = UnresolvedAddressDto.loadFromBinary(Uint8Array.from(byteArray)); - byteArray.splice(0, recipient.getSize()); + const recipientAddress = UnresolvedAddressDto.loadFromBinary(Uint8Array.from(byteArray)); + byteArray.splice(0, recipientAddress.getSize()); const messageSize = GeneratorUtils.bufferToUint(GeneratorUtils.getBytes(Uint8Array.from(byteArray), 2)); byteArray.splice(0, 2); const mosaicsCount = GeneratorUtils.bufferToUint(GeneratorUtils.getBytes(Uint8Array.from(byteArray), 1)); @@ -67,22 +67,22 @@ export class TransferTransactionBodyBuilder { mosaics.push(item); byteArray.splice(0, item.getSize()); } - return new TransferTransactionBodyBuilder(recipient, message, mosaics); + return new TransferTransactionBodyBuilder(recipientAddress, message, mosaics); } /** - * Gets transaction recipient. + * Gets recipient address. * - * @return Transaction recipient. + * @return Recipient address. */ - public getRecipient(): UnresolvedAddressDto { - return this.recipient; + public getRecipientAddress(): UnresolvedAddressDto { + return this.recipientAddress; } /** - * Gets transaction message. + * Gets attached message. * - * @return Transaction message. + * @return Attached message. */ public getMessage(): Uint8Array { return this.message; @@ -104,7 +104,7 @@ export class TransferTransactionBodyBuilder { */ public getSize(): number { let size = 0; - size += this.recipient.getSize(); + size += this.recipientAddress.getSize(); size += 2; // messageSize size += 1; // mosaicsCount size += this.message.length; @@ -119,8 +119,8 @@ export class TransferTransactionBodyBuilder { */ public serialize(): Uint8Array { let newArray = Uint8Array.from([]); - const recipientBytes = this.recipient.serialize(); - newArray = GeneratorUtils.concatTypedArrays(newArray, recipientBytes); + const recipientAddressBytes = this.recipientAddress.serialize(); + newArray = GeneratorUtils.concatTypedArrays(newArray, recipientAddressBytes); const messageSizeBytes = GeneratorUtils.uintToBuffer(this.message.length, 2); newArray = GeneratorUtils.concatTypedArrays(newArray, messageSizeBytes); const mosaicsCountBytes = GeneratorUtils.uintToBuffer(this.mosaics.length, 1); diff --git a/src/infrastructure/catbuffer/TransferTransactionBuilder.ts b/src/infrastructure/catbuffer/TransferTransactionBuilder.ts index 722d79409a..e2322d04a6 100644 --- a/src/infrastructure/catbuffer/TransferTransactionBuilder.ts +++ b/src/infrastructure/catbuffer/TransferTransactionBuilder.ts @@ -39,19 +39,19 @@ export class TransferTransactionBuilder extends TransactionBuilder { * Constructor. * * @param signature Entity signature. - * @param signer Entity signer's public key. + * @param signerPublicKey Entity signer's public key. * @param version Entity version. * @param type Entity type. * @param fee Transaction fee. * @param deadline Transaction deadline. - * @param recipient Transaction recipient. - * @param message Transaction message. + * @param recipientAddress Recipient address. + * @param message Attached message. * @param mosaics Attached mosaics. */ // tslint:disable-next-line: max-line-length - public constructor(signature: SignatureDto, signer: KeyDto, version: number, type: EntityTypeDto, fee: AmountDto, deadline: TimestampDto, recipient: UnresolvedAddressDto, message: Uint8Array, mosaics: UnresolvedMosaicBuilder[]) { - super(signature, signer, version, type, fee, deadline); - this.transferTransactionBody = new TransferTransactionBodyBuilder(recipient, message, mosaics); + public constructor(signature: SignatureDto, signerPublicKey: KeyDto, version: number, type: EntityTypeDto, fee: AmountDto, deadline: TimestampDto, recipientAddress: UnresolvedAddressDto, message: Uint8Array, mosaics: UnresolvedMosaicBuilder[]) { + super(signature, signerPublicKey, version, type, fee, deadline); + this.transferTransactionBody = new TransferTransactionBodyBuilder(recipientAddress, message, mosaics); } /** @@ -67,22 +67,22 @@ export class TransferTransactionBuilder extends TransactionBuilder { 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.signer, superObject.version, superObject.type, superObject.fee, superObject.deadline, transferTransactionBody.recipient, transferTransactionBody.message, transferTransactionBody.mosaics); + return new TransferTransactionBuilder(superObject.signature, superObject.signerPublicKey, superObject.version, superObject.type, superObject.fee, superObject.deadline, transferTransactionBody.recipientAddress, transferTransactionBody.message, transferTransactionBody.mosaics); } /** - * Gets transaction recipient. + * Gets recipient address. * - * @return Transaction recipient. + * @return Recipient address. */ - public getRecipient(): UnresolvedAddressDto { - return this.transferTransactionBody.getRecipient(); + public getRecipientAddress(): UnresolvedAddressDto { + return this.transferTransactionBody.getRecipientAddress(); } /** - * Gets transaction message. + * Gets attached message. * - * @return Transaction message. + * @return Attached message. */ public getMessage(): Uint8Array { return this.transferTransactionBody.getMessage(); diff --git a/src/model/transaction/AccountAddressRestrictionTransaction.ts b/src/model/transaction/AccountAddressRestrictionTransaction.ts index 48299057bb..82c70a84f3 100644 --- a/src/model/transaction/AccountAddressRestrictionTransaction.ts +++ b/src/model/transaction/AccountAddressRestrictionTransaction.ts @@ -97,7 +97,7 @@ export class AccountAddressRestrictionTransaction extends Transaction { signSchema: SignSchema = SignSchema.SHA3): Transaction | InnerTransaction { const builder = isEmbedded ? EmbeddedAccountAddressRestrictionTransactionBuilder.loadFromBinary(Convert.hexToUint8(payload)) : AccountAddressRestrictionTransactionBuilder.loadFromBinary(Convert.hexToUint8(payload)); - const signer = Convert.uint8ToHex(builder.getSigner().key); + const signer = Convert.uint8ToHex(builder.getSignerPublicKey().key); const networkType = Convert.hexToUint8(builder.getVersion().toString(16))[0]; const transaction = AccountAddressRestrictionTransaction.create( isEmbedded ? Deadline.create() : Deadline.createFromDTO( diff --git a/src/model/transaction/AccountLinkTransaction.ts b/src/model/transaction/AccountLinkTransaction.ts index f1cb351b7a..ad1d67ab7e 100644 --- a/src/model/transaction/AccountLinkTransaction.ts +++ b/src/model/transaction/AccountLinkTransaction.ts @@ -101,11 +101,11 @@ export class AccountLinkTransaction extends Transaction { signSchema: SignSchema = SignSchema.SHA3): Transaction | InnerTransaction { const builder = isEmbedded ? EmbeddedAccountLinkTransactionBuilder.loadFromBinary(Convert.hexToUint8(payload)) : AccountLinkTransactionBuilder.loadFromBinary(Convert.hexToUint8(payload)); - const signer = Convert.uint8ToHex(builder.getSigner().key); + const signer = Convert.uint8ToHex(builder.getSignerPublicKey().key); const networkType = Convert.hexToUint8(builder.getVersion().toString(16))[0]; const transaction = AccountLinkTransaction.create( isEmbedded ? Deadline.create() : Deadline.createFromDTO((builder as AccountLinkTransactionBuilder).getDeadline().timestamp), - Convert.uint8ToHex(builder.getRemoteAccountPublicKey().key), + Convert.uint8ToHex(builder.getRemotePublicKey().key), builder.getLinkAction().valueOf(), networkType, isEmbedded ? new UInt64([0, 0]) : new UInt64((builder as AccountLinkTransactionBuilder).fee.amount), diff --git a/src/model/transaction/AccountMetadataTransaction.ts b/src/model/transaction/AccountMetadataTransaction.ts index 23120e9367..5065687eab 100644 --- a/src/model/transaction/AccountMetadataTransaction.ts +++ b/src/model/transaction/AccountMetadataTransaction.ts @@ -119,7 +119,7 @@ export class AccountMetadataTransaction extends Transaction { signSchema: SignSchema = SignSchema.SHA3): Transaction | InnerTransaction { const builder = isEmbedded ? EmbeddedAccountMetadataTransactionBuilder.loadFromBinary(Convert.hexToUint8(payload)) : AccountMetadataTransactionBuilder.loadFromBinary(Convert.hexToUint8(payload)); - const signer = Convert.uint8ToHex(builder.getSigner().key); + const signer = Convert.uint8ToHex(builder.getSignerPublicKey().key); const networkType = Convert.hexToUint8(builder.getVersion().toString(16))[0]; const transaction = AccountMetadataTransaction.create( isEmbedded ? Deadline.create() : Deadline.createFromDTO((builder as AccountMetadataTransactionBuilder).getDeadline().timestamp), diff --git a/src/model/transaction/AccountMosaicRestrictionTransaction.ts b/src/model/transaction/AccountMosaicRestrictionTransaction.ts index 97343c5460..836eaeea80 100644 --- a/src/model/transaction/AccountMosaicRestrictionTransaction.ts +++ b/src/model/transaction/AccountMosaicRestrictionTransaction.ts @@ -97,7 +97,7 @@ export class AccountMosaicRestrictionTransaction extends Transaction { signSchema: SignSchema = SignSchema.SHA3): Transaction | InnerTransaction { const builder = isEmbedded ? EmbeddedAccountMosaicRestrictionTransactionBuilder.loadFromBinary(Convert.hexToUint8(payload)) : AccountMosaicRestrictionTransactionBuilder.loadFromBinary(Convert.hexToUint8(payload)); - const signer = Convert.uint8ToHex(builder.getSigner().key); + const signer = Convert.uint8ToHex(builder.getSignerPublicKey().key); const networkType = Convert.hexToUint8(builder.getVersion().toString(16))[0]; const transaction = AccountMosaicRestrictionTransaction.create( isEmbedded ? Deadline.create() : Deadline.createFromDTO( diff --git a/src/model/transaction/AccountOperationRestrictionTransaction.ts b/src/model/transaction/AccountOperationRestrictionTransaction.ts index f60abe0115..bab5131586 100644 --- a/src/model/transaction/AccountOperationRestrictionTransaction.ts +++ b/src/model/transaction/AccountOperationRestrictionTransaction.ts @@ -95,7 +95,7 @@ export class AccountOperationRestrictionTransaction extends Transaction { signSchema: SignSchema = SignSchema.SHA3): Transaction | InnerTransaction { const builder = isEmbedded ? EmbeddedAccountOperationRestrictionTransactionBuilder.loadFromBinary(Convert.hexToUint8(payload)) : AccountOperationRestrictionTransactionBuilder.loadFromBinary(Convert.hexToUint8(payload)); - const signer = Convert.uint8ToHex(builder.getSigner().key); + const signer = Convert.uint8ToHex(builder.getSignerPublicKey().key); const networkType = Convert.hexToUint8(builder.getVersion().toString(16))[0]; const transaction = AccountOperationRestrictionTransaction.create( isEmbedded ? Deadline.create() : Deadline.createFromDTO( diff --git a/src/model/transaction/AddressAliasTransaction.ts b/src/model/transaction/AddressAliasTransaction.ts index 3975b926dc..ef10ab183c 100644 --- a/src/model/transaction/AddressAliasTransaction.ts +++ b/src/model/transaction/AddressAliasTransaction.ts @@ -115,7 +115,7 @@ export class AddressAliasTransaction extends Transaction { signSchema: SignSchema = SignSchema.SHA3): Transaction | InnerTransaction { const builder = isEmbedded ? EmbeddedAddressAliasTransactionBuilder.loadFromBinary(Convert.hexToUint8(payload)) : AddressAliasTransactionBuilder.loadFromBinary(Convert.hexToUint8(payload)); - const signer = Convert.uint8ToHex(builder.getSigner().key); + const signer = Convert.uint8ToHex(builder.getSignerPublicKey().key); const networkType = Convert.hexToUint8(builder.getVersion().toString(16))[0]; const transaction = AddressAliasTransaction.create( isEmbedded ? Deadline.create() : Deadline.createFromDTO((builder as AddressAliasTransactionBuilder).getDeadline().timestamp), diff --git a/src/model/transaction/LockFundsTransaction.ts b/src/model/transaction/LockFundsTransaction.ts index 96088b7ec0..816ccf1a41 100644 --- a/src/model/transaction/LockFundsTransaction.ts +++ b/src/model/transaction/LockFundsTransaction.ts @@ -126,7 +126,7 @@ export class LockFundsTransaction extends Transaction { signSchema: SignSchema = SignSchema.SHA3): Transaction | InnerTransaction { const builder = isEmbedded ? EmbeddedHashLockTransactionBuilder.loadFromBinary(Convert.hexToUint8(payload)) : HashLockTransactionBuilder.loadFromBinary(Convert.hexToUint8(payload)); - const signer = Convert.uint8ToHex(builder.getSigner().key); + const signer = Convert.uint8ToHex(builder.getSignerPublicKey().key); const networkType = Convert.hexToUint8(builder.getVersion().toString(16))[0]; const transaction = LockFundsTransaction.create( isEmbedded ? Deadline.create() : Deadline.createFromDTO((builder as HashLockTransactionBuilder).getDeadline().timestamp), diff --git a/src/model/transaction/ModifyMultisigAccountTransaction.ts b/src/model/transaction/ModifyMultisigAccountTransaction.ts index 23dce96d81..c278cc49d8 100644 --- a/src/model/transaction/ModifyMultisigAccountTransaction.ts +++ b/src/model/transaction/ModifyMultisigAccountTransaction.ts @@ -115,7 +115,7 @@ export class ModifyMultisigAccountTransaction extends Transaction { signSchema: SignSchema = SignSchema.SHA3): Transaction | InnerTransaction { const builder = isEmbedded ? EmbeddedMultisigAccountModificationTransactionBuilder.loadFromBinary(Convert.hexToUint8(payload)) : MultisigAccountModificationTransactionBuilder.loadFromBinary(Convert.hexToUint8(payload)); - const signer = Convert.uint8ToHex(builder.getSigner().key); + const signer = Convert.uint8ToHex(builder.getSignerPublicKey().key); const networkType = Convert.hexToUint8(builder.getVersion().toString(16))[0]; const transaction = ModifyMultisigAccountTransaction.create( isEmbedded ? Deadline.create() : Deadline.createFromDTO( diff --git a/src/model/transaction/MosaicAddressRestrictionTransaction.ts b/src/model/transaction/MosaicAddressRestrictionTransaction.ts index 3f1877838a..f13d59a5ac 100644 --- a/src/model/transaction/MosaicAddressRestrictionTransaction.ts +++ b/src/model/transaction/MosaicAddressRestrictionTransaction.ts @@ -133,7 +133,7 @@ export class MosaicAddressRestrictionTransaction extends Transaction { signSchema: SignSchema = SignSchema.SHA3): Transaction | InnerTransaction { const builder = isEmbedded ? EmbeddedMosaicAddressRestrictionTransactionBuilder.loadFromBinary(Convert.hexToUint8(payload)) : MosaicAddressRestrictionTransactionBuilder.loadFromBinary(Convert.hexToUint8(payload)); - const signer = Convert.uint8ToHex(builder.getSigner().key); + const signer = Convert.uint8ToHex(builder.getSignerPublicKey().key); const networkType = Convert.hexToUint8(builder.getVersion().toString(16))[0]; const transaction = MosaicAddressRestrictionTransaction.create( isEmbedded ? Deadline.create() : Deadline.createFromDTO( diff --git a/src/model/transaction/MosaicAliasTransaction.ts b/src/model/transaction/MosaicAliasTransaction.ts index 6d7cae3183..13c6b06deb 100644 --- a/src/model/transaction/MosaicAliasTransaction.ts +++ b/src/model/transaction/MosaicAliasTransaction.ts @@ -112,7 +112,7 @@ export class MosaicAliasTransaction extends Transaction { signSchema: SignSchema = SignSchema.SHA3): Transaction | InnerTransaction { const builder = isEmbedded ? EmbeddedMosaicAliasTransactionBuilder.loadFromBinary(Convert.hexToUint8(payload)) : MosaicAliasTransactionBuilder.loadFromBinary(Convert.hexToUint8(payload)); - const signer = Convert.uint8ToHex(builder.getSigner().key); + const signer = Convert.uint8ToHex(builder.getSignerPublicKey().key); const networkType = Convert.hexToUint8(builder.getVersion().toString(16))[0]; const transaction = MosaicAliasTransaction.create( isEmbedded ? Deadline.create() : Deadline.createFromDTO((builder as MosaicAliasTransactionBuilder).getDeadline().timestamp), diff --git a/src/model/transaction/MosaicDefinitionTransaction.ts b/src/model/transaction/MosaicDefinitionTransaction.ts index 1616044875..470f83dceb 100644 --- a/src/model/transaction/MosaicDefinitionTransaction.ts +++ b/src/model/transaction/MosaicDefinitionTransaction.ts @@ -118,7 +118,7 @@ export class MosaicDefinitionTransaction extends Transaction { signSchema: SignSchema = SignSchema.SHA3): Transaction | InnerTransaction { const builder = isEmbedded ? EmbeddedMosaicDefinitionTransactionBuilder.loadFromBinary(Convert.hexToUint8(payload)) : MosaicDefinitionTransactionBuilder.loadFromBinary(Convert.hexToUint8(payload)); - const signer = Convert.uint8ToHex(builder.getSigner().key); + const signer = Convert.uint8ToHex(builder.getSignerPublicKey().key); const networkType = Convert.hexToUint8(builder.getVersion().toString(16))[0]; const transaction = MosaicDefinitionTransaction.create( isEmbedded ? Deadline.create() : Deadline.createFromDTO( diff --git a/src/model/transaction/MosaicGlobalRestrictionTransaction.ts b/src/model/transaction/MosaicGlobalRestrictionTransaction.ts index c7e36df0d2..9f771f79a8 100644 --- a/src/model/transaction/MosaicGlobalRestrictionTransaction.ts +++ b/src/model/transaction/MosaicGlobalRestrictionTransaction.ts @@ -150,7 +150,7 @@ export class MosaicGlobalRestrictionTransaction extends Transaction { signSchema: SignSchema = SignSchema.SHA3): Transaction | InnerTransaction { const builder = isEmbedded ? EmbeddedMosaicGlobalRestrictionTransactionBuilder.loadFromBinary(Convert.hexToUint8(payload)) : MosaicGlobalRestrictionTransactionBuilder.loadFromBinary(Convert.hexToUint8(payload)); - const signer = Convert.uint8ToHex(builder.getSigner().key); + const signer = Convert.uint8ToHex(builder.getSignerPublicKey().key); const networkType = Convert.hexToUint8(builder.getVersion().toString(16))[0]; const transaction = MosaicGlobalRestrictionTransaction.create( isEmbedded ? Deadline.create() : Deadline.createFromDTO( diff --git a/src/model/transaction/MosaicMetadataTransaction.ts b/src/model/transaction/MosaicMetadataTransaction.ts index 78798f73a9..37688f395c 100644 --- a/src/model/transaction/MosaicMetadataTransaction.ts +++ b/src/model/transaction/MosaicMetadataTransaction.ts @@ -129,7 +129,7 @@ export class MosaicMetadataTransaction extends Transaction { signSchema: SignSchema = SignSchema.SHA3): Transaction | InnerTransaction { const builder = isEmbedded ? EmbeddedMosaicMetadataTransactionBuilder.loadFromBinary(Convert.hexToUint8(payload)) : MosaicMetadataTransactionBuilder.loadFromBinary(Convert.hexToUint8(payload)); - const signer = Convert.uint8ToHex(builder.getSigner().key); + const signer = Convert.uint8ToHex(builder.getSignerPublicKey().key); const networkType = Convert.hexToUint8(builder.getVersion().toString(16))[0]; const transaction = MosaicMetadataTransaction.create( isEmbedded ? Deadline.create() : Deadline.createFromDTO((builder as MosaicMetadataTransactionBuilder).getDeadline().timestamp), diff --git a/src/model/transaction/MosaicSupplyChangeTransaction.ts b/src/model/transaction/MosaicSupplyChangeTransaction.ts index 1ee6fc22d7..e479f7d028 100644 --- a/src/model/transaction/MosaicSupplyChangeTransaction.ts +++ b/src/model/transaction/MosaicSupplyChangeTransaction.ts @@ -113,7 +113,7 @@ export class MosaicSupplyChangeTransaction extends Transaction { signSchema: SignSchema = SignSchema.SHA3): Transaction | InnerTransaction { const builder = isEmbedded ? EmbeddedMosaicSupplyChangeTransactionBuilder.loadFromBinary(Convert.hexToUint8(payload)) : MosaicSupplyChangeTransactionBuilder.loadFromBinary(Convert.hexToUint8(payload)); - const signer = Convert.uint8ToHex(builder.getSigner().key); + const signer = Convert.uint8ToHex(builder.getSignerPublicKey().key); const networkType = Convert.hexToUint8(builder.getVersion().toString(16))[0]; const transaction = MosaicSupplyChangeTransaction.create( isEmbedded ? Deadline.create() : Deadline.createFromDTO( diff --git a/src/model/transaction/NamespaceMetadataTransaction.ts b/src/model/transaction/NamespaceMetadataTransaction.ts index 49d4236d94..043d575a16 100644 --- a/src/model/transaction/NamespaceMetadataTransaction.ts +++ b/src/model/transaction/NamespaceMetadataTransaction.ts @@ -129,7 +129,7 @@ export class NamespaceMetadataTransaction extends Transaction { signSchema: SignSchema = SignSchema.SHA3): Transaction | InnerTransaction { const builder = isEmbedded ? EmbeddedNamespaceMetadataTransactionBuilder.loadFromBinary(Convert.hexToUint8(payload)) : NamespaceMetadataTransactionBuilder.loadFromBinary(Convert.hexToUint8(payload)); - const signer = Convert.uint8ToHex(builder.getSigner().key); + const signer = Convert.uint8ToHex(builder.getSignerPublicKey().key); const networkType = Convert.hexToUint8(builder.getVersion().toString(16))[0]; const transaction = NamespaceMetadataTransaction.create( isEmbedded ? Deadline.create() : diff --git a/src/model/transaction/RegisterNamespaceTransaction.ts b/src/model/transaction/RegisterNamespaceTransaction.ts index 6c63a6c4e5..ea0509f778 100644 --- a/src/model/transaction/RegisterNamespaceTransaction.ts +++ b/src/model/transaction/RegisterNamespaceTransaction.ts @@ -160,7 +160,7 @@ export class RegisterNamespaceTransaction extends Transaction { const builder = isEmbedded ? EmbeddedNamespaceRegistrationTransactionBuilder.loadFromBinary(Convert.hexToUint8(payload)) : NamespaceRegistrationTransactionBuilder.loadFromBinary(Convert.hexToUint8(payload)); const namespaceType = builder.getRegistrationType().valueOf(); - const signer = Convert.uint8ToHex(builder.getSigner().key); + const signer = Convert.uint8ToHex(builder.getSignerPublicKey().key); const networkType = Convert.hexToUint8(builder.getVersion().toString(16))[0]; const transaction = namespaceType === NamespaceType.RootNamespace ? RegisterNamespaceTransaction.createRootNamespace( diff --git a/src/model/transaction/SecretLockTransaction.ts b/src/model/transaction/SecretLockTransaction.ts index 6dd679613e..367eedd940 100644 --- a/src/model/transaction/SecretLockTransaction.ts +++ b/src/model/transaction/SecretLockTransaction.ts @@ -137,7 +137,7 @@ export class SecretLockTransaction extends Transaction { signSchema: SignSchema = SignSchema.SHA3): Transaction | InnerTransaction { const builder = isEmbedded ? EmbeddedSecretLockTransactionBuilder.loadFromBinary(Convert.hexToUint8(payload)) : SecretLockTransactionBuilder.loadFromBinary(Convert.hexToUint8(payload)); - const signer = Convert.uint8ToHex(builder.getSigner().key); + const signer = Convert.uint8ToHex(builder.getSignerPublicKey().key); const networkType = Convert.hexToUint8(builder.getVersion().toString(16))[0]; const transaction = SecretLockTransaction.create( isEmbedded ? Deadline.create() : Deadline.createFromDTO( @@ -149,7 +149,7 @@ export class SecretLockTransaction extends Transaction { new UInt64(builder.getDuration().blockDuration), builder.getHashAlgorithm().valueOf(), Convert.uint8ToHex(builder.getSecret().hash256), - Address.createFromEncoded(Convert.uint8ToHex(builder.getRecipient().unresolvedAddress)), + Address.createFromEncoded(Convert.uint8ToHex(builder.getRecipientAddress().unresolvedAddress)), networkType, isEmbedded ? new UInt64([0, 0]) : new UInt64((builder as SecretLockTransactionBuilder).fee.amount), ); diff --git a/src/model/transaction/SecretProofTransaction.ts b/src/model/transaction/SecretProofTransaction.ts index 0752efa2f1..1ae58c7228 100644 --- a/src/model/transaction/SecretProofTransaction.ts +++ b/src/model/transaction/SecretProofTransaction.ts @@ -113,14 +113,14 @@ export class SecretProofTransaction extends Transaction { signSchema: SignSchema = SignSchema.SHA3): Transaction | InnerTransaction { const builder = isEmbedded ? EmbeddedSecretProofTransactionBuilder.loadFromBinary(Convert.hexToUint8(payload)) : SecretProofTransactionBuilder.loadFromBinary(Convert.hexToUint8(payload)); - const signer = Convert.uint8ToHex(builder.getSigner().key); + const signer = Convert.uint8ToHex(builder.getSignerPublicKey().key); const networkType = Convert.hexToUint8(builder.getVersion().toString(16))[0]; const transaction = SecretProofTransaction.create( isEmbedded ? Deadline.create() : Deadline.createFromDTO( (builder as SecretProofTransactionBuilder).getDeadline().timestamp), builder.getHashAlgorithm().valueOf(), Convert.uint8ToHex(builder.getSecret().hash256), - Address.createFromEncoded(Convert.uint8ToHex(builder.getRecipient().unresolvedAddress)), + Address.createFromEncoded(Convert.uint8ToHex(builder.getRecipientAddress().unresolvedAddress)), Convert.uint8ToHex(builder.getProof()), networkType, isEmbedded ? new UInt64([0, 0]) : new UInt64((builder as SecretProofTransactionBuilder).fee.amount), diff --git a/src/model/transaction/TransferTransaction.ts b/src/model/transaction/TransferTransaction.ts index eb2daab1de..63e5909a70 100644 --- a/src/model/transaction/TransferTransaction.ts +++ b/src/model/transaction/TransferTransaction.ts @@ -122,12 +122,12 @@ export class TransferTransaction extends Transaction { TransferTransactionBuilder.loadFromBinary(Convert.hexToUint8(payload)); const messageType = builder.getMessage()[0]; const messageHex = Convert.uint8ToHex(builder.getMessage()).substring(2); - const signer = Convert.uint8ToHex(builder.getSigner().key); + const signer = Convert.uint8ToHex(builder.getSignerPublicKey().key); const networkType = Convert.hexToUint8(builder.getVersion().toString(16))[0]; const transaction = TransferTransaction.create( isEmbedded ? Deadline.create() : Deadline.createFromDTO( (builder as TransferTransactionBuilder).getDeadline().timestamp), - Address.createFromEncoded(Convert.uint8ToHex(builder.getRecipient().unresolvedAddress)), + Address.createFromEncoded(Convert.uint8ToHex(builder.getRecipientAddress().unresolvedAddress)), builder.getMosaics().map((mosaic) => { return new Mosaic( new MosaicId(mosaic.mosaicId.unresolvedMosaicId), From 3a75c1ebf2dc24b2b1d5eca994d7626120a5099e Mon Sep 17 00:00:00 2001 From: Steven Liu Date: Mon, 2 Sep 2019 16:41:47 +0100 Subject: [PATCH 02/10] Model / class - catbuffer consistency renaming --- e2e/infrastructure/AccountHttp.spec.ts | 40 ++++----- e2e/infrastructure/Listener.spec.ts | 32 ++++---- e2e/infrastructure/MosaicHttp.spec.ts | 6 +- e2e/infrastructure/NamespaceHttp.spec.ts | 6 +- e2e/infrastructure/TransactionHttp.spec.ts | 42 +++++----- e2e/infrastructure/TransactionUtils.ts | 10 +-- .../CreateTransactionFromDTO.spec.ts | 32 ++++---- src/infrastructure/Listener.ts | 8 +- .../transaction/CreateTransactionFromDTO.ts | 8 +- .../CreateTransactionFromPayload.ts | 8 +- .../transaction/SerializeTransactionToJSON.ts | 20 ++--- ...> AccountRestrictionModificationAction.ts} | 2 +- src/model/model.ts | 14 ++-- ...plyType.ts => MosaicSupplyChangeAction.ts} | 2 +- ...ceType.ts => NamespaceRegistrationType.ts} | 2 +- .../AccountRestrictionModification.ts | 10 +-- ...pe.ts => CosignatoryModificationAction.ts} | 2 +- .../MosaicSupplyChangeTransaction.ts | 6 +- ...MultisigAccountModificationTransaction.ts} | 14 ++-- .../MultisigCosignatoryModification.ts | 4 +- ...ts => NamespaceRegistrationTransaction.ts} | 38 ++++----- src/service/AggregateTransactionService.ts | 8 +- test/core/utils/TransactionMapping.spec.ts | 82 +++++++++---------- .../SerializeTransactionToJSON.spec.ts | 32 ++++---- .../model/account/AccountRestrictions.spec.ts | 7 +- .../account/AccountRestrictionsInfo.spec.ts | 4 +- .../AccountRestrictionTransaction.spec.ts | 40 ++++----- .../transaction/AggregateTransaction.spec.ts | 22 ++--- .../MosaicSupplyChangeTransaction.spec.ts | 12 +-- ...sigAccountModificationTransaction.spec.ts} | 36 ++++---- .../MultisigCosignatoryModification.spec.ts | 18 ++-- ... NamespaceRegistrationTransaction.spec.ts} | 24 +++--- .../AggregateTransactionService.spec.ts | 8 +- 33 files changed, 301 insertions(+), 298 deletions(-) rename src/model/account/{RestrictionModificationType.ts => AccountRestrictionModificationAction.ts} (92%) rename src/model/mosaic/{MosaicSupplyType.ts => MosaicSupplyChangeAction.ts} (94%) rename src/model/namespace/{NamespaceType.ts => NamespaceRegistrationType.ts} (94%) rename src/model/transaction/{MultisigCosignatoryModificationType.ts => CosignatoryModificationAction.ts} (93%) rename src/model/transaction/{ModifyMultisigAccountTransaction.ts => MultisigAccountModificationTransaction.ts} (95%) rename src/model/transaction/{RegisterNamespaceTransaction.ts => NamespaceRegistrationTransaction.ts} (90%) rename test/model/transaction/{ModifyMultisigAccountTransaction.spec.ts => MultisigAccountModificationTransaction.spec.ts} (78%) rename test/model/transaction/{RegisterNamespaceTransaction.spec.ts => NamespaceRegistrationTransaction.spec.ts} (76%) diff --git a/e2e/infrastructure/AccountHttp.spec.ts b/e2e/infrastructure/AccountHttp.spec.ts index c190d8c0ae..a5193df19d 100644 --- a/e2e/infrastructure/AccountHttp.spec.ts +++ b/e2e/infrastructure/AccountHttp.spec.ts @@ -19,10 +19,10 @@ import {assert, expect} from 'chai'; import {AccountHttp} from '../../src/infrastructure/AccountHttp'; import { Listener, TransactionHttp } from '../../src/infrastructure/infrastructure'; import { Account } from '../../src/model/account/Account'; +import { AccountRestrictionModificationAction } from '../../src/model/account/AccountRestrictionModificationAction'; import { AccountRestrictionType } from '../../src/model/account/AccountRestrictionType'; import {Address} from '../../src/model/account/Address'; import {PublicAccount} from '../../src/model/account/PublicAccount'; -import { RestrictionModificationType } from '../../src/model/account/RestrictionModificationType'; import {NetworkType} from '../../src/model/blockchain/NetworkType'; import { NetworkCurrencyMosaic } from '../../src/model/mosaic/NetworkCurrencyMosaic'; import { AliasAction } from '../../src/model/namespace/AliasAction'; @@ -31,12 +31,12 @@ import { AccountRestrictionModification } from '../../src/model/transaction/Acco import { AccountRestrictionTransaction } from '../../src/model/transaction/AccountRestrictionTransaction'; import { AddressAliasTransaction } from '../../src/model/transaction/AddressAliasTransaction'; import { AggregateTransaction } from '../../src/model/transaction/AggregateTransaction'; +import { CosignatoryModificationAction } from '../../src/model/transaction/CosignatoryModificationAction'; import { Deadline } from '../../src/model/transaction/Deadline'; -import { ModifyMultisigAccountTransaction } from '../../src/model/transaction/ModifyMultisigAccountTransaction'; +import { MultisigAccountModificationTransaction } from '../../src/model/transaction/MultisigAccountModificationTransaction'; import { MultisigCosignatoryModification } from '../../src/model/transaction/MultisigCosignatoryModification'; -import { MultisigCosignatoryModificationType } from '../../src/model/transaction/MultisigCosignatoryModificationType'; +import { NamespaceRegistrationTransaction } from '../../src/model/transaction/NamespaceRegistrationTransaction'; import { PlainMessage } from '../../src/model/transaction/PlainMessage'; -import { RegisterNamespaceTransaction } from '../../src/model/transaction/RegisterNamespaceTransaction'; import { TransferTransaction } from '../../src/model/transaction/TransferTransaction'; import { UInt64 } from '../../src/model/UInt64'; @@ -129,9 +129,9 @@ describe('AccountHttp', () => { after(() => { return listener.close(); }); - it('Announce RegisterNamespaceTransaction', (done) => { + it('Announce NamespaceRegistrationTransaction', (done) => { const namespaceName = 'root-test-namespace-' + Math.floor(Math.random() * 10000); - const registerNamespaceTransaction = RegisterNamespaceTransaction.createRootNamespace( + const registerNamespaceTransaction = NamespaceRegistrationTransaction.createRootNamespace( Deadline.create(), namespaceName, UInt64.fromUint(1000), @@ -195,7 +195,7 @@ describe('AccountHttp', () => { it('Announce AccountRestrictionTransaction', (done) => { const addressPropertyFilter = AccountRestrictionModification.createForAddress( - RestrictionModificationType.Add, + AccountRestrictionModificationAction.Add, account3.address, ); const addressModification = AccountRestrictionTransaction.createAddressRestrictionModificationTransaction( @@ -226,14 +226,14 @@ describe('AccountHttp', () => { after(() => { return listener.close(); }); - it('Announce ModifyMultisigAccountTransaction', (done) => { - const modifyMultisigAccountTransaction = ModifyMultisigAccountTransaction.create( + it('Announce MultisigAccountModificationTransaction', (done) => { + const modifyMultisigAccountTransaction = MultisigAccountModificationTransaction.create( Deadline.create(), 2, 1, - [ new MultisigCosignatoryModification(MultisigCosignatoryModificationType.Add, cosignAccount1.publicAccount), - new MultisigCosignatoryModification(MultisigCosignatoryModificationType.Add, cosignAccount2.publicAccount), - new MultisigCosignatoryModification(MultisigCosignatoryModificationType.Add, cosignAccount3.publicAccount), + [ new MultisigCosignatoryModification(CosignatoryModificationAction.Add, cosignAccount1.publicAccount), + new MultisigCosignatoryModification(CosignatoryModificationAction.Add, cosignAccount2.publicAccount), + new MultisigCosignatoryModification(CosignatoryModificationAction.Add, cosignAccount3.publicAccount), ], NetworkType.MIJIN_TEST, ); @@ -421,7 +421,7 @@ describe('AccountHttp', () => { it('Announce AccountRestrictionTransaction', (done) => { const addressPropertyFilter = AccountRestrictionModification.createForAddress( - RestrictionModificationType.Remove, + AccountRestrictionModificationAction.Remove, account3.address, ); const addressModification = AccountRestrictionTransaction.createAddressRestrictionModificationTransaction( @@ -453,29 +453,29 @@ describe('AccountHttp', () => { after(() => { return listener.close(); }); - it('Announce ModifyMultisigAccountTransaction', (done) => { - const removeCosigner1 = ModifyMultisigAccountTransaction.create( + it('Announce MultisigAccountModificationTransaction', (done) => { + const removeCosigner1 = MultisigAccountModificationTransaction.create( Deadline.create(), -1, 0, - [ new MultisigCosignatoryModification(MultisigCosignatoryModificationType.Remove, cosignAccount1.publicAccount), + [ new MultisigCosignatoryModification(CosignatoryModificationAction.Remove, cosignAccount1.publicAccount), ], NetworkType.MIJIN_TEST, ); - const removeCosigner2 = ModifyMultisigAccountTransaction.create( + const removeCosigner2 = MultisigAccountModificationTransaction.create( Deadline.create(), 0, 0, - [ new MultisigCosignatoryModification(MultisigCosignatoryModificationType.Remove, cosignAccount2.publicAccount), + [ new MultisigCosignatoryModification(CosignatoryModificationAction.Remove, cosignAccount2.publicAccount), ], NetworkType.MIJIN_TEST, ); - const removeCosigner3 = ModifyMultisigAccountTransaction.create( + const removeCosigner3 = MultisigAccountModificationTransaction.create( Deadline.create(), -1, -1, - [ new MultisigCosignatoryModification(MultisigCosignatoryModificationType.Remove, cosignAccount3.publicAccount), + [ new MultisigCosignatoryModification(CosignatoryModificationAction.Remove, cosignAccount3.publicAccount), ], NetworkType.MIJIN_TEST, ); diff --git a/e2e/infrastructure/Listener.spec.ts b/e2e/infrastructure/Listener.spec.ts index e4db455f94..38a5f84b59 100644 --- a/e2e/infrastructure/Listener.spec.ts +++ b/e2e/infrastructure/Listener.spec.ts @@ -25,10 +25,10 @@ import { MosaicId } from '../../src/model/mosaic/MosaicId'; import { NetworkCurrencyMosaic } from '../../src/model/mosaic/NetworkCurrencyMosaic'; import { NamespaceId } from '../../src/model/namespace/NamespaceId'; import { AggregateTransaction } from '../../src/model/transaction/AggregateTransaction'; +import { CosignatoryModificationAction } from '../../src/model/transaction/CosignatoryModificationAction'; import { Deadline } from '../../src/model/transaction/Deadline'; -import { ModifyMultisigAccountTransaction } from '../../src/model/transaction/ModifyMultisigAccountTransaction'; +import { MultisigAccountModificationTransaction } from '../../src/model/transaction/MultisigAccountModificationTransaction'; import { MultisigCosignatoryModification } from '../../src/model/transaction/MultisigCosignatoryModification'; -import { MultisigCosignatoryModificationType } from '../../src/model/transaction/MultisigCosignatoryModificationType'; import { PlainMessage } from '../../src/model/transaction/PlainMessage'; import { TransferTransaction } from '../../src/model/transaction/TransferTransaction'; import { TransactionUtils } from './TransactionUtils'; @@ -203,7 +203,7 @@ describe('Listener', () => { }); }); - describe('ModifyMultisigAccountTransaction - Create multisig account', () => { + describe('MultisigAccountModificationTransaction - Create multisig account', () => { let listener: Listener; before (() => { listener = new Listener(config.apiUrl); @@ -212,14 +212,14 @@ describe('Listener', () => { after(() => { return listener.close(); }); - it('ModifyMultisigAccountTransaction', (done) => { - const modifyMultisigAccountTransaction = ModifyMultisigAccountTransaction.create( + it('MultisigAccountModificationTransaction', (done) => { + const modifyMultisigAccountTransaction = MultisigAccountModificationTransaction.create( Deadline.create(), 2, 1, - [ new MultisigCosignatoryModification(MultisigCosignatoryModificationType.Add, cosignAccount1.publicAccount), - new MultisigCosignatoryModification(MultisigCosignatoryModificationType.Add, cosignAccount2.publicAccount), - new MultisigCosignatoryModification(MultisigCosignatoryModificationType.Add, cosignAccount3.publicAccount), + [ new MultisigCosignatoryModification(CosignatoryModificationAction.Add, cosignAccount1.publicAccount), + new MultisigCosignatoryModification(CosignatoryModificationAction.Add, cosignAccount2.publicAccount), + new MultisigCosignatoryModification(CosignatoryModificationAction.Add, cosignAccount3.publicAccount), ], NetworkType.MIJIN_TEST, ); @@ -347,7 +347,7 @@ describe('Listener', () => { }); }); - describe('ModifyMultisigAccountTransaction - Restore multisig Accounts', () => { + describe('MultisigAccountModificationTransaction - Restore multisig Accounts', () => { let listener: Listener; before (() => { listener = new Listener(config.apiUrl); @@ -357,28 +357,28 @@ describe('Listener', () => { return listener.close(); }); it('Restore Multisig Account', (done) => { - const removeCosigner1 = ModifyMultisigAccountTransaction.create( + const removeCosigner1 = MultisigAccountModificationTransaction.create( Deadline.create(), -1, 0, - [ new MultisigCosignatoryModification(MultisigCosignatoryModificationType.Remove, cosignAccount1.publicAccount), + [ new MultisigCosignatoryModification(CosignatoryModificationAction.Remove, cosignAccount1.publicAccount), ], NetworkType.MIJIN_TEST, ); - const removeCosigner2 = ModifyMultisigAccountTransaction.create( + const removeCosigner2 = MultisigAccountModificationTransaction.create( Deadline.create(), 0, 0, - [ new MultisigCosignatoryModification(MultisigCosignatoryModificationType.Remove, cosignAccount2.publicAccount), + [ new MultisigCosignatoryModification(CosignatoryModificationAction.Remove, cosignAccount2.publicAccount), ], NetworkType.MIJIN_TEST, ); - const removeCosigner3 = ModifyMultisigAccountTransaction.create( + const removeCosigner3 = MultisigAccountModificationTransaction.create( Deadline.create(), -1, -1, - [ new MultisigCosignatoryModification(MultisigCosignatoryModificationType.Remove, cosignAccount3.publicAccount), + [ new MultisigCosignatoryModification(CosignatoryModificationAction.Remove, cosignAccount3.publicAccount), ], NetworkType.MIJIN_TEST, ); @@ -438,4 +438,4 @@ describe('Listener', () => { TransactionUtils.createAndAnnounce(account, account.address, transactionHttp, undefined, generationHash); }); }); -}); \ No newline at end of file +}); diff --git a/e2e/infrastructure/MosaicHttp.spec.ts b/e2e/infrastructure/MosaicHttp.spec.ts index 37717636aa..42500ef042 100644 --- a/e2e/infrastructure/MosaicHttp.spec.ts +++ b/e2e/infrastructure/MosaicHttp.spec.ts @@ -26,7 +26,7 @@ import {NamespaceId} from '../../src/model/namespace/NamespaceId'; import { Deadline } from '../../src/model/transaction/Deadline'; import { MosaicAliasTransaction } from '../../src/model/transaction/MosaicAliasTransaction'; import { MosaicDefinitionTransaction } from '../../src/model/transaction/MosaicDefinitionTransaction'; -import { RegisterNamespaceTransaction } from '../../src/model/transaction/RegisterNamespaceTransaction'; +import { NamespaceRegistrationTransaction } from '../../src/model/transaction/NamespaceRegistrationTransaction'; import { UInt64 } from '../../src/model/UInt64'; describe('MosaicHttp', () => { @@ -98,9 +98,9 @@ describe('MosaicHttp', () => { after(() => { return listener.close(); }); - it('Announce RegisterNamespaceTransaction', (done) => { + it('Announce NamespaceRegistrationTransaction', (done) => { const namespaceName = 'root-test-namespace-' + Math.floor(Math.random() * 10000); - const registerNamespaceTransaction = RegisterNamespaceTransaction.createRootNamespace( + const registerNamespaceTransaction = NamespaceRegistrationTransaction.createRootNamespace( Deadline.create(), namespaceName, UInt64.fromUint(1000), diff --git a/e2e/infrastructure/NamespaceHttp.spec.ts b/e2e/infrastructure/NamespaceHttp.spec.ts index 5a33e7dd46..f6e7e6898e 100644 --- a/e2e/infrastructure/NamespaceHttp.spec.ts +++ b/e2e/infrastructure/NamespaceHttp.spec.ts @@ -25,7 +25,7 @@ import { AliasAction } from '../../src/model/namespace/AliasAction'; import { NamespaceId } from '../../src/model/namespace/NamespaceId'; import { AddressAliasTransaction } from '../../src/model/transaction/AddressAliasTransaction'; import { Deadline } from '../../src/model/transaction/Deadline'; -import { RegisterNamespaceTransaction } from '../../src/model/transaction/RegisterNamespaceTransaction'; +import { NamespaceRegistrationTransaction } from '../../src/model/transaction/NamespaceRegistrationTransaction'; import { UInt64 } from '../../src/model/UInt64'; describe('NamespaceHttp', () => { @@ -51,7 +51,7 @@ describe('NamespaceHttp', () => { done(); }); }); - describe('RegisterNamespaceTransaction', () => { + describe('NamespaceRegistrationTransaction', () => { let listener: Listener; before (() => { listener = new Listener(config.apiUrl); @@ -62,7 +62,7 @@ describe('NamespaceHttp', () => { }); it('standalone', (done) => { const namespaceName = 'root-test-namespace-' + Math.floor(Math.random() * 10000); - const registerNamespaceTransaction = RegisterNamespaceTransaction.createRootNamespace( + const registerNamespaceTransaction = NamespaceRegistrationTransaction.createRootNamespace( Deadline.create(), namespaceName, UInt64.fromUint(1000), diff --git a/e2e/infrastructure/TransactionHttp.spec.ts b/e2e/infrastructure/TransactionHttp.spec.ts index ff7e1952eb..80a86a52fc 100644 --- a/e2e/infrastructure/TransactionHttp.spec.ts +++ b/e2e/infrastructure/TransactionHttp.spec.ts @@ -26,14 +26,14 @@ import {Listener} from '../../src/infrastructure/Listener'; import {TransactionHttp} from '../../src/infrastructure/TransactionHttp'; import {Account} from '../../src/model/account/Account'; import { AccountRestrictionType } from '../../src/model/account/AccountRestrictionType'; -import { RestrictionModificationType } from '../../src/model/account/RestrictionModificationType'; +import { AccountRestrictionModificationAction } from '../../src/model/account/AccountRestrictionModificationAction'; import {NetworkType} from '../../src/model/blockchain/NetworkType'; import { Mosaic } from '../../src/model/mosaic/Mosaic'; import {MosaicId} from '../../src/model/mosaic/MosaicId'; import {MosaicNonce} from '../../src/model/mosaic/MosaicNonce'; import {MosaicProperties} from '../../src/model/mosaic/MosaicProperties'; import { MosaicRestrictionType } from '../../src/model/mosaic/MosaicRestrictionType'; -import {MosaicSupplyType} from '../../src/model/mosaic/MosaicSupplyType'; +import {MosaicSupplyChangeAction} from '../../src/model/mosaic/MosaicSupplyChangeAction'; import {NetworkCurrencyMosaic} from '../../src/model/mosaic/NetworkCurrencyMosaic'; import { AliasAction } from '../../src/model/namespace/AliasAction'; import { NamespaceId } from '../../src/model/namespace/NamespaceId'; @@ -60,8 +60,8 @@ import { MosaicGlobalRestrictionTransaction } from '../../src/model/transaction/ import { MosaicMetadataTransaction } from '../../src/model/transaction/MosaicMetadataTransaction'; import {MosaicSupplyChangeTransaction} from '../../src/model/transaction/MosaicSupplyChangeTransaction'; import { NamespaceMetadataTransaction } from '../../src/model/transaction/NamespaceMetadataTransaction'; +import {NamespaceRegistrationTransaction} from '../../src/model/transaction/NamespaceRegistrationTransaction'; import { PlainMessage } from '../../src/model/transaction/PlainMessage'; -import {RegisterNamespaceTransaction} from '../../src/model/transaction/RegisterNamespaceTransaction'; import {SecretLockTransaction} from '../../src/model/transaction/SecretLockTransaction'; import {SecretProofTransaction} from '../../src/model/transaction/SecretProofTransaction'; import { SignedTransaction } from '../../src/model/transaction/SignedTransaction'; @@ -299,7 +299,7 @@ describe('TransactionHttp', () => { }); }); - describe('RegisterNamespaceTransaction', () => { + describe('NamespaceRegistrationTransaction', () => { let listener: Listener; before (() => { listener = new Listener(config.apiUrl); @@ -310,7 +310,7 @@ describe('TransactionHttp', () => { }); it('standalone', (done) => { const namespaceName = 'root-test-namespace-' + Math.floor(Math.random() * 10000); - const registerNamespaceTransaction = RegisterNamespaceTransaction.createRootNamespace( + const registerNamespaceTransaction = NamespaceRegistrationTransaction.createRootNamespace( Deadline.create(), namespaceName, UInt64.fromUint(1000), @@ -318,10 +318,10 @@ describe('TransactionHttp', () => { ); namespaceId = new NamespaceId(namespaceName); const signedTransaction = registerNamespaceTransaction.signWith(account, generationHash); - listener.confirmed(account.address).subscribe((transaction: RegisterNamespaceTransaction) => { + listener.confirmed(account.address).subscribe((transaction: NamespaceRegistrationTransaction) => { expect(transaction.namespaceId, 'NamespaceId').not.to.be.undefined; expect(transaction.namespaceName, 'NamespaceName').not.to.be.undefined; - expect(transaction.namespaceType, 'NamespaceType').not.to.be.undefined; + expect(transaction.namespaceType, 'NamespaceRegistrationType').not.to.be.undefined; done(); }); listener.status(account.address).subscribe((error) => { @@ -333,7 +333,7 @@ describe('TransactionHttp', () => { }); }); - describe('RegisterNamespaceTransaction', () => { + describe('NamespaceRegistrationTransaction', () => { let listener: Listener; before (() => { listener = new Listener(config.apiUrl); @@ -343,7 +343,7 @@ describe('TransactionHttp', () => { return listener.close(); }); it('aggregate', (done) => { - const registerNamespaceTransaction = RegisterNamespaceTransaction.createRootNamespace( + const registerNamespaceTransaction = NamespaceRegistrationTransaction.createRootNamespace( Deadline.create(), 'root-test-namespace-' + Math.floor(Math.random() * 10000), UInt64.fromUint(1000), @@ -602,7 +602,7 @@ describe('TransactionHttp', () => { it('standalone', (done) => { const addressRestrictionFilter = AccountRestrictionModification.createForAddress( - RestrictionModificationType.Add, + AccountRestrictionModificationAction.Add, account3.address, ); const addressModification = AccountRestrictionTransaction.createAddressRestrictionModificationTransaction( @@ -639,7 +639,7 @@ describe('TransactionHttp', () => { }); it('aggregate', (done) => { const addressRestrictionFilter = AccountRestrictionModification.createForAddress( - RestrictionModificationType.Remove, + AccountRestrictionModificationAction.Remove, account3.address, ); const addressModification = AccountRestrictionTransaction.createAddressRestrictionModificationTransaction( @@ -678,7 +678,7 @@ describe('TransactionHttp', () => { it('standalone', (done) => { const addressRestrictionFilter = AccountRestrictionModification.createForAddress( - RestrictionModificationType.Add, + AccountRestrictionModificationAction.Add, account3.address, ); const addressModification = AccountRestrictionTransaction.createAddressRestrictionModificationTransaction( @@ -715,7 +715,7 @@ describe('TransactionHttp', () => { }); it('aggregate', (done) => { const addressRestrictionFilter = AccountRestrictionModification.createForAddress( - RestrictionModificationType.Remove, + AccountRestrictionModificationAction.Remove, account3.address, ); const addressModification = AccountRestrictionTransaction.createAddressRestrictionModificationTransaction( @@ -753,7 +753,7 @@ describe('TransactionHttp', () => { it('standalone', (done) => { const mosaicRestrictionFilter = AccountRestrictionModification.createForMosaic( - RestrictionModificationType.Add, + AccountRestrictionModificationAction.Add, mosaicId, ); const addressModification = AccountRestrictionTransaction.createMosaicRestrictionModificationTransaction( @@ -790,7 +790,7 @@ describe('TransactionHttp', () => { }); it('aggregate', (done) => { const mosaicRestrictionFilter = AccountRestrictionModification.createForMosaic( - RestrictionModificationType.Remove, + AccountRestrictionModificationAction.Remove, mosaicId, ); const addressModification = AccountRestrictionTransaction.createMosaicRestrictionModificationTransaction( @@ -828,7 +828,7 @@ describe('TransactionHttp', () => { it('standalone', (done) => { const operationRestrictionFilter = AccountRestrictionModification.createForOperation( - RestrictionModificationType.Add, + AccountRestrictionModificationAction.Add, TransactionType.LINK_ACCOUNT, ); const addressModification = AccountRestrictionTransaction.createOperationRestrictionModificationTransaction( @@ -865,7 +865,7 @@ describe('TransactionHttp', () => { }); it('aggregate', (done) => { const operationRestrictionFilter = AccountRestrictionModification.createForOperation( - RestrictionModificationType.Remove, + AccountRestrictionModificationAction.Remove, TransactionType.LINK_ACCOUNT, ); const addressModification = AccountRestrictionTransaction.createOperationRestrictionModificationTransaction( @@ -904,7 +904,7 @@ describe('TransactionHttp', () => { it('standalone', (done) => { const operationRestrictionFilter = AccountRestrictionModification.createForOperation( - RestrictionModificationType.Add, + AccountRestrictionModificationAction.Add, TransactionType.LINK_ACCOUNT, ); const addressModification = AccountRestrictionTransaction.createOperationRestrictionModificationTransaction( @@ -941,7 +941,7 @@ describe('TransactionHttp', () => { }); it('aggregate', (done) => { const operationRestrictionFilter = AccountRestrictionModification.createForOperation( - RestrictionModificationType.Remove, + AccountRestrictionModificationAction.Remove, TransactionType.LINK_ACCOUNT, ); const addressModification = AccountRestrictionTransaction.createOperationRestrictionModificationTransaction( @@ -1116,7 +1116,7 @@ describe('TransactionHttp', () => { const mosaicSupplyChangeTransaction = MosaicSupplyChangeTransaction.create( Deadline.create(), mosaicId, - MosaicSupplyType.Increase, + MosaicSupplyChangeAction.Increase, UInt64.fromUint(10), NetworkType.MIJIN_TEST, ); @@ -1148,7 +1148,7 @@ describe('TransactionHttp', () => { const mosaicSupplyChangeTransaction = MosaicSupplyChangeTransaction.create( Deadline.create(), mosaicId, - MosaicSupplyType.Increase, + MosaicSupplyChangeAction.Increase, UInt64.fromUint(10), NetworkType.MIJIN_TEST, ); diff --git a/e2e/infrastructure/TransactionUtils.ts b/e2e/infrastructure/TransactionUtils.ts index 0a3631f49a..b00e1ca55d 100644 --- a/e2e/infrastructure/TransactionUtils.ts +++ b/e2e/infrastructure/TransactionUtils.ts @@ -26,9 +26,9 @@ import {AggregateTransaction} from '../../src/model/transaction/AggregateTransac import {CosignatureTransaction} from '../../src/model/transaction/CosignatureTransaction'; import {Deadline} from '../../src/model/transaction/Deadline'; import { LockFundsTransaction } from '../../src/model/transaction/LockFundsTransaction'; -import { ModifyMultisigAccountTransaction } from '../../src/model/transaction/ModifyMultisigAccountTransaction'; +import { MultisigAccountModificationTransaction } from '../../src/model/transaction/MultisigAccountModificationTransaction'; import { MultisigCosignatoryModification } from '../../src/model/transaction/MultisigCosignatoryModification'; -import { MultisigCosignatoryModificationType } from '../../src/model/transaction/MultisigCosignatoryModificationType'; +import { CosignatoryModificationAction } from '../../src/model/transaction/CosignatoryModificationAction'; import {PlainMessage} from '../../src/model/transaction/PlainMessage'; import { SignedTransaction } from '../../src/model/transaction/SignedTransaction'; import {TransferTransaction} from '../../src/model/transaction/TransferTransaction'; @@ -103,15 +103,15 @@ export class TransactionUtils { transactionHttp.announceAggregateBondedCosignature(cosignatureSignedTransaction); } - public static createModifyMultisigAccountTransaction( account: Account, + public static createMultisigAccountModificationTransaction( account: Account, transactionHttp: TransactionHttp, generationHash: string) { - const modifyMultisig = ModifyMultisigAccountTransaction.create( + const modifyMultisig = MultisigAccountModificationTransaction.create( Deadline.create(), 2, 1, [new MultisigCosignatoryModification( - MultisigCosignatoryModificationType.Add, + CosignatoryModificationAction.Add, PublicAccount.createFromPublicKey(account.publicKey, NetworkType.MIJIN_TEST), )], NetworkType.MIJIN_TEST, diff --git a/e2e/infrastructure/transaction/CreateTransactionFromDTO.spec.ts b/e2e/infrastructure/transaction/CreateTransactionFromDTO.spec.ts index 7f9a802332..15da95bcd9 100644 --- a/e2e/infrastructure/transaction/CreateTransactionFromDTO.spec.ts +++ b/e2e/infrastructure/transaction/CreateTransactionFromDTO.spec.ts @@ -175,7 +175,7 @@ describe('CreateTransactionFromDTO', () => { }); }); - describe('RegisterNamespaceTransaction', () => { + describe('NamespaceRegistrationTransaction', () => { describe('namespace', () => { it('standalone', () => { const registerNamespaceTransactionDTO = { @@ -222,7 +222,7 @@ describe('CreateTransactionFromDTO', () => { }); it('aggregate', () => { - const aggregateRegisterNamespaceTransactionDTO = { + const aggregateNamespaceRegistrationTransactionDTO = { meta: { hash: '671653C94E2254F2A23EFEDB15D67C38332AED1FBD24B063C0A8E675582B6A96', height: [ @@ -286,12 +286,12 @@ describe('CreateTransactionFromDTO', () => { }, }; - const aggregateRegisterNamespaceTransaction = CreateTransactionFromDTO( - aggregateRegisterNamespaceTransactionDTO, + const aggregateNamespaceRegistrationTransaction = CreateTransactionFromDTO( + aggregateNamespaceRegistrationTransactionDTO, ); ValidateTransaction.validateAggregateTx( - aggregateRegisterNamespaceTransaction, aggregateRegisterNamespaceTransactionDTO); + aggregateNamespaceRegistrationTransaction, aggregateNamespaceRegistrationTransactionDTO); }); }); @@ -340,7 +340,7 @@ describe('CreateTransactionFromDTO', () => { }); it('aggregate', () => { - const aggregateRegisterNamespaceTransactionDTO = { + const aggregateNamespaceRegistrationTransactionDTO = { meta: { hash: '671653C94E2254F2A23EFEDB15D67C38332AED1FBD24B063C0A8E675582B6A96', height: [ @@ -404,11 +404,11 @@ describe('CreateTransactionFromDTO', () => { }, }; - const aggregateRegisterNamespaceTransaction = CreateTransactionFromDTO( - aggregateRegisterNamespaceTransactionDTO); + const aggregateNamespaceRegistrationTransaction = CreateTransactionFromDTO( + aggregateNamespaceRegistrationTransactionDTO); ValidateTransaction.validateAggregateTx( - aggregateRegisterNamespaceTransaction, aggregateRegisterNamespaceTransactionDTO); + aggregateNamespaceRegistrationTransaction, aggregateNamespaceRegistrationTransactionDTO); }); }); }); @@ -565,11 +565,11 @@ describe('CreateTransactionFromDTO', () => { }, }; - const aggregateRegisterNamespaceTransaction = CreateTransactionFromDTO( + const aggregateNamespaceRegistrationTransaction = CreateTransactionFromDTO( aggregateMosaicDefinitionTransactionDTO); ValidateTransaction.validateAggregateTx( - aggregateRegisterNamespaceTransaction, aggregateMosaicDefinitionTransactionDTO); + aggregateNamespaceRegistrationTransaction, aggregateMosaicDefinitionTransactionDTO); }); }); @@ -689,7 +689,7 @@ describe('CreateTransactionFromDTO', () => { }); }); - describe('ModifyMultisigAccountTransaction', () => { + describe('MultisigAccountModificationTransaction', () => { it('standalone', () => { const modifyMultisigAccountTransactionDTO = { meta: { @@ -734,7 +734,7 @@ describe('CreateTransactionFromDTO', () => { }); it('aggregate', () => { - const aggregateModifyMultisigAccountTransactionDTO = { + const aggregateMultisigAccountModificationTransactionDTO = { meta: { hash: '671653C94E2254F2A23EFEDB15D67C38332AED1FBD24B063C0A8E675582B6A96', height: [ @@ -797,11 +797,11 @@ describe('CreateTransactionFromDTO', () => { }, }; - const aggregateModifyMultisigAccountTransaction = CreateTransactionFromDTO( - aggregateModifyMultisigAccountTransactionDTO); + const aggregateMultisigAccountModificationTransaction = CreateTransactionFromDTO( + aggregateMultisigAccountModificationTransactionDTO); ValidateTransaction.validateAggregateTx( - aggregateModifyMultisigAccountTransaction, aggregateModifyMultisigAccountTransactionDTO); + aggregateMultisigAccountModificationTransaction, aggregateMultisigAccountModificationTransactionDTO); }); }); }); diff --git a/src/infrastructure/Listener.ts b/src/infrastructure/Listener.ts index fb631222f5..753b4cc454 100644 --- a/src/infrastructure/Listener.ts +++ b/src/infrastructure/Listener.ts @@ -24,12 +24,12 @@ import {NetworkType} from '../model/blockchain/NetworkType'; import {NamespaceId} from '../model/namespace/NamespaceId'; import {AggregateTransaction} from '../model/transaction/AggregateTransaction'; import {AggregateTransactionCosignature} from '../model/transaction/AggregateTransactionCosignature'; +import {CosignatoryModificationAction} from '../model/transaction/CosignatoryModificationAction'; import {CosignatureSignedTransaction} from '../model/transaction/CosignatureSignedTransaction'; import {Deadline} from '../model/transaction/Deadline'; import {InnerTransaction} from '../model/transaction/InnerTransaction'; -import {ModifyMultisigAccountTransaction} from '../model/transaction/ModifyMultisigAccountTransaction'; +import {MultisigAccountModificationTransaction} from '../model/transaction/MultisigAccountModificationTransaction'; import {MultisigCosignatoryModification} from '../model/transaction/MultisigCosignatoryModification'; -import {MultisigCosignatoryModificationType} from '../model/transaction/MultisigCosignatoryModificationType'; import {Transaction} from '../model/transaction/Transaction'; import {TransactionStatusError} from '../model/transaction/TransactionStatusError'; import {TransferTransaction} from '../model/transaction/TransferTransaction'; @@ -407,9 +407,9 @@ export class Listener { */ // tslint:disable-next-line:adjacent-overload-signatures private accountAddedToMultiSig(transaction: Transaction, address: Address): boolean { - if (transaction instanceof ModifyMultisigAccountTransaction) { + if (transaction instanceof MultisigAccountModificationTransaction) { transaction.modifications.map((_: MultisigCosignatoryModification) => { - if (_.modificiationType === MultisigCosignatoryModificationType.Add && _.cosignatoryPublicAccount.address.equals(address)) { + if (_.modificiationType === CosignatoryModificationAction.Add && _.cosignatoryPublicAccount.address.equals(address)) { return true; } }); diff --git a/src/infrastructure/transaction/CreateTransactionFromDTO.ts b/src/infrastructure/transaction/CreateTransactionFromDTO.ts index 27d698a4bb..0f4b8cb204 100644 --- a/src/infrastructure/transaction/CreateTransactionFromDTO.ts +++ b/src/infrastructure/transaction/CreateTransactionFromDTO.ts @@ -38,17 +38,17 @@ import {Deadline} from '../../model/transaction/Deadline'; import { EncryptedMessage } from '../../model/transaction/EncryptedMessage'; import {LockFundsTransaction} from '../../model/transaction/LockFundsTransaction'; import { MessageType } from '../../model/transaction/MessageType'; -import {ModifyMultisigAccountTransaction} from '../../model/transaction/ModifyMultisigAccountTransaction'; import { MosaicAddressRestrictionTransaction } from '../../model/transaction/MosaicAddressRestrictionTransaction'; import {MosaicAliasTransaction} from '../../model/transaction/MosaicAliasTransaction'; import {MosaicDefinitionTransaction} from '../../model/transaction/MosaicDefinitionTransaction'; import { MosaicGlobalRestrictionTransaction } from '../../model/transaction/MosaicGlobalRestrictionTransaction'; import { MosaicMetadataTransaction } from '../../model/transaction/MosaicMetadataTransaction'; import {MosaicSupplyChangeTransaction} from '../../model/transaction/MosaicSupplyChangeTransaction'; +import {MultisigAccountModificationTransaction} from '../../model/transaction/MultisigAccountModificationTransaction'; import {MultisigCosignatoryModification} from '../../model/transaction/MultisigCosignatoryModification'; import { NamespaceMetadataTransaction } from '../../model/transaction/NamespaceMetadataTransaction'; +import {NamespaceRegistrationTransaction} from '../../model/transaction/NamespaceRegistrationTransaction'; import {EmptyMessage, PlainMessage} from '../../model/transaction/PlainMessage'; -import {RegisterNamespaceTransaction} from '../../model/transaction/RegisterNamespaceTransaction'; import {SecretLockTransaction} from '../../model/transaction/SecretLockTransaction'; import {SecretProofTransaction} from '../../model/transaction/SecretProofTransaction'; import {SignedTransaction} from '../../model/transaction/SignedTransaction'; @@ -141,7 +141,7 @@ const CreateStandaloneTransactionFromDTO = (transactionDTO, transactionInfo): Tr transactionInfo, ); } else if (transactionDTO.type === TransactionType.REGISTER_NAMESPACE) { - return new RegisterNamespaceTransaction( + return new NamespaceRegistrationTransaction( extractNetworkType(transactionDTO.version), extractTransactionVersion(transactionDTO.version), Deadline.createFromDTO(transactionDTO.deadline), @@ -190,7 +190,7 @@ const CreateStandaloneTransactionFromDTO = (transactionDTO, transactionInfo): Tr transactionInfo, ); } else if (transactionDTO.type === TransactionType.MODIFY_MULTISIG_ACCOUNT) { - return new ModifyMultisigAccountTransaction( + return new MultisigAccountModificationTransaction( extractNetworkType(transactionDTO.version), extractTransactionVersion(transactionDTO.version), Deadline.createFromDTO(transactionDTO.deadline), diff --git a/src/infrastructure/transaction/CreateTransactionFromPayload.ts b/src/infrastructure/transaction/CreateTransactionFromPayload.ts index 20b0410151..386c17c26b 100644 --- a/src/infrastructure/transaction/CreateTransactionFromPayload.ts +++ b/src/infrastructure/transaction/CreateTransactionFromPayload.ts @@ -25,15 +25,15 @@ import { AccountOperationRestrictionTransaction } from '../../model/transaction/ import { AddressAliasTransaction } from '../../model/transaction/AddressAliasTransaction'; import { AggregateTransaction } from '../../model/transaction/AggregateTransaction'; import { LockFundsTransaction } from '../../model/transaction/LockFundsTransaction'; -import { ModifyMultisigAccountTransaction } from '../../model/transaction/ModifyMultisigAccountTransaction'; import { MosaicAddressRestrictionTransaction } from '../../model/transaction/MosaicAddressRestrictionTransaction'; import { MosaicAliasTransaction } from '../../model/transaction/MosaicAliasTransaction'; import { MosaicDefinitionTransaction } from '../../model/transaction/MosaicDefinitionTransaction'; import { MosaicGlobalRestrictionTransaction } from '../../model/transaction/MosaicGlobalRestrictionTransaction'; import { MosaicMetadataTransaction } from '../../model/transaction/MosaicMetadataTransaction'; import { MosaicSupplyChangeTransaction } from '../../model/transaction/MosaicSupplyChangeTransaction'; +import { MultisigAccountModificationTransaction } from '../../model/transaction/MultisigAccountModificationTransaction'; import { NamespaceMetadataTransaction } from '../../model/transaction/NamespaceMetadataTransaction'; -import { RegisterNamespaceTransaction } from '../../model/transaction/RegisterNamespaceTransaction'; +import { NamespaceRegistrationTransaction } from '../../model/transaction/NamespaceRegistrationTransaction'; import { SecretLockTransaction } from '../../model/transaction/SecretLockTransaction'; import { SecretProofTransaction } from '../../model/transaction/SecretProofTransaction'; import { Transaction } from '../../model/transaction/Transaction'; @@ -80,7 +80,7 @@ export const CreateTransactionFromPayload = (payload: string, case TransactionType.MOSAIC_SUPPLY_CHANGE: return MosaicSupplyChangeTransaction.createFromPayload(payload, isEmbedded, signSchema); case TransactionType.REGISTER_NAMESPACE: - return RegisterNamespaceTransaction.createFromPayload(payload, isEmbedded, signSchema); + return NamespaceRegistrationTransaction.createFromPayload(payload, isEmbedded, signSchema); case TransactionType.TRANSFER: return TransferTransaction.createFromPayload(payload, isEmbedded, signSchema); case TransactionType.SECRET_LOCK: @@ -88,7 +88,7 @@ export const CreateTransactionFromPayload = (payload: string, case TransactionType.SECRET_PROOF: return SecretProofTransaction.createFromPayload(payload, isEmbedded, signSchema); case TransactionType.MODIFY_MULTISIG_ACCOUNT: - return ModifyMultisigAccountTransaction.createFromPayload(payload, isEmbedded, signSchema); + return MultisigAccountModificationTransaction.createFromPayload(payload, isEmbedded, signSchema); case TransactionType.LOCK: return LockFundsTransaction.createFromPayload(payload, isEmbedded, signSchema); case TransactionType.MOSAIC_GLOBAL_RESTRICTION: diff --git a/src/infrastructure/transaction/SerializeTransactionToJSON.ts b/src/infrastructure/transaction/SerializeTransactionToJSON.ts index 48fa73fee7..0a7a35ea6f 100644 --- a/src/infrastructure/transaction/SerializeTransactionToJSON.ts +++ b/src/infrastructure/transaction/SerializeTransactionToJSON.ts @@ -23,15 +23,15 @@ import { AccountOperationRestrictionTransaction } from '../../model/transaction/ import { AddressAliasTransaction } from '../../model/transaction/AddressAliasTransaction'; import { AggregateTransaction } from '../../model/transaction/AggregateTransaction'; import { LockFundsTransaction } from '../../model/transaction/LockFundsTransaction'; -import { ModifyMultisigAccountTransaction } from '../../model/transaction/ModifyMultisigAccountTransaction'; import { MosaicAddressRestrictionTransaction } from '../../model/transaction/MosaicAddressRestrictionTransaction'; import { MosaicAliasTransaction } from '../../model/transaction/MosaicAliasTransaction'; import { MosaicDefinitionTransaction } from '../../model/transaction/MosaicDefinitionTransaction'; import { MosaicGlobalRestrictionTransaction } from '../../model/transaction/MosaicGlobalRestrictionTransaction'; import { MosaicMetadataTransaction } from '../../model/transaction/MosaicMetadataTransaction'; import { MosaicSupplyChangeTransaction } from '../../model/transaction/MosaicSupplyChangeTransaction'; +import { MultisigAccountModificationTransaction } from '../../model/transaction/MultisigAccountModificationTransaction'; import { NamespaceMetadataTransaction } from '../../model/transaction/NamespaceMetadataTransaction'; -import { RegisterNamespaceTransaction } from '../../model/transaction/RegisterNamespaceTransaction'; +import { NamespaceRegistrationTransaction } from '../../model/transaction/NamespaceRegistrationTransaction'; import { SecretLockTransaction } from '../../model/transaction/SecretLockTransaction'; import { SecretProofTransaction } from '../../model/transaction/SecretProofTransaction'; import { Transaction } from '../../model/transaction/Transaction'; @@ -99,9 +99,9 @@ export const SerializeTransactionToJSON = (transaction: Transaction): any => { }; case TransactionType.MODIFY_MULTISIG_ACCOUNT: return { - minApprovalDelta: (transaction as ModifyMultisigAccountTransaction).minApprovalDelta, - minRemovalDelta: (transaction as ModifyMultisigAccountTransaction).minRemovalDelta, - modifications: (transaction as ModifyMultisigAccountTransaction).modifications.map((modification) => { + minApprovalDelta: (transaction as MultisigAccountModificationTransaction).minApprovalDelta, + minRemovalDelta: (transaction as MultisigAccountModificationTransaction).minRemovalDelta, + modifications: (transaction as MultisigAccountModificationTransaction).modifications.map((modification) => { return modification.toDTO(); }), }; @@ -124,13 +124,13 @@ export const SerializeTransactionToJSON = (transaction: Transaction): any => { delta: (transaction as MosaicSupplyChangeTransaction).delta.toDTO(), }; case TransactionType.REGISTER_NAMESPACE: - const registerNamespaceDuration = (transaction as RegisterNamespaceTransaction).duration; - const registerNamespaceParentId = (transaction as RegisterNamespaceTransaction).parentId; + const registerNamespaceDuration = (transaction as NamespaceRegistrationTransaction).duration; + const registerNamespaceParentId = (transaction as NamespaceRegistrationTransaction).parentId; const jsonObject = { - namespaceType: (transaction as RegisterNamespaceTransaction).namespaceType, - namespaceName: (transaction as RegisterNamespaceTransaction).namespaceName, - namespaceId: (transaction as RegisterNamespaceTransaction).namespaceId.toDTO(), + namespaceType: (transaction as NamespaceRegistrationTransaction).namespaceType, + namespaceName: (transaction as NamespaceRegistrationTransaction).namespaceName, + namespaceId: (transaction as NamespaceRegistrationTransaction).namespaceId.toDTO(), }; if (registerNamespaceDuration) { diff --git a/src/model/account/RestrictionModificationType.ts b/src/model/account/AccountRestrictionModificationAction.ts similarity index 92% rename from src/model/account/RestrictionModificationType.ts rename to src/model/account/AccountRestrictionModificationAction.ts index a9aa625500..69fde53404 100644 --- a/src/model/account/RestrictionModificationType.ts +++ b/src/model/account/AccountRestrictionModificationAction.ts @@ -17,7 +17,7 @@ /** * Account restriction modification type */ -export enum RestrictionModificationType { +export enum AccountRestrictionModificationAction { Add = 0x01, Remove = 0x00, } diff --git a/src/model/model.ts b/src/model/model.ts index c825aa96ef..8810f2ab73 100644 --- a/src/model/model.ts +++ b/src/model/model.ts @@ -27,7 +27,7 @@ export * from './account/PublicAccount'; export * from './account/AccountRestrictions'; export * from './account/AccountRestrictionsInfo'; export * from './account/AccountRestriction'; -export * from './account/RestrictionModificationType'; +export * from './account/AccountRestrictionModificationAction'; export * from './account/AccountRestrictionType'; export * from './account/AccountNames'; @@ -48,7 +48,7 @@ export * from './mosaic/Mosaic'; export * from './mosaic/MosaicInfo'; export * from './mosaic/MosaicId'; export * from './mosaic/MosaicNonce'; -export * from './mosaic/MosaicSupplyType'; +export * from './mosaic/MosaicSupplyChangeAction'; export * from './mosaic/MosaicProperties'; export * from '../service/MosaicView'; export * from '../service/MosaicAmountView'; @@ -67,7 +67,7 @@ export * from './namespace/MosaicAlias'; export * from './namespace/NamespaceId'; export * from './namespace/NamespaceInfo'; export * from './namespace/NamespaceName'; -export * from './namespace/NamespaceType'; +export * from './namespace/NamespaceRegistrationType'; export * from './namespace/AliasAction'; // Node @@ -95,7 +95,7 @@ export * from './transaction/AccountLinkTransaction'; export * from './transaction/AccountRestrictionTransaction'; export * from './transaction/AccountAddressRestrictionTransaction'; export * from './transaction/AccountMosaicRestrictionTransaction'; -export * from './transaction/AccountMosaicRestrictionTransaction'; +export * from './transaction/AccountOperationRestrictionTransaction'; export * from './transaction/AccountRestrictionModification'; export * from './transaction/AddressAliasTransaction'; export * from './transaction/AggregateTransaction'; @@ -112,14 +112,14 @@ export * from './transaction/InnerTransaction'; export * from './transaction/LinkAction'; export * from './transaction/LockFundsTransaction'; export * from './transaction/Message'; -export * from './transaction/ModifyMultisigAccountTransaction'; +export * from './transaction/MultisigAccountModificationTransaction'; export * from './transaction/MosaicAliasTransaction'; export * from './transaction/MosaicDefinitionTransaction'; export * from './transaction/MosaicSupplyChangeTransaction'; export * from './transaction/MultisigCosignatoryModification'; -export * from './transaction/MultisigCosignatoryModificationType'; +export * from './transaction/CosignatoryModificationAction'; export * from './transaction/PlainMessage'; -export * from './transaction/RegisterNamespaceTransaction'; +export * from './transaction/NamespaceRegistrationTransaction'; export * from './transaction/SecretLockTransaction'; export * from './transaction/SecretProofTransaction'; export * from './transaction/SignedTransaction'; diff --git a/src/model/mosaic/MosaicSupplyType.ts b/src/model/mosaic/MosaicSupplyChangeAction.ts similarity index 94% rename from src/model/mosaic/MosaicSupplyType.ts rename to src/model/mosaic/MosaicSupplyChangeAction.ts index 0f28e995b0..6c7fd26c7d 100644 --- a/src/model/mosaic/MosaicSupplyType.ts +++ b/src/model/mosaic/MosaicSupplyChangeAction.ts @@ -19,7 +19,7 @@ * 0: Increase in supply. * 1: Decrease in supply. */ -export enum MosaicSupplyType { +export enum MosaicSupplyChangeAction { Decrease = 0x00, Increase = 0x01, } diff --git a/src/model/namespace/NamespaceType.ts b/src/model/namespace/NamespaceRegistrationType.ts similarity index 94% rename from src/model/namespace/NamespaceType.ts rename to src/model/namespace/NamespaceRegistrationType.ts index fd793a0fc4..0a1eb91390 100644 --- a/src/model/namespace/NamespaceType.ts +++ b/src/model/namespace/NamespaceRegistrationType.ts @@ -19,7 +19,7 @@ * 0: Namespace. * 1: Sub namespace. */ -export enum NamespaceType { +export enum NamespaceRegistrationType { RootNamespace = 0, SubNamespace = 1, } diff --git a/src/model/transaction/AccountRestrictionModification.ts b/src/model/transaction/AccountRestrictionModification.ts index 599a61ae65..c928aa0515 100644 --- a/src/model/transaction/AccountRestrictionModification.ts +++ b/src/model/transaction/AccountRestrictionModification.ts @@ -14,8 +14,8 @@ * limitations under the License. */ +import { AccountRestrictionModificationAction } from '../account/AccountRestrictionModificationAction'; import { Address } from '../account/Address'; -import { RestrictionModificationType } from '../account/RestrictionModificationType'; import { MosaicId } from '../mosaic/MosaicId'; import { TransactionType } from './TransactionType'; @@ -30,7 +30,7 @@ export class AccountRestrictionModification { /** * Modification type. */ - public readonly modificationType: RestrictionModificationType, + public readonly modificationType: AccountRestrictionModificationAction, /** * Modification value (Address, Mosaic or Transaction Type). */ @@ -44,7 +44,7 @@ export class AccountRestrictionModification { * @param address - modification value (Address) * @returns {AccountRestrictionModification} */ - public static createForAddress(modificationType: RestrictionModificationType, + public static createForAddress(modificationType: AccountRestrictionModificationAction, address: Address): AccountRestrictionModification { return new AccountRestrictionModification(modificationType, address.plain()); } @@ -54,7 +54,7 @@ export class AccountRestrictionModification { * @param mosaicId - modification value (Mosaic) * @returns {AccountRestrictionModification} */ - public static createForMosaic(modificationType: RestrictionModificationType, + public static createForMosaic(modificationType: AccountRestrictionModificationAction, mosaicId: MosaicId): AccountRestrictionModification { return new AccountRestrictionModification(modificationType, mosaicId.id.toDTO()); } @@ -65,7 +65,7 @@ export class AccountRestrictionModification { * @param operation - modification value (Transaction Type) * @returns {AccountRestrictionModification} */ - public static createForOperation(modificationType: RestrictionModificationType, + public static createForOperation(modificationType: AccountRestrictionModificationAction, operation: number): AccountRestrictionModification { return new AccountRestrictionModification(modificationType, operation); } diff --git a/src/model/transaction/MultisigCosignatoryModificationType.ts b/src/model/transaction/CosignatoryModificationAction.ts similarity index 93% rename from src/model/transaction/MultisigCosignatoryModificationType.ts rename to src/model/transaction/CosignatoryModificationAction.ts index 2edfa42d01..848a405f00 100644 --- a/src/model/transaction/MultisigCosignatoryModificationType.ts +++ b/src/model/transaction/CosignatoryModificationAction.ts @@ -19,7 +19,7 @@ * 0: Add cosignatory. * 1: Remove cosignatory. */ -export enum MultisigCosignatoryModificationType { +export enum CosignatoryModificationAction { Add = 0x01, Remove = 0x00, } diff --git a/src/model/transaction/MosaicSupplyChangeTransaction.ts b/src/model/transaction/MosaicSupplyChangeTransaction.ts index e479f7d028..cb241ba6e8 100644 --- a/src/model/transaction/MosaicSupplyChangeTransaction.ts +++ b/src/model/transaction/MosaicSupplyChangeTransaction.ts @@ -26,7 +26,7 @@ import { UnresolvedMosaicIdDto } from '../../infrastructure/catbuffer/Unresolved import { PublicAccount } from '../account/PublicAccount'; import { NetworkType } from '../blockchain/NetworkType'; import { MosaicId } from '../mosaic/MosaicId'; -import { MosaicSupplyType } from '../mosaic/MosaicSupplyType'; +import { MosaicSupplyChangeAction } from '../mosaic/MosaicSupplyChangeAction'; import { UInt64 } from '../UInt64'; import { Deadline } from './Deadline'; import { InnerTransaction } from './InnerTransaction'; @@ -53,7 +53,7 @@ export class MosaicSupplyChangeTransaction extends Transaction { */ public static create(deadline: Deadline, mosaicId: MosaicId, - direction: MosaicSupplyType, + direction: MosaicSupplyChangeAction, delta: UInt64, networkType: NetworkType, maxFee: UInt64 = new UInt64([0, 0])): MosaicSupplyChangeTransaction { @@ -90,7 +90,7 @@ export class MosaicSupplyChangeTransaction extends Transaction { /** * The supply type. */ - public readonly direction: MosaicSupplyType, + public readonly direction: MosaicSupplyChangeAction, /** * The supply change in units for the mosaic. */ diff --git a/src/model/transaction/ModifyMultisigAccountTransaction.ts b/src/model/transaction/MultisigAccountModificationTransaction.ts similarity index 95% rename from src/model/transaction/ModifyMultisigAccountTransaction.ts rename to src/model/transaction/MultisigAccountModificationTransaction.ts index c278cc49d8..6a754b69f8 100644 --- a/src/model/transaction/ModifyMultisigAccountTransaction.ts +++ b/src/model/transaction/MultisigAccountModificationTransaction.ts @@ -40,7 +40,7 @@ import { TransactionVersion } from './TransactionVersion'; * min number of signatures to approve a transaction and a min number of signatures to remove a cosignatory. * @since 1.0 */ -export class ModifyMultisigAccountTransaction extends Transaction { +export class MultisigAccountModificationTransaction extends Transaction { /** * Create a modify multisig account transaction object @@ -50,15 +50,15 @@ export class ModifyMultisigAccountTransaction extends Transaction { * @param modifications - The array of modifications. * @param networkType - The network type. * @param maxFee - (Optional) Max fee defined by the sender - * @returns {ModifyMultisigAccountTransaction} + * @returns {MultisigAccountModificationTransaction} */ public static create(deadline: Deadline, minApprovalDelta: number, minRemovalDelta: number, modifications: MultisigCosignatoryModification[], networkType: NetworkType, - maxFee: UInt64 = new UInt64([0, 0])): ModifyMultisigAccountTransaction { - return new ModifyMultisigAccountTransaction(networkType, + maxFee: UInt64 = new UInt64([0, 0])): MultisigAccountModificationTransaction { + return new MultisigAccountModificationTransaction(networkType, TransactionVersion.MODIFY_MULTISIG_ACCOUNT, deadline, maxFee, @@ -117,7 +117,7 @@ export class ModifyMultisigAccountTransaction extends Transaction { MultisigAccountModificationTransactionBuilder.loadFromBinary(Convert.hexToUint8(payload)); const signer = Convert.uint8ToHex(builder.getSignerPublicKey().key); const networkType = Convert.hexToUint8(builder.getVersion().toString(16))[0]; - const transaction = ModifyMultisigAccountTransaction.create( + const transaction = MultisigAccountModificationTransaction.create( isEmbedded ? Deadline.create() : Deadline.createFromDTO( (builder as MultisigAccountModificationTransactionBuilder).getDeadline().timestamp), builder.getMinApprovalDelta(), @@ -139,9 +139,9 @@ export class ModifyMultisigAccountTransaction extends Transaction { /** * @override Transaction.size() - * @description get the byte size of a ModifyMultisigAccountTransaction + * @description get the byte size of a MultisigAccountModificationTransaction * @returns {number} - * @memberof ModifyMultisigAccountTransaction + * @memberof MultisigAccountModificationTransaction */ public get size(): number { const byteSize = super.size; diff --git a/src/model/transaction/MultisigCosignatoryModification.ts b/src/model/transaction/MultisigCosignatoryModification.ts index e0d45b99d5..649a8146c0 100644 --- a/src/model/transaction/MultisigCosignatoryModification.ts +++ b/src/model/transaction/MultisigCosignatoryModification.ts @@ -15,7 +15,7 @@ */ import {PublicAccount} from '../account/PublicAccount'; -import {MultisigCosignatoryModificationType} from './MultisigCosignatoryModificationType'; +import {CosignatoryModificationAction} from './CosignatoryModificationAction'; /** * Multisig cosignatory modifications are part of the NEM's multisig account system. @@ -34,7 +34,7 @@ export class MultisigCosignatoryModification { /** * Multi-signature modification type. */ - public readonly modificiationType: MultisigCosignatoryModificationType, + public readonly modificiationType: CosignatoryModificationAction, /** * Cosignatory public account. */ diff --git a/src/model/transaction/RegisterNamespaceTransaction.ts b/src/model/transaction/NamespaceRegistrationTransaction.ts similarity index 90% rename from src/model/transaction/RegisterNamespaceTransaction.ts rename to src/model/transaction/NamespaceRegistrationTransaction.ts index ea0509f778..e7355f24d0 100644 --- a/src/model/transaction/RegisterNamespaceTransaction.ts +++ b/src/model/transaction/NamespaceRegistrationTransaction.ts @@ -28,7 +28,7 @@ import {NamespaceMosaicIdGenerator} from '../../infrastructure/transaction/Names import { PublicAccount } from '../account/PublicAccount'; import { NetworkType } from '../blockchain/NetworkType'; import { NamespaceId } from '../namespace/NamespaceId'; -import { NamespaceType } from '../namespace/NamespaceType'; +import { NamespaceRegistrationType } from '../namespace/NamespaceRegistrationType'; import { UInt64 } from '../UInt64'; import { Deadline } from './Deadline'; import { InnerTransaction } from './InnerTransaction'; @@ -39,9 +39,9 @@ import { TransactionVersion } from './TransactionVersion'; /** * Accounts can rent a namespace for an amount of blocks and after a this renew the contract. - * This is done via a RegisterNamespaceTransaction. + * This is done via a NamespaceRegistrationTransaction. */ -export class RegisterNamespaceTransaction extends Transaction { +export class NamespaceRegistrationTransaction extends Transaction { /** * Create a root namespace object @@ -50,18 +50,18 @@ export class RegisterNamespaceTransaction extends Transaction { * @param duration - The duration of the namespace. * @param networkType - The network type. * @param maxFee - (Optional) Max fee defined by the sender - * @returns {RegisterNamespaceTransaction} + * @returns {NamespaceRegistrationTransaction} */ public static createRootNamespace(deadline: Deadline, namespaceName: string, duration: UInt64, networkType: NetworkType, - maxFee: UInt64 = new UInt64([0, 0])): RegisterNamespaceTransaction { - return new RegisterNamespaceTransaction(networkType, + maxFee: UInt64 = new UInt64([0, 0])): NamespaceRegistrationTransaction { + return new NamespaceRegistrationTransaction(networkType, TransactionVersion.REGISTER_NAMESPACE, deadline, maxFee, - NamespaceType.RootNamespace, + NamespaceRegistrationType.RootNamespace, namespaceName, new NamespaceId(namespaceName), duration, @@ -75,24 +75,24 @@ export class RegisterNamespaceTransaction extends Transaction { * @param parentNamespace - The parent namespace name. * @param networkType - The network type. * @param maxFee - (Optional) Max fee defined by the sender - * @returns {RegisterNamespaceTransaction} + * @returns {NamespaceRegistrationTransaction} */ public static createSubNamespace(deadline: Deadline, namespaceName: string, parentNamespace: string | NamespaceId, networkType: NetworkType, - maxFee: UInt64 = new UInt64([0, 0])): RegisterNamespaceTransaction { + maxFee: UInt64 = new UInt64([0, 0])): NamespaceRegistrationTransaction { let parentId: NamespaceId; if (typeof parentNamespace === 'string') { parentId = new NamespaceId(NamespaceMosaicIdGenerator.subnamespaceParentId(parentNamespace, namespaceName)); } else { parentId = parentNamespace; } - return new RegisterNamespaceTransaction(networkType, + return new NamespaceRegistrationTransaction(networkType, TransactionVersion.REGISTER_NAMESPACE, deadline, maxFee, - NamespaceType.SubNamespace, + NamespaceRegistrationType.SubNamespace, namespaceName, typeof parentNamespace === 'string' ? new NamespaceId(NamespaceMosaicIdGenerator.subnamespaceNamespaceId(parentNamespace, namespaceName)) : @@ -123,7 +123,7 @@ export class RegisterNamespaceTransaction extends Transaction { /** * The namespace type could be namespace or sub namespace */ - public readonly namespaceType: NamespaceType, + public readonly namespaceType: NamespaceRegistrationType, /** * The namespace name */ @@ -162,15 +162,15 @@ export class RegisterNamespaceTransaction extends Transaction { const namespaceType = builder.getRegistrationType().valueOf(); const signer = Convert.uint8ToHex(builder.getSignerPublicKey().key); const networkType = Convert.hexToUint8(builder.getVersion().toString(16))[0]; - const transaction = namespaceType === NamespaceType.RootNamespace ? - RegisterNamespaceTransaction.createRootNamespace( + const transaction = namespaceType === NamespaceRegistrationType.RootNamespace ? + NamespaceRegistrationTransaction.createRootNamespace( isEmbedded ? Deadline.create() : Deadline.createFromDTO( (builder as NamespaceRegistrationTransactionBuilder).getDeadline().timestamp), Convert.decodeHex(Convert.uint8ToHex(builder.getName())), new UInt64(builder.getDuration()!.blockDuration), networkType, isEmbedded ? new UInt64([0, 0]) : new UInt64((builder as NamespaceRegistrationTransactionBuilder).fee.amount), - ) : RegisterNamespaceTransaction.createSubNamespace( + ) : NamespaceRegistrationTransaction.createSubNamespace( isEmbedded ? Deadline.create() : Deadline.createFromDTO( (builder as NamespaceRegistrationTransactionBuilder).getDeadline().timestamp), Convert.decodeHex(Convert.uint8ToHex(builder.getName())), @@ -183,9 +183,9 @@ export class RegisterNamespaceTransaction extends Transaction { /** * @override Transaction.size() - * @description get the byte size of a RegisterNamespaceTransaction + * @description get the byte size of a NamespaceRegistrationTransaction * @returns {number} - * @memberof RegisterNamespaceTransaction + * @memberof NamespaceRegistrationTransaction */ public get size(): number { const byteSize = super.size; @@ -210,7 +210,7 @@ export class RegisterNamespaceTransaction extends Transaction { const signerBuffer = new Uint8Array(32); const signatureBuffer = new Uint8Array(64); let transactionBuilder: NamespaceRegistrationTransactionBuilder; - if (this.namespaceType === NamespaceType.RootNamespace) { + if (this.namespaceType === NamespaceRegistrationType.RootNamespace) { transactionBuilder = new NamespaceRegistrationTransactionBuilder( new SignatureDto(signatureBuffer), new KeyDto(signerBuffer), @@ -246,7 +246,7 @@ export class RegisterNamespaceTransaction extends Transaction { */ protected generateEmbeddedBytes(): Uint8Array { let transactionBuilder: EmbeddedNamespaceRegistrationTransactionBuilder; - if (this.namespaceType === NamespaceType.RootNamespace) { + if (this.namespaceType === NamespaceRegistrationType.RootNamespace) { transactionBuilder = new EmbeddedNamespaceRegistrationTransactionBuilder( new KeyDto(Convert.hexToUint8(this.signer!.publicKey)), this.versionToDTO(), diff --git a/src/service/AggregateTransactionService.ts b/src/service/AggregateTransactionService.ts index 98775221ce..73a2a7b8d1 100644 --- a/src/service/AggregateTransactionService.ts +++ b/src/service/AggregateTransactionService.ts @@ -21,8 +21,8 @@ import { AccountHttp } from '../infrastructure/AccountHttp'; import { MultisigAccountGraphInfo } from '../model/account/MultisigAccountGraphInfo'; import { AggregateTransaction } from '../model/transaction/AggregateTransaction'; import { InnerTransaction } from '../model/transaction/InnerTransaction'; -import { ModifyMultisigAccountTransaction } from '../model/transaction/ModifyMultisigAccountTransaction'; -import { MultisigCosignatoryModificationType } from '../model/transaction/MultisigCosignatoryModificationType'; +import { MultisigAccountModificationTransaction } from '../model/transaction/MultisigAccountModificationTransaction'; +import { CosignatoryModificationAction } from '../model/transaction/CosignatoryModificationAction'; import { SignedTransaction } from '../model/transaction/SignedTransaction'; import { TransactionType } from '../model/transaction/TransactionType'; @@ -98,8 +98,8 @@ export class AggregateTransactionService { * use minRemoval instead of minApproval for cosignatories validation. */ if (innerTransaction.type === TransactionType.MODIFY_MULTISIG_ACCOUNT) { - if ((innerTransaction as ModifyMultisigAccountTransaction).modifications - .find((modification) => modification.modificiationType === MultisigCosignatoryModificationType.Remove) !== undefined) { + if ((innerTransaction as MultisigAccountModificationTransaction).modifications + .find((modification) => modification.modificiationType === CosignatoryModificationAction.Remove) !== undefined) { isMultisigRemoval = true; } } diff --git a/test/core/utils/TransactionMapping.spec.ts b/test/core/utils/TransactionMapping.spec.ts index 53e7d8df9c..2d5cb4be71 100644 --- a/test/core/utils/TransactionMapping.spec.ts +++ b/test/core/utils/TransactionMapping.spec.ts @@ -20,20 +20,20 @@ import { sha3_256 } from 'js-sha3'; import {Convert as convert} from '../../../src/core/format'; import { TransactionMapping } from '../../../src/core/utils/TransactionMapping'; import { Account } from '../../../src/model/account/Account'; +import { AccountRestrictionModificationAction } from '../../../src/model/account/AccountRestrictionModificationAction'; import { AccountRestrictionType } from '../../../src/model/account/AccountRestrictionType'; import { Address } from '../../../src/model/account/Address'; import { PublicAccount } from '../../../src/model/account/PublicAccount'; -import { RestrictionModificationType } from '../../../src/model/account/RestrictionModificationType'; import { NetworkType } from '../../../src/model/blockchain/NetworkType'; import { MosaicId } from '../../../src/model/mosaic/MosaicId'; import { MosaicNonce } from '../../../src/model/mosaic/MosaicNonce'; import { MosaicProperties } from '../../../src/model/mosaic/MosaicProperties'; import { MosaicRestrictionType } from '../../../src/model/mosaic/MosaicRestrictionType'; -import { MosaicSupplyType } from '../../../src/model/mosaic/MosaicSupplyType'; +import { MosaicSupplyChangeAction } from '../../../src/model/mosaic/MosaicSupplyChangeAction'; import { NetworkCurrencyMosaic } from '../../../src/model/mosaic/NetworkCurrencyMosaic'; import { AliasAction } from '../../../src/model/namespace/AliasAction'; import { NamespaceId } from '../../../src/model/namespace/NamespaceId'; -import { NamespaceType } from '../../../src/model/namespace/NamespaceType'; +import { NamespaceRegistrationType } from '../../../src/model/namespace/NamespaceRegistrationType'; import { AccountAddressRestrictionTransaction } from '../../../src/model/transaction/AccountAddressRestrictionTransaction'; import { AccountLinkTransaction } from '../../../src/model/transaction/AccountLinkTransaction'; import { AccountMetadataTransaction } from '../../../src/model/transaction/AccountMetadataTransaction'; @@ -42,24 +42,24 @@ import { AccountRestrictionModification } from '../../../src/model/transaction/A import { AccountRestrictionTransaction } from '../../../src/model/transaction/AccountRestrictionTransaction'; import { AddressAliasTransaction } from '../../../src/model/transaction/AddressAliasTransaction'; import { AggregateTransaction } from '../../../src/model/transaction/AggregateTransaction'; +import { CosignatoryModificationAction } from '../../../src/model/transaction/CosignatoryModificationAction'; import { Deadline } from '../../../src/model/transaction/Deadline'; import { EncryptedMessage } from '../../../src/model/transaction/EncryptedMessage'; import { HashType } from '../../../src/model/transaction/HashType'; import { LinkAction } from '../../../src/model/transaction/LinkAction'; import { LockFundsTransaction } from '../../../src/model/transaction/LockFundsTransaction'; import { MessageType } from '../../../src/model/transaction/MessageType'; -import { ModifyMultisigAccountTransaction } from '../../../src/model/transaction/ModifyMultisigAccountTransaction'; import { MosaicAddressRestrictionTransaction } from '../../../src/model/transaction/MosaicAddressRestrictionTransaction'; import { MosaicAliasTransaction } from '../../../src/model/transaction/MosaicAliasTransaction'; import { MosaicDefinitionTransaction } from '../../../src/model/transaction/MosaicDefinitionTransaction'; import { MosaicGlobalRestrictionTransaction } from '../../../src/model/transaction/MosaicGlobalRestrictionTransaction'; import { MosaicMetadataTransaction } from '../../../src/model/transaction/MosaicMetadataTransaction'; import { MosaicSupplyChangeTransaction } from '../../../src/model/transaction/MosaicSupplyChangeTransaction'; +import { MultisigAccountModificationTransaction } from '../../../src/model/transaction/MultisigAccountModificationTransaction'; import { MultisigCosignatoryModification } from '../../../src/model/transaction/MultisigCosignatoryModification'; -import { MultisigCosignatoryModificationType } from '../../../src/model/transaction/MultisigCosignatoryModificationType'; import { NamespaceMetadataTransaction } from '../../../src/model/transaction/NamespaceMetadataTransaction'; +import { NamespaceRegistrationTransaction } from '../../../src/model/transaction/NamespaceRegistrationTransaction'; import { PlainMessage } from '../../../src/model/transaction/PlainMessage'; -import { RegisterNamespaceTransaction } from '../../../src/model/transaction/RegisterNamespaceTransaction'; import { SecretLockTransaction } from '../../../src/model/transaction/SecretLockTransaction'; import { SecretProofTransaction } from '../../../src/model/transaction/SecretProofTransaction'; import { TransactionType } from '../../../src/model/transaction/TransactionType' ; @@ -77,7 +77,7 @@ describe('TransactionMapping - createFromPayload', () => { it('should create AccountRestrictionAddressTransaction', () => { const address = Address.createFromRawAddress('SBILTA367K2LX2FEXG5TFWAS7GEFYAGY7QLFBYKC'); const addressRestrictionFilter = AccountRestrictionModification.createForAddress( - RestrictionModificationType.Add, + AccountRestrictionModificationAction.Add, address, ); const addressRestrictionTransaction = AccountRestrictionTransaction.createAddressRestrictionModificationTransaction( @@ -93,14 +93,14 @@ describe('TransactionMapping - createFromPayload', () => { .createFromPayload(signedTransaction.payload) as AccountAddressRestrictionTransaction; expect(transaction.restrictionType).to.be.equal(AccountRestrictionType.AllowIncomingAddress); - expect(transaction.modifications[0].modificationType).to.be.equal(RestrictionModificationType.Add); + expect(transaction.modifications[0].modificationType).to.be.equal(AccountRestrictionModificationAction.Add); expect(transaction.modifications[0].value).to.be.equal('SBILTA367K2LX2FEXG5TFWAS7GEFYAGY7QLFBYKC'); }); it('should create AccountRestrictionMosaicTransaction', () => { const mosaicId = new MosaicId([2262289484, 3405110546]); const mosaicRestrictionFilter = AccountRestrictionModification.createForMosaic( - RestrictionModificationType.Add, + AccountRestrictionModificationAction.Add, mosaicId, ); const mosaicRestrictionTransaction = AccountRestrictionTransaction.createMosaicRestrictionModificationTransaction( @@ -117,13 +117,13 @@ describe('TransactionMapping - createFromPayload', () => { expect(transaction.restrictionType).to.be.equal(AccountRestrictionType.AllowMosaic); expect(transaction.modifications[0].value[0]).to.be.equal(2262289484); expect(transaction.modifications[0].value[1]).to.be.equal(3405110546); - expect(transaction.modifications[0].modificationType).to.be.equal(RestrictionModificationType.Add); + expect(transaction.modifications[0].modificationType).to.be.equal(AccountRestrictionModificationAction.Add); }); it('should create AccountRestrictionOperationTransaction', () => { const operation = TransactionType.ADDRESS_ALIAS; const operationRestrictionFilter = AccountRestrictionModification.createForOperation( - RestrictionModificationType.Add, + AccountRestrictionModificationAction.Add, operation, ); const operationRestrictionTransaction = AccountRestrictionTransaction.createOperationRestrictionModificationTransaction( @@ -139,7 +139,7 @@ describe('TransactionMapping - createFromPayload', () => { .createFromPayload(signedTransaction.payload) as AccountAddressRestrictionTransaction; expect(transaction.restrictionType).to.be.equal(AccountRestrictionType.AllowIncomingTransactionType); expect(transaction.modifications[0].value).to.be.equal(operation); - expect(transaction.modifications[0].modificationType).to.be.equal(RestrictionModificationType.Add); + expect(transaction.modifications[0].modificationType).to.be.equal(AccountRestrictionModificationAction.Add); }); it('should create AddressAliasTransaction', () => { @@ -313,7 +313,7 @@ describe('TransactionMapping - createFromPayload', () => { const mosaicSupplyChangeTransaction = MosaicSupplyChangeTransaction.create( Deadline.create(), mosaicId, - MosaicSupplyType.Increase, + MosaicSupplyChangeAction.Increase, UInt64.fromUint(10), NetworkType.MIJIN_TEST, ); @@ -322,7 +322,7 @@ describe('TransactionMapping - createFromPayload', () => { const transaction = TransactionMapping.createFromPayload(signedTransaction.payload) as MosaicSupplyChangeTransaction; - expect(transaction.direction).to.be.equal(MosaicSupplyType.Increase); + expect(transaction.direction).to.be.equal(MosaicSupplyChangeAction.Increase); expect(transaction.delta.lower).to.be.equal(10); expect(transaction.delta.higher).to.be.equal(0); expect(transaction.mosaicId.id.lower).to.be.equal(2262289484); @@ -398,12 +398,12 @@ describe('TransactionMapping - createFromPayload', () => { }); it('should create ModifyMultiSigTransaction', () => { - const modifyMultisigAccountTransaction = ModifyMultisigAccountTransaction.create( + const modifyMultisigAccountTransaction = MultisigAccountModificationTransaction.create( Deadline.create(), 2, 1, [new MultisigCosignatoryModification( - MultisigCosignatoryModificationType.Add, + CosignatoryModificationAction.Add, PublicAccount.createFromPublicKey('B0F93CBEE49EEB9953C6F3985B15A4F238E205584D8F924C621CBE4D7AC6EC24', NetworkType.MIJIN_TEST), )], @@ -412,14 +412,14 @@ describe('TransactionMapping - createFromPayload', () => { const signedTransaction = modifyMultisigAccountTransaction.signWith(account, generationHash); - const transaction = TransactionMapping.createFromPayload(signedTransaction.payload) as ModifyMultisigAccountTransaction; + const transaction = TransactionMapping.createFromPayload(signedTransaction.payload) as MultisigAccountModificationTransaction; expect(transaction.minApprovalDelta) .to.be.equal(2); expect(transaction.minRemovalDelta) .to.be.equal(1); expect(transaction.modifications[0].modificiationType) - .to.be.equal(MultisigCosignatoryModificationType.Add); + .to.be.equal(CosignatoryModificationAction.Add); expect(transaction.modifications[0].cosignatoryPublicAccount.publicKey) .to.be.equal('B0F93CBEE49EEB9953C6F3985B15A4F238E205584D8F924C621CBE4D7AC6EC24'); }); @@ -508,8 +508,8 @@ describe('TransactionMapping - createFromPayload', () => { expect(transaction.remoteAccountKey).to.be.equal(account.publicKey); }); - it('should create RegisterNamespaceTransaction - Root', () => { - const registerNamespaceTransaction = RegisterNamespaceTransaction.createRootNamespace( + it('should create NamespaceRegistrationTransaction - Root', () => { + const registerNamespaceTransaction = NamespaceRegistrationTransaction.createRootNamespace( Deadline.create(), 'root-test-namespace', UInt64.fromUint(1000), @@ -518,15 +518,15 @@ describe('TransactionMapping - createFromPayload', () => { const signedTransaction = registerNamespaceTransaction.signWith(account, generationHash); - const transaction = TransactionMapping.createFromPayload(signedTransaction.payload) as RegisterNamespaceTransaction; + const transaction = TransactionMapping.createFromPayload(signedTransaction.payload) as NamespaceRegistrationTransaction; - expect(transaction.namespaceType).to.be.equal(NamespaceType.RootNamespace); + expect(transaction.namespaceType).to.be.equal(NamespaceRegistrationType.RootNamespace); expect(transaction.namespaceName).to.be.equal('root-test-namespace'); }); - it('should create RegisterNamespaceTransaction - Sub', () => { - const registerNamespaceTransaction = RegisterNamespaceTransaction.createSubNamespace( + it('should create NamespaceRegistrationTransaction - Sub', () => { + const registerNamespaceTransaction = NamespaceRegistrationTransaction.createSubNamespace( Deadline.create(), 'root-test-namespace', 'parent-test-namespace', @@ -535,9 +535,9 @@ describe('TransactionMapping - createFromPayload', () => { const signedTransaction = registerNamespaceTransaction.signWith(account, generationHash); - const transaction = TransactionMapping.createFromPayload(signedTransaction.payload) as RegisterNamespaceTransaction; + const transaction = TransactionMapping.createFromPayload(signedTransaction.payload) as NamespaceRegistrationTransaction; - expect(transaction.namespaceType).to.be.equal(NamespaceType.SubNamespace); + expect(transaction.namespaceType).to.be.equal(NamespaceRegistrationType.SubNamespace); expect(transaction.namespaceName).to.be.equal('root-test-namespace'); }); @@ -733,7 +733,7 @@ describe('TransactionMapping - createFromDTO (Transaction.toJSON() feed)', () => it('should create AccountRestrictionAddressTransaction', () => { const address = Address.createFromRawAddress('SBILTA367K2LX2FEXG5TFWAS7GEFYAGY7QLFBYKC'); const addressRestrictionFilter = AccountRestrictionModification.createForAddress( - RestrictionModificationType.Add, + AccountRestrictionModificationAction.Add, address, ); const addressRestrictionTransaction = AccountRestrictionTransaction.createAddressRestrictionModificationTransaction( @@ -748,13 +748,13 @@ describe('TransactionMapping - createFromDTO (Transaction.toJSON() feed)', () => expect(transaction.modifications[0].value).to.be.equal('SBILTA367K2LX2FEXG5TFWAS7GEFYAGY7QLFBYKC'); expect(transaction.restrictionType).to.be.equal(AccountRestrictionType.AllowIncomingAddress); - expect(transaction.modifications[0].modificationType).to.be.equal(RestrictionModificationType.Add); + expect(transaction.modifications[0].modificationType).to.be.equal(AccountRestrictionModificationAction.Add); }); it('should create AccountRestrictionMosaicTransaction', () => { const mosaicId = new MosaicId([2262289484, 3405110546]); const mosaicRestrictionFilter = AccountRestrictionModification.createForMosaic( - RestrictionModificationType.Add, + AccountRestrictionModificationAction.Add, mosaicId, ); const mosaicRestrictionTransaction = AccountRestrictionTransaction.createMosaicRestrictionModificationTransaction( @@ -775,7 +775,7 @@ describe('TransactionMapping - createFromDTO (Transaction.toJSON() feed)', () => it('should create AccountRestrictionMosaicTransaction', () => { const operation = TransactionType.ADDRESS_ALIAS; const operationRestrictionFilter = AccountRestrictionModification.createForOperation( - RestrictionModificationType.Add, + AccountRestrictionModificationAction.Add, operation, ); const operationRestrictionTransaction = AccountRestrictionTransaction.createOperationRestrictionModificationTransaction( @@ -860,7 +860,7 @@ describe('TransactionMapping - createFromDTO (Transaction.toJSON() feed)', () => const mosaicSupplyChangeTransaction = MosaicSupplyChangeTransaction.create( Deadline.create(), mosaicId, - MosaicSupplyType.Increase, + MosaicSupplyChangeAction.Increase, UInt64.fromUint(10), NetworkType.MIJIN_TEST, ); @@ -869,7 +869,7 @@ describe('TransactionMapping - createFromDTO (Transaction.toJSON() feed)', () => TransactionMapping.createFromDTO(mosaicSupplyChangeTransaction.toJSON()) as MosaicSupplyChangeTransaction; expect(transaction.type).to.be.equal(TransactionType.MOSAIC_SUPPLY_CHANGE); - expect(transaction.direction).to.be.equal(MosaicSupplyType.Increase); + expect(transaction.direction).to.be.equal(MosaicSupplyChangeAction.Increase); }); @@ -917,12 +917,12 @@ describe('TransactionMapping - createFromDTO (Transaction.toJSON() feed)', () => }); it('should create ModifyMultiSigTransaction', () => { - const modifyMultisigAccountTransaction = ModifyMultisigAccountTransaction.create( + const modifyMultisigAccountTransaction = MultisigAccountModificationTransaction.create( Deadline.create(), 2, 1, [new MultisigCosignatoryModification( - MultisigCosignatoryModificationType.Add, + CosignatoryModificationAction.Add, PublicAccount.createFromPublicKey('B0F93CBEE49EEB9953C6F3985B15A4F238E205584D8F924C621CBE4D7AC6EC24', NetworkType.MIJIN_TEST), )], @@ -930,7 +930,7 @@ describe('TransactionMapping - createFromDTO (Transaction.toJSON() feed)', () => ); const transaction = - TransactionMapping.createFromDTO(modifyMultisigAccountTransaction.toJSON()) as ModifyMultisigAccountTransaction; + TransactionMapping.createFromDTO(modifyMultisigAccountTransaction.toJSON()) as MultisigAccountModificationTransaction; expect(transaction.type).to.be.equal(TransactionType.MODIFY_MULTISIG_ACCOUNT); expect(transaction.minApprovalDelta).to.be.equal(2); @@ -1002,8 +1002,8 @@ describe('TransactionMapping - createFromDTO (Transaction.toJSON() feed)', () => expect(transaction.hash).to.be.equal(signedTransaction.hash); }); - it('should create RegisterNamespaceTransaction - Root', () => { - const registerNamespaceTransaction = RegisterNamespaceTransaction.createRootNamespace( + it('should create NamespaceRegistrationTransaction - Root', () => { + const registerNamespaceTransaction = NamespaceRegistrationTransaction.createRootNamespace( Deadline.create(), 'root-test-namespace', UInt64.fromUint(1000), @@ -1011,14 +1011,14 @@ describe('TransactionMapping - createFromDTO (Transaction.toJSON() feed)', () => ); const transaction = - TransactionMapping.createFromDTO(registerNamespaceTransaction.toJSON()) as RegisterNamespaceTransaction; + TransactionMapping.createFromDTO(registerNamespaceTransaction.toJSON()) as NamespaceRegistrationTransaction; expect(transaction.type).to.be.equal(TransactionType.REGISTER_NAMESPACE); }); - it('should create RegisterNamespaceTransaction - Sub', () => { - const registerNamespaceTransaction = RegisterNamespaceTransaction.createSubNamespace( + it('should create NamespaceRegistrationTransaction - Sub', () => { + const registerNamespaceTransaction = NamespaceRegistrationTransaction.createSubNamespace( Deadline.create(), 'root-test-namespace', 'parent-test-namespace', @@ -1026,7 +1026,7 @@ describe('TransactionMapping - createFromDTO (Transaction.toJSON() feed)', () => ); const transaction = - TransactionMapping.createFromDTO(registerNamespaceTransaction.toJSON()) as RegisterNamespaceTransaction; + TransactionMapping.createFromDTO(registerNamespaceTransaction.toJSON()) as NamespaceRegistrationTransaction; expect(transaction.type).to.be.equal(TransactionType.REGISTER_NAMESPACE); }); diff --git a/test/infrastructure/SerializeTransactionToJSON.spec.ts b/test/infrastructure/SerializeTransactionToJSON.spec.ts index 21822a3091..b8428ffdf7 100644 --- a/test/infrastructure/SerializeTransactionToJSON.spec.ts +++ b/test/infrastructure/SerializeTransactionToJSON.spec.ts @@ -18,15 +18,15 @@ import { expect } from 'chai'; import { sha3_256 } from 'js-sha3'; import {Convert as convert} from '../../src/core/format'; import { Account } from '../../src/model/account/Account'; +import { AccountRestrictionModificationAction } from '../../src/model/account/AccountRestrictionModificationAction'; import { AccountRestrictionType } from '../../src/model/account/AccountRestrictionType'; import { Address } from '../../src/model/account/Address'; import { PublicAccount } from '../../src/model/account/PublicAccount'; -import { RestrictionModificationType } from '../../src/model/account/RestrictionModificationType'; import { NetworkType } from '../../src/model/blockchain/NetworkType'; import { MosaicId } from '../../src/model/mosaic/MosaicId'; import { MosaicNonce } from '../../src/model/mosaic/MosaicNonce'; import { MosaicProperties } from '../../src/model/mosaic/MosaicProperties'; -import { MosaicSupplyType } from '../../src/model/mosaic/MosaicSupplyType'; +import { MosaicSupplyChangeAction } from '../../src/model/mosaic/MosaicSupplyChangeAction'; import { NetworkCurrencyMosaic } from '../../src/model/mosaic/NetworkCurrencyMosaic'; import { AliasAction } from '../../src/model/namespace/AliasAction'; import { NamespaceId } from '../../src/model/namespace/NamespaceId'; @@ -35,18 +35,18 @@ import { AccountRestrictionModification } from '../../src/model/transaction/Acco import { AccountRestrictionTransaction } from '../../src/model/transaction/AccountRestrictionTransaction'; import { AddressAliasTransaction } from '../../src/model/transaction/AddressAliasTransaction'; import { AggregateTransaction } from '../../src/model/transaction/AggregateTransaction'; +import { CosignatoryModificationAction } from '../../src/model/transaction/CosignatoryModificationAction'; import { Deadline } from '../../src/model/transaction/Deadline'; import { HashType } from '../../src/model/transaction/HashType'; import { LinkAction } from '../../src/model/transaction/LinkAction'; import { LockFundsTransaction } from '../../src/model/transaction/LockFundsTransaction'; -import { ModifyMultisigAccountTransaction } from '../../src/model/transaction/ModifyMultisigAccountTransaction'; import { MosaicAliasTransaction } from '../../src/model/transaction/MosaicAliasTransaction'; import { MosaicDefinitionTransaction } from '../../src/model/transaction/MosaicDefinitionTransaction'; import { MosaicSupplyChangeTransaction } from '../../src/model/transaction/MosaicSupplyChangeTransaction'; +import { MultisigAccountModificationTransaction } from '../../src/model/transaction/MultisigAccountModificationTransaction'; import { MultisigCosignatoryModification } from '../../src/model/transaction/MultisigCosignatoryModification'; -import { MultisigCosignatoryModificationType } from '../../src/model/transaction/MultisigCosignatoryModificationType'; +import { NamespaceRegistrationTransaction } from '../../src/model/transaction/NamespaceRegistrationTransaction'; import { PlainMessage } from '../../src/model/transaction/PlainMessage'; -import { RegisterNamespaceTransaction } from '../../src/model/transaction/RegisterNamespaceTransaction'; import { SecretLockTransaction } from '../../src/model/transaction/SecretLockTransaction'; import { SecretProofTransaction } from '../../src/model/transaction/SecretProofTransaction'; import { TransactionType } from '../../src/model/transaction/TransactionType' ; @@ -78,7 +78,7 @@ describe('SerializeTransactionToJSON', () => { it('should create AccountRestrictionAddressTransaction', () => { const address = Address.createFromRawAddress('SBILTA367K2LX2FEXG5TFWAS7GEFYAGY7QLFBYKC'); const addressRestrictionFilter = AccountRestrictionModification.createForAddress( - RestrictionModificationType.Add, + AccountRestrictionModificationAction.Add, address, ); const addressRestrictionTransaction = AccountRestrictionTransaction.createAddressRestrictionModificationTransaction( @@ -98,7 +98,7 @@ describe('SerializeTransactionToJSON', () => { it('should create AccountRestrictionMosaicTransaction', () => { const mosaicId = new MosaicId([2262289484, 3405110546]); const mosaicRestrictionFilter = AccountRestrictionModification.createForMosaic( - RestrictionModificationType.Add, + AccountRestrictionModificationAction.Add, mosaicId, ); const mosaicRestrictionTransaction = AccountRestrictionTransaction.createMosaicRestrictionModificationTransaction( @@ -118,7 +118,7 @@ describe('SerializeTransactionToJSON', () => { it('should create AccountRestrictionOperationTransaction', () => { const operation = TransactionType.ADDRESS_ALIAS; const operationRestrictionFilter = AccountRestrictionModification.createForOperation( - RestrictionModificationType.Add, + AccountRestrictionModificationAction.Add, operation, ); const operationRestrictionTransaction = AccountRestrictionTransaction.createOperationRestrictionModificationTransaction( @@ -218,7 +218,7 @@ describe('SerializeTransactionToJSON', () => { const mosaicSupplyChangeTransaction = MosaicSupplyChangeTransaction.create( Deadline.create(), mosaicId, - MosaicSupplyType.Increase, + MosaicSupplyChangeAction.Increase, UInt64.fromUint(10), NetworkType.MIJIN_TEST, ); @@ -226,7 +226,7 @@ describe('SerializeTransactionToJSON', () => { const json = mosaicSupplyChangeTransaction.toJSON(); expect(json.transaction.type).to.be.equal(TransactionType.MOSAIC_SUPPLY_CHANGE); - expect(json.transaction.direction).to.be.equal(MosaicSupplyType.Increase); + expect(json.transaction.direction).to.be.equal(MosaicSupplyChangeAction.Increase); }); @@ -290,12 +290,12 @@ describe('SerializeTransactionToJSON', () => { }); it('should create ModifyMultiSigTransaction', () => { - const modifyMultisigAccountTransaction = ModifyMultisigAccountTransaction.create( + const modifyMultisigAccountTransaction = MultisigAccountModificationTransaction.create( Deadline.create(), 2, 1, [new MultisigCosignatoryModification( - MultisigCosignatoryModificationType.Add, + CosignatoryModificationAction.Add, PublicAccount.createFromPublicKey('B0F93CBEE49EEB9953C6F3985B15A4F238E205584D8F924C621CBE4D7AC6EC24', NetworkType.MIJIN_TEST), )], @@ -372,8 +372,8 @@ describe('SerializeTransactionToJSON', () => { expect(json.transaction.hash).to.be.equal(signedTransaction.hash); }); - it('should create RegisterNamespaceTransaction - Root', () => { - const registerNamespaceTransaction = RegisterNamespaceTransaction.createRootNamespace( + it('should create NamespaceRegistrationTransaction - Root', () => { + const registerNamespaceTransaction = NamespaceRegistrationTransaction.createRootNamespace( Deadline.create(), 'root-test-namespace', UInt64.fromUint(1000), @@ -386,8 +386,8 @@ describe('SerializeTransactionToJSON', () => { }); - it('should create RegisterNamespaceTransaction - Sub', () => { - const registerNamespaceTransaction = RegisterNamespaceTransaction.createSubNamespace( + it('should create NamespaceRegistrationTransaction - Sub', () => { + const registerNamespaceTransaction = NamespaceRegistrationTransaction.createSubNamespace( Deadline.create(), 'root-test-namespace', 'parent-test-namespace', diff --git a/test/model/account/AccountRestrictions.spec.ts b/test/model/account/AccountRestrictions.spec.ts index 0ed43b4f0b..f86b7fa7c2 100644 --- a/test/model/account/AccountRestrictions.spec.ts +++ b/test/model/account/AccountRestrictions.spec.ts @@ -16,8 +16,11 @@ import {deepEqual} from 'assert'; import {expect} from 'chai'; +import { AccountRestriction } from '../../../src/model/account/AccountRestriction'; +import { AccountRestrictionModificationAction } from '../../../src/model/account/AccountRestrictionModificationAction'; +import { AccountRestrictions } from '../../../src/model/account/AccountRestrictions'; +import { AccountRestrictionType } from '../../../src/model/account/AccountRestrictionType'; import {Address} from '../../../src/model/account/Address'; -import { AccountRestriction, AccountRestrictions, AccountRestrictionType, RestrictionModificationType } from '../../../src/model/model'; describe('AccountRestrictions', () => { @@ -26,7 +29,7 @@ describe('AccountRestrictions', () => { address: Address.createFromEncoded('9050B9837EFAB4BBE8A4B9BB32D812F9885C00D8FC1650E142'), restrictions: [{ restrictionType: AccountRestrictionType.AllowIncomingAddress, - values: [{modificationType: RestrictionModificationType.Add, + values: [{modificationType: AccountRestrictionModificationAction.Add, value: 'SDUP5PLHDXKBX3UU5Q52LAY4WYEKGEWC6IB3VBFM', }], }], diff --git a/test/model/account/AccountRestrictionsInfo.spec.ts b/test/model/account/AccountRestrictionsInfo.spec.ts index f4291f2468..93d9736355 100644 --- a/test/model/account/AccountRestrictionsInfo.spec.ts +++ b/test/model/account/AccountRestrictionsInfo.spec.ts @@ -16,11 +16,11 @@ import {deepEqual} from 'assert'; import { AccountRestriction } from '../../../src/model/account/AccountRestriction'; +import { AccountRestrictionModificationAction } from '../../../src/model/account/AccountRestrictionModificationAction'; import { AccountRestrictions } from '../../../src/model/account/AccountRestrictions'; import { AccountRestrictionsInfo } from '../../../src/model/account/AccountRestrictionsInfo'; import { AccountRestrictionType } from '../../../src/model/account/AccountRestrictionType'; import {Address} from '../../../src/model/account/Address'; -import { RestrictionModificationType } from '../../../src/model/account/RestrictionModificationType'; describe('AccountRestrictionsInfo', () => { @@ -32,7 +32,7 @@ describe('AccountRestrictionsInfo', () => { address: '9050B9837EFAB4BBE8A4B9BB32D812F9885C00D8FC1650E142', restrictions: [{ restrictionType: AccountRestrictionType.AllowIncomingAddress, - values: [{modificationType: RestrictionModificationType.Add, + values: [{modificationType: AccountRestrictionModificationAction.Add, value: 'SDUP5PLHDXKBX3UU5Q52LAY4WYEKGEWC6IB3VBFM', }], }], diff --git a/test/model/transaction/AccountRestrictionTransaction.spec.ts b/test/model/transaction/AccountRestrictionTransaction.spec.ts index cde002ae01..b614fc20ab 100644 --- a/test/model/transaction/AccountRestrictionTransaction.spec.ts +++ b/test/model/transaction/AccountRestrictionTransaction.spec.ts @@ -16,9 +16,9 @@ import {expect} from 'chai'; import {Account} from '../../../src/model/account/Account'; +import { AccountRestrictionModificationAction } from '../../../src/model/account/AccountRestrictionModificationAction'; import { AccountRestrictionType } from '../../../src/model/account/AccountRestrictionType'; import {Address} from '../../../src/model/account/Address'; -import { RestrictionModificationType } from '../../../src/model/account/RestrictionModificationType'; import {NetworkType} from '../../../src/model/blockchain/NetworkType'; import {MosaicId} from '../../../src/model/mosaic/MosaicId'; import { AccountRestrictionModification } from '../../../src/model/transaction/AccountRestrictionModification'; @@ -37,20 +37,20 @@ describe('AccountRestrictionTransaction', () => { it('should create address restriction filter', () => { const address = Address.createFromRawAddress('SBILTA367K2LX2FEXG5TFWAS7GEFYAGY7QLFBYKC'); const addressRestrictionFilter = AccountRestrictionModification.createForAddress( - RestrictionModificationType.Add, + AccountRestrictionModificationAction.Add, address, ); - expect(addressRestrictionFilter.modificationType).to.be.equal(RestrictionModificationType.Add); + expect(addressRestrictionFilter.modificationType).to.be.equal(AccountRestrictionModificationAction.Add); expect(addressRestrictionFilter.value).to.be.equal(address.plain()); }); it('should create mosaic restriction filter', () => { const mosaicId = new MosaicId([2262289484, 3405110546]); const mosaicRestrictionFilter = AccountRestrictionModification.createForMosaic( - RestrictionModificationType.Add, + AccountRestrictionModificationAction.Add, mosaicId, ); - expect(mosaicRestrictionFilter.modificationType).to.be.equal(RestrictionModificationType.Add); + expect(mosaicRestrictionFilter.modificationType).to.be.equal(AccountRestrictionModificationAction.Add); expect(mosaicRestrictionFilter.value[0]).to.be.equal(mosaicId.id.lower); expect(mosaicRestrictionFilter.value[1]).to.be.equal(mosaicId.id.higher); }); @@ -58,10 +58,10 @@ describe('AccountRestrictionTransaction', () => { it('should create operation restriction filter', () => { const operation = TransactionType.ADDRESS_ALIAS; const operationRestrictionFilter = AccountRestrictionModification.createForOperation( - RestrictionModificationType.Add, + AccountRestrictionModificationAction.Add, operation, ); - expect(operationRestrictionFilter.modificationType).to.be.equal(RestrictionModificationType.Add); + expect(operationRestrictionFilter.modificationType).to.be.equal(AccountRestrictionModificationAction.Add); expect(operationRestrictionFilter.value).to.be.equal(operation); }); @@ -69,7 +69,7 @@ describe('AccountRestrictionTransaction', () => { it('should return 148 for AccountAddressRestrictionTransaction transaction byte size with 1 modification', () => { const address = Address.createFromRawAddress('SBILTA367K2LX2FEXG5TFWAS7GEFYAGY7QLFBYKC'); const addressRestrictionFilter = AccountRestrictionModification.createForAddress( - RestrictionModificationType.Add, + AccountRestrictionModificationAction.Add, address, ); const addressRestrictionTransaction = AccountRestrictionTransaction.createAddressRestrictionModificationTransaction( @@ -85,7 +85,7 @@ describe('AccountRestrictionTransaction', () => { it('should return 131 for AccountMosaicRestrictionTransaction transaction byte size with 1 modification', () => { const mosaicId = new MosaicId([2262289484, 3405110546]); const mosaicRestrictionFilter = AccountRestrictionModification.createForMosaic( - RestrictionModificationType.Add, + AccountRestrictionModificationAction.Add, mosaicId, ); const mosaicRestrictionTransaction = AccountRestrictionTransaction.createMosaicRestrictionModificationTransaction( @@ -100,7 +100,7 @@ describe('AccountRestrictionTransaction', () => { it('should return 125 for AccountOperationRestrictionTransaction transaction byte size with 1 modification', () => { const operation = TransactionType.ADDRESS_ALIAS; const operationRestrictionFilter = AccountRestrictionModification.createForOperation( - RestrictionModificationType.Add, + AccountRestrictionModificationAction.Add, operation, ); const operationRestrictionTransaction = AccountRestrictionTransaction.createOperationRestrictionModificationTransaction( @@ -116,7 +116,7 @@ describe('AccountRestrictionTransaction', () => { it('should default maxFee field be set to 0', () => { const address = Address.createFromRawAddress('SBILTA367K2LX2FEXG5TFWAS7GEFYAGY7QLFBYKC'); const addressRestrictionFilter = AccountRestrictionModification.createForAddress( - RestrictionModificationType.Add, + AccountRestrictionModificationAction.Add, address, ); const addressRestrictionTransaction = AccountRestrictionTransaction.createAddressRestrictionModificationTransaction( @@ -133,7 +133,7 @@ describe('AccountRestrictionTransaction', () => { it('should filled maxFee override transaction maxFee', () => { const address = Address.createFromRawAddress('SBILTA367K2LX2FEXG5TFWAS7GEFYAGY7QLFBYKC'); const addressRestrictionFilter = AccountRestrictionModification.createForAddress( - RestrictionModificationType.Add, + AccountRestrictionModificationAction.Add, address, ); const addressRestrictionTransaction = AccountRestrictionTransaction.createAddressRestrictionModificationTransaction( @@ -152,7 +152,7 @@ describe('AccountRestrictionTransaction', () => { const address = Address.createFromRawAddress('SBILTA367K2LX2FEXG5TFWAS7GEFYAGY7QLFBYKC'); const addressRestrictionFilter = AccountRestrictionModification.createForAddress( - RestrictionModificationType.Add, + AccountRestrictionModificationAction.Add, address, ); const addressRestrictionTransaction = AccountRestrictionTransaction.createAddressRestrictionModificationTransaction( @@ -175,7 +175,7 @@ describe('AccountRestrictionTransaction', () => { const address = Address.createFromRawAddress('SBILTA367K2LX2FEXG5TFWAS7GEFYAGY7QLFBYKC'); const addressRestrictionFilter = AccountRestrictionModification.createForAddress( - RestrictionModificationType.Add, + AccountRestrictionModificationAction.Add, address, ); @@ -203,7 +203,7 @@ describe('AccountRestrictionTransaction', () => { const mosaicId = new MosaicId([2262289484, 3405110546]); const mosaicRestrictionFilter = AccountRestrictionModification.createForMosaic( - RestrictionModificationType.Add, + AccountRestrictionModificationAction.Add, mosaicId, ); const mosaicRestrictionTransaction = AccountRestrictionTransaction.createMosaicRestrictionModificationTransaction( @@ -226,7 +226,7 @@ describe('AccountRestrictionTransaction', () => { const mosaicId = new MosaicId([2262289484, 3405110546]); const mosaicRestrictionFilter = AccountRestrictionModification.createForMosaic( - RestrictionModificationType.Add, + AccountRestrictionModificationAction.Add, mosaicId, ); @@ -256,7 +256,7 @@ describe('AccountRestrictionTransaction', () => { const operation = TransactionType.ADDRESS_ALIAS; const operationRestrictionFilter = AccountRestrictionModification.createForOperation( - RestrictionModificationType.Add, + AccountRestrictionModificationAction.Add, operation, ); const operationRestrictionTransaction = AccountRestrictionTransaction.createOperationRestrictionModificationTransaction( @@ -279,7 +279,7 @@ describe('AccountRestrictionTransaction', () => { const operation = TransactionType.ADDRESS_ALIAS; const operationRestrictionFilter = AccountRestrictionModification.createForOperation( - RestrictionModificationType.Add, + AccountRestrictionModificationAction.Add, operation, ); @@ -307,7 +307,7 @@ describe('AccountRestrictionTransaction', () => { const address = Address.createFromRawAddress('SBILTA367K2LX2FEXG5TFWAS7GEFYAGY7QLFBYKC'); const addressRestrictionFilter = AccountRestrictionModification.createForAddress( - RestrictionModificationType.Add, + AccountRestrictionModificationAction.Add, address, ); let addressRestrictionTransaction = AccountRestrictionTransaction.createAddressRestrictionModificationTransaction( @@ -344,7 +344,7 @@ describe('AccountRestrictionTransaction', () => { const operation = TransactionType.ADDRESS_ALIAS; const operationRestrictionFilter = AccountRestrictionModification.createForOperation( - RestrictionModificationType.Add, + AccountRestrictionModificationAction.Add, operation, ); let operationRestrictionTransaction = AccountRestrictionTransaction.createOperationRestrictionModificationTransaction( diff --git a/test/model/transaction/AggregateTransaction.spec.ts b/test/model/transaction/AggregateTransaction.spec.ts index 4e8c4227e6..4f331e0bdd 100644 --- a/test/model/transaction/AggregateTransaction.spec.ts +++ b/test/model/transaction/AggregateTransaction.spec.ts @@ -25,19 +25,19 @@ import {NetworkType} from '../../../src/model/blockchain/NetworkType'; import {MosaicId} from '../../../src/model/mosaic/MosaicId'; import {MosaicNonce} from '../../../src/model/mosaic/MosaicNonce'; import {MosaicProperties} from '../../../src/model/mosaic/MosaicProperties'; -import {MosaicSupplyType} from '../../../src/model/mosaic/MosaicSupplyType'; +import {MosaicSupplyChangeAction} from '../../../src/model/mosaic/MosaicSupplyChangeAction'; import { NetworkCurrencyMosaic } from '../../../src/model/mosaic/NetworkCurrencyMosaic'; import {AggregateTransaction} from '../../../src/model/transaction/AggregateTransaction'; +import {CosignatoryModificationAction} from '../../../src/model/transaction/CosignatoryModificationAction'; import { CosignatureSignedTransaction } from '../../../src/model/transaction/CosignatureSignedTransaction'; import { CosignatureTransaction } from '../../../src/model/transaction/CosignatureTransaction'; import {Deadline} from '../../../src/model/transaction/Deadline'; -import {ModifyMultisigAccountTransaction} from '../../../src/model/transaction/ModifyMultisigAccountTransaction'; import {MosaicDefinitionTransaction} from '../../../src/model/transaction/MosaicDefinitionTransaction'; import {MosaicSupplyChangeTransaction} from '../../../src/model/transaction/MosaicSupplyChangeTransaction'; +import {MultisigAccountModificationTransaction} from '../../../src/model/transaction/MultisigAccountModificationTransaction'; import {MultisigCosignatoryModification} from '../../../src/model/transaction/MultisigCosignatoryModification'; -import {MultisigCosignatoryModificationType} from '../../../src/model/transaction/MultisigCosignatoryModificationType'; +import {NamespaceRegistrationTransaction} from '../../../src/model/transaction/NamespaceRegistrationTransaction'; import {PlainMessage} from '../../../src/model/transaction/PlainMessage'; -import {RegisterNamespaceTransaction} from '../../../src/model/transaction/RegisterNamespaceTransaction'; import { TransactionType } from '../../../src/model/transaction/TransactionType'; import {TransferTransaction} from '../../../src/model/transaction/TransferTransaction'; import {UInt64} from '../../../src/model/UInt64'; @@ -116,8 +116,8 @@ describe('AggregateTransaction', () => { )).to.be.equal('019054419050B9837EFAB4BBE8A4B9BB32D812F9885C00D8FC1650E1420D000000746573742D6D657373616765'); }); - it('should createComplete an AggregateTransaction object with RegisterNamespaceTransaction', () => { - const registerNamespaceTransaction = RegisterNamespaceTransaction.createRootNamespace( + it('should createComplete an AggregateTransaction object with NamespaceRegistrationTransaction', () => { + const registerNamespaceTransaction = NamespaceRegistrationTransaction.createRootNamespace( Deadline.create(), 'root-test-namespace', UInt64.fromUint(1000), @@ -179,7 +179,7 @@ describe('AggregateTransaction', () => { const mosaicSupplyChangeTransaction = MosaicSupplyChangeTransaction.create( Deadline.create(), mosaicId, - MosaicSupplyType.Increase, + MosaicSupplyChangeAction.Increase, UInt64.fromUint(10), NetworkType.MIJIN_TEST, ); @@ -201,18 +201,18 @@ describe('AggregateTransaction', () => { )).to.be.equal('01904D424CCCD78612DDF5CA010A00000000000000'); }); - it('should createComplete an AggregateTransaction object with ModifyMultisigAccountTransaction', () => { - const modifyMultisigAccountTransaction = ModifyMultisigAccountTransaction.create( + it('should createComplete an AggregateTransaction object with MultisigAccountModificationTransaction', () => { + const modifyMultisigAccountTransaction = MultisigAccountModificationTransaction.create( Deadline.create(), 2, 1, [new MultisigCosignatoryModification( - MultisigCosignatoryModificationType.Add, + CosignatoryModificationAction.Add, PublicAccount.createFromPublicKey('B0F93CBEE49EEB9953C6F3985B15A4F238E205584D8F924C621CBE4D7AC6EC24', NetworkType.MIJIN_TEST), ), new MultisigCosignatoryModification( - MultisigCosignatoryModificationType.Add, + CosignatoryModificationAction.Add, PublicAccount.createFromPublicKey('B1B5581FC81A6970DEE418D2C2978F2724228B7B36C5C6DF71B0162BB04778B4', NetworkType.MIJIN_TEST), )], diff --git a/test/model/transaction/MosaicSupplyChangeTransaction.spec.ts b/test/model/transaction/MosaicSupplyChangeTransaction.spec.ts index 95c752e731..e2b65d03c6 100644 --- a/test/model/transaction/MosaicSupplyChangeTransaction.spec.ts +++ b/test/model/transaction/MosaicSupplyChangeTransaction.spec.ts @@ -18,7 +18,7 @@ import {expect} from 'chai'; import {Account} from '../../../src/model/account/Account'; import {NetworkType} from '../../../src/model/blockchain/NetworkType'; import {MosaicId} from '../../../src/model/mosaic/MosaicId'; -import {MosaicSupplyType} from '../../../src/model/mosaic/MosaicSupplyType'; +import {MosaicSupplyChangeAction} from '../../../src/model/mosaic/MosaicSupplyChangeAction'; import {Deadline} from '../../../src/model/transaction/Deadline'; import {MosaicSupplyChangeTransaction,} from '../../../src/model/transaction/MosaicSupplyChangeTransaction'; import {UInt64} from '../../../src/model/UInt64'; @@ -36,7 +36,7 @@ describe('MosaicSupplyChangeTransaction', () => { const mosaicSupplyChangeTransaction = MosaicSupplyChangeTransaction.create( Deadline.create(), mosaicId, - MosaicSupplyType.Increase, + MosaicSupplyChangeAction.Increase, UInt64.fromUint(10), NetworkType.MIJIN_TEST, ); @@ -50,7 +50,7 @@ describe('MosaicSupplyChangeTransaction', () => { const mosaicSupplyChangeTransaction = MosaicSupplyChangeTransaction.create( Deadline.create(), mosaicId, - MosaicSupplyType.Increase, + MosaicSupplyChangeAction.Increase, UInt64.fromUint(10), NetworkType.MIJIN_TEST, new UInt64([1, 0]) @@ -65,12 +65,12 @@ describe('MosaicSupplyChangeTransaction', () => { const mosaicSupplyChangeTransaction = MosaicSupplyChangeTransaction.create( Deadline.create(), mosaicId, - MosaicSupplyType.Increase, + MosaicSupplyChangeAction.Increase, UInt64.fromUint(10), NetworkType.MIJIN_TEST, ); - expect(mosaicSupplyChangeTransaction.direction).to.be.equal(MosaicSupplyType.Increase); + expect(mosaicSupplyChangeTransaction.direction).to.be.equal(MosaicSupplyChangeAction.Increase); expect(mosaicSupplyChangeTransaction.delta.lower).to.be.equal(10); expect(mosaicSupplyChangeTransaction.delta.higher).to.be.equal(0); expect(mosaicSupplyChangeTransaction.mosaicId.id.lower).to.be.equal(2262289484); @@ -91,7 +91,7 @@ describe('MosaicSupplyChangeTransaction', () => { const mosaicSupplyChangeTransaction = MosaicSupplyChangeTransaction.create( Deadline.create(), mosaicId, - MosaicSupplyType.Increase, + MosaicSupplyChangeAction.Increase, UInt64.fromUint(10), NetworkType.MIJIN_TEST, ); diff --git a/test/model/transaction/ModifyMultisigAccountTransaction.spec.ts b/test/model/transaction/MultisigAccountModificationTransaction.spec.ts similarity index 78% rename from test/model/transaction/ModifyMultisigAccountTransaction.spec.ts rename to test/model/transaction/MultisigAccountModificationTransaction.spec.ts index 00afd72d47..33cb731df5 100644 --- a/test/model/transaction/ModifyMultisigAccountTransaction.spec.ts +++ b/test/model/transaction/MultisigAccountModificationTransaction.spec.ts @@ -18,14 +18,14 @@ import {expect} from 'chai'; import {Account} from '../../../src/model/account/Account'; import {PublicAccount} from '../../../src/model/account/PublicAccount'; import {NetworkType} from '../../../src/model/blockchain/NetworkType'; +import {CosignatoryModificationAction} from '../../../src/model/transaction/CosignatoryModificationAction'; import {Deadline} from '../../../src/model/transaction/Deadline'; -import {ModifyMultisigAccountTransaction} from '../../../src/model/transaction/ModifyMultisigAccountTransaction'; +import {MultisigAccountModificationTransaction} from '../../../src/model/transaction/MultisigAccountModificationTransaction'; import {MultisigCosignatoryModification} from '../../../src/model/transaction/MultisigCosignatoryModification'; -import {MultisigCosignatoryModificationType} from '../../../src/model/transaction/MultisigCosignatoryModificationType'; import {UInt64} from '../../../src/model/UInt64'; import {TestingAccount} from '../../conf/conf.spec'; -describe('ModifyMultisigAccountTransaction', () => { +describe('MultisigAccountModificationTransaction', () => { let account: Account; const generationHash = '57F7DA205008026C776CB6AED843393F04CD458E0AA2D9F1D5F31A402072B2D6'; before(() => { @@ -33,17 +33,17 @@ describe('ModifyMultisigAccountTransaction', () => { }); it('should default maxFee field be set to 0', () => { - const modifyMultisigAccountTransaction = ModifyMultisigAccountTransaction.create( + const modifyMultisigAccountTransaction = MultisigAccountModificationTransaction.create( Deadline.create(), 2, 1, [new MultisigCosignatoryModification( - MultisigCosignatoryModificationType.Add, + CosignatoryModificationAction.Add, PublicAccount.createFromPublicKey('B0F93CBEE49EEB9953C6F3985B15A4F238E205584D8F924C621CBE4D7AC6EC24', NetworkType.MIJIN_TEST), ), new MultisigCosignatoryModification( - MultisigCosignatoryModificationType.Add, + CosignatoryModificationAction.Add, PublicAccount.createFromPublicKey('B1B5581FC81A6970DEE418D2C2978F2724228B7B36C5C6DF71B0162BB04778B4', NetworkType.MIJIN_TEST), )], @@ -55,17 +55,17 @@ describe('ModifyMultisigAccountTransaction', () => { }); it('should filled maxFee override transaction maxFee', () => { - const modifyMultisigAccountTransaction = ModifyMultisigAccountTransaction.create( + const modifyMultisigAccountTransaction = MultisigAccountModificationTransaction.create( Deadline.create(), 2, 1, [new MultisigCosignatoryModification( - MultisigCosignatoryModificationType.Add, + CosignatoryModificationAction.Add, PublicAccount.createFromPublicKey('B0F93CBEE49EEB9953C6F3985B15A4F238E205584D8F924C621CBE4D7AC6EC24', NetworkType.MIJIN_TEST), ), new MultisigCosignatoryModification( - MultisigCosignatoryModificationType.Add, + CosignatoryModificationAction.Add, PublicAccount.createFromPublicKey('B1B5581FC81A6970DEE418D2C2978F2724228B7B36C5C6DF71B0162BB04778B4', NetworkType.MIJIN_TEST), )], @@ -77,18 +77,18 @@ describe('ModifyMultisigAccountTransaction', () => { expect(modifyMultisigAccountTransaction.maxFee.lower).to.be.equal(1); }); - it('should createComplete an ModifyMultisigAccountTransaction object and sign it', () => { - const modifyMultisigAccountTransaction = ModifyMultisigAccountTransaction.create( + it('should createComplete an MultisigAccountModificationTransaction object and sign it', () => { + const modifyMultisigAccountTransaction = MultisigAccountModificationTransaction.create( Deadline.create(), 2, 1, [new MultisigCosignatoryModification( - MultisigCosignatoryModificationType.Add, + CosignatoryModificationAction.Add, PublicAccount.createFromPublicKey('B0F93CBEE49EEB9953C6F3985B15A4F238E205584D8F924C621CBE4D7AC6EC24', NetworkType.MIJIN_TEST), ), new MultisigCosignatoryModification( - MultisigCosignatoryModificationType.Add, + CosignatoryModificationAction.Add, PublicAccount.createFromPublicKey('B1B5581FC81A6970DEE418D2C2978F2724228B7B36C5C6DF71B0162BB04778B4', NetworkType.MIJIN_TEST), )], @@ -102,11 +102,11 @@ describe('ModifyMultisigAccountTransaction', () => { expect(modifyMultisigAccountTransaction.modifications.length) .to.be.equal(2); expect(modifyMultisigAccountTransaction.modifications[0].modificiationType) - .to.be.equal(MultisigCosignatoryModificationType.Add); + .to.be.equal(CosignatoryModificationAction.Add); expect(modifyMultisigAccountTransaction.modifications[0].cosignatoryPublicAccount.publicKey) .to.be.equal('B0F93CBEE49EEB9953C6F3985B15A4F238E205584D8F924C621CBE4D7AC6EC24'); expect(modifyMultisigAccountTransaction.modifications[1].modificiationType) - .to.be.equal(MultisigCosignatoryModificationType.Add); + .to.be.equal(CosignatoryModificationAction.Add); expect(modifyMultisigAccountTransaction.modifications[1].cosignatoryPublicAccount.publicKey) .to.be.equal('B1B5581FC81A6970DEE418D2C2978F2724228B7B36C5C6DF71B0162BB04778B4'); @@ -121,13 +121,13 @@ describe('ModifyMultisigAccountTransaction', () => { }); describe('size', () => { - it('should return 156 for ModifyMultisigAccountTransaction transaction byte size with 1 modification', () => { - const modifyMultisigAccountTransaction = ModifyMultisigAccountTransaction.create( + it('should return 156 for MultisigAccountModificationTransaction transaction byte size with 1 modification', () => { + const modifyMultisigAccountTransaction = MultisigAccountModificationTransaction.create( Deadline.create(), 1, 1, [new MultisigCosignatoryModification( - MultisigCosignatoryModificationType.Add, + CosignatoryModificationAction.Add, PublicAccount.createFromPublicKey('B0F93CBEE49EEB9953C6F3985B15A4F238E205584D8F924C621CBE4D7AC6EC24', NetworkType.MIJIN_TEST), )], diff --git a/test/model/transaction/MultisigCosignatoryModification.spec.ts b/test/model/transaction/MultisigCosignatoryModification.spec.ts index 5c03c03bc3..078f90fa83 100644 --- a/test/model/transaction/MultisigCosignatoryModification.spec.ts +++ b/test/model/transaction/MultisigCosignatoryModification.spec.ts @@ -17,48 +17,48 @@ import {expect} from 'chai'; import {PublicAccount} from '../../../src/model/account/PublicAccount'; import {NetworkType} from '../../../src/model/blockchain/NetworkType'; +import {CosignatoryModificationAction} from '../../../src/model/transaction/CosignatoryModificationAction'; import {MultisigCosignatoryModification} from '../../../src/model/transaction/MultisigCosignatoryModification'; -import {MultisigCosignatoryModificationType} from '../../../src/model/transaction/MultisigCosignatoryModificationType'; describe('MultisigCosignatoryModification', () => { it('should create Add MultisigCosignatoryModification', () => { const multisigCosignatoryModification = new MultisigCosignatoryModification( - MultisigCosignatoryModificationType.Add, + CosignatoryModificationAction.Add, PublicAccount.createFromPublicKey('C52C211CF935C61D65F26B253AA260416F018C3D21E4D184A7671F403C849BBB', NetworkType.MIJIN_TEST), ); expect(multisigCosignatoryModification.cosignatoryPublicAccount.publicKey) .to.be.equal('C52C211CF935C61D65F26B253AA260416F018C3D21E4D184A7671F403C849BBB'); - expect(multisigCosignatoryModification.modificiationType).to.be.equal(MultisigCosignatoryModificationType.Add); + expect(multisigCosignatoryModification.modificiationType).to.be.equal(CosignatoryModificationAction.Add); }); it('should create Add MultisigCosignatoryModification and get toDTO correctly', () => { const multisigCosignatoryModification = new MultisigCosignatoryModification( - MultisigCosignatoryModificationType.Add, + CosignatoryModificationAction.Add, PublicAccount.createFromPublicKey('C52C211CF935C61D65F26B253AA260416F018C3D21E4D184A7671F403C849BBB', NetworkType.MIJIN_TEST), ).toDTO(); expect(multisigCosignatoryModification.cosignatoryPublicKey) .to.be.equal('C52C211CF935C61D65F26B253AA260416F018C3D21E4D184A7671F403C849BBB'); - expect(multisigCosignatoryModification.modificiationType).to.be.equal(MultisigCosignatoryModificationType.Add); + expect(multisigCosignatoryModification.modificiationType).to.be.equal(CosignatoryModificationAction.Add); }); it('should create Remove MultisigCosignatoryModification', () => { const multisigCosignatoryModification = new MultisigCosignatoryModification( - MultisigCosignatoryModificationType.Remove, + CosignatoryModificationAction.Remove, PublicAccount.createFromPublicKey('C52C211CF935C61D65F26B253AA260416F018C3D21E4D184A7671F403C849BBB', NetworkType.MIJIN_TEST), ); expect(multisigCosignatoryModification.cosignatoryPublicAccount.publicKey) .to.be.equal('C52C211CF935C61D65F26B253AA260416F018C3D21E4D184A7671F403C849BBB'); - expect(multisigCosignatoryModification.modificiationType).to.be.equal(MultisigCosignatoryModificationType.Remove); + expect(multisigCosignatoryModification.modificiationType).to.be.equal(CosignatoryModificationAction.Remove); }); it('should create Remove MultisigCosignatoryModification and get toDTO correctly', () => { const multisigCosignatoryModification = new MultisigCosignatoryModification( - MultisigCosignatoryModificationType.Remove, + CosignatoryModificationAction.Remove, PublicAccount.createFromPublicKey('C52C211CF935C61D65F26B253AA260416F018C3D21E4D184A7671F403C849BBB', NetworkType.MIJIN_TEST), ).toDTO(); expect(multisigCosignatoryModification.cosignatoryPublicKey) .to.be.equal('C52C211CF935C61D65F26B253AA260416F018C3D21E4D184A7671F403C849BBB'); - expect(multisigCosignatoryModification.modificiationType).to.be.equal(MultisigCosignatoryModificationType.Remove); + expect(multisigCosignatoryModification.modificiationType).to.be.equal(CosignatoryModificationAction.Remove); }); }); diff --git a/test/model/transaction/RegisterNamespaceTransaction.spec.ts b/test/model/transaction/NamespaceRegistrationTransaction.spec.ts similarity index 76% rename from test/model/transaction/RegisterNamespaceTransaction.spec.ts rename to test/model/transaction/NamespaceRegistrationTransaction.spec.ts index dcd12d95f7..ddb27b4172 100644 --- a/test/model/transaction/RegisterNamespaceTransaction.spec.ts +++ b/test/model/transaction/NamespaceRegistrationTransaction.spec.ts @@ -19,11 +19,11 @@ import {Account} from '../../../src/model/account/Account'; import {NetworkType} from '../../../src/model/blockchain/NetworkType'; import { NamespaceId } from '../../../src/model/namespace/NamespaceId'; import {Deadline} from '../../../src/model/transaction/Deadline'; -import {RegisterNamespaceTransaction} from '../../../src/model/transaction/RegisterNamespaceTransaction'; +import {NamespaceRegistrationTransaction} from '../../../src/model/transaction/NamespaceRegistrationTransaction'; import {UInt64} from '../../../src/model/UInt64'; import {TestingAccount} from '../../conf/conf.spec'; -describe('RegisterNamespaceTransaction', () => { +describe('NamespaceRegistrationTransaction', () => { let account: Account; const generationHash = '57F7DA205008026C776CB6AED843393F04CD458E0AA2D9F1D5F31A402072B2D6'; before(() => { @@ -31,7 +31,7 @@ describe('RegisterNamespaceTransaction', () => { }); it('should default maxFee field be set to 0', () => { - const registerNamespaceTransaction = RegisterNamespaceTransaction.createRootNamespace( + const registerNamespaceTransaction = NamespaceRegistrationTransaction.createRootNamespace( Deadline.create(), 'root-test-namespace', UInt64.fromUint(1000), @@ -43,7 +43,7 @@ describe('RegisterNamespaceTransaction', () => { }); it('should filled maxFee override transaction maxFee', () => { - const registerNamespaceTransaction = RegisterNamespaceTransaction.createRootNamespace( + const registerNamespaceTransaction = NamespaceRegistrationTransaction.createRootNamespace( Deadline.create(), 'root-test-namespace', UInt64.fromUint(1000), @@ -55,8 +55,8 @@ describe('RegisterNamespaceTransaction', () => { expect(registerNamespaceTransaction.maxFee.lower).to.be.equal(1); }); - it('should createComplete an root RegisterNamespaceTransaction object and sign it', () => { - const registerNamespaceTransaction = RegisterNamespaceTransaction.createRootNamespace( + it('should createComplete an root NamespaceRegistrationTransaction object and sign it', () => { + const registerNamespaceTransaction = NamespaceRegistrationTransaction.createRootNamespace( Deadline.create(), 'root-test-namespace', UInt64.fromUint(1000), @@ -75,8 +75,8 @@ describe('RegisterNamespaceTransaction', () => { }); - it('should createComplete an sub RegisterNamespaceTransaction object and sign it', () => { - const registerNamespaceTransaction = RegisterNamespaceTransaction.createSubNamespace( + it('should createComplete an sub NamespaceRegistrationTransaction object and sign it', () => { + const registerNamespaceTransaction = NamespaceRegistrationTransaction.createSubNamespace( Deadline.create(), 'root-test-namespace', 'parent-test-namespace', @@ -92,8 +92,8 @@ describe('RegisterNamespaceTransaction', () => { }); - it('should createComplete an sub RegisterNamespaceTransaction object and sign it - ParentId', () => { - const registerNamespaceTransaction = RegisterNamespaceTransaction.createSubNamespace( + it('should createComplete an sub NamespaceRegistrationTransaction object and sign it - ParentId', () => { + const registerNamespaceTransaction = NamespaceRegistrationTransaction.createSubNamespace( Deadline.create(), 'root-test-namespace', new NamespaceId([929036875, 2226345261]), @@ -109,8 +109,8 @@ describe('RegisterNamespaceTransaction', () => { }); describe('size', () => { - it('should return 176 for RegisterNamespaceTransaction with name of 19 bytes', () => { - const registerNamespaceTransaction = RegisterNamespaceTransaction.createRootNamespace( + it('should return 176 for NamespaceRegistrationTransaction with name of 19 bytes', () => { + const registerNamespaceTransaction = NamespaceRegistrationTransaction.createRootNamespace( Deadline.create(), 'root-test-namespace', UInt64.fromUint(1000), diff --git a/test/service/AggregateTransactionService.spec.ts b/test/service/AggregateTransactionService.spec.ts index 6fe75cd7f7..36191ff368 100644 --- a/test/service/AggregateTransactionService.spec.ts +++ b/test/service/AggregateTransactionService.spec.ts @@ -25,10 +25,10 @@ import { MultisigAccountGraphInfo } from '../../src/model/account/MultisigAccoun import { MultisigAccountInfo } from '../../src/model/account/MultisigAccountInfo'; import {NetworkType} from '../../src/model/blockchain/NetworkType'; import { AggregateTransaction } from '../../src/model/transaction/AggregateTransaction'; +import { CosignatoryModificationAction } from '../../src/model/transaction/CosignatoryModificationAction'; import { Deadline } from '../../src/model/transaction/Deadline'; -import { ModifyMultisigAccountTransaction } from '../../src/model/transaction/ModifyMultisigAccountTransaction'; +import { MultisigAccountModificationTransaction } from '../../src/model/transaction/MultisigAccountModificationTransaction'; import { MultisigCosignatoryModification } from '../../src/model/transaction/MultisigCosignatoryModification'; -import { MultisigCosignatoryModificationType } from '../../src/model/transaction/MultisigCosignatoryModificationType'; import { PlainMessage } from '../../src/model/transaction/PlainMessage'; import { TransferTransaction } from '../../src/model/transaction/TransferTransaction'; import { AggregateTransactionService } from '../../src/service/AggregateTransactionService'; @@ -270,12 +270,12 @@ describe('AggregateTransactionService', () => { * The validator should use minRemoval value rather than minApproval value * to determine if the act is complete or not */ - const modifyMultisigTransaction = ModifyMultisigAccountTransaction.create( + const modifyMultisigTransaction = MultisigAccountModificationTransaction.create( Deadline.create(1, ChronoUnit.HOURS), 1, 1, [new MultisigCosignatoryModification( - MultisigCosignatoryModificationType.Remove, + CosignatoryModificationAction.Remove, account1.publicAccount, )], NetworkType.MIJIN_TEST, From b2338715f8fdcdf9d8b6a725310f1595c5c932d4 Mon Sep 17 00:00:00 2001 From: Steven Liu Date: Wed, 4 Sep 2019 14:02:23 +0100 Subject: [PATCH 03/10] Re-applied latest OpenAPI generated code (v.0.7.18) --- e2e/infrastructure/BlockHttp.spec.ts | 6 +- e2e/infrastructure/ChainHttp.spec.ts | 2 +- src/infrastructure/AccountHttp.ts | 42 +- src/infrastructure/BlockHttp.ts | 25 +- src/infrastructure/ChainHttp.ts | 10 +- src/infrastructure/ChainRepository.ts | 2 +- src/infrastructure/MosaicHttp.ts | 14 +- src/infrastructure/NamespaceHttp.ts | 28 +- src/infrastructure/api/accountRoutesApi.ts | 532 +++++++++--------- src/infrastructure/api/apis.ts | 2 +- src/infrastructure/api/blockRoutesApi.ts | 260 +++++---- src/infrastructure/api/chainRoutesApi.ts | 82 +-- src/infrastructure/api/diagnosticRoutesApi.ts | 80 +-- src/infrastructure/api/metadataRoutesApi.ts | 143 +++++ src/infrastructure/api/mosaicRoutesApi.ts | 125 ++-- src/infrastructure/api/namespaceRoutesApi.ts | 182 +++--- src/infrastructure/api/networkRoutesApi.ts | 40 +- src/infrastructure/api/nodeRoutesApi.ts | 80 +-- .../api/transactionRoutesApi.ts | 275 ++++----- ...ccountAddressRestrictionModificationDTO.ts | 55 ++ ...tAddressRestrictionModificationDTOAllOf.ts | 48 ++ ...untAddressRestrictionTransactionBodyDTO.ts | 53 ++ ...accountAddressRestrictionTransactionDTO.ts | 97 ++++ src/infrastructure/model/accountDTO.ts | 35 +- src/infrastructure/model/accountIds.ts | 6 +- .../model/accountIdsAddresses.ts | 48 ++ .../model/accountIdsPublicKeys.ts | 48 ++ src/infrastructure/model/accountInfoDTO.ts | 9 +- .../model/accountLinkActionEnum.ts | 35 ++ .../model/accountLinkTransactionBodyDTO.ts | 52 ++ .../model/accountLinkTransactionDTO.ts | 96 ++++ ...accountMosaicRestrictionModificationDTO.ts | 52 ++ ...ntMosaicRestrictionModificationDTOAllOf.ts | 45 ++ ...ountMosaicRestrictionTransactionBodyDTO.ts | 53 ++ .../accountMosaicRestrictionTransactionDTO.ts | 97 ++++ src/infrastructure/model/accountNamesDTO.ts | 6 +- ...ountOperationRestrictionModificationDTO.ts | 53 ++ ...perationRestrictionModificationDTOAllOf.ts | 46 ++ ...tOperationRestrictionTransactionBodyDTO.ts | 53 ++ ...countOperationRestrictionTransactionDTO.ts | 97 ++++ .../model/accountRestrictionDTO.ts | 8 +- ...ccountRestrictionModificationActionEnum.ts | 35 ++ .../accountRestrictionModificationDTO.ts | 46 ++ .../accountRestrictionModificationTypeEnum.ts | 35 ++ .../accountRestrictionTransactionBodyDTO.ts | 53 ++ .../model/accountRestrictionTransactionDTO.ts | 104 ++++ .../model/accountRestrictionTypeEnum.ts | 25 +- .../model/accountRestrictionsDTO.ts | 4 +- .../model/accountRestrictionsInfoDTO.ts | 2 +- src/infrastructure/model/accountTypeEnum.ts | 37 ++ src/infrastructure/model/accountsNamesDTO.ts | 49 ++ src/infrastructure/model/activityBucketDTO.ts | 63 +++ .../model/addressAliasTransactionBodyDTO.ts | 61 ++ .../model/addressAliasTransactionDTO.ts | 105 ++++ ...ressMosaicRestrictionTransactionBodyDTO.ts | 72 +++ .../addressMosaicRestrictionTransactionDTO.ts | 116 ++++ .../model/aggregateBondedTransactionDTO.ts | 103 ++++ .../model/aggregateCompleteTransactionDTO.ts | 103 ++++ .../model/aggregateTransactionBodyDTO.ts | 59 ++ .../model/aggregateTransactionDTO.ts | 110 ++++ src/infrastructure/model/aliasActionEnum.ts | 35 ++ src/infrastructure/model/aliasDTO.ts | 4 +- src/infrastructure/model/aliasTypeEnum.ts | 19 +- src/infrastructure/model/amount.ts | 34 ++ .../model/announceTransactionInfoDTO.ts | 2 +- .../model/artifactExpiryReceiptDTO.ts | 65 +++ .../model/artifactExpiryReceiptDTOAllOf.ts | 44 ++ .../model/balanceChangeReceiptDTO.ts | 78 +++ .../model/balanceChangeReceiptDTOAllOf.ts | 57 ++ .../model/balanceTransferReceiptDTO.ts | 87 +++ .../model/balanceTransferReceiptDTOAllOf.ts | 66 +++ src/infrastructure/model/blockDTO.ts | 57 +- src/infrastructure/model/blockDTOAllOf.ts | 96 ++++ src/infrastructure/model/blockDuration.ts | 34 ++ src/infrastructure/model/blockInfoDTO.ts | 2 +- src/infrastructure/model/blockMetaDTO.ts | 20 +- .../model/blockchainScoreDTO.ts | 2 +- src/infrastructure/model/chainScoreDTO.ts | 51 ++ .../model/communicationTimestamps.ts | 2 +- .../model/communicationTimestampsDTO.ts | 51 ++ .../model/cosignatoryModificationAction.ts | 35 ++ .../cosignatoryModificationActionEnum.ts | 35 ++ .../model/cosignatoryModificationDTO.ts | 52 ++ src/infrastructure/model/cosignature.ts | 17 +- src/infrastructure/model/cosignatureDTO.ts | 53 ++ .../model/cosignatureDTOAllOf.ts | 45 ++ src/infrastructure/model/difficulty.ts | 34 ++ ...AccountAddressRestrictionTransactionDTO.ts | 88 +++ .../embeddedAccountLinkTransactionDTO.ts | 87 +++ ...dAccountMosaicRestrictionTransactionDTO.ts | 88 +++ ...countOperationRestrictionTransactionDTO.ts | 88 +++ ...mbeddedAccountRestrictionTransactionDTO.ts | 92 +++ .../embeddedAddressAliasTransactionDTO.ts | 96 ++++ ...dAddressMosaicRestrictionTransactionDTO.ts | 107 ++++ ...edGlobalMosaicRestrictionTransactionDTO.ts | 117 ++++ .../model/embeddedHashLockTransactionDTO.ts | 99 ++++ ...ddedModifyMultisigAccountTransactionDTO.ts | 103 ++++ .../embeddedMosaicAliasTransactionDTO.ts | 93 +++ .../embeddedMosaicDefinitionTransactionDTO.ts | 113 ++++ ...mbeddedMosaicSupplyChangeTransactionDTO.ts | 93 +++ ...ltisigAccountModificationTransactionDTO.ts | 102 ++++ ...ddedNamespaceRegistrationTransactionDTO.ts | 108 ++++ ...embeddedRegisterNamespaceTransactionDTO.ts | 109 ++++ .../model/embeddedSecretLockTransactionDTO.ts | 114 ++++ .../embeddedSecretProofTransactionDTO.ts | 105 ++++ .../model/embeddedTransactionDTO.ts | 74 +++ .../model/embeddedTransactionInfoDTO.ts | 52 ++ .../model/embeddedTransactionMetaDTO.ts | 69 +++ .../model/embeddedTransferTransactionDTO.ts | 100 ++++ src/infrastructure/model/entityDTO.ts | 60 ++ src/infrastructure/model/entityTypeEnum.ts | 53 ++ ...obalMosaicRestrictionTransactionBodyDTO.ts | 82 +++ .../globalMosaicRestrictionTransactionDTO.ts | 126 +++++ src/infrastructure/model/hashAlgorithmEnum.ts | 37 ++ .../model/hashLockTransactionBodyDTO.ts | 58 ++ .../model/hashLockTransactionDTO.ts | 102 ++++ src/infrastructure/model/height.ts | 34 ++ src/infrastructure/model/heightInfoDTO.ts | 2 +- src/infrastructure/model/importance.ts | 34 ++ .../model/inflationReceiptDTO.ts | 72 +++ .../model/inflationReceiptDTOAllOf.ts | 51 ++ src/infrastructure/model/keyMetadataDTO.ts | 58 ++ src/infrastructure/model/linkActionEnum.ts | 35 ++ .../model/lockHashAlgorithmEnum.ts | 37 ++ src/infrastructure/model/merklePathItem.ts | 2 +- .../model/merkleProofInfoDTO.ts | 21 +- src/infrastructure/model/messageDTO.ts | 55 ++ src/infrastructure/model/messageTypeEnum.ts | 34 ++ src/infrastructure/model/metadataDTO.ts | 82 +++ src/infrastructure/model/metadataTypeEnum.ts | 36 ++ src/infrastructure/model/modelError.ts | 51 ++ src/infrastructure/model/models.ts | 382 +++++++++++-- ...modifyMultisigAccountTransactionBodyDTO.ts | 67 +++ .../modifyMultisigAccountTransactionDTO.ts | 112 ++++ src/infrastructure/model/mosaic.ts | 51 ++ .../model/mosaicAliasTransactionBodyDTO.ts | 58 ++ .../model/mosaicAliasTransactionDTO.ts | 102 ++++ src/infrastructure/model/mosaicDTO.ts | 42 +- .../model/mosaicDefinitionDTO.ts | 7 +- .../mosaicDefinitionTransactionBodyDTO.ts | 78 +++ .../model/mosaicDefinitionTransactionDTO.ts | 122 ++++ src/infrastructure/model/mosaicFlagsEnum.ts | 37 ++ src/infrastructure/model/mosaicId.ts | 34 ++ src/infrastructure/model/mosaicIds.ts | 4 +- src/infrastructure/model/mosaicInfoDTO.ts | 15 +- src/infrastructure/model/mosaicMetaDTO.ts | 2 +- src/infrastructure/model/mosaicNamesDTO.ts | 4 +- .../model/mosaicPropertiesDTO.ts | 63 +++ src/infrastructure/model/mosaicPropertyDTO.ts | 2 +- .../model/mosaicPropertyIdEnum.ts | 19 +- .../model/mosaicRestrictionTypeEnum.ts | 40 ++ .../model/mosaicSupplyChangeActionEnum.ts | 35 ++ .../model/mosaicSupplyChangeDirectionEnum.ts | 35 ++ .../mosaicSupplyChangeTransactionBodyDTO.ts | 58 ++ .../model/mosaicSupplyChangeTransactionDTO.ts | 102 ++++ src/infrastructure/model/mosaicsNamesDTO.ts | 49 ++ .../model/multisigAccountGraphInfoDTO.ts | 6 +- .../model/multisigAccountInfoDTO.ts | 2 +- ...igAccountModificationTransactionBodyDTO.ts | 67 +++ ...ltisigAccountModificationTransactionDTO.ts | 111 ++++ src/infrastructure/model/multisigDTO.ts | 35 +- .../model/multisigModificationTypeEnum.ts | 18 +- src/infrastructure/model/namespaceDTO.ts | 71 ++- src/infrastructure/model/namespaceId.ts | 34 ++ src/infrastructure/model/namespaceIds.ts | 4 +- src/infrastructure/model/namespaceInfoDTO.ts | 2 +- src/infrastructure/model/namespaceMetaDTO.ts | 2 +- src/infrastructure/model/namespaceNameDTO.ts | 4 +- ...namespaceRegistrationTransactionBodyDTO.ts | 73 +++ .../namespaceRegistrationTransactionDTO.ts | 117 ++++ .../model/namespaceRegistrationTypeEnum.ts | 35 ++ src/infrastructure/model/namespaceTypeEnum.ts | 18 +- src/infrastructure/model/networkTypeDTO.ts | 4 +- src/infrastructure/model/nodeInfoDTO.ts | 13 +- src/infrastructure/model/nodeTimeDTO.ts | 8 +- src/infrastructure/model/receiptDTO.ts | 55 ++ src/infrastructure/model/receiptTypeEnum.ts | 30 +- .../registerNamespaceTransactionBodyDTO.ts | 73 +++ .../model/registerNamespaceTransactionDTO.ts | 118 ++++ .../model/resolutionEntryDTO.ts | 6 +- .../model/resolutionStatementDTO.ts | 8 +- src/infrastructure/model/rolesTypeEnum.ts | 18 +- src/infrastructure/model/score.ts | 34 ++ .../model/secretLockTransactionBodyDTO.ts | 79 +++ .../model/secretLockTransactionDTO.ts | 123 ++++ .../model/secretProofTransactionBodyDTO.ts | 70 +++ .../model/secretProofTransactionDTO.ts | 114 ++++ src/infrastructure/model/serverDTO.ts | 2 +- src/infrastructure/model/serverInfoDTO.ts | 6 +- src/infrastructure/model/sourceDTO.ts | 8 +- src/infrastructure/model/statementsDTO.ts | 10 +- src/infrastructure/model/storageInfoDTO.ts | 8 +- src/infrastructure/model/timestamp.ts | 34 ++ .../model/transactionBodyDTO.ts | 51 ++ src/infrastructure/model/transactionDTO.ts | 81 +++ src/infrastructure/model/transactionHashes.ts | 4 +- src/infrastructure/model/transactionIds.ts | 4 +- .../model/transactionInfoDTO.ts | 4 +- .../model/transactionMetaDTO.ts | 2 +- .../model/transactionPayload.ts | 4 +- .../model/transactionStatementDTO.ts | 10 +- .../model/transactionStatusDTO.ts | 2 +- .../model/transactionTypeEnum.ts | 51 ++ .../model/transferTransactionBodyDTO.ts | 65 +++ .../model/transferTransactionDTO.ts | 109 ++++ src/infrastructure/model/unresolvedMosaic.ts | 51 ++ .../model/unresolvedMosaicId.ts | 34 ++ .../model/verifiableEntityDTO.ts | 45 ++ src/model/account/AccountInfo.ts | 20 +- .../AccountType.ts} | 24 +- src/model/account/ActivityBucket.ts | 46 ++ src/model/blockchain/MerkleProofInfo.ts | 15 +- src/model/model.ts | 3 +- src/model/mosaic/MosaicInfo.ts | 8 +- src/model/namespace/NamespaceInfo.ts | 10 +- src/service/MosaicAmountView.ts | 2 +- test/model/account/AccountInfo.spec.ts | 21 +- test/model/mosaic/MosaicAmountView.spec.ts | 4 +- test/model/mosaic/MosaicInfo.spec.ts | 21 +- test/model/mosaic/MosaicView.spec.ts | 1 - 220 files changed, 10797 insertions(+), 1335 deletions(-) create mode 100644 src/infrastructure/api/metadataRoutesApi.ts create mode 100644 src/infrastructure/model/accountAddressRestrictionModificationDTO.ts create mode 100644 src/infrastructure/model/accountAddressRestrictionModificationDTOAllOf.ts create mode 100644 src/infrastructure/model/accountAddressRestrictionTransactionBodyDTO.ts create mode 100644 src/infrastructure/model/accountAddressRestrictionTransactionDTO.ts create mode 100644 src/infrastructure/model/accountIdsAddresses.ts create mode 100644 src/infrastructure/model/accountIdsPublicKeys.ts create mode 100644 src/infrastructure/model/accountLinkActionEnum.ts create mode 100644 src/infrastructure/model/accountLinkTransactionBodyDTO.ts create mode 100644 src/infrastructure/model/accountLinkTransactionDTO.ts create mode 100644 src/infrastructure/model/accountMosaicRestrictionModificationDTO.ts create mode 100644 src/infrastructure/model/accountMosaicRestrictionModificationDTOAllOf.ts create mode 100644 src/infrastructure/model/accountMosaicRestrictionTransactionBodyDTO.ts create mode 100644 src/infrastructure/model/accountMosaicRestrictionTransactionDTO.ts create mode 100644 src/infrastructure/model/accountOperationRestrictionModificationDTO.ts create mode 100644 src/infrastructure/model/accountOperationRestrictionModificationDTOAllOf.ts create mode 100644 src/infrastructure/model/accountOperationRestrictionTransactionBodyDTO.ts create mode 100644 src/infrastructure/model/accountOperationRestrictionTransactionDTO.ts create mode 100644 src/infrastructure/model/accountRestrictionModificationActionEnum.ts create mode 100644 src/infrastructure/model/accountRestrictionModificationDTO.ts create mode 100644 src/infrastructure/model/accountRestrictionModificationTypeEnum.ts create mode 100644 src/infrastructure/model/accountRestrictionTransactionBodyDTO.ts create mode 100644 src/infrastructure/model/accountRestrictionTransactionDTO.ts create mode 100644 src/infrastructure/model/accountTypeEnum.ts create mode 100644 src/infrastructure/model/accountsNamesDTO.ts create mode 100644 src/infrastructure/model/activityBucketDTO.ts create mode 100644 src/infrastructure/model/addressAliasTransactionBodyDTO.ts create mode 100644 src/infrastructure/model/addressAliasTransactionDTO.ts create mode 100644 src/infrastructure/model/addressMosaicRestrictionTransactionBodyDTO.ts create mode 100644 src/infrastructure/model/addressMosaicRestrictionTransactionDTO.ts create mode 100644 src/infrastructure/model/aggregateBondedTransactionDTO.ts create mode 100644 src/infrastructure/model/aggregateCompleteTransactionDTO.ts create mode 100644 src/infrastructure/model/aggregateTransactionBodyDTO.ts create mode 100644 src/infrastructure/model/aggregateTransactionDTO.ts create mode 100644 src/infrastructure/model/aliasActionEnum.ts create mode 100644 src/infrastructure/model/amount.ts create mode 100644 src/infrastructure/model/artifactExpiryReceiptDTO.ts create mode 100644 src/infrastructure/model/artifactExpiryReceiptDTOAllOf.ts create mode 100644 src/infrastructure/model/balanceChangeReceiptDTO.ts create mode 100644 src/infrastructure/model/balanceChangeReceiptDTOAllOf.ts create mode 100644 src/infrastructure/model/balanceTransferReceiptDTO.ts create mode 100644 src/infrastructure/model/balanceTransferReceiptDTOAllOf.ts create mode 100644 src/infrastructure/model/blockDTOAllOf.ts create mode 100644 src/infrastructure/model/blockDuration.ts create mode 100644 src/infrastructure/model/chainScoreDTO.ts create mode 100644 src/infrastructure/model/communicationTimestampsDTO.ts create mode 100644 src/infrastructure/model/cosignatoryModificationAction.ts create mode 100644 src/infrastructure/model/cosignatoryModificationActionEnum.ts create mode 100644 src/infrastructure/model/cosignatoryModificationDTO.ts create mode 100644 src/infrastructure/model/cosignatureDTO.ts create mode 100644 src/infrastructure/model/cosignatureDTOAllOf.ts create mode 100644 src/infrastructure/model/difficulty.ts create mode 100644 src/infrastructure/model/embeddedAccountAddressRestrictionTransactionDTO.ts create mode 100644 src/infrastructure/model/embeddedAccountLinkTransactionDTO.ts create mode 100644 src/infrastructure/model/embeddedAccountMosaicRestrictionTransactionDTO.ts create mode 100644 src/infrastructure/model/embeddedAccountOperationRestrictionTransactionDTO.ts create mode 100644 src/infrastructure/model/embeddedAccountRestrictionTransactionDTO.ts create mode 100644 src/infrastructure/model/embeddedAddressAliasTransactionDTO.ts create mode 100644 src/infrastructure/model/embeddedAddressMosaicRestrictionTransactionDTO.ts create mode 100644 src/infrastructure/model/embeddedGlobalMosaicRestrictionTransactionDTO.ts create mode 100644 src/infrastructure/model/embeddedHashLockTransactionDTO.ts create mode 100644 src/infrastructure/model/embeddedModifyMultisigAccountTransactionDTO.ts create mode 100644 src/infrastructure/model/embeddedMosaicAliasTransactionDTO.ts create mode 100644 src/infrastructure/model/embeddedMosaicDefinitionTransactionDTO.ts create mode 100644 src/infrastructure/model/embeddedMosaicSupplyChangeTransactionDTO.ts create mode 100644 src/infrastructure/model/embeddedMultisigAccountModificationTransactionDTO.ts create mode 100644 src/infrastructure/model/embeddedNamespaceRegistrationTransactionDTO.ts create mode 100644 src/infrastructure/model/embeddedRegisterNamespaceTransactionDTO.ts create mode 100644 src/infrastructure/model/embeddedSecretLockTransactionDTO.ts create mode 100644 src/infrastructure/model/embeddedSecretProofTransactionDTO.ts create mode 100644 src/infrastructure/model/embeddedTransactionDTO.ts create mode 100644 src/infrastructure/model/embeddedTransactionInfoDTO.ts create mode 100644 src/infrastructure/model/embeddedTransactionMetaDTO.ts create mode 100644 src/infrastructure/model/embeddedTransferTransactionDTO.ts create mode 100644 src/infrastructure/model/entityDTO.ts create mode 100644 src/infrastructure/model/entityTypeEnum.ts create mode 100644 src/infrastructure/model/globalMosaicRestrictionTransactionBodyDTO.ts create mode 100644 src/infrastructure/model/globalMosaicRestrictionTransactionDTO.ts create mode 100644 src/infrastructure/model/hashAlgorithmEnum.ts create mode 100644 src/infrastructure/model/hashLockTransactionBodyDTO.ts create mode 100644 src/infrastructure/model/hashLockTransactionDTO.ts create mode 100644 src/infrastructure/model/height.ts create mode 100644 src/infrastructure/model/importance.ts create mode 100644 src/infrastructure/model/inflationReceiptDTO.ts create mode 100644 src/infrastructure/model/inflationReceiptDTOAllOf.ts create mode 100644 src/infrastructure/model/keyMetadataDTO.ts create mode 100644 src/infrastructure/model/linkActionEnum.ts create mode 100644 src/infrastructure/model/lockHashAlgorithmEnum.ts create mode 100644 src/infrastructure/model/messageDTO.ts create mode 100644 src/infrastructure/model/messageTypeEnum.ts create mode 100644 src/infrastructure/model/metadataDTO.ts create mode 100644 src/infrastructure/model/metadataTypeEnum.ts create mode 100644 src/infrastructure/model/modelError.ts create mode 100644 src/infrastructure/model/modifyMultisigAccountTransactionBodyDTO.ts create mode 100644 src/infrastructure/model/modifyMultisigAccountTransactionDTO.ts create mode 100644 src/infrastructure/model/mosaic.ts create mode 100644 src/infrastructure/model/mosaicAliasTransactionBodyDTO.ts create mode 100644 src/infrastructure/model/mosaicAliasTransactionDTO.ts create mode 100644 src/infrastructure/model/mosaicDefinitionTransactionBodyDTO.ts create mode 100644 src/infrastructure/model/mosaicDefinitionTransactionDTO.ts create mode 100644 src/infrastructure/model/mosaicFlagsEnum.ts create mode 100644 src/infrastructure/model/mosaicId.ts create mode 100644 src/infrastructure/model/mosaicPropertiesDTO.ts create mode 100644 src/infrastructure/model/mosaicRestrictionTypeEnum.ts create mode 100644 src/infrastructure/model/mosaicSupplyChangeActionEnum.ts create mode 100644 src/infrastructure/model/mosaicSupplyChangeDirectionEnum.ts create mode 100644 src/infrastructure/model/mosaicSupplyChangeTransactionBodyDTO.ts create mode 100644 src/infrastructure/model/mosaicSupplyChangeTransactionDTO.ts create mode 100644 src/infrastructure/model/mosaicsNamesDTO.ts create mode 100644 src/infrastructure/model/multisigAccountModificationTransactionBodyDTO.ts create mode 100644 src/infrastructure/model/multisigAccountModificationTransactionDTO.ts create mode 100644 src/infrastructure/model/namespaceId.ts create mode 100644 src/infrastructure/model/namespaceRegistrationTransactionBodyDTO.ts create mode 100644 src/infrastructure/model/namespaceRegistrationTransactionDTO.ts create mode 100644 src/infrastructure/model/namespaceRegistrationTypeEnum.ts create mode 100644 src/infrastructure/model/receiptDTO.ts create mode 100644 src/infrastructure/model/registerNamespaceTransactionBodyDTO.ts create mode 100644 src/infrastructure/model/registerNamespaceTransactionDTO.ts create mode 100644 src/infrastructure/model/score.ts create mode 100644 src/infrastructure/model/secretLockTransactionBodyDTO.ts create mode 100644 src/infrastructure/model/secretLockTransactionDTO.ts create mode 100644 src/infrastructure/model/secretProofTransactionBodyDTO.ts create mode 100644 src/infrastructure/model/secretProofTransactionDTO.ts create mode 100644 src/infrastructure/model/timestamp.ts create mode 100644 src/infrastructure/model/transactionBodyDTO.ts create mode 100644 src/infrastructure/model/transactionDTO.ts create mode 100644 src/infrastructure/model/transactionTypeEnum.ts create mode 100644 src/infrastructure/model/transferTransactionBodyDTO.ts create mode 100644 src/infrastructure/model/transferTransactionDTO.ts create mode 100644 src/infrastructure/model/unresolvedMosaic.ts create mode 100644 src/infrastructure/model/unresolvedMosaicId.ts create mode 100644 src/infrastructure/model/verifiableEntityDTO.ts rename src/model/{blockchain/MerkleProofInfoPayload.ts => account/AccountType.ts} (64%) create mode 100644 src/model/account/ActivityBucket.ts diff --git a/e2e/infrastructure/BlockHttp.spec.ts b/e2e/infrastructure/BlockHttp.spec.ts index f309f65d70..b52137e3d5 100644 --- a/e2e/infrastructure/BlockHttp.spec.ts +++ b/e2e/infrastructure/BlockHttp.spec.ts @@ -145,8 +145,7 @@ describe('BlockHttp', () => { it('should return Merkle Receipts', (done) => { blockHttp.getMerkleReceipts(chainHeight, blockReceiptHash) .subscribe((merkleReceipts) => { - expect(merkleReceipts.type).not.to.be.null; - expect(merkleReceipts.payload).not.to.be.null; + expect(merkleReceipts.merklePath).not.to.be.null; done(); }); }); @@ -155,8 +154,7 @@ describe('BlockHttp', () => { it('should return Merkle Transaction', (done) => { blockHttp.getMerkleTransaction(chainHeight, blockTransactionHash) .subscribe((merkleTransactionss) => { - expect(merkleTransactionss.type).not.to.be.null; - expect(merkleTransactionss.payload).not.to.be.null; + expect(merkleTransactionss.merklePath).not.to.be.null; done(); }); }); diff --git a/e2e/infrastructure/ChainHttp.spec.ts b/e2e/infrastructure/ChainHttp.spec.ts index 4f9842522d..e761530138 100644 --- a/e2e/infrastructure/ChainHttp.spec.ts +++ b/e2e/infrastructure/ChainHttp.spec.ts @@ -43,7 +43,7 @@ describe('ChainHttp', () => { describe('getBlockchainScore', () => { it('should return blockchain score', (done) => { - chainHttp.getBlockchainScore() + chainHttp.getChainScore() .subscribe((blockchainScore) => { expect(blockchainScore.scoreLow).to.not.be.equal(undefined); expect(blockchainScore.scoreHigh.lower).to.be.equal(0); diff --git a/src/infrastructure/AccountHttp.ts b/src/infrastructure/AccountHttp.ts index aed431fd19..9aa45bc530 100644 --- a/src/infrastructure/AccountHttp.ts +++ b/src/infrastructure/AccountHttp.ts @@ -21,6 +21,7 @@ import { DtoMapping } from '../core/utils/DtoMapping'; import {AccountInfo} from '../model/account/AccountInfo'; import { AccountNames } from '../model/account/AccountNames'; import { AccountRestrictionsInfo } from '../model/account/AccountRestrictionsInfo'; +import { ActivityBucket } from '../model/account/ActivityBucket'; import {Address} from '../model/account/Address'; import {MultisigAccountGraphInfo} from '../model/account/MultisigAccountGraphInfo'; import {MultisigAccountInfo} from '../model/account/MultisigAccountInfo'; @@ -79,11 +80,20 @@ export class AccountHttp extends Http implements AccountRepository { map((response: { response: ClientResponse; body: AccountInfoDTO; }) => { const accountInfoDTO = response.body; return new AccountInfo( - accountInfoDTO.meta, Address.createFromEncoded(accountInfoDTO.account.address), new UInt64(accountInfoDTO.account.addressHeight), accountInfoDTO.account.publicKey, new UInt64(accountInfoDTO.account.publicKeyHeight), + accountInfoDTO.account.accountType.valueOf(), + accountInfoDTO.account.linkedAccountKey, + accountInfoDTO.account.activityBuckets.map((bucket) => { + return new ActivityBucket( + bucket.startHeight, + bucket.totalFeesPaid, + bucket.beneficiaryCount, + bucket.rawScore, + ); + }), accountInfoDTO.account.mosaics.map((mosaicDTO) => new Mosaic( new MosaicId(mosaicDTO.id), new UInt64(mosaicDTO.amount), @@ -147,16 +157,28 @@ export class AccountHttp extends Http implements AccountRepository { const accountsInfoMetaDataDTO = response.body; return accountsInfoMetaDataDTO.map((accountInfoDTO: AccountInfoDTO) => { return new AccountInfo( - accountInfoDTO.meta, Address.createFromEncoded(accountInfoDTO.account.address), new UInt64(accountInfoDTO.account.addressHeight), accountInfoDTO.account.publicKey, new UInt64(accountInfoDTO.account.publicKeyHeight), - accountInfoDTO.account.mosaics.map((mosaicDTO: MosaicDTO) => - new Mosaic(new MosaicId(mosaicDTO.id), new UInt64(mosaicDTO.amount))), + accountInfoDTO.account.accountType.valueOf(), + accountInfoDTO.account.linkedAccountKey, + accountInfoDTO.account.activityBuckets.map((bucket) => { + return new ActivityBucket( + bucket.startHeight, + bucket.totalFeesPaid, + bucket.beneficiaryCount, + bucket.rawScore, + ); + }), + accountInfoDTO.account.mosaics.map((mosaicDTO) => new Mosaic( + new MosaicId(mosaicDTO.id), + new UInt64(mosaicDTO.amount), + )), new UInt64(accountInfoDTO.account.importance), new UInt64(accountInfoDTO.account.importanceHeight), ); + }); }), catchError((error) => throwError(error)), @@ -195,12 +217,12 @@ export class AccountHttp extends Http implements AccountRepository { .pipe(map((response: { response: ClientResponse; body: MultisigAccountInfoDTO; }) => { const multisigAccountInfoDTO = response.body; return new MultisigAccountInfo( - PublicAccount.createFromPublicKey(multisigAccountInfoDTO.multisig.account, networkType), + PublicAccount.createFromPublicKey(multisigAccountInfoDTO.multisig.accountPublicKey, networkType), multisigAccountInfoDTO.multisig.minApproval, multisigAccountInfoDTO.multisig.minRemoval, - multisigAccountInfoDTO.multisig.cosignatories + multisigAccountInfoDTO.multisig.cosignatoryPublicKeys .map((cosigner) => PublicAccount.createFromPublicKey(cosigner, networkType)), - multisigAccountInfoDTO.multisig.multisigAccounts + multisigAccountInfoDTO.multisig.multisigPublicKeys .map((multisigAccount) => PublicAccount.createFromPublicKey(multisigAccount, networkType)), ); }), @@ -224,12 +246,12 @@ export class AccountHttp extends Http implements AccountRepository { multisigAccounts.set(multisigAccountGraphInfoDTO.level, multisigAccountGraphInfoDTO.multisigEntries.map((multisigAccountInfoDTO) => { return new MultisigAccountInfo( - PublicAccount.createFromPublicKey(multisigAccountInfoDTO.multisig.account, networkType), + PublicAccount.createFromPublicKey(multisigAccountInfoDTO.multisig.accountPublicKey, networkType), multisigAccountInfoDTO.multisig.minApproval, multisigAccountInfoDTO.multisig.minRemoval, - multisigAccountInfoDTO.multisig.cosignatories + multisigAccountInfoDTO.multisig.cosignatoryPublicKeys .map((cosigner) => PublicAccount.createFromPublicKey(cosigner, networkType)), - multisigAccountInfoDTO.multisig.multisigAccounts + multisigAccountInfoDTO.multisig.multisigPublicKeys .map((multisigAccountDTO) => PublicAccount.createFromPublicKey(multisigAccountDTO, networkType))); }), diff --git a/src/infrastructure/BlockHttp.ts b/src/infrastructure/BlockHttp.ts index a6f4ce9bb8..ad027e3db2 100644 --- a/src/infrastructure/BlockHttp.ts +++ b/src/infrastructure/BlockHttp.ts @@ -21,7 +21,6 @@ import {PublicAccount} from '../model/account/PublicAccount'; import {BlockInfo} from '../model/blockchain/BlockInfo'; import { MerklePathItem } from '../model/blockchain/MerklePathItem'; import { MerkleProofInfo } from '../model/blockchain/MerkleProofInfo'; -import { MerkleProofInfoPayload } from '../model/blockchain/MerkleProofInfoPayload'; import { Statement } from '../model/receipt/Statement'; import {Transaction} from '../model/transaction/Transaction'; import {UInt64} from '../model/UInt64'; @@ -90,7 +89,7 @@ export class BlockHttp extends Http implements BlockRepository { new UInt64(blockDTO.meta.totalFee), blockDTO.meta.numTransactions, blockDTO.block.signature, - PublicAccount.createFromPublicKey(blockDTO.block.signer, networkType), + PublicAccount.createFromPublicKey(blockDTO.block.signerPublicKey, networkType), networkType, parseInt((blockDTO.block.version as number).toString(16).substr(2, 2), 16), // Tx version blockDTO.block.type, @@ -99,8 +98,8 @@ export class BlockHttp extends Http implements BlockRepository { new UInt64(blockDTO.block.difficulty), blockDTO.block.feeMultiplier, blockDTO.block.previousBlockHash, - blockDTO.block.blockTransactionsHash, - blockDTO.block.blockReceiptsHash, + blockDTO.block.transactionsHash, + blockDTO.block.receiptsHash, blockDTO.block.stateHash, extractBeneficiary(blockDTO, networkType), ); @@ -151,7 +150,7 @@ export class BlockHttp extends Http implements BlockRepository { new UInt64(blockDTO.meta.totalFee), blockDTO.meta.numTransactions, blockDTO.block.signature, - PublicAccount.createFromPublicKey(blockDTO.block.signer, networkType), + PublicAccount.createFromPublicKey(blockDTO.block.signerPublicKey, networkType), networkType, parseInt((blockDTO.block.version as number).toString(16).substr(2, 2), 16), // Tx version blockDTO.block.type, @@ -160,8 +159,8 @@ export class BlockHttp extends Http implements BlockRepository { new UInt64(blockDTO.block.difficulty), blockDTO.block.feeMultiplier, blockDTO.block.previousBlockHash, - blockDTO.block.blockTransactionsHash, - blockDTO.block.blockReceiptsHash, + blockDTO.block.transactionsHash, + blockDTO.block.receiptsHash, blockDTO.block.stateHash, extractBeneficiary(blockDTO, networkType), ); @@ -187,10 +186,8 @@ export class BlockHttp extends Http implements BlockRepository { map((response: { response: ClientResponse; body: MerkleProofInfoDTO; } ) => { const merkleProofReceipt = response.body; return new MerkleProofInfo( - new MerkleProofInfoPayload( - merkleProofReceipt.payload.merklePath!.map( - (payload) => new MerklePathItem(payload.position, payload.hash))), - merkleProofReceipt.type, + merkleProofReceipt.merklePath!.map( + (payload) => new MerklePathItem(payload.position, payload.hash)), ); }), catchError((error) => throwError(this.errorHandling(error))), @@ -213,10 +210,8 @@ export class BlockHttp extends Http implements BlockRepository { map((response: { response: ClientResponse; body: MerkleProofInfoDTO; } ) => { const merkleProofTransaction = response.body; return new MerkleProofInfo( - new MerkleProofInfoPayload( - merkleProofTransaction.payload.merklePath!.map((payload) => - new MerklePathItem(payload.position, payload.hash))), - merkleProofTransaction.type, + merkleProofTransaction.merklePath!.map( + (payload) => new MerklePathItem(payload.position, payload.hash)), ); }), catchError((error) => throwError(this.errorHandling(error))), diff --git a/src/infrastructure/ChainHttp.ts b/src/infrastructure/ChainHttp.ts index 5b32953b6f..7082fc17af 100644 --- a/src/infrastructure/ChainHttp.ts +++ b/src/infrastructure/ChainHttp.ts @@ -19,11 +19,11 @@ import {from as observableFrom, Observable, throwError} from 'rxjs'; import {catchError, map} from 'rxjs/operators'; import {BlockchainScore} from '../model/blockchain/BlockchainScore'; import {UInt64} from '../model/UInt64'; -import { BlockchainScoreDTO, - ChainRoutesApi, +import { ChainRoutesApi, HeightInfoDTO } from './api'; import { ChainRepository } from './ChainRepository'; import {Http} from './Http'; +import { ChainScoreDTO } from './model/chainScoreDTO'; /** * Chian http repository. @@ -64,9 +64,9 @@ export class ChainHttp extends Http implements ChainRepository { * Gets current blockchain score * @returns Observable */ - public getBlockchainScore(): Observable { - return observableFrom(this.chainRoutesApi.getBlockchainScore()).pipe( - map((response: { response: ClientResponse; body: BlockchainScoreDTO; } ) => { + public getChainScore(): Observable { + return observableFrom(this.chainRoutesApi.getChainScore()).pipe( + map((response: { response: ClientResponse; body: ChainScoreDTO; } ) => { const blockchainScoreDTO = response.body; return new BlockchainScore( new UInt64(blockchainScoreDTO.scoreLow), diff --git a/src/infrastructure/ChainRepository.ts b/src/infrastructure/ChainRepository.ts index c3b640fe01..f081e621e6 100644 --- a/src/infrastructure/ChainRepository.ts +++ b/src/infrastructure/ChainRepository.ts @@ -34,5 +34,5 @@ export interface ChainRepository { * Gets current blockchain score * @returns Observable */ - getBlockchainScore(): Observable; + getChainScore(): Observable; } diff --git a/src/infrastructure/MosaicHttp.ts b/src/infrastructure/MosaicHttp.ts index b86fd4b730..c6b4060b5a 100644 --- a/src/infrastructure/MosaicHttp.ts +++ b/src/infrastructure/MosaicHttp.ts @@ -78,11 +78,10 @@ export class MosaicHttp extends Http implements MosaicRepository { duration = mosaicInfoDTO.mosaic.properties[MosaicPropertyType.Duration].value; } return new MosaicInfo( - mosaicInfoDTO.meta.id, - new MosaicId(mosaicInfoDTO.mosaic.mosaicId), + new MosaicId(mosaicInfoDTO.mosaic.id), new UInt64(mosaicInfoDTO.mosaic.supply), - new UInt64(mosaicInfoDTO.mosaic.height), - PublicAccount.createFromPublicKey(mosaicInfoDTO.mosaic.owner, networkType), + new UInt64(mosaicInfoDTO.mosaic.startHeight), + PublicAccount.createFromPublicKey(mosaicInfoDTO.mosaic.ownerPublicKey, networkType), mosaicInfoDTO.mosaic.revision, new MosaicProperties( mosaicFlag ? new UInt64(mosaicFlag) : UInt64.fromUint(0), @@ -124,11 +123,10 @@ export class MosaicHttp extends Http implements MosaicRepository { duration = mosaicInfoDTO.mosaic.properties[MosaicPropertyType.Duration].value; } return new MosaicInfo( - mosaicInfoDTO.meta.id, - new MosaicId(mosaicInfoDTO.mosaic.mosaicId), + new MosaicId(mosaicInfoDTO.mosaic.id), new UInt64(mosaicInfoDTO.mosaic.supply), - new UInt64(mosaicInfoDTO.mosaic.height), - PublicAccount.createFromPublicKey(mosaicInfoDTO.mosaic.owner, networkType), + new UInt64(mosaicInfoDTO.mosaic.startHeight), + PublicAccount.createFromPublicKey(mosaicInfoDTO.mosaic.ownerPublicKey, networkType), mosaicInfoDTO.mosaic.revision, new MosaicProperties( mosaicFlag ? new UInt64(mosaicFlag) : UInt64.fromUint(0), diff --git a/src/infrastructure/NamespaceHttp.ts b/src/infrastructure/NamespaceHttp.ts index 4d695f44bc..7a50da8d2b 100644 --- a/src/infrastructure/NamespaceHttp.ts +++ b/src/infrastructure/NamespaceHttp.ts @@ -29,7 +29,7 @@ import {NamespaceId} from '../model/namespace/NamespaceId'; import {NamespaceInfo} from '../model/namespace/NamespaceInfo'; import {NamespaceName} from '../model/namespace/NamespaceName'; import {UInt64} from '../model/UInt64'; -import { NamespaceInfoDTO, NamespaceNameDTO, NamespaceRoutesApi } from './api'; +import { NamespaceInfoDTO, NamespaceNameDTO, NamespaceRoutesApi, NamespaceDTO } from './api'; import {Http} from './Http'; import {NamespaceRepository} from './NamespaceRepository'; import {NetworkHttp} from './NetworkHttp'; @@ -69,15 +69,16 @@ export class NamespaceHttp extends Http implements NamespaceRepository { this.namespaceRoutesApi.getNamespace(namespaceId.toHex())).pipe( map((response: { response: ClientResponse; body: NamespaceInfoDTO; } ) => { const namespaceInfoDTO = response.body; + return new NamespaceInfo( namespaceInfoDTO.meta.active, namespaceInfoDTO.meta.index, namespaceInfoDTO.meta.id, - namespaceInfoDTO.namespace.type as number, + namespaceInfoDTO.namespace.registrationType as number, namespaceInfoDTO.namespace.depth, this.extractLevels(namespaceInfoDTO.namespace), new NamespaceId(namespaceInfoDTO.namespace.parentId), - PublicAccount.createFromPublicKey(namespaceInfoDTO.namespace.owner, networkType), + PublicAccount.createFromPublicKey(namespaceInfoDTO.namespace.ownerPublicKey, networkType), new UInt64(namespaceInfoDTO.namespace.startHeight), new UInt64(namespaceInfoDTO.namespace.endHeight), this.extractAlias(namespaceInfoDTO.namespace), @@ -110,11 +111,11 @@ export class NamespaceHttp extends Http implements NamespaceRepository { namespaceInfoDTO.meta.active, namespaceInfoDTO.meta.index, namespaceInfoDTO.meta.id, - namespaceInfoDTO.namespace.type as number, + namespaceInfoDTO.namespace.registrationType as number, namespaceInfoDTO.namespace.depth, this.extractLevels(namespaceInfoDTO.namespace), new NamespaceId(namespaceInfoDTO.namespace.parentId), - PublicAccount.createFromPublicKey(namespaceInfoDTO.namespace.owner, networkType), + PublicAccount.createFromPublicKey(namespaceInfoDTO.namespace.ownerPublicKey, networkType), new UInt64(namespaceInfoDTO.namespace.startHeight), new UInt64(namespaceInfoDTO.namespace.endHeight), this.extractAlias(namespaceInfoDTO.namespace), @@ -139,10 +140,7 @@ export class NamespaceHttp extends Http implements NamespaceRepository { }; return this.getNetworkTypeObservable().pipe( mergeMap((networkType) => observableFrom( - this.namespaceRoutesApi.getNamespacesFromAccounts(publicKeysBody, - this.queryParams(queryParams).pageSize, - this.queryParams(queryParams).id, - this.queryParams(queryParams).order)).pipe( + this.namespaceRoutesApi.getNamespacesFromAccounts(publicKeysBody)).pipe( map((response: { response: ClientResponse; body: NamespaceInfoDTO[]; }) => { const namespaceInfosDTO = response.body; return namespaceInfosDTO.map((namespaceInfoDTO) => { @@ -150,11 +148,11 @@ export class NamespaceHttp extends Http implements NamespaceRepository { namespaceInfoDTO.meta.active, namespaceInfoDTO.meta.index, namespaceInfoDTO.meta.id, - namespaceInfoDTO.namespace.type as number, + namespaceInfoDTO.namespace.registrationType as number, namespaceInfoDTO.namespace.depth, this.extractLevels(namespaceInfoDTO.namespace), new NamespaceId(namespaceInfoDTO.namespace.parentId), - PublicAccount.createFromPublicKey(namespaceInfoDTO.namespace.owner, networkType), + PublicAccount.createFromPublicKey(namespaceInfoDTO.namespace.ownerPublicKey, networkType), new UInt64(namespaceInfoDTO.namespace.startHeight), new UInt64(namespaceInfoDTO.namespace.endHeight), this.extractAlias(namespaceInfoDTO.namespace), @@ -207,8 +205,8 @@ export class NamespaceHttp extends Http implements NamespaceRepository { throw namespaceInfoDTO; } - if (namespaceInfoDTO.namespace.alias.type === AliasType.None - || namespaceInfoDTO.namespace.alias.type !== AliasType.Mosaic + if (namespaceInfoDTO.namespace.alias.type.valueOf() === AliasType.None + || namespaceInfoDTO.namespace.alias.type.valueOf() !== AliasType.Mosaic || !namespaceInfoDTO.namespace.alias.mosaicId) { throw new Error('No mosaicId is linked to namespace \'' + namespaceInfoDTO.namespace.level0 + '\''); } @@ -235,8 +233,8 @@ export class NamespaceHttp extends Http implements NamespaceRepository { throw namespaceInfoDTO; } - if (namespaceInfoDTO.namespace.alias.type === AliasType.None - || namespaceInfoDTO.namespace.alias.type !== AliasType.Address + if (namespaceInfoDTO.namespace.alias.type.valueOf() === AliasType.None + || namespaceInfoDTO.namespace.alias.type.valueOf() !== AliasType.Address || !namespaceInfoDTO.namespace.alias.address) { throw new Error('No address is linked to namespace \'' + namespaceInfoDTO.namespace.level0 + '\''); } diff --git a/src/infrastructure/api/accountRoutesApi.ts b/src/infrastructure/api/accountRoutesApi.ts index a4c378b15f..7ef90b565e 100644 --- a/src/infrastructure/api/accountRoutesApi.ts +++ b/src/infrastructure/api/accountRoutesApi.ts @@ -17,7 +17,7 @@ * Catapult REST Endpoints * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) * - * The version of the OpenAPI document: 0.7.16 + * The version of the OpenAPI document: 0.7.18 * * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). @@ -31,8 +31,9 @@ import http = require('http'); /* tslint:disable:no-unused-locals */ import { AccountIds } from '../model/accountIds'; import { AccountInfoDTO } from '../model/accountInfoDTO'; -import { AccountNamesDTO } from '../model/accountNamesDTO'; import { AccountRestrictionsInfoDTO } from '../model/accountRestrictionsInfoDTO'; +import { AccountsNamesDTO } from '../model/accountsNamesDTO'; +import { ModelError } from '../model/modelError'; import { MultisigAccountGraphInfoDTO } from '../model/multisigAccountGraphInfoDTO'; import { MultisigAccountInfoDTO } from '../model/multisigAccountInfoDTO'; import { TransactionInfoDTO } from '../model/transactionInfoDTO'; @@ -93,7 +94,7 @@ export class AccountRoutesApi { /** * Returns the account information. * @summary Get account information - * @param accountId The public key or address of the account. + * @param accountId Account public key or address. */ public async getAccountInfo (accountId: string, options: {headers: {[name: string]: string}} = {headers: {}}) : Promise<{ response: http.ClientResponse; body: AccountInfoDTO; }> { const localVarPath = this.basePath + '/account/{accountId}' @@ -120,34 +121,36 @@ export class AccountRoutesApi { json: true, }; - this.authentications.default.applyToRequest(localVarRequestOptions); - - if (Object.keys(localVarFormParams).length) { - if (localVarUseFormData) { - (localVarRequestOptions).formData = localVarFormParams; - } else { - localVarRequestOptions.form = localVarFormParams; - } - } - return new Promise<{ response: http.ClientResponse; body: AccountInfoDTO; }>((resolve, reject) => { - localVarRequest(localVarRequestOptions, (error, response, body) => { - if (error) { - reject(error); + let authenticationPromise = Promise.resolve(); + authenticationPromise = authenticationPromise.then(() => this.authentications.default.applyToRequest(localVarRequestOptions)); + return authenticationPromise.then(() => { + if (Object.keys(localVarFormParams).length) { + if (localVarUseFormData) { + (localVarRequestOptions).formData = localVarFormParams; } else { - body = ObjectSerializer.deserialize(body, "AccountInfoDTO"); - if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) { - resolve({ response, body }); + localVarRequestOptions.form = localVarFormParams; + } + } + return new Promise<{ response: http.ClientResponse; body: AccountInfoDTO; }>((resolve, reject) => { + localVarRequest(localVarRequestOptions, (error, response, body) => { + if (error) { + reject(error); } else { - reject({ response, body }); + body = ObjectSerializer.deserialize(body, "AccountInfoDTO"); + if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) { + resolve({ response: response, body: body }); + } else { + reject({ response: response, body: body }); + } } - } + }); }); }); } /** * Returns the multisig account information. * @summary Get multisig account information - * @param accountId The public key or address of the account. + * @param accountId Account public key or address. */ public async getAccountMultisig (accountId: string, options: {headers: {[name: string]: string}} = {headers: {}}) : Promise<{ response: http.ClientResponse; body: MultisigAccountInfoDTO; }> { const localVarPath = this.basePath + '/account/{accountId}/multisig' @@ -174,34 +177,36 @@ export class AccountRoutesApi { json: true, }; - this.authentications.default.applyToRequest(localVarRequestOptions); - - if (Object.keys(localVarFormParams).length) { - if (localVarUseFormData) { - (localVarRequestOptions).formData = localVarFormParams; - } else { - localVarRequestOptions.form = localVarFormParams; - } - } - return new Promise<{ response: http.ClientResponse; body: MultisigAccountInfoDTO; }>((resolve, reject) => { - localVarRequest(localVarRequestOptions, (error, response, body) => { - if (error) { - reject(error); + let authenticationPromise = Promise.resolve(); + authenticationPromise = authenticationPromise.then(() => this.authentications.default.applyToRequest(localVarRequestOptions)); + return authenticationPromise.then(() => { + if (Object.keys(localVarFormParams).length) { + if (localVarUseFormData) { + (localVarRequestOptions).formData = localVarFormParams; } else { - body = ObjectSerializer.deserialize(body, "MultisigAccountInfoDTO"); - if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) { - resolve({ response, body }); + localVarRequestOptions.form = localVarFormParams; + } + } + return new Promise<{ response: http.ClientResponse; body: MultisigAccountInfoDTO; }>((resolve, reject) => { + localVarRequest(localVarRequestOptions, (error, response, body) => { + if (error) { + reject(error); } else { - reject({ response, body }); + body = ObjectSerializer.deserialize(body, "MultisigAccountInfoDTO"); + if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) { + resolve({ response: response, body: body }); + } else { + reject({ response: response, body: body }); + } } - } + }); }); }); } /** * Returns the multisig account graph. * @summary Get multisig account graph information - * @param accountId The public key or address of the account. + * @param accountId Account public key or address. */ public async getAccountMultisigGraph (accountId: string, options: {headers: {[name: string]: string}} = {headers: {}}) : Promise<{ response: http.ClientResponse; body: Array; }> { const localVarPath = this.basePath + '/account/{accountId}/multisig/graph' @@ -228,34 +233,36 @@ export class AccountRoutesApi { json: true, }; - this.authentications.default.applyToRequest(localVarRequestOptions); - - if (Object.keys(localVarFormParams).length) { - if (localVarUseFormData) { - (localVarRequestOptions).formData = localVarFormParams; - } else { - localVarRequestOptions.form = localVarFormParams; - } - } - return new Promise<{ response: http.ClientResponse; body: Array; }>((resolve, reject) => { - localVarRequest(localVarRequestOptions, (error, response, body) => { - if (error) { - reject(error); + let authenticationPromise = Promise.resolve(); + authenticationPromise = authenticationPromise.then(() => this.authentications.default.applyToRequest(localVarRequestOptions)); + return authenticationPromise.then(() => { + if (Object.keys(localVarFormParams).length) { + if (localVarUseFormData) { + (localVarRequestOptions).formData = localVarFormParams; } else { - body = ObjectSerializer.deserialize(body, "Array"); - if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) { - resolve({ response, body }); + localVarRequestOptions.form = localVarFormParams; + } + } + return new Promise<{ response: http.ClientResponse; body: Array; }>((resolve, reject) => { + localVarRequest(localVarRequestOptions, (error, response, body) => { + if (error) { + reject(error); } else { - reject({ response, body }); + body = ObjectSerializer.deserialize(body, "Array"); + if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) { + resolve({ response: response, body: body }); + } else { + reject({ response: response, body: body }); + } } - } + }); }); }); } /** - * Returns the account restrictions for a given account. + * Returns the account restrictions for a given account. * @summary Get the account restrictions - * @param accountId The public key or address of the account. + * @param accountId Account public key or address. */ public async getAccountRestrictions (accountId: string, options: {headers: {[name: string]: string}} = {headers: {}}) : Promise<{ response: http.ClientResponse; body: AccountRestrictionsInfoDTO; }> { const localVarPath = this.basePath + '/account/{accountId}/restrictions/' @@ -282,27 +289,29 @@ export class AccountRoutesApi { json: true, }; - this.authentications.default.applyToRequest(localVarRequestOptions); - - if (Object.keys(localVarFormParams).length) { - if (localVarUseFormData) { - (localVarRequestOptions).formData = localVarFormParams; - } else { - localVarRequestOptions.form = localVarFormParams; - } - } - return new Promise<{ response: http.ClientResponse; body: AccountRestrictionsInfoDTO; }>((resolve, reject) => { - localVarRequest(localVarRequestOptions, (error, response, body) => { - if (error) { - reject(error); + let authenticationPromise = Promise.resolve(); + authenticationPromise = authenticationPromise.then(() => this.authentications.default.applyToRequest(localVarRequestOptions)); + return authenticationPromise.then(() => { + if (Object.keys(localVarFormParams).length) { + if (localVarUseFormData) { + (localVarRequestOptions).formData = localVarFormParams; } else { - body = ObjectSerializer.deserialize(body, "AccountRestrictionsInfoDTO"); - if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) { - resolve({ response, body }); + localVarRequestOptions.form = localVarFormParams; + } + } + return new Promise<{ response: http.ClientResponse; body: AccountRestrictionsInfoDTO; }>((resolve, reject) => { + localVarRequest(localVarRequestOptions, (error, response, body) => { + if (error) { + reject(error); } else { - reject({ response, body }); + body = ObjectSerializer.deserialize(body, "AccountRestrictionsInfoDTO"); + if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) { + resolve({ response: response, body: body }); + } else { + reject({ response: response, body: body }); + } } - } + }); }); }); } @@ -311,17 +320,12 @@ export class AccountRoutesApi { * @summary Get account restrictions for given array of addresses * @param accountIds */ - public async getAccountRestrictionsFromAccounts (accountIds: AccountIds, options: {headers: {[name: string]: string}} = {headers: {}}) : Promise<{ response: http.ClientResponse; body: Array; }> { + public async getAccountRestrictionsFromAccounts (accountIds?: AccountIds, options: {headers: {[name: string]: string}} = {headers: {}}) : Promise<{ response: http.ClientResponse; body: Array; }> { const localVarPath = this.basePath + '/account/restrictions'; let localVarQueryParameters: any = {}; let localVarHeaderParams: any = (Object).assign({}, this.defaultHeaders); let localVarFormParams: any = {}; - // verify required parameter 'accountIds' is not null or undefined - if (accountIds === null || accountIds === undefined) { - throw new Error('Required parameter accountIds was null or undefined when calling getAccountRestrictionsFromAccounts.'); - } - (Object).assign(localVarHeaderParams, options.headers); let localVarUseFormData = false; @@ -336,27 +340,29 @@ export class AccountRoutesApi { body: ObjectSerializer.serialize(accountIds, "AccountIds") }; - this.authentications.default.applyToRequest(localVarRequestOptions); - - if (Object.keys(localVarFormParams).length) { - if (localVarUseFormData) { - (localVarRequestOptions).formData = localVarFormParams; - } else { - localVarRequestOptions.form = localVarFormParams; - } - } - return new Promise<{ response: http.ClientResponse; body: Array; }>((resolve, reject) => { - localVarRequest(localVarRequestOptions, (error, response, body) => { - if (error) { - reject(error); + let authenticationPromise = Promise.resolve(); + authenticationPromise = authenticationPromise.then(() => this.authentications.default.applyToRequest(localVarRequestOptions)); + return authenticationPromise.then(() => { + if (Object.keys(localVarFormParams).length) { + if (localVarUseFormData) { + (localVarRequestOptions).formData = localVarFormParams; } else { - body = ObjectSerializer.deserialize(body, "Array"); - if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) { - resolve({ response, body }); + localVarRequestOptions.form = localVarFormParams; + } + } + return new Promise<{ response: http.ClientResponse; body: Array; }>((resolve, reject) => { + localVarRequest(localVarRequestOptions, (error, response, body) => { + if (error) { + reject(error); } else { - reject({ response, body }); + body = ObjectSerializer.deserialize(body, "Array"); + if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) { + resolve({ response: response, body: body }); + } else { + reject({ response: response, body: body }); + } } - } + }); }); }); } @@ -365,17 +371,12 @@ export class AccountRoutesApi { * @summary Get accounts information * @param accountIds */ - public async getAccountsInfo (accountIds: AccountIds, options: {headers: {[name: string]: string}} = {headers: {}}) : Promise<{ response: http.ClientResponse; body: Array; }> { + public async getAccountsInfo (accountIds?: AccountIds, options: {headers: {[name: string]: string}} = {headers: {}}) : Promise<{ response: http.ClientResponse; body: Array; }> { const localVarPath = this.basePath + '/account'; let localVarQueryParameters: any = {}; let localVarHeaderParams: any = (Object).assign({}, this.defaultHeaders); let localVarFormParams: any = {}; - // verify required parameter 'accountIds' is not null or undefined - if (accountIds === null || accountIds === undefined) { - throw new Error('Required parameter accountIds was null or undefined when calling getAccountsInfo.'); - } - (Object).assign(localVarHeaderParams, options.headers); let localVarUseFormData = false; @@ -390,27 +391,29 @@ export class AccountRoutesApi { body: ObjectSerializer.serialize(accountIds, "AccountIds") }; - this.authentications.default.applyToRequest(localVarRequestOptions); - - if (Object.keys(localVarFormParams).length) { - if (localVarUseFormData) { - (localVarRequestOptions).formData = localVarFormParams; - } else { - localVarRequestOptions.form = localVarFormParams; - } - } - return new Promise<{ response: http.ClientResponse; body: Array; }>((resolve, reject) => { - localVarRequest(localVarRequestOptions, (error, response, body) => { - if (error) { - reject(error); + let authenticationPromise = Promise.resolve(); + authenticationPromise = authenticationPromise.then(() => this.authentications.default.applyToRequest(localVarRequestOptions)); + return authenticationPromise.then(() => { + if (Object.keys(localVarFormParams).length) { + if (localVarUseFormData) { + (localVarRequestOptions).formData = localVarFormParams; } else { - body = ObjectSerializer.deserialize(body, "Array"); - if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) { - resolve({ response, body }); + localVarRequestOptions.form = localVarFormParams; + } + } + return new Promise<{ response: http.ClientResponse; body: Array; }>((resolve, reject) => { + localVarRequest(localVarRequestOptions, (error, response, body) => { + if (error) { + reject(error); } else { - reject({ response, body }); + body = ObjectSerializer.deserialize(body, "Array"); + if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) { + resolve({ response: response, body: body }); + } else { + reject({ response: response, body: body }); + } } - } + }); }); }); } @@ -419,17 +422,12 @@ export class AccountRoutesApi { * @summary Get readable names for a set of accountIds. * @param accountIds */ - public async getAccountsNames (accountIds: AccountIds, options: {headers: {[name: string]: string}} = {headers: {}}) : Promise<{ response: http.ClientResponse; body: Array; }> { + public async getAccountsNames (accountIds?: AccountIds, options: {headers: {[name: string]: string}} = {headers: {}}) : Promise<{ response: http.ClientResponse; body: AccountsNamesDTO; }> { const localVarPath = this.basePath + '/account/names'; let localVarQueryParameters: any = {}; let localVarHeaderParams: any = (Object).assign({}, this.defaultHeaders); let localVarFormParams: any = {}; - // verify required parameter 'accountIds' is not null or undefined - if (accountIds === null || accountIds === undefined) { - throw new Error('Required parameter accountIds was null or undefined when calling getAccountsNames.'); - } - (Object).assign(localVarHeaderParams, options.headers); let localVarUseFormData = false; @@ -444,37 +442,39 @@ export class AccountRoutesApi { body: ObjectSerializer.serialize(accountIds, "AccountIds") }; - this.authentications.default.applyToRequest(localVarRequestOptions); - - if (Object.keys(localVarFormParams).length) { - if (localVarUseFormData) { - (localVarRequestOptions).formData = localVarFormParams; - } else { - localVarRequestOptions.form = localVarFormParams; - } - } - return new Promise<{ response: http.ClientResponse; body: Array; }>((resolve, reject) => { - localVarRequest(localVarRequestOptions, (error, response, body) => { - if (error) { - reject(error); + let authenticationPromise = Promise.resolve(); + authenticationPromise = authenticationPromise.then(() => this.authentications.default.applyToRequest(localVarRequestOptions)); + return authenticationPromise.then(() => { + if (Object.keys(localVarFormParams).length) { + if (localVarUseFormData) { + (localVarRequestOptions).formData = localVarFormParams; } else { - body = ObjectSerializer.deserialize(body, "Array"); - if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) { - resolve({ response, body }); + localVarRequestOptions.form = localVarFormParams; + } + } + return new Promise<{ response: http.ClientResponse; body: AccountsNamesDTO; }>((resolve, reject) => { + localVarRequest(localVarRequestOptions, (error, response, body) => { + if (error) { + reject(error); } else { - reject({ response, body }); + body = ObjectSerializer.deserialize(body, "AccountsNamesDTO"); + if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) { + resolve({ response: response, body: body }); + } else { + reject({ response: response, body: body }); + } } - } + }); }); }); } /** * Gets an array of incoming transactions. A transaction is said to be incoming with respect to an account if the account is the recipient of the transaction. * @summary Get incoming transactions - * @param publicKey The public key of the account. - * @param pageSize The number of transactions to return for each request. - * @param id The transaction id up to which transactions are returned. - * @param ordering The ordering criteria: * -id - Descending order by id. * id - Ascending order by id. + * @param publicKey Public key. + * @param pageSize Number of transactions to return for each request. + * @param id Transaction identifier up to which transactions are returned. + * @param ordering Ordering criteria: * -id - Descending order by id. * id - Ascending order by id. */ public async incomingTransactions (publicKey: string, pageSize?: number, id?: string, ordering?: string, options: {headers: {[name: string]: string}} = {headers: {}}) : Promise<{ response: http.ClientResponse; body: Array; }> { const localVarPath = this.basePath + '/account/{publicKey}/transactions/incoming' @@ -513,37 +513,39 @@ export class AccountRoutesApi { json: true, }; - this.authentications.default.applyToRequest(localVarRequestOptions); - - if (Object.keys(localVarFormParams).length) { - if (localVarUseFormData) { - (localVarRequestOptions).formData = localVarFormParams; - } else { - localVarRequestOptions.form = localVarFormParams; - } - } - return new Promise<{ response: http.ClientResponse; body: Array; }>((resolve, reject) => { - localVarRequest(localVarRequestOptions, (error, response, body) => { - if (error) { - reject(error); + let authenticationPromise = Promise.resolve(); + authenticationPromise = authenticationPromise.then(() => this.authentications.default.applyToRequest(localVarRequestOptions)); + return authenticationPromise.then(() => { + if (Object.keys(localVarFormParams).length) { + if (localVarUseFormData) { + (localVarRequestOptions).formData = localVarFormParams; } else { - body = ObjectSerializer.deserialize(body, "Array"); - if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) { - resolve({ response, body }); + localVarRequestOptions.form = localVarFormParams; + } + } + return new Promise<{ response: http.ClientResponse; body: Array; }>((resolve, reject) => { + localVarRequest(localVarRequestOptions, (error, response, body) => { + if (error) { + reject(error); } else { - reject({ response, body }); + body = ObjectSerializer.deserialize(body, "Array"); + if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) { + resolve({ response: response, body: body }); + } else { + reject({ response: response, body: body }); + } } - } + }); }); }); } /** * Gets an array of outgoing transactions. A transaction is said to be outgoing with respect to an account if the account is the sender of the transaction. * @summary Get outgoing transactions - * @param publicKey The public key of the account. - * @param pageSize The number of transactions to return for each request. - * @param id The transaction id up to which transactions are returned. - * @param ordering The ordering criteria: * -id - Descending order by id. * id - Ascending order by id. + * @param publicKey Public key. + * @param pageSize Number of transactions to return for each request. + * @param id Transaction identifier up to which transactions are returned. + * @param ordering Ordering criteria: * -id - Descending order by id. * id - Ascending order by id. */ public async outgoingTransactions (publicKey: string, pageSize?: number, id?: string, ordering?: string, options: {headers: {[name: string]: string}} = {headers: {}}) : Promise<{ response: http.ClientResponse; body: Array; }> { const localVarPath = this.basePath + '/account/{publicKey}/transactions/outgoing' @@ -582,37 +584,39 @@ export class AccountRoutesApi { json: true, }; - this.authentications.default.applyToRequest(localVarRequestOptions); - - if (Object.keys(localVarFormParams).length) { - if (localVarUseFormData) { - (localVarRequestOptions).formData = localVarFormParams; - } else { - localVarRequestOptions.form = localVarFormParams; - } - } - return new Promise<{ response: http.ClientResponse; body: Array; }>((resolve, reject) => { - localVarRequest(localVarRequestOptions, (error, response, body) => { - if (error) { - reject(error); + let authenticationPromise = Promise.resolve(); + authenticationPromise = authenticationPromise.then(() => this.authentications.default.applyToRequest(localVarRequestOptions)); + return authenticationPromise.then(() => { + if (Object.keys(localVarFormParams).length) { + if (localVarUseFormData) { + (localVarRequestOptions).formData = localVarFormParams; } else { - body = ObjectSerializer.deserialize(body, "Array"); - if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) { - resolve({ response, body }); + localVarRequestOptions.form = localVarFormParams; + } + } + return new Promise<{ response: http.ClientResponse; body: Array; }>((resolve, reject) => { + localVarRequest(localVarRequestOptions, (error, response, body) => { + if (error) { + reject(error); } else { - reject({ response, body }); + body = ObjectSerializer.deserialize(body, "Array"); + if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) { + resolve({ response: response, body: body }); + } else { + reject({ response: response, body: body }); + } } - } + }); }); }); } /** * Gets an array of aggregate bonded transactions where the account is the sender or requires to cosign the transaction. * @summary Get aggregate bonded transactions information - * @param publicKey The public key of the account. - * @param pageSize The number of transactions to return for each request. - * @param id The transaction id up to which transactions are returned. - * @param ordering The ordering criteria. * -id - Descending order by id. * id - Ascending order by id. + * @param publicKey Public key. + * @param pageSize Number of transactions to return for each request. + * @param id Transaction identifier up to which transactions are returned. + * @param ordering Ordering criteria: * -id - Descending order by id. * id - Ascending order by id. */ public async partialTransactions (publicKey: string, pageSize?: number, id?: string, ordering?: string, options: {headers: {[name: string]: string}} = {headers: {}}) : Promise<{ response: http.ClientResponse; body: Array; }> { const localVarPath = this.basePath + '/account/{publicKey}/transactions/partial' @@ -651,37 +655,39 @@ export class AccountRoutesApi { json: true, }; - this.authentications.default.applyToRequest(localVarRequestOptions); - - if (Object.keys(localVarFormParams).length) { - if (localVarUseFormData) { - (localVarRequestOptions).formData = localVarFormParams; - } else { - localVarRequestOptions.form = localVarFormParams; - } - } - return new Promise<{ response: http.ClientResponse; body: Array; }>((resolve, reject) => { - localVarRequest(localVarRequestOptions, (error, response, body) => { - if (error) { - reject(error); + let authenticationPromise = Promise.resolve(); + authenticationPromise = authenticationPromise.then(() => this.authentications.default.applyToRequest(localVarRequestOptions)); + return authenticationPromise.then(() => { + if (Object.keys(localVarFormParams).length) { + if (localVarUseFormData) { + (localVarRequestOptions).formData = localVarFormParams; } else { - body = ObjectSerializer.deserialize(body, "Array"); - if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) { - resolve({ response, body }); + localVarRequestOptions.form = localVarFormParams; + } + } + return new Promise<{ response: http.ClientResponse; body: Array; }>((resolve, reject) => { + localVarRequest(localVarRequestOptions, (error, response, body) => { + if (error) { + reject(error); } else { - reject({ response, body }); + body = ObjectSerializer.deserialize(body, "Array"); + if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) { + resolve({ response: response, body: body }); + } else { + reject({ response: response, body: body }); + } } - } + }); }); }); } /** * Gets an array of transactions for which an account is the sender or receiver. * @summary Get confirmed transactions - * @param publicKey The public key of the account. - * @param pageSize The number of transactions to return for each request. - * @param id The transaction id up to which transactions are returned. - * @param ordering The ordering criteria: * -id - Descending order by id. * id - Ascending order by id. + * @param publicKey Public key. + * @param pageSize Number of transactions to return for each request. + * @param id Transaction identifier up to which transactions are returned. + * @param ordering Ordering criteria: * -id - Descending order by id. * id - Ascending order by id. */ public async transactions (publicKey: string, pageSize?: number, id?: string, ordering?: string, options: {headers: {[name: string]: string}} = {headers: {}}) : Promise<{ response: http.ClientResponse; body: Array; }> { const localVarPath = this.basePath + '/account/{publicKey}/transactions' @@ -720,37 +726,39 @@ export class AccountRoutesApi { json: true, }; - this.authentications.default.applyToRequest(localVarRequestOptions); - - if (Object.keys(localVarFormParams).length) { - if (localVarUseFormData) { - (localVarRequestOptions).formData = localVarFormParams; - } else { - localVarRequestOptions.form = localVarFormParams; - } - } - return new Promise<{ response: http.ClientResponse; body: Array; }>((resolve, reject) => { - localVarRequest(localVarRequestOptions, (error, response, body) => { - if (error) { - reject(error); + let authenticationPromise = Promise.resolve(); + authenticationPromise = authenticationPromise.then(() => this.authentications.default.applyToRequest(localVarRequestOptions)); + return authenticationPromise.then(() => { + if (Object.keys(localVarFormParams).length) { + if (localVarUseFormData) { + (localVarRequestOptions).formData = localVarFormParams; } else { - body = ObjectSerializer.deserialize(body, "Array"); - if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) { - resolve({ response, body }); + localVarRequestOptions.form = localVarFormParams; + } + } + return new Promise<{ response: http.ClientResponse; body: Array; }>((resolve, reject) => { + localVarRequest(localVarRequestOptions, (error, response, body) => { + if (error) { + reject(error); } else { - reject({ response, body }); + body = ObjectSerializer.deserialize(body, "Array"); + if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) { + resolve({ response: response, body: body }); + } else { + reject({ response: response, body: body }); + } } - } + }); }); }); } /** * Gets the array of transactions not included in a block where an account is the sender or receiver. * @summary Get unconfirmed transactions - * @param publicKey The public key of the account. - * @param pageSize The number of transactions to return for each request. - * @param id The transaction id up to which transactions are returned. - * @param ordering The ordering criteria. * -id - Descending order by id. * id - Ascending order by id. + * @param publicKey Public key. + * @param pageSize Number of transactions to return for each request. + * @param id Transaction identifier up to which transactions are returned. + * @param ordering Ordering criteria: * -id - Descending order by id. * id - Ascending order by id. */ public async unconfirmedTransactions (publicKey: string, pageSize?: number, id?: string, ordering?: string, options: {headers: {[name: string]: string}} = {headers: {}}) : Promise<{ response: http.ClientResponse; body: Array; }> { const localVarPath = this.basePath + '/account/{publicKey}/transactions/unconfirmed' @@ -789,27 +797,29 @@ export class AccountRoutesApi { json: true, }; - this.authentications.default.applyToRequest(localVarRequestOptions); - - if (Object.keys(localVarFormParams).length) { - if (localVarUseFormData) { - (localVarRequestOptions).formData = localVarFormParams; - } else { - localVarRequestOptions.form = localVarFormParams; - } - } - return new Promise<{ response: http.ClientResponse; body: Array; }>((resolve, reject) => { - localVarRequest(localVarRequestOptions, (error, response, body) => { - if (error) { - reject(error); + let authenticationPromise = Promise.resolve(); + authenticationPromise = authenticationPromise.then(() => this.authentications.default.applyToRequest(localVarRequestOptions)); + return authenticationPromise.then(() => { + if (Object.keys(localVarFormParams).length) { + if (localVarUseFormData) { + (localVarRequestOptions).formData = localVarFormParams; } else { - body = ObjectSerializer.deserialize(body, "Array"); - if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) { - resolve({ response, body }); + localVarRequestOptions.form = localVarFormParams; + } + } + return new Promise<{ response: http.ClientResponse; body: Array; }>((resolve, reject) => { + localVarRequest(localVarRequestOptions, (error, response, body) => { + if (error) { + reject(error); } else { - reject({ response, body }); + body = ObjectSerializer.deserialize(body, "Array"); + if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) { + resolve({ response: response, body: body }); + } else { + reject({ response: response, body: body }); + } } - } + }); }); }); } diff --git a/src/infrastructure/api/apis.ts b/src/infrastructure/api/apis.ts index 8772c3573e..2a831a8ce3 100644 --- a/src/infrastructure/api/apis.ts +++ b/src/infrastructure/api/apis.ts @@ -17,7 +17,7 @@ * Catapult REST Endpoints * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) * - * The version of the OpenAPI document: 0.7.16 + * The version of the OpenAPI document: 0.7.18 * * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). diff --git a/src/infrastructure/api/blockRoutesApi.ts b/src/infrastructure/api/blockRoutesApi.ts index eafea7acf8..853c64ec21 100644 --- a/src/infrastructure/api/blockRoutesApi.ts +++ b/src/infrastructure/api/blockRoutesApi.ts @@ -17,7 +17,7 @@ * Catapult REST Endpoints * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) * - * The version of the OpenAPI document: 0.7.16 + * The version of the OpenAPI document: 0.7.18 * * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). @@ -31,6 +31,7 @@ import http = require('http'); /* tslint:disable:no-unused-locals */ import { BlockInfoDTO } from '../model/blockInfoDTO'; import { MerkleProofInfoDTO } from '../model/merkleProofInfoDTO'; +import { ModelError } from '../model/modelError'; import { StatementsDTO } from '../model/statementsDTO'; import { TransactionInfoDTO } from '../model/transactionInfoDTO'; @@ -90,7 +91,7 @@ export class BlockRoutesApi { /** * Gets a block from the chain that has the given height. * @summary Get block information - * @param height The height of the block. + * @param height Block height. If height -1 is not a multiple of the limit provided, the inferior closest multiple + 1 is used instead. */ public async getBlockByHeight (height: number, options: {headers: {[name: string]: string}} = {headers: {}}) : Promise<{ response: http.ClientResponse; body: BlockInfoDTO; }> { const localVarPath = this.basePath + '/block/{height}' @@ -117,34 +118,36 @@ export class BlockRoutesApi { json: true, }; - this.authentications.default.applyToRequest(localVarRequestOptions); - - if (Object.keys(localVarFormParams).length) { - if (localVarUseFormData) { - (localVarRequestOptions).formData = localVarFormParams; - } else { - localVarRequestOptions.form = localVarFormParams; - } - } - return new Promise<{ response: http.ClientResponse; body: BlockInfoDTO; }>((resolve, reject) => { - localVarRequest(localVarRequestOptions, (error, response, body) => { - if (error) { - reject(error); + let authenticationPromise = Promise.resolve(); + authenticationPromise = authenticationPromise.then(() => this.authentications.default.applyToRequest(localVarRequestOptions)); + return authenticationPromise.then(() => { + if (Object.keys(localVarFormParams).length) { + if (localVarUseFormData) { + (localVarRequestOptions).formData = localVarFormParams; } else { - body = ObjectSerializer.deserialize(body, "BlockInfoDTO"); - if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) { - resolve({ response, body }); + localVarRequestOptions.form = localVarFormParams; + } + } + return new Promise<{ response: http.ClientResponse; body: BlockInfoDTO; }>((resolve, reject) => { + localVarRequest(localVarRequestOptions, (error, response, body) => { + if (error) { + reject(error); } else { - reject({ response, body }); + body = ObjectSerializer.deserialize(body, "BlockInfoDTO"); + if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) { + resolve({ response: response, body: body }); + } else { + reject({ response: response, body: body }); + } } - } + }); }); }); } /** * Returns the receipts linked to a block. * @summary Get receipts from a block - * @param height The height of the block. + * @param height Block height. If height -1 is not a multiple of the limit provided, the inferior closest multiple + 1 is used instead. */ public async getBlockReceipts (height: number, options: {headers: {[name: string]: string}} = {headers: {}}) : Promise<{ response: http.ClientResponse; body: StatementsDTO; }> { const localVarPath = this.basePath + '/block/{height}/receipts' @@ -171,38 +174,41 @@ export class BlockRoutesApi { json: true, }; - this.authentications.default.applyToRequest(localVarRequestOptions); - - if (Object.keys(localVarFormParams).length) { - if (localVarUseFormData) { - (localVarRequestOptions).formData = localVarFormParams; - } else { - localVarRequestOptions.form = localVarFormParams; - } - } - return new Promise<{ response: http.ClientResponse; body: StatementsDTO; }>((resolve, reject) => { - localVarRequest(localVarRequestOptions, (error, response, body) => { - if (error) { - reject(error); + let authenticationPromise = Promise.resolve(); + authenticationPromise = authenticationPromise.then(() => this.authentications.default.applyToRequest(localVarRequestOptions)); + return authenticationPromise.then(() => { + if (Object.keys(localVarFormParams).length) { + if (localVarUseFormData) { + (localVarRequestOptions).formData = localVarFormParams; } else { - body = ObjectSerializer.deserialize(body, "StatementsDTO"); - if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) { - resolve({ response, body }); + localVarRequestOptions.form = localVarFormParams; + } + } + return new Promise<{ response: http.ClientResponse; body: StatementsDTO; }>((resolve, reject) => { + localVarRequest(localVarRequestOptions, (error, response, body) => { + if (error) { + reject(error); } else { - reject({ response, body }); + body = ObjectSerializer.deserialize(body, "StatementsDTO"); + if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) { + resolve({ response: response, body: body }); + } else { + reject({ response: response, body: body }); + } } - } + }); }); }); } /** * Returns an array of transactions included in a block for a given block height. * @summary Get transactions from a block - * @param height The height of the block. - * @param pageSize The number of transactions to return for each request. - * @param id The transaction id up to which transactions are returned. + * @param height Block height. If height -1 is not a multiple of the limit provided, the inferior closest multiple + 1 is used instead. + * @param pageSize Number of transactions to return for each request. + * @param id Transaction identifier up to which transactions are returned. + * @param ordering Ordering criteria: * -id - Descending order by id. * id - Ascending order by id. */ - public async getBlockTransactions (height: number, pageSize?: number, id?: string, options: {headers: {[name: string]: string}} = {headers: {}}) : Promise<{ response: http.ClientResponse; body: Array; }> { + public async getBlockTransactions (height: number, pageSize?: number, id?: string, ordering?: string, options: {headers: {[name: string]: string}} = {headers: {}}) : Promise<{ response: http.ClientResponse; body: Array; }> { const localVarPath = this.basePath + '/block/{height}/transactions' .replace('{' + 'height' + '}', encodeURIComponent(String(height))); let localVarQueryParameters: any = {}; @@ -222,6 +228,10 @@ export class BlockRoutesApi { localVarQueryParameters['id'] = ObjectSerializer.serialize(id, "string"); } + if (ordering !== undefined) { + localVarQueryParameters['ordering'] = ObjectSerializer.serialize(ordering, "string"); + } + (Object).assign(localVarHeaderParams, options.headers); let localVarUseFormData = false; @@ -235,35 +245,37 @@ export class BlockRoutesApi { json: true, }; - this.authentications.default.applyToRequest(localVarRequestOptions); - - if (Object.keys(localVarFormParams).length) { - if (localVarUseFormData) { - (localVarRequestOptions).formData = localVarFormParams; - } else { - localVarRequestOptions.form = localVarFormParams; - } - } - return new Promise<{ response: http.ClientResponse; body: Array; }>((resolve, reject) => { - localVarRequest(localVarRequestOptions, (error, response, body) => { - if (error) { - reject(error); + let authenticationPromise = Promise.resolve(); + authenticationPromise = authenticationPromise.then(() => this.authentications.default.applyToRequest(localVarRequestOptions)); + return authenticationPromise.then(() => { + if (Object.keys(localVarFormParams).length) { + if (localVarUseFormData) { + (localVarRequestOptions).formData = localVarFormParams; } else { - body = ObjectSerializer.deserialize(body, "Array"); - if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) { - resolve({ response, body }); + localVarRequestOptions.form = localVarFormParams; + } + } + return new Promise<{ response: http.ClientResponse; body: Array; }>((resolve, reject) => { + localVarRequest(localVarRequestOptions, (error, response, body) => { + if (error) { + reject(error); } else { - reject({ response, body }); + body = ObjectSerializer.deserialize(body, "Array"); + if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) { + resolve({ response: response, body: body }); + } else { + reject({ response: response, body: body }); + } } - } + }); }); }); } /** * Gets up to limit number of blocks after given block height. * @summary Get blocks information - * @param height The height of the block. If height -1 is not a multiple of the limit provided, the inferior closest multiple + 1 is used instead. - * @param limit The number of blocks to be returned. + * @param height Block height. If height -1 is not a multiple of the limit provided, the inferior closest multiple + 1 is used instead. + * @param limit Number of elements to be returned. */ public async getBlocksByHeightWithLimit (height: number, limit: 25 | 50 | 75 | 100, options: {headers: {[name: string]: string}} = {headers: {}}) : Promise<{ response: http.ClientResponse; body: Array; }> { const localVarPath = this.basePath + '/blocks/{height}/limit/{limit}' @@ -296,35 +308,37 @@ export class BlockRoutesApi { json: true, }; - this.authentications.default.applyToRequest(localVarRequestOptions); - - if (Object.keys(localVarFormParams).length) { - if (localVarUseFormData) { - (localVarRequestOptions).formData = localVarFormParams; - } else { - localVarRequestOptions.form = localVarFormParams; - } - } - return new Promise<{ response: http.ClientResponse; body: Array; }>((resolve, reject) => { - localVarRequest(localVarRequestOptions, (error, response, body) => { - if (error) { - reject(error); + let authenticationPromise = Promise.resolve(); + authenticationPromise = authenticationPromise.then(() => this.authentications.default.applyToRequest(localVarRequestOptions)); + return authenticationPromise.then(() => { + if (Object.keys(localVarFormParams).length) { + if (localVarUseFormData) { + (localVarRequestOptions).formData = localVarFormParams; } else { - body = ObjectSerializer.deserialize(body, "Array"); - if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) { - resolve({ response, body }); + localVarRequestOptions.form = localVarFormParams; + } + } + return new Promise<{ response: http.ClientResponse; body: Array; }>((resolve, reject) => { + localVarRequest(localVarRequestOptions, (error, response, body) => { + if (error) { + reject(error); } else { - reject({ response, body }); + body = ObjectSerializer.deserialize(body, "Array"); + if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) { + resolve({ response: response, body: body }); + } else { + reject({ response: response, body: body }); + } } - } + }); }); }); } /** * Returns the merkle path for a receipt statement or resolution linked to a block. The path is the complementary data needed to calculate the merkle root. A client can compare if the calculated root equals the one recorded in the block header, verifying that the receipt was linked with the block. * @summary Get the merkle path for a given a receipt statement hash and block - * @param height The height of the block. - * @param hash The hash of the receipt statement or resolution. + * @param height Block height. If height -1 is not a multiple of the limit provided, the inferior closest multiple + 1 is used instead. + * @param hash Receipt hash. */ public async getMerkleReceipts (height: number, hash: string, options: {headers: {[name: string]: string}} = {headers: {}}) : Promise<{ response: http.ClientResponse; body: MerkleProofInfoDTO; }> { const localVarPath = this.basePath + '/block/{height}/receipt/{hash}/merkle' @@ -357,35 +371,37 @@ export class BlockRoutesApi { json: true, }; - this.authentications.default.applyToRequest(localVarRequestOptions); - - if (Object.keys(localVarFormParams).length) { - if (localVarUseFormData) { - (localVarRequestOptions).formData = localVarFormParams; - } else { - localVarRequestOptions.form = localVarFormParams; - } - } - return new Promise<{ response: http.ClientResponse; body: MerkleProofInfoDTO; }>((resolve, reject) => { - localVarRequest(localVarRequestOptions, (error, response, body) => { - if (error) { - reject(error); + let authenticationPromise = Promise.resolve(); + authenticationPromise = authenticationPromise.then(() => this.authentications.default.applyToRequest(localVarRequestOptions)); + return authenticationPromise.then(() => { + if (Object.keys(localVarFormParams).length) { + if (localVarUseFormData) { + (localVarRequestOptions).formData = localVarFormParams; } else { - body = ObjectSerializer.deserialize(body, "MerkleProofInfoDTO"); - if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) { - resolve({ response, body }); + localVarRequestOptions.form = localVarFormParams; + } + } + return new Promise<{ response: http.ClientResponse; body: MerkleProofInfoDTO; }>((resolve, reject) => { + localVarRequest(localVarRequestOptions, (error, response, body) => { + if (error) { + reject(error); } else { - reject({ response, body }); + body = ObjectSerializer.deserialize(body, "MerkleProofInfoDTO"); + if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) { + resolve({ response: response, body: body }); + } else { + reject({ response: response, body: body }); + } } - } + }); }); }); } /** * Returns the merkle path for a transaction included in a block. The path is the complementary data needed to calculate the merkle root. A client can compare if the calculated root equals the one recorded in the block header, verifying that the transaction was included in the block. * @summary Get the merkle path for a given a transaction and block - * @param height The height of the block. - * @param hash The hash of the transaction. + * @param height Block height. If height -1 is not a multiple of the limit provided, the inferior closest multiple + 1 is used instead. + * @param hash Transaction hash. */ public async getMerkleTransaction (height: number, hash: string, options: {headers: {[name: string]: string}} = {headers: {}}) : Promise<{ response: http.ClientResponse; body: MerkleProofInfoDTO; }> { const localVarPath = this.basePath + '/block/{height}/transaction/{hash}/merkle' @@ -418,27 +434,29 @@ export class BlockRoutesApi { json: true, }; - this.authentications.default.applyToRequest(localVarRequestOptions); - - if (Object.keys(localVarFormParams).length) { - if (localVarUseFormData) { - (localVarRequestOptions).formData = localVarFormParams; - } else { - localVarRequestOptions.form = localVarFormParams; - } - } - return new Promise<{ response: http.ClientResponse; body: MerkleProofInfoDTO; }>((resolve, reject) => { - localVarRequest(localVarRequestOptions, (error, response, body) => { - if (error) { - reject(error); + let authenticationPromise = Promise.resolve(); + authenticationPromise = authenticationPromise.then(() => this.authentications.default.applyToRequest(localVarRequestOptions)); + return authenticationPromise.then(() => { + if (Object.keys(localVarFormParams).length) { + if (localVarUseFormData) { + (localVarRequestOptions).formData = localVarFormParams; } else { - body = ObjectSerializer.deserialize(body, "MerkleProofInfoDTO"); - if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) { - resolve({ response, body }); + localVarRequestOptions.form = localVarFormParams; + } + } + return new Promise<{ response: http.ClientResponse; body: MerkleProofInfoDTO; }>((resolve, reject) => { + localVarRequest(localVarRequestOptions, (error, response, body) => { + if (error) { + reject(error); } else { - reject({ response, body }); + body = ObjectSerializer.deserialize(body, "MerkleProofInfoDTO"); + if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) { + resolve({ response: response, body: body }); + } else { + reject({ response: response, body: body }); + } } - } + }); }); }); } diff --git a/src/infrastructure/api/chainRoutesApi.ts b/src/infrastructure/api/chainRoutesApi.ts index e2697992b4..4a929c79d4 100644 --- a/src/infrastructure/api/chainRoutesApi.ts +++ b/src/infrastructure/api/chainRoutesApi.ts @@ -17,7 +17,7 @@ * Catapult REST Endpoints * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) * - * The version of the OpenAPI document: 0.7.16 + * The version of the OpenAPI document: 0.7.18 * * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). @@ -29,7 +29,7 @@ import localVarRequest = require('request'); import http = require('http'); /* tslint:disable:no-unused-locals */ -import { BlockchainScoreDTO } from '../model/blockchainScoreDTO'; +import { ChainScoreDTO } from '../model/chainScoreDTO'; import { HeightInfoDTO } from '../model/heightInfoDTO'; import { ObjectSerializer, Authentication, VoidAuth } from '../model/models'; @@ -108,27 +108,29 @@ export class ChainRoutesApi { json: true, }; - this.authentications.default.applyToRequest(localVarRequestOptions); - - if (Object.keys(localVarFormParams).length) { - if (localVarUseFormData) { - (localVarRequestOptions).formData = localVarFormParams; - } else { - localVarRequestOptions.form = localVarFormParams; - } - } - return new Promise<{ response: http.ClientResponse; body: HeightInfoDTO; }>((resolve, reject) => { - localVarRequest(localVarRequestOptions, (error, response, body) => { - if (error) { - reject(error); + let authenticationPromise = Promise.resolve(); + authenticationPromise = authenticationPromise.then(() => this.authentications.default.applyToRequest(localVarRequestOptions)); + return authenticationPromise.then(() => { + if (Object.keys(localVarFormParams).length) { + if (localVarUseFormData) { + (localVarRequestOptions).formData = localVarFormParams; } else { - body = ObjectSerializer.deserialize(body, "HeightInfoDTO"); - if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) { - resolve({ response, body }); + localVarRequestOptions.form = localVarFormParams; + } + } + return new Promise<{ response: http.ClientResponse; body: HeightInfoDTO; }>((resolve, reject) => { + localVarRequest(localVarRequestOptions, (error, response, body) => { + if (error) { + reject(error); } else { - reject({ response, body }); + body = ObjectSerializer.deserialize(body, "HeightInfoDTO"); + if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) { + resolve({ response: response, body: body }); + } else { + reject({ response: response, body: body }); + } } - } + }); }); }); } @@ -136,7 +138,7 @@ export class ChainRoutesApi { * Gets the current score of the blockchain. The higher the score, the better the chain. During synchronization, nodes try to get the best blockchain in the network. The score for a block is derived from its difficulty and the time (in seconds) that has elapsed since the last block: block score = difficulty − time elapsed since last block * @summary Get the current score of the chain */ - public async getBlockchainScore (options: {headers: {[name: string]: string}} = {headers: {}}) : Promise<{ response: http.ClientResponse; body: BlockchainScoreDTO; }> { + public async getChainScore (options: {headers: {[name: string]: string}} = {headers: {}}) : Promise<{ response: http.ClientResponse; body: ChainScoreDTO; }> { const localVarPath = this.basePath + '/chain/score'; let localVarQueryParameters: any = {}; let localVarHeaderParams: any = (Object).assign({}, this.defaultHeaders); @@ -155,27 +157,29 @@ export class ChainRoutesApi { json: true, }; - this.authentications.default.applyToRequest(localVarRequestOptions); - - if (Object.keys(localVarFormParams).length) { - if (localVarUseFormData) { - (localVarRequestOptions).formData = localVarFormParams; - } else { - localVarRequestOptions.form = localVarFormParams; - } - } - return new Promise<{ response: http.ClientResponse; body: BlockchainScoreDTO; }>((resolve, reject) => { - localVarRequest(localVarRequestOptions, (error, response, body) => { - if (error) { - reject(error); + let authenticationPromise = Promise.resolve(); + authenticationPromise = authenticationPromise.then(() => this.authentications.default.applyToRequest(localVarRequestOptions)); + return authenticationPromise.then(() => { + if (Object.keys(localVarFormParams).length) { + if (localVarUseFormData) { + (localVarRequestOptions).formData = localVarFormParams; } else { - body = ObjectSerializer.deserialize(body, "BlockchainScoreDTO"); - if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) { - resolve({ response, body }); + localVarRequestOptions.form = localVarFormParams; + } + } + return new Promise<{ response: http.ClientResponse; body: ChainScoreDTO; }>((resolve, reject) => { + localVarRequest(localVarRequestOptions, (error, response, body) => { + if (error) { + reject(error); } else { - reject({ response, body }); + body = ObjectSerializer.deserialize(body, "ChainScoreDTO"); + if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) { + resolve({ response: response, body: body }); + } else { + reject({ response: response, body: body }); + } } - } + }); }); }); } diff --git a/src/infrastructure/api/diagnosticRoutesApi.ts b/src/infrastructure/api/diagnosticRoutesApi.ts index 01daa002d8..955064d1f1 100644 --- a/src/infrastructure/api/diagnosticRoutesApi.ts +++ b/src/infrastructure/api/diagnosticRoutesApi.ts @@ -17,7 +17,7 @@ * Catapult REST Endpoints * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) * - * The version of the OpenAPI document: 0.7.16 + * The version of the OpenAPI document: 0.7.18 * * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). @@ -108,32 +108,34 @@ export class DiagnosticRoutesApi { json: true, }; - this.authentications.default.applyToRequest(localVarRequestOptions); - - if (Object.keys(localVarFormParams).length) { - if (localVarUseFormData) { - (localVarRequestOptions).formData = localVarFormParams; - } else { - localVarRequestOptions.form = localVarFormParams; - } - } - return new Promise<{ response: http.ClientResponse; body: StorageInfoDTO; }>((resolve, reject) => { - localVarRequest(localVarRequestOptions, (error, response, body) => { - if (error) { - reject(error); + let authenticationPromise = Promise.resolve(); + authenticationPromise = authenticationPromise.then(() => this.authentications.default.applyToRequest(localVarRequestOptions)); + return authenticationPromise.then(() => { + if (Object.keys(localVarFormParams).length) { + if (localVarUseFormData) { + (localVarRequestOptions).formData = localVarFormParams; } else { - body = ObjectSerializer.deserialize(body, "StorageInfoDTO"); - if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) { - resolve({ response, body }); + localVarRequestOptions.form = localVarFormParams; + } + } + return new Promise<{ response: http.ClientResponse; body: StorageInfoDTO; }>((resolve, reject) => { + localVarRequest(localVarRequestOptions, (error, response, body) => { + if (error) { + reject(error); } else { - reject({ response, body }); + body = ObjectSerializer.deserialize(body, "StorageInfoDTO"); + if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) { + resolve({ response: response, body: body }); + } else { + reject({ response: response, body: body }); + } } - } + }); }); }); } /** - * Returns the version of the running rest component. + * Returns the version of the running catapult-rest component. * @summary Get the version of the running rest component */ public async getServerInfo (options: {headers: {[name: string]: string}} = {headers: {}}) : Promise<{ response: http.ClientResponse; body: ServerDTO; }> { @@ -155,27 +157,29 @@ export class DiagnosticRoutesApi { json: true, }; - this.authentications.default.applyToRequest(localVarRequestOptions); - - if (Object.keys(localVarFormParams).length) { - if (localVarUseFormData) { - (localVarRequestOptions).formData = localVarFormParams; - } else { - localVarRequestOptions.form = localVarFormParams; - } - } - return new Promise<{ response: http.ClientResponse; body: ServerDTO; }>((resolve, reject) => { - localVarRequest(localVarRequestOptions, (error, response, body) => { - if (error) { - reject(error); + let authenticationPromise = Promise.resolve(); + authenticationPromise = authenticationPromise.then(() => this.authentications.default.applyToRequest(localVarRequestOptions)); + return authenticationPromise.then(() => { + if (Object.keys(localVarFormParams).length) { + if (localVarUseFormData) { + (localVarRequestOptions).formData = localVarFormParams; } else { - body = ObjectSerializer.deserialize(body, "ServerDTO"); - if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) { - resolve({ response, body }); + localVarRequestOptions.form = localVarFormParams; + } + } + return new Promise<{ response: http.ClientResponse; body: ServerDTO; }>((resolve, reject) => { + localVarRequest(localVarRequestOptions, (error, response, body) => { + if (error) { + reject(error); } else { - reject({ response, body }); + body = ObjectSerializer.deserialize(body, "ServerDTO"); + if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) { + resolve({ response: response, body: body }); + } else { + reject({ response: response, body: body }); + } } - } + }); }); }); } diff --git a/src/infrastructure/api/metadataRoutesApi.ts b/src/infrastructure/api/metadataRoutesApi.ts new file mode 100644 index 0000000000..f87eac8fca --- /dev/null +++ b/src/infrastructure/api/metadataRoutesApi.ts @@ -0,0 +1,143 @@ +/* + * Copyright 2019 NEM + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +/** + * Catapult REST Endpoints + * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) + * + * The version of the OpenAPI document: 0.7.17 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + +import localVarRequest = require('request'); +import http = require('http'); + +/* tslint:disable:no-unused-locals */ +import { KeyMetadataDTO } from '../model/keyMetadataDTO'; + +import { ObjectSerializer, Authentication, VoidAuth } from '../model/models'; + +let defaultBasePath = 'http://localhost:3000'; + +// =============================================== +// This file is autogenerated - Please do not edit +// =============================================== + +export enum MetadataRoutesApiApiKeys { +} + +export class MetadataRoutesApi { + protected _basePath = defaultBasePath; + protected defaultHeaders : any = {}; + protected _useQuerystring : boolean = false; + + protected authentications = { + 'default': new VoidAuth(), + } + + constructor(basePath?: string); + constructor(basePathOrUsername: string, password?: string, basePath?: string) { + if (password) { + if (basePath) { + this.basePath = basePath; + } + } else { + if (basePathOrUsername) { + this.basePath = basePathOrUsername + } + } + } + + set useQuerystring(value: boolean) { + this._useQuerystring = value; + } + + set basePath(basePath: string) { + this._basePath = basePath; + } + + get basePath() { + return this._basePath; + } + + public setDefaultAuthentication(auth: Authentication) { + this.authentications.default = auth; + } + + public setApiKey(key: MetadataRoutesApiApiKeys, value: string) { + (this.authentications as any)[MetadataRoutesApiApiKeys[key]].apiKey = value; + } + + /** + * Returns the account metadata given an account id. + * @summary Get account metadata + * @param accountId Public key or address of the account. + */ + public async getAccountMetadata (accountId: string, options: {headers: {[name: string]: string}} = {headers: {}}) : Promise<{ response: http.ClientResponse; body: Array; }> { + const localVarPath = this.basePath + '/account/{accountId}/metadata' + .replace('{' + 'accountId' + '}', encodeURIComponent(String(accountId))); + let localVarQueryParameters: any = {}; + let localVarHeaderParams: any = (Object).assign({}, this.defaultHeaders); + let localVarFormParams: any = {}; + + // verify required parameter 'accountId' is not null or undefined + if (accountId === null || accountId === undefined) { + throw new Error('Required parameter accountId was null or undefined when calling getAccountMetadata.'); + } + + (Object).assign(localVarHeaderParams, options.headers); + + let localVarUseFormData = false; + + let localVarRequestOptions: localVarRequest.Options = { + method: 'GET', + qs: localVarQueryParameters, + headers: localVarHeaderParams, + uri: localVarPath, + useQuerystring: this._useQuerystring, + json: true, + }; + + let authenticationPromise = Promise.resolve(); + authenticationPromise = authenticationPromise.then(() => this.authentications.default.applyToRequest(localVarRequestOptions)); + return authenticationPromise.then(() => { + if (Object.keys(localVarFormParams).length) { + if (localVarUseFormData) { + (localVarRequestOptions).formData = localVarFormParams; + } else { + localVarRequestOptions.form = localVarFormParams; + } + } + return new Promise<{ response: http.ClientResponse; body: Array; }>((resolve, reject) => { + localVarRequest(localVarRequestOptions, (error, response, body) => { + if (error) { + reject(error); + } else { + body = ObjectSerializer.deserialize(body, "Array"); + if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) { + resolve({ response: response, body: body }); + } else { + reject({ response: response, body: body }); + } + } + }); + }); + }); + } +} diff --git a/src/infrastructure/api/mosaicRoutesApi.ts b/src/infrastructure/api/mosaicRoutesApi.ts index 00e398b6b6..575581c93f 100644 --- a/src/infrastructure/api/mosaicRoutesApi.ts +++ b/src/infrastructure/api/mosaicRoutesApi.ts @@ -17,7 +17,7 @@ * Catapult REST Endpoints * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) * - * The version of the OpenAPI document: 0.7.16 + * The version of the OpenAPI document: 0.7.18 * * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). @@ -29,9 +29,10 @@ import localVarRequest = require('request'); import http = require('http'); /* tslint:disable:no-unused-locals */ +import { ModelError } from '../model/modelError'; import { MosaicIds } from '../model/mosaicIds'; import { MosaicInfoDTO } from '../model/mosaicInfoDTO'; -import { MosaicNamesDTO } from '../model/mosaicNamesDTO'; +import { MosaicsNamesDTO } from '../model/mosaicsNamesDTO'; import { ObjectSerializer, Authentication, VoidAuth } from '../model/models'; @@ -87,9 +88,9 @@ export class MosaicRoutesApi { } /** - * Gets the mosaic definition for a given mosaicId. + * Gets the mosaic definition for a given mosaic identifier. * @summary Get mosaic information - * @param mosaicId The mosaic identifier. + * @param mosaicId Mosaic identifier. */ public async getMosaic (mosaicId: string, options: {headers: {[name: string]: string}} = {headers: {}}) : Promise<{ response: http.ClientResponse; body: MosaicInfoDTO; }> { const localVarPath = this.basePath + '/mosaic/{mosaicId}' @@ -116,27 +117,29 @@ export class MosaicRoutesApi { json: true, }; - this.authentications.default.applyToRequest(localVarRequestOptions); - - if (Object.keys(localVarFormParams).length) { - if (localVarUseFormData) { - (localVarRequestOptions).formData = localVarFormParams; - } else { - localVarRequestOptions.form = localVarFormParams; - } - } - return new Promise<{ response: http.ClientResponse; body: MosaicInfoDTO; }>((resolve, reject) => { - localVarRequest(localVarRequestOptions, (error, response, body) => { - if (error) { - reject(error); + let authenticationPromise = Promise.resolve(); + authenticationPromise = authenticationPromise.then(() => this.authentications.default.applyToRequest(localVarRequestOptions)); + return authenticationPromise.then(() => { + if (Object.keys(localVarFormParams).length) { + if (localVarUseFormData) { + (localVarRequestOptions).formData = localVarFormParams; } else { - body = ObjectSerializer.deserialize(body, "MosaicInfoDTO"); - if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) { - resolve({ response, body }); + localVarRequestOptions.form = localVarFormParams; + } + } + return new Promise<{ response: http.ClientResponse; body: MosaicInfoDTO; }>((resolve, reject) => { + localVarRequest(localVarRequestOptions, (error, response, body) => { + if (error) { + reject(error); } else { - reject({ response, body }); + body = ObjectSerializer.deserialize(body, "MosaicInfoDTO"); + if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) { + resolve({ response: response, body: body }); + } else { + reject({ response: response, body: body }); + } } - } + }); }); }); } @@ -170,27 +173,29 @@ export class MosaicRoutesApi { body: ObjectSerializer.serialize(mosaicIds, "MosaicIds") }; - this.authentications.default.applyToRequest(localVarRequestOptions); - - if (Object.keys(localVarFormParams).length) { - if (localVarUseFormData) { - (localVarRequestOptions).formData = localVarFormParams; - } else { - localVarRequestOptions.form = localVarFormParams; - } - } - return new Promise<{ response: http.ClientResponse; body: Array; }>((resolve, reject) => { - localVarRequest(localVarRequestOptions, (error, response, body) => { - if (error) { - reject(error); + let authenticationPromise = Promise.resolve(); + authenticationPromise = authenticationPromise.then(() => this.authentications.default.applyToRequest(localVarRequestOptions)); + return authenticationPromise.then(() => { + if (Object.keys(localVarFormParams).length) { + if (localVarUseFormData) { + (localVarRequestOptions).formData = localVarFormParams; } else { - body = ObjectSerializer.deserialize(body, "Array"); - if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) { - resolve({ response, body }); + localVarRequestOptions.form = localVarFormParams; + } + } + return new Promise<{ response: http.ClientResponse; body: Array; }>((resolve, reject) => { + localVarRequest(localVarRequestOptions, (error, response, body) => { + if (error) { + reject(error); } else { - reject({ response, body }); + body = ObjectSerializer.deserialize(body, "Array"); + if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) { + resolve({ response: response, body: body }); + } else { + reject({ response: response, body: body }); + } } - } + }); }); }); } @@ -199,7 +204,7 @@ export class MosaicRoutesApi { * @summary Get readable names for a set of mosaics * @param mosaicIds */ - public async getMosaicsNames (mosaicIds: MosaicIds, options: {headers: {[name: string]: string}} = {headers: {}}) : Promise<{ response: http.ClientResponse; body: Array; }> { + public async getMosaicsNames (mosaicIds: MosaicIds, options: {headers: {[name: string]: string}} = {headers: {}}) : Promise<{ response: http.ClientResponse; body: MosaicsNamesDTO; }> { const localVarPath = this.basePath + '/mosaic/names'; let localVarQueryParameters: any = {}; let localVarHeaderParams: any = (Object).assign({}, this.defaultHeaders); @@ -224,27 +229,29 @@ export class MosaicRoutesApi { body: ObjectSerializer.serialize(mosaicIds, "MosaicIds") }; - this.authentications.default.applyToRequest(localVarRequestOptions); - - if (Object.keys(localVarFormParams).length) { - if (localVarUseFormData) { - (localVarRequestOptions).formData = localVarFormParams; - } else { - localVarRequestOptions.form = localVarFormParams; - } - } - return new Promise<{ response: http.ClientResponse; body: Array; }>((resolve, reject) => { - localVarRequest(localVarRequestOptions, (error, response, body) => { - if (error) { - reject(error); + let authenticationPromise = Promise.resolve(); + authenticationPromise = authenticationPromise.then(() => this.authentications.default.applyToRequest(localVarRequestOptions)); + return authenticationPromise.then(() => { + if (Object.keys(localVarFormParams).length) { + if (localVarUseFormData) { + (localVarRequestOptions).formData = localVarFormParams; } else { - body = ObjectSerializer.deserialize(body, "Array"); - if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) { - resolve({ response, body }); + localVarRequestOptions.form = localVarFormParams; + } + } + return new Promise<{ response: http.ClientResponse; body: MosaicsNamesDTO; }>((resolve, reject) => { + localVarRequest(localVarRequestOptions, (error, response, body) => { + if (error) { + reject(error); } else { - reject({ response, body }); + body = ObjectSerializer.deserialize(body, "MosaicsNamesDTO"); + if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) { + resolve({ response: response, body: body }); + } else { + reject({ response: response, body: body }); + } } - } + }); }); }); } diff --git a/src/infrastructure/api/namespaceRoutesApi.ts b/src/infrastructure/api/namespaceRoutesApi.ts index 9559ef2f13..b2f3a03318 100644 --- a/src/infrastructure/api/namespaceRoutesApi.ts +++ b/src/infrastructure/api/namespaceRoutesApi.ts @@ -17,7 +17,7 @@ * Catapult REST Endpoints * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) * - * The version of the OpenAPI document: 0.7.16 + * The version of the OpenAPI document: 0.7.18 * * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). @@ -30,6 +30,7 @@ import http = require('http'); /* tslint:disable:no-unused-locals */ import { AccountIds } from '../model/accountIds'; +import { ModelError } from '../model/modelError'; import { NamespaceIds } from '../model/namespaceIds'; import { NamespaceInfoDTO } from '../model/namespaceInfoDTO'; import { NamespaceNameDTO } from '../model/namespaceNameDTO'; @@ -88,9 +89,9 @@ export class NamespaceRoutesApi { } /** - * Gets the namespace for a given namespaceId. + * Gets the namespace for a given namespace identifier. * @summary Get namespace information - * @param namespaceId The namespace identifier. + * @param namespaceId Namespace identifier. */ public async getNamespace (namespaceId: string, options: {headers: {[name: string]: string}} = {headers: {}}) : Promise<{ response: http.ClientResponse; body: NamespaceInfoDTO; }> { const localVarPath = this.basePath + '/namespace/{namespaceId}' @@ -117,36 +118,38 @@ export class NamespaceRoutesApi { json: true, }; - this.authentications.default.applyToRequest(localVarRequestOptions); - - if (Object.keys(localVarFormParams).length) { - if (localVarUseFormData) { - (localVarRequestOptions).formData = localVarFormParams; - } else { - localVarRequestOptions.form = localVarFormParams; - } - } - return new Promise<{ response: http.ClientResponse; body: NamespaceInfoDTO; }>((resolve, reject) => { - localVarRequest(localVarRequestOptions, (error, response, body) => { - if (error) { - reject(error); + let authenticationPromise = Promise.resolve(); + authenticationPromise = authenticationPromise.then(() => this.authentications.default.applyToRequest(localVarRequestOptions)); + return authenticationPromise.then(() => { + if (Object.keys(localVarFormParams).length) { + if (localVarUseFormData) { + (localVarRequestOptions).formData = localVarFormParams; } else { - body = ObjectSerializer.deserialize(body, "NamespaceInfoDTO"); - if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) { - resolve({ response, body }); + localVarRequestOptions.form = localVarFormParams; + } + } + return new Promise<{ response: http.ClientResponse; body: NamespaceInfoDTO; }>((resolve, reject) => { + localVarRequest(localVarRequestOptions, (error, response, body) => { + if (error) { + reject(error); } else { - reject({ response, body }); + body = ObjectSerializer.deserialize(body, "NamespaceInfoDTO"); + if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) { + resolve({ response: response, body: body }); + } else { + reject({ response: response, body: body }); + } } - } + }); }); }); } /** * Gets an array of namespaces for a given account address. * @summary Get namespaces owned by an account - * @param accountId The address or public key of the account. - * @param pageSize The number of namespaces to return. - * @param id The namespace id up to which namespace objects are returned. + * @param accountId Account public key or address. + * @param pageSize Number of transactions to return for each request. + * @param id Namespace identifier up to which transactions are returned. */ public async getNamespacesFromAccount (accountId: string, pageSize?: number, id?: string, options: {headers: {[name: string]: string}} = {headers: {}}) : Promise<{ response: http.ClientResponse; body: Array; }> { const localVarPath = this.basePath + '/account/{accountId}/namespaces' @@ -181,27 +184,29 @@ export class NamespaceRoutesApi { json: true, }; - this.authentications.default.applyToRequest(localVarRequestOptions); - - if (Object.keys(localVarFormParams).length) { - if (localVarUseFormData) { - (localVarRequestOptions).formData = localVarFormParams; - } else { - localVarRequestOptions.form = localVarFormParams; - } - } - return new Promise<{ response: http.ClientResponse; body: Array; }>((resolve, reject) => { - localVarRequest(localVarRequestOptions, (error, response, body) => { - if (error) { - reject(error); + let authenticationPromise = Promise.resolve(); + authenticationPromise = authenticationPromise.then(() => this.authentications.default.applyToRequest(localVarRequestOptions)); + return authenticationPromise.then(() => { + if (Object.keys(localVarFormParams).length) { + if (localVarUseFormData) { + (localVarRequestOptions).formData = localVarFormParams; } else { - body = ObjectSerializer.deserialize(body, "Array"); - if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) { - resolve({ response, body }); + localVarRequestOptions.form = localVarFormParams; + } + } + return new Promise<{ response: http.ClientResponse; body: Array; }>((resolve, reject) => { + localVarRequest(localVarRequestOptions, (error, response, body) => { + if (error) { + reject(error); } else { - reject({ response, body }); + body = ObjectSerializer.deserialize(body, "Array"); + if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) { + resolve({ response: response, body: body }); + } else { + reject({ response: response, body: body }); + } } - } + }); }); }); } @@ -209,28 +214,13 @@ export class NamespaceRoutesApi { * Gets namespaces for a given array of addresses. * @summary Get namespaces for given array of addresses * @param accountIds - * @param pageSize The number of namespaces to return. - * @param id The namespace id up to which namespace objects are returned. */ - public async getNamespacesFromAccounts (accountIds: AccountIds, pageSize?: number, id?: string, options: {headers: {[name: string]: string}} = {headers: {}}) : Promise<{ response: http.ClientResponse; body: Array; }> { + public async getNamespacesFromAccounts (accountIds?: AccountIds, options: {headers: {[name: string]: string}} = {headers: {}}) : Promise<{ response: http.ClientResponse; body: Array; }> { const localVarPath = this.basePath + '/account/namespaces'; let localVarQueryParameters: any = {}; let localVarHeaderParams: any = (Object).assign({}, this.defaultHeaders); let localVarFormParams: any = {}; - // verify required parameter 'accountIds' is not null or undefined - if (accountIds === null || accountIds === undefined) { - throw new Error('Required parameter accountIds was null or undefined when calling getNamespacesFromAccounts.'); - } - - if (pageSize !== undefined) { - localVarQueryParameters['pageSize'] = ObjectSerializer.serialize(pageSize, "number"); - } - - if (id !== undefined) { - localVarQueryParameters['id'] = ObjectSerializer.serialize(id, "string"); - } - (Object).assign(localVarHeaderParams, options.headers); let localVarUseFormData = false; @@ -245,27 +235,29 @@ export class NamespaceRoutesApi { body: ObjectSerializer.serialize(accountIds, "AccountIds") }; - this.authentications.default.applyToRequest(localVarRequestOptions); - - if (Object.keys(localVarFormParams).length) { - if (localVarUseFormData) { - (localVarRequestOptions).formData = localVarFormParams; - } else { - localVarRequestOptions.form = localVarFormParams; - } - } - return new Promise<{ response: http.ClientResponse; body: Array; }>((resolve, reject) => { - localVarRequest(localVarRequestOptions, (error, response, body) => { - if (error) { - reject(error); + let authenticationPromise = Promise.resolve(); + authenticationPromise = authenticationPromise.then(() => this.authentications.default.applyToRequest(localVarRequestOptions)); + return authenticationPromise.then(() => { + if (Object.keys(localVarFormParams).length) { + if (localVarUseFormData) { + (localVarRequestOptions).formData = localVarFormParams; } else { - body = ObjectSerializer.deserialize(body, "Array"); - if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) { - resolve({ response, body }); + localVarRequestOptions.form = localVarFormParams; + } + } + return new Promise<{ response: http.ClientResponse; body: Array; }>((resolve, reject) => { + localVarRequest(localVarRequestOptions, (error, response, body) => { + if (error) { + reject(error); } else { - reject({ response, body }); + body = ObjectSerializer.deserialize(body, "Array"); + if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) { + resolve({ response: response, body: body }); + } else { + reject({ response: response, body: body }); + } } - } + }); }); }); } @@ -299,27 +291,29 @@ export class NamespaceRoutesApi { body: ObjectSerializer.serialize(namespaceIds, "NamespaceIds") }; - this.authentications.default.applyToRequest(localVarRequestOptions); - - if (Object.keys(localVarFormParams).length) { - if (localVarUseFormData) { - (localVarRequestOptions).formData = localVarFormParams; - } else { - localVarRequestOptions.form = localVarFormParams; - } - } - return new Promise<{ response: http.ClientResponse; body: Array; }>((resolve, reject) => { - localVarRequest(localVarRequestOptions, (error, response, body) => { - if (error) { - reject(error); + let authenticationPromise = Promise.resolve(); + authenticationPromise = authenticationPromise.then(() => this.authentications.default.applyToRequest(localVarRequestOptions)); + return authenticationPromise.then(() => { + if (Object.keys(localVarFormParams).length) { + if (localVarUseFormData) { + (localVarRequestOptions).formData = localVarFormParams; } else { - body = ObjectSerializer.deserialize(body, "Array"); - if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) { - resolve({ response, body }); + localVarRequestOptions.form = localVarFormParams; + } + } + return new Promise<{ response: http.ClientResponse; body: Array; }>((resolve, reject) => { + localVarRequest(localVarRequestOptions, (error, response, body) => { + if (error) { + reject(error); } else { - reject({ response, body }); + body = ObjectSerializer.deserialize(body, "Array"); + if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) { + resolve({ response: response, body: body }); + } else { + reject({ response: response, body: body }); + } } - } + }); }); }); } diff --git a/src/infrastructure/api/networkRoutesApi.ts b/src/infrastructure/api/networkRoutesApi.ts index 3c574d8c46..bb5c24eef8 100644 --- a/src/infrastructure/api/networkRoutesApi.ts +++ b/src/infrastructure/api/networkRoutesApi.ts @@ -17,7 +17,7 @@ * Catapult REST Endpoints * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) * - * The version of the OpenAPI document: 0.7.16 + * The version of the OpenAPI document: 0.7.18 * * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). @@ -107,27 +107,29 @@ export class NetworkRoutesApi { json: true, }; - this.authentications.default.applyToRequest(localVarRequestOptions); - - if (Object.keys(localVarFormParams).length) { - if (localVarUseFormData) { - (localVarRequestOptions).formData = localVarFormParams; - } else { - localVarRequestOptions.form = localVarFormParams; - } - } - return new Promise<{ response: http.ClientResponse; body: NetworkTypeDTO; }>((resolve, reject) => { - localVarRequest(localVarRequestOptions, (error, response, body) => { - if (error) { - reject(error); + let authenticationPromise = Promise.resolve(); + authenticationPromise = authenticationPromise.then(() => this.authentications.default.applyToRequest(localVarRequestOptions)); + return authenticationPromise.then(() => { + if (Object.keys(localVarFormParams).length) { + if (localVarUseFormData) { + (localVarRequestOptions).formData = localVarFormParams; } else { - body = ObjectSerializer.deserialize(body, "NetworkTypeDTO"); - if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) { - resolve({ response, body }); + localVarRequestOptions.form = localVarFormParams; + } + } + return new Promise<{ response: http.ClientResponse; body: NetworkTypeDTO; }>((resolve, reject) => { + localVarRequest(localVarRequestOptions, (error, response, body) => { + if (error) { + reject(error); } else { - reject({ response, body }); + body = ObjectSerializer.deserialize(body, "NetworkTypeDTO"); + if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) { + resolve({ response: response, body: body }); + } else { + reject({ response: response, body: body }); + } } - } + }); }); }); } diff --git a/src/infrastructure/api/nodeRoutesApi.ts b/src/infrastructure/api/nodeRoutesApi.ts index 456a05ad64..5de47b7fce 100644 --- a/src/infrastructure/api/nodeRoutesApi.ts +++ b/src/infrastructure/api/nodeRoutesApi.ts @@ -17,7 +17,7 @@ * Catapult REST Endpoints * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) * - * The version of the OpenAPI document: 0.7.16 + * The version of the OpenAPI document: 0.7.18 * * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). @@ -86,7 +86,7 @@ export class NodeRoutesApi { } /** - * Supplies additional information about the application running on a node. + * Supplies additional information about the application running on a node. * @summary Get the node information */ public async getNodeInfo (options: {headers: {[name: string]: string}} = {headers: {}}) : Promise<{ response: http.ClientResponse; body: NodeInfoDTO; }> { @@ -108,27 +108,29 @@ export class NodeRoutesApi { json: true, }; - this.authentications.default.applyToRequest(localVarRequestOptions); - - if (Object.keys(localVarFormParams).length) { - if (localVarUseFormData) { - (localVarRequestOptions).formData = localVarFormParams; - } else { - localVarRequestOptions.form = localVarFormParams; - } - } - return new Promise<{ response: http.ClientResponse; body: NodeInfoDTO; }>((resolve, reject) => { - localVarRequest(localVarRequestOptions, (error, response, body) => { - if (error) { - reject(error); + let authenticationPromise = Promise.resolve(); + authenticationPromise = authenticationPromise.then(() => this.authentications.default.applyToRequest(localVarRequestOptions)); + return authenticationPromise.then(() => { + if (Object.keys(localVarFormParams).length) { + if (localVarUseFormData) { + (localVarRequestOptions).formData = localVarFormParams; } else { - body = ObjectSerializer.deserialize(body, "NodeInfoDTO"); - if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) { - resolve({ response, body }); + localVarRequestOptions.form = localVarFormParams; + } + } + return new Promise<{ response: http.ClientResponse; body: NodeInfoDTO; }>((resolve, reject) => { + localVarRequest(localVarRequestOptions, (error, response, body) => { + if (error) { + reject(error); } else { - reject({ response, body }); + body = ObjectSerializer.deserialize(body, "NodeInfoDTO"); + if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) { + resolve({ response: response, body: body }); + } else { + reject({ response: response, body: body }); + } } - } + }); }); }); } @@ -155,27 +157,29 @@ export class NodeRoutesApi { json: true, }; - this.authentications.default.applyToRequest(localVarRequestOptions); - - if (Object.keys(localVarFormParams).length) { - if (localVarUseFormData) { - (localVarRequestOptions).formData = localVarFormParams; - } else { - localVarRequestOptions.form = localVarFormParams; - } - } - return new Promise<{ response: http.ClientResponse; body: NodeTimeDTO; }>((resolve, reject) => { - localVarRequest(localVarRequestOptions, (error, response, body) => { - if (error) { - reject(error); + let authenticationPromise = Promise.resolve(); + authenticationPromise = authenticationPromise.then(() => this.authentications.default.applyToRequest(localVarRequestOptions)); + return authenticationPromise.then(() => { + if (Object.keys(localVarFormParams).length) { + if (localVarUseFormData) { + (localVarRequestOptions).formData = localVarFormParams; } else { - body = ObjectSerializer.deserialize(body, "NodeTimeDTO"); - if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) { - resolve({ response, body }); + localVarRequestOptions.form = localVarFormParams; + } + } + return new Promise<{ response: http.ClientResponse; body: NodeTimeDTO; }>((resolve, reject) => { + localVarRequest(localVarRequestOptions, (error, response, body) => { + if (error) { + reject(error); } else { - reject({ response, body }); + body = ObjectSerializer.deserialize(body, "NodeTimeDTO"); + if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) { + resolve({ response: response, body: body }); + } else { + reject({ response: response, body: body }); + } } - } + }); }); }); } diff --git a/src/infrastructure/api/transactionRoutesApi.ts b/src/infrastructure/api/transactionRoutesApi.ts index 0a3abdd119..5ea283c686 100644 --- a/src/infrastructure/api/transactionRoutesApi.ts +++ b/src/infrastructure/api/transactionRoutesApi.ts @@ -17,7 +17,7 @@ * Catapult REST Endpoints * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) * - * The version of the OpenAPI document: 0.7.16 + * The version of the OpenAPI document: 0.7.18 * * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). @@ -31,6 +31,7 @@ import http = require('http'); /* tslint:disable:no-unused-locals */ import { AnnounceTransactionInfoDTO } from '../model/announceTransactionInfoDTO'; import { Cosignature } from '../model/cosignature'; +import { ModelError } from '../model/modelError'; import { TransactionHashes } from '../model/transactionHashes'; import { TransactionIds } from '../model/transactionIds'; import { TransactionInfoDTO } from '../model/transactionInfoDTO'; @@ -120,27 +121,29 @@ export class TransactionRoutesApi { body: ObjectSerializer.serialize(cosignature, "Cosignature") }; - this.authentications.default.applyToRequest(localVarRequestOptions); - - if (Object.keys(localVarFormParams).length) { - if (localVarUseFormData) { - (localVarRequestOptions).formData = localVarFormParams; - } else { - localVarRequestOptions.form = localVarFormParams; - } - } - return new Promise<{ response: http.ClientResponse; body: AnnounceTransactionInfoDTO; }>((resolve, reject) => { - localVarRequest(localVarRequestOptions, (error, response, body) => { - if (error) { - reject(error); + let authenticationPromise = Promise.resolve(); + authenticationPromise = authenticationPromise.then(() => this.authentications.default.applyToRequest(localVarRequestOptions)); + return authenticationPromise.then(() => { + if (Object.keys(localVarFormParams).length) { + if (localVarUseFormData) { + (localVarRequestOptions).formData = localVarFormParams; } else { - body = ObjectSerializer.deserialize(body, "AnnounceTransactionInfoDTO"); - if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) { - resolve({ response, body }); + localVarRequestOptions.form = localVarFormParams; + } + } + return new Promise<{ response: http.ClientResponse; body: AnnounceTransactionInfoDTO; }>((resolve, reject) => { + localVarRequest(localVarRequestOptions, (error, response, body) => { + if (error) { + reject(error); } else { - reject({ response, body }); + body = ObjectSerializer.deserialize(body, "AnnounceTransactionInfoDTO"); + if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) { + resolve({ response: response, body: body }); + } else { + reject({ response: response, body: body }); + } } - } + }); }); }); } @@ -174,32 +177,34 @@ export class TransactionRoutesApi { body: ObjectSerializer.serialize(transactionPayload, "TransactionPayload") }; - this.authentications.default.applyToRequest(localVarRequestOptions); - - if (Object.keys(localVarFormParams).length) { - if (localVarUseFormData) { - (localVarRequestOptions).formData = localVarFormParams; - } else { - localVarRequestOptions.form = localVarFormParams; - } - } - return new Promise<{ response: http.ClientResponse; body: AnnounceTransactionInfoDTO; }>((resolve, reject) => { - localVarRequest(localVarRequestOptions, (error, response, body) => { - if (error) { - reject(error); + let authenticationPromise = Promise.resolve(); + authenticationPromise = authenticationPromise.then(() => this.authentications.default.applyToRequest(localVarRequestOptions)); + return authenticationPromise.then(() => { + if (Object.keys(localVarFormParams).length) { + if (localVarUseFormData) { + (localVarRequestOptions).formData = localVarFormParams; } else { - body = ObjectSerializer.deserialize(body, "AnnounceTransactionInfoDTO"); - if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) { - resolve({ response, body }); + localVarRequestOptions.form = localVarFormParams; + } + } + return new Promise<{ response: http.ClientResponse; body: AnnounceTransactionInfoDTO; }>((resolve, reject) => { + localVarRequest(localVarRequestOptions, (error, response, body) => { + if (error) { + reject(error); } else { - reject({ response, body }); + body = ObjectSerializer.deserialize(body, "AnnounceTransactionInfoDTO"); + if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) { + resolve({ response: response, body: body }); + } else { + reject({ response: response, body: body }); + } } - } + }); }); }); } /** - * Announces a transaction to the network. It is recommended to use the NEM2-SDK to announce transactions as they should be serialized. + * Announces a transaction to the network. We recommended to use the NEM2-SDK to announce transactions as they should be serialized. * @summary Announce a new transaction * @param transactionPayload */ @@ -228,34 +233,36 @@ export class TransactionRoutesApi { body: ObjectSerializer.serialize(transactionPayload, "TransactionPayload") }; - this.authentications.default.applyToRequest(localVarRequestOptions); - - if (Object.keys(localVarFormParams).length) { - if (localVarUseFormData) { - (localVarRequestOptions).formData = localVarFormParams; - } else { - localVarRequestOptions.form = localVarFormParams; - } - } - return new Promise<{ response: http.ClientResponse; body: AnnounceTransactionInfoDTO; }>((resolve, reject) => { - localVarRequest(localVarRequestOptions, (error, response, body) => { - if (error) { - reject(error); + let authenticationPromise = Promise.resolve(); + authenticationPromise = authenticationPromise.then(() => this.authentications.default.applyToRequest(localVarRequestOptions)); + return authenticationPromise.then(() => { + if (Object.keys(localVarFormParams).length) { + if (localVarUseFormData) { + (localVarRequestOptions).formData = localVarFormParams; } else { - body = ObjectSerializer.deserialize(body, "AnnounceTransactionInfoDTO"); - if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) { - resolve({ response, body }); + localVarRequestOptions.form = localVarFormParams; + } + } + return new Promise<{ response: http.ClientResponse; body: AnnounceTransactionInfoDTO; }>((resolve, reject) => { + localVarRequest(localVarRequestOptions, (error, response, body) => { + if (error) { + reject(error); } else { - reject({ response, body }); + body = ObjectSerializer.deserialize(body, "AnnounceTransactionInfoDTO"); + if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) { + resolve({ response: response, body: body }); + } else { + reject({ response: response, body: body }); + } } - } + }); }); }); } /** * Returns transaction information given a transactionId or hash. * @summary Get transaction information - * @param transactionId The transaction id or hash. + * @param transactionId Transaction identifier or hash. */ public async getTransaction (transactionId: string, options: {headers: {[name: string]: string}} = {headers: {}}) : Promise<{ response: http.ClientResponse; body: TransactionInfoDTO; }> { const localVarPath = this.basePath + '/transaction/{transactionId}' @@ -282,34 +289,36 @@ export class TransactionRoutesApi { json: true, }; - this.authentications.default.applyToRequest(localVarRequestOptions); - - if (Object.keys(localVarFormParams).length) { - if (localVarUseFormData) { - (localVarRequestOptions).formData = localVarFormParams; - } else { - localVarRequestOptions.form = localVarFormParams; - } - } - return new Promise<{ response: http.ClientResponse; body: TransactionInfoDTO; }>((resolve, reject) => { - localVarRequest(localVarRequestOptions, (error, response, body) => { - if (error) { - reject(error); + let authenticationPromise = Promise.resolve(); + authenticationPromise = authenticationPromise.then(() => this.authentications.default.applyToRequest(localVarRequestOptions)); + return authenticationPromise.then(() => { + if (Object.keys(localVarFormParams).length) { + if (localVarUseFormData) { + (localVarRequestOptions).formData = localVarFormParams; } else { - body = ObjectSerializer.deserialize(body, "TransactionInfoDTO"); - if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) { - resolve({ response, body }); + localVarRequestOptions.form = localVarFormParams; + } + } + return new Promise<{ response: http.ClientResponse; body: TransactionInfoDTO; }>((resolve, reject) => { + localVarRequest(localVarRequestOptions, (error, response, body) => { + if (error) { + reject(error); } else { - reject({ response, body }); + body = ObjectSerializer.deserialize(body, "TransactionInfoDTO"); + if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) { + resolve({ response: response, body: body }); + } else { + reject({ response: response, body: body }); + } } - } + }); }); }); } /** * Returns the transaction status for a given hash. * @summary Get transaction status - * @param hash The transaction hash. + * @param hash Transaction hash. */ public async getTransactionStatus (hash: string, options: {headers: {[name: string]: string}} = {headers: {}}) : Promise<{ response: http.ClientResponse; body: TransactionStatusDTO; }> { const localVarPath = this.basePath + '/transaction/{hash}/status' @@ -336,27 +345,29 @@ export class TransactionRoutesApi { json: true, }; - this.authentications.default.applyToRequest(localVarRequestOptions); - - if (Object.keys(localVarFormParams).length) { - if (localVarUseFormData) { - (localVarRequestOptions).formData = localVarFormParams; - } else { - localVarRequestOptions.form = localVarFormParams; - } - } - return new Promise<{ response: http.ClientResponse; body: TransactionStatusDTO; }>((resolve, reject) => { - localVarRequest(localVarRequestOptions, (error, response, body) => { - if (error) { - reject(error); + let authenticationPromise = Promise.resolve(); + authenticationPromise = authenticationPromise.then(() => this.authentications.default.applyToRequest(localVarRequestOptions)); + return authenticationPromise.then(() => { + if (Object.keys(localVarFormParams).length) { + if (localVarUseFormData) { + (localVarRequestOptions).formData = localVarFormParams; } else { - body = ObjectSerializer.deserialize(body, "TransactionStatusDTO"); - if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) { - resolve({ response, body }); + localVarRequestOptions.form = localVarFormParams; + } + } + return new Promise<{ response: http.ClientResponse; body: TransactionStatusDTO; }>((resolve, reject) => { + localVarRequest(localVarRequestOptions, (error, response, body) => { + if (error) { + reject(error); } else { - reject({ response, body }); + body = ObjectSerializer.deserialize(body, "TransactionStatusDTO"); + if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) { + resolve({ response: response, body: body }); + } else { + reject({ response: response, body: body }); + } } - } + }); }); }); } @@ -390,27 +401,29 @@ export class TransactionRoutesApi { body: ObjectSerializer.serialize(transactionIds, "TransactionIds") }; - this.authentications.default.applyToRequest(localVarRequestOptions); - - if (Object.keys(localVarFormParams).length) { - if (localVarUseFormData) { - (localVarRequestOptions).formData = localVarFormParams; - } else { - localVarRequestOptions.form = localVarFormParams; - } - } - return new Promise<{ response: http.ClientResponse; body: Array; }>((resolve, reject) => { - localVarRequest(localVarRequestOptions, (error, response, body) => { - if (error) { - reject(error); + let authenticationPromise = Promise.resolve(); + authenticationPromise = authenticationPromise.then(() => this.authentications.default.applyToRequest(localVarRequestOptions)); + return authenticationPromise.then(() => { + if (Object.keys(localVarFormParams).length) { + if (localVarUseFormData) { + (localVarRequestOptions).formData = localVarFormParams; } else { - body = ObjectSerializer.deserialize(body, "Array"); - if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) { - resolve({ response, body }); + localVarRequestOptions.form = localVarFormParams; + } + } + return new Promise<{ response: http.ClientResponse; body: Array; }>((resolve, reject) => { + localVarRequest(localVarRequestOptions, (error, response, body) => { + if (error) { + reject(error); } else { - reject({ response, body }); + body = ObjectSerializer.deserialize(body, "Array"); + if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) { + resolve({ response: response, body: body }); + } else { + reject({ response: response, body: body }); + } } - } + }); }); }); } @@ -444,27 +457,29 @@ export class TransactionRoutesApi { body: ObjectSerializer.serialize(transactionHashes, "TransactionHashes") }; - this.authentications.default.applyToRequest(localVarRequestOptions); - - if (Object.keys(localVarFormParams).length) { - if (localVarUseFormData) { - (localVarRequestOptions).formData = localVarFormParams; - } else { - localVarRequestOptions.form = localVarFormParams; - } - } - return new Promise<{ response: http.ClientResponse; body: Array; }>((resolve, reject) => { - localVarRequest(localVarRequestOptions, (error, response, body) => { - if (error) { - reject(error); + let authenticationPromise = Promise.resolve(); + authenticationPromise = authenticationPromise.then(() => this.authentications.default.applyToRequest(localVarRequestOptions)); + return authenticationPromise.then(() => { + if (Object.keys(localVarFormParams).length) { + if (localVarUseFormData) { + (localVarRequestOptions).formData = localVarFormParams; } else { - body = ObjectSerializer.deserialize(body, "Array"); - if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) { - resolve({ response, body }); + localVarRequestOptions.form = localVarFormParams; + } + } + return new Promise<{ response: http.ClientResponse; body: Array; }>((resolve, reject) => { + localVarRequest(localVarRequestOptions, (error, response, body) => { + if (error) { + reject(error); } else { - reject({ response, body }); + body = ObjectSerializer.deserialize(body, "Array"); + if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) { + resolve({ response: response, body: body }); + } else { + reject({ response: response, body: body }); + } } - } + }); }); }); } diff --git a/src/infrastructure/model/accountAddressRestrictionModificationDTO.ts b/src/infrastructure/model/accountAddressRestrictionModificationDTO.ts new file mode 100644 index 0000000000..e0da699dc7 --- /dev/null +++ b/src/infrastructure/model/accountAddressRestrictionModificationDTO.ts @@ -0,0 +1,55 @@ +/* + * Copyright 2019 NEM + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +/** + * Catapult REST Endpoints + * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) + * + * The version of the OpenAPI document: 0.7.18 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + +import { AccountRestrictionModificationActionEnum } from './accountRestrictionModificationActionEnum'; + +export class AccountAddressRestrictionModificationDTO { + 'modificationAction': AccountRestrictionModificationActionEnum; + /** + * Address decoded. If the bit 0 of byte 0 is not set (like in 0x90), then it is a regular address. Else (e.g. 0x91) it represents a namespace id which starts at byte 1. + */ + 'value': string; + + static discriminator: string | undefined = undefined; + + static attributeTypeMap: Array<{name: string, baseName: string, type: string}> = [ + { + "name": "modificationAction", + "baseName": "modificationAction", + "type": "AccountRestrictionModificationActionEnum" + }, + { + "name": "value", + "baseName": "value", + "type": "string" + } ]; + + static getAttributeTypeMap() { + return AccountAddressRestrictionModificationDTO.attributeTypeMap; + } +} + diff --git a/src/infrastructure/model/accountAddressRestrictionModificationDTOAllOf.ts b/src/infrastructure/model/accountAddressRestrictionModificationDTOAllOf.ts new file mode 100644 index 0000000000..c493566d8d --- /dev/null +++ b/src/infrastructure/model/accountAddressRestrictionModificationDTOAllOf.ts @@ -0,0 +1,48 @@ +/* + * Copyright 2019 NEM + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +/** + * Catapult REST Endpoints + * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) + * + * The version of the OpenAPI document: 0.7.18 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +export class AccountAddressRestrictionModificationDTOAllOf { + /** + * Address decoded. If the bit 0 of byte 0 is not set (like in 0x90), then it is a regular address. Else (e.g. 0x91) it represents a namespace id which starts at byte 1. + */ + 'value': string; + + static discriminator: string | undefined = undefined; + + static attributeTypeMap: Array<{name: string, baseName: string, type: string}> = [ + { + "name": "value", + "baseName": "value", + "type": "string" + } ]; + + static getAttributeTypeMap() { + return AccountAddressRestrictionModificationDTOAllOf.attributeTypeMap; + } +} + diff --git a/src/infrastructure/model/accountAddressRestrictionTransactionBodyDTO.ts b/src/infrastructure/model/accountAddressRestrictionTransactionBodyDTO.ts new file mode 100644 index 0000000000..b2fb7e129b --- /dev/null +++ b/src/infrastructure/model/accountAddressRestrictionTransactionBodyDTO.ts @@ -0,0 +1,53 @@ +/* + * Copyright 2019 NEM + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +/** + * Catapult REST Endpoints + * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) + * + * The version of the OpenAPI document: 0.7.18 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + +import { AccountAddressRestrictionModificationDTO } from './accountAddressRestrictionModificationDTO'; +import { AccountRestrictionTypeEnum } from './accountRestrictionTypeEnum'; + +export class AccountAddressRestrictionTransactionBodyDTO { + 'restrictionType': AccountRestrictionTypeEnum; + 'modifications': Array; + + static discriminator: string | undefined = undefined; + + static attributeTypeMap: Array<{name: string, baseName: string, type: string}> = [ + { + "name": "restrictionType", + "baseName": "restrictionType", + "type": "AccountRestrictionTypeEnum" + }, + { + "name": "modifications", + "baseName": "modifications", + "type": "Array" + } ]; + + static getAttributeTypeMap() { + return AccountAddressRestrictionTransactionBodyDTO.attributeTypeMap; + } +} + diff --git a/src/infrastructure/model/accountAddressRestrictionTransactionDTO.ts b/src/infrastructure/model/accountAddressRestrictionTransactionDTO.ts new file mode 100644 index 0000000000..67f79b67d6 --- /dev/null +++ b/src/infrastructure/model/accountAddressRestrictionTransactionDTO.ts @@ -0,0 +1,97 @@ +/* + * Copyright 2019 NEM + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +/** + * Catapult REST Endpoints + * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) + * + * The version of the OpenAPI document: 0.7.18 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + +import { AccountAddressRestrictionModificationDTO } from './accountAddressRestrictionModificationDTO'; +import { AccountAddressRestrictionTransactionBodyDTO } from './accountAddressRestrictionTransactionBodyDTO'; +import { AccountRestrictionTypeEnum } from './accountRestrictionTypeEnum'; +import { TransactionDTO } from './transactionDTO'; + +/** +* Transaction to prevent incoming and outgoing transactions for a given a set of addresses. +*/ +export class AccountAddressRestrictionTransactionDTO { + 'signature': string; + 'signerPublicKey': string; + /** + * Entity version. The higher byte represents the network identifier: * 0x68 (MAIN_NET) - Public main network. * 0x98 (TEST_NET) - Public test network. * 0x60 (MIJIN) - Private network. * 0x90 (MIJIN_TEST) - Private test network. + */ + 'version': number; + 'type': number; + 'maxFee': Array; + 'deadline': Array; + 'restrictionType': AccountRestrictionTypeEnum; + 'modifications': Array; + + static discriminator: string | undefined = undefined; + + static attributeTypeMap: Array<{name: string, baseName: string, type: string}> = [ + { + "name": "signature", + "baseName": "signature", + "type": "string" + }, + { + "name": "signerPublicKey", + "baseName": "signerPublicKey", + "type": "string" + }, + { + "name": "version", + "baseName": "version", + "type": "number" + }, + { + "name": "type", + "baseName": "type", + "type": "number" + }, + { + "name": "maxFee", + "baseName": "maxFee", + "type": "Array" + }, + { + "name": "deadline", + "baseName": "deadline", + "type": "Array" + }, + { + "name": "restrictionType", + "baseName": "restrictionType", + "type": "AccountRestrictionTypeEnum" + }, + { + "name": "modifications", + "baseName": "modifications", + "type": "Array" + } ]; + + static getAttributeTypeMap() { + return AccountAddressRestrictionTransactionDTO.attributeTypeMap; + } +} + diff --git a/src/infrastructure/model/accountDTO.ts b/src/infrastructure/model/accountDTO.ts index 0b3890eea9..0699243e48 100644 --- a/src/infrastructure/model/accountDTO.ts +++ b/src/infrastructure/model/accountDTO.ts @@ -17,7 +17,7 @@ * Catapult REST Endpoints * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) * - * The version of the OpenAPI document: 0.7.16 + * The version of the OpenAPI document: 0.7.18 * * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). @@ -25,23 +25,25 @@ * Do not edit the class manually. */ -import { MosaicDTO } from './mosaicDTO'; +import { AccountTypeEnum } from './accountTypeEnum'; +import { ActivityBucketDTO } from './activityBucketDTO'; +import { Mosaic } from './mosaic'; export class AccountDTO { /** - * The account unique address in hexadecimal. + * Decoded address. */ 'address': string; 'addressHeight': Array; - /** - * The public key of an account can be used to verify signatures of the account. Only accounts that have already published a transaction have a public key assigned to the account. Otherwise, the field is null. - */ 'publicKey': string; 'publicKeyHeight': Array; + 'accountType': AccountTypeEnum; + 'linkedAccountKey': string; + 'activityBuckets': Array; /** - * The list of mosaics the account owns. The amount is represented in absolute amount. Thus a balance of 123456789 for a mosaic with divisibility 6 (absolute) means the account owns 123.456789 instead. + * Mosaic units owned. The amount is represented in absolute amount. Thus a balance of 123456789 for a mosaic with divisibility 6 (absolute) means the account owns 123.456789. */ - 'mosaics': Array; + 'mosaics': Array; 'importance': Array; 'importanceHeight': Array; @@ -68,10 +70,25 @@ export class AccountDTO { "baseName": "publicKeyHeight", "type": "Array" }, + { + "name": "accountType", + "baseName": "accountType", + "type": "AccountTypeEnum" + }, + { + "name": "linkedAccountKey", + "baseName": "linkedAccountKey", + "type": "string" + }, + { + "name": "activityBuckets", + "baseName": "activityBuckets", + "type": "Array" + }, { "name": "mosaics", "baseName": "mosaics", - "type": "Array" + "type": "Array" }, { "name": "importance", diff --git a/src/infrastructure/model/accountIds.ts b/src/infrastructure/model/accountIds.ts index 1da22f763f..71d9aa6131 100644 --- a/src/infrastructure/model/accountIds.ts +++ b/src/infrastructure/model/accountIds.ts @@ -17,7 +17,7 @@ * Catapult REST Endpoints * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) * - * The version of the OpenAPI document: 0.7.16 + * The version of the OpenAPI document: 0.7.18 * * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). @@ -28,11 +28,11 @@ export class AccountIds { /** - * The array of public keys. + * Array of public keys. */ 'publicKeys'?: Array; /** - * The array of addresses. + * Array of addresses. */ 'addresses'?: Array; diff --git a/src/infrastructure/model/accountIdsAddresses.ts b/src/infrastructure/model/accountIdsAddresses.ts new file mode 100644 index 0000000000..481865bc55 --- /dev/null +++ b/src/infrastructure/model/accountIdsAddresses.ts @@ -0,0 +1,48 @@ +/* + * Copyright 2019 NEM + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +/** + * Catapult REST Endpoints + * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) + * + * The version of the OpenAPI document: 0.7.17 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +export class AccountIdsAddresses { + /** + * Array of addresses. + */ + 'addresses'?: Array; + + static discriminator: string | undefined = undefined; + + static attributeTypeMap: Array<{name: string, baseName: string, type: string}> = [ + { + "name": "addresses", + "baseName": "addresses", + "type": "Array" + } ]; + + static getAttributeTypeMap() { + return AccountIdsAddresses.attributeTypeMap; + } +} + diff --git a/src/infrastructure/model/accountIdsPublicKeys.ts b/src/infrastructure/model/accountIdsPublicKeys.ts new file mode 100644 index 0000000000..0f28d92ad9 --- /dev/null +++ b/src/infrastructure/model/accountIdsPublicKeys.ts @@ -0,0 +1,48 @@ +/* + * Copyright 2019 NEM + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +/** + * Catapult REST Endpoints + * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) + * + * The version of the OpenAPI document: 0.7.17 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +export class AccountIdsPublicKeys { + /** + * Array of public keys. + */ + 'publicKeys'?: Array; + + static discriminator: string | undefined = undefined; + + static attributeTypeMap: Array<{name: string, baseName: string, type: string}> = [ + { + "name": "publicKeys", + "baseName": "publicKeys", + "type": "Array" + } ]; + + static getAttributeTypeMap() { + return AccountIdsPublicKeys.attributeTypeMap; + } +} + diff --git a/src/infrastructure/model/accountInfoDTO.ts b/src/infrastructure/model/accountInfoDTO.ts index e2a190f4d9..1dead1916b 100644 --- a/src/infrastructure/model/accountInfoDTO.ts +++ b/src/infrastructure/model/accountInfoDTO.ts @@ -17,7 +17,7 @@ * Catapult REST Endpoints * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) * - * The version of the OpenAPI document: 0.7.16 + * The version of the OpenAPI document: 0.7.18 * * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). @@ -26,20 +26,13 @@ */ import { AccountDTO } from './accountDTO'; -import { AccountMetaDTO } from './accountMetaDTO'; export class AccountInfoDTO { - 'meta': AccountMetaDTO; 'account': AccountDTO; static discriminator: string | undefined = undefined; static attributeTypeMap: Array<{name: string, baseName: string, type: string}> = [ - { - "name": "meta", - "baseName": "meta", - "type": "AccountMetaDTO" - }, { "name": "account", "baseName": "account", diff --git a/src/infrastructure/model/accountLinkActionEnum.ts b/src/infrastructure/model/accountLinkActionEnum.ts new file mode 100644 index 0000000000..838e423f1c --- /dev/null +++ b/src/infrastructure/model/accountLinkActionEnum.ts @@ -0,0 +1,35 @@ +/* + * Copyright 2019 NEM + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +/** + * Catapult REST Endpoints + * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) + * + * The version of the OpenAPI document: 0.7.18 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +/** +* Type of action: * 0 - Unlink. * 1 - Link. +*/ +export enum AccountLinkActionEnum { + NUMBER_0 = 0, + NUMBER_1 = 1 +} diff --git a/src/infrastructure/model/accountLinkTransactionBodyDTO.ts b/src/infrastructure/model/accountLinkTransactionBodyDTO.ts new file mode 100644 index 0000000000..a4b9c973c3 --- /dev/null +++ b/src/infrastructure/model/accountLinkTransactionBodyDTO.ts @@ -0,0 +1,52 @@ +/* + * Copyright 2019 NEM + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +/** + * Catapult REST Endpoints + * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) + * + * The version of the OpenAPI document: 0.7.18 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + +import { AccountLinkActionEnum } from './accountLinkActionEnum'; + +export class AccountLinkTransactionBodyDTO { + 'remotePublicKey': string; + 'linkAction': AccountLinkActionEnum; + + static discriminator: string | undefined = undefined; + + static attributeTypeMap: Array<{name: string, baseName: string, type: string}> = [ + { + "name": "remotePublicKey", + "baseName": "remotePublicKey", + "type": "string" + }, + { + "name": "linkAction", + "baseName": "linkAction", + "type": "AccountLinkActionEnum" + } ]; + + static getAttributeTypeMap() { + return AccountLinkTransactionBodyDTO.attributeTypeMap; + } +} + diff --git a/src/infrastructure/model/accountLinkTransactionDTO.ts b/src/infrastructure/model/accountLinkTransactionDTO.ts new file mode 100644 index 0000000000..c7e4936937 --- /dev/null +++ b/src/infrastructure/model/accountLinkTransactionDTO.ts @@ -0,0 +1,96 @@ +/* + * Copyright 2019 NEM + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +/** + * Catapult REST Endpoints + * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) + * + * The version of the OpenAPI document: 0.7.18 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + +import { AccountLinkActionEnum } from './accountLinkActionEnum'; +import { AccountLinkTransactionBodyDTO } from './accountLinkTransactionBodyDTO'; +import { TransactionDTO } from './transactionDTO'; + +/** +* Delegates the account importance score to a proxy account. +*/ +export class AccountLinkTransactionDTO { + 'signature': string; + 'signerPublicKey': string; + /** + * Entity version. The higher byte represents the network identifier: * 0x68 (MAIN_NET) - Public main network. * 0x98 (TEST_NET) - Public test network. * 0x60 (MIJIN) - Private network. * 0x90 (MIJIN_TEST) - Private test network. + */ + 'version': number; + 'type': number; + 'maxFee': Array; + 'deadline': Array; + 'remotePublicKey': string; + 'linkAction': AccountLinkActionEnum; + + static discriminator: string | undefined = undefined; + + static attributeTypeMap: Array<{name: string, baseName: string, type: string}> = [ + { + "name": "signature", + "baseName": "signature", + "type": "string" + }, + { + "name": "signerPublicKey", + "baseName": "signerPublicKey", + "type": "string" + }, + { + "name": "version", + "baseName": "version", + "type": "number" + }, + { + "name": "type", + "baseName": "type", + "type": "number" + }, + { + "name": "maxFee", + "baseName": "maxFee", + "type": "Array" + }, + { + "name": "deadline", + "baseName": "deadline", + "type": "Array" + }, + { + "name": "remotePublicKey", + "baseName": "remotePublicKey", + "type": "string" + }, + { + "name": "linkAction", + "baseName": "linkAction", + "type": "AccountLinkActionEnum" + } ]; + + static getAttributeTypeMap() { + return AccountLinkTransactionDTO.attributeTypeMap; + } +} + diff --git a/src/infrastructure/model/accountMosaicRestrictionModificationDTO.ts b/src/infrastructure/model/accountMosaicRestrictionModificationDTO.ts new file mode 100644 index 0000000000..694cac403b --- /dev/null +++ b/src/infrastructure/model/accountMosaicRestrictionModificationDTO.ts @@ -0,0 +1,52 @@ +/* + * Copyright 2019 NEM + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +/** + * Catapult REST Endpoints + * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) + * + * The version of the OpenAPI document: 0.7.18 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + +import { AccountRestrictionModificationActionEnum } from './accountRestrictionModificationActionEnum'; + +export class AccountMosaicRestrictionModificationDTO { + 'modificationAction': AccountRestrictionModificationActionEnum; + 'value': Array; + + static discriminator: string | undefined = undefined; + + static attributeTypeMap: Array<{name: string, baseName: string, type: string}> = [ + { + "name": "modificationAction", + "baseName": "modificationAction", + "type": "AccountRestrictionModificationActionEnum" + }, + { + "name": "value", + "baseName": "value", + "type": "Array" + } ]; + + static getAttributeTypeMap() { + return AccountMosaicRestrictionModificationDTO.attributeTypeMap; + } +} + diff --git a/src/infrastructure/model/accountMosaicRestrictionModificationDTOAllOf.ts b/src/infrastructure/model/accountMosaicRestrictionModificationDTOAllOf.ts new file mode 100644 index 0000000000..ca72a0c0f3 --- /dev/null +++ b/src/infrastructure/model/accountMosaicRestrictionModificationDTOAllOf.ts @@ -0,0 +1,45 @@ +/* + * Copyright 2019 NEM + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +/** + * Catapult REST Endpoints + * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) + * + * The version of the OpenAPI document: 0.7.18 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +export class AccountMosaicRestrictionModificationDTOAllOf { + 'value': Array; + + static discriminator: string | undefined = undefined; + + static attributeTypeMap: Array<{name: string, baseName: string, type: string}> = [ + { + "name": "value", + "baseName": "value", + "type": "Array" + } ]; + + static getAttributeTypeMap() { + return AccountMosaicRestrictionModificationDTOAllOf.attributeTypeMap; + } +} + diff --git a/src/infrastructure/model/accountMosaicRestrictionTransactionBodyDTO.ts b/src/infrastructure/model/accountMosaicRestrictionTransactionBodyDTO.ts new file mode 100644 index 0000000000..ac9f7e4b3c --- /dev/null +++ b/src/infrastructure/model/accountMosaicRestrictionTransactionBodyDTO.ts @@ -0,0 +1,53 @@ +/* + * Copyright 2019 NEM + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +/** + * Catapult REST Endpoints + * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) + * + * The version of the OpenAPI document: 0.7.18 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + +import { AccountMosaicRestrictionModificationDTO } from './accountMosaicRestrictionModificationDTO'; +import { AccountRestrictionTypeEnum } from './accountRestrictionTypeEnum'; + +export class AccountMosaicRestrictionTransactionBodyDTO { + 'restrictionType': AccountRestrictionTypeEnum; + 'modifications': Array; + + static discriminator: string | undefined = undefined; + + static attributeTypeMap: Array<{name: string, baseName: string, type: string}> = [ + { + "name": "restrictionType", + "baseName": "restrictionType", + "type": "AccountRestrictionTypeEnum" + }, + { + "name": "modifications", + "baseName": "modifications", + "type": "Array" + } ]; + + static getAttributeTypeMap() { + return AccountMosaicRestrictionTransactionBodyDTO.attributeTypeMap; + } +} + diff --git a/src/infrastructure/model/accountMosaicRestrictionTransactionDTO.ts b/src/infrastructure/model/accountMosaicRestrictionTransactionDTO.ts new file mode 100644 index 0000000000..6fcc87c2aa --- /dev/null +++ b/src/infrastructure/model/accountMosaicRestrictionTransactionDTO.ts @@ -0,0 +1,97 @@ +/* + * Copyright 2019 NEM + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +/** + * Catapult REST Endpoints + * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) + * + * The version of the OpenAPI document: 0.7.18 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + +import { AccountMosaicRestrictionModificationDTO } from './accountMosaicRestrictionModificationDTO'; +import { AccountMosaicRestrictionTransactionBodyDTO } from './accountMosaicRestrictionTransactionBodyDTO'; +import { AccountRestrictionTypeEnum } from './accountRestrictionTypeEnum'; +import { TransactionDTO } from './transactionDTO'; + +/** +* Transaction to prevent incoming transactions containing a given set of mosaics. +*/ +export class AccountMosaicRestrictionTransactionDTO { + 'signature': string; + 'signerPublicKey': string; + /** + * Entity version. The higher byte represents the network identifier: * 0x68 (MAIN_NET) - Public main network. * 0x98 (TEST_NET) - Public test network. * 0x60 (MIJIN) - Private network. * 0x90 (MIJIN_TEST) - Private test network. + */ + 'version': number; + 'type': number; + 'maxFee': Array; + 'deadline': Array; + 'restrictionType': AccountRestrictionTypeEnum; + 'modifications': Array; + + static discriminator: string | undefined = undefined; + + static attributeTypeMap: Array<{name: string, baseName: string, type: string}> = [ + { + "name": "signature", + "baseName": "signature", + "type": "string" + }, + { + "name": "signerPublicKey", + "baseName": "signerPublicKey", + "type": "string" + }, + { + "name": "version", + "baseName": "version", + "type": "number" + }, + { + "name": "type", + "baseName": "type", + "type": "number" + }, + { + "name": "maxFee", + "baseName": "maxFee", + "type": "Array" + }, + { + "name": "deadline", + "baseName": "deadline", + "type": "Array" + }, + { + "name": "restrictionType", + "baseName": "restrictionType", + "type": "AccountRestrictionTypeEnum" + }, + { + "name": "modifications", + "baseName": "modifications", + "type": "Array" + } ]; + + static getAttributeTypeMap() { + return AccountMosaicRestrictionTransactionDTO.attributeTypeMap; + } +} + diff --git a/src/infrastructure/model/accountNamesDTO.ts b/src/infrastructure/model/accountNamesDTO.ts index b6e99a36cb..fb896d2b00 100644 --- a/src/infrastructure/model/accountNamesDTO.ts +++ b/src/infrastructure/model/accountNamesDTO.ts @@ -17,7 +17,7 @@ * Catapult REST Endpoints * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) * - * The version of the OpenAPI document: 0.7.16 + * The version of the OpenAPI document: 0.7.18 * * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). @@ -28,11 +28,11 @@ export class AccountNamesDTO { /** - * The address of the account in hexadecimal. + * Decoded address. */ 'address': string; /** - * The mosaic linked namespace names. + * Account linked namespace names. */ 'names': Array; diff --git a/src/infrastructure/model/accountOperationRestrictionModificationDTO.ts b/src/infrastructure/model/accountOperationRestrictionModificationDTO.ts new file mode 100644 index 0000000000..2d3d69fcac --- /dev/null +++ b/src/infrastructure/model/accountOperationRestrictionModificationDTO.ts @@ -0,0 +1,53 @@ +/* + * Copyright 2019 NEM + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +/** + * Catapult REST Endpoints + * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) + * + * The version of the OpenAPI document: 0.7.18 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + +import { AccountRestrictionModificationActionEnum } from './accountRestrictionModificationActionEnum'; +import { TransactionTypeEnum } from './transactionTypeEnum'; + +export class AccountOperationRestrictionModificationDTO { + 'modificationAction': AccountRestrictionModificationActionEnum; + 'value': TransactionTypeEnum; + + static discriminator: string | undefined = undefined; + + static attributeTypeMap: Array<{name: string, baseName: string, type: string}> = [ + { + "name": "modificationAction", + "baseName": "modificationAction", + "type": "AccountRestrictionModificationActionEnum" + }, + { + "name": "value", + "baseName": "value", + "type": "TransactionTypeEnum" + } ]; + + static getAttributeTypeMap() { + return AccountOperationRestrictionModificationDTO.attributeTypeMap; + } +} + diff --git a/src/infrastructure/model/accountOperationRestrictionModificationDTOAllOf.ts b/src/infrastructure/model/accountOperationRestrictionModificationDTOAllOf.ts new file mode 100644 index 0000000000..33273c79d8 --- /dev/null +++ b/src/infrastructure/model/accountOperationRestrictionModificationDTOAllOf.ts @@ -0,0 +1,46 @@ +/* + * Copyright 2019 NEM + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +/** + * Catapult REST Endpoints + * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) + * + * The version of the OpenAPI document: 0.7.18 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + +import { TransactionTypeEnum } from './transactionTypeEnum'; + +export class AccountOperationRestrictionModificationDTOAllOf { + 'value': TransactionTypeEnum; + + static discriminator: string | undefined = undefined; + + static attributeTypeMap: Array<{name: string, baseName: string, type: string}> = [ + { + "name": "value", + "baseName": "value", + "type": "TransactionTypeEnum" + } ]; + + static getAttributeTypeMap() { + return AccountOperationRestrictionModificationDTOAllOf.attributeTypeMap; + } +} + diff --git a/src/infrastructure/model/accountOperationRestrictionTransactionBodyDTO.ts b/src/infrastructure/model/accountOperationRestrictionTransactionBodyDTO.ts new file mode 100644 index 0000000000..03e823bee5 --- /dev/null +++ b/src/infrastructure/model/accountOperationRestrictionTransactionBodyDTO.ts @@ -0,0 +1,53 @@ +/* + * Copyright 2019 NEM + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +/** + * Catapult REST Endpoints + * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) + * + * The version of the OpenAPI document: 0.7.18 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + +import { AccountOperationRestrictionModificationDTO } from './accountOperationRestrictionModificationDTO'; +import { AccountRestrictionTypeEnum } from './accountRestrictionTypeEnum'; + +export class AccountOperationRestrictionTransactionBodyDTO { + 'restrictionType': AccountRestrictionTypeEnum; + 'modifications': Array; + + static discriminator: string | undefined = undefined; + + static attributeTypeMap: Array<{name: string, baseName: string, type: string}> = [ + { + "name": "restrictionType", + "baseName": "restrictionType", + "type": "AccountRestrictionTypeEnum" + }, + { + "name": "modifications", + "baseName": "modifications", + "type": "Array" + } ]; + + static getAttributeTypeMap() { + return AccountOperationRestrictionTransactionBodyDTO.attributeTypeMap; + } +} + diff --git a/src/infrastructure/model/accountOperationRestrictionTransactionDTO.ts b/src/infrastructure/model/accountOperationRestrictionTransactionDTO.ts new file mode 100644 index 0000000000..df5c260b3c --- /dev/null +++ b/src/infrastructure/model/accountOperationRestrictionTransactionDTO.ts @@ -0,0 +1,97 @@ +/* + * Copyright 2019 NEM + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +/** + * Catapult REST Endpoints + * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) + * + * The version of the OpenAPI document: 0.7.18 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + +import { AccountOperationRestrictionModificationDTO } from './accountOperationRestrictionModificationDTO'; +import { AccountOperationRestrictionTransactionBodyDTO } from './accountOperationRestrictionTransactionBodyDTO'; +import { AccountRestrictionTypeEnum } from './accountRestrictionTypeEnum'; +import { TransactionDTO } from './transactionDTO'; + +/** +* Transaction to prevent outgoing transactions by transaction type. +*/ +export class AccountOperationRestrictionTransactionDTO { + 'signature': string; + 'signerPublicKey': string; + /** + * Entity version. The higher byte represents the network identifier: * 0x68 (MAIN_NET) - Public main network. * 0x98 (TEST_NET) - Public test network. * 0x60 (MIJIN) - Private network. * 0x90 (MIJIN_TEST) - Private test network. + */ + 'version': number; + 'type': number; + 'maxFee': Array; + 'deadline': Array; + 'restrictionType': AccountRestrictionTypeEnum; + 'modifications': Array; + + static discriminator: string | undefined = undefined; + + static attributeTypeMap: Array<{name: string, baseName: string, type: string}> = [ + { + "name": "signature", + "baseName": "signature", + "type": "string" + }, + { + "name": "signerPublicKey", + "baseName": "signerPublicKey", + "type": "string" + }, + { + "name": "version", + "baseName": "version", + "type": "number" + }, + { + "name": "type", + "baseName": "type", + "type": "number" + }, + { + "name": "maxFee", + "baseName": "maxFee", + "type": "Array" + }, + { + "name": "deadline", + "baseName": "deadline", + "type": "Array" + }, + { + "name": "restrictionType", + "baseName": "restrictionType", + "type": "AccountRestrictionTypeEnum" + }, + { + "name": "modifications", + "baseName": "modifications", + "type": "Array" + } ]; + + static getAttributeTypeMap() { + return AccountOperationRestrictionTransactionDTO.attributeTypeMap; + } +} + diff --git a/src/infrastructure/model/accountRestrictionDTO.ts b/src/infrastructure/model/accountRestrictionDTO.ts index 0da2925a92..f1290bb3a5 100644 --- a/src/infrastructure/model/accountRestrictionDTO.ts +++ b/src/infrastructure/model/accountRestrictionDTO.ts @@ -17,7 +17,7 @@ * Catapult REST Endpoints * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) * - * The version of the OpenAPI document: 0.7.16 + * The version of the OpenAPI document: 0.7.18 * * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). @@ -30,9 +30,9 @@ import { AccountRestrictionTypeEnum } from './accountRestrictionTypeEnum'; export class AccountRestrictionDTO { 'restrictionType': AccountRestrictionTypeEnum; /** - * The address, transaction type or mosaic id to restrict. + * Address, transaction type, or mosaic id to restrict. */ - 'values': Array; + 'values': Array; static discriminator: string | undefined = undefined; @@ -45,7 +45,7 @@ export class AccountRestrictionDTO { { "name": "values", "baseName": "values", - "type": "Array" + "type": "Array" } ]; static getAttributeTypeMap() { diff --git a/src/infrastructure/model/accountRestrictionModificationActionEnum.ts b/src/infrastructure/model/accountRestrictionModificationActionEnum.ts new file mode 100644 index 0000000000..bb45da5992 --- /dev/null +++ b/src/infrastructure/model/accountRestrictionModificationActionEnum.ts @@ -0,0 +1,35 @@ +/* + * Copyright 2019 NEM + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +/** + * Catapult REST Endpoints + * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) + * + * The version of the OpenAPI document: 0.7.18 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +/** +* Type of action: * 0 - Remove property. * 1 - Add property. +*/ +export enum AccountRestrictionModificationActionEnum { + NUMBER_0 = 0, + NUMBER_1 = 1 +} diff --git a/src/infrastructure/model/accountRestrictionModificationDTO.ts b/src/infrastructure/model/accountRestrictionModificationDTO.ts new file mode 100644 index 0000000000..7a79a19ae8 --- /dev/null +++ b/src/infrastructure/model/accountRestrictionModificationDTO.ts @@ -0,0 +1,46 @@ +/* + * Copyright 2019 NEM + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +/** + * Catapult REST Endpoints + * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) + * + * The version of the OpenAPI document: 0.7.18 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + +import { AccountRestrictionModificationActionEnum } from './accountRestrictionModificationActionEnum'; + +export class AccountRestrictionModificationDTO { + 'modificationAction': AccountRestrictionModificationActionEnum; + + static discriminator: string | undefined = undefined; + + static attributeTypeMap: Array<{name: string, baseName: string, type: string}> = [ + { + "name": "modificationAction", + "baseName": "modificationAction", + "type": "AccountRestrictionModificationActionEnum" + } ]; + + static getAttributeTypeMap() { + return AccountRestrictionModificationDTO.attributeTypeMap; + } +} + diff --git a/src/infrastructure/model/accountRestrictionModificationTypeEnum.ts b/src/infrastructure/model/accountRestrictionModificationTypeEnum.ts new file mode 100644 index 0000000000..6ea104ef40 --- /dev/null +++ b/src/infrastructure/model/accountRestrictionModificationTypeEnum.ts @@ -0,0 +1,35 @@ +/* + * Copyright 2019 NEM + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +/** + * Catapult REST Endpoints + * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) + * + * The version of the OpenAPI document: 0.7.17 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +/** +* Type of account restriction modification: * 0 - Add property. * 1 - Remove property. +*/ +export enum AccountRestrictionModificationTypeEnum { + NUMBER_0 = 0, + NUMBER_1 = 1 +} diff --git a/src/infrastructure/model/accountRestrictionTransactionBodyDTO.ts b/src/infrastructure/model/accountRestrictionTransactionBodyDTO.ts new file mode 100644 index 0000000000..5e9cd2609b --- /dev/null +++ b/src/infrastructure/model/accountRestrictionTransactionBodyDTO.ts @@ -0,0 +1,53 @@ +/* + * Copyright 2019 NEM + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +/** + * Catapult REST Endpoints + * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) + * + * The version of the OpenAPI document: 0.7.17 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + +import { AccountRestrictionModificationDTO } from './accountRestrictionModificationDTO'; +import { AccountRestrictionTypeEnum } from './accountRestrictionTypeEnum'; + +export class AccountRestrictionTransactionBodyDTO { + 'propertyType': AccountRestrictionTypeEnum; + 'modifications': Array; + + static discriminator: string | undefined = undefined; + + static attributeTypeMap: Array<{name: string, baseName: string, type: string}> = [ + { + "name": "propertyType", + "baseName": "propertyType", + "type": "AccountRestrictionTypeEnum" + }, + { + "name": "modifications", + "baseName": "modifications", + "type": "Array" + } ]; + + static getAttributeTypeMap() { + return AccountRestrictionTransactionBodyDTO.attributeTypeMap; + } +} + diff --git a/src/infrastructure/model/accountRestrictionTransactionDTO.ts b/src/infrastructure/model/accountRestrictionTransactionDTO.ts new file mode 100644 index 0000000000..361918f16e --- /dev/null +++ b/src/infrastructure/model/accountRestrictionTransactionDTO.ts @@ -0,0 +1,104 @@ +/* + * Copyright 2019 NEM + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +/** + * Catapult REST Endpoints + * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) + * + * The version of the OpenAPI document: 0.7.17 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + +import { AccountRestrictionModificationDTO } from './accountRestrictionModificationDTO'; +import { AccountRestrictionTransactionBodyDTO } from './accountRestrictionTransactionBodyDTO'; +import { AccountRestrictionTypeEnum } from './accountRestrictionTypeEnum'; +import { EntityTypeEnum } from './entityTypeEnum'; +import { TransactionDTO } from './transactionDTO'; + +/** +* Transaction to prevent receiving transactions from undesired addresses, mosaics or sending certain transaction types. +*/ +export class AccountRestrictionTransactionDTO { + /** + * Signature of the entity generated by the signer. It is used to validate tha the entity data was not modified by a node. + */ + 'signature': string; + /** + * Public key of the signer account. + */ + 'signer': string; + /** + * Version of the entity. The higher byte represents the network identifier: * 0x68 (MAIN_NET) - Public main network. * 0x98 (TEST_NET) - Public test network. * 0x60 (MIJIN) - Private network. * 0x90 (MIJIN_TEST) - Private test network. + */ + 'version': number; + 'type': EntityTypeEnum; + 'maxFee': Array; + 'deadline': Array; + 'propertyType': AccountRestrictionTypeEnum; + 'modifications': Array; + + static discriminator: string | undefined = undefined; + + static attributeTypeMap: Array<{name: string, baseName: string, type: string}> = [ + { + "name": "signature", + "baseName": "signature", + "type": "string" + }, + { + "name": "signer", + "baseName": "signer", + "type": "string" + }, + { + "name": "version", + "baseName": "version", + "type": "number" + }, + { + "name": "type", + "baseName": "type", + "type": "EntityTypeEnum" + }, + { + "name": "maxFee", + "baseName": "max_fee", + "type": "Array" + }, + { + "name": "deadline", + "baseName": "deadline", + "type": "Array" + }, + { + "name": "propertyType", + "baseName": "propertyType", + "type": "AccountRestrictionTypeEnum" + }, + { + "name": "modifications", + "baseName": "modifications", + "type": "Array" + } ]; + + static getAttributeTypeMap() { + return AccountRestrictionTransactionDTO.attributeTypeMap; + } +} + diff --git a/src/infrastructure/model/accountRestrictionTypeEnum.ts b/src/infrastructure/model/accountRestrictionTypeEnum.ts index f23969ad40..382ed9ba8c 100644 --- a/src/infrastructure/model/accountRestrictionTypeEnum.ts +++ b/src/infrastructure/model/accountRestrictionTypeEnum.ts @@ -17,7 +17,7 @@ * Catapult REST Endpoints * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) * - * The version of the OpenAPI document: 0.7.16 + * The version of the OpenAPI document: 0.7.18 * * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). @@ -27,17 +27,16 @@ /** -* The account restriction type: * 0x01 (1 decimal) - Allow only receiving transactions from an address. * 0x02 (2 decimal) - Allow only receiving transactions containing a mosaic id. * 0x04 (4 decimal) - Allow only sending transactions with a given transaction type. * 0x05 (5 decimal) - Restriction type sentinel. * 0x81 (129 decimal) - Block receiving transactions from an address. * 0x82 (130 decimal) - Block receiving transactions containing a mosaic id. * 0x84 (132 decimal) - Block sending transactions with a given transaction type. +* Type of account restriction: * 0x01 (1 decimal) - Allow only incoming transactions from a given address. * 0x02 (2 decimal) - Allow only incoming transactions containing a given mosaic identifier. * 0x05 (5 decimal) - Account restriction sentinel. * 0x41 (65 decimal) - Allow only outgoing transactions to a given address. * 0x44 (68 decimal) - Allow only outgoing transactions with a given transaction type. * 0x81 (129 decimal) - Block incoming transactions from a given address. * 0x82 (130 decimal) - Block incoming transactions containing a given mosaic identifier. * 0xC1 (193 decimal) - Block outgoing transactions to a given address. * 0xC4 (196 decimal) - Block outgoing transactions with a given transaction type. */ -export class AccountRestrictionTypeEnum { - - static discriminator: string | undefined = undefined; - - static attributeTypeMap: Array<{name: string, baseName: string, type: string}> = [ - ]; - - static getAttributeTypeMap() { - return AccountRestrictionTypeEnum.attributeTypeMap; - } +export enum AccountRestrictionTypeEnum { + NUMBER_1 = 1, + NUMBER_2 = 2, + NUMBER_5 = 5, + NUMBER_65 = 65, + NUMBER_68 = 68, + NUMBER_129 = 129, + NUMBER_130 = 130, + NUMBER_193 = 193, + NUMBER_196 = 196 } - diff --git a/src/infrastructure/model/accountRestrictionsDTO.ts b/src/infrastructure/model/accountRestrictionsDTO.ts index 61512ce91f..dc8ff32652 100644 --- a/src/infrastructure/model/accountRestrictionsDTO.ts +++ b/src/infrastructure/model/accountRestrictionsDTO.ts @@ -17,7 +17,7 @@ * Catapult REST Endpoints * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) * - * The version of the OpenAPI document: 0.7.16 + * The version of the OpenAPI document: 0.7.18 * * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). @@ -29,7 +29,7 @@ import { AccountRestrictionDTO } from './accountRestrictionDTO'; export class AccountRestrictionsDTO { /** - * The address of the account in hexadecimal. + * Decoded address. */ 'address': string; 'restrictions': Array; diff --git a/src/infrastructure/model/accountRestrictionsInfoDTO.ts b/src/infrastructure/model/accountRestrictionsInfoDTO.ts index 8dc7cacf80..5df56a42f9 100644 --- a/src/infrastructure/model/accountRestrictionsInfoDTO.ts +++ b/src/infrastructure/model/accountRestrictionsInfoDTO.ts @@ -17,7 +17,7 @@ * Catapult REST Endpoints * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) * - * The version of the OpenAPI document: 0.7.16 + * The version of the OpenAPI document: 0.7.18 * * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). diff --git a/src/infrastructure/model/accountTypeEnum.ts b/src/infrastructure/model/accountTypeEnum.ts new file mode 100644 index 0000000000..2c5dba3181 --- /dev/null +++ b/src/infrastructure/model/accountTypeEnum.ts @@ -0,0 +1,37 @@ +/* + * Copyright 2019 NEM + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +/** + * Catapult REST Endpoints + * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) + * + * The version of the OpenAPI document: 0.7.18 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +/** +* * 0 - Unlinked. * 1 - Balance-holding account that is linked to a remote harvester account. * 2 - Remote harvester account that is linked to a balance-holding account. * 3 - Remote harvester eligible account that is unlinked. +*/ +export enum AccountTypeEnum { + NUMBER_0 = 0, + NUMBER_1 = 1, + NUMBER_2 = 2, + NUMBER_3 = 3 +} diff --git a/src/infrastructure/model/accountsNamesDTO.ts b/src/infrastructure/model/accountsNamesDTO.ts new file mode 100644 index 0000000000..da81545d5d --- /dev/null +++ b/src/infrastructure/model/accountsNamesDTO.ts @@ -0,0 +1,49 @@ +/* + * Copyright 2019 NEM + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +/** + * Catapult REST Endpoints + * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) + * + * The version of the OpenAPI document: 0.7.18 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + +import { AccountNamesDTO } from './accountNamesDTO'; + +export class AccountsNamesDTO { + /** + * Array of account names. + */ + 'accountNames': Array; + + static discriminator: string | undefined = undefined; + + static attributeTypeMap: Array<{name: string, baseName: string, type: string}> = [ + { + "name": "accountNames", + "baseName": "accountNames", + "type": "Array" + } ]; + + static getAttributeTypeMap() { + return AccountsNamesDTO.attributeTypeMap; + } +} + diff --git a/src/infrastructure/model/activityBucketDTO.ts b/src/infrastructure/model/activityBucketDTO.ts new file mode 100644 index 0000000000..e91ca575ec --- /dev/null +++ b/src/infrastructure/model/activityBucketDTO.ts @@ -0,0 +1,63 @@ +/* + * Copyright 2019 NEM + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +/** + * Catapult REST Endpoints + * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) + * + * The version of the OpenAPI document: 0.7.18 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +export class ActivityBucketDTO { + 'startHeight': string; + 'totalFeesPaid': number; + 'beneficiaryCount': number; + 'rawScore': number; + + static discriminator: string | undefined = undefined; + + static attributeTypeMap: Array<{name: string, baseName: string, type: string}> = [ + { + "name": "startHeight", + "baseName": "startHeight", + "type": "string" + }, + { + "name": "totalFeesPaid", + "baseName": "totalFeesPaid", + "type": "number" + }, + { + "name": "beneficiaryCount", + "baseName": "beneficiaryCount", + "type": "number" + }, + { + "name": "rawScore", + "baseName": "rawScore", + "type": "number" + } ]; + + static getAttributeTypeMap() { + return ActivityBucketDTO.attributeTypeMap; + } +} + diff --git a/src/infrastructure/model/addressAliasTransactionBodyDTO.ts b/src/infrastructure/model/addressAliasTransactionBodyDTO.ts new file mode 100644 index 0000000000..2457bfcc01 --- /dev/null +++ b/src/infrastructure/model/addressAliasTransactionBodyDTO.ts @@ -0,0 +1,61 @@ +/* + * Copyright 2019 NEM + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +/** + * Catapult REST Endpoints + * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) + * + * The version of the OpenAPI document: 0.7.18 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + +import { AliasActionEnum } from './aliasActionEnum'; + +export class AddressAliasTransactionBodyDTO { + 'aliasAction': AliasActionEnum; + 'namespaceId': Array; + /** + * Decoded address. + */ + 'address': string; + + static discriminator: string | undefined = undefined; + + static attributeTypeMap: Array<{name: string, baseName: string, type: string}> = [ + { + "name": "aliasAction", + "baseName": "aliasAction", + "type": "AliasActionEnum" + }, + { + "name": "namespaceId", + "baseName": "namespaceId", + "type": "Array" + }, + { + "name": "address", + "baseName": "address", + "type": "string" + } ]; + + static getAttributeTypeMap() { + return AddressAliasTransactionBodyDTO.attributeTypeMap; + } +} + diff --git a/src/infrastructure/model/addressAliasTransactionDTO.ts b/src/infrastructure/model/addressAliasTransactionDTO.ts new file mode 100644 index 0000000000..ffc61a7ee8 --- /dev/null +++ b/src/infrastructure/model/addressAliasTransactionDTO.ts @@ -0,0 +1,105 @@ +/* + * Copyright 2019 NEM + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +/** + * Catapult REST Endpoints + * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) + * + * The version of the OpenAPI document: 0.7.18 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + +import { AddressAliasTransactionBodyDTO } from './addressAliasTransactionBodyDTO'; +import { AliasActionEnum } from './aliasActionEnum'; +import { TransactionDTO } from './transactionDTO'; + +/** +* Transaction to link a namespace to an account. +*/ +export class AddressAliasTransactionDTO { + 'signature': string; + 'signerPublicKey': string; + /** + * Entity version. The higher byte represents the network identifier: * 0x68 (MAIN_NET) - Public main network. * 0x98 (TEST_NET) - Public test network. * 0x60 (MIJIN) - Private network. * 0x90 (MIJIN_TEST) - Private test network. + */ + 'version': number; + 'type': number; + 'maxFee': Array; + 'deadline': Array; + 'aliasAction': AliasActionEnum; + 'namespaceId': Array; + /** + * Decoded address. + */ + 'address': string; + + static discriminator: string | undefined = undefined; + + static attributeTypeMap: Array<{name: string, baseName: string, type: string}> = [ + { + "name": "signature", + "baseName": "signature", + "type": "string" + }, + { + "name": "signerPublicKey", + "baseName": "signerPublicKey", + "type": "string" + }, + { + "name": "version", + "baseName": "version", + "type": "number" + }, + { + "name": "type", + "baseName": "type", + "type": "number" + }, + { + "name": "maxFee", + "baseName": "maxFee", + "type": "Array" + }, + { + "name": "deadline", + "baseName": "deadline", + "type": "Array" + }, + { + "name": "aliasAction", + "baseName": "aliasAction", + "type": "AliasActionEnum" + }, + { + "name": "namespaceId", + "baseName": "namespaceId", + "type": "Array" + }, + { + "name": "address", + "baseName": "address", + "type": "string" + } ]; + + static getAttributeTypeMap() { + return AddressAliasTransactionDTO.attributeTypeMap; + } +} + diff --git a/src/infrastructure/model/addressMosaicRestrictionTransactionBodyDTO.ts b/src/infrastructure/model/addressMosaicRestrictionTransactionBodyDTO.ts new file mode 100644 index 0000000000..041bcadfab --- /dev/null +++ b/src/infrastructure/model/addressMosaicRestrictionTransactionBodyDTO.ts @@ -0,0 +1,72 @@ +/* + * Copyright 2019 NEM + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +/** + * Catapult REST Endpoints + * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) + * + * The version of the OpenAPI document: 0.7.18 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +export class AddressMosaicRestrictionTransactionBodyDTO { + 'mosaicId': Array; + 'restrictionKey': Array; + /** + * Address decoded. If the bit 0 of byte 0 is not set (like in 0x90), then it is a regular address. Else (e.g. 0x91) it represents a namespace id which starts at byte 1. + */ + 'targetAddress': string; + 'previousRestrictionValue': Array; + 'newRestrictionValue': Array; + + static discriminator: string | undefined = undefined; + + static attributeTypeMap: Array<{name: string, baseName: string, type: string}> = [ + { + "name": "mosaicId", + "baseName": "mosaicId", + "type": "Array" + }, + { + "name": "restrictionKey", + "baseName": "restrictionKey", + "type": "Array" + }, + { + "name": "targetAddress", + "baseName": "targetAddress", + "type": "string" + }, + { + "name": "previousRestrictionValue", + "baseName": "previousRestrictionValue", + "type": "Array" + }, + { + "name": "newRestrictionValue", + "baseName": "newRestrictionValue", + "type": "Array" + } ]; + + static getAttributeTypeMap() { + return AddressMosaicRestrictionTransactionBodyDTO.attributeTypeMap; + } +} + diff --git a/src/infrastructure/model/addressMosaicRestrictionTransactionDTO.ts b/src/infrastructure/model/addressMosaicRestrictionTransactionDTO.ts new file mode 100644 index 0000000000..6f604daec9 --- /dev/null +++ b/src/infrastructure/model/addressMosaicRestrictionTransactionDTO.ts @@ -0,0 +1,116 @@ +/* + * Copyright 2019 NEM + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +/** + * Catapult REST Endpoints + * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) + * + * The version of the OpenAPI document: 0.7.18 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + +import { AddressMosaicRestrictionTransactionBodyDTO } from './addressMosaicRestrictionTransactionBodyDTO'; +import { TransactionDTO } from './transactionDTO'; + +/** +* Transaction to set a restriction rule to an address. +*/ +export class AddressMosaicRestrictionTransactionDTO { + 'signature': string; + 'signerPublicKey': string; + /** + * Entity version. The higher byte represents the network identifier: * 0x68 (MAIN_NET) - Public main network. * 0x98 (TEST_NET) - Public test network. * 0x60 (MIJIN) - Private network. * 0x90 (MIJIN_TEST) - Private test network. + */ + 'version': number; + 'type': number; + 'maxFee': Array; + 'deadline': Array; + 'mosaicId': Array; + 'restrictionKey': Array; + /** + * Address decoded. If the bit 0 of byte 0 is not set (like in 0x90), then it is a regular address. Else (e.g. 0x91) it represents a namespace id which starts at byte 1. + */ + 'targetAddress': string; + 'previousRestrictionValue': Array; + 'newRestrictionValue': Array; + + static discriminator: string | undefined = undefined; + + static attributeTypeMap: Array<{name: string, baseName: string, type: string}> = [ + { + "name": "signature", + "baseName": "signature", + "type": "string" + }, + { + "name": "signerPublicKey", + "baseName": "signerPublicKey", + "type": "string" + }, + { + "name": "version", + "baseName": "version", + "type": "number" + }, + { + "name": "type", + "baseName": "type", + "type": "number" + }, + { + "name": "maxFee", + "baseName": "maxFee", + "type": "Array" + }, + { + "name": "deadline", + "baseName": "deadline", + "type": "Array" + }, + { + "name": "mosaicId", + "baseName": "mosaicId", + "type": "Array" + }, + { + "name": "restrictionKey", + "baseName": "restrictionKey", + "type": "Array" + }, + { + "name": "targetAddress", + "baseName": "targetAddress", + "type": "string" + }, + { + "name": "previousRestrictionValue", + "baseName": "previousRestrictionValue", + "type": "Array" + }, + { + "name": "newRestrictionValue", + "baseName": "newRestrictionValue", + "type": "Array" + } ]; + + static getAttributeTypeMap() { + return AddressMosaicRestrictionTransactionDTO.attributeTypeMap; + } +} + diff --git a/src/infrastructure/model/aggregateBondedTransactionDTO.ts b/src/infrastructure/model/aggregateBondedTransactionDTO.ts new file mode 100644 index 0000000000..081fb28044 --- /dev/null +++ b/src/infrastructure/model/aggregateBondedTransactionDTO.ts @@ -0,0 +1,103 @@ +/* + * Copyright 2019 NEM + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +/** + * Catapult REST Endpoints + * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) + * + * The version of the OpenAPI document: 0.7.18 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + +import { AggregateTransactionBodyDTO } from './aggregateTransactionBodyDTO'; +import { CosignatureDTO } from './cosignatureDTO'; +import { EmbeddedTransactionInfoDTO } from './embeddedTransactionInfoDTO'; +import { TransactionDTO } from './transactionDTO'; + +/** +* Transaction to combine multiple transactions together. +*/ +export class AggregateBondedTransactionDTO { + 'signature': string; + 'signerPublicKey': string; + /** + * Entity version. The higher byte represents the network identifier: * 0x68 (MAIN_NET) - Public main network. * 0x98 (TEST_NET) - Public test network. * 0x60 (MIJIN) - Private network. * 0x90 (MIJIN_TEST) - Private test network. + */ + 'version': number; + 'type': number; + 'maxFee': Array; + 'deadline': Array; + /** + * Array of transaction cosignatures. + */ + 'cosignatures': Array; + /** + * Array of transactions initiated by different accounts. + */ + 'transactions': Array; + + static discriminator: string | undefined = undefined; + + static attributeTypeMap: Array<{name: string, baseName: string, type: string}> = [ + { + "name": "signature", + "baseName": "signature", + "type": "string" + }, + { + "name": "signerPublicKey", + "baseName": "signerPublicKey", + "type": "string" + }, + { + "name": "version", + "baseName": "version", + "type": "number" + }, + { + "name": "type", + "baseName": "type", + "type": "number" + }, + { + "name": "maxFee", + "baseName": "maxFee", + "type": "Array" + }, + { + "name": "deadline", + "baseName": "deadline", + "type": "Array" + }, + { + "name": "cosignatures", + "baseName": "cosignatures", + "type": "Array" + }, + { + "name": "transactions", + "baseName": "transactions", + "type": "Array" + } ]; + + static getAttributeTypeMap() { + return AggregateBondedTransactionDTO.attributeTypeMap; + } +} + diff --git a/src/infrastructure/model/aggregateCompleteTransactionDTO.ts b/src/infrastructure/model/aggregateCompleteTransactionDTO.ts new file mode 100644 index 0000000000..6260f136e7 --- /dev/null +++ b/src/infrastructure/model/aggregateCompleteTransactionDTO.ts @@ -0,0 +1,103 @@ +/* + * Copyright 2019 NEM + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +/** + * Catapult REST Endpoints + * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) + * + * The version of the OpenAPI document: 0.7.18 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + +import { AggregateTransactionBodyDTO } from './aggregateTransactionBodyDTO'; +import { CosignatureDTO } from './cosignatureDTO'; +import { EmbeddedTransactionInfoDTO } from './embeddedTransactionInfoDTO'; +import { TransactionDTO } from './transactionDTO'; + +/** +* Transaction to combine multiple transactions together. +*/ +export class AggregateCompleteTransactionDTO { + 'signature': string; + 'signerPublicKey': string; + /** + * Entity version. The higher byte represents the network identifier: * 0x68 (MAIN_NET) - Public main network. * 0x98 (TEST_NET) - Public test network. * 0x60 (MIJIN) - Private network. * 0x90 (MIJIN_TEST) - Private test network. + */ + 'version': number; + 'type': number; + 'maxFee': Array; + 'deadline': Array; + /** + * Array of transaction cosignatures. + */ + 'cosignatures': Array; + /** + * Array of transactions initiated by different accounts. + */ + 'transactions': Array; + + static discriminator: string | undefined = undefined; + + static attributeTypeMap: Array<{name: string, baseName: string, type: string}> = [ + { + "name": "signature", + "baseName": "signature", + "type": "string" + }, + { + "name": "signerPublicKey", + "baseName": "signerPublicKey", + "type": "string" + }, + { + "name": "version", + "baseName": "version", + "type": "number" + }, + { + "name": "type", + "baseName": "type", + "type": "number" + }, + { + "name": "maxFee", + "baseName": "maxFee", + "type": "Array" + }, + { + "name": "deadline", + "baseName": "deadline", + "type": "Array" + }, + { + "name": "cosignatures", + "baseName": "cosignatures", + "type": "Array" + }, + { + "name": "transactions", + "baseName": "transactions", + "type": "Array" + } ]; + + static getAttributeTypeMap() { + return AggregateCompleteTransactionDTO.attributeTypeMap; + } +} + diff --git a/src/infrastructure/model/aggregateTransactionBodyDTO.ts b/src/infrastructure/model/aggregateTransactionBodyDTO.ts new file mode 100644 index 0000000000..b311fdb281 --- /dev/null +++ b/src/infrastructure/model/aggregateTransactionBodyDTO.ts @@ -0,0 +1,59 @@ +/* + * Copyright 2019 NEM + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +/** + * Catapult REST Endpoints + * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) + * + * The version of the OpenAPI document: 0.7.18 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + +import { CosignatureDTO } from './cosignatureDTO'; +import { EmbeddedTransactionInfoDTO } from './embeddedTransactionInfoDTO'; + +export class AggregateTransactionBodyDTO { + /** + * Array of transaction cosignatures. + */ + 'cosignatures': Array; + /** + * Array of transactions initiated by different accounts. + */ + 'transactions': Array; + + static discriminator: string | undefined = undefined; + + static attributeTypeMap: Array<{name: string, baseName: string, type: string}> = [ + { + "name": "cosignatures", + "baseName": "cosignatures", + "type": "Array" + }, + { + "name": "transactions", + "baseName": "transactions", + "type": "Array" + } ]; + + static getAttributeTypeMap() { + return AggregateTransactionBodyDTO.attributeTypeMap; + } +} + diff --git a/src/infrastructure/model/aggregateTransactionDTO.ts b/src/infrastructure/model/aggregateTransactionDTO.ts new file mode 100644 index 0000000000..ab308aa43e --- /dev/null +++ b/src/infrastructure/model/aggregateTransactionDTO.ts @@ -0,0 +1,110 @@ +/* + * Copyright 2019 NEM + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +/** + * Catapult REST Endpoints + * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) + * + * The version of the OpenAPI document: 0.7.17 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + +import { AggregateTransactionBodyDTO } from './aggregateTransactionBodyDTO'; +import { CosignatureDTO } from './cosignatureDTO'; +import { EmbeddedTransactionInfoDTO } from './embeddedTransactionInfoDTO'; +import { EntityTypeEnum } from './entityTypeEnum'; +import { TransactionDTO } from './transactionDTO'; + +/** +* Transaction to combine multiple transactions together. +*/ +export class AggregateTransactionDTO { + /** + * Signature of the entity generated by the signer. It is used to validate tha the entity data was not modified by a node. + */ + 'signature': string; + /** + * Public key of the signer account. + */ + 'signer': string; + /** + * Version of the entity. The higher byte represents the network identifier: * 0x68 (MAIN_NET) - Public main network. * 0x98 (TEST_NET) - Public test network. * 0x60 (MIJIN) - Private network. * 0x90 (MIJIN_TEST) - Private test network. + */ + 'version': number; + 'type': EntityTypeEnum; + 'maxFee': Array; + 'deadline': Array; + /** + * Array of transaction cosignatures. + */ + 'cosignatures': Array; + /** + * Array of transactions initiated by different accounts. + */ + 'transactions': Array; + + static discriminator: string | undefined = undefined; + + static attributeTypeMap: Array<{name: string, baseName: string, type: string}> = [ + { + "name": "signature", + "baseName": "signature", + "type": "string" + }, + { + "name": "signer", + "baseName": "signer", + "type": "string" + }, + { + "name": "version", + "baseName": "version", + "type": "number" + }, + { + "name": "type", + "baseName": "type", + "type": "EntityTypeEnum" + }, + { + "name": "maxFee", + "baseName": "max_fee", + "type": "Array" + }, + { + "name": "deadline", + "baseName": "deadline", + "type": "Array" + }, + { + "name": "cosignatures", + "baseName": "cosignatures", + "type": "Array" + }, + { + "name": "transactions", + "baseName": "transactions", + "type": "Array" + } ]; + + static getAttributeTypeMap() { + return AggregateTransactionDTO.attributeTypeMap; + } +} + diff --git a/src/infrastructure/model/aliasActionEnum.ts b/src/infrastructure/model/aliasActionEnum.ts new file mode 100644 index 0000000000..1d52eee7c5 --- /dev/null +++ b/src/infrastructure/model/aliasActionEnum.ts @@ -0,0 +1,35 @@ +/* + * Copyright 2019 NEM + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +/** + * Catapult REST Endpoints + * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) + * + * The version of the OpenAPI document: 0.7.18 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +/** +* Alias action: * 0 - Unlink alias. * 1 - Link alias. +*/ +export enum AliasActionEnum { + NUMBER_0 = 0, + NUMBER_1 = 1 +} diff --git a/src/infrastructure/model/aliasDTO.ts b/src/infrastructure/model/aliasDTO.ts index 06056e902c..3b310b4752 100644 --- a/src/infrastructure/model/aliasDTO.ts +++ b/src/infrastructure/model/aliasDTO.ts @@ -17,7 +17,7 @@ * Catapult REST Endpoints * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) * - * The version of the OpenAPI document: 0.7.16 + * The version of the OpenAPI document: 0.7.18 * * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). @@ -31,7 +31,7 @@ export class AliasDTO { 'type': AliasTypeEnum; 'mosaicId'?: Array; /** - * The aliased address in hexadecimal. + * Decoded address. */ 'address'?: string; diff --git a/src/infrastructure/model/aliasTypeEnum.ts b/src/infrastructure/model/aliasTypeEnum.ts index 8035ecd711..82f54f9b7c 100644 --- a/src/infrastructure/model/aliasTypeEnum.ts +++ b/src/infrastructure/model/aliasTypeEnum.ts @@ -17,7 +17,7 @@ * Catapult REST Endpoints * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) * - * The version of the OpenAPI document: 0.7.16 + * The version of the OpenAPI document: 0.7.18 * * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). @@ -27,17 +27,10 @@ /** -* The alias type: * 0 - No alias. * 1 - Mosaic id alias. * 2 - Addres alias. +* Type of alias: * 0 - No alias. * 1 - Mosaic id alias. * 2 - Addres alias. */ -export class AliasTypeEnum { - - static discriminator: string | undefined = undefined; - - static attributeTypeMap: Array<{name: string, baseName: string, type: string}> = [ - ]; - - static getAttributeTypeMap() { - return AliasTypeEnum.attributeTypeMap; - } +export enum AliasTypeEnum { + NUMBER_0 = 0, + NUMBER_1 = 1, + NUMBER_2 = 2 } - diff --git a/src/infrastructure/model/amount.ts b/src/infrastructure/model/amount.ts new file mode 100644 index 0000000000..5e33dc7483 --- /dev/null +++ b/src/infrastructure/model/amount.ts @@ -0,0 +1,34 @@ +/* + * Copyright 2019 NEM + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +/** + * Catapult REST Endpoints + * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) + * + * The version of the OpenAPI document: 0.7.18 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +export class Amount extends Array { + + static discriminator: string | undefined = undefined; + +} + diff --git a/src/infrastructure/model/announceTransactionInfoDTO.ts b/src/infrastructure/model/announceTransactionInfoDTO.ts index 298c4d310e..3bde57da3d 100644 --- a/src/infrastructure/model/announceTransactionInfoDTO.ts +++ b/src/infrastructure/model/announceTransactionInfoDTO.ts @@ -17,7 +17,7 @@ * Catapult REST Endpoints * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) * - * The version of the OpenAPI document: 0.7.16 + * The version of the OpenAPI document: 0.7.18 * * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). diff --git a/src/infrastructure/model/artifactExpiryReceiptDTO.ts b/src/infrastructure/model/artifactExpiryReceiptDTO.ts new file mode 100644 index 0000000000..1507ef0130 --- /dev/null +++ b/src/infrastructure/model/artifactExpiryReceiptDTO.ts @@ -0,0 +1,65 @@ +/* + * Copyright 2019 NEM + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +/** + * Catapult REST Endpoints + * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) + * + * The version of the OpenAPI document: 0.7.18 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + +import { ReceiptDTO } from './receiptDTO'; +import { ReceiptTypeEnum } from './receiptTypeEnum'; + +/** +* An artifact namespace or mosaic expired. +*/ +export class ArtifactExpiryReceiptDTO { + /** + * Version of the receipt. + */ + 'version': number; + 'type': ReceiptTypeEnum; + 'artifactId': any; + + static discriminator: string | undefined = undefined; + + static attributeTypeMap: Array<{name: string, baseName: string, type: string}> = [ + { + "name": "version", + "baseName": "version", + "type": "number" + }, + { + "name": "type", + "baseName": "type", + "type": "ReceiptTypeEnum" + }, + { + "name": "artifactId", + "baseName": "artifactId", + "type": "AnyOfarrayarray" + } ]; + + static getAttributeTypeMap() { + return ArtifactExpiryReceiptDTO.attributeTypeMap; + } +} + diff --git a/src/infrastructure/model/artifactExpiryReceiptDTOAllOf.ts b/src/infrastructure/model/artifactExpiryReceiptDTOAllOf.ts new file mode 100644 index 0000000000..5394c00495 --- /dev/null +++ b/src/infrastructure/model/artifactExpiryReceiptDTOAllOf.ts @@ -0,0 +1,44 @@ +/* + * Copyright 2019 NEM + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +/** + * Catapult REST Endpoints + * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) + * + * The version of the OpenAPI document: 0.7.18 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + +export class ArtifactExpiryReceiptDTOAllOf { + 'artifactId': any; + + static discriminator: string | undefined = undefined; + + static attributeTypeMap: Array<{name: string, baseName: string, type: string}> = [ + { + "name": "artifactId", + "baseName": "artifactId", + "type": "AnyOfarrayarray" + } ]; + + static getAttributeTypeMap() { + return ArtifactExpiryReceiptDTOAllOf.attributeTypeMap; + } +} + diff --git a/src/infrastructure/model/balanceChangeReceiptDTO.ts b/src/infrastructure/model/balanceChangeReceiptDTO.ts new file mode 100644 index 0000000000..1fd80d36d6 --- /dev/null +++ b/src/infrastructure/model/balanceChangeReceiptDTO.ts @@ -0,0 +1,78 @@ +/* + * Copyright 2019 NEM + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +/** + * Catapult REST Endpoints + * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) + * + * The version of the OpenAPI document: 0.7.18 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + +import { BalanceChangeReceiptDTOAllOf } from './balanceChangeReceiptDTOAllOf'; +import { ReceiptDTO } from './receiptDTO'; +import { ReceiptTypeEnum } from './receiptTypeEnum'; + +/** +* Invisible state change that changed an account balance. +*/ +export class BalanceChangeReceiptDTO { + /** + * Version of the receipt. + */ + 'version': number; + 'type': ReceiptTypeEnum; + 'targetPublicKey': string; + 'mosaicId': Array; + 'amount': Array; + + static discriminator: string | undefined = undefined; + + static attributeTypeMap: Array<{name: string, baseName: string, type: string}> = [ + { + "name": "version", + "baseName": "version", + "type": "number" + }, + { + "name": "type", + "baseName": "type", + "type": "ReceiptTypeEnum" + }, + { + "name": "targetPublicKey", + "baseName": "targetPublicKey", + "type": "string" + }, + { + "name": "mosaicId", + "baseName": "mosaicId", + "type": "Array" + }, + { + "name": "amount", + "baseName": "amount", + "type": "Array" + } ]; + + static getAttributeTypeMap() { + return BalanceChangeReceiptDTO.attributeTypeMap; + } +} + diff --git a/src/infrastructure/model/balanceChangeReceiptDTOAllOf.ts b/src/infrastructure/model/balanceChangeReceiptDTOAllOf.ts new file mode 100644 index 0000000000..246d25e904 --- /dev/null +++ b/src/infrastructure/model/balanceChangeReceiptDTOAllOf.ts @@ -0,0 +1,57 @@ +/* + * Copyright 2019 NEM + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +/** + * Catapult REST Endpoints + * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) + * + * The version of the OpenAPI document: 0.7.18 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +export class BalanceChangeReceiptDTOAllOf { + 'targetPublicKey': string; + 'mosaicId': Array; + 'amount': Array; + + static discriminator: string | undefined = undefined; + + static attributeTypeMap: Array<{name: string, baseName: string, type: string}> = [ + { + "name": "targetPublicKey", + "baseName": "targetPublicKey", + "type": "string" + }, + { + "name": "mosaicId", + "baseName": "mosaicId", + "type": "Array" + }, + { + "name": "amount", + "baseName": "amount", + "type": "Array" + } ]; + + static getAttributeTypeMap() { + return BalanceChangeReceiptDTOAllOf.attributeTypeMap; + } +} + diff --git a/src/infrastructure/model/balanceTransferReceiptDTO.ts b/src/infrastructure/model/balanceTransferReceiptDTO.ts new file mode 100644 index 0000000000..5d25ab91ba --- /dev/null +++ b/src/infrastructure/model/balanceTransferReceiptDTO.ts @@ -0,0 +1,87 @@ +/* + * Copyright 2019 NEM + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +/** + * Catapult REST Endpoints + * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) + * + * The version of the OpenAPI document: 0.7.18 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + +import { BalanceTransferReceiptDTOAllOf } from './balanceTransferReceiptDTOAllOf'; +import { ReceiptDTO } from './receiptDTO'; +import { ReceiptTypeEnum } from './receiptTypeEnum'; + +/** +* Invisible state change that triggered a mosaic transfer. +*/ +export class BalanceTransferReceiptDTO { + /** + * Version of the receipt. + */ + 'version': number; + 'type': ReceiptTypeEnum; + 'senderPublicKey': string; + /** + * Decoded address. + */ + 'recipientAddress': string; + 'mosaicId': Array; + 'amount': Array; + + static discriminator: string | undefined = undefined; + + static attributeTypeMap: Array<{name: string, baseName: string, type: string}> = [ + { + "name": "version", + "baseName": "version", + "type": "number" + }, + { + "name": "type", + "baseName": "type", + "type": "ReceiptTypeEnum" + }, + { + "name": "senderPublicKey", + "baseName": "senderPublicKey", + "type": "string" + }, + { + "name": "recipientAddress", + "baseName": "recipientAddress", + "type": "string" + }, + { + "name": "mosaicId", + "baseName": "mosaicId", + "type": "Array" + }, + { + "name": "amount", + "baseName": "amount", + "type": "Array" + } ]; + + static getAttributeTypeMap() { + return BalanceTransferReceiptDTO.attributeTypeMap; + } +} + diff --git a/src/infrastructure/model/balanceTransferReceiptDTOAllOf.ts b/src/infrastructure/model/balanceTransferReceiptDTOAllOf.ts new file mode 100644 index 0000000000..a2bccc9e57 --- /dev/null +++ b/src/infrastructure/model/balanceTransferReceiptDTOAllOf.ts @@ -0,0 +1,66 @@ +/* + * Copyright 2019 NEM + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +/** + * Catapult REST Endpoints + * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) + * + * The version of the OpenAPI document: 0.7.18 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +export class BalanceTransferReceiptDTOAllOf { + 'senderPublicKey': string; + /** + * Decoded address. + */ + 'recipientAddress': string; + 'mosaicId': Array; + 'amount': Array; + + static discriminator: string | undefined = undefined; + + static attributeTypeMap: Array<{name: string, baseName: string, type: string}> = [ + { + "name": "senderPublicKey", + "baseName": "senderPublicKey", + "type": "string" + }, + { + "name": "recipientAddress", + "baseName": "recipientAddress", + "type": "string" + }, + { + "name": "mosaicId", + "baseName": "mosaicId", + "type": "Array" + }, + { + "name": "amount", + "baseName": "amount", + "type": "Array" + } ]; + + static getAttributeTypeMap() { + return BalanceTransferReceiptDTOAllOf.attributeTypeMap; + } +} + diff --git a/src/infrastructure/model/blockDTO.ts b/src/infrastructure/model/blockDTO.ts index 4182db536a..320b3bed72 100644 --- a/src/infrastructure/model/blockDTO.ts +++ b/src/infrastructure/model/blockDTO.ts @@ -17,7 +17,7 @@ * Catapult REST Endpoints * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) * - * The version of the OpenAPI document: 0.7.16 + * The version of the OpenAPI document: 0.7.18 * * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). @@ -25,51 +25,30 @@ * Do not edit the class manually. */ +import { BlockDTOAllOf } from './blockDTOAllOf'; +import { EntityDTO } from './entityDTO'; +import { VerifiableEntityDTO } from './verifiableEntityDTO'; export class BlockDTO { - /** - * The signature of the block. The signature was generated by the signer and can be used to validate tha the entity data was not modified by a node. - */ 'signature': string; + 'signerPublicKey': string; /** - * The public key of the block harvester formatted as hexadecimal. - */ - 'signer': string; - /** - * The entity version. The higher byte represents the network identifier: * 0x68 (MAIN_NET) - Public main network. * 0x98 (TEST_NET) - Public test network. * 0x60 (MIJIN) - Private network. * 0x90 (MIJIN_TEST) - Private test network. + * Entity version. The higher byte represents the network identifier: * 0x68 (MAIN_NET) - Public main network. * 0x98 (TEST_NET) - Public test network. * 0x60 (MIJIN) - Private network. * 0x90 (MIJIN_TEST) - Private test network. */ 'version': number; - /** - * The block type: * 0x8043 (32835 decimal) - Nemesis block. * 0x8143 (33091 decimal) - Regular block. - */ 'type': number; 'height': Array; 'timestamp': Array; 'difficulty': Array; /** - * The fee multiplier applied to transactions contained in block. + * Fee multiplier applied to transactions contained in block. */ 'feeMultiplier': number; - /** - * The hash of the previous block. - */ 'previousBlockHash': string; - /** - * The transactions included in a block are hashed forming a merkle tree. The root of the tree summarizes them. - */ - 'blockTransactionsHash': string; - /** - * The collection of receipts are hashed into a merkle tree and linked to a block. The block header stores the root hash. - */ - 'blockReceiptsHash': string; - /** - * For each block, the state of the blockchain is stored in RocksDB, forming a patricia tree. The root of the tree summarizes the state of the blockchain for the given block. - */ + 'transactionsHash': string; + 'receiptsHash': string; 'stateHash': string; - /** - * The public key of the optional beneficiary designated by harvester. - */ - 'beneficiary': string; + 'beneficiaryPublicKey': string; static discriminator: string | undefined = undefined; @@ -80,8 +59,8 @@ export class BlockDTO { "type": "string" }, { - "name": "signer", - "baseName": "signer", + "name": "signerPublicKey", + "baseName": "signerPublicKey", "type": "string" }, { @@ -120,13 +99,13 @@ export class BlockDTO { "type": "string" }, { - "name": "blockTransactionsHash", - "baseName": "blockTransactionsHash", + "name": "transactionsHash", + "baseName": "transactionsHash", "type": "string" }, { - "name": "blockReceiptsHash", - "baseName": "blockReceiptsHash", + "name": "receiptsHash", + "baseName": "receiptsHash", "type": "string" }, { @@ -135,8 +114,8 @@ export class BlockDTO { "type": "string" }, { - "name": "beneficiary", - "baseName": "beneficiary", + "name": "beneficiaryPublicKey", + "baseName": "beneficiaryPublicKey", "type": "string" } ]; diff --git a/src/infrastructure/model/blockDTOAllOf.ts b/src/infrastructure/model/blockDTOAllOf.ts new file mode 100644 index 0000000000..fade3adbd2 --- /dev/null +++ b/src/infrastructure/model/blockDTOAllOf.ts @@ -0,0 +1,96 @@ +/* + * Copyright 2019 NEM + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +/** + * Catapult REST Endpoints + * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) + * + * The version of the OpenAPI document: 0.7.18 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +export class BlockDTOAllOf { + 'height': Array; + 'timestamp': Array; + 'difficulty': Array; + /** + * Fee multiplier applied to transactions contained in block. + */ + 'feeMultiplier': number; + 'previousBlockHash': string; + 'transactionsHash': string; + 'receiptsHash': string; + 'stateHash': string; + 'beneficiaryPublicKey': string; + + static discriminator: string | undefined = undefined; + + static attributeTypeMap: Array<{name: string, baseName: string, type: string}> = [ + { + "name": "height", + "baseName": "height", + "type": "Array" + }, + { + "name": "timestamp", + "baseName": "timestamp", + "type": "Array" + }, + { + "name": "difficulty", + "baseName": "difficulty", + "type": "Array" + }, + { + "name": "feeMultiplier", + "baseName": "feeMultiplier", + "type": "number" + }, + { + "name": "previousBlockHash", + "baseName": "previousBlockHash", + "type": "string" + }, + { + "name": "transactionsHash", + "baseName": "transactionsHash", + "type": "string" + }, + { + "name": "receiptsHash", + "baseName": "receiptsHash", + "type": "string" + }, + { + "name": "stateHash", + "baseName": "stateHash", + "type": "string" + }, + { + "name": "beneficiaryPublicKey", + "baseName": "beneficiaryPublicKey", + "type": "string" + } ]; + + static getAttributeTypeMap() { + return BlockDTOAllOf.attributeTypeMap; + } +} + diff --git a/src/infrastructure/model/blockDuration.ts b/src/infrastructure/model/blockDuration.ts new file mode 100644 index 0000000000..ea383a2ad7 --- /dev/null +++ b/src/infrastructure/model/blockDuration.ts @@ -0,0 +1,34 @@ +/* + * Copyright 2019 NEM + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +/** + * Catapult REST Endpoints + * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) + * + * The version of the OpenAPI document: 0.7.18 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +export class BlockDuration extends Array { + + static discriminator: string | undefined = undefined; + +} + diff --git a/src/infrastructure/model/blockInfoDTO.ts b/src/infrastructure/model/blockInfoDTO.ts index e64ced621a..eb57a57707 100644 --- a/src/infrastructure/model/blockInfoDTO.ts +++ b/src/infrastructure/model/blockInfoDTO.ts @@ -17,7 +17,7 @@ * Catapult REST Endpoints * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) * - * The version of the OpenAPI document: 0.7.16 + * The version of the OpenAPI document: 0.7.18 * * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). diff --git a/src/infrastructure/model/blockMetaDTO.ts b/src/infrastructure/model/blockMetaDTO.ts index d37bd8c65d..e8f8a106a9 100644 --- a/src/infrastructure/model/blockMetaDTO.ts +++ b/src/infrastructure/model/blockMetaDTO.ts @@ -17,7 +17,7 @@ * Catapult REST Endpoints * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) * - * The version of the OpenAPI document: 0.7.16 + * The version of the OpenAPI document: 0.7.18 * * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). @@ -28,9 +28,9 @@ export class BlockMetaDTO { 'hash': string; - 'generationHash': string; - 'subCacheMerkleRoots': Array; 'totalFee': Array; + 'generationHash': string; + 'stateHashSubCacheMerkleRoots': Array; 'numTransactions': number; 'numStatements'?: number; @@ -42,21 +42,21 @@ export class BlockMetaDTO { "baseName": "hash", "type": "string" }, + { + "name": "totalFee", + "baseName": "totalFee", + "type": "Array" + }, { "name": "generationHash", "baseName": "generationHash", "type": "string" }, { - "name": "subCacheMerkleRoots", - "baseName": "subCacheMerkleRoots", + "name": "stateHashSubCacheMerkleRoots", + "baseName": "stateHashSubCacheMerkleRoots", "type": "Array" }, - { - "name": "totalFee", - "baseName": "totalFee", - "type": "Array" - }, { "name": "numTransactions", "baseName": "numTransactions", diff --git a/src/infrastructure/model/blockchainScoreDTO.ts b/src/infrastructure/model/blockchainScoreDTO.ts index a5498b09d4..72e95b5fc9 100644 --- a/src/infrastructure/model/blockchainScoreDTO.ts +++ b/src/infrastructure/model/blockchainScoreDTO.ts @@ -17,7 +17,7 @@ * Catapult REST Endpoints * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) * - * The version of the OpenAPI document: 0.7.16 + * The version of the OpenAPI document: 0.7.17 * * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). diff --git a/src/infrastructure/model/chainScoreDTO.ts b/src/infrastructure/model/chainScoreDTO.ts new file mode 100644 index 0000000000..d935b27df0 --- /dev/null +++ b/src/infrastructure/model/chainScoreDTO.ts @@ -0,0 +1,51 @@ +/* + * Copyright 2019 NEM + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +/** + * Catapult REST Endpoints + * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) + * + * The version of the OpenAPI document: 0.7.18 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +export class ChainScoreDTO { + 'scoreHigh': Array; + 'scoreLow': Array; + + static discriminator: string | undefined = undefined; + + static attributeTypeMap: Array<{name: string, baseName: string, type: string}> = [ + { + "name": "scoreHigh", + "baseName": "scoreHigh", + "type": "Array" + }, + { + "name": "scoreLow", + "baseName": "scoreLow", + "type": "Array" + } ]; + + static getAttributeTypeMap() { + return ChainScoreDTO.attributeTypeMap; + } +} + diff --git a/src/infrastructure/model/communicationTimestamps.ts b/src/infrastructure/model/communicationTimestamps.ts index e44d99a240..5731cdd6ff 100644 --- a/src/infrastructure/model/communicationTimestamps.ts +++ b/src/infrastructure/model/communicationTimestamps.ts @@ -17,7 +17,7 @@ * Catapult REST Endpoints * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) * - * The version of the OpenAPI document: 0.7.16 + * The version of the OpenAPI document: 0.7.17 * * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). diff --git a/src/infrastructure/model/communicationTimestampsDTO.ts b/src/infrastructure/model/communicationTimestampsDTO.ts new file mode 100644 index 0000000000..d379b4e5fe --- /dev/null +++ b/src/infrastructure/model/communicationTimestampsDTO.ts @@ -0,0 +1,51 @@ +/* + * Copyright 2019 NEM + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +/** + * Catapult REST Endpoints + * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) + * + * The version of the OpenAPI document: 0.7.18 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +export class CommunicationTimestampsDTO { + 'sendTimestamp'?: Array; + 'receiveTimestamp'?: Array; + + static discriminator: string | undefined = undefined; + + static attributeTypeMap: Array<{name: string, baseName: string, type: string}> = [ + { + "name": "sendTimestamp", + "baseName": "sendTimestamp", + "type": "Array" + }, + { + "name": "receiveTimestamp", + "baseName": "receiveTimestamp", + "type": "Array" + } ]; + + static getAttributeTypeMap() { + return CommunicationTimestampsDTO.attributeTypeMap; + } +} + diff --git a/src/infrastructure/model/cosignatoryModificationAction.ts b/src/infrastructure/model/cosignatoryModificationAction.ts new file mode 100644 index 0000000000..f0f7897147 --- /dev/null +++ b/src/infrastructure/model/cosignatoryModificationAction.ts @@ -0,0 +1,35 @@ +/* + * Copyright 2019 NEM + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +/** + * Catapult REST Endpoints + * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) + * + * The version of the OpenAPI document: 0.7.18 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +/** +* Type of modification: * 0 - Remove cosignatory. * 1 - Add cosignatory. +*/ +export enum CosignatoryModificationAction { + NUMBER_0 = 0, + NUMBER_1 = 1 +} diff --git a/src/infrastructure/model/cosignatoryModificationActionEnum.ts b/src/infrastructure/model/cosignatoryModificationActionEnum.ts new file mode 100644 index 0000000000..d52faa65a7 --- /dev/null +++ b/src/infrastructure/model/cosignatoryModificationActionEnum.ts @@ -0,0 +1,35 @@ +/* + * Copyright 2019 NEM + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +/** + * Catapult REST Endpoints + * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) + * + * The version of the OpenAPI document: 0.7.18 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +/** +* Type of modification: * 0 - Remove cosignatory. * 1 - Add cosignatory. +*/ +export enum CosignatoryModificationActionEnum { + NUMBER_0 = 0, + NUMBER_1 = 1 +} diff --git a/src/infrastructure/model/cosignatoryModificationDTO.ts b/src/infrastructure/model/cosignatoryModificationDTO.ts new file mode 100644 index 0000000000..01bbf7070e --- /dev/null +++ b/src/infrastructure/model/cosignatoryModificationDTO.ts @@ -0,0 +1,52 @@ +/* + * Copyright 2019 NEM + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +/** + * Catapult REST Endpoints + * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) + * + * The version of the OpenAPI document: 0.7.18 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + +import { CosignatoryModificationActionEnum } from './cosignatoryModificationActionEnum'; + +export class CosignatoryModificationDTO { + 'modificationAction': CosignatoryModificationActionEnum; + 'cosignatoryPublicKey': string; + + static discriminator: string | undefined = undefined; + + static attributeTypeMap: Array<{name: string, baseName: string, type: string}> = [ + { + "name": "modificationAction", + "baseName": "modificationAction", + "type": "CosignatoryModificationActionEnum" + }, + { + "name": "cosignatoryPublicKey", + "baseName": "cosignatoryPublicKey", + "type": "string" + } ]; + + static getAttributeTypeMap() { + return CosignatoryModificationDTO.attributeTypeMap; + } +} + diff --git a/src/infrastructure/model/cosignature.ts b/src/infrastructure/model/cosignature.ts index 4e078d0794..68585d822d 100644 --- a/src/infrastructure/model/cosignature.ts +++ b/src/infrastructure/model/cosignature.ts @@ -17,7 +17,7 @@ * Catapult REST Endpoints * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) * - * The version of the OpenAPI document: 0.7.16 + * The version of the OpenAPI document: 0.7.18 * * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). @@ -27,18 +27,9 @@ export class Cosignature { - /** - * The hash of parent aggregate transaction that has been signed by a cosignatory of the transaction. - */ 'parentHash'?: string; - /** - * The signatures generated by signing the parent aggregate transaction hash. - */ 'signature'?: string; - /** - * The signer of the transaction. - */ - 'signer'?: string; + 'signerPublicKey'?: string; static discriminator: string | undefined = undefined; @@ -54,8 +45,8 @@ export class Cosignature { "type": "string" }, { - "name": "signer", - "baseName": "signer", + "name": "signerPublicKey", + "baseName": "signerPublicKey", "type": "string" } ]; diff --git a/src/infrastructure/model/cosignatureDTO.ts b/src/infrastructure/model/cosignatureDTO.ts new file mode 100644 index 0000000000..8135e67528 --- /dev/null +++ b/src/infrastructure/model/cosignatureDTO.ts @@ -0,0 +1,53 @@ +/* + * Copyright 2019 NEM + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +/** + * Catapult REST Endpoints + * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) + * + * The version of the OpenAPI document: 0.7.18 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + +import { CosignatureDTOAllOf } from './cosignatureDTOAllOf'; +import { VerifiableEntityDTO } from './verifiableEntityDTO'; + +export class CosignatureDTO { + 'signature': string; + 'signerPublicKey': string; + + static discriminator: string | undefined = undefined; + + static attributeTypeMap: Array<{name: string, baseName: string, type: string}> = [ + { + "name": "signature", + "baseName": "signature", + "type": "string" + }, + { + "name": "signerPublicKey", + "baseName": "signerPublicKey", + "type": "string" + } ]; + + static getAttributeTypeMap() { + return CosignatureDTO.attributeTypeMap; + } +} + diff --git a/src/infrastructure/model/cosignatureDTOAllOf.ts b/src/infrastructure/model/cosignatureDTOAllOf.ts new file mode 100644 index 0000000000..2e0618a3d9 --- /dev/null +++ b/src/infrastructure/model/cosignatureDTOAllOf.ts @@ -0,0 +1,45 @@ +/* + * Copyright 2019 NEM + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +/** + * Catapult REST Endpoints + * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) + * + * The version of the OpenAPI document: 0.7.18 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +export class CosignatureDTOAllOf { + 'signerPublicKey': string; + + static discriminator: string | undefined = undefined; + + static attributeTypeMap: Array<{name: string, baseName: string, type: string}> = [ + { + "name": "signerPublicKey", + "baseName": "signerPublicKey", + "type": "string" + } ]; + + static getAttributeTypeMap() { + return CosignatureDTOAllOf.attributeTypeMap; + } +} + diff --git a/src/infrastructure/model/difficulty.ts b/src/infrastructure/model/difficulty.ts new file mode 100644 index 0000000000..b0f0b003e9 --- /dev/null +++ b/src/infrastructure/model/difficulty.ts @@ -0,0 +1,34 @@ +/* + * Copyright 2019 NEM + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +/** + * Catapult REST Endpoints + * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) + * + * The version of the OpenAPI document: 0.7.18 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +export class Difficulty extends Array { + + static discriminator: string | undefined = undefined; + +} + diff --git a/src/infrastructure/model/embeddedAccountAddressRestrictionTransactionDTO.ts b/src/infrastructure/model/embeddedAccountAddressRestrictionTransactionDTO.ts new file mode 100644 index 0000000000..107916e547 --- /dev/null +++ b/src/infrastructure/model/embeddedAccountAddressRestrictionTransactionDTO.ts @@ -0,0 +1,88 @@ +/* + * Copyright 2019 NEM + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +/** + * Catapult REST Endpoints + * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) + * + * The version of the OpenAPI document: 0.7.18 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + +import { AccountAddressRestrictionModificationDTO } from './accountAddressRestrictionModificationDTO'; +import { AccountAddressRestrictionTransactionBodyDTO } from './accountAddressRestrictionTransactionBodyDTO'; +import { AccountRestrictionTypeEnum } from './accountRestrictionTypeEnum'; +import { EmbeddedTransactionDTO } from './embeddedTransactionDTO'; + +export class EmbeddedAccountAddressRestrictionTransactionDTO { + 'signerPublicKey': string; + /** + * Entity version. The higher byte represents the network identifier: * 0x68 (MAIN_NET) - Public main network. * 0x98 (TEST_NET) - Public test network. * 0x60 (MIJIN) - Private network. * 0x90 (MIJIN_TEST) - Private test network. + */ + 'version': number; + 'type': number; + 'maxFee': Array; + 'deadline': Array; + 'restrictionType': AccountRestrictionTypeEnum; + 'modifications': Array; + + static discriminator: string | undefined = undefined; + + static attributeTypeMap: Array<{name: string, baseName: string, type: string}> = [ + { + "name": "signerPublicKey", + "baseName": "signerPublicKey", + "type": "string" + }, + { + "name": "version", + "baseName": "version", + "type": "number" + }, + { + "name": "type", + "baseName": "type", + "type": "number" + }, + { + "name": "maxFee", + "baseName": "maxFee", + "type": "Array" + }, + { + "name": "deadline", + "baseName": "deadline", + "type": "Array" + }, + { + "name": "restrictionType", + "baseName": "restrictionType", + "type": "AccountRestrictionTypeEnum" + }, + { + "name": "modifications", + "baseName": "modifications", + "type": "Array" + } ]; + + static getAttributeTypeMap() { + return EmbeddedAccountAddressRestrictionTransactionDTO.attributeTypeMap; + } +} + diff --git a/src/infrastructure/model/embeddedAccountLinkTransactionDTO.ts b/src/infrastructure/model/embeddedAccountLinkTransactionDTO.ts new file mode 100644 index 0000000000..31a40eef7a --- /dev/null +++ b/src/infrastructure/model/embeddedAccountLinkTransactionDTO.ts @@ -0,0 +1,87 @@ +/* + * Copyright 2019 NEM + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +/** + * Catapult REST Endpoints + * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) + * + * The version of the OpenAPI document: 0.7.18 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + +import { AccountLinkActionEnum } from './accountLinkActionEnum'; +import { AccountLinkTransactionBodyDTO } from './accountLinkTransactionBodyDTO'; +import { EmbeddedTransactionDTO } from './embeddedTransactionDTO'; + +export class EmbeddedAccountLinkTransactionDTO { + 'signerPublicKey': string; + /** + * Entity version. The higher byte represents the network identifier: * 0x68 (MAIN_NET) - Public main network. * 0x98 (TEST_NET) - Public test network. * 0x60 (MIJIN) - Private network. * 0x90 (MIJIN_TEST) - Private test network. + */ + 'version': number; + 'type': number; + 'maxFee': Array; + 'deadline': Array; + 'remotePublicKey': string; + 'linkAction': AccountLinkActionEnum; + + static discriminator: string | undefined = undefined; + + static attributeTypeMap: Array<{name: string, baseName: string, type: string}> = [ + { + "name": "signerPublicKey", + "baseName": "signerPublicKey", + "type": "string" + }, + { + "name": "version", + "baseName": "version", + "type": "number" + }, + { + "name": "type", + "baseName": "type", + "type": "number" + }, + { + "name": "maxFee", + "baseName": "maxFee", + "type": "Array" + }, + { + "name": "deadline", + "baseName": "deadline", + "type": "Array" + }, + { + "name": "remotePublicKey", + "baseName": "remotePublicKey", + "type": "string" + }, + { + "name": "linkAction", + "baseName": "linkAction", + "type": "AccountLinkActionEnum" + } ]; + + static getAttributeTypeMap() { + return EmbeddedAccountLinkTransactionDTO.attributeTypeMap; + } +} + diff --git a/src/infrastructure/model/embeddedAccountMosaicRestrictionTransactionDTO.ts b/src/infrastructure/model/embeddedAccountMosaicRestrictionTransactionDTO.ts new file mode 100644 index 0000000000..9fdc9e072c --- /dev/null +++ b/src/infrastructure/model/embeddedAccountMosaicRestrictionTransactionDTO.ts @@ -0,0 +1,88 @@ +/* + * Copyright 2019 NEM + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +/** + * Catapult REST Endpoints + * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) + * + * The version of the OpenAPI document: 0.7.18 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + +import { AccountMosaicRestrictionModificationDTO } from './accountMosaicRestrictionModificationDTO'; +import { AccountMosaicRestrictionTransactionBodyDTO } from './accountMosaicRestrictionTransactionBodyDTO'; +import { AccountRestrictionTypeEnum } from './accountRestrictionTypeEnum'; +import { EmbeddedTransactionDTO } from './embeddedTransactionDTO'; + +export class EmbeddedAccountMosaicRestrictionTransactionDTO { + 'signerPublicKey': string; + /** + * Entity version. The higher byte represents the network identifier: * 0x68 (MAIN_NET) - Public main network. * 0x98 (TEST_NET) - Public test network. * 0x60 (MIJIN) - Private network. * 0x90 (MIJIN_TEST) - Private test network. + */ + 'version': number; + 'type': number; + 'maxFee': Array; + 'deadline': Array; + 'restrictionType': AccountRestrictionTypeEnum; + 'modifications': Array; + + static discriminator: string | undefined = undefined; + + static attributeTypeMap: Array<{name: string, baseName: string, type: string}> = [ + { + "name": "signerPublicKey", + "baseName": "signerPublicKey", + "type": "string" + }, + { + "name": "version", + "baseName": "version", + "type": "number" + }, + { + "name": "type", + "baseName": "type", + "type": "number" + }, + { + "name": "maxFee", + "baseName": "maxFee", + "type": "Array" + }, + { + "name": "deadline", + "baseName": "deadline", + "type": "Array" + }, + { + "name": "restrictionType", + "baseName": "restrictionType", + "type": "AccountRestrictionTypeEnum" + }, + { + "name": "modifications", + "baseName": "modifications", + "type": "Array" + } ]; + + static getAttributeTypeMap() { + return EmbeddedAccountMosaicRestrictionTransactionDTO.attributeTypeMap; + } +} + diff --git a/src/infrastructure/model/embeddedAccountOperationRestrictionTransactionDTO.ts b/src/infrastructure/model/embeddedAccountOperationRestrictionTransactionDTO.ts new file mode 100644 index 0000000000..79feea1c67 --- /dev/null +++ b/src/infrastructure/model/embeddedAccountOperationRestrictionTransactionDTO.ts @@ -0,0 +1,88 @@ +/* + * Copyright 2019 NEM + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +/** + * Catapult REST Endpoints + * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) + * + * The version of the OpenAPI document: 0.7.18 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + +import { AccountOperationRestrictionModificationDTO } from './accountOperationRestrictionModificationDTO'; +import { AccountOperationRestrictionTransactionBodyDTO } from './accountOperationRestrictionTransactionBodyDTO'; +import { AccountRestrictionTypeEnum } from './accountRestrictionTypeEnum'; +import { EmbeddedTransactionDTO } from './embeddedTransactionDTO'; + +export class EmbeddedAccountOperationRestrictionTransactionDTO { + 'signerPublicKey': string; + /** + * Entity version. The higher byte represents the network identifier: * 0x68 (MAIN_NET) - Public main network. * 0x98 (TEST_NET) - Public test network. * 0x60 (MIJIN) - Private network. * 0x90 (MIJIN_TEST) - Private test network. + */ + 'version': number; + 'type': number; + 'maxFee': Array; + 'deadline': Array; + 'restrictionType': AccountRestrictionTypeEnum; + 'modifications': Array; + + static discriminator: string | undefined = undefined; + + static attributeTypeMap: Array<{name: string, baseName: string, type: string}> = [ + { + "name": "signerPublicKey", + "baseName": "signerPublicKey", + "type": "string" + }, + { + "name": "version", + "baseName": "version", + "type": "number" + }, + { + "name": "type", + "baseName": "type", + "type": "number" + }, + { + "name": "maxFee", + "baseName": "maxFee", + "type": "Array" + }, + { + "name": "deadline", + "baseName": "deadline", + "type": "Array" + }, + { + "name": "restrictionType", + "baseName": "restrictionType", + "type": "AccountRestrictionTypeEnum" + }, + { + "name": "modifications", + "baseName": "modifications", + "type": "Array" + } ]; + + static getAttributeTypeMap() { + return EmbeddedAccountOperationRestrictionTransactionDTO.attributeTypeMap; + } +} + diff --git a/src/infrastructure/model/embeddedAccountRestrictionTransactionDTO.ts b/src/infrastructure/model/embeddedAccountRestrictionTransactionDTO.ts new file mode 100644 index 0000000000..2f37f5f430 --- /dev/null +++ b/src/infrastructure/model/embeddedAccountRestrictionTransactionDTO.ts @@ -0,0 +1,92 @@ +/* + * Copyright 2019 NEM + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +/** + * Catapult REST Endpoints + * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) + * + * The version of the OpenAPI document: 0.7.17 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + +import { AccountRestrictionModificationDTO } from './accountRestrictionModificationDTO'; +import { AccountRestrictionTransactionBodyDTO } from './accountRestrictionTransactionBodyDTO'; +import { AccountRestrictionTypeEnum } from './accountRestrictionTypeEnum'; +import { EmbeddedTransactionDTO } from './embeddedTransactionDTO'; +import { EntityTypeEnum } from './entityTypeEnum'; + +export class EmbeddedAccountRestrictionTransactionDTO { + /** + * Public key of the signer account. + */ + 'signer': string; + /** + * Version of the entity. The higher byte represents the network identifier: * 0x68 (MAIN_NET) - Public main network. * 0x98 (TEST_NET) - Public test network. * 0x60 (MIJIN) - Private network. * 0x90 (MIJIN_TEST) - Private test network. + */ + 'version': number; + 'type': EntityTypeEnum; + 'maxFee': Array; + 'deadline': Array; + 'propertyType': AccountRestrictionTypeEnum; + 'modifications': Array; + + static discriminator: string | undefined = undefined; + + static attributeTypeMap: Array<{name: string, baseName: string, type: string}> = [ + { + "name": "signer", + "baseName": "signer", + "type": "string" + }, + { + "name": "version", + "baseName": "version", + "type": "number" + }, + { + "name": "type", + "baseName": "type", + "type": "EntityTypeEnum" + }, + { + "name": "maxFee", + "baseName": "max_fee", + "type": "Array" + }, + { + "name": "deadline", + "baseName": "deadline", + "type": "Array" + }, + { + "name": "propertyType", + "baseName": "propertyType", + "type": "AccountRestrictionTypeEnum" + }, + { + "name": "modifications", + "baseName": "modifications", + "type": "Array" + } ]; + + static getAttributeTypeMap() { + return EmbeddedAccountRestrictionTransactionDTO.attributeTypeMap; + } +} + diff --git a/src/infrastructure/model/embeddedAddressAliasTransactionDTO.ts b/src/infrastructure/model/embeddedAddressAliasTransactionDTO.ts new file mode 100644 index 0000000000..d297c9dc69 --- /dev/null +++ b/src/infrastructure/model/embeddedAddressAliasTransactionDTO.ts @@ -0,0 +1,96 @@ +/* + * Copyright 2019 NEM + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +/** + * Catapult REST Endpoints + * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) + * + * The version of the OpenAPI document: 0.7.18 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + +import { AddressAliasTransactionBodyDTO } from './addressAliasTransactionBodyDTO'; +import { AliasActionEnum } from './aliasActionEnum'; +import { EmbeddedTransactionDTO } from './embeddedTransactionDTO'; + +export class EmbeddedAddressAliasTransactionDTO { + 'signerPublicKey': string; + /** + * Entity version. The higher byte represents the network identifier: * 0x68 (MAIN_NET) - Public main network. * 0x98 (TEST_NET) - Public test network. * 0x60 (MIJIN) - Private network. * 0x90 (MIJIN_TEST) - Private test network. + */ + 'version': number; + 'type': number; + 'maxFee': Array; + 'deadline': Array; + 'aliasAction': AliasActionEnum; + 'namespaceId': Array; + /** + * Decoded address. + */ + 'address': string; + + static discriminator: string | undefined = undefined; + + static attributeTypeMap: Array<{name: string, baseName: string, type: string}> = [ + { + "name": "signerPublicKey", + "baseName": "signerPublicKey", + "type": "string" + }, + { + "name": "version", + "baseName": "version", + "type": "number" + }, + { + "name": "type", + "baseName": "type", + "type": "number" + }, + { + "name": "maxFee", + "baseName": "maxFee", + "type": "Array" + }, + { + "name": "deadline", + "baseName": "deadline", + "type": "Array" + }, + { + "name": "aliasAction", + "baseName": "aliasAction", + "type": "AliasActionEnum" + }, + { + "name": "namespaceId", + "baseName": "namespaceId", + "type": "Array" + }, + { + "name": "address", + "baseName": "address", + "type": "string" + } ]; + + static getAttributeTypeMap() { + return EmbeddedAddressAliasTransactionDTO.attributeTypeMap; + } +} + diff --git a/src/infrastructure/model/embeddedAddressMosaicRestrictionTransactionDTO.ts b/src/infrastructure/model/embeddedAddressMosaicRestrictionTransactionDTO.ts new file mode 100644 index 0000000000..af712e147e --- /dev/null +++ b/src/infrastructure/model/embeddedAddressMosaicRestrictionTransactionDTO.ts @@ -0,0 +1,107 @@ +/* + * Copyright 2019 NEM + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +/** + * Catapult REST Endpoints + * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) + * + * The version of the OpenAPI document: 0.7.18 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + +import { AddressMosaicRestrictionTransactionBodyDTO } from './addressMosaicRestrictionTransactionBodyDTO'; +import { EmbeddedTransactionDTO } from './embeddedTransactionDTO'; + +export class EmbeddedAddressMosaicRestrictionTransactionDTO { + 'signerPublicKey': string; + /** + * Entity version. The higher byte represents the network identifier: * 0x68 (MAIN_NET) - Public main network. * 0x98 (TEST_NET) - Public test network. * 0x60 (MIJIN) - Private network. * 0x90 (MIJIN_TEST) - Private test network. + */ + 'version': number; + 'type': number; + 'maxFee': Array; + 'deadline': Array; + 'mosaicId': Array; + 'restrictionKey': Array; + /** + * Address decoded. If the bit 0 of byte 0 is not set (like in 0x90), then it is a regular address. Else (e.g. 0x91) it represents a namespace id which starts at byte 1. + */ + 'targetAddress': string; + 'previousRestrictionValue': Array; + 'newRestrictionValue': Array; + + static discriminator: string | undefined = undefined; + + static attributeTypeMap: Array<{name: string, baseName: string, type: string}> = [ + { + "name": "signerPublicKey", + "baseName": "signerPublicKey", + "type": "string" + }, + { + "name": "version", + "baseName": "version", + "type": "number" + }, + { + "name": "type", + "baseName": "type", + "type": "number" + }, + { + "name": "maxFee", + "baseName": "maxFee", + "type": "Array" + }, + { + "name": "deadline", + "baseName": "deadline", + "type": "Array" + }, + { + "name": "mosaicId", + "baseName": "mosaicId", + "type": "Array" + }, + { + "name": "restrictionKey", + "baseName": "restrictionKey", + "type": "Array" + }, + { + "name": "targetAddress", + "baseName": "targetAddress", + "type": "string" + }, + { + "name": "previousRestrictionValue", + "baseName": "previousRestrictionValue", + "type": "Array" + }, + { + "name": "newRestrictionValue", + "baseName": "newRestrictionValue", + "type": "Array" + } ]; + + static getAttributeTypeMap() { + return EmbeddedAddressMosaicRestrictionTransactionDTO.attributeTypeMap; + } +} + diff --git a/src/infrastructure/model/embeddedGlobalMosaicRestrictionTransactionDTO.ts b/src/infrastructure/model/embeddedGlobalMosaicRestrictionTransactionDTO.ts new file mode 100644 index 0000000000..e3f73afe55 --- /dev/null +++ b/src/infrastructure/model/embeddedGlobalMosaicRestrictionTransactionDTO.ts @@ -0,0 +1,117 @@ +/* + * Copyright 2019 NEM + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +/** + * Catapult REST Endpoints + * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) + * + * The version of the OpenAPI document: 0.7.18 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + +import { EmbeddedTransactionDTO } from './embeddedTransactionDTO'; +import { GlobalMosaicRestrictionTransactionBodyDTO } from './globalMosaicRestrictionTransactionBodyDTO'; +import { MosaicRestrictionTypeEnum } from './mosaicRestrictionTypeEnum'; + +export class EmbeddedGlobalMosaicRestrictionTransactionDTO { + 'signerPublicKey': string; + /** + * Entity version. The higher byte represents the network identifier: * 0x68 (MAIN_NET) - Public main network. * 0x98 (TEST_NET) - Public test network. * 0x60 (MIJIN) - Private network. * 0x90 (MIJIN_TEST) - Private test network. + */ + 'version': number; + 'type': number; + 'maxFee': Array; + 'deadline': Array; + 'mosaicId': Array; + 'referenceMosaicId': Array; + 'restrictionKey': Array; + 'previousRestrictionValue': Array; + 'previousRestrictionType': MosaicRestrictionTypeEnum; + 'newRestrictionValue': Array; + 'newRestrictionType': MosaicRestrictionTypeEnum; + + static discriminator: string | undefined = undefined; + + static attributeTypeMap: Array<{name: string, baseName: string, type: string}> = [ + { + "name": "signerPublicKey", + "baseName": "signerPublicKey", + "type": "string" + }, + { + "name": "version", + "baseName": "version", + "type": "number" + }, + { + "name": "type", + "baseName": "type", + "type": "number" + }, + { + "name": "maxFee", + "baseName": "maxFee", + "type": "Array" + }, + { + "name": "deadline", + "baseName": "deadline", + "type": "Array" + }, + { + "name": "mosaicId", + "baseName": "mosaicId", + "type": "Array" + }, + { + "name": "referenceMosaicId", + "baseName": "referenceMosaicId", + "type": "Array" + }, + { + "name": "restrictionKey", + "baseName": "restrictionKey", + "type": "Array" + }, + { + "name": "previousRestrictionValue", + "baseName": "previousRestrictionValue", + "type": "Array" + }, + { + "name": "previousRestrictionType", + "baseName": "previousRestrictionType", + "type": "MosaicRestrictionTypeEnum" + }, + { + "name": "newRestrictionValue", + "baseName": "newRestrictionValue", + "type": "Array" + }, + { + "name": "newRestrictionType", + "baseName": "newRestrictionType", + "type": "MosaicRestrictionTypeEnum" + } ]; + + static getAttributeTypeMap() { + return EmbeddedGlobalMosaicRestrictionTransactionDTO.attributeTypeMap; + } +} + diff --git a/src/infrastructure/model/embeddedHashLockTransactionDTO.ts b/src/infrastructure/model/embeddedHashLockTransactionDTO.ts new file mode 100644 index 0000000000..55e2f6bbc4 --- /dev/null +++ b/src/infrastructure/model/embeddedHashLockTransactionDTO.ts @@ -0,0 +1,99 @@ +/* + * Copyright 2019 NEM + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +/** + * Catapult REST Endpoints + * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) + * + * The version of the OpenAPI document: 0.7.18 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + +import { EmbeddedTransactionDTO } from './embeddedTransactionDTO'; +import { HashLockTransactionDTO } from './hashLockTransactionDTO'; +import { Mosaic } from './mosaic'; + +export class EmbeddedHashLockTransactionDTO { + 'signerPublicKey': string; + /** + * Entity version. The higher byte represents the network identifier: * 0x68 (MAIN_NET) - Public main network. * 0x98 (TEST_NET) - Public test network. * 0x60 (MIJIN) - Private network. * 0x90 (MIJIN_TEST) - Private test network. + */ + 'version': number; + 'type': number; + 'maxFee': Array; + 'deadline': Array; + 'signature': string; + 'mosaic': Mosaic; + 'duration': Array; + 'hash': string; + + static discriminator: string | undefined = undefined; + + static attributeTypeMap: Array<{name: string, baseName: string, type: string}> = [ + { + "name": "signerPublicKey", + "baseName": "signerPublicKey", + "type": "string" + }, + { + "name": "version", + "baseName": "version", + "type": "number" + }, + { + "name": "type", + "baseName": "type", + "type": "number" + }, + { + "name": "maxFee", + "baseName": "maxFee", + "type": "Array" + }, + { + "name": "deadline", + "baseName": "deadline", + "type": "Array" + }, + { + "name": "signature", + "baseName": "signature", + "type": "string" + }, + { + "name": "mosaic", + "baseName": "mosaic", + "type": "Mosaic" + }, + { + "name": "duration", + "baseName": "duration", + "type": "Array" + }, + { + "name": "hash", + "baseName": "hash", + "type": "string" + } ]; + + static getAttributeTypeMap() { + return EmbeddedHashLockTransactionDTO.attributeTypeMap; + } +} + diff --git a/src/infrastructure/model/embeddedModifyMultisigAccountTransactionDTO.ts b/src/infrastructure/model/embeddedModifyMultisigAccountTransactionDTO.ts new file mode 100644 index 0000000000..2436ff9dd8 --- /dev/null +++ b/src/infrastructure/model/embeddedModifyMultisigAccountTransactionDTO.ts @@ -0,0 +1,103 @@ +/* + * Copyright 2019 NEM + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +/** + * Catapult REST Endpoints + * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) + * + * The version of the OpenAPI document: 0.7.17 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + +import { CosignatoryModificationDTO } from './cosignatoryModificationDTO'; +import { EmbeddedTransactionDTO } from './embeddedTransactionDTO'; +import { EntityTypeEnum } from './entityTypeEnum'; +import { ModifyMultisigAccountTransactionBodyDTO } from './modifyMultisigAccountTransactionBodyDTO'; + +export class EmbeddedModifyMultisigAccountTransactionDTO { + 'signer': string; + /** + * Entity version. The higher byte represents the network identifier: * 0x68 (MAIN_NET) - Public main network. * 0x98 (TEST_NET) - Public test network. * 0x60 (MIJIN) - Private network. * 0x90 (MIJIN_TEST) - Private test network. + */ + 'version': number; + 'type': EntityTypeEnum; + 'maxFee': Array; + 'deadline': Array; + /** + * Number of signatures needed to remove a cosignatory. If we are modifying an existing multisig account, this indicates the relative change of the minimum cosignatories. + */ + 'minRemovalDelta': number; + /** + * Number of signatures needed to approve a transaction. If we are modifying an existing multisig account, this indicates the relative change of the minimum cosignatories. + */ + 'minApprovalDelta': number; + /** + * Array of cosignatory accounts to add or delete. + */ + 'modifications': Array; + + static discriminator: string | undefined = undefined; + + static attributeTypeMap: Array<{name: string, baseName: string, type: string}> = [ + { + "name": "signer", + "baseName": "signer", + "type": "string" + }, + { + "name": "version", + "baseName": "version", + "type": "number" + }, + { + "name": "type", + "baseName": "type", + "type": "EntityTypeEnum" + }, + { + "name": "maxFee", + "baseName": "maxFee", + "type": "Array" + }, + { + "name": "deadline", + "baseName": "deadline", + "type": "Array" + }, + { + "name": "minRemovalDelta", + "baseName": "minRemovalDelta", + "type": "number" + }, + { + "name": "minApprovalDelta", + "baseName": "minApprovalDelta", + "type": "number" + }, + { + "name": "modifications", + "baseName": "modifications", + "type": "Array" + } ]; + + static getAttributeTypeMap() { + return EmbeddedModifyMultisigAccountTransactionDTO.attributeTypeMap; + } +} + diff --git a/src/infrastructure/model/embeddedMosaicAliasTransactionDTO.ts b/src/infrastructure/model/embeddedMosaicAliasTransactionDTO.ts new file mode 100644 index 0000000000..6dcec84138 --- /dev/null +++ b/src/infrastructure/model/embeddedMosaicAliasTransactionDTO.ts @@ -0,0 +1,93 @@ +/* + * Copyright 2019 NEM + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +/** + * Catapult REST Endpoints + * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) + * + * The version of the OpenAPI document: 0.7.18 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + +import { AliasActionEnum } from './aliasActionEnum'; +import { EmbeddedTransactionDTO } from './embeddedTransactionDTO'; +import { MosaicAliasTransactionBodyDTO } from './mosaicAliasTransactionBodyDTO'; + +export class EmbeddedMosaicAliasTransactionDTO { + 'signerPublicKey': string; + /** + * Entity version. The higher byte represents the network identifier: * 0x68 (MAIN_NET) - Public main network. * 0x98 (TEST_NET) - Public test network. * 0x60 (MIJIN) - Private network. * 0x90 (MIJIN_TEST) - Private test network. + */ + 'version': number; + 'type': number; + 'maxFee': Array; + 'deadline': Array; + 'aliasAction': AliasActionEnum; + 'namespaceId': Array; + 'mosaicId': Array; + + static discriminator: string | undefined = undefined; + + static attributeTypeMap: Array<{name: string, baseName: string, type: string}> = [ + { + "name": "signerPublicKey", + "baseName": "signerPublicKey", + "type": "string" + }, + { + "name": "version", + "baseName": "version", + "type": "number" + }, + { + "name": "type", + "baseName": "type", + "type": "number" + }, + { + "name": "maxFee", + "baseName": "maxFee", + "type": "Array" + }, + { + "name": "deadline", + "baseName": "deadline", + "type": "Array" + }, + { + "name": "aliasAction", + "baseName": "aliasAction", + "type": "AliasActionEnum" + }, + { + "name": "namespaceId", + "baseName": "namespaceId", + "type": "Array" + }, + { + "name": "mosaicId", + "baseName": "mosaicId", + "type": "Array" + } ]; + + static getAttributeTypeMap() { + return EmbeddedMosaicAliasTransactionDTO.attributeTypeMap; + } +} + diff --git a/src/infrastructure/model/embeddedMosaicDefinitionTransactionDTO.ts b/src/infrastructure/model/embeddedMosaicDefinitionTransactionDTO.ts new file mode 100644 index 0000000000..1706fc1231 --- /dev/null +++ b/src/infrastructure/model/embeddedMosaicDefinitionTransactionDTO.ts @@ -0,0 +1,113 @@ +/* + * Copyright 2019 NEM + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +/** + * Catapult REST Endpoints + * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) + * + * The version of the OpenAPI document: 0.7.18 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + +import { EmbeddedTransactionDTO } from './embeddedTransactionDTO'; +import { MosaicDefinitionTransactionBodyDTO } from './mosaicDefinitionTransactionBodyDTO'; + +export class EmbeddedMosaicDefinitionTransactionDTO { + 'signerPublicKey': string; + /** + * Entity version. The higher byte represents the network identifier: * 0x68 (MAIN_NET) - Public main network. * 0x98 (TEST_NET) - Public test network. * 0x60 (MIJIN) - Private network. * 0x90 (MIJIN_TEST) - Private test network. + */ + 'version': number; + 'type': number; + 'maxFee': Array; + 'deadline': Array; + /** + * Random nonce used to generate the mosaic id. + */ + 'nonce': number; + 'id': Array; + /** + * - 0x00 (none) - No flags present. - 0x01 (supplyMutable) - Mosaic supports supply changes even when mosaic owner owns partial supply. - 0x02 (transferable) - Mosaic supports transfers between arbitrary accounts. When not set, mosaic can only be transferred to and from mosaic owner. - 0x04 (restrictable) - Mosaic supports custom restrictions configured by mosaic owner. + */ + 'flags'?: number; + /** + * Determines up to what decimal place the mosaic can be divided. Divisibility of 3 means that a mosaic can be divided into smallest parts of 0.001 mosaics. The divisibility must be in the range of 0 and 6. + */ + 'divisibility'?: number; + 'duration'?: Array; + + static discriminator: string | undefined = undefined; + + static attributeTypeMap: Array<{name: string, baseName: string, type: string}> = [ + { + "name": "signerPublicKey", + "baseName": "signerPublicKey", + "type": "string" + }, + { + "name": "version", + "baseName": "version", + "type": "number" + }, + { + "name": "type", + "baseName": "type", + "type": "number" + }, + { + "name": "maxFee", + "baseName": "maxFee", + "type": "Array" + }, + { + "name": "deadline", + "baseName": "deadline", + "type": "Array" + }, + { + "name": "nonce", + "baseName": "nonce", + "type": "number" + }, + { + "name": "id", + "baseName": "id", + "type": "Array" + }, + { + "name": "flags", + "baseName": "flags", + "type": "number" + }, + { + "name": "divisibility", + "baseName": "divisibility", + "type": "number" + }, + { + "name": "duration", + "baseName": "duration", + "type": "Array" + } ]; + + static getAttributeTypeMap() { + return EmbeddedMosaicDefinitionTransactionDTO.attributeTypeMap; + } +} + diff --git a/src/infrastructure/model/embeddedMosaicSupplyChangeTransactionDTO.ts b/src/infrastructure/model/embeddedMosaicSupplyChangeTransactionDTO.ts new file mode 100644 index 0000000000..374c77788a --- /dev/null +++ b/src/infrastructure/model/embeddedMosaicSupplyChangeTransactionDTO.ts @@ -0,0 +1,93 @@ +/* + * Copyright 2019 NEM + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +/** + * Catapult REST Endpoints + * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) + * + * The version of the OpenAPI document: 0.7.18 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + +import { EmbeddedTransactionDTO } from './embeddedTransactionDTO'; +import { MosaicSupplyChangeActionEnum } from './mosaicSupplyChangeActionEnum'; +import { MosaicSupplyChangeTransactionBodyDTO } from './mosaicSupplyChangeTransactionBodyDTO'; + +export class EmbeddedMosaicSupplyChangeTransactionDTO { + 'signerPublicKey': string; + /** + * Entity version. The higher byte represents the network identifier: * 0x68 (MAIN_NET) - Public main network. * 0x98 (TEST_NET) - Public test network. * 0x60 (MIJIN) - Private network. * 0x90 (MIJIN_TEST) - Private test network. + */ + 'version': number; + 'type': number; + 'maxFee': Array; + 'deadline': Array; + 'mosaicId': Array; + 'action': MosaicSupplyChangeActionEnum; + 'delta': Array; + + static discriminator: string | undefined = undefined; + + static attributeTypeMap: Array<{name: string, baseName: string, type: string}> = [ + { + "name": "signerPublicKey", + "baseName": "signerPublicKey", + "type": "string" + }, + { + "name": "version", + "baseName": "version", + "type": "number" + }, + { + "name": "type", + "baseName": "type", + "type": "number" + }, + { + "name": "maxFee", + "baseName": "maxFee", + "type": "Array" + }, + { + "name": "deadline", + "baseName": "deadline", + "type": "Array" + }, + { + "name": "mosaicId", + "baseName": "mosaicId", + "type": "Array" + }, + { + "name": "action", + "baseName": "action", + "type": "MosaicSupplyChangeActionEnum" + }, + { + "name": "delta", + "baseName": "delta", + "type": "Array" + } ]; + + static getAttributeTypeMap() { + return EmbeddedMosaicSupplyChangeTransactionDTO.attributeTypeMap; + } +} + diff --git a/src/infrastructure/model/embeddedMultisigAccountModificationTransactionDTO.ts b/src/infrastructure/model/embeddedMultisigAccountModificationTransactionDTO.ts new file mode 100644 index 0000000000..5812ab62e3 --- /dev/null +++ b/src/infrastructure/model/embeddedMultisigAccountModificationTransactionDTO.ts @@ -0,0 +1,102 @@ +/* + * Copyright 2019 NEM + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +/** + * Catapult REST Endpoints + * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) + * + * The version of the OpenAPI document: 0.7.18 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + +import { CosignatoryModificationDTO } from './cosignatoryModificationDTO'; +import { EmbeddedTransactionDTO } from './embeddedTransactionDTO'; +import { MultisigAccountModificationTransactionBodyDTO } from './multisigAccountModificationTransactionBodyDTO'; + +export class EmbeddedMultisigAccountModificationTransactionDTO { + 'signerPublicKey': string; + /** + * Entity version. The higher byte represents the network identifier: * 0x68 (MAIN_NET) - Public main network. * 0x98 (TEST_NET) - Public test network. * 0x60 (MIJIN) - Private network. * 0x90 (MIJIN_TEST) - Private test network. + */ + 'version': number; + 'type': number; + 'maxFee': Array; + 'deadline': Array; + /** + * Number of signatures needed to remove a cosignatory. If we are modifying an existing multisig account, this indicates the relative change of the minimum cosignatories. + */ + 'minRemovalDelta': number; + /** + * Number of signatures needed to approve a transaction. If we are modifying an existing multisig account, this indicates the relative change of the minimum cosignatories. + */ + 'minApprovalDelta': number; + /** + * Array of cosignatory accounts to add or delete. + */ + 'modifications': Array; + + static discriminator: string | undefined = undefined; + + static attributeTypeMap: Array<{name: string, baseName: string, type: string}> = [ + { + "name": "signerPublicKey", + "baseName": "signerPublicKey", + "type": "string" + }, + { + "name": "version", + "baseName": "version", + "type": "number" + }, + { + "name": "type", + "baseName": "type", + "type": "number" + }, + { + "name": "maxFee", + "baseName": "maxFee", + "type": "Array" + }, + { + "name": "deadline", + "baseName": "deadline", + "type": "Array" + }, + { + "name": "minRemovalDelta", + "baseName": "minRemovalDelta", + "type": "number" + }, + { + "name": "minApprovalDelta", + "baseName": "minApprovalDelta", + "type": "number" + }, + { + "name": "modifications", + "baseName": "modifications", + "type": "Array" + } ]; + + static getAttributeTypeMap() { + return EmbeddedMultisigAccountModificationTransactionDTO.attributeTypeMap; + } +} + diff --git a/src/infrastructure/model/embeddedNamespaceRegistrationTransactionDTO.ts b/src/infrastructure/model/embeddedNamespaceRegistrationTransactionDTO.ts new file mode 100644 index 0000000000..eec0db850c --- /dev/null +++ b/src/infrastructure/model/embeddedNamespaceRegistrationTransactionDTO.ts @@ -0,0 +1,108 @@ +/* + * Copyright 2019 NEM + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +/** + * Catapult REST Endpoints + * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) + * + * The version of the OpenAPI document: 0.7.18 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + +import { EmbeddedTransactionDTO } from './embeddedTransactionDTO'; +import { NamespaceRegistrationTransactionBodyDTO } from './namespaceRegistrationTransactionBodyDTO'; +import { NamespaceRegistrationTypeEnum } from './namespaceRegistrationTypeEnum'; + +export class EmbeddedNamespaceRegistrationTransactionDTO { + 'signerPublicKey': string; + /** + * Entity version. The higher byte represents the network identifier: * 0x68 (MAIN_NET) - Public main network. * 0x98 (TEST_NET) - Public test network. * 0x60 (MIJIN) - Private network. * 0x90 (MIJIN_TEST) - Private test network. + */ + 'version': number; + 'type': number; + 'maxFee': Array; + 'deadline': Array; + 'registrationType': NamespaceRegistrationTypeEnum; + 'duration': Array; + 'parentId': Array; + 'id': Array; + /** + * Namespace name. + */ + 'name': string; + + static discriminator: string | undefined = undefined; + + static attributeTypeMap: Array<{name: string, baseName: string, type: string}> = [ + { + "name": "signerPublicKey", + "baseName": "signerPublicKey", + "type": "string" + }, + { + "name": "version", + "baseName": "version", + "type": "number" + }, + { + "name": "type", + "baseName": "type", + "type": "number" + }, + { + "name": "maxFee", + "baseName": "maxFee", + "type": "Array" + }, + { + "name": "deadline", + "baseName": "deadline", + "type": "Array" + }, + { + "name": "registrationType", + "baseName": "registrationType", + "type": "NamespaceRegistrationTypeEnum" + }, + { + "name": "duration", + "baseName": "duration", + "type": "Array" + }, + { + "name": "parentId", + "baseName": "parentId", + "type": "Array" + }, + { + "name": "id", + "baseName": "id", + "type": "Array" + }, + { + "name": "name", + "baseName": "name", + "type": "string" + } ]; + + static getAttributeTypeMap() { + return EmbeddedNamespaceRegistrationTransactionDTO.attributeTypeMap; + } +} + diff --git a/src/infrastructure/model/embeddedRegisterNamespaceTransactionDTO.ts b/src/infrastructure/model/embeddedRegisterNamespaceTransactionDTO.ts new file mode 100644 index 0000000000..4eaf1a199e --- /dev/null +++ b/src/infrastructure/model/embeddedRegisterNamespaceTransactionDTO.ts @@ -0,0 +1,109 @@ +/* + * Copyright 2019 NEM + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +/** + * Catapult REST Endpoints + * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) + * + * The version of the OpenAPI document: 0.7.17 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + +import { EmbeddedTransactionDTO } from './embeddedTransactionDTO'; +import { EntityTypeEnum } from './entityTypeEnum'; +import { NamespaceTypeEnum } from './namespaceTypeEnum'; +import { RegisterNamespaceTransactionBodyDTO } from './registerNamespaceTransactionBodyDTO'; + +export class EmbeddedRegisterNamespaceTransactionDTO { + 'signer': string; + /** + * Entity version. The higher byte represents the network identifier: * 0x68 (MAIN_NET) - Public main network. * 0x98 (TEST_NET) - Public test network. * 0x60 (MIJIN) - Private network. * 0x90 (MIJIN_TEST) - Private test network. + */ + 'version': number; + 'type': EntityTypeEnum; + 'maxFee': Array; + 'deadline': Array; + 'namespaceType': NamespaceTypeEnum; + 'duration': Array; + 'namespaceId': Array; + /** + * Namespace name. + */ + 'name': string; + 'parentId': Array; + + static discriminator: string | undefined = undefined; + + static attributeTypeMap: Array<{name: string, baseName: string, type: string}> = [ + { + "name": "signer", + "baseName": "signer", + "type": "string" + }, + { + "name": "version", + "baseName": "version", + "type": "number" + }, + { + "name": "type", + "baseName": "type", + "type": "EntityTypeEnum" + }, + { + "name": "maxFee", + "baseName": "maxFee", + "type": "Array" + }, + { + "name": "deadline", + "baseName": "deadline", + "type": "Array" + }, + { + "name": "namespaceType", + "baseName": "namespaceType", + "type": "NamespaceTypeEnum" + }, + { + "name": "duration", + "baseName": "duration", + "type": "Array" + }, + { + "name": "namespaceId", + "baseName": "namespaceId", + "type": "Array" + }, + { + "name": "name", + "baseName": "name", + "type": "string" + }, + { + "name": "parentId", + "baseName": "parentId", + "type": "Array" + } ]; + + static getAttributeTypeMap() { + return EmbeddedRegisterNamespaceTransactionDTO.attributeTypeMap; + } +} + diff --git a/src/infrastructure/model/embeddedSecretLockTransactionDTO.ts b/src/infrastructure/model/embeddedSecretLockTransactionDTO.ts new file mode 100644 index 0000000000..2ede009316 --- /dev/null +++ b/src/infrastructure/model/embeddedSecretLockTransactionDTO.ts @@ -0,0 +1,114 @@ +/* + * Copyright 2019 NEM + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +/** + * Catapult REST Endpoints + * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) + * + * The version of the OpenAPI document: 0.7.18 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + +import { EmbeddedTransactionDTO } from './embeddedTransactionDTO'; +import { LockHashAlgorithmEnum } from './lockHashAlgorithmEnum'; +import { SecretLockTransactionBodyDTO } from './secretLockTransactionBodyDTO'; + +export class EmbeddedSecretLockTransactionDTO { + 'signerPublicKey': string; + /** + * Entity version. The higher byte represents the network identifier: * 0x68 (MAIN_NET) - Public main network. * 0x98 (TEST_NET) - Public test network. * 0x60 (MIJIN) - Private network. * 0x90 (MIJIN_TEST) - Private test network. + */ + 'version': number; + 'type': number; + 'maxFee': Array; + 'deadline': Array; + 'duration': Array; + 'mosaicId': Array; + 'amount': Array; + 'hashAlgorithm': LockHashAlgorithmEnum; + 'secret': string; + /** + * Address decoded. If the bit 0 of byte 0 is not set (like in 0x90), then it is a regular address. Else (e.g. 0x91) it represents a namespace id which starts at byte 1. + */ + 'recipientAddress': string; + + static discriminator: string | undefined = undefined; + + static attributeTypeMap: Array<{name: string, baseName: string, type: string}> = [ + { + "name": "signerPublicKey", + "baseName": "signerPublicKey", + "type": "string" + }, + { + "name": "version", + "baseName": "version", + "type": "number" + }, + { + "name": "type", + "baseName": "type", + "type": "number" + }, + { + "name": "maxFee", + "baseName": "maxFee", + "type": "Array" + }, + { + "name": "deadline", + "baseName": "deadline", + "type": "Array" + }, + { + "name": "duration", + "baseName": "duration", + "type": "Array" + }, + { + "name": "mosaicId", + "baseName": "mosaicId", + "type": "Array" + }, + { + "name": "amount", + "baseName": "amount", + "type": "Array" + }, + { + "name": "hashAlgorithm", + "baseName": "hashAlgorithm", + "type": "LockHashAlgorithmEnum" + }, + { + "name": "secret", + "baseName": "secret", + "type": "string" + }, + { + "name": "recipientAddress", + "baseName": "recipientAddress", + "type": "string" + } ]; + + static getAttributeTypeMap() { + return EmbeddedSecretLockTransactionDTO.attributeTypeMap; + } +} + diff --git a/src/infrastructure/model/embeddedSecretProofTransactionDTO.ts b/src/infrastructure/model/embeddedSecretProofTransactionDTO.ts new file mode 100644 index 0000000000..dc85495bf0 --- /dev/null +++ b/src/infrastructure/model/embeddedSecretProofTransactionDTO.ts @@ -0,0 +1,105 @@ +/* + * Copyright 2019 NEM + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +/** + * Catapult REST Endpoints + * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) + * + * The version of the OpenAPI document: 0.7.18 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + +import { EmbeddedTransactionDTO } from './embeddedTransactionDTO'; +import { LockHashAlgorithmEnum } from './lockHashAlgorithmEnum'; +import { SecretProofTransactionBodyDTO } from './secretProofTransactionBodyDTO'; + +export class EmbeddedSecretProofTransactionDTO { + 'signerPublicKey': string; + /** + * Entity version. The higher byte represents the network identifier: * 0x68 (MAIN_NET) - Public main network. * 0x98 (TEST_NET) - Public test network. * 0x60 (MIJIN) - Private network. * 0x90 (MIJIN_TEST) - Private test network. + */ + 'version': number; + 'type': number; + 'maxFee': Array; + 'deadline': Array; + 'hashAlgorithm': LockHashAlgorithmEnum; + 'secret': string; + /** + * Address decoded. If the bit 0 of byte 0 is not set (like in 0x90), then it is a regular address. Else (e.g. 0x91) it represents a namespace id which starts at byte 1. + */ + 'recipientAddress': string; + /** + * Original random set of bytes. + */ + 'proof': string; + + static discriminator: string | undefined = undefined; + + static attributeTypeMap: Array<{name: string, baseName: string, type: string}> = [ + { + "name": "signerPublicKey", + "baseName": "signerPublicKey", + "type": "string" + }, + { + "name": "version", + "baseName": "version", + "type": "number" + }, + { + "name": "type", + "baseName": "type", + "type": "number" + }, + { + "name": "maxFee", + "baseName": "maxFee", + "type": "Array" + }, + { + "name": "deadline", + "baseName": "deadline", + "type": "Array" + }, + { + "name": "hashAlgorithm", + "baseName": "hashAlgorithm", + "type": "LockHashAlgorithmEnum" + }, + { + "name": "secret", + "baseName": "secret", + "type": "string" + }, + { + "name": "recipientAddress", + "baseName": "recipientAddress", + "type": "string" + }, + { + "name": "proof", + "baseName": "proof", + "type": "string" + } ]; + + static getAttributeTypeMap() { + return EmbeddedSecretProofTransactionDTO.attributeTypeMap; + } +} + diff --git a/src/infrastructure/model/embeddedTransactionDTO.ts b/src/infrastructure/model/embeddedTransactionDTO.ts new file mode 100644 index 0000000000..66fedf8cf4 --- /dev/null +++ b/src/infrastructure/model/embeddedTransactionDTO.ts @@ -0,0 +1,74 @@ +/* + * Copyright 2019 NEM + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +/** + * Catapult REST Endpoints + * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) + * + * The version of the OpenAPI document: 0.7.18 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + +import { EntityDTO } from './entityDTO'; +import { TransactionBodyDTO } from './transactionBodyDTO'; + +export class EmbeddedTransactionDTO { + 'signerPublicKey': string; + /** + * Entity version. The higher byte represents the network identifier: * 0x68 (MAIN_NET) - Public main network. * 0x98 (TEST_NET) - Public test network. * 0x60 (MIJIN) - Private network. * 0x90 (MIJIN_TEST) - Private test network. + */ + 'version': number; + 'type': number; + 'maxFee': Array; + 'deadline': Array; + + static discriminator: string | undefined = undefined; + + static attributeTypeMap: Array<{name: string, baseName: string, type: string}> = [ + { + "name": "signerPublicKey", + "baseName": "signerPublicKey", + "type": "string" + }, + { + "name": "version", + "baseName": "version", + "type": "number" + }, + { + "name": "type", + "baseName": "type", + "type": "number" + }, + { + "name": "maxFee", + "baseName": "maxFee", + "type": "Array" + }, + { + "name": "deadline", + "baseName": "deadline", + "type": "Array" + } ]; + + static getAttributeTypeMap() { + return EmbeddedTransactionDTO.attributeTypeMap; + } +} + diff --git a/src/infrastructure/model/embeddedTransactionInfoDTO.ts b/src/infrastructure/model/embeddedTransactionInfoDTO.ts new file mode 100644 index 0000000000..45ecaf78cf --- /dev/null +++ b/src/infrastructure/model/embeddedTransactionInfoDTO.ts @@ -0,0 +1,52 @@ +/* + * Copyright 2019 NEM + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +/** + * Catapult REST Endpoints + * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) + * + * The version of the OpenAPI document: 0.7.18 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + +import { EmbeddedTransactionMetaDTO } from './embeddedTransactionMetaDTO'; + +export class EmbeddedTransactionInfoDTO { + 'meta': EmbeddedTransactionMetaDTO; + 'transaction': object; + + static discriminator: string | undefined = undefined; + + static attributeTypeMap: Array<{name: string, baseName: string, type: string}> = [ + { + "name": "meta", + "baseName": "meta", + "type": "EmbeddedTransactionMetaDTO" + }, + { + "name": "transaction", + "baseName": "transaction", + "type": "AnyOfEmbeddedAccountLinkTransactionDTOEmbeddedMosaicDefinitionTransactionDTOEmbeddedMosaicSupplyChangeTransactionDTOEmbeddedMultisigAccountModificationTransactionDTOEmbeddedNamespaceRegistrationTransactionDTOEmbeddedAddressAliasTransactionDTOEmbeddedMosaicAliasTransactionDTOEmbeddedHashLockTransactionDTOEmbeddedSecretLockTransactionDTOEmbeddedSecretProofTransactionDTOEmbeddedAccountAddressRestrictionTransactionDTOEmbeddedAccountMosaicRestrictionTransactionDTOEmbeddedAccountOperationRestrictionTransactionDTOEmbeddedGlobalMosaicRestrictionTransactionDTOEmbeddedAddressMosaicRestrictionTransactionDTOEmbeddedTransferTransactionDTO" + } ]; + + static getAttributeTypeMap() { + return EmbeddedTransactionInfoDTO.attributeTypeMap; + } +} + diff --git a/src/infrastructure/model/embeddedTransactionMetaDTO.ts b/src/infrastructure/model/embeddedTransactionMetaDTO.ts new file mode 100644 index 0000000000..f7258a9484 --- /dev/null +++ b/src/infrastructure/model/embeddedTransactionMetaDTO.ts @@ -0,0 +1,69 @@ +/* + * Copyright 2019 NEM + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +/** + * Catapult REST Endpoints + * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) + * + * The version of the OpenAPI document: 0.7.18 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +export class EmbeddedTransactionMetaDTO { + 'height': Array; + 'aggregateHash': string; + 'aggregateId': string; + 'index': number; + 'id': string; + + static discriminator: string | undefined = undefined; + + static attributeTypeMap: Array<{name: string, baseName: string, type: string}> = [ + { + "name": "height", + "baseName": "height", + "type": "Array" + }, + { + "name": "aggregateHash", + "baseName": "aggregateHash", + "type": "string" + }, + { + "name": "aggregateId", + "baseName": "aggregateId", + "type": "string" + }, + { + "name": "index", + "baseName": "index", + "type": "number" + }, + { + "name": "id", + "baseName": "id", + "type": "string" + } ]; + + static getAttributeTypeMap() { + return EmbeddedTransactionMetaDTO.attributeTypeMap; + } +} + diff --git a/src/infrastructure/model/embeddedTransferTransactionDTO.ts b/src/infrastructure/model/embeddedTransferTransactionDTO.ts new file mode 100644 index 0000000000..fc16070f21 --- /dev/null +++ b/src/infrastructure/model/embeddedTransferTransactionDTO.ts @@ -0,0 +1,100 @@ +/* + * Copyright 2019 NEM + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +/** + * Catapult REST Endpoints + * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) + * + * The version of the OpenAPI document: 0.7.18 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + +import { EmbeddedTransactionDTO } from './embeddedTransactionDTO'; +import { MessageDTO } from './messageDTO'; +import { Mosaic } from './mosaic'; +import { TransferTransactionBodyDTO } from './transferTransactionBodyDTO'; + +export class EmbeddedTransferTransactionDTO { + 'signerPublicKey': string; + /** + * Entity version. The higher byte represents the network identifier: * 0x68 (MAIN_NET) - Public main network. * 0x98 (TEST_NET) - Public test network. * 0x60 (MIJIN) - Private network. * 0x90 (MIJIN_TEST) - Private test network. + */ + 'version': number; + 'type': number; + 'maxFee': Array; + 'deadline': Array; + /** + * Address decoded. If the bit 0 of byte 0 is not set (like in 0x90), then it is a regular address. Else (e.g. 0x91) it represents a namespace id which starts at byte 1. + */ + 'recipientAddress': string; + /** + * Array of mosaics sent to the recipient. If the most significant bit of byte 0 is set, a namespaceId (alias) is used instead of a instead of a mosaicId corresponds to a mosaicId. + */ + 'mosaics': Array; + 'message': MessageDTO; + + static discriminator: string | undefined = undefined; + + static attributeTypeMap: Array<{name: string, baseName: string, type: string}> = [ + { + "name": "signerPublicKey", + "baseName": "signerPublicKey", + "type": "string" + }, + { + "name": "version", + "baseName": "version", + "type": "number" + }, + { + "name": "type", + "baseName": "type", + "type": "number" + }, + { + "name": "maxFee", + "baseName": "maxFee", + "type": "Array" + }, + { + "name": "deadline", + "baseName": "deadline", + "type": "Array" + }, + { + "name": "recipientAddress", + "baseName": "recipientAddress", + "type": "string" + }, + { + "name": "mosaics", + "baseName": "mosaics", + "type": "Array" + }, + { + "name": "message", + "baseName": "message", + "type": "MessageDTO" + } ]; + + static getAttributeTypeMap() { + return EmbeddedTransferTransactionDTO.attributeTypeMap; + } +} + diff --git a/src/infrastructure/model/entityDTO.ts b/src/infrastructure/model/entityDTO.ts new file mode 100644 index 0000000000..d5e4cb7edd --- /dev/null +++ b/src/infrastructure/model/entityDTO.ts @@ -0,0 +1,60 @@ +/* + * Copyright 2019 NEM + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +/** + * Catapult REST Endpoints + * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) + * + * The version of the OpenAPI document: 0.7.18 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +export class EntityDTO { + 'signerPublicKey': string; + /** + * Entity version. The higher byte represents the network identifier: * 0x68 (MAIN_NET) - Public main network. * 0x98 (TEST_NET) - Public test network. * 0x60 (MIJIN) - Private network. * 0x90 (MIJIN_TEST) - Private test network. + */ + 'version': number; + 'type': number; + + static discriminator: string | undefined = undefined; + + static attributeTypeMap: Array<{name: string, baseName: string, type: string}> = [ + { + "name": "signerPublicKey", + "baseName": "signerPublicKey", + "type": "string" + }, + { + "name": "version", + "baseName": "version", + "type": "number" + }, + { + "name": "type", + "baseName": "type", + "type": "number" + } ]; + + static getAttributeTypeMap() { + return EntityDTO.attributeTypeMap; + } +} + diff --git a/src/infrastructure/model/entityTypeEnum.ts b/src/infrastructure/model/entityTypeEnum.ts new file mode 100644 index 0000000000..47fced18d1 --- /dev/null +++ b/src/infrastructure/model/entityTypeEnum.ts @@ -0,0 +1,53 @@ +/* + * Copyright 2019 NEM + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +/** + * Catapult REST Endpoints + * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) + * + * The version of the OpenAPI document: 0.7.17 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +/** +* Type of entity: * 0x414C (16716 decimal) - AccountLinkTransaction. * 0x4141 (16705 decimal) - AggregateCompleteTransaction. * 0x4241 (16961 decimal) - AggregateBondedTransaction. * 0x414D (16717 decimal) - MosaicDefinitionTransaction. * 0x424D (16973 decimal) - MosaicSupplyChangeTransaction. * 0x424E (16974 decimal) - AddressAliasTransaction. * 0x434E (17230 decimal) - MosaicAliasTransaction. * 0x4155 (16725 decimal) - ModifyMultisigAccountTransaction. * 0x414E (16718 decimal) - RegisterNamespaceTransaction. * 0x4148 (16712 decimal) - HashLockTransaction. * 0x4152 (16722 decimal) - SecretLockTransaction. * 0x4252 (16978 decimal) - SecretProofTransaction. * 0x4150 (16720 decimal) - AccountAddressRestrictionTransaction. * 0x4250 (16976 decimal) - AccountMosaicRestrictionTransaction. * 0x4350 (17232 decimal) - AccountOperationRestrictionTransaction. * 0x4151 (16721 decimal) - MosaicGlobalRestrictionTransaction. * 0x4251 (16977 decimal) - MosaicAddressRestrictionTransaction. * 0x4154 (16724 decimal) - TransferTransaction. * 0x8043 (32835 decimal) - Nemesis block. * 0x8143 (33091 decimal) - Regular block. +*/ +export enum EntityTypeEnum { + NUMBER_16716 = 16716, + NUMBER_16705 = 16705, + NUMBER_16961 = 16961, + NUMBER_16717 = 16717, + NUMBER_16973 = 16973, + NUMBER_16974 = 16974, + NUMBER_17230 = 17230, + NUMBER_16725 = 16725, + NUMBER_16718 = 16718, + NUMBER_16712 = 16712, + NUMBER_16722 = 16722, + NUMBER_16978 = 16978, + NUMBER_16720 = 16720, + NUMBER_16976 = 16976, + NUMBER_17232 = 17232, + NUMBER_16721 = 16721, + NUMBER_16977 = 16977, + NUMBER_16724 = 16724, + NUMBER_32835 = 32835, + NUMBER_33091 = 33091 +} diff --git a/src/infrastructure/model/globalMosaicRestrictionTransactionBodyDTO.ts b/src/infrastructure/model/globalMosaicRestrictionTransactionBodyDTO.ts new file mode 100644 index 0000000000..a7145acd7d --- /dev/null +++ b/src/infrastructure/model/globalMosaicRestrictionTransactionBodyDTO.ts @@ -0,0 +1,82 @@ +/* + * Copyright 2019 NEM + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +/** + * Catapult REST Endpoints + * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) + * + * The version of the OpenAPI document: 0.7.18 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + +import { MosaicRestrictionTypeEnum } from './mosaicRestrictionTypeEnum'; + +export class GlobalMosaicRestrictionTransactionBodyDTO { + 'mosaicId': Array; + 'referenceMosaicId': Array; + 'restrictionKey': Array; + 'previousRestrictionValue': Array; + 'previousRestrictionType': MosaicRestrictionTypeEnum; + 'newRestrictionValue': Array; + 'newRestrictionType': MosaicRestrictionTypeEnum; + + static discriminator: string | undefined = undefined; + + static attributeTypeMap: Array<{name: string, baseName: string, type: string}> = [ + { + "name": "mosaicId", + "baseName": "mosaicId", + "type": "Array" + }, + { + "name": "referenceMosaicId", + "baseName": "referenceMosaicId", + "type": "Array" + }, + { + "name": "restrictionKey", + "baseName": "restrictionKey", + "type": "Array" + }, + { + "name": "previousRestrictionValue", + "baseName": "previousRestrictionValue", + "type": "Array" + }, + { + "name": "previousRestrictionType", + "baseName": "previousRestrictionType", + "type": "MosaicRestrictionTypeEnum" + }, + { + "name": "newRestrictionValue", + "baseName": "newRestrictionValue", + "type": "Array" + }, + { + "name": "newRestrictionType", + "baseName": "newRestrictionType", + "type": "MosaicRestrictionTypeEnum" + } ]; + + static getAttributeTypeMap() { + return GlobalMosaicRestrictionTransactionBodyDTO.attributeTypeMap; + } +} + diff --git a/src/infrastructure/model/globalMosaicRestrictionTransactionDTO.ts b/src/infrastructure/model/globalMosaicRestrictionTransactionDTO.ts new file mode 100644 index 0000000000..63150bf0b7 --- /dev/null +++ b/src/infrastructure/model/globalMosaicRestrictionTransactionDTO.ts @@ -0,0 +1,126 @@ +/* + * Copyright 2019 NEM + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +/** + * Catapult REST Endpoints + * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) + * + * The version of the OpenAPI document: 0.7.18 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + +import { GlobalMosaicRestrictionTransactionBodyDTO } from './globalMosaicRestrictionTransactionBodyDTO'; +import { MosaicRestrictionTypeEnum } from './mosaicRestrictionTypeEnum'; +import { TransactionDTO } from './transactionDTO'; + +/** +* Transaction to set a network-wide restriction rule to a mosaic. +*/ +export class GlobalMosaicRestrictionTransactionDTO { + 'signature': string; + 'signerPublicKey': string; + /** + * Entity version. The higher byte represents the network identifier: * 0x68 (MAIN_NET) - Public main network. * 0x98 (TEST_NET) - Public test network. * 0x60 (MIJIN) - Private network. * 0x90 (MIJIN_TEST) - Private test network. + */ + 'version': number; + 'type': number; + 'maxFee': Array; + 'deadline': Array; + 'mosaicId': Array; + 'referenceMosaicId': Array; + 'restrictionKey': Array; + 'previousRestrictionValue': Array; + 'previousRestrictionType': MosaicRestrictionTypeEnum; + 'newRestrictionValue': Array; + 'newRestrictionType': MosaicRestrictionTypeEnum; + + static discriminator: string | undefined = undefined; + + static attributeTypeMap: Array<{name: string, baseName: string, type: string}> = [ + { + "name": "signature", + "baseName": "signature", + "type": "string" + }, + { + "name": "signerPublicKey", + "baseName": "signerPublicKey", + "type": "string" + }, + { + "name": "version", + "baseName": "version", + "type": "number" + }, + { + "name": "type", + "baseName": "type", + "type": "number" + }, + { + "name": "maxFee", + "baseName": "maxFee", + "type": "Array" + }, + { + "name": "deadline", + "baseName": "deadline", + "type": "Array" + }, + { + "name": "mosaicId", + "baseName": "mosaicId", + "type": "Array" + }, + { + "name": "referenceMosaicId", + "baseName": "referenceMosaicId", + "type": "Array" + }, + { + "name": "restrictionKey", + "baseName": "restrictionKey", + "type": "Array" + }, + { + "name": "previousRestrictionValue", + "baseName": "previousRestrictionValue", + "type": "Array" + }, + { + "name": "previousRestrictionType", + "baseName": "previousRestrictionType", + "type": "MosaicRestrictionTypeEnum" + }, + { + "name": "newRestrictionValue", + "baseName": "newRestrictionValue", + "type": "Array" + }, + { + "name": "newRestrictionType", + "baseName": "newRestrictionType", + "type": "MosaicRestrictionTypeEnum" + } ]; + + static getAttributeTypeMap() { + return GlobalMosaicRestrictionTransactionDTO.attributeTypeMap; + } +} + diff --git a/src/infrastructure/model/hashAlgorithmEnum.ts b/src/infrastructure/model/hashAlgorithmEnum.ts new file mode 100644 index 0000000000..f91360a949 --- /dev/null +++ b/src/infrastructure/model/hashAlgorithmEnum.ts @@ -0,0 +1,37 @@ +/* + * Copyright 2019 NEM + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +/** + * Catapult REST Endpoints + * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) + * + * The version of the OpenAPI document: 0.7.17 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +/** +* Algorithm used to hash te proof: * 0 (Op_Sha3_256) - Proof is hashed using sha3 256. * 1 (Op_Keccak_256) - Proof is hashed using Keccak (ETH compatibility). * 2 (Op_Hash_160) - Proof is hashed twice: first with Sha-256 and then with RIPEMD-160 (bitcoin’s OP_HASH160). * 3 (Op_Hash_256) - Proof is hashed twice with Sha-256 (bitcoin’s OP_HASH256). +*/ +export enum HashAlgorithmEnum { + NUMBER_0 = 0, + NUMBER_1 = 1, + NUMBER_2 = 2, + NUMBER_3 = 3 +} diff --git a/src/infrastructure/model/hashLockTransactionBodyDTO.ts b/src/infrastructure/model/hashLockTransactionBodyDTO.ts new file mode 100644 index 0000000000..e75ace96e9 --- /dev/null +++ b/src/infrastructure/model/hashLockTransactionBodyDTO.ts @@ -0,0 +1,58 @@ +/* + * Copyright 2019 NEM + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +/** + * Catapult REST Endpoints + * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) + * + * The version of the OpenAPI document: 0.7.18 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + +import { Mosaic } from './mosaic'; + +export class HashLockTransactionBodyDTO { + 'mosaic': Mosaic; + 'duration': Array; + 'hash': string; + + static discriminator: string | undefined = undefined; + + static attributeTypeMap: Array<{name: string, baseName: string, type: string}> = [ + { + "name": "mosaic", + "baseName": "mosaic", + "type": "Mosaic" + }, + { + "name": "duration", + "baseName": "duration", + "type": "Array" + }, + { + "name": "hash", + "baseName": "hash", + "type": "string" + } ]; + + static getAttributeTypeMap() { + return HashLockTransactionBodyDTO.attributeTypeMap; + } +} + diff --git a/src/infrastructure/model/hashLockTransactionDTO.ts b/src/infrastructure/model/hashLockTransactionDTO.ts new file mode 100644 index 0000000000..ee17e69dc1 --- /dev/null +++ b/src/infrastructure/model/hashLockTransactionDTO.ts @@ -0,0 +1,102 @@ +/* + * Copyright 2019 NEM + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +/** + * Catapult REST Endpoints + * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) + * + * The version of the OpenAPI document: 0.7.18 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + +import { HashLockTransactionBodyDTO } from './hashLockTransactionBodyDTO'; +import { Mosaic } from './mosaic'; +import { TransactionDTO } from './transactionDTO'; + +/** +* Transaction to lock funds before sending an aggregate bonded transaction. +*/ +export class HashLockTransactionDTO { + 'signature': string; + 'signerPublicKey': string; + /** + * Entity version. The higher byte represents the network identifier: * 0x68 (MAIN_NET) - Public main network. * 0x98 (TEST_NET) - Public test network. * 0x60 (MIJIN) - Private network. * 0x90 (MIJIN_TEST) - Private test network. + */ + 'version': number; + 'type': number; + 'maxFee': Array; + 'deadline': Array; + 'mosaic': Mosaic; + 'duration': Array; + 'hash': string; + + static discriminator: string | undefined = undefined; + + static attributeTypeMap: Array<{name: string, baseName: string, type: string}> = [ + { + "name": "signature", + "baseName": "signature", + "type": "string" + }, + { + "name": "signerPublicKey", + "baseName": "signerPublicKey", + "type": "string" + }, + { + "name": "version", + "baseName": "version", + "type": "number" + }, + { + "name": "type", + "baseName": "type", + "type": "number" + }, + { + "name": "maxFee", + "baseName": "maxFee", + "type": "Array" + }, + { + "name": "deadline", + "baseName": "deadline", + "type": "Array" + }, + { + "name": "mosaic", + "baseName": "mosaic", + "type": "Mosaic" + }, + { + "name": "duration", + "baseName": "duration", + "type": "Array" + }, + { + "name": "hash", + "baseName": "hash", + "type": "string" + } ]; + + static getAttributeTypeMap() { + return HashLockTransactionDTO.attributeTypeMap; + } +} + diff --git a/src/infrastructure/model/height.ts b/src/infrastructure/model/height.ts new file mode 100644 index 0000000000..fc9ae32878 --- /dev/null +++ b/src/infrastructure/model/height.ts @@ -0,0 +1,34 @@ +/* + * Copyright 2019 NEM + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +/** + * Catapult REST Endpoints + * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) + * + * The version of the OpenAPI document: 0.7.18 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +export class Height extends Array { + + static discriminator: string | undefined = undefined; + +} + diff --git a/src/infrastructure/model/heightInfoDTO.ts b/src/infrastructure/model/heightInfoDTO.ts index 53f49ef78a..82d31767cc 100644 --- a/src/infrastructure/model/heightInfoDTO.ts +++ b/src/infrastructure/model/heightInfoDTO.ts @@ -17,7 +17,7 @@ * Catapult REST Endpoints * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) * - * The version of the OpenAPI document: 0.7.16 + * The version of the OpenAPI document: 0.7.18 * * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). diff --git a/src/infrastructure/model/importance.ts b/src/infrastructure/model/importance.ts new file mode 100644 index 0000000000..cab79309a0 --- /dev/null +++ b/src/infrastructure/model/importance.ts @@ -0,0 +1,34 @@ +/* + * Copyright 2019 NEM + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +/** + * Catapult REST Endpoints + * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) + * + * The version of the OpenAPI document: 0.7.18 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +export class Importance extends Array { + + static discriminator: string | undefined = undefined; + +} + diff --git a/src/infrastructure/model/inflationReceiptDTO.ts b/src/infrastructure/model/inflationReceiptDTO.ts new file mode 100644 index 0000000000..b545a9ce5b --- /dev/null +++ b/src/infrastructure/model/inflationReceiptDTO.ts @@ -0,0 +1,72 @@ +/* + * Copyright 2019 NEM + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +/** + * Catapult REST Endpoints + * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) + * + * The version of the OpenAPI document: 0.7.18 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + +import { InflationReceiptDTOAllOf } from './inflationReceiptDTOAllOf'; +import { ReceiptDTO } from './receiptDTO'; +import { ReceiptTypeEnum } from './receiptTypeEnum'; + +/** +* Native currency mosaics that were created due to inflation. +*/ +export class InflationReceiptDTO { + /** + * Version of the receipt. + */ + 'version': number; + 'type': ReceiptTypeEnum; + 'mosaicId': Array; + 'amount': Array; + + static discriminator: string | undefined = undefined; + + static attributeTypeMap: Array<{name: string, baseName: string, type: string}> = [ + { + "name": "version", + "baseName": "version", + "type": "number" + }, + { + "name": "type", + "baseName": "type", + "type": "ReceiptTypeEnum" + }, + { + "name": "mosaicId", + "baseName": "mosaicId", + "type": "Array" + }, + { + "name": "amount", + "baseName": "amount", + "type": "Array" + } ]; + + static getAttributeTypeMap() { + return InflationReceiptDTO.attributeTypeMap; + } +} + diff --git a/src/infrastructure/model/inflationReceiptDTOAllOf.ts b/src/infrastructure/model/inflationReceiptDTOAllOf.ts new file mode 100644 index 0000000000..1efe5c2405 --- /dev/null +++ b/src/infrastructure/model/inflationReceiptDTOAllOf.ts @@ -0,0 +1,51 @@ +/* + * Copyright 2019 NEM + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +/** + * Catapult REST Endpoints + * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) + * + * The version of the OpenAPI document: 0.7.18 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +export class InflationReceiptDTOAllOf { + 'mosaicId': Array; + 'amount': Array; + + static discriminator: string | undefined = undefined; + + static attributeTypeMap: Array<{name: string, baseName: string, type: string}> = [ + { + "name": "mosaicId", + "baseName": "mosaicId", + "type": "Array" + }, + { + "name": "amount", + "baseName": "amount", + "type": "Array" + } ]; + + static getAttributeTypeMap() { + return InflationReceiptDTOAllOf.attributeTypeMap; + } +} + diff --git a/src/infrastructure/model/keyMetadataDTO.ts b/src/infrastructure/model/keyMetadataDTO.ts new file mode 100644 index 0000000000..78d3b35a54 --- /dev/null +++ b/src/infrastructure/model/keyMetadataDTO.ts @@ -0,0 +1,58 @@ +/* + * Copyright 2019 NEM + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +/** + * Catapult REST Endpoints + * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) + * + * The version of the OpenAPI document: 0.7.17 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + +import { MetadataDTO } from './metadataDTO'; + +export class KeyMetadataDTO { + /** + * Metadata key. + */ + 'key': string; + /** + * Array of metadata objects. + */ + 'metadata': Array; + + static discriminator: string | undefined = undefined; + + static attributeTypeMap: Array<{name: string, baseName: string, type: string}> = [ + { + "name": "key", + "baseName": "key", + "type": "string" + }, + { + "name": "metadata", + "baseName": "metadata", + "type": "Array" + } ]; + + static getAttributeTypeMap() { + return KeyMetadataDTO.attributeTypeMap; + } +} + diff --git a/src/infrastructure/model/linkActionEnum.ts b/src/infrastructure/model/linkActionEnum.ts new file mode 100644 index 0000000000..cdc2da198a --- /dev/null +++ b/src/infrastructure/model/linkActionEnum.ts @@ -0,0 +1,35 @@ +/* + * Copyright 2019 NEM + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +/** + * Catapult REST Endpoints + * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) + * + * The version of the OpenAPI document: 0.7.17 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +/** +* Type of action: * 0 - Link. * 1 - Unlink. +*/ +export enum LinkActionEnum { + NUMBER_0 = 0, + NUMBER_1 = 1 +} diff --git a/src/infrastructure/model/lockHashAlgorithmEnum.ts b/src/infrastructure/model/lockHashAlgorithmEnum.ts new file mode 100644 index 0000000000..b0f2b26d17 --- /dev/null +++ b/src/infrastructure/model/lockHashAlgorithmEnum.ts @@ -0,0 +1,37 @@ +/* + * Copyright 2019 NEM + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +/** + * Catapult REST Endpoints + * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) + * + * The version of the OpenAPI document: 0.7.18 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +/** +* Algorithm used to hash te proof: * 0 (Op_Sha3_256) - Proof is hashed using sha3 256. * 1 (Op_Keccak_256) - Proof is hashed using Keccak (ETH compatibility). * 2 (Op_Hash_160) - Proof is hashed twice: first with Sha-256 and then with RIPEMD-160 (bitcoin’s OP_HASH160). * 3 (Op_Hash_256) - Proof is hashed twice with Sha-256 (bitcoin’s OP_HASH256). +*/ +export enum LockHashAlgorithmEnum { + NUMBER_0 = 0, + NUMBER_1 = 1, + NUMBER_2 = 2, + NUMBER_3 = 3 +} diff --git a/src/infrastructure/model/merklePathItem.ts b/src/infrastructure/model/merklePathItem.ts index fe4e09e439..d73212e419 100644 --- a/src/infrastructure/model/merklePathItem.ts +++ b/src/infrastructure/model/merklePathItem.ts @@ -17,7 +17,7 @@ * Catapult REST Endpoints * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) * - * The version of the OpenAPI document: 0.7.16 + * The version of the OpenAPI document: 0.7.18 * * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). diff --git a/src/infrastructure/model/merkleProofInfoDTO.ts b/src/infrastructure/model/merkleProofInfoDTO.ts index 8e46199b97..b67b22f5ec 100644 --- a/src/infrastructure/model/merkleProofInfoDTO.ts +++ b/src/infrastructure/model/merkleProofInfoDTO.ts @@ -17,7 +17,7 @@ * Catapult REST Endpoints * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) * - * The version of the OpenAPI document: 0.7.16 + * The version of the OpenAPI document: 0.7.18 * * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). @@ -25,24 +25,21 @@ * Do not edit the class manually. */ -import { MerkleProofInfo } from './merkleProofInfo'; +import { MerklePathItem } from './merklePathItem'; export class MerkleProofInfoDTO { - 'payload': MerkleProofInfo; - 'type': string; + /** + * Complementary data needed to calculate the merkle root. + */ + 'merklePath'?: Array; static discriminator: string | undefined = undefined; static attributeTypeMap: Array<{name: string, baseName: string, type: string}> = [ { - "name": "payload", - "baseName": "payload", - "type": "MerkleProofInfo" - }, - { - "name": "type", - "baseName": "type", - "type": "string" + "name": "merklePath", + "baseName": "merklePath", + "type": "Array" } ]; static getAttributeTypeMap() { diff --git a/src/infrastructure/model/messageDTO.ts b/src/infrastructure/model/messageDTO.ts new file mode 100644 index 0000000000..df0e9dc566 --- /dev/null +++ b/src/infrastructure/model/messageDTO.ts @@ -0,0 +1,55 @@ +/* + * Copyright 2019 NEM + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +/** + * Catapult REST Endpoints + * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) + * + * The version of the OpenAPI document: 0.7.18 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + +import { MessageTypeEnum } from './messageTypeEnum'; + +export class MessageDTO { + 'type': MessageTypeEnum; + /** + * Content of the message in hexadecimal. + */ + 'payload': string; + + static discriminator: string | undefined = undefined; + + static attributeTypeMap: Array<{name: string, baseName: string, type: string}> = [ + { + "name": "type", + "baseName": "type", + "type": "MessageTypeEnum" + }, + { + "name": "payload", + "baseName": "payload", + "type": "string" + } ]; + + static getAttributeTypeMap() { + return MessageDTO.attributeTypeMap; + } +} + diff --git a/src/infrastructure/model/messageTypeEnum.ts b/src/infrastructure/model/messageTypeEnum.ts new file mode 100644 index 0000000000..674b66872d --- /dev/null +++ b/src/infrastructure/model/messageTypeEnum.ts @@ -0,0 +1,34 @@ +/* + * Copyright 2019 NEM + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +/** + * Catapult REST Endpoints + * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) + * + * The version of the OpenAPI document: 0.7.18 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +/** +* Type of message: * 0 - Regular message. * 1 - Encrypted message. +*/ +export enum MessageTypeEnum { + NUMBER_0 = 0 +} diff --git a/src/infrastructure/model/metadataDTO.ts b/src/infrastructure/model/metadataDTO.ts new file mode 100644 index 0000000000..513e8918c9 --- /dev/null +++ b/src/infrastructure/model/metadataDTO.ts @@ -0,0 +1,82 @@ +/* + * Copyright 2019 NEM + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +/** + * Catapult REST Endpoints + * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) + * + * The version of the OpenAPI document: 0.7.17 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + +import { MetadataTypeEnum } from './metadataTypeEnum'; + +export class MetadataDTO { + 'compositeHash': string; + 'sourcePublicKey': string; + 'targetPublicKey': string; + 'scopedMetadataKey': Array; + 'targetId': Array; + 'metadataType': MetadataTypeEnum; + 'value': string; + + static discriminator: string | undefined = undefined; + + static attributeTypeMap: Array<{name: string, baseName: string, type: string}> = [ + { + "name": "compositeHash", + "baseName": "compositeHash", + "type": "string" + }, + { + "name": "sourcePublicKey", + "baseName": "sourcePublicKey", + "type": "string" + }, + { + "name": "targetPublicKey", + "baseName": "targetPublicKey", + "type": "string" + }, + { + "name": "scopedMetadataKey", + "baseName": "scopedMetadataKey", + "type": "Array" + }, + { + "name": "targetId", + "baseName": "targetId", + "type": "Array" + }, + { + "name": "metadataType", + "baseName": "metadataType", + "type": "MetadataTypeEnum" + }, + { + "name": "value", + "baseName": "value", + "type": "string" + } ]; + + static getAttributeTypeMap() { + return MetadataDTO.attributeTypeMap; + } +} + diff --git a/src/infrastructure/model/metadataTypeEnum.ts b/src/infrastructure/model/metadataTypeEnum.ts new file mode 100644 index 0000000000..51a90a395b --- /dev/null +++ b/src/infrastructure/model/metadataTypeEnum.ts @@ -0,0 +1,36 @@ +/* + * Copyright 2019 NEM + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +/** + * Catapult REST Endpoints + * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) + * + * The version of the OpenAPI document: 0.7.17 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +/** +* Type of metadata: * 0 - Account * 1 - Mosaic * 2 - Namespace +*/ +export enum MetadataTypeEnum { + NUMBER_0 = 0, + NUMBER_1 = 1, + NUMBER_2 = 2 +} diff --git a/src/infrastructure/model/modelError.ts b/src/infrastructure/model/modelError.ts new file mode 100644 index 0000000000..fe9fb92c06 --- /dev/null +++ b/src/infrastructure/model/modelError.ts @@ -0,0 +1,51 @@ +/* + * Copyright 2019 NEM + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +/** + * Catapult REST Endpoints + * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) + * + * The version of the OpenAPI document: 0.7.18 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +export class ModelError { + 'code': string; + 'message': string; + + static discriminator: string | undefined = undefined; + + static attributeTypeMap: Array<{name: string, baseName: string, type: string}> = [ + { + "name": "code", + "baseName": "code", + "type": "string" + }, + { + "name": "message", + "baseName": "message", + "type": "string" + } ]; + + static getAttributeTypeMap() { + return ModelError.attributeTypeMap; + } +} + diff --git a/src/infrastructure/model/models.ts b/src/infrastructure/model/models.ts index 79ac71b3db..ad551ae0b9 100644 --- a/src/infrastructure/model/models.ts +++ b/src/infrastructure/model/models.ts @@ -1,81 +1,144 @@ -/* - * Copyright 2019 NEM - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -/** - * Catapult REST API Reference - * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) - * - * The version of the OpenAPI document: 0.7.15 - * - * - * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). - * https://openapi-generator.tech - * Do not edit the class manually. - */ +export * from './accountAddressRestrictionModificationDTO'; +export * from './accountAddressRestrictionTransactionBodyDTO'; +export * from './accountAddressRestrictionTransactionDTO'; export * from './accountDTO'; export * from './accountIds'; export * from './accountInfoDTO'; -export * from './accountMetaDTO'; +export * from './accountLinkActionEnum'; +export * from './accountLinkTransactionBodyDTO'; +export * from './accountLinkTransactionDTO'; +export * from './accountMosaicRestrictionModificationDTO'; +export * from './accountMosaicRestrictionTransactionBodyDTO'; +export * from './accountMosaicRestrictionTransactionDTO'; export * from './accountNamesDTO'; +export * from './accountOperationRestrictionModificationDTO'; +export * from './accountOperationRestrictionTransactionBodyDTO'; +export * from './accountOperationRestrictionTransactionDTO'; export * from './accountRestrictionDTO'; +export * from './accountRestrictionModificationActionEnum'; export * from './accountRestrictionTypeEnum'; export * from './accountRestrictionsDTO'; export * from './accountRestrictionsInfoDTO'; +export * from './accountTypeEnum'; +export * from './accountsNamesDTO'; +export * from './activityBucketDTO'; +export * from './addressAliasTransactionBodyDTO'; +export * from './addressAliasTransactionDTO'; +export * from './addressMosaicRestrictionTransactionBodyDTO'; +export * from './addressMosaicRestrictionTransactionDTO'; +export * from './aggregateBondedTransactionDTO'; +export * from './aggregateCompleteTransactionDTO'; +export * from './aggregateTransactionBodyDTO'; +export * from './aliasActionEnum'; export * from './aliasDTO'; export * from './aliasTypeEnum'; +export * from './amount'; export * from './announceTransactionInfoDTO'; +export * from './artifactExpiryReceiptDTO'; +export * from './artifactExpiryReceiptDTOAllOf'; +export * from './balanceChangeReceiptDTO'; +export * from './balanceChangeReceiptDTOAllOf'; +export * from './balanceTransferReceiptDTO'; +export * from './balanceTransferReceiptDTOAllOf'; export * from './blockDTO'; +export * from './blockDTOAllOf'; +export * from './blockDuration'; export * from './blockInfoDTO'; export * from './blockMetaDTO'; -export * from './blockchainScoreDTO'; -export * from './communicationTimestamps'; +export * from './chainScoreDTO'; +export * from './communicationTimestampsDTO'; +export * from './cosignatoryModificationActionEnum'; +export * from './cosignatoryModificationDTO'; export * from './cosignature'; +export * from './cosignatureDTO'; +export * from './cosignatureDTOAllOf'; +export * from './difficulty'; +export * from './embeddedAccountAddressRestrictionTransactionDTO'; +export * from './embeddedAccountLinkTransactionDTO'; +export * from './embeddedAccountMosaicRestrictionTransactionDTO'; +export * from './embeddedAccountOperationRestrictionTransactionDTO'; +export * from './embeddedAddressAliasTransactionDTO'; +export * from './embeddedAddressMosaicRestrictionTransactionDTO'; +export * from './embeddedGlobalMosaicRestrictionTransactionDTO'; +export * from './embeddedHashLockTransactionDTO'; +export * from './embeddedMosaicAliasTransactionDTO'; +export * from './embeddedMosaicDefinitionTransactionDTO'; +export * from './embeddedMosaicSupplyChangeTransactionDTO'; +export * from './embeddedMultisigAccountModificationTransactionDTO'; +export * from './embeddedNamespaceRegistrationTransactionDTO'; +export * from './embeddedSecretLockTransactionDTO'; +export * from './embeddedSecretProofTransactionDTO'; +export * from './embeddedTransactionDTO'; +export * from './embeddedTransactionInfoDTO'; +export * from './embeddedTransactionMetaDTO'; +export * from './embeddedTransferTransactionDTO'; +export * from './entityDTO'; +export * from './globalMosaicRestrictionTransactionBodyDTO'; +export * from './globalMosaicRestrictionTransactionDTO'; +export * from './hashLockTransactionBodyDTO'; +export * from './hashLockTransactionDTO'; +export * from './height'; export * from './heightInfoDTO'; +export * from './importance'; +export * from './inflationReceiptDTO'; +export * from './inflationReceiptDTOAllOf'; +export * from './lockHashAlgorithmEnum'; export * from './merklePathItem'; -export * from './merkleProofInfo'; export * from './merkleProofInfoDTO'; +export * from './messageDTO'; +export * from './messageTypeEnum'; +export * from './modelError'; +export * from './mosaic'; +export * from './mosaicAliasTransactionBodyDTO'; +export * from './mosaicAliasTransactionDTO'; export * from './mosaicDTO'; -export * from './mosaicDefinitionDTO'; +export * from './mosaicDefinitionTransactionBodyDTO'; +export * from './mosaicDefinitionTransactionDTO'; +export * from './mosaicId'; export * from './mosaicIds'; export * from './mosaicInfoDTO'; -export * from './mosaicMetaDTO'; export * from './mosaicNamesDTO'; -export * from './mosaicPropertyDTO'; -export * from './mosaicPropertyIdEnum'; +export * from './mosaicPropertiesDTO'; +export * from './mosaicRestrictionTypeEnum'; +export * from './mosaicSupplyChangeActionEnum'; +export * from './mosaicSupplyChangeTransactionBodyDTO'; +export * from './mosaicSupplyChangeTransactionDTO'; +export * from './mosaicsNamesDTO'; export * from './multisigAccountGraphInfoDTO'; export * from './multisigAccountInfoDTO'; +export * from './multisigAccountModificationTransactionBodyDTO'; +export * from './multisigAccountModificationTransactionDTO'; export * from './multisigDTO'; -export * from './multisigModificationTypeEnum'; export * from './namespaceDTO'; +export * from './namespaceId'; export * from './namespaceIds'; export * from './namespaceInfoDTO'; export * from './namespaceMetaDTO'; export * from './namespaceNameDTO'; -export * from './namespaceTypeEnum'; +export * from './namespaceRegistrationTransactionBodyDTO'; +export * from './namespaceRegistrationTransactionDTO'; +export * from './namespaceRegistrationTypeEnum'; export * from './networkTypeDTO'; export * from './nodeInfoDTO'; export * from './nodeTimeDTO'; +export * from './receiptDTO'; export * from './receiptTypeEnum'; export * from './resolutionEntryDTO'; export * from './resolutionStatementDTO'; export * from './rolesTypeEnum'; +export * from './score'; +export * from './secretLockTransactionBodyDTO'; +export * from './secretLockTransactionDTO'; +export * from './secretProofTransactionBodyDTO'; +export * from './secretProofTransactionDTO'; export * from './serverDTO'; export * from './serverInfoDTO'; export * from './sourceDTO'; export * from './statementsDTO'; export * from './storageInfoDTO'; +export * from './timestamp'; +export * from './transactionBodyDTO'; +export * from './transactionDTO'; export * from './transactionHashes'; export * from './transactionIds'; export * from './transactionInfoDTO'; @@ -83,61 +146,156 @@ export * from './transactionMetaDTO'; export * from './transactionPayload'; export * from './transactionStatementDTO'; export * from './transactionStatusDTO'; +export * from './transactionTypeEnum'; +export * from './transferTransactionBodyDTO'; +export * from './transferTransactionDTO'; +export * from './unresolvedMosaic'; +export * from './unresolvedMosaicId'; +export * from './verifiableEntityDTO'; import localVarRequest = require('request'); +import { AccountAddressRestrictionModificationDTO } from './accountAddressRestrictionModificationDTO'; +import { AccountAddressRestrictionTransactionBodyDTO } from './accountAddressRestrictionTransactionBodyDTO'; +import { AccountAddressRestrictionTransactionDTO } from './accountAddressRestrictionTransactionDTO'; import { AccountDTO } from './accountDTO'; import { AccountIds } from './accountIds'; import { AccountInfoDTO } from './accountInfoDTO'; -import { AccountMetaDTO } from './accountMetaDTO'; +import { AccountLinkActionEnum } from './accountLinkActionEnum'; +import { AccountLinkTransactionBodyDTO } from './accountLinkTransactionBodyDTO'; +import { AccountLinkTransactionDTO } from './accountLinkTransactionDTO'; +import { AccountMosaicRestrictionModificationDTO } from './accountMosaicRestrictionModificationDTO'; +import { AccountMosaicRestrictionTransactionBodyDTO } from './accountMosaicRestrictionTransactionBodyDTO'; +import { AccountMosaicRestrictionTransactionDTO } from './accountMosaicRestrictionTransactionDTO'; import { AccountNamesDTO } from './accountNamesDTO'; +import { AccountOperationRestrictionModificationDTO } from './accountOperationRestrictionModificationDTO'; +import { AccountOperationRestrictionTransactionBodyDTO } from './accountOperationRestrictionTransactionBodyDTO'; +import { AccountOperationRestrictionTransactionDTO } from './accountOperationRestrictionTransactionDTO'; import { AccountRestrictionDTO } from './accountRestrictionDTO'; +import { AccountRestrictionModificationActionEnum } from './accountRestrictionModificationActionEnum'; import { AccountRestrictionTypeEnum } from './accountRestrictionTypeEnum'; import { AccountRestrictionsDTO } from './accountRestrictionsDTO'; import { AccountRestrictionsInfoDTO } from './accountRestrictionsInfoDTO'; +import { AccountTypeEnum } from './accountTypeEnum'; +import { AccountsNamesDTO } from './accountsNamesDTO'; +import { ActivityBucketDTO } from './activityBucketDTO'; +import { AddressAliasTransactionBodyDTO } from './addressAliasTransactionBodyDTO'; +import { AddressAliasTransactionDTO } from './addressAliasTransactionDTO'; +import { AddressMosaicRestrictionTransactionBodyDTO } from './addressMosaicRestrictionTransactionBodyDTO'; +import { AddressMosaicRestrictionTransactionDTO } from './addressMosaicRestrictionTransactionDTO'; +import { AggregateBondedTransactionDTO } from './aggregateBondedTransactionDTO'; +import { AggregateCompleteTransactionDTO } from './aggregateCompleteTransactionDTO'; +import { AggregateTransactionBodyDTO } from './aggregateTransactionBodyDTO'; +import { AliasActionEnum } from './aliasActionEnum'; import { AliasDTO } from './aliasDTO'; import { AliasTypeEnum } from './aliasTypeEnum'; +import { Amount } from './amount'; import { AnnounceTransactionInfoDTO } from './announceTransactionInfoDTO'; +import { ArtifactExpiryReceiptDTO } from './artifactExpiryReceiptDTO'; +import { ArtifactExpiryReceiptDTOAllOf } from './artifactExpiryReceiptDTOAllOf'; +import { BalanceChangeReceiptDTO } from './balanceChangeReceiptDTO'; +import { BalanceChangeReceiptDTOAllOf } from './balanceChangeReceiptDTOAllOf'; +import { BalanceTransferReceiptDTO } from './balanceTransferReceiptDTO'; +import { BalanceTransferReceiptDTOAllOf } from './balanceTransferReceiptDTOAllOf'; import { BlockDTO } from './blockDTO'; +import { BlockDTOAllOf } from './blockDTOAllOf'; +import { BlockDuration } from './blockDuration'; import { BlockInfoDTO } from './blockInfoDTO'; import { BlockMetaDTO } from './blockMetaDTO'; -import { BlockchainScoreDTO } from './blockchainScoreDTO'; -import { CommunicationTimestamps } from './communicationTimestamps'; +import { ChainScoreDTO } from './chainScoreDTO'; +import { CommunicationTimestampsDTO } from './communicationTimestampsDTO'; +import { CosignatoryModificationActionEnum } from './cosignatoryModificationActionEnum'; +import { CosignatoryModificationDTO } from './cosignatoryModificationDTO'; import { Cosignature } from './cosignature'; +import { CosignatureDTO } from './cosignatureDTO'; +import { CosignatureDTOAllOf } from './cosignatureDTOAllOf'; +import { Difficulty } from './difficulty'; +import { EmbeddedAccountAddressRestrictionTransactionDTO } from './embeddedAccountAddressRestrictionTransactionDTO'; +import { EmbeddedAccountLinkTransactionDTO } from './embeddedAccountLinkTransactionDTO'; +import { EmbeddedAccountMosaicRestrictionTransactionDTO } from './embeddedAccountMosaicRestrictionTransactionDTO'; +import { EmbeddedAccountOperationRestrictionTransactionDTO } from './embeddedAccountOperationRestrictionTransactionDTO'; +import { EmbeddedAddressAliasTransactionDTO } from './embeddedAddressAliasTransactionDTO'; +import { EmbeddedAddressMosaicRestrictionTransactionDTO } from './embeddedAddressMosaicRestrictionTransactionDTO'; +import { EmbeddedGlobalMosaicRestrictionTransactionDTO } from './embeddedGlobalMosaicRestrictionTransactionDTO'; +import { EmbeddedHashLockTransactionDTO } from './embeddedHashLockTransactionDTO'; +import { EmbeddedMosaicAliasTransactionDTO } from './embeddedMosaicAliasTransactionDTO'; +import { EmbeddedMosaicDefinitionTransactionDTO } from './embeddedMosaicDefinitionTransactionDTO'; +import { EmbeddedMosaicSupplyChangeTransactionDTO } from './embeddedMosaicSupplyChangeTransactionDTO'; +import { EmbeddedMultisigAccountModificationTransactionDTO } from './embeddedMultisigAccountModificationTransactionDTO'; +import { EmbeddedNamespaceRegistrationTransactionDTO } from './embeddedNamespaceRegistrationTransactionDTO'; +import { EmbeddedSecretLockTransactionDTO } from './embeddedSecretLockTransactionDTO'; +import { EmbeddedSecretProofTransactionDTO } from './embeddedSecretProofTransactionDTO'; +import { EmbeddedTransactionDTO } from './embeddedTransactionDTO'; +import { EmbeddedTransactionInfoDTO } from './embeddedTransactionInfoDTO'; +import { EmbeddedTransactionMetaDTO } from './embeddedTransactionMetaDTO'; +import { EmbeddedTransferTransactionDTO } from './embeddedTransferTransactionDTO'; +import { EntityDTO } from './entityDTO'; +import { GlobalMosaicRestrictionTransactionBodyDTO } from './globalMosaicRestrictionTransactionBodyDTO'; +import { GlobalMosaicRestrictionTransactionDTO } from './globalMosaicRestrictionTransactionDTO'; +import { HashLockTransactionBodyDTO } from './hashLockTransactionBodyDTO'; +import { HashLockTransactionDTO } from './hashLockTransactionDTO'; +import { Height } from './height'; import { HeightInfoDTO } from './heightInfoDTO'; +import { Importance } from './importance'; +import { InflationReceiptDTO } from './inflationReceiptDTO'; +import { InflationReceiptDTOAllOf } from './inflationReceiptDTOAllOf'; +import { LockHashAlgorithmEnum } from './lockHashAlgorithmEnum'; import { MerklePathItem } from './merklePathItem'; -import { MerkleProofInfo } from './merkleProofInfo'; import { MerkleProofInfoDTO } from './merkleProofInfoDTO'; +import { MessageDTO } from './messageDTO'; +import { MessageTypeEnum } from './messageTypeEnum'; +import { ModelError } from './modelError'; +import { Mosaic } from './mosaic'; +import { MosaicAliasTransactionBodyDTO } from './mosaicAliasTransactionBodyDTO'; +import { MosaicAliasTransactionDTO } from './mosaicAliasTransactionDTO'; import { MosaicDTO } from './mosaicDTO'; -import { MosaicDefinitionDTO } from './mosaicDefinitionDTO'; +import { MosaicDefinitionTransactionBodyDTO } from './mosaicDefinitionTransactionBodyDTO'; +import { MosaicDefinitionTransactionDTO } from './mosaicDefinitionTransactionDTO'; +import { MosaicId } from './mosaicId'; import { MosaicIds } from './mosaicIds'; import { MosaicInfoDTO } from './mosaicInfoDTO'; -import { MosaicMetaDTO } from './mosaicMetaDTO'; import { MosaicNamesDTO } from './mosaicNamesDTO'; -import { MosaicPropertyDTO } from './mosaicPropertyDTO'; -import { MosaicPropertyIdEnum } from './mosaicPropertyIdEnum'; +import { MosaicPropertiesDTO } from './mosaicPropertiesDTO'; +import { MosaicRestrictionTypeEnum } from './mosaicRestrictionTypeEnum'; +import { MosaicSupplyChangeActionEnum } from './mosaicSupplyChangeActionEnum'; +import { MosaicSupplyChangeTransactionBodyDTO } from './mosaicSupplyChangeTransactionBodyDTO'; +import { MosaicSupplyChangeTransactionDTO } from './mosaicSupplyChangeTransactionDTO'; +import { MosaicsNamesDTO } from './mosaicsNamesDTO'; import { MultisigAccountGraphInfoDTO } from './multisigAccountGraphInfoDTO'; import { MultisigAccountInfoDTO } from './multisigAccountInfoDTO'; +import { MultisigAccountModificationTransactionBodyDTO } from './multisigAccountModificationTransactionBodyDTO'; +import { MultisigAccountModificationTransactionDTO } from './multisigAccountModificationTransactionDTO'; import { MultisigDTO } from './multisigDTO'; -import { MultisigModificationTypeEnum } from './multisigModificationTypeEnum'; import { NamespaceDTO } from './namespaceDTO'; +import { NamespaceId } from './namespaceId'; import { NamespaceIds } from './namespaceIds'; import { NamespaceInfoDTO } from './namespaceInfoDTO'; import { NamespaceMetaDTO } from './namespaceMetaDTO'; import { NamespaceNameDTO } from './namespaceNameDTO'; -import { NamespaceTypeEnum } from './namespaceTypeEnum'; +import { NamespaceRegistrationTransactionBodyDTO } from './namespaceRegistrationTransactionBodyDTO'; +import { NamespaceRegistrationTransactionDTO } from './namespaceRegistrationTransactionDTO'; +import { NamespaceRegistrationTypeEnum } from './namespaceRegistrationTypeEnum'; import { NetworkTypeDTO } from './networkTypeDTO'; import { NodeInfoDTO } from './nodeInfoDTO'; import { NodeTimeDTO } from './nodeTimeDTO'; +import { ReceiptDTO } from './receiptDTO'; import { ReceiptTypeEnum } from './receiptTypeEnum'; import { ResolutionEntryDTO } from './resolutionEntryDTO'; import { ResolutionStatementDTO } from './resolutionStatementDTO'; import { RolesTypeEnum } from './rolesTypeEnum'; +import { Score } from './score'; +import { SecretLockTransactionBodyDTO } from './secretLockTransactionBodyDTO'; +import { SecretLockTransactionDTO } from './secretLockTransactionDTO'; +import { SecretProofTransactionBodyDTO } from './secretProofTransactionBodyDTO'; +import { SecretProofTransactionDTO } from './secretProofTransactionDTO'; import { ServerDTO } from './serverDTO'; import { ServerInfoDTO } from './serverInfoDTO'; import { SourceDTO } from './sourceDTO'; import { StatementsDTO } from './statementsDTO'; import { StorageInfoDTO } from './storageInfoDTO'; +import { Timestamp } from './timestamp'; +import { TransactionBodyDTO } from './transactionBodyDTO'; +import { TransactionDTO } from './transactionDTO'; import { TransactionHashes } from './transactionHashes'; import { TransactionIds } from './transactionIds'; import { TransactionInfoDTO } from './transactionInfoDTO'; @@ -145,6 +303,12 @@ import { TransactionMetaDTO } from './transactionMetaDTO'; import { TransactionPayload } from './transactionPayload'; import { TransactionStatementDTO } from './transactionStatementDTO'; import { TransactionStatusDTO } from './transactionStatusDTO'; +import { TransactionTypeEnum } from './transactionTypeEnum'; +import { TransferTransactionBodyDTO } from './transferTransactionBodyDTO'; +import { TransferTransactionDTO } from './transferTransactionDTO'; +import { UnresolvedMosaic } from './unresolvedMosaic'; +import { UnresolvedMosaicId } from './unresolvedMosaicId'; +import { VerifiableEntityDTO } from './verifiableEntityDTO'; /* tslint:disable:no-unused-variable */ let primitives = [ @@ -159,62 +323,151 @@ let primitives = [ ]; let enumsMap: {[index: string]: any} = { - - "AliasTypeEnum": AliasTypeEnum, - "MosaicPropertyIdEnum": MosaicPropertyIdEnum, - "MultisigModificationTypeEnum": MultisigModificationTypeEnum, - "NamespaceTypeEnum": NamespaceTypeEnum, - "ReceiptTypeEnum": ReceiptTypeEnum, - "RolesTypeEnum": RolesTypeEnum, + "AccountLinkActionEnum": AccountLinkActionEnum, + "AccountRestrictionModificationActionEnum": AccountRestrictionModificationActionEnum, + "AccountRestrictionTypeEnum": AccountRestrictionTypeEnum, + "AccountTypeEnum": AccountTypeEnum, + "AliasActionEnum": AliasActionEnum, + "AliasTypeEnum": AliasTypeEnum, + "CosignatoryModificationActionEnum": CosignatoryModificationActionEnum, + "LockHashAlgorithmEnum": LockHashAlgorithmEnum, + "MessageTypeEnum": MessageTypeEnum, + "MosaicRestrictionTypeEnum": MosaicRestrictionTypeEnum, + "MosaicSupplyChangeActionEnum": MosaicSupplyChangeActionEnum, + "NamespaceRegistrationTypeEnum": NamespaceRegistrationTypeEnum, + "ReceiptTypeEnum": ReceiptTypeEnum, + "RolesTypeEnum": RolesTypeEnum, + "TransactionTypeEnum": TransactionTypeEnum, } let typeMap: {[index: string]: any} = { + "AccountAddressRestrictionModificationDTO": AccountAddressRestrictionModificationDTO, + "AccountAddressRestrictionTransactionBodyDTO": AccountAddressRestrictionTransactionBodyDTO, + "AccountAddressRestrictionTransactionDTO": AccountAddressRestrictionTransactionDTO, "AccountDTO": AccountDTO, "AccountIds": AccountIds, "AccountInfoDTO": AccountInfoDTO, - "AccountMetaDTO": AccountMetaDTO, + "AccountLinkTransactionBodyDTO": AccountLinkTransactionBodyDTO, + "AccountLinkTransactionDTO": AccountLinkTransactionDTO, + "AccountMosaicRestrictionModificationDTO": AccountMosaicRestrictionModificationDTO, + "AccountMosaicRestrictionTransactionBodyDTO": AccountMosaicRestrictionTransactionBodyDTO, + "AccountMosaicRestrictionTransactionDTO": AccountMosaicRestrictionTransactionDTO, "AccountNamesDTO": AccountNamesDTO, + "AccountOperationRestrictionModificationDTO": AccountOperationRestrictionModificationDTO, + "AccountOperationRestrictionTransactionBodyDTO": AccountOperationRestrictionTransactionBodyDTO, + "AccountOperationRestrictionTransactionDTO": AccountOperationRestrictionTransactionDTO, "AccountRestrictionDTO": AccountRestrictionDTO, - "AccountRestrictionTypeEnum": AccountRestrictionTypeEnum, "AccountRestrictionsDTO": AccountRestrictionsDTO, "AccountRestrictionsInfoDTO": AccountRestrictionsInfoDTO, + "AccountsNamesDTO": AccountsNamesDTO, + "ActivityBucketDTO": ActivityBucketDTO, + "AddressAliasTransactionBodyDTO": AddressAliasTransactionBodyDTO, + "AddressAliasTransactionDTO": AddressAliasTransactionDTO, + "AddressMosaicRestrictionTransactionBodyDTO": AddressMosaicRestrictionTransactionBodyDTO, + "AddressMosaicRestrictionTransactionDTO": AddressMosaicRestrictionTransactionDTO, + "AggregateBondedTransactionDTO": AggregateBondedTransactionDTO, + "AggregateCompleteTransactionDTO": AggregateCompleteTransactionDTO, + "AggregateTransactionBodyDTO": AggregateTransactionBodyDTO, "AliasDTO": AliasDTO, + "Amount": Amount, "AnnounceTransactionInfoDTO": AnnounceTransactionInfoDTO, + "ArtifactExpiryReceiptDTO": ArtifactExpiryReceiptDTO, + "ArtifactExpiryReceiptDTOAllOf": ArtifactExpiryReceiptDTOAllOf, + "BalanceChangeReceiptDTO": BalanceChangeReceiptDTO, + "BalanceChangeReceiptDTOAllOf": BalanceChangeReceiptDTOAllOf, + "BalanceTransferReceiptDTO": BalanceTransferReceiptDTO, + "BalanceTransferReceiptDTOAllOf": BalanceTransferReceiptDTOAllOf, "BlockDTO": BlockDTO, + "BlockDTOAllOf": BlockDTOAllOf, + "BlockDuration": BlockDuration, "BlockInfoDTO": BlockInfoDTO, "BlockMetaDTO": BlockMetaDTO, - "BlockchainScoreDTO": BlockchainScoreDTO, - "CommunicationTimestamps": CommunicationTimestamps, + "ChainScoreDTO": ChainScoreDTO, + "CommunicationTimestampsDTO": CommunicationTimestampsDTO, + "CosignatoryModificationDTO": CosignatoryModificationDTO, "Cosignature": Cosignature, + "CosignatureDTO": CosignatureDTO, + "CosignatureDTOAllOf": CosignatureDTOAllOf, + "Difficulty": Difficulty, + "EmbeddedAccountAddressRestrictionTransactionDTO": EmbeddedAccountAddressRestrictionTransactionDTO, + "EmbeddedAccountLinkTransactionDTO": EmbeddedAccountLinkTransactionDTO, + "EmbeddedAccountMosaicRestrictionTransactionDTO": EmbeddedAccountMosaicRestrictionTransactionDTO, + "EmbeddedAccountOperationRestrictionTransactionDTO": EmbeddedAccountOperationRestrictionTransactionDTO, + "EmbeddedAddressAliasTransactionDTO": EmbeddedAddressAliasTransactionDTO, + "EmbeddedAddressMosaicRestrictionTransactionDTO": EmbeddedAddressMosaicRestrictionTransactionDTO, + "EmbeddedGlobalMosaicRestrictionTransactionDTO": EmbeddedGlobalMosaicRestrictionTransactionDTO, + "EmbeddedHashLockTransactionDTO": EmbeddedHashLockTransactionDTO, + "EmbeddedMosaicAliasTransactionDTO": EmbeddedMosaicAliasTransactionDTO, + "EmbeddedMosaicDefinitionTransactionDTO": EmbeddedMosaicDefinitionTransactionDTO, + "EmbeddedMosaicSupplyChangeTransactionDTO": EmbeddedMosaicSupplyChangeTransactionDTO, + "EmbeddedMultisigAccountModificationTransactionDTO": EmbeddedMultisigAccountModificationTransactionDTO, + "EmbeddedNamespaceRegistrationTransactionDTO": EmbeddedNamespaceRegistrationTransactionDTO, + "EmbeddedSecretLockTransactionDTO": EmbeddedSecretLockTransactionDTO, + "EmbeddedSecretProofTransactionDTO": EmbeddedSecretProofTransactionDTO, + "EmbeddedTransactionDTO": EmbeddedTransactionDTO, + "EmbeddedTransactionInfoDTO": EmbeddedTransactionInfoDTO, + "EmbeddedTransactionMetaDTO": EmbeddedTransactionMetaDTO, + "EmbeddedTransferTransactionDTO": EmbeddedTransferTransactionDTO, + "EntityDTO": EntityDTO, + "GlobalMosaicRestrictionTransactionBodyDTO": GlobalMosaicRestrictionTransactionBodyDTO, + "GlobalMosaicRestrictionTransactionDTO": GlobalMosaicRestrictionTransactionDTO, + "HashLockTransactionBodyDTO": HashLockTransactionBodyDTO, + "HashLockTransactionDTO": HashLockTransactionDTO, + "Height": Height, "HeightInfoDTO": HeightInfoDTO, + "Importance": Importance, + "InflationReceiptDTO": InflationReceiptDTO, + "InflationReceiptDTOAllOf": InflationReceiptDTOAllOf, "MerklePathItem": MerklePathItem, - "MerkleProofInfo": MerkleProofInfo, "MerkleProofInfoDTO": MerkleProofInfoDTO, + "MessageDTO": MessageDTO, + "ModelError": ModelError, + "Mosaic": Mosaic, + "MosaicAliasTransactionBodyDTO": MosaicAliasTransactionBodyDTO, + "MosaicAliasTransactionDTO": MosaicAliasTransactionDTO, "MosaicDTO": MosaicDTO, - "MosaicDefinitionDTO": MosaicDefinitionDTO, + "MosaicDefinitionTransactionBodyDTO": MosaicDefinitionTransactionBodyDTO, + "MosaicDefinitionTransactionDTO": MosaicDefinitionTransactionDTO, + "MosaicId": MosaicId, "MosaicIds": MosaicIds, "MosaicInfoDTO": MosaicInfoDTO, - "MosaicMetaDTO": MosaicMetaDTO, "MosaicNamesDTO": MosaicNamesDTO, - "MosaicPropertyDTO": MosaicPropertyDTO, + "MosaicPropertiesDTO": MosaicPropertiesDTO, + "MosaicSupplyChangeTransactionBodyDTO": MosaicSupplyChangeTransactionBodyDTO, + "MosaicSupplyChangeTransactionDTO": MosaicSupplyChangeTransactionDTO, + "MosaicsNamesDTO": MosaicsNamesDTO, "MultisigAccountGraphInfoDTO": MultisigAccountGraphInfoDTO, "MultisigAccountInfoDTO": MultisigAccountInfoDTO, + "MultisigAccountModificationTransactionBodyDTO": MultisigAccountModificationTransactionBodyDTO, + "MultisigAccountModificationTransactionDTO": MultisigAccountModificationTransactionDTO, "MultisigDTO": MultisigDTO, "NamespaceDTO": NamespaceDTO, + "NamespaceId": NamespaceId, "NamespaceIds": NamespaceIds, "NamespaceInfoDTO": NamespaceInfoDTO, "NamespaceMetaDTO": NamespaceMetaDTO, "NamespaceNameDTO": NamespaceNameDTO, + "NamespaceRegistrationTransactionBodyDTO": NamespaceRegistrationTransactionBodyDTO, + "NamespaceRegistrationTransactionDTO": NamespaceRegistrationTransactionDTO, "NetworkTypeDTO": NetworkTypeDTO, "NodeInfoDTO": NodeInfoDTO, "NodeTimeDTO": NodeTimeDTO, + "ReceiptDTO": ReceiptDTO, "ResolutionEntryDTO": ResolutionEntryDTO, "ResolutionStatementDTO": ResolutionStatementDTO, + "Score": Score, + "SecretLockTransactionBodyDTO": SecretLockTransactionBodyDTO, + "SecretLockTransactionDTO": SecretLockTransactionDTO, + "SecretProofTransactionBodyDTO": SecretProofTransactionBodyDTO, + "SecretProofTransactionDTO": SecretProofTransactionDTO, "ServerDTO": ServerDTO, "ServerInfoDTO": ServerInfoDTO, "SourceDTO": SourceDTO, "StatementsDTO": StatementsDTO, "StorageInfoDTO": StorageInfoDTO, + "Timestamp": Timestamp, + "TransactionBodyDTO": TransactionBodyDTO, + "TransactionDTO": TransactionDTO, "TransactionHashes": TransactionHashes, "TransactionIds": TransactionIds, "TransactionInfoDTO": TransactionInfoDTO, @@ -222,6 +475,11 @@ let typeMap: {[index: string]: any} = { "TransactionPayload": TransactionPayload, "TransactionStatementDTO": TransactionStatementDTO, "TransactionStatusDTO": TransactionStatusDTO, + "TransferTransactionBodyDTO": TransferTransactionBodyDTO, + "TransferTransactionDTO": TransferTransactionDTO, + "UnresolvedMosaic": UnresolvedMosaic, + "UnresolvedMosaicId": UnresolvedMosaicId, + "VerifiableEntityDTO": VerifiableEntityDTO, } export class ObjectSerializer { @@ -339,7 +597,7 @@ export interface Authentication { /** * Apply authentication settings to header and query params. */ - applyToRequest(requestOptions: localVarRequest.Options): void; + applyToRequest(requestOptions: localVarRequest.Options): Promise | void; } export class HttpBasicAuth implements Authentication { diff --git a/src/infrastructure/model/modifyMultisigAccountTransactionBodyDTO.ts b/src/infrastructure/model/modifyMultisigAccountTransactionBodyDTO.ts new file mode 100644 index 0000000000..d5ff699fe8 --- /dev/null +++ b/src/infrastructure/model/modifyMultisigAccountTransactionBodyDTO.ts @@ -0,0 +1,67 @@ +/* + * Copyright 2019 NEM + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +/** + * Catapult REST Endpoints + * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) + * + * The version of the OpenAPI document: 0.7.17 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + +import { CosignatoryModificationDTO } from './cosignatoryModificationDTO'; + +export class ModifyMultisigAccountTransactionBodyDTO { + /** + * Number of signatures needed to remove a cosignatory. If we are modifying an existing multisig account, this indicates the relative change of the minimum cosignatories. + */ + 'minRemovalDelta': number; + /** + * Number of signatures needed to approve a transaction. If we are modifying an existing multisig account, this indicates the relative change of the minimum cosignatories. + */ + 'minApprovalDelta': number; + /** + * Array of cosignatory accounts to add or delete. + */ + 'modifications': Array; + + static discriminator: string | undefined = undefined; + + static attributeTypeMap: Array<{name: string, baseName: string, type: string}> = [ + { + "name": "minRemovalDelta", + "baseName": "minRemovalDelta", + "type": "number" + }, + { + "name": "minApprovalDelta", + "baseName": "minApprovalDelta", + "type": "number" + }, + { + "name": "modifications", + "baseName": "modifications", + "type": "Array" + } ]; + + static getAttributeTypeMap() { + return ModifyMultisigAccountTransactionBodyDTO.attributeTypeMap; + } +} + diff --git a/src/infrastructure/model/modifyMultisigAccountTransactionDTO.ts b/src/infrastructure/model/modifyMultisigAccountTransactionDTO.ts new file mode 100644 index 0000000000..d993f92736 --- /dev/null +++ b/src/infrastructure/model/modifyMultisigAccountTransactionDTO.ts @@ -0,0 +1,112 @@ +/* + * Copyright 2019 NEM + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +/** + * Catapult REST Endpoints + * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) + * + * The version of the OpenAPI document: 0.7.17 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + +import { CosignatoryModificationDTO } from './cosignatoryModificationDTO'; +import { EntityTypeEnum } from './entityTypeEnum'; +import { ModifyMultisigAccountTransactionBodyDTO } from './modifyMultisigAccountTransactionBodyDTO'; +import { TransactionDTO } from './transactionDTO'; + +/** +* Transaction to create or modify a multisig account. +*/ +export class ModifyMultisigAccountTransactionDTO { + 'signature': string; + 'signer': string; + /** + * Entity version. The higher byte represents the network identifier: * 0x68 (MAIN_NET) - Public main network. * 0x98 (TEST_NET) - Public test network. * 0x60 (MIJIN) - Private network. * 0x90 (MIJIN_TEST) - Private test network. + */ + 'version': number; + 'type': EntityTypeEnum; + 'maxFee': Array; + 'deadline': Array; + /** + * Number of signatures needed to remove a cosignatory. If we are modifying an existing multisig account, this indicates the relative change of the minimum cosignatories. + */ + 'minRemovalDelta': number; + /** + * Number of signatures needed to approve a transaction. If we are modifying an existing multisig account, this indicates the relative change of the minimum cosignatories. + */ + 'minApprovalDelta': number; + /** + * Array of cosignatory accounts to add or delete. + */ + 'modifications': Array; + + static discriminator: string | undefined = undefined; + + static attributeTypeMap: Array<{name: string, baseName: string, type: string}> = [ + { + "name": "signature", + "baseName": "signature", + "type": "string" + }, + { + "name": "signer", + "baseName": "signer", + "type": "string" + }, + { + "name": "version", + "baseName": "version", + "type": "number" + }, + { + "name": "type", + "baseName": "type", + "type": "EntityTypeEnum" + }, + { + "name": "maxFee", + "baseName": "maxFee", + "type": "Array" + }, + { + "name": "deadline", + "baseName": "deadline", + "type": "Array" + }, + { + "name": "minRemovalDelta", + "baseName": "minRemovalDelta", + "type": "number" + }, + { + "name": "minApprovalDelta", + "baseName": "minApprovalDelta", + "type": "number" + }, + { + "name": "modifications", + "baseName": "modifications", + "type": "Array" + } ]; + + static getAttributeTypeMap() { + return ModifyMultisigAccountTransactionDTO.attributeTypeMap; + } +} + diff --git a/src/infrastructure/model/mosaic.ts b/src/infrastructure/model/mosaic.ts new file mode 100644 index 0000000000..ca6a7a83fb --- /dev/null +++ b/src/infrastructure/model/mosaic.ts @@ -0,0 +1,51 @@ +/* + * Copyright 2019 NEM + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +/** + * Catapult REST Endpoints + * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) + * + * The version of the OpenAPI document: 0.7.18 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +export class Mosaic { + 'id': Array; + 'amount': Array; + + static discriminator: string | undefined = undefined; + + static attributeTypeMap: Array<{name: string, baseName: string, type: string}> = [ + { + "name": "id", + "baseName": "id", + "type": "Array" + }, + { + "name": "amount", + "baseName": "amount", + "type": "Array" + } ]; + + static getAttributeTypeMap() { + return Mosaic.attributeTypeMap; + } +} + diff --git a/src/infrastructure/model/mosaicAliasTransactionBodyDTO.ts b/src/infrastructure/model/mosaicAliasTransactionBodyDTO.ts new file mode 100644 index 0000000000..ae7aacf577 --- /dev/null +++ b/src/infrastructure/model/mosaicAliasTransactionBodyDTO.ts @@ -0,0 +1,58 @@ +/* + * Copyright 2019 NEM + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +/** + * Catapult REST Endpoints + * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) + * + * The version of the OpenAPI document: 0.7.18 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + +import { AliasActionEnum } from './aliasActionEnum'; + +export class MosaicAliasTransactionBodyDTO { + 'aliasAction': AliasActionEnum; + 'namespaceId': Array; + 'mosaicId': Array; + + static discriminator: string | undefined = undefined; + + static attributeTypeMap: Array<{name: string, baseName: string, type: string}> = [ + { + "name": "aliasAction", + "baseName": "aliasAction", + "type": "AliasActionEnum" + }, + { + "name": "namespaceId", + "baseName": "namespaceId", + "type": "Array" + }, + { + "name": "mosaicId", + "baseName": "mosaicId", + "type": "Array" + } ]; + + static getAttributeTypeMap() { + return MosaicAliasTransactionBodyDTO.attributeTypeMap; + } +} + diff --git a/src/infrastructure/model/mosaicAliasTransactionDTO.ts b/src/infrastructure/model/mosaicAliasTransactionDTO.ts new file mode 100644 index 0000000000..c70c7f1e8b --- /dev/null +++ b/src/infrastructure/model/mosaicAliasTransactionDTO.ts @@ -0,0 +1,102 @@ +/* + * Copyright 2019 NEM + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +/** + * Catapult REST Endpoints + * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) + * + * The version of the OpenAPI document: 0.7.18 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + +import { AliasActionEnum } from './aliasActionEnum'; +import { MosaicAliasTransactionBodyDTO } from './mosaicAliasTransactionBodyDTO'; +import { TransactionDTO } from './transactionDTO'; + +/** +* Transaction to link a namespace to a mosaic. +*/ +export class MosaicAliasTransactionDTO { + 'signature': string; + 'signerPublicKey': string; + /** + * Entity version. The higher byte represents the network identifier: * 0x68 (MAIN_NET) - Public main network. * 0x98 (TEST_NET) - Public test network. * 0x60 (MIJIN) - Private network. * 0x90 (MIJIN_TEST) - Private test network. + */ + 'version': number; + 'type': number; + 'maxFee': Array; + 'deadline': Array; + 'aliasAction': AliasActionEnum; + 'namespaceId': Array; + 'mosaicId': Array; + + static discriminator: string | undefined = undefined; + + static attributeTypeMap: Array<{name: string, baseName: string, type: string}> = [ + { + "name": "signature", + "baseName": "signature", + "type": "string" + }, + { + "name": "signerPublicKey", + "baseName": "signerPublicKey", + "type": "string" + }, + { + "name": "version", + "baseName": "version", + "type": "number" + }, + { + "name": "type", + "baseName": "type", + "type": "number" + }, + { + "name": "maxFee", + "baseName": "maxFee", + "type": "Array" + }, + { + "name": "deadline", + "baseName": "deadline", + "type": "Array" + }, + { + "name": "aliasAction", + "baseName": "aliasAction", + "type": "AliasActionEnum" + }, + { + "name": "namespaceId", + "baseName": "namespaceId", + "type": "Array" + }, + { + "name": "mosaicId", + "baseName": "mosaicId", + "type": "Array" + } ]; + + static getAttributeTypeMap() { + return MosaicAliasTransactionDTO.attributeTypeMap; + } +} + diff --git a/src/infrastructure/model/mosaicDTO.ts b/src/infrastructure/model/mosaicDTO.ts index a929869893..43084af7f5 100644 --- a/src/infrastructure/model/mosaicDTO.ts +++ b/src/infrastructure/model/mosaicDTO.ts @@ -17,7 +17,7 @@ * Catapult REST Endpoints * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) * - * The version of the OpenAPI document: 0.7.16 + * The version of the OpenAPI document: 0.7.18 * * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). @@ -25,10 +25,19 @@ * Do not edit the class manually. */ +import { MosaicPropertiesDTO } from './mosaicPropertiesDTO'; export class MosaicDTO { 'id': Array; - 'amount': Array; + 'supply': Array; + 'startHeight': Array; + 'ownerPublicKey': string; + 'ownerAddress': string; + /** + * Number of definitions for the same mosaic. + */ + 'revision': number; + 'properties': MosaicPropertiesDTO; static discriminator: string | undefined = undefined; @@ -39,9 +48,34 @@ export class MosaicDTO { "type": "Array" }, { - "name": "amount", - "baseName": "amount", + "name": "supply", + "baseName": "supply", "type": "Array" + }, + { + "name": "startHeight", + "baseName": "startHeight", + "type": "Array" + }, + { + "name": "ownerPublicKey", + "baseName": "ownerPublicKey", + "type": "string" + }, + { + "name": "ownerAddress", + "baseName": "ownerAddress", + "type": "string" + }, + { + "name": "revision", + "baseName": "revision", + "type": "number" + }, + { + "name": "properties", + "baseName": "properties", + "type": "MosaicPropertiesDTO" } ]; static getAttributeTypeMap() { diff --git a/src/infrastructure/model/mosaicDefinitionDTO.ts b/src/infrastructure/model/mosaicDefinitionDTO.ts index a4582269be..15f875c91b 100644 --- a/src/infrastructure/model/mosaicDefinitionDTO.ts +++ b/src/infrastructure/model/mosaicDefinitionDTO.ts @@ -17,7 +17,7 @@ * Catapult REST Endpoints * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) * - * The version of the OpenAPI document: 0.7.16 + * The version of the OpenAPI document: 0.7.17 * * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). @@ -31,12 +31,9 @@ export class MosaicDefinitionDTO { 'mosaicId': Array; 'supply': Array; 'height': Array; - /** - * The public key of the mosaic owner. - */ 'owner': string; /** - * The number of definitions for the same mosaic. + * Number of definitions for the same mosaic. */ 'revision': number; 'properties': Array; diff --git a/src/infrastructure/model/mosaicDefinitionTransactionBodyDTO.ts b/src/infrastructure/model/mosaicDefinitionTransactionBodyDTO.ts new file mode 100644 index 0000000000..24d54d75bf --- /dev/null +++ b/src/infrastructure/model/mosaicDefinitionTransactionBodyDTO.ts @@ -0,0 +1,78 @@ +/* + * Copyright 2019 NEM + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +/** + * Catapult REST Endpoints + * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) + * + * The version of the OpenAPI document: 0.7.18 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +export class MosaicDefinitionTransactionBodyDTO { + /** + * Random nonce used to generate the mosaic id. + */ + 'nonce': number; + 'id': Array; + /** + * - 0x00 (none) - No flags present. - 0x01 (supplyMutable) - Mosaic supports supply changes even when mosaic owner owns partial supply. - 0x02 (transferable) - Mosaic supports transfers between arbitrary accounts. When not set, mosaic can only be transferred to and from mosaic owner. - 0x04 (restrictable) - Mosaic supports custom restrictions configured by mosaic owner. + */ + 'flags'?: number; + /** + * Determines up to what decimal place the mosaic can be divided. Divisibility of 3 means that a mosaic can be divided into smallest parts of 0.001 mosaics. The divisibility must be in the range of 0 and 6. + */ + 'divisibility'?: number; + 'duration'?: Array; + + static discriminator: string | undefined = undefined; + + static attributeTypeMap: Array<{name: string, baseName: string, type: string}> = [ + { + "name": "nonce", + "baseName": "nonce", + "type": "number" + }, + { + "name": "id", + "baseName": "id", + "type": "Array" + }, + { + "name": "flags", + "baseName": "flags", + "type": "number" + }, + { + "name": "divisibility", + "baseName": "divisibility", + "type": "number" + }, + { + "name": "duration", + "baseName": "duration", + "type": "Array" + } ]; + + static getAttributeTypeMap() { + return MosaicDefinitionTransactionBodyDTO.attributeTypeMap; + } +} + diff --git a/src/infrastructure/model/mosaicDefinitionTransactionDTO.ts b/src/infrastructure/model/mosaicDefinitionTransactionDTO.ts new file mode 100644 index 0000000000..c47dd20ec2 --- /dev/null +++ b/src/infrastructure/model/mosaicDefinitionTransactionDTO.ts @@ -0,0 +1,122 @@ +/* + * Copyright 2019 NEM + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +/** + * Catapult REST Endpoints + * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) + * + * The version of the OpenAPI document: 0.7.18 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + +import { MosaicDefinitionTransactionBodyDTO } from './mosaicDefinitionTransactionBodyDTO'; +import { TransactionDTO } from './transactionDTO'; + +/** +* Transaction to create a new mosaic. +*/ +export class MosaicDefinitionTransactionDTO { + 'signature': string; + 'signerPublicKey': string; + /** + * Entity version. The higher byte represents the network identifier: * 0x68 (MAIN_NET) - Public main network. * 0x98 (TEST_NET) - Public test network. * 0x60 (MIJIN) - Private network. * 0x90 (MIJIN_TEST) - Private test network. + */ + 'version': number; + 'type': number; + 'maxFee': Array; + 'deadline': Array; + /** + * Random nonce used to generate the mosaic id. + */ + 'nonce': number; + 'id': Array; + /** + * - 0x00 (none) - No flags present. - 0x01 (supplyMutable) - Mosaic supports supply changes even when mosaic owner owns partial supply. - 0x02 (transferable) - Mosaic supports transfers between arbitrary accounts. When not set, mosaic can only be transferred to and from mosaic owner. - 0x04 (restrictable) - Mosaic supports custom restrictions configured by mosaic owner. + */ + 'flags'?: number; + /** + * Determines up to what decimal place the mosaic can be divided. Divisibility of 3 means that a mosaic can be divided into smallest parts of 0.001 mosaics. The divisibility must be in the range of 0 and 6. + */ + 'divisibility'?: number; + 'duration'?: Array; + + static discriminator: string | undefined = undefined; + + static attributeTypeMap: Array<{name: string, baseName: string, type: string}> = [ + { + "name": "signature", + "baseName": "signature", + "type": "string" + }, + { + "name": "signerPublicKey", + "baseName": "signerPublicKey", + "type": "string" + }, + { + "name": "version", + "baseName": "version", + "type": "number" + }, + { + "name": "type", + "baseName": "type", + "type": "number" + }, + { + "name": "maxFee", + "baseName": "maxFee", + "type": "Array" + }, + { + "name": "deadline", + "baseName": "deadline", + "type": "Array" + }, + { + "name": "nonce", + "baseName": "nonce", + "type": "number" + }, + { + "name": "id", + "baseName": "id", + "type": "Array" + }, + { + "name": "flags", + "baseName": "flags", + "type": "number" + }, + { + "name": "divisibility", + "baseName": "divisibility", + "type": "number" + }, + { + "name": "duration", + "baseName": "duration", + "type": "Array" + } ]; + + static getAttributeTypeMap() { + return MosaicDefinitionTransactionDTO.attributeTypeMap; + } +} + diff --git a/src/infrastructure/model/mosaicFlagsEnum.ts b/src/infrastructure/model/mosaicFlagsEnum.ts new file mode 100644 index 0000000000..d0ed00ecc9 --- /dev/null +++ b/src/infrastructure/model/mosaicFlagsEnum.ts @@ -0,0 +1,37 @@ +/* + * Copyright 2019 NEM + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +/** + * Catapult REST Endpoints + * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) + * + * The version of the OpenAPI document: 0.7.18 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +/** +* Mosaic Flags: * 0x00 (none) - No flags present. * 0x01 (supplyMutable) - Mosaic supports supply changes even when mosaic owner owns partial supply. * 0x02 (transferable) - Mosaic supports transfers between arbitrary accounts. When not set, mosaic can only be transferred to and from mosaic owner. * 0x04 (restrictable) - Mosaic supports custom restrictions configured by mosaic owner. +*/ +export enum MosaicFlagsEnum { + NUMBER_0 = 0, + NUMBER_1 = 1, + NUMBER_2 = 2, + NUMBER_4 = 4 +} diff --git a/src/infrastructure/model/mosaicId.ts b/src/infrastructure/model/mosaicId.ts new file mode 100644 index 0000000000..3dc1aeaf4d --- /dev/null +++ b/src/infrastructure/model/mosaicId.ts @@ -0,0 +1,34 @@ +/* + * Copyright 2019 NEM + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +/** + * Catapult REST Endpoints + * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) + * + * The version of the OpenAPI document: 0.7.18 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +export class MosaicId extends Array { + + static discriminator: string | undefined = undefined; + +} + diff --git a/src/infrastructure/model/mosaicIds.ts b/src/infrastructure/model/mosaicIds.ts index 0cf86352e0..f554c12f2f 100644 --- a/src/infrastructure/model/mosaicIds.ts +++ b/src/infrastructure/model/mosaicIds.ts @@ -17,7 +17,7 @@ * Catapult REST Endpoints * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) * - * The version of the OpenAPI document: 0.7.16 + * The version of the OpenAPI document: 0.7.18 * * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). @@ -28,7 +28,7 @@ export class MosaicIds { /** - * The array of mosaic identifiers. + * Array of mosaic identifiers. */ 'mosaicIds'?: Array; diff --git a/src/infrastructure/model/mosaicInfoDTO.ts b/src/infrastructure/model/mosaicInfoDTO.ts index d3f22605f6..cbfac6cca6 100644 --- a/src/infrastructure/model/mosaicInfoDTO.ts +++ b/src/infrastructure/model/mosaicInfoDTO.ts @@ -17,7 +17,7 @@ * Catapult REST Endpoints * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) * - * The version of the OpenAPI document: 0.7.16 + * The version of the OpenAPI document: 0.7.18 * * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). @@ -25,25 +25,18 @@ * Do not edit the class manually. */ -import { MosaicDefinitionDTO } from './mosaicDefinitionDTO'; -import { MosaicMetaDTO } from './mosaicMetaDTO'; +import { MosaicDTO } from './mosaicDTO'; export class MosaicInfoDTO { - 'meta': MosaicMetaDTO; - 'mosaic': MosaicDefinitionDTO; + 'mosaic': MosaicDTO; static discriminator: string | undefined = undefined; static attributeTypeMap: Array<{name: string, baseName: string, type: string}> = [ - { - "name": "meta", - "baseName": "meta", - "type": "MosaicMetaDTO" - }, { "name": "mosaic", "baseName": "mosaic", - "type": "MosaicDefinitionDTO" + "type": "MosaicDTO" } ]; static getAttributeTypeMap() { diff --git a/src/infrastructure/model/mosaicMetaDTO.ts b/src/infrastructure/model/mosaicMetaDTO.ts index 845c13a39a..22af9d42ba 100644 --- a/src/infrastructure/model/mosaicMetaDTO.ts +++ b/src/infrastructure/model/mosaicMetaDTO.ts @@ -17,7 +17,7 @@ * Catapult REST Endpoints * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) * - * The version of the OpenAPI document: 0.7.16 + * The version of the OpenAPI document: 0.7.18 * * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). diff --git a/src/infrastructure/model/mosaicNamesDTO.ts b/src/infrastructure/model/mosaicNamesDTO.ts index e9413ce9be..ad61d50362 100644 --- a/src/infrastructure/model/mosaicNamesDTO.ts +++ b/src/infrastructure/model/mosaicNamesDTO.ts @@ -17,7 +17,7 @@ * Catapult REST Endpoints * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) * - * The version of the OpenAPI document: 0.7.16 + * The version of the OpenAPI document: 0.7.18 * * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). @@ -29,7 +29,7 @@ export class MosaicNamesDTO { 'mosaicId': Array; /** - * The mosaic linked namespace names. + * Mosaic linked namespace names. */ 'names': Array; diff --git a/src/infrastructure/model/mosaicPropertiesDTO.ts b/src/infrastructure/model/mosaicPropertiesDTO.ts new file mode 100644 index 0000000000..0f914d0f72 --- /dev/null +++ b/src/infrastructure/model/mosaicPropertiesDTO.ts @@ -0,0 +1,63 @@ +/* + * Copyright 2019 NEM + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +/** + * Catapult REST Endpoints + * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) + * + * The version of the OpenAPI document: 0.7.18 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +export class MosaicPropertiesDTO { + /** + * - 0x00 (none) - No flags present. - 0x01 (supplyMutable) - Mosaic supports supply changes even when mosaic owner owns partial supply. - 0x02 (transferable) - Mosaic supports transfers between arbitrary accounts. When not set, mosaic can only be transferred to and from mosaic owner. - 0x04 (restrictable) - Mosaic supports custom restrictions configured by mosaic owner. + */ + 'flags'?: number; + /** + * Determines up to what decimal place the mosaic can be divided. Divisibility of 3 means that a mosaic can be divided into smallest parts of 0.001 mosaics. The divisibility must be in the range of 0 and 6. + */ + 'divisibility'?: number; + 'duration'?: Array; + + static discriminator: string | undefined = undefined; + + static attributeTypeMap: Array<{name: string, baseName: string, type: string}> = [ + { + "name": "flags", + "baseName": "flags", + "type": "number" + }, + { + "name": "divisibility", + "baseName": "divisibility", + "type": "number" + }, + { + "name": "duration", + "baseName": "duration", + "type": "Array" + } ]; + + static getAttributeTypeMap() { + return MosaicPropertiesDTO.attributeTypeMap; + } +} + diff --git a/src/infrastructure/model/mosaicPropertyDTO.ts b/src/infrastructure/model/mosaicPropertyDTO.ts index 90f9bde59c..e4cdab62ad 100644 --- a/src/infrastructure/model/mosaicPropertyDTO.ts +++ b/src/infrastructure/model/mosaicPropertyDTO.ts @@ -17,7 +17,7 @@ * Catapult REST Endpoints * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) * - * The version of the OpenAPI document: 0.7.16 + * The version of the OpenAPI document: 0.7.17 * * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). diff --git a/src/infrastructure/model/mosaicPropertyIdEnum.ts b/src/infrastructure/model/mosaicPropertyIdEnum.ts index 6f739ec065..3ee5630832 100644 --- a/src/infrastructure/model/mosaicPropertyIdEnum.ts +++ b/src/infrastructure/model/mosaicPropertyIdEnum.ts @@ -17,7 +17,7 @@ * Catapult REST Endpoints * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) * - * The version of the OpenAPI document: 0.7.16 + * The version of the OpenAPI document: 0.7.17 * * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). @@ -27,17 +27,10 @@ /** -* The mosaic propery id means: * 0 - MosaicFlags * 1 - Divisibility * 2 - Duration +* Identifier of the mosaic property: * 0 - MosaicFlags * 1 - Divisibility * 2 - Duration */ -export class MosaicPropertyIdEnum { - - static discriminator: string | undefined = undefined; - - static attributeTypeMap: Array<{name: string, baseName: string, type: string}> = [ - ]; - - static getAttributeTypeMap() { - return MosaicPropertyIdEnum.attributeTypeMap; - } +export enum MosaicPropertyIdEnum { + NUMBER_0 = 0, + NUMBER_1 = 1, + NUMBER_2 = 2 } - diff --git a/src/infrastructure/model/mosaicRestrictionTypeEnum.ts b/src/infrastructure/model/mosaicRestrictionTypeEnum.ts new file mode 100644 index 0000000000..be33b36d3e --- /dev/null +++ b/src/infrastructure/model/mosaicRestrictionTypeEnum.ts @@ -0,0 +1,40 @@ +/* + * Copyright 2019 NEM + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +/** + * Catapult REST Endpoints + * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) + * + * The version of the OpenAPI document: 0.7.18 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +/** +* Type of mosaic restriction. * 0 - Uninitialized value indicating no restriction. * 1(EQ) - Allow if equal. * 2 (NE) - Allow if not equal. * 3 (LT) - Allow if less than. * 4 (LE) - Allow if less than or equal. * 5 (GT) - Allow if greater than. * 6 (GE) - Allow if greater than or equal. +*/ +export enum MosaicRestrictionTypeEnum { + NUMBER_0 = 0, + NUMBER_1 = 1, + NUMBER_2 = 2, + NUMBER_3 = 3, + NUMBER_4 = 4, + NUMBER_5 = 5, + NUMBER_6 = 6 +} diff --git a/src/infrastructure/model/mosaicSupplyChangeActionEnum.ts b/src/infrastructure/model/mosaicSupplyChangeActionEnum.ts new file mode 100644 index 0000000000..a0c465f65c --- /dev/null +++ b/src/infrastructure/model/mosaicSupplyChangeActionEnum.ts @@ -0,0 +1,35 @@ +/* + * Copyright 2019 NEM + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +/** + * Catapult REST Endpoints + * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) + * + * The version of the OpenAPI document: 0.7.18 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +/** +* Direction of the supply change: * 0 - Decrease. * 1 - Increase. +*/ +export enum MosaicSupplyChangeActionEnum { + NUMBER_0 = 0, + NUMBER_1 = 1 +} diff --git a/src/infrastructure/model/mosaicSupplyChangeDirectionEnum.ts b/src/infrastructure/model/mosaicSupplyChangeDirectionEnum.ts new file mode 100644 index 0000000000..b00e1b9ddc --- /dev/null +++ b/src/infrastructure/model/mosaicSupplyChangeDirectionEnum.ts @@ -0,0 +1,35 @@ +/* + * Copyright 2019 NEM + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +/** + * Catapult REST Endpoints + * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) + * + * The version of the OpenAPI document: 0.7.17 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +/** +* Direction of mosaic supply change: * 0 - Decrease. * 1 - Increase. +*/ +export enum MosaicSupplyChangeDirectionEnum { + NUMBER_0 = 0, + NUMBER_1 = 1 +} diff --git a/src/infrastructure/model/mosaicSupplyChangeTransactionBodyDTO.ts b/src/infrastructure/model/mosaicSupplyChangeTransactionBodyDTO.ts new file mode 100644 index 0000000000..b08e1eccaa --- /dev/null +++ b/src/infrastructure/model/mosaicSupplyChangeTransactionBodyDTO.ts @@ -0,0 +1,58 @@ +/* + * Copyright 2019 NEM + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +/** + * Catapult REST Endpoints + * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) + * + * The version of the OpenAPI document: 0.7.18 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + +import { MosaicSupplyChangeActionEnum } from './mosaicSupplyChangeActionEnum'; + +export class MosaicSupplyChangeTransactionBodyDTO { + 'mosaicId': Array; + 'action': MosaicSupplyChangeActionEnum; + 'delta': Array; + + static discriminator: string | undefined = undefined; + + static attributeTypeMap: Array<{name: string, baseName: string, type: string}> = [ + { + "name": "mosaicId", + "baseName": "mosaicId", + "type": "Array" + }, + { + "name": "action", + "baseName": "action", + "type": "MosaicSupplyChangeActionEnum" + }, + { + "name": "delta", + "baseName": "delta", + "type": "Array" + } ]; + + static getAttributeTypeMap() { + return MosaicSupplyChangeTransactionBodyDTO.attributeTypeMap; + } +} + diff --git a/src/infrastructure/model/mosaicSupplyChangeTransactionDTO.ts b/src/infrastructure/model/mosaicSupplyChangeTransactionDTO.ts new file mode 100644 index 0000000000..1153b87dda --- /dev/null +++ b/src/infrastructure/model/mosaicSupplyChangeTransactionDTO.ts @@ -0,0 +1,102 @@ +/* + * Copyright 2019 NEM + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +/** + * Catapult REST Endpoints + * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) + * + * The version of the OpenAPI document: 0.7.18 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + +import { MosaicSupplyChangeActionEnum } from './mosaicSupplyChangeActionEnum'; +import { MosaicSupplyChangeTransactionBodyDTO } from './mosaicSupplyChangeTransactionBodyDTO'; +import { TransactionDTO } from './transactionDTO'; + +/** +* Transaction to increase or decrease the supply of a mosaic. +*/ +export class MosaicSupplyChangeTransactionDTO { + 'signature': string; + 'signerPublicKey': string; + /** + * Entity version. The higher byte represents the network identifier: * 0x68 (MAIN_NET) - Public main network. * 0x98 (TEST_NET) - Public test network. * 0x60 (MIJIN) - Private network. * 0x90 (MIJIN_TEST) - Private test network. + */ + 'version': number; + 'type': number; + 'maxFee': Array; + 'deadline': Array; + 'mosaicId': Array; + 'action': MosaicSupplyChangeActionEnum; + 'delta': Array; + + static discriminator: string | undefined = undefined; + + static attributeTypeMap: Array<{name: string, baseName: string, type: string}> = [ + { + "name": "signature", + "baseName": "signature", + "type": "string" + }, + { + "name": "signerPublicKey", + "baseName": "signerPublicKey", + "type": "string" + }, + { + "name": "version", + "baseName": "version", + "type": "number" + }, + { + "name": "type", + "baseName": "type", + "type": "number" + }, + { + "name": "maxFee", + "baseName": "maxFee", + "type": "Array" + }, + { + "name": "deadline", + "baseName": "deadline", + "type": "Array" + }, + { + "name": "mosaicId", + "baseName": "mosaicId", + "type": "Array" + }, + { + "name": "action", + "baseName": "action", + "type": "MosaicSupplyChangeActionEnum" + }, + { + "name": "delta", + "baseName": "delta", + "type": "Array" + } ]; + + static getAttributeTypeMap() { + return MosaicSupplyChangeTransactionDTO.attributeTypeMap; + } +} + diff --git a/src/infrastructure/model/mosaicsNamesDTO.ts b/src/infrastructure/model/mosaicsNamesDTO.ts new file mode 100644 index 0000000000..046c1b14a6 --- /dev/null +++ b/src/infrastructure/model/mosaicsNamesDTO.ts @@ -0,0 +1,49 @@ +/* + * Copyright 2019 NEM + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +/** + * Catapult REST Endpoints + * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) + * + * The version of the OpenAPI document: 0.7.18 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + +import { MosaicNamesDTO } from './mosaicNamesDTO'; + +export class MosaicsNamesDTO { + /** + * Array of mosaic names. + */ + 'accountNames': Array; + + static discriminator: string | undefined = undefined; + + static attributeTypeMap: Array<{name: string, baseName: string, type: string}> = [ + { + "name": "accountNames", + "baseName": "accountNames", + "type": "Array" + } ]; + + static getAttributeTypeMap() { + return MosaicsNamesDTO.attributeTypeMap; + } +} + diff --git a/src/infrastructure/model/multisigAccountGraphInfoDTO.ts b/src/infrastructure/model/multisigAccountGraphInfoDTO.ts index d004a7ce63..cf9772b8a8 100644 --- a/src/infrastructure/model/multisigAccountGraphInfoDTO.ts +++ b/src/infrastructure/model/multisigAccountGraphInfoDTO.ts @@ -17,7 +17,7 @@ * Catapult REST Endpoints * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) * - * The version of the OpenAPI document: 0.7.16 + * The version of the OpenAPI document: 0.7.18 * * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). @@ -29,11 +29,11 @@ import { MultisigAccountInfoDTO } from './multisigAccountInfoDTO'; export class MultisigAccountGraphInfoDTO { /** - * The level of the multisig account. + * Level of the multisig account. */ 'level': number; /** - * The array of multisig accounts for this level. + * Array of multisig accounts for this level. */ 'multisigEntries': Array; diff --git a/src/infrastructure/model/multisigAccountInfoDTO.ts b/src/infrastructure/model/multisigAccountInfoDTO.ts index 59b5c8e55c..124f401523 100644 --- a/src/infrastructure/model/multisigAccountInfoDTO.ts +++ b/src/infrastructure/model/multisigAccountInfoDTO.ts @@ -17,7 +17,7 @@ * Catapult REST Endpoints * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) * - * The version of the OpenAPI document: 0.7.16 + * The version of the OpenAPI document: 0.7.18 * * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). diff --git a/src/infrastructure/model/multisigAccountModificationTransactionBodyDTO.ts b/src/infrastructure/model/multisigAccountModificationTransactionBodyDTO.ts new file mode 100644 index 0000000000..f3c66ed277 --- /dev/null +++ b/src/infrastructure/model/multisigAccountModificationTransactionBodyDTO.ts @@ -0,0 +1,67 @@ +/* + * Copyright 2019 NEM + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +/** + * Catapult REST Endpoints + * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) + * + * The version of the OpenAPI document: 0.7.18 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + +import { CosignatoryModificationDTO } from './cosignatoryModificationDTO'; + +export class MultisigAccountModificationTransactionBodyDTO { + /** + * Number of signatures needed to remove a cosignatory. If we are modifying an existing multisig account, this indicates the relative change of the minimum cosignatories. + */ + 'minRemovalDelta': number; + /** + * Number of signatures needed to approve a transaction. If we are modifying an existing multisig account, this indicates the relative change of the minimum cosignatories. + */ + 'minApprovalDelta': number; + /** + * Array of cosignatory accounts to add or delete. + */ + 'modifications': Array; + + static discriminator: string | undefined = undefined; + + static attributeTypeMap: Array<{name: string, baseName: string, type: string}> = [ + { + "name": "minRemovalDelta", + "baseName": "minRemovalDelta", + "type": "number" + }, + { + "name": "minApprovalDelta", + "baseName": "minApprovalDelta", + "type": "number" + }, + { + "name": "modifications", + "baseName": "modifications", + "type": "Array" + } ]; + + static getAttributeTypeMap() { + return MultisigAccountModificationTransactionBodyDTO.attributeTypeMap; + } +} + diff --git a/src/infrastructure/model/multisigAccountModificationTransactionDTO.ts b/src/infrastructure/model/multisigAccountModificationTransactionDTO.ts new file mode 100644 index 0000000000..15b582cedc --- /dev/null +++ b/src/infrastructure/model/multisigAccountModificationTransactionDTO.ts @@ -0,0 +1,111 @@ +/* + * Copyright 2019 NEM + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +/** + * Catapult REST Endpoints + * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) + * + * The version of the OpenAPI document: 0.7.18 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + +import { CosignatoryModificationDTO } from './cosignatoryModificationDTO'; +import { MultisigAccountModificationTransactionBodyDTO } from './multisigAccountModificationTransactionBodyDTO'; +import { TransactionDTO } from './transactionDTO'; + +/** +* Transaction to create or modify a multisig account. +*/ +export class MultisigAccountModificationTransactionDTO { + 'signature': string; + 'signerPublicKey': string; + /** + * Entity version. The higher byte represents the network identifier: * 0x68 (MAIN_NET) - Public main network. * 0x98 (TEST_NET) - Public test network. * 0x60 (MIJIN) - Private network. * 0x90 (MIJIN_TEST) - Private test network. + */ + 'version': number; + 'type': number; + 'maxFee': Array; + 'deadline': Array; + /** + * Number of signatures needed to remove a cosignatory. If we are modifying an existing multisig account, this indicates the relative change of the minimum cosignatories. + */ + 'minRemovalDelta': number; + /** + * Number of signatures needed to approve a transaction. If we are modifying an existing multisig account, this indicates the relative change of the minimum cosignatories. + */ + 'minApprovalDelta': number; + /** + * Array of cosignatory accounts to add or delete. + */ + 'modifications': Array; + + static discriminator: string | undefined = undefined; + + static attributeTypeMap: Array<{name: string, baseName: string, type: string}> = [ + { + "name": "signature", + "baseName": "signature", + "type": "string" + }, + { + "name": "signerPublicKey", + "baseName": "signerPublicKey", + "type": "string" + }, + { + "name": "version", + "baseName": "version", + "type": "number" + }, + { + "name": "type", + "baseName": "type", + "type": "number" + }, + { + "name": "maxFee", + "baseName": "maxFee", + "type": "Array" + }, + { + "name": "deadline", + "baseName": "deadline", + "type": "Array" + }, + { + "name": "minRemovalDelta", + "baseName": "minRemovalDelta", + "type": "number" + }, + { + "name": "minApprovalDelta", + "baseName": "minApprovalDelta", + "type": "number" + }, + { + "name": "modifications", + "baseName": "modifications", + "type": "Array" + } ]; + + static getAttributeTypeMap() { + return MultisigAccountModificationTransactionDTO.attributeTypeMap; + } +} + diff --git a/src/infrastructure/model/multisigDTO.ts b/src/infrastructure/model/multisigDTO.ts index 011353a2f3..f966bfcc7e 100644 --- a/src/infrastructure/model/multisigDTO.ts +++ b/src/infrastructure/model/multisigDTO.ts @@ -17,7 +17,7 @@ * Catapult REST Endpoints * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) * - * The version of the OpenAPI document: 0.7.16 + * The version of the OpenAPI document: 0.7.18 * * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). @@ -27,37 +27,34 @@ export class MultisigDTO { + 'accountPublicKey': string; /** - * The account public key. + * Decoded address. */ - 'account': string; + 'accountAddress': string; /** - * The account address in hexadecimal. - */ - 'accountAddress'?: string; - /** - * The number of signatures needed to approve a transaction. + * Number of signatures needed to approve a transaction. */ 'minApproval': number; /** - * The number of signatures needed to remove a cosignatory. + * Number of signatures needed to remove a cosignatory. */ 'minRemoval': number; /** - * The array of public keys of the cosignatory accounts. + * Array of public keys of the cosignatory accounts. */ - 'cosignatories': Array; + 'cosignatoryPublicKeys': Array; /** - * The array of multisig accounts where the account is cosignatory. + * Array of multisig accounts where the account is cosignatory. */ - 'multisigAccounts': Array; + 'multisigPublicKeys': Array; static discriminator: string | undefined = undefined; static attributeTypeMap: Array<{name: string, baseName: string, type: string}> = [ { - "name": "account", - "baseName": "account", + "name": "accountPublicKey", + "baseName": "accountPublicKey", "type": "string" }, { @@ -76,13 +73,13 @@ export class MultisigDTO { "type": "number" }, { - "name": "cosignatories", - "baseName": "cosignatories", + "name": "cosignatoryPublicKeys", + "baseName": "cosignatoryPublicKeys", "type": "Array" }, { - "name": "multisigAccounts", - "baseName": "multisigAccounts", + "name": "multisigPublicKeys", + "baseName": "multisigPublicKeys", "type": "Array" } ]; diff --git a/src/infrastructure/model/multisigModificationTypeEnum.ts b/src/infrastructure/model/multisigModificationTypeEnum.ts index 3107b46071..1b32f9e4c7 100644 --- a/src/infrastructure/model/multisigModificationTypeEnum.ts +++ b/src/infrastructure/model/multisigModificationTypeEnum.ts @@ -17,7 +17,7 @@ * Catapult REST Endpoints * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) * - * The version of the OpenAPI document: 0.7.16 + * The version of the OpenAPI document: 0.7.17 * * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). @@ -27,17 +27,9 @@ /** -* The type of the modification: * 0 - Add cosignatory. * 1 - Remove cosignatory. +* Type of modification: * 0 - Add cosignatory. * 1 - Remove cosignatory. */ -export class MultisigModificationTypeEnum { - - static discriminator: string | undefined = undefined; - - static attributeTypeMap: Array<{name: string, baseName: string, type: string}> = [ - ]; - - static getAttributeTypeMap() { - return MultisigModificationTypeEnum.attributeTypeMap; - } +export enum MultisigModificationTypeEnum { + NUMBER_0 = 0, + NUMBER_1 = 1 } - diff --git a/src/infrastructure/model/namespaceDTO.ts b/src/infrastructure/model/namespaceDTO.ts index 68f20c9d7b..29039daa20 100644 --- a/src/infrastructure/model/namespaceDTO.ts +++ b/src/infrastructure/model/namespaceDTO.ts @@ -17,7 +17,7 @@ * Catapult REST Endpoints * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) * - * The version of the OpenAPI document: 0.7.16 + * The version of the OpenAPI document: 0.7.18 * * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). @@ -26,52 +26,34 @@ */ import { AliasDTO } from './aliasDTO'; -import { NamespaceTypeEnum } from './namespaceTypeEnum'; +import { NamespaceRegistrationTypeEnum } from './namespaceRegistrationTypeEnum'; export class NamespaceDTO { + 'registrationType': NamespaceRegistrationTypeEnum; /** - * The public key of the owner of the namespace. - */ - 'owner': string; - /** - * The address of the owner of the namespace in hexadecimal. - */ - 'ownerAddress': string; - 'startHeight': Array; - 'endHeight': Array; - /** - * The level of the namespace. + * Level of the namespace. */ 'depth': number; 'level0': Array; 'level1'?: Array; 'level2'?: Array; - 'type': NamespaceTypeEnum; 'alias': AliasDTO; 'parentId': Array; + 'ownerPublicKey': string; + /** + * Decoded address. + */ + 'ownerAddress': string; + 'startHeight': Array; + 'endHeight': Array; static discriminator: string | undefined = undefined; static attributeTypeMap: Array<{name: string, baseName: string, type: string}> = [ { - "name": "owner", - "baseName": "owner", - "type": "string" - }, - { - "name": "ownerAddress", - "baseName": "ownerAddress", - "type": "string" - }, - { - "name": "startHeight", - "baseName": "startHeight", - "type": "Array" - }, - { - "name": "endHeight", - "baseName": "endHeight", - "type": "Array" + "name": "registrationType", + "baseName": "registrationType", + "type": "NamespaceRegistrationTypeEnum" }, { "name": "depth", @@ -93,11 +75,6 @@ export class NamespaceDTO { "baseName": "level2", "type": "Array" }, - { - "name": "type", - "baseName": "type", - "type": "NamespaceTypeEnum" - }, { "name": "alias", "baseName": "alias", @@ -107,6 +84,26 @@ export class NamespaceDTO { "name": "parentId", "baseName": "parentId", "type": "Array" + }, + { + "name": "ownerPublicKey", + "baseName": "ownerPublicKey", + "type": "string" + }, + { + "name": "ownerAddress", + "baseName": "ownerAddress", + "type": "string" + }, + { + "name": "startHeight", + "baseName": "startHeight", + "type": "Array" + }, + { + "name": "endHeight", + "baseName": "endHeight", + "type": "Array" } ]; static getAttributeTypeMap() { diff --git a/src/infrastructure/model/namespaceId.ts b/src/infrastructure/model/namespaceId.ts new file mode 100644 index 0000000000..dea7b3c938 --- /dev/null +++ b/src/infrastructure/model/namespaceId.ts @@ -0,0 +1,34 @@ +/* + * Copyright 2019 NEM + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +/** + * Catapult REST Endpoints + * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) + * + * The version of the OpenAPI document: 0.7.18 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +export class NamespaceId extends Array { + + static discriminator: string | undefined = undefined; + +} + diff --git a/src/infrastructure/model/namespaceIds.ts b/src/infrastructure/model/namespaceIds.ts index 24f633f1c4..613c168f0f 100644 --- a/src/infrastructure/model/namespaceIds.ts +++ b/src/infrastructure/model/namespaceIds.ts @@ -17,7 +17,7 @@ * Catapult REST Endpoints * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) * - * The version of the OpenAPI document: 0.7.16 + * The version of the OpenAPI document: 0.7.18 * * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). @@ -28,7 +28,7 @@ export class NamespaceIds { /** - * The array of namespace identifiers. + * Array of namespace identifiers. */ 'namespaceIds'?: Array; diff --git a/src/infrastructure/model/namespaceInfoDTO.ts b/src/infrastructure/model/namespaceInfoDTO.ts index dceebf799a..547389c563 100644 --- a/src/infrastructure/model/namespaceInfoDTO.ts +++ b/src/infrastructure/model/namespaceInfoDTO.ts @@ -17,7 +17,7 @@ * Catapult REST Endpoints * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) * - * The version of the OpenAPI document: 0.7.16 + * The version of the OpenAPI document: 0.7.18 * * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). diff --git a/src/infrastructure/model/namespaceMetaDTO.ts b/src/infrastructure/model/namespaceMetaDTO.ts index cb6640b594..7adb8828aa 100644 --- a/src/infrastructure/model/namespaceMetaDTO.ts +++ b/src/infrastructure/model/namespaceMetaDTO.ts @@ -17,7 +17,7 @@ * Catapult REST Endpoints * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) * - * The version of the OpenAPI document: 0.7.16 + * The version of the OpenAPI document: 0.7.18 * * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). diff --git a/src/infrastructure/model/namespaceNameDTO.ts b/src/infrastructure/model/namespaceNameDTO.ts index 7cd704e180..dab03546e4 100644 --- a/src/infrastructure/model/namespaceNameDTO.ts +++ b/src/infrastructure/model/namespaceNameDTO.ts @@ -17,7 +17,7 @@ * Catapult REST Endpoints * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) * - * The version of the OpenAPI document: 0.7.16 + * The version of the OpenAPI document: 0.7.18 * * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). @@ -30,7 +30,7 @@ export class NamespaceNameDTO { 'parentId'?: Array; 'namespaceId': Array; /** - * The name of the namespace. + * Namespace name. */ 'name': string; diff --git a/src/infrastructure/model/namespaceRegistrationTransactionBodyDTO.ts b/src/infrastructure/model/namespaceRegistrationTransactionBodyDTO.ts new file mode 100644 index 0000000000..de50865b73 --- /dev/null +++ b/src/infrastructure/model/namespaceRegistrationTransactionBodyDTO.ts @@ -0,0 +1,73 @@ +/* + * Copyright 2019 NEM + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +/** + * Catapult REST Endpoints + * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) + * + * The version of the OpenAPI document: 0.7.18 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + +import { NamespaceRegistrationTypeEnum } from './namespaceRegistrationTypeEnum'; + +export class NamespaceRegistrationTransactionBodyDTO { + 'registrationType': NamespaceRegistrationTypeEnum; + 'duration': Array; + 'parentId': Array; + 'id': Array; + /** + * Namespace name. + */ + 'name': string; + + static discriminator: string | undefined = undefined; + + static attributeTypeMap: Array<{name: string, baseName: string, type: string}> = [ + { + "name": "registrationType", + "baseName": "registrationType", + "type": "NamespaceRegistrationTypeEnum" + }, + { + "name": "duration", + "baseName": "duration", + "type": "Array" + }, + { + "name": "parentId", + "baseName": "parentId", + "type": "Array" + }, + { + "name": "id", + "baseName": "id", + "type": "Array" + }, + { + "name": "name", + "baseName": "name", + "type": "string" + } ]; + + static getAttributeTypeMap() { + return NamespaceRegistrationTransactionBodyDTO.attributeTypeMap; + } +} + diff --git a/src/infrastructure/model/namespaceRegistrationTransactionDTO.ts b/src/infrastructure/model/namespaceRegistrationTransactionDTO.ts new file mode 100644 index 0000000000..9070bb4551 --- /dev/null +++ b/src/infrastructure/model/namespaceRegistrationTransactionDTO.ts @@ -0,0 +1,117 @@ +/* + * Copyright 2019 NEM + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +/** + * Catapult REST Endpoints + * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) + * + * The version of the OpenAPI document: 0.7.18 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + +import { NamespaceRegistrationTransactionBodyDTO } from './namespaceRegistrationTransactionBodyDTO'; +import { NamespaceRegistrationTypeEnum } from './namespaceRegistrationTypeEnum'; +import { TransactionDTO } from './transactionDTO'; + +/** +* Transaction to create or renew a namespace. +*/ +export class NamespaceRegistrationTransactionDTO { + 'signature': string; + 'signerPublicKey': string; + /** + * Entity version. The higher byte represents the network identifier: * 0x68 (MAIN_NET) - Public main network. * 0x98 (TEST_NET) - Public test network. * 0x60 (MIJIN) - Private network. * 0x90 (MIJIN_TEST) - Private test network. + */ + 'version': number; + 'type': number; + 'maxFee': Array; + 'deadline': Array; + 'registrationType': NamespaceRegistrationTypeEnum; + 'duration': Array; + 'parentId': Array; + 'id': Array; + /** + * Namespace name. + */ + 'name': string; + + static discriminator: string | undefined = undefined; + + static attributeTypeMap: Array<{name: string, baseName: string, type: string}> = [ + { + "name": "signature", + "baseName": "signature", + "type": "string" + }, + { + "name": "signerPublicKey", + "baseName": "signerPublicKey", + "type": "string" + }, + { + "name": "version", + "baseName": "version", + "type": "number" + }, + { + "name": "type", + "baseName": "type", + "type": "number" + }, + { + "name": "maxFee", + "baseName": "maxFee", + "type": "Array" + }, + { + "name": "deadline", + "baseName": "deadline", + "type": "Array" + }, + { + "name": "registrationType", + "baseName": "registrationType", + "type": "NamespaceRegistrationTypeEnum" + }, + { + "name": "duration", + "baseName": "duration", + "type": "Array" + }, + { + "name": "parentId", + "baseName": "parentId", + "type": "Array" + }, + { + "name": "id", + "baseName": "id", + "type": "Array" + }, + { + "name": "name", + "baseName": "name", + "type": "string" + } ]; + + static getAttributeTypeMap() { + return NamespaceRegistrationTransactionDTO.attributeTypeMap; + } +} + diff --git a/src/infrastructure/model/namespaceRegistrationTypeEnum.ts b/src/infrastructure/model/namespaceRegistrationTypeEnum.ts new file mode 100644 index 0000000000..437b1494c8 --- /dev/null +++ b/src/infrastructure/model/namespaceRegistrationTypeEnum.ts @@ -0,0 +1,35 @@ +/* + * Copyright 2019 NEM + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +/** + * Catapult REST Endpoints + * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) + * + * The version of the OpenAPI document: 0.7.18 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +/** +* Type of namespace: * 0 - Root namespace. * 1 - Subnamespace. +*/ +export enum NamespaceRegistrationTypeEnum { + NUMBER_0 = 0, + NUMBER_1 = 1 +} diff --git a/src/infrastructure/model/namespaceTypeEnum.ts b/src/infrastructure/model/namespaceTypeEnum.ts index 9e78121039..0a3f387bac 100644 --- a/src/infrastructure/model/namespaceTypeEnum.ts +++ b/src/infrastructure/model/namespaceTypeEnum.ts @@ -17,7 +17,7 @@ * Catapult REST Endpoints * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) * - * The version of the OpenAPI document: 0.7.16 + * The version of the OpenAPI document: 0.7.17 * * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). @@ -27,17 +27,9 @@ /** -* The namespace type: * 0 - Root namespace. * 1 - Subnamespace. +* Type of namespace: * 0 - Root namespace. * 1 - Subnamespace. */ -export class NamespaceTypeEnum { - - static discriminator: string | undefined = undefined; - - static attributeTypeMap: Array<{name: string, baseName: string, type: string}> = [ - ]; - - static getAttributeTypeMap() { - return NamespaceTypeEnum.attributeTypeMap; - } +export enum NamespaceTypeEnum { + NUMBER_0 = 0, + NUMBER_1 = 1 } - diff --git a/src/infrastructure/model/networkTypeDTO.ts b/src/infrastructure/model/networkTypeDTO.ts index 0df44f1af7..fa6605c537 100644 --- a/src/infrastructure/model/networkTypeDTO.ts +++ b/src/infrastructure/model/networkTypeDTO.ts @@ -17,7 +17,7 @@ * Catapult REST Endpoints * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) * - * The version of the OpenAPI document: 0.7.16 + * The version of the OpenAPI document: 0.7.18 * * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). @@ -28,7 +28,7 @@ export class NetworkTypeDTO { /** - * The name of the network. + * Network name. */ 'name': string; /** diff --git a/src/infrastructure/model/nodeInfoDTO.ts b/src/infrastructure/model/nodeInfoDTO.ts index a44c736793..9b22f69a0a 100644 --- a/src/infrastructure/model/nodeInfoDTO.ts +++ b/src/infrastructure/model/nodeInfoDTO.ts @@ -17,7 +17,7 @@ * Catapult REST Endpoints * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) * - * The version of the OpenAPI document: 0.7.16 + * The version of the OpenAPI document: 0.7.18 * * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). @@ -28,26 +28,23 @@ import { RolesTypeEnum } from './rolesTypeEnum'; export class NodeInfoDTO { - /** - * The public key used to identify the node. - */ 'publicKey': string; /** - * The port used for the communication. + * Port used for the communication. */ 'port': number; 'networkIdentifier': number; /** - * The version of the application. + * Version of the application. */ 'version': number; 'roles': RolesTypeEnum; /** - * The IP address of the endpoint. + * Node IP address. */ 'host': string; /** - * The name of the node. + * Node friendly name. */ 'friendlyName': string; diff --git a/src/infrastructure/model/nodeTimeDTO.ts b/src/infrastructure/model/nodeTimeDTO.ts index dda0b6eaa4..6862cf6500 100644 --- a/src/infrastructure/model/nodeTimeDTO.ts +++ b/src/infrastructure/model/nodeTimeDTO.ts @@ -17,7 +17,7 @@ * Catapult REST Endpoints * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) * - * The version of the OpenAPI document: 0.7.16 + * The version of the OpenAPI document: 0.7.18 * * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). @@ -25,10 +25,10 @@ * Do not edit the class manually. */ -import { CommunicationTimestamps } from './communicationTimestamps'; +import { CommunicationTimestampsDTO } from './communicationTimestampsDTO'; export class NodeTimeDTO { - 'communicationTimestamps': CommunicationTimestamps; + 'communicationTimestamps': CommunicationTimestampsDTO; static discriminator: string | undefined = undefined; @@ -36,7 +36,7 @@ export class NodeTimeDTO { { "name": "communicationTimestamps", "baseName": "communicationTimestamps", - "type": "CommunicationTimestamps" + "type": "CommunicationTimestampsDTO" } ]; static getAttributeTypeMap() { diff --git a/src/infrastructure/model/receiptDTO.ts b/src/infrastructure/model/receiptDTO.ts new file mode 100644 index 0000000000..d0c1932d17 --- /dev/null +++ b/src/infrastructure/model/receiptDTO.ts @@ -0,0 +1,55 @@ +/* + * Copyright 2019 NEM + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +/** + * Catapult REST Endpoints + * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) + * + * The version of the OpenAPI document: 0.7.18 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + +import { ReceiptTypeEnum } from './receiptTypeEnum'; + +export class ReceiptDTO { + /** + * Version of the receipt. + */ + 'version': number; + 'type': ReceiptTypeEnum; + + static discriminator: string | undefined = undefined; + + static attributeTypeMap: Array<{name: string, baseName: string, type: string}> = [ + { + "name": "version", + "baseName": "version", + "type": "number" + }, + { + "name": "type", + "baseName": "type", + "type": "ReceiptTypeEnum" + } ]; + + static getAttributeTypeMap() { + return ReceiptDTO.attributeTypeMap; + } +} + diff --git a/src/infrastructure/model/receiptTypeEnum.ts b/src/infrastructure/model/receiptTypeEnum.ts index 7c2b4981fa..5c8e58eff8 100644 --- a/src/infrastructure/model/receiptTypeEnum.ts +++ b/src/infrastructure/model/receiptTypeEnum.ts @@ -17,7 +17,7 @@ * Catapult REST Endpoints * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) * - * The version of the OpenAPI document: 0.7.16 + * The version of the OpenAPI document: 0.7.18 * * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). @@ -27,17 +27,21 @@ /** -* The type of the receipt: * 0x134D (4941 decimal) - Mosaic_Rental_Fee. * 0x124E (4686 decimal) - Namespace_Rental_Fee. * 0x2143 (8515 decimal) - Harvest_Fee. * 0x2248 (8776 decimal) - LockHash_Completed. * 0x2348 (9032 decimal) - LockHash_Expired. * 0x2252 (8786 decimal) - LockSecret_Completed. * 0x2352 (9042 decimal) - LockSecret_Expired. * 0x3148 (12616 decimal) - LockHash_Created. * 0x3152 (12626 decimal) - LockSecret_Created. * 0x414D (16717 decimal) - Mosaic_Expired. * 0x414E (16718 decimal) - Namespace_Expired. * 0x5143 (20803 decimal) - Inflation. * 0xE134 (57652 decimal) - Transaction_Group. * 0xF143 (61763 decimal) - Address_Alias_Resolution. * 0xF243 (62019 decimal) - Mosaic_Alias_Resolution. +* Type of receipt: * 0x124D (4685 decimal) - Mosaic_Rental_Fee. * 0x134E (4942 decimal) - Namespace_Rental_Fee. * 0x2143 (8515 decimal) - Harvest_Fee. * 0x2248 (8776 decimal) - LockHash_Completed. * 0x2348 (9032 decimal) - LockHash_Expired. * 0x2252 (8786 decimal) - LockSecret_Completed. * 0x2352 (9042 decimal) - LockSecret_Expired. * 0x3148 (12616 decimal) - LockHash_Created. * 0x3152 (12626 decimal) - LockSecret_Created. * 0x414D (16717 decimal) - Mosaic_Expired. * 0x414E (16718 decimal) - Namespace_Expired. * 0x424E (16974 decimal) - Namespace_Deleted. * 0x5143 (20803 decimal) - Inflation. * 0xE134 (57652 decimal) - Transaction_Group. * 0xF143 (61763 decimal) - Address_Alias_Resolution. * 0xF243 (62019 decimal) - Mosaic_Alias_Resolution. */ -export class ReceiptTypeEnum { - - static discriminator: string | undefined = undefined; - - static attributeTypeMap: Array<{name: string, baseName: string, type: string}> = [ - ]; - - static getAttributeTypeMap() { - return ReceiptTypeEnum.attributeTypeMap; - } +export enum ReceiptTypeEnum { + NUMBER_4685 = 4685, + NUMBER_4942 = 4942, + NUMBER_8515 = 8515, + NUMBER_8776 = 8776, + NUMBER_9042 = 9042, + NUMBER_12616 = 12616, + NUMBER_12626 = 12626, + NUMBER_16717 = 16717, + NUMBER_16718 = 16718, + NUMBER_16974 = 16974, + NUMBER_20803 = 20803, + NUMBER_57652 = 57652, + NUMBER_61763 = 61763, + NUMBER_62019 = 62019 } - diff --git a/src/infrastructure/model/registerNamespaceTransactionBodyDTO.ts b/src/infrastructure/model/registerNamespaceTransactionBodyDTO.ts new file mode 100644 index 0000000000..f9a83e6357 --- /dev/null +++ b/src/infrastructure/model/registerNamespaceTransactionBodyDTO.ts @@ -0,0 +1,73 @@ +/* + * Copyright 2019 NEM + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +/** + * Catapult REST Endpoints + * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) + * + * The version of the OpenAPI document: 0.7.17 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + +import { NamespaceTypeEnum } from './namespaceTypeEnum'; + +export class RegisterNamespaceTransactionBodyDTO { + 'namespaceType': NamespaceTypeEnum; + 'duration': Array; + 'namespaceId': Array; + /** + * Namespace name. + */ + 'name': string; + 'parentId': Array; + + static discriminator: string | undefined = undefined; + + static attributeTypeMap: Array<{name: string, baseName: string, type: string}> = [ + { + "name": "namespaceType", + "baseName": "namespaceType", + "type": "NamespaceTypeEnum" + }, + { + "name": "duration", + "baseName": "duration", + "type": "Array" + }, + { + "name": "namespaceId", + "baseName": "namespaceId", + "type": "Array" + }, + { + "name": "name", + "baseName": "name", + "type": "string" + }, + { + "name": "parentId", + "baseName": "parentId", + "type": "Array" + } ]; + + static getAttributeTypeMap() { + return RegisterNamespaceTransactionBodyDTO.attributeTypeMap; + } +} + diff --git a/src/infrastructure/model/registerNamespaceTransactionDTO.ts b/src/infrastructure/model/registerNamespaceTransactionDTO.ts new file mode 100644 index 0000000000..c964079be4 --- /dev/null +++ b/src/infrastructure/model/registerNamespaceTransactionDTO.ts @@ -0,0 +1,118 @@ +/* + * Copyright 2019 NEM + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +/** + * Catapult REST Endpoints + * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) + * + * The version of the OpenAPI document: 0.7.17 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + +import { EntityTypeEnum } from './entityTypeEnum'; +import { NamespaceTypeEnum } from './namespaceTypeEnum'; +import { RegisterNamespaceTransactionBodyDTO } from './registerNamespaceTransactionBodyDTO'; +import { TransactionDTO } from './transactionDTO'; + +/** +* Transaction to create or renew a namespace. +*/ +export class RegisterNamespaceTransactionDTO { + 'signature': string; + 'signer': string; + /** + * Entity version. The higher byte represents the network identifier: * 0x68 (MAIN_NET) - Public main network. * 0x98 (TEST_NET) - Public test network. * 0x60 (MIJIN) - Private network. * 0x90 (MIJIN_TEST) - Private test network. + */ + 'version': number; + 'type': EntityTypeEnum; + 'maxFee': Array; + 'deadline': Array; + 'namespaceType': NamespaceTypeEnum; + 'duration': Array; + 'namespaceId': Array; + /** + * Namespace name. + */ + 'name': string; + 'parentId': Array; + + static discriminator: string | undefined = undefined; + + static attributeTypeMap: Array<{name: string, baseName: string, type: string}> = [ + { + "name": "signature", + "baseName": "signature", + "type": "string" + }, + { + "name": "signer", + "baseName": "signer", + "type": "string" + }, + { + "name": "version", + "baseName": "version", + "type": "number" + }, + { + "name": "type", + "baseName": "type", + "type": "EntityTypeEnum" + }, + { + "name": "maxFee", + "baseName": "maxFee", + "type": "Array" + }, + { + "name": "deadline", + "baseName": "deadline", + "type": "Array" + }, + { + "name": "namespaceType", + "baseName": "namespaceType", + "type": "NamespaceTypeEnum" + }, + { + "name": "duration", + "baseName": "duration", + "type": "Array" + }, + { + "name": "namespaceId", + "baseName": "namespaceId", + "type": "Array" + }, + { + "name": "name", + "baseName": "name", + "type": "string" + }, + { + "name": "parentId", + "baseName": "parentId", + "type": "Array" + } ]; + + static getAttributeTypeMap() { + return RegisterNamespaceTransactionDTO.attributeTypeMap; + } +} + diff --git a/src/infrastructure/model/resolutionEntryDTO.ts b/src/infrastructure/model/resolutionEntryDTO.ts index e0f1328c48..cbd07c4340 100644 --- a/src/infrastructure/model/resolutionEntryDTO.ts +++ b/src/infrastructure/model/resolutionEntryDTO.ts @@ -17,7 +17,7 @@ * Catapult REST Endpoints * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) * - * The version of the OpenAPI document: 0.7.16 + * The version of the OpenAPI document: 0.7.18 * * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). @@ -29,7 +29,7 @@ import { SourceDTO } from './sourceDTO'; export class ResolutionEntryDTO { 'source': SourceDTO; - 'resolved': Array; + 'resolved': any; static discriminator: string | undefined = undefined; @@ -42,7 +42,7 @@ export class ResolutionEntryDTO { { "name": "resolved", "baseName": "resolved", - "type": "Array" + "type": "AnyOfstringarray" } ]; static getAttributeTypeMap() { diff --git a/src/infrastructure/model/resolutionStatementDTO.ts b/src/infrastructure/model/resolutionStatementDTO.ts index ab58575eb1..836087fadc 100644 --- a/src/infrastructure/model/resolutionStatementDTO.ts +++ b/src/infrastructure/model/resolutionStatementDTO.ts @@ -17,7 +17,7 @@ * Catapult REST Endpoints * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) * - * The version of the OpenAPI document: 0.7.16 + * The version of the OpenAPI document: 0.7.18 * * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). @@ -32,9 +32,9 @@ import { ResolutionEntryDTO } from './resolutionEntryDTO'; */ export class ResolutionStatementDTO { 'height': Array; - 'unresolved': Array; + 'unresolved': any; /** - * The array of resolution entries linked to the unresolved namespaceId. It is an array instead of a single UInt64 field since within one block the resolution might change for different sources due to alias related transactions. + * Array of resolution entries linked to the unresolved namespaceId. It is an array instead of a single UInt64 field since within one block the resolution might change for different sources due to alias related transactions. */ 'resolutionEntries': Array; @@ -49,7 +49,7 @@ export class ResolutionStatementDTO { { "name": "unresolved", "baseName": "unresolved", - "type": "Array" + "type": "AnyOfarraystring" }, { "name": "resolutionEntries", diff --git a/src/infrastructure/model/rolesTypeEnum.ts b/src/infrastructure/model/rolesTypeEnum.ts index 1b7cd9a3bb..9383eb59c4 100644 --- a/src/infrastructure/model/rolesTypeEnum.ts +++ b/src/infrastructure/model/rolesTypeEnum.ts @@ -17,7 +17,7 @@ * Catapult REST Endpoints * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) * - * The version of the OpenAPI document: 0.7.16 + * The version of the OpenAPI document: 0.7.18 * * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). @@ -27,17 +27,9 @@ /** -* The role of the node: * 1 - A peer node. * 2 - An api node. +* Role of the node: * 1 - Peer node. * 2 - Api node. */ -export class RolesTypeEnum { - - static discriminator: string | undefined = undefined; - - static attributeTypeMap: Array<{name: string, baseName: string, type: string}> = [ - ]; - - static getAttributeTypeMap() { - return RolesTypeEnum.attributeTypeMap; - } +export enum RolesTypeEnum { + NUMBER_1 = 1, + NUMBER_2 = 2 } - diff --git a/src/infrastructure/model/score.ts b/src/infrastructure/model/score.ts new file mode 100644 index 0000000000..6f7935ceb6 --- /dev/null +++ b/src/infrastructure/model/score.ts @@ -0,0 +1,34 @@ +/* + * Copyright 2019 NEM + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +/** + * Catapult REST Endpoints + * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) + * + * The version of the OpenAPI document: 0.7.18 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +export class Score extends Array { + + static discriminator: string | undefined = undefined; + +} + diff --git a/src/infrastructure/model/secretLockTransactionBodyDTO.ts b/src/infrastructure/model/secretLockTransactionBodyDTO.ts new file mode 100644 index 0000000000..930ffb634c --- /dev/null +++ b/src/infrastructure/model/secretLockTransactionBodyDTO.ts @@ -0,0 +1,79 @@ +/* + * Copyright 2019 NEM + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +/** + * Catapult REST Endpoints + * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) + * + * The version of the OpenAPI document: 0.7.18 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + +import { LockHashAlgorithmEnum } from './lockHashAlgorithmEnum'; + +export class SecretLockTransactionBodyDTO { + 'duration': Array; + 'mosaicId': Array; + 'amount': Array; + 'hashAlgorithm': LockHashAlgorithmEnum; + 'secret': string; + /** + * Address decoded. If the bit 0 of byte 0 is not set (like in 0x90), then it is a regular address. Else (e.g. 0x91) it represents a namespace id which starts at byte 1. + */ + 'recipientAddress': string; + + static discriminator: string | undefined = undefined; + + static attributeTypeMap: Array<{name: string, baseName: string, type: string}> = [ + { + "name": "duration", + "baseName": "duration", + "type": "Array" + }, + { + "name": "mosaicId", + "baseName": "mosaicId", + "type": "Array" + }, + { + "name": "amount", + "baseName": "amount", + "type": "Array" + }, + { + "name": "hashAlgorithm", + "baseName": "hashAlgorithm", + "type": "LockHashAlgorithmEnum" + }, + { + "name": "secret", + "baseName": "secret", + "type": "string" + }, + { + "name": "recipientAddress", + "baseName": "recipientAddress", + "type": "string" + } ]; + + static getAttributeTypeMap() { + return SecretLockTransactionBodyDTO.attributeTypeMap; + } +} + diff --git a/src/infrastructure/model/secretLockTransactionDTO.ts b/src/infrastructure/model/secretLockTransactionDTO.ts new file mode 100644 index 0000000000..f20e138255 --- /dev/null +++ b/src/infrastructure/model/secretLockTransactionDTO.ts @@ -0,0 +1,123 @@ +/* + * Copyright 2019 NEM + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +/** + * Catapult REST Endpoints + * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) + * + * The version of the OpenAPI document: 0.7.18 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + +import { LockHashAlgorithmEnum } from './lockHashAlgorithmEnum'; +import { SecretLockTransactionBodyDTO } from './secretLockTransactionBodyDTO'; +import { TransactionDTO } from './transactionDTO'; + +/** +* Transaction to sends mosaics to a recipient if the proof used is revealed. If the duration is reached, the locked funds go back to the sender of the transaction. +*/ +export class SecretLockTransactionDTO { + 'signature': string; + 'signerPublicKey': string; + /** + * Entity version. The higher byte represents the network identifier: * 0x68 (MAIN_NET) - Public main network. * 0x98 (TEST_NET) - Public test network. * 0x60 (MIJIN) - Private network. * 0x90 (MIJIN_TEST) - Private test network. + */ + 'version': number; + 'type': number; + 'maxFee': Array; + 'deadline': Array; + 'duration': Array; + 'mosaicId': Array; + 'amount': Array; + 'hashAlgorithm': LockHashAlgorithmEnum; + 'secret': string; + /** + * Address decoded. If the bit 0 of byte 0 is not set (like in 0x90), then it is a regular address. Else (e.g. 0x91) it represents a namespace id which starts at byte 1. + */ + 'recipientAddress': string; + + static discriminator: string | undefined = undefined; + + static attributeTypeMap: Array<{name: string, baseName: string, type: string}> = [ + { + "name": "signature", + "baseName": "signature", + "type": "string" + }, + { + "name": "signerPublicKey", + "baseName": "signerPublicKey", + "type": "string" + }, + { + "name": "version", + "baseName": "version", + "type": "number" + }, + { + "name": "type", + "baseName": "type", + "type": "number" + }, + { + "name": "maxFee", + "baseName": "maxFee", + "type": "Array" + }, + { + "name": "deadline", + "baseName": "deadline", + "type": "Array" + }, + { + "name": "duration", + "baseName": "duration", + "type": "Array" + }, + { + "name": "mosaicId", + "baseName": "mosaicId", + "type": "Array" + }, + { + "name": "amount", + "baseName": "amount", + "type": "Array" + }, + { + "name": "hashAlgorithm", + "baseName": "hashAlgorithm", + "type": "LockHashAlgorithmEnum" + }, + { + "name": "secret", + "baseName": "secret", + "type": "string" + }, + { + "name": "recipientAddress", + "baseName": "recipientAddress", + "type": "string" + } ]; + + static getAttributeTypeMap() { + return SecretLockTransactionDTO.attributeTypeMap; + } +} + diff --git a/src/infrastructure/model/secretProofTransactionBodyDTO.ts b/src/infrastructure/model/secretProofTransactionBodyDTO.ts new file mode 100644 index 0000000000..5bec3aa2d2 --- /dev/null +++ b/src/infrastructure/model/secretProofTransactionBodyDTO.ts @@ -0,0 +1,70 @@ +/* + * Copyright 2019 NEM + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +/** + * Catapult REST Endpoints + * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) + * + * The version of the OpenAPI document: 0.7.18 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + +import { LockHashAlgorithmEnum } from './lockHashAlgorithmEnum'; + +export class SecretProofTransactionBodyDTO { + 'hashAlgorithm': LockHashAlgorithmEnum; + 'secret': string; + /** + * Address decoded. If the bit 0 of byte 0 is not set (like in 0x90), then it is a regular address. Else (e.g. 0x91) it represents a namespace id which starts at byte 1. + */ + 'recipientAddress': string; + /** + * Original random set of bytes. + */ + 'proof': string; + + static discriminator: string | undefined = undefined; + + static attributeTypeMap: Array<{name: string, baseName: string, type: string}> = [ + { + "name": "hashAlgorithm", + "baseName": "hashAlgorithm", + "type": "LockHashAlgorithmEnum" + }, + { + "name": "secret", + "baseName": "secret", + "type": "string" + }, + { + "name": "recipientAddress", + "baseName": "recipientAddress", + "type": "string" + }, + { + "name": "proof", + "baseName": "proof", + "type": "string" + } ]; + + static getAttributeTypeMap() { + return SecretProofTransactionBodyDTO.attributeTypeMap; + } +} + diff --git a/src/infrastructure/model/secretProofTransactionDTO.ts b/src/infrastructure/model/secretProofTransactionDTO.ts new file mode 100644 index 0000000000..944f98b96c --- /dev/null +++ b/src/infrastructure/model/secretProofTransactionDTO.ts @@ -0,0 +1,114 @@ +/* + * Copyright 2019 NEM + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +/** + * Catapult REST Endpoints + * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) + * + * The version of the OpenAPI document: 0.7.18 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + +import { LockHashAlgorithmEnum } from './lockHashAlgorithmEnum'; +import { SecretProofTransactionBodyDTO } from './secretProofTransactionBodyDTO'; +import { TransactionDTO } from './transactionDTO'; + +/** +* Transaction to reveal a proof. +*/ +export class SecretProofTransactionDTO { + 'signature': string; + 'signerPublicKey': string; + /** + * Entity version. The higher byte represents the network identifier: * 0x68 (MAIN_NET) - Public main network. * 0x98 (TEST_NET) - Public test network. * 0x60 (MIJIN) - Private network. * 0x90 (MIJIN_TEST) - Private test network. + */ + 'version': number; + 'type': number; + 'maxFee': Array; + 'deadline': Array; + 'hashAlgorithm': LockHashAlgorithmEnum; + 'secret': string; + /** + * Address decoded. If the bit 0 of byte 0 is not set (like in 0x90), then it is a regular address. Else (e.g. 0x91) it represents a namespace id which starts at byte 1. + */ + 'recipientAddress': string; + /** + * Original random set of bytes. + */ + 'proof': string; + + static discriminator: string | undefined = undefined; + + static attributeTypeMap: Array<{name: string, baseName: string, type: string}> = [ + { + "name": "signature", + "baseName": "signature", + "type": "string" + }, + { + "name": "signerPublicKey", + "baseName": "signerPublicKey", + "type": "string" + }, + { + "name": "version", + "baseName": "version", + "type": "number" + }, + { + "name": "type", + "baseName": "type", + "type": "number" + }, + { + "name": "maxFee", + "baseName": "maxFee", + "type": "Array" + }, + { + "name": "deadline", + "baseName": "deadline", + "type": "Array" + }, + { + "name": "hashAlgorithm", + "baseName": "hashAlgorithm", + "type": "LockHashAlgorithmEnum" + }, + { + "name": "secret", + "baseName": "secret", + "type": "string" + }, + { + "name": "recipientAddress", + "baseName": "recipientAddress", + "type": "string" + }, + { + "name": "proof", + "baseName": "proof", + "type": "string" + } ]; + + static getAttributeTypeMap() { + return SecretProofTransactionDTO.attributeTypeMap; + } +} + diff --git a/src/infrastructure/model/serverDTO.ts b/src/infrastructure/model/serverDTO.ts index ea725312b5..fa2b0cd218 100644 --- a/src/infrastructure/model/serverDTO.ts +++ b/src/infrastructure/model/serverDTO.ts @@ -17,7 +17,7 @@ * Catapult REST Endpoints * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) * - * The version of the OpenAPI document: 0.7.16 + * The version of the OpenAPI document: 0.7.18 * * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). diff --git a/src/infrastructure/model/serverInfoDTO.ts b/src/infrastructure/model/serverInfoDTO.ts index 6dd2fd1b2d..f457f56c5a 100644 --- a/src/infrastructure/model/serverInfoDTO.ts +++ b/src/infrastructure/model/serverInfoDTO.ts @@ -17,7 +17,7 @@ * Catapult REST Endpoints * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) * - * The version of the OpenAPI document: 0.7.16 + * The version of the OpenAPI document: 0.7.18 * * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). @@ -28,11 +28,11 @@ export class ServerInfoDTO { /** - * The catapult-rest component version. + * catapult-rest component version. */ 'restVersion': string; /** - * The catapult-sdk component version. + * catapult-sdk component version. */ 'sdkVersion': string; diff --git a/src/infrastructure/model/sourceDTO.ts b/src/infrastructure/model/sourceDTO.ts index d57091485c..e7cb26b487 100644 --- a/src/infrastructure/model/sourceDTO.ts +++ b/src/infrastructure/model/sourceDTO.ts @@ -17,7 +17,7 @@ * Catapult REST Endpoints * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) * - * The version of the OpenAPI document: 0.7.16 + * The version of the OpenAPI document: 0.7.18 * * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). @@ -27,15 +27,15 @@ /** -* The transaction that triggered the receipt. +* Transaction that triggered the receipt. */ export class SourceDTO { /** - * The transaction index within the block. + * Transaction index within the block. */ 'primaryId': number; /** - * The transaction index inside within the aggregate transaction. If the transaction is not an inner transaction, then the secondary id is set to 0. + * Transaction index inside within the aggregate transaction. If the transaction is not an inner transaction, then the secondary id is set to 0. */ 'secondaryId': number; diff --git a/src/infrastructure/model/statementsDTO.ts b/src/infrastructure/model/statementsDTO.ts index 35d64d7a68..51c5e7b889 100644 --- a/src/infrastructure/model/statementsDTO.ts +++ b/src/infrastructure/model/statementsDTO.ts @@ -17,7 +17,7 @@ * Catapult REST Endpoints * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) * - * The version of the OpenAPI document: 0.7.16 + * The version of the OpenAPI document: 0.7.18 * * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). @@ -29,19 +29,19 @@ import { ResolutionStatementDTO } from './resolutionStatementDTO'; import { TransactionStatementDTO } from './transactionStatementDTO'; /** -* The collection of transaction statements and resolutions triggered for the block requested. +* Collection of transaction statements and resolutions triggered for the block requested. */ export class StatementsDTO { /** - * The array of transaction statements for the block requested. + * Array of transaction statements for the block requested. */ 'transactionStatements': Array; /** - * The array of address resolutions for the block requested. + * Array of address resolutions for the block requested. */ 'addressResolutionStatements': Array; /** - * The array of mosaic resolutions for the block requested. + * Array of mosaic resolutions for the block requested. */ 'mosaicResolutionStatements': Array; diff --git a/src/infrastructure/model/storageInfoDTO.ts b/src/infrastructure/model/storageInfoDTO.ts index 672a18ba13..3792f26c71 100644 --- a/src/infrastructure/model/storageInfoDTO.ts +++ b/src/infrastructure/model/storageInfoDTO.ts @@ -17,7 +17,7 @@ * Catapult REST Endpoints * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) * - * The version of the OpenAPI document: 0.7.16 + * The version of the OpenAPI document: 0.7.18 * * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). @@ -28,15 +28,15 @@ export class StorageInfoDTO { /** - * The number of blocks stored. + * Number of blocks stored. */ 'numBlocks': number; /** - * The number of transactions stored. + * Number of transactions stored. */ 'numTransactions': number; /** - * The number of accounts created. + * Number of accounts created. */ 'numAccounts': number; diff --git a/src/infrastructure/model/timestamp.ts b/src/infrastructure/model/timestamp.ts new file mode 100644 index 0000000000..53de3dd493 --- /dev/null +++ b/src/infrastructure/model/timestamp.ts @@ -0,0 +1,34 @@ +/* + * Copyright 2019 NEM + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +/** + * Catapult REST Endpoints + * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) + * + * The version of the OpenAPI document: 0.7.18 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +export class Timestamp extends Array { + + static discriminator: string | undefined = undefined; + +} + diff --git a/src/infrastructure/model/transactionBodyDTO.ts b/src/infrastructure/model/transactionBodyDTO.ts new file mode 100644 index 0000000000..ef8d14e4e8 --- /dev/null +++ b/src/infrastructure/model/transactionBodyDTO.ts @@ -0,0 +1,51 @@ +/* + * Copyright 2019 NEM + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +/** + * Catapult REST Endpoints + * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) + * + * The version of the OpenAPI document: 0.7.18 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +export class TransactionBodyDTO { + 'maxFee': Array; + 'deadline': Array; + + static discriminator: string | undefined = undefined; + + static attributeTypeMap: Array<{name: string, baseName: string, type: string}> = [ + { + "name": "maxFee", + "baseName": "maxFee", + "type": "Array" + }, + { + "name": "deadline", + "baseName": "deadline", + "type": "Array" + } ]; + + static getAttributeTypeMap() { + return TransactionBodyDTO.attributeTypeMap; + } +} + diff --git a/src/infrastructure/model/transactionDTO.ts b/src/infrastructure/model/transactionDTO.ts new file mode 100644 index 0000000000..01f02e771e --- /dev/null +++ b/src/infrastructure/model/transactionDTO.ts @@ -0,0 +1,81 @@ +/* + * Copyright 2019 NEM + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +/** + * Catapult REST Endpoints + * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) + * + * The version of the OpenAPI document: 0.7.18 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + +import { EntityDTO } from './entityDTO'; +import { TransactionBodyDTO } from './transactionBodyDTO'; +import { VerifiableEntityDTO } from './verifiableEntityDTO'; + +export class TransactionDTO { + 'signature': string; + 'signerPublicKey': string; + /** + * Entity version. The higher byte represents the network identifier: * 0x68 (MAIN_NET) - Public main network. * 0x98 (TEST_NET) - Public test network. * 0x60 (MIJIN) - Private network. * 0x90 (MIJIN_TEST) - Private test network. + */ + 'version': number; + 'type': number; + 'maxFee': Array; + 'deadline': Array; + + static discriminator: string | undefined = undefined; + + static attributeTypeMap: Array<{name: string, baseName: string, type: string}> = [ + { + "name": "signature", + "baseName": "signature", + "type": "string" + }, + { + "name": "signerPublicKey", + "baseName": "signerPublicKey", + "type": "string" + }, + { + "name": "version", + "baseName": "version", + "type": "number" + }, + { + "name": "type", + "baseName": "type", + "type": "number" + }, + { + "name": "maxFee", + "baseName": "maxFee", + "type": "Array" + }, + { + "name": "deadline", + "baseName": "deadline", + "type": "Array" + } ]; + + static getAttributeTypeMap() { + return TransactionDTO.attributeTypeMap; + } +} + diff --git a/src/infrastructure/model/transactionHashes.ts b/src/infrastructure/model/transactionHashes.ts index 40b833628d..a2505d3a28 100644 --- a/src/infrastructure/model/transactionHashes.ts +++ b/src/infrastructure/model/transactionHashes.ts @@ -17,7 +17,7 @@ * Catapult REST Endpoints * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) * - * The version of the OpenAPI document: 0.7.16 + * The version of the OpenAPI document: 0.7.18 * * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). @@ -28,7 +28,7 @@ export class TransactionHashes { /** - * The array of transaction hashes. + * Array of transaction hashes. */ 'hashes'?: Array; diff --git a/src/infrastructure/model/transactionIds.ts b/src/infrastructure/model/transactionIds.ts index 745788bae6..5e8c76feb4 100644 --- a/src/infrastructure/model/transactionIds.ts +++ b/src/infrastructure/model/transactionIds.ts @@ -17,7 +17,7 @@ * Catapult REST Endpoints * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) * - * The version of the OpenAPI document: 0.7.16 + * The version of the OpenAPI document: 0.7.18 * * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). @@ -28,7 +28,7 @@ export class TransactionIds { /** - * The array of transaction ids. + * Array of transaction ids. */ 'transactionIds'?: Array; diff --git a/src/infrastructure/model/transactionInfoDTO.ts b/src/infrastructure/model/transactionInfoDTO.ts index 73901a3a24..1e1323aa7a 100644 --- a/src/infrastructure/model/transactionInfoDTO.ts +++ b/src/infrastructure/model/transactionInfoDTO.ts @@ -17,7 +17,7 @@ * Catapult REST Endpoints * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) * - * The version of the OpenAPI document: 0.7.16 + * The version of the OpenAPI document: 0.7.18 * * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). @@ -42,7 +42,7 @@ export class TransactionInfoDTO { { "name": "transaction", "baseName": "transaction", - "type": "object" + "type": "AnyOfAccountLinkTransactionDTOAggregateCompleteTransactionDTOAggregateBondedTransactionDTOMosaicDefinitionTransactionDTOMosaicSupplyChangeTransactionDTOMultisigAccountModificationTransactionDTONamespaceRegistrationTransactionDTOAddressAliasTransactionDTOMosaicAliasTransactionDTOHashLockTransactionDTOSecretLockTransactionDTOSecretProofTransactionDTOAccountAddressRestrictionTransactionDTOAccountMosaicRestrictionTransactionDTOAccountOperationRestrictionTransactionDTOGlobalMosaicRestrictionTransactionDTOAddressMosaicRestrictionTransactionDTOTransferTransactionDTO" } ]; static getAttributeTypeMap() { diff --git a/src/infrastructure/model/transactionMetaDTO.ts b/src/infrastructure/model/transactionMetaDTO.ts index c6e9e626a4..7c31969749 100644 --- a/src/infrastructure/model/transactionMetaDTO.ts +++ b/src/infrastructure/model/transactionMetaDTO.ts @@ -17,7 +17,7 @@ * Catapult REST Endpoints * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) * - * The version of the OpenAPI document: 0.7.16 + * The version of the OpenAPI document: 0.7.18 * * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). diff --git a/src/infrastructure/model/transactionPayload.ts b/src/infrastructure/model/transactionPayload.ts index ff83fbb12a..8339cc9d34 100644 --- a/src/infrastructure/model/transactionPayload.ts +++ b/src/infrastructure/model/transactionPayload.ts @@ -17,7 +17,7 @@ * Catapult REST Endpoints * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) * - * The version of the OpenAPI document: 0.7.16 + * The version of the OpenAPI document: 0.7.18 * * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). @@ -28,7 +28,7 @@ export class TransactionPayload { /** - * The transaction payload. + * Transaction payload. */ 'payload'?: string; diff --git a/src/infrastructure/model/transactionStatementDTO.ts b/src/infrastructure/model/transactionStatementDTO.ts index 7f0a9959e9..466e8c47d9 100644 --- a/src/infrastructure/model/transactionStatementDTO.ts +++ b/src/infrastructure/model/transactionStatementDTO.ts @@ -17,7 +17,7 @@ * Catapult REST Endpoints * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) * - * The version of the OpenAPI document: 0.7.16 + * The version of the OpenAPI document: 0.7.18 * * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). @@ -28,15 +28,15 @@ import { SourceDTO } from './sourceDTO'; /** -* The collection of receipts related to a transaction. +* Collection of receipts related to a transaction. */ export class TransactionStatementDTO { 'height': Array; 'source': SourceDTO; /** - * The array of receipts. + * Array of receipts. */ - 'receipts': Array; + 'receipts': Array; static discriminator: string | undefined = undefined; @@ -54,7 +54,7 @@ export class TransactionStatementDTO { { "name": "receipts", "baseName": "receipts", - "type": "Array" + "type": "Array" } ]; static getAttributeTypeMap() { diff --git a/src/infrastructure/model/transactionStatusDTO.ts b/src/infrastructure/model/transactionStatusDTO.ts index 8ae13588c0..6f8576bf2c 100644 --- a/src/infrastructure/model/transactionStatusDTO.ts +++ b/src/infrastructure/model/transactionStatusDTO.ts @@ -17,7 +17,7 @@ * Catapult REST Endpoints * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) * - * The version of the OpenAPI document: 0.7.16 + * The version of the OpenAPI document: 0.7.18 * * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). diff --git a/src/infrastructure/model/transactionTypeEnum.ts b/src/infrastructure/model/transactionTypeEnum.ts new file mode 100644 index 0000000000..ed9c474a75 --- /dev/null +++ b/src/infrastructure/model/transactionTypeEnum.ts @@ -0,0 +1,51 @@ +/* + * Copyright 2019 NEM + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +/** + * Catapult REST Endpoints + * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) + * + * The version of the OpenAPI document: 0.7.18 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +/** +* Type of transaction: * 0x414C (16716 decimal) - AccountLinkTransaction. * 0x4141 (16705 decimal) - AggregateCompleteTransaction. * 0x4241 (16961 decimal) - AggregateBondedTransaction. * 0x414D (16717 decimal) - MosaicDefinitionTransaction. * 0x424D (16973 decimal) - MosaicSupplyChangeTransaction. * 0x424E (16974 decimal) - AddressAliasTransaction. * 0x434E (17230 decimal) - MosaicAliasTransaction. * 0x4155 (16725 decimal) - MultisigAccountModificationTransaction. * 0x414E (16718 decimal) - NamespaceRegistrationTransaction. * 0x4148 (16712 decimal) - HashLockTransaction. * 0x4152 (16722 decimal) - SecretLockTransaction. * 0x4252 (16978 decimal) - SecretProofTransaction. * 0x4150 (16720 decimal) - AccountAddressRestrictionTransaction. * 0x4250 (16976 decimal) - AccountMosaicRestrictionTransaction. * 0x4350 (17232 decimal) - AccountOperationRestrictionTransaction. * 0x4151 (16721 decimal) - MosaicGlobalRestrictionTransaction. * 0x4251 (16977 decimal) - MosaicAddressRestrictionTransaction. * 0x4154 (16724 decimal) - TransferTransaction. +*/ +export enum TransactionTypeEnum { + NUMBER_16716 = 16716, + NUMBER_16705 = 16705, + NUMBER_16961 = 16961, + NUMBER_16717 = 16717, + NUMBER_16973 = 16973, + NUMBER_16974 = 16974, + NUMBER_17230 = 17230, + NUMBER_16725 = 16725, + NUMBER_16718 = 16718, + NUMBER_16712 = 16712, + NUMBER_16722 = 16722, + NUMBER_16978 = 16978, + NUMBER_16720 = 16720, + NUMBER_16976 = 16976, + NUMBER_17232 = 17232, + NUMBER_16721 = 16721, + NUMBER_16977 = 16977, + NUMBER_16724 = 16724 +} diff --git a/src/infrastructure/model/transferTransactionBodyDTO.ts b/src/infrastructure/model/transferTransactionBodyDTO.ts new file mode 100644 index 0000000000..f3937250dc --- /dev/null +++ b/src/infrastructure/model/transferTransactionBodyDTO.ts @@ -0,0 +1,65 @@ +/* + * Copyright 2019 NEM + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +/** + * Catapult REST Endpoints + * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) + * + * The version of the OpenAPI document: 0.7.18 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + +import { MessageDTO } from './messageDTO'; +import { Mosaic } from './mosaic'; + +export class TransferTransactionBodyDTO { + /** + * Address decoded. If the bit 0 of byte 0 is not set (like in 0x90), then it is a regular address. Else (e.g. 0x91) it represents a namespace id which starts at byte 1. + */ + 'recipientAddress': string; + /** + * Array of mosaics sent to the recipient. If the most significant bit of byte 0 is set, a namespaceId (alias) is used instead of a instead of a mosaicId corresponds to a mosaicId. + */ + 'mosaics': Array; + 'message': MessageDTO; + + static discriminator: string | undefined = undefined; + + static attributeTypeMap: Array<{name: string, baseName: string, type: string}> = [ + { + "name": "recipientAddress", + "baseName": "recipientAddress", + "type": "string" + }, + { + "name": "mosaics", + "baseName": "mosaics", + "type": "Array" + }, + { + "name": "message", + "baseName": "message", + "type": "MessageDTO" + } ]; + + static getAttributeTypeMap() { + return TransferTransactionBodyDTO.attributeTypeMap; + } +} + diff --git a/src/infrastructure/model/transferTransactionDTO.ts b/src/infrastructure/model/transferTransactionDTO.ts new file mode 100644 index 0000000000..58c918940e --- /dev/null +++ b/src/infrastructure/model/transferTransactionDTO.ts @@ -0,0 +1,109 @@ +/* + * Copyright 2019 NEM + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +/** + * Catapult REST Endpoints + * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) + * + * The version of the OpenAPI document: 0.7.18 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + +import { MessageDTO } from './messageDTO'; +import { Mosaic } from './mosaic'; +import { TransactionDTO } from './transactionDTO'; +import { TransferTransactionBodyDTO } from './transferTransactionBodyDTO'; + +/** +* Transaction to transfer mosaics and a message to another account. +*/ +export class TransferTransactionDTO { + 'signature': string; + 'signerPublicKey': string; + /** + * Entity version. The higher byte represents the network identifier: * 0x68 (MAIN_NET) - Public main network. * 0x98 (TEST_NET) - Public test network. * 0x60 (MIJIN) - Private network. * 0x90 (MIJIN_TEST) - Private test network. + */ + 'version': number; + 'type': number; + 'maxFee': Array; + 'deadline': Array; + /** + * Address decoded. If the bit 0 of byte 0 is not set (like in 0x90), then it is a regular address. Else (e.g. 0x91) it represents a namespace id which starts at byte 1. + */ + 'recipientAddress': string; + /** + * Array of mosaics sent to the recipient. If the most significant bit of byte 0 is set, a namespaceId (alias) is used instead of a instead of a mosaicId corresponds to a mosaicId. + */ + 'mosaics': Array; + 'message': MessageDTO; + + static discriminator: string | undefined = undefined; + + static attributeTypeMap: Array<{name: string, baseName: string, type: string}> = [ + { + "name": "signature", + "baseName": "signature", + "type": "string" + }, + { + "name": "signerPublicKey", + "baseName": "signerPublicKey", + "type": "string" + }, + { + "name": "version", + "baseName": "version", + "type": "number" + }, + { + "name": "type", + "baseName": "type", + "type": "number" + }, + { + "name": "maxFee", + "baseName": "maxFee", + "type": "Array" + }, + { + "name": "deadline", + "baseName": "deadline", + "type": "Array" + }, + { + "name": "recipientAddress", + "baseName": "recipientAddress", + "type": "string" + }, + { + "name": "mosaics", + "baseName": "mosaics", + "type": "Array" + }, + { + "name": "message", + "baseName": "message", + "type": "MessageDTO" + } ]; + + static getAttributeTypeMap() { + return TransferTransactionDTO.attributeTypeMap; + } +} + diff --git a/src/infrastructure/model/unresolvedMosaic.ts b/src/infrastructure/model/unresolvedMosaic.ts new file mode 100644 index 0000000000..afffdede96 --- /dev/null +++ b/src/infrastructure/model/unresolvedMosaic.ts @@ -0,0 +1,51 @@ +/* + * Copyright 2019 NEM + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +/** + * Catapult REST Endpoints + * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) + * + * The version of the OpenAPI document: 0.7.18 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +export class UnresolvedMosaic { + 'id': Array; + 'amount': Array; + + static discriminator: string | undefined = undefined; + + static attributeTypeMap: Array<{name: string, baseName: string, type: string}> = [ + { + "name": "id", + "baseName": "id", + "type": "Array" + }, + { + "name": "amount", + "baseName": "amount", + "type": "Array" + } ]; + + static getAttributeTypeMap() { + return UnresolvedMosaic.attributeTypeMap; + } +} + diff --git a/src/infrastructure/model/unresolvedMosaicId.ts b/src/infrastructure/model/unresolvedMosaicId.ts new file mode 100644 index 0000000000..22de281923 --- /dev/null +++ b/src/infrastructure/model/unresolvedMosaicId.ts @@ -0,0 +1,34 @@ +/* + * Copyright 2019 NEM + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +/** + * Catapult REST Endpoints + * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) + * + * The version of the OpenAPI document: 0.7.18 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +export class UnresolvedMosaicId extends Array { + + static discriminator: string | undefined = undefined; + +} + diff --git a/src/infrastructure/model/verifiableEntityDTO.ts b/src/infrastructure/model/verifiableEntityDTO.ts new file mode 100644 index 0000000000..482ba53b4e --- /dev/null +++ b/src/infrastructure/model/verifiableEntityDTO.ts @@ -0,0 +1,45 @@ +/* + * Copyright 2019 NEM + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +/** + * Catapult REST Endpoints + * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) + * + * The version of the OpenAPI document: 0.7.18 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +export class VerifiableEntityDTO { + 'signature': string; + + static discriminator: string | undefined = undefined; + + static attributeTypeMap: Array<{name: string, baseName: string, type: string}> = [ + { + "name": "signature", + "baseName": "signature", + "type": "string" + } ]; + + static getAttributeTypeMap() { + return VerifiableEntityDTO.attributeTypeMap; + } +} + diff --git a/src/model/account/AccountInfo.ts b/src/model/account/AccountInfo.ts index c871330c4c..6b1b155b7e 100644 --- a/src/model/account/AccountInfo.ts +++ b/src/model/account/AccountInfo.ts @@ -16,6 +16,8 @@ import {Mosaic} from '../mosaic/Mosaic'; import {UInt64} from '../UInt64'; +import { AccountType } from './AccountType'; +import { ActivityBucket } from './ActivityBucket'; import {Address} from './Address'; import {PublicAccount} from './PublicAccount'; @@ -27,11 +29,7 @@ export class AccountInfo { /** * */ - constructor(// TODO: meta not implemented in nis - /** - * Account metadata - */ - public readonly meta: any, + constructor( /** * Address of the account. */ @@ -48,6 +46,18 @@ export class AccountInfo { * Height when the public key was published. */ public readonly publicKeyHeight: UInt64, + /** + * Account type + */ + public readonly accountType: AccountType, + /** + * Linked account key + */ + public readonly linkedAccountKey: string, + /** + * Account activity bucket + */ + public readonly activityBucket: ActivityBucket[], /** * Mosaics hold by the account. */ diff --git a/src/model/blockchain/MerkleProofInfoPayload.ts b/src/model/account/AccountType.ts similarity index 64% rename from src/model/blockchain/MerkleProofInfoPayload.ts rename to src/model/account/AccountType.ts index 30396e6fc5..f0f1f08126 100644 --- a/src/model/blockchain/MerkleProofInfoPayload.ts +++ b/src/model/account/AccountType.ts @@ -1,7 +1,7 @@ /* * Copyright 2019 NEM * - * Licensed under the Apache License, Version 2.0 (the "License"); + * Licensed under the Apache License, Version 2.0 (the "License"), * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * @@ -14,20 +14,16 @@ * limitations under the License. */ -import { MerklePathItem } from "./MerklePathItem"; - /** - * The block merkle proof payload + * 0 - Unlinked. + * 1 - Main account that is linked to a remote harvester account. + * 2 - Remote harvester account that is linked to a balance-holding account. + * 3 - Remote harvester eligible account that is unlinked. */ -export class MerkleProofInfoPayload { - - /** - * @param merklePath - */ - constructor(/** - * The merkle path item - */ - public readonly merklePath: MerklePathItem[]) { - } + export enum AccountType { + Unlinked = 0, + Main = 1, + Remote = 2, + Remote_Unlinked = 3, } diff --git a/src/model/account/ActivityBucket.ts b/src/model/account/ActivityBucket.ts new file mode 100644 index 0000000000..296a49a145 --- /dev/null +++ b/src/model/account/ActivityBucket.ts @@ -0,0 +1,46 @@ +/* + * Copyright 2019 NEM + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +/** + * Account activity bucket. + */ +export class ActivityBucket { + + /** + * Constructor + * @param meta + * @param accountRestrictions + */ + constructor( + /** + * Start height + */ + public readonly startHeight: string, + /** + * Total fees paid. + */ + public readonly totalFeesPaid: number, + /** + * Beneficiary count. + */ + public readonly beneficiaryCount: number, + /** + * Raw score. + */ + public readonly rawScore: number) { + + } +} diff --git a/src/model/blockchain/MerkleProofInfo.ts b/src/model/blockchain/MerkleProofInfo.ts index 552fffbe97..18314665d8 100644 --- a/src/model/blockchain/MerkleProofInfo.ts +++ b/src/model/blockchain/MerkleProofInfo.ts @@ -1,3 +1,5 @@ +import { MerklePathItem } from "./MerklePathItem"; + /* * Copyright 2019 NEM * @@ -14,25 +16,18 @@ * limitations under the License. */ -import { MerkleProofInfoPayload } from "./MerkleProofInfoPayload"; - /** * The block merkle proof info */ export class MerkleProofInfo { /** - * @param payload - The merkle proof payload - * @param type - The merkle proof type + * @param merklePath - Array of merkle path items */ constructor(/** - * The merkle proof payload - */ - public readonly payload: MerkleProofInfoPayload, - /** - * The merkle proof type + * The merkle path */ - public readonly type: string) { + public readonly merklePath?: MerklePathItem[]) { } } diff --git a/src/model/model.ts b/src/model/model.ts index 8810f2ab73..45c2a98c64 100644 --- a/src/model/model.ts +++ b/src/model/model.ts @@ -19,6 +19,8 @@ export * from './Id'; // Account export * from './account/Account'; +export * from './account/AccountType'; +export * from './account/ActivityBucket'; export * from './account/AccountInfo'; export * from './account/Address'; export * from './account/MultisigAccountGraphInfo'; @@ -38,7 +40,6 @@ export * from './blockchain/BlockInfo'; export * from './blockchain/NetworkType'; export * from './blockchain/MerklePathItem'; export * from './blockchain/MerkleProofInfo'; -export * from './blockchain/MerkleProofInfoPayload'; // Diagnostic export * from './diagnostic/ServerInfo'; diff --git a/src/model/mosaic/MosaicInfo.ts b/src/model/mosaic/MosaicInfo.ts index 225fdec922..078bcd3d9e 100644 --- a/src/model/mosaic/MosaicInfo.ts +++ b/src/model/mosaic/MosaicInfo.ts @@ -27,21 +27,17 @@ export class MosaicInfo { /** * @param active * @param index - * @param metaId * @param nonce * @param supply * @param height * @param owner * @param properties */ - constructor(/** - * The meta data id. - */ - public readonly metaId: string, + constructor( /** * The mosaic id. */ - public readonly mosaicId: MosaicId, + public readonly id: MosaicId, /** * The mosaic supply. */ diff --git a/src/model/namespace/NamespaceInfo.ts b/src/model/namespace/NamespaceInfo.ts index 029168aba8..cd06cb0498 100644 --- a/src/model/namespace/NamespaceInfo.ts +++ b/src/model/namespace/NamespaceInfo.ts @@ -28,7 +28,7 @@ export class NamespaceInfo { * @param active * @param index * @param metaId - * @param type + * @param registrationType * @param depth * @param levels * @param parentId @@ -49,9 +49,9 @@ export class NamespaceInfo { */ public readonly metaId: string, /** - * The namespace type, namespace and sub namespace. + * The namespace registration type, namespace and sub namespace. */ - private readonly type: number, + private readonly registrationType: number, /** * The level of namespace. */ @@ -96,7 +96,7 @@ export class NamespaceInfo { * @returns {boolean} */ public isRoot(): boolean { - return this.type === 0; + return this.registrationType === 0; } /** @@ -104,7 +104,7 @@ export class NamespaceInfo { * @returns {boolean} */ public isSubnamespace(): boolean { - return this.type === 1; + return this.registrationType === 1; } /** diff --git a/src/service/MosaicAmountView.ts b/src/service/MosaicAmountView.ts index 306e6bc185..974792c382 100644 --- a/src/service/MosaicAmountView.ts +++ b/src/service/MosaicAmountView.ts @@ -55,6 +55,6 @@ export class MosaicAmountView { * @returns {string} */ public fullName(): string { - return this.mosaicInfo.mosaicId.toHex(); + return this.mosaicInfo.id.toHex(); } } diff --git a/test/model/account/AccountInfo.spec.ts b/test/model/account/AccountInfo.spec.ts index e42853e9bc..35add19d11 100644 --- a/test/model/account/AccountInfo.spec.ts +++ b/test/model/account/AccountInfo.spec.ts @@ -23,6 +23,7 @@ import {NetworkType} from '../../../src/model/blockchain/NetworkType'; import {Mosaic} from '../../../src/model/mosaic/Mosaic'; import {UInt64} from '../../../src/model/UInt64'; import {MosaicId} from '../../../src/model/mosaic/MosaicId'; +import { ActivityBucket } from '../../../src/model/account/ActivityBucket'; describe('AccountInfo', () => { @@ -33,6 +34,14 @@ describe('AccountInfo', () => { addressHeight: new UInt64([1, 0]), importance: new UInt64([405653170, 0]), importanceHeight: new UInt64([6462, 0]), + accountType: 0, + linkedAccountKey: '9050B9837EFAB4BBE8A4B9BB32D812F9885C00D8FC1650E142', + activityBucket: [{ + startHeight: '1000', + totalFeesPaid: 100, + beneficiaryCount: 1, + rawScore: 20, + }], mosaics: [{ amount: new UInt64([1830592442, 94387]), id: new MosaicId([3646934825, 3576016193]), @@ -40,21 +49,25 @@ describe('AccountInfo', () => { publicKey: '846B4439154579A5903B1459C9CF69CB8153F6D0110A7A0ED61DE29AE4810BF2', publicKeyHeight: new UInt64([13, 0]), }, - meta: {}, }; const accountInfo = new AccountInfo( - accountInfoDTO.meta, accountInfoDTO.account.address, accountInfoDTO.account.addressHeight, accountInfoDTO.account.publicKey, accountInfoDTO.account.publicKeyHeight, + accountInfoDTO.account.accountType, + accountInfoDTO.account.linkedAccountKey, + accountInfoDTO.account.activityBucket.map((bucket) => new ActivityBucket( + bucket.startHeight, + bucket.totalFeesPaid, + bucket.beneficiaryCount, + bucket.rawScore, + )), accountInfoDTO.account.mosaics.map((mosaicDTO) => new Mosaic(mosaicDTO.id, mosaicDTO.amount)), accountInfoDTO.account.importance, accountInfoDTO.account.importanceHeight, ); - - expect(accountInfo.meta).to.be.equal(accountInfoDTO.meta); deepEqual(accountInfo.address, accountInfoDTO.account.address); deepEqual(accountInfo.addressHeight, accountInfoDTO.account.addressHeight); expect(accountInfo.publicKey).to.be.equal(accountInfoDTO.account.publicKey); diff --git a/test/model/mosaic/MosaicAmountView.spec.ts b/test/model/mosaic/MosaicAmountView.spec.ts index 5c24f52255..da500af5a2 100644 --- a/test/model/mosaic/MosaicAmountView.spec.ts +++ b/test/model/mosaic/MosaicAmountView.spec.ts @@ -17,12 +17,11 @@ import {expect} from 'chai'; import {PublicAccount} from '../../../src/model/account/PublicAccount'; import {NetworkType} from '../../../src/model/blockchain/NetworkType'; -import {MosaicAmountView} from '../../../src/service/MosaicAmountView'; import {MosaicId} from '../../../src/model/mosaic/MosaicId'; import {MosaicInfo} from '../../../src/model/mosaic/MosaicInfo'; import {MosaicProperties} from '../../../src/model/mosaic/MosaicProperties'; -import {NamespaceId} from '../../../src/model/namespace/NamespaceId'; import {UInt64} from '../../../src/model/UInt64'; +import {MosaicAmountView} from '../../../src/service/MosaicAmountView'; describe('MosaicAmountView', () => { @@ -30,7 +29,6 @@ describe('MosaicAmountView', () => { before(() => { mosaicInfo = new MosaicInfo( - '59FDA0733F17CF0001772CBC', new MosaicId([3294802500, 2243684972]), // mosaicId new UInt64([3403414400, 2095475]), // supply new UInt64([1, 0]), // height diff --git a/test/model/mosaic/MosaicInfo.spec.ts b/test/model/mosaic/MosaicInfo.spec.ts index b85e1146dd..4303e0dd8d 100644 --- a/test/model/mosaic/MosaicInfo.spec.ts +++ b/test/model/mosaic/MosaicInfo.spec.ts @@ -16,13 +16,12 @@ import {deepEqual} from 'assert'; import {expect} from 'chai'; -import {MosaicInfo} from '../../../src/model/mosaic/MosaicInfo'; -import {MosaicProperties} from '../../../src/model/mosaic/MosaicProperties'; -import {UInt64} from '../../../src/model/UInt64'; import {PublicAccount} from '../../../src/model/account/PublicAccount'; import {NetworkType} from '../../../src/model/blockchain/NetworkType'; import {MosaicId} from '../../../src/model/mosaic/MosaicId'; -import {NamespaceId} from '../../../src/model/namespace/NamespaceId'; +import {MosaicInfo} from '../../../src/model/mosaic/MosaicInfo'; +import {MosaicProperties} from '../../../src/model/mosaic/MosaicProperties'; +import {UInt64} from '../../../src/model/UInt64'; describe('MosaicInfo', () => { const mosaicInfoDTO = { @@ -51,7 +50,6 @@ describe('MosaicInfo', () => { it('should createComplete an MosaicInfo object', () => { const mosaicInfo = new MosaicInfo( - mosaicInfoDTO.meta.id, mosaicInfoDTO.mosaic.mosaicId, mosaicInfoDTO.mosaic.supply, mosaicInfoDTO.mosaic.height, @@ -64,8 +62,7 @@ describe('MosaicInfo', () => { ), ); - expect(mosaicInfo.metaId).to.be.equal(mosaicInfoDTO.meta.id); - deepEqual(mosaicInfo.mosaicId, mosaicInfoDTO.mosaic.mosaicId); + deepEqual(mosaicInfo.id, mosaicInfoDTO.mosaic.mosaicId); deepEqual(mosaicInfo.supply, mosaicInfoDTO.mosaic.supply); deepEqual(mosaicInfo.height, mosaicInfoDTO.mosaic.height); expect(mosaicInfo.owner).to.be.equal(mosaicInfoDTO.mosaic.owner); @@ -78,7 +75,6 @@ describe('MosaicInfo', () => { it('should createComplete an MosaicInfo object without duration', () => { const mosaicInfo = new MosaicInfo( - mosaicInfoDTO.meta.id, mosaicInfoDTO.mosaic.mosaicId, mosaicInfoDTO.mosaic.supply, mosaicInfoDTO.mosaic.height, @@ -90,8 +86,7 @@ describe('MosaicInfo', () => { ), ); - expect(mosaicInfo.metaId).to.be.equal(mosaicInfoDTO.meta.id); - deepEqual(mosaicInfo.mosaicId, mosaicInfoDTO.mosaic.mosaicId); + deepEqual(mosaicInfo.id, mosaicInfoDTO.mosaic.mosaicId); deepEqual(mosaicInfo.supply, mosaicInfoDTO.mosaic.supply); deepEqual(mosaicInfo.height, mosaicInfoDTO.mosaic.height); expect(mosaicInfo.owner).to.be.equal(mosaicInfoDTO.mosaic.owner); @@ -105,7 +100,6 @@ describe('MosaicInfo', () => { describe('isSupplyMutable', () => { it('should return true when it\'s mutable', () => { const mosaicInfo = new MosaicInfo( - mosaicInfoDTO.meta.id, mosaicInfoDTO.mosaic.mosaicId, mosaicInfoDTO.mosaic.supply, mosaicInfoDTO.mosaic.height, @@ -124,7 +118,6 @@ describe('MosaicInfo', () => { it('should return false when it\'s immutable', () => { const mosaicInfo = new MosaicInfo( - mosaicInfoDTO.meta.id, mosaicInfoDTO.mosaic.mosaicId, mosaicInfoDTO.mosaic.supply, mosaicInfoDTO.mosaic.height, @@ -144,7 +137,6 @@ describe('MosaicInfo', () => { describe('isTransferable', () => { it('should return true when it\'s transferable', () => { const mosaicInfo = new MosaicInfo( - mosaicInfoDTO.meta.id, mosaicInfoDTO.mosaic.mosaicId, mosaicInfoDTO.mosaic.supply, mosaicInfoDTO.mosaic.height, @@ -162,7 +154,6 @@ describe('MosaicInfo', () => { it('should return false when it\'s not transferable', () => { const mosaicInfo = new MosaicInfo( - mosaicInfoDTO.meta.id, mosaicInfoDTO.mosaic.mosaicId, mosaicInfoDTO.mosaic.supply, mosaicInfoDTO.mosaic.height, @@ -182,7 +173,6 @@ describe('MosaicInfo', () => { describe('isRestrictable', () => { it('should return true when it\'s restrictable', () => { const mosaicInfo = new MosaicInfo( - mosaicInfoDTO.meta.id, mosaicInfoDTO.mosaic.mosaicId, mosaicInfoDTO.mosaic.supply, mosaicInfoDTO.mosaic.height, @@ -201,7 +191,6 @@ describe('MosaicInfo', () => { it('should return false when it\'s not restrictable', () => { const mosaicInfo = new MosaicInfo( - mosaicInfoDTO.meta.id, mosaicInfoDTO.mosaic.mosaicId, mosaicInfoDTO.mosaic.supply, mosaicInfoDTO.mosaic.height, diff --git a/test/model/mosaic/MosaicView.spec.ts b/test/model/mosaic/MosaicView.spec.ts index 5f85049cf1..90a010ad22 100644 --- a/test/model/mosaic/MosaicView.spec.ts +++ b/test/model/mosaic/MosaicView.spec.ts @@ -29,7 +29,6 @@ describe('MosaicView', () => { before(() => { mosaicInfo = new MosaicInfo( - '59FDA0733F17CF0001772CBC', new MosaicId([3294802500, 2243684972]), new UInt64([3403414400, 2095475]), // supply new UInt64([1, 0]), // height From 9b630c05142409ec66d51e6c8b1b97a080a9d8a7 Mon Sep 17 00:00:00 2001 From: Steven Liu Date: Mon, 9 Sep 2019 20:12:47 +0100 Subject: [PATCH 04/10] - Latest OpenAPI Dtos applied - Latest schema changes applied - Uint64 string handler added --- e2e/infrastructure/AccountHttp.spec.ts | 14 +- e2e/infrastructure/TransactionHttp.spec.ts | 207 ++++++++---------- .../CreateTransactionFromDTO.spec.ts | 60 ++--- .../transaction/ValidateTransaction.ts | 18 +- package-lock.json | 10 + package.json | 4 +- src/infrastructure/AccountHttp.ts | 38 ++-- src/infrastructure/AccountRepository.ts | 8 +- src/infrastructure/BlockHttp.ts | 16 +- src/infrastructure/ChainHttp.ts | 6 +- src/infrastructure/Listener.ts | 8 +- src/infrastructure/MosaicHttp.ts | 50 ++--- src/infrastructure/NamespaceHttp.ts | 25 +-- src/infrastructure/NodeHttp.ts | 8 +- src/infrastructure/TransactionHttp.ts | 12 +- src/infrastructure/api/accountRoutesApi.ts | 4 +- src/infrastructure/api/metadataRoutesApi.ts | 143 ------------ .../api/transactionRoutesApi.ts | 2 +- ...accountAddressRestrictionTransactionDTO.ts | 17 +- src/infrastructure/model/accountDTO.ts | 28 ++- .../model/accountIdsAddresses.ts | 48 ---- .../model/accountIdsPublicKeys.ts | 48 ---- .../model/accountLinkTransactionDTO.ts | 17 +- ...accountMosaicRestrictionModificationDTO.ts | 7 +- ...ntMosaicRestrictionModificationDTOAllOf.ts | 45 ---- .../accountMosaicRestrictionTransactionDTO.ts | 17 +- ...perationRestrictionModificationDTOAllOf.ts | 46 ---- ...countOperationRestrictionTransactionDTO.ts | 17 +- .../model/accountRestrictionDTO.ts | 2 +- .../accountRestrictionModificationDTO.ts | 46 ---- .../accountRestrictionModificationTypeEnum.ts | 35 --- .../accountRestrictionTransactionBodyDTO.ts | 53 ----- .../model/accountRestrictionTransactionDTO.ts | 104 --------- src/infrastructure/model/activityBucketDTO.ts | 3 + .../model/addressAliasTransactionBodyDTO.ts | 7 +- .../model/addressAliasTransactionDTO.ts | 24 +- ...ressMosaicRestrictionTransactionBodyDTO.ts | 28 ++- .../addressMosaicRestrictionTransactionDTO.ts | 45 +++- .../model/aggregateBondedTransactionDTO.ts | 17 +- .../model/aggregateCompleteTransactionDTO.ts | 17 +- .../model/aggregateTransactionDTO.ts | 110 ---------- src/infrastructure/model/aliasDTO.ts | 7 +- src/infrastructure/model/amount.ts | 34 --- .../model/artifactExpiryReceiptDTO.ts | 2 +- .../model/artifactExpiryReceiptDTOAllOf.ts | 2 +- .../model/balanceChangeReceiptDTO.ts | 14 +- .../model/balanceChangeReceiptDTOAllOf.ts | 14 +- .../model/balanceTransferReceiptDTO.ts | 14 +- .../model/balanceTransferReceiptDTOAllOf.ts | 14 +- src/infrastructure/model/blockDTO.ts | 24 +- src/infrastructure/model/blockDTOAllOf.ts | 21 +- src/infrastructure/model/blockDuration.ts | 34 --- src/infrastructure/model/blockMetaDTO.ts | 7 +- .../model/blockchainScoreDTO.ts | 51 ----- src/infrastructure/model/chainScoreDTO.ts | 14 +- .../model/communicationTimestamps.ts | 51 ----- .../model/communicationTimestampsDTO.ts | 14 +- .../model/cosignatoryModificationAction.ts | 35 --- src/infrastructure/model/cosignature.ts | 3 + src/infrastructure/model/cosignatureDTO.ts | 3 + src/infrastructure/model/difficulty.ts | 34 --- ...AccountAddressRestrictionTransactionDTO.ts | 14 +- .../embeddedAccountLinkTransactionDTO.ts | 14 +- ...dAccountMosaicRestrictionTransactionDTO.ts | 14 +- ...countOperationRestrictionTransactionDTO.ts | 14 +- ...mbeddedAccountRestrictionTransactionDTO.ts | 92 -------- .../embeddedAddressAliasTransactionDTO.ts | 21 +- ...dAddressMosaicRestrictionTransactionDTO.ts | 42 +++- ...edGlobalMosaicRestrictionTransactionDTO.ts | 49 +++-- .../model/embeddedHashLockTransactionDTO.ts | 24 +- ...ddedModifyMultisigAccountTransactionDTO.ts | 103 --------- .../embeddedMosaicAliasTransactionDTO.ts | 28 ++- .../embeddedMosaicDefinitionTransactionDTO.ts | 28 ++- ...mbeddedMosaicSupplyChangeTransactionDTO.ts | 28 ++- ...ltisigAccountModificationTransactionDTO.ts | 14 +- ...ddedNamespaceRegistrationTransactionDTO.ts | 35 ++- ...embeddedRegisterNamespaceTransactionDTO.ts | 109 --------- .../model/embeddedSecretLockTransactionDTO.ts | 35 ++- .../embeddedSecretProofTransactionDTO.ts | 14 +- .../model/embeddedTransactionDTO.ts | 14 +- .../model/embeddedTransactionInfoDTO.ts | 4 +- .../model/embeddedTransactionMetaDTO.ts | 7 +- .../model/embeddedTransferTransactionDTO.ts | 14 +- src/infrastructure/model/entityTypeEnum.ts | 53 ----- ...obalMosaicRestrictionTransactionBodyDTO.ts | 35 ++- .../globalMosaicRestrictionTransactionDTO.ts | 52 +++-- src/infrastructure/model/hashAlgorithmEnum.ts | 37 ---- .../model/hashLockTransactionBodyDTO.ts | 7 +- .../model/hashLockTransactionDTO.ts | 24 +- src/infrastructure/model/height.ts | 34 --- src/infrastructure/model/heightInfoDTO.ts | 7 +- src/infrastructure/model/importance.ts | 34 --- .../model/inflationReceiptDTO.ts | 14 +- .../model/inflationReceiptDTOAllOf.ts | 14 +- src/infrastructure/model/keyMetadataDTO.ts | 58 ----- src/infrastructure/model/linkActionEnum.ts | 35 --- src/infrastructure/model/merkleProofInfo.ts | 49 ----- src/infrastructure/model/metadataDTO.ts | 82 ------- src/infrastructure/model/metadataTypeEnum.ts | 36 --- src/infrastructure/model/models.ts | 30 --- ...modifyMultisigAccountTransactionBodyDTO.ts | 67 ------ .../modifyMultisigAccountTransactionDTO.ts | 112 ---------- src/infrastructure/model/mosaic.ts | 14 +- .../model/mosaicAliasTransactionBodyDTO.ts | 14 +- .../model/mosaicAliasTransactionDTO.ts | 31 ++- src/infrastructure/model/mosaicDTO.ts | 21 +- .../model/mosaicDefinitionDTO.ts | 79 ------- .../mosaicDefinitionTransactionBodyDTO.ts | 14 +- .../model/mosaicDefinitionTransactionDTO.ts | 31 ++- src/infrastructure/model/mosaicFlagsEnum.ts | 37 ---- src/infrastructure/model/mosaicId.ts | 34 --- src/infrastructure/model/mosaicMetaDTO.ts | 45 ---- src/infrastructure/model/mosaicNamesDTO.ts | 7 +- .../model/mosaicPropertiesDTO.ts | 7 +- src/infrastructure/model/mosaicPropertyDTO.ts | 52 ----- .../model/mosaicPropertyIdEnum.ts | 36 --- .../model/mosaicSupplyChangeDirectionEnum.ts | 35 --- .../mosaicSupplyChangeTransactionBodyDTO.ts | 14 +- .../model/mosaicSupplyChangeTransactionDTO.ts | 31 ++- src/infrastructure/model/mosaicsNamesDTO.ts | 4 +- ...ltisigAccountModificationTransactionDTO.ts | 17 +- .../model/multisigModificationTypeEnum.ts | 35 --- src/infrastructure/model/namespaceDTO.ts | 42 +++- src/infrastructure/model/namespaceId.ts | 34 --- src/infrastructure/model/namespaceNameDTO.ts | 14 +- ...namespaceRegistrationTransactionBodyDTO.ts | 21 +- .../namespaceRegistrationTransactionDTO.ts | 38 +++- src/infrastructure/model/namespaceTypeEnum.ts | 35 --- .../registerNamespaceTransactionBodyDTO.ts | 73 ------ .../model/registerNamespaceTransactionDTO.ts | 118 ---------- .../model/resolutionEntryDTO.ts | 2 +- ...taDTO.ts => resolutionStatementBodyDTO.ts} | 43 ++-- .../model/resolutionStatementDTO.ts | 25 +-- src/infrastructure/model/score.ts | 34 --- .../model/secretLockTransactionBodyDTO.ts | 21 +- .../model/secretLockTransactionDTO.ts | 38 +++- .../model/secretProofTransactionDTO.ts | 17 +- src/infrastructure/model/timestamp.ts | 34 --- .../model/transactionBodyDTO.ts | 14 +- src/infrastructure/model/transactionDTO.ts | 17 +- .../model/transactionInfoDTO.ts | 4 +- .../model/transactionMetaDTO.ts | 7 +- ...llOf.ts => transactionStatementBodyDTO.ts} | 28 ++- .../model/transactionStatementDTO.ts | 25 +-- .../model/transactionStatusDTO.ts | 14 +- .../model/transferTransactionDTO.ts | 17 +- src/infrastructure/model/unresolvedMosaic.ts | 14 +- .../model/unresolvedMosaicId.ts | 34 --- .../model/verifiableEntityDTO.ts | 3 + .../receipt/CreateReceiptFromDTO.ts | 23 +- .../transaction/CreateTransactionFromDTO.ts | 194 ++++++++-------- .../transaction/SerializeTransactionToJSON.ts | 8 +- src/model/UInt64.ts | 14 ++ src/model/receipt/BalanceChangeReceipt.ts | 6 +- src/model/receipt/BalanceTransferReceipt.ts | 4 +- src/model/receipt/ResolutionStatement.ts | 5 +- src/model/receipt/TransactionStatement.ts | 3 +- .../AccountAddressRestrictionTransaction.ts | 5 +- .../transaction/AccountLinkTransaction.ts | 19 +- .../transaction/AccountMetadataTransaction.ts | 5 +- .../AccountMosaicRestrictionTransaction.ts | 5 +- .../AccountRestrictionModification.ts | 18 +- .../transaction/AddressAliasTransaction.ts | 5 +- src/model/transaction/AggregateTransaction.ts | 25 ++- .../AggregateTransactionCosignature.ts | 2 +- .../CosignatureSignedTransaction.ts | 6 +- src/model/transaction/Deadline.ts | 5 +- src/model/transaction/LockFundsTransaction.ts | 5 +- .../MosaicAddressRestrictionTransaction.ts | 5 +- .../transaction/MosaicAliasTransaction.ts | 5 +- .../MosaicDefinitionTransaction.ts | 5 +- .../MosaicGlobalRestrictionTransaction.ts | 5 +- .../transaction/MosaicMetadataTransaction.ts | 5 +- .../MosaicSupplyChangeTransaction.ts | 5 +- .../MultisigAccountModificationTransaction.ts | 5 +- .../NamespaceMetadataTransaction.ts | 5 +- .../NamespaceRegistrationTransaction.ts | 5 +- .../transaction/SecretLockTransaction.ts | 21 +- .../transaction/SecretProofTransaction.ts | 19 +- src/model/transaction/SignedTransaction.ts | 6 +- src/model/transaction/Transaction.ts | 8 +- src/model/transaction/TransferTransaction.ts | 27 +-- src/service/AggregateTransactionService.ts | 8 +- test/core/utils/TransactionMapping.spec.ts | 25 ++- .../SerializeTransactionToJSON.spec.ts | 6 +- test/model/UInt64.spec.ts | 18 ++ test/model/blockchain/BlockInfo.spec.ts | 6 +- test/model/receipt/Receipt.spec.ts | 18 +- .../AccountLinkTransaction.spec.ts | 4 +- .../transaction/AggregateTransaction.spec.ts | 10 +- .../CosignatureTransaction.spec.ts | 14 +- test/model/transaction/Deadline.spec.ts | 2 +- .../transaction/SecretLockTransaction.spec.ts | 56 ++--- .../transaction/TransactionStatus.spec.ts | 2 +- .../TransactionStatusError.spec.ts | 2 +- .../transaction/TransferTransaction.spec.ts | 20 +- 196 files changed, 1709 insertions(+), 3592 deletions(-) delete mode 100644 src/infrastructure/api/metadataRoutesApi.ts delete mode 100644 src/infrastructure/model/accountIdsAddresses.ts delete mode 100644 src/infrastructure/model/accountIdsPublicKeys.ts delete mode 100644 src/infrastructure/model/accountMosaicRestrictionModificationDTOAllOf.ts delete mode 100644 src/infrastructure/model/accountOperationRestrictionModificationDTOAllOf.ts delete mode 100644 src/infrastructure/model/accountRestrictionModificationDTO.ts delete mode 100644 src/infrastructure/model/accountRestrictionModificationTypeEnum.ts delete mode 100644 src/infrastructure/model/accountRestrictionTransactionBodyDTO.ts delete mode 100644 src/infrastructure/model/accountRestrictionTransactionDTO.ts delete mode 100644 src/infrastructure/model/aggregateTransactionDTO.ts delete mode 100644 src/infrastructure/model/amount.ts delete mode 100644 src/infrastructure/model/blockDuration.ts delete mode 100644 src/infrastructure/model/blockchainScoreDTO.ts delete mode 100644 src/infrastructure/model/communicationTimestamps.ts delete mode 100644 src/infrastructure/model/cosignatoryModificationAction.ts delete mode 100644 src/infrastructure/model/difficulty.ts delete mode 100644 src/infrastructure/model/embeddedAccountRestrictionTransactionDTO.ts delete mode 100644 src/infrastructure/model/embeddedModifyMultisigAccountTransactionDTO.ts delete mode 100644 src/infrastructure/model/embeddedRegisterNamespaceTransactionDTO.ts delete mode 100644 src/infrastructure/model/entityTypeEnum.ts delete mode 100644 src/infrastructure/model/hashAlgorithmEnum.ts delete mode 100644 src/infrastructure/model/height.ts delete mode 100644 src/infrastructure/model/importance.ts delete mode 100644 src/infrastructure/model/keyMetadataDTO.ts delete mode 100644 src/infrastructure/model/linkActionEnum.ts delete mode 100644 src/infrastructure/model/merkleProofInfo.ts delete mode 100644 src/infrastructure/model/metadataDTO.ts delete mode 100644 src/infrastructure/model/metadataTypeEnum.ts delete mode 100644 src/infrastructure/model/modifyMultisigAccountTransactionBodyDTO.ts delete mode 100644 src/infrastructure/model/modifyMultisigAccountTransactionDTO.ts delete mode 100644 src/infrastructure/model/mosaicDefinitionDTO.ts delete mode 100644 src/infrastructure/model/mosaicFlagsEnum.ts delete mode 100644 src/infrastructure/model/mosaicId.ts delete mode 100644 src/infrastructure/model/mosaicMetaDTO.ts delete mode 100644 src/infrastructure/model/mosaicPropertyDTO.ts delete mode 100644 src/infrastructure/model/mosaicPropertyIdEnum.ts delete mode 100644 src/infrastructure/model/mosaicSupplyChangeDirectionEnum.ts delete mode 100644 src/infrastructure/model/multisigModificationTypeEnum.ts delete mode 100644 src/infrastructure/model/namespaceId.ts delete mode 100644 src/infrastructure/model/namespaceTypeEnum.ts delete mode 100644 src/infrastructure/model/registerNamespaceTransactionBodyDTO.ts delete mode 100644 src/infrastructure/model/registerNamespaceTransactionDTO.ts rename src/infrastructure/model/{accountMetaDTO.ts => resolutionStatementBodyDTO.ts} (60%) delete mode 100644 src/infrastructure/model/score.ts delete mode 100644 src/infrastructure/model/timestamp.ts rename src/infrastructure/model/{accountAddressRestrictionModificationDTOAllOf.ts => transactionStatementBodyDTO.ts} (67%) delete mode 100644 src/infrastructure/model/unresolvedMosaicId.ts diff --git a/e2e/infrastructure/AccountHttp.spec.ts b/e2e/infrastructure/AccountHttp.spec.ts index a5193df19d..94bd22c52d 100644 --- a/e2e/infrastructure/AccountHttp.spec.ts +++ b/e2e/infrastructure/AccountHttp.spec.ts @@ -134,7 +134,7 @@ describe('AccountHttp', () => { const registerNamespaceTransaction = NamespaceRegistrationTransaction.createRootNamespace( Deadline.create(), namespaceName, - UInt64.fromUint(1000), + UInt64.fromUint(5), NetworkType.MIJIN_TEST, ); namespaceId = new NamespaceId(namespaceName); @@ -183,7 +183,7 @@ describe('AccountHttp', () => { }); }); - describe('Setup Test AccountAddressProperty', () => { + describe('Setup Test AccountAddressRestriction', () => { let listener: Listener; before (() => { listener = new Listener(config.apiUrl); @@ -200,12 +200,11 @@ describe('AccountHttp', () => { ); const addressModification = AccountRestrictionTransaction.createAddressRestrictionModificationTransaction( Deadline.create(), - AccountRestrictionType.BlockIncomingAddress, + AccountRestrictionType.AllowIncomingAddress, [addressPropertyFilter], NetworkType.MIJIN_TEST, ); const signedTransaction = addressModification.signWith(account, generationHash); - listener.confirmed(account.address).subscribe(() => { done(); }); @@ -307,7 +306,7 @@ describe('AccountHttp', () => { describe('getMultisigAccountGraphInfo', () => { it('should call getMultisigAccountGraphInfo successfully', (done) => { setTimeout(() => { - accountHttp.getMultisigAccountGraphInfo(multisigAccount.address).subscribe((multisigAccountGraphInfo) => { + accountHttp.getMultisigAccountGraphInfo(multisigAccount.publicAccount).subscribe((multisigAccountGraphInfo) => { expect(multisigAccountGraphInfo.multisigAccounts.get(0)![0]. account.publicKey).to.be.equal(multisigAccount.publicKey); done(); @@ -318,7 +317,7 @@ describe('AccountHttp', () => { describe('getMultisigAccountInfo', () => { it('should call getMultisigAccountInfo successfully', (done) => { setTimeout(() => { - accountHttp.getMultisigAccountInfo(multisigAccount.address).subscribe((multisigAccountInfo) => { + accountHttp.getMultisigAccountInfo(multisigAccount.publicAccount).subscribe((multisigAccountInfo) => { expect(multisigAccountInfo.account.publicKey).to.be.equal(multisigAccount.publicKey); done(); }); @@ -426,12 +425,11 @@ describe('AccountHttp', () => { ); const addressModification = AccountRestrictionTransaction.createAddressRestrictionModificationTransaction( Deadline.create(), - AccountRestrictionType.BlockIncomingAddress, + AccountRestrictionType.AllowIncomingAddress, [addressPropertyFilter], NetworkType.MIJIN_TEST, ); const signedTransaction = addressModification.signWith(account, generationHash); - listener.confirmed(account.address).subscribe(() => { done(); }); diff --git a/e2e/infrastructure/TransactionHttp.spec.ts b/e2e/infrastructure/TransactionHttp.spec.ts index 80a86a52fc..b558c448b3 100644 --- a/e2e/infrastructure/TransactionHttp.spec.ts +++ b/e2e/infrastructure/TransactionHttp.spec.ts @@ -171,88 +171,88 @@ describe('TransactionHttp', () => { }); }); - describe('MosaicDefinitionTransaction', () => { - let listener: Listener; - before (() => { - listener = new Listener(config.apiUrl); - return listener.open(); - }); - after(() => { - return listener.close(); - }); - it('aggregate', (done) => { - const nonce = MosaicNonce.createRandom(); - const mosaicDefinitionTransaction = MosaicDefinitionTransaction.create( - Deadline.create(), - nonce, - MosaicId.createFromNonce(nonce, account.publicAccount), - MosaicProperties.create({ - supplyMutable: true, - transferable: true, - divisibility: 3, - restrictable: true, - }), - NetworkType.MIJIN_TEST, - ); - const aggregateTransaction = AggregateTransaction.createComplete(Deadline.create(), - [mosaicDefinitionTransaction.toAggregate(account.publicAccount)], - NetworkType.MIJIN_TEST, - []); - const signedTransaction = aggregateTransaction.signWith(account, generationHash); - listener.confirmed(account.address).subscribe((transaction: Transaction) => { - done(); - }); - listener.status(account.address).subscribe((error) => { - console.log('Error:', error); - assert(false); - done(); - }); - transactionHttp.announce(signedTransaction); - }); - }); - - describe('AccountMetadataTransaction', () => { - let listener: Listener; - before (() => { - listener = new Listener(config.apiUrl); - return listener.open(); - }); - after(() => { - return listener.close(); - }); - it('aggregate', (done) => { - const accountMetadataTransaction = AccountMetadataTransaction.create( - Deadline.create(), - account.publicKey, - UInt64.fromUint(1000), - 10, - new Uint8Array(10), - NetworkType.MIJIN_TEST, - ); + // describe('MosaicDefinitionTransaction', () => { + // let listener: Listener; + // before (() => { + // listener = new Listener(config.apiUrl); + // return listener.open(); + // }); + // after(() => { + // return listener.close(); + // }); + // it('aggregate', (done) => { + // const nonce = MosaicNonce.createRandom(); + // const mosaicDefinitionTransaction = MosaicDefinitionTransaction.create( + // Deadline.create(), + // nonce, + // MosaicId.createFromNonce(nonce, account.publicAccount), + // MosaicProperties.create({ + // supplyMutable: true, + // transferable: true, + // divisibility: 3, + // restrictable: true, + // }), + // NetworkType.MIJIN_TEST, + // ); + // const aggregateTransaction = AggregateTransaction.createComplete(Deadline.create(), + // [mosaicDefinitionTransaction.toAggregate(account.publicAccount)], + // NetworkType.MIJIN_TEST, + // []); + // const signedTransaction = aggregateTransaction.signWith(account, generationHash); + // listener.confirmed(account.address).subscribe((transaction: Transaction) => { + // done(); + // }); + // listener.status(account.address).subscribe((error) => { + // console.log('Error:', error); + // assert(false); + // done(); + // }); + // transactionHttp.announce(signedTransaction); + // }); + // }); - const aggregateTransaction = AggregateTransaction.createComplete(Deadline.create(), - [accountMetadataTransaction.toAggregate(account.publicAccount)], - NetworkType.MIJIN_TEST, - [], - ); - const signedTransaction = aggregateTransaction.signWith(account, generationHash); - listener.confirmed(account.address).subscribe((transaction: AggregateTransaction) => { - transaction.innerTransactions.forEach((innerTx) => { - expect((innerTx as AccountMetadataTransaction).targetPublicKey, 'TargetPublicKey').not.to.be.undefined; - expect((innerTx as AccountMetadataTransaction).scopedMetadataKey, 'ScopedMetadataKey').not.to.be.undefined; - expect((innerTx as AccountMetadataTransaction).valueSizeDelta, 'ValueSizeDelta').not.to.be.undefined; - expect((innerTx as AccountMetadataTransaction).value, 'Value').not.to.be.undefined; - }); - done(); - }); - listener.status(account.address).subscribe((error) => { - console.log('Error:', error); - assert(false); - done(); - }); - transactionHttp.announce(signedTransaction); - }); - }); + // describe('AccountMetadataTransaction', () => { + // let listener: Listener; + // before (() => { + // listener = new Listener(config.apiUrl); + // return listener.open(); + // }); + // after(() => { + // return listener.close(); + // }); + // it('aggregate', (done) => { + // const accountMetadataTransaction = AccountMetadataTransaction.create( + // Deadline.create(), + // account.publicKey, + // UInt64.fromUint(5), + // 10, + // new Uint8Array(10), + // NetworkType.MIJIN_TEST, + // ); + + // const aggregateTransaction = AggregateTransaction.createComplete(Deadline.create(), + // [accountMetadataTransaction.toAggregate(account.publicAccount)], + // NetworkType.MIJIN_TEST, + // [], + // ); + // const signedTransaction = aggregateTransaction.signWith(account, generationHash); + // listener.confirmed(account.address).subscribe((transaction: AggregateTransaction) => { + // transaction.innerTransactions.forEach((innerTx) => { + // expect((innerTx as AccountMetadataTransaction).targetPublicKey, 'TargetPublicKey').not.to.be.undefined; + // expect((innerTx as AccountMetadataTransaction).scopedMetadataKey, 'ScopedMetadataKey').not.to.be.undefined; + // expect((innerTx as AccountMetadataTransaction).valueSizeDelta, 'ValueSizeDelta').not.to.be.undefined; + // expect((innerTx as AccountMetadataTransaction).value, 'Value').not.to.be.undefined; + // }); + // done(); + // }); + // listener.status(account.address).subscribe((error) => { + // console.log('Error:', error); + // assert(false); + // done(); + // }); + // transactionHttp.announce(signedTransaction); + // }); + // }); describe('MosaicMetadataTransaction', () => { let listener: Listener; @@ -267,7 +267,7 @@ describe('TransactionHttp', () => { const mosaicMetadataTransaction = MosaicMetadataTransaction.create( Deadline.create(), account.publicKey, - UInt64.fromUint(1000), + UInt64.fromUint(5), mosaicId, 10, new Uint8Array(10), @@ -313,7 +313,7 @@ describe('TransactionHttp', () => { const registerNamespaceTransaction = NamespaceRegistrationTransaction.createRootNamespace( Deadline.create(), namespaceName, - UInt64.fromUint(1000), + UInt64.fromUint(5), NetworkType.MIJIN_TEST, ); namespaceId = new NamespaceId(namespaceName); @@ -346,7 +346,7 @@ describe('TransactionHttp', () => { const registerNamespaceTransaction = NamespaceRegistrationTransaction.createRootNamespace( Deadline.create(), 'root-test-namespace-' + Math.floor(Math.random() * 10000), - UInt64.fromUint(1000), + UInt64.fromUint(5), NetworkType.MIJIN_TEST, ); const aggregateTransaction = AggregateTransaction.createComplete(Deadline.create(), @@ -379,7 +379,7 @@ describe('TransactionHttp', () => { const namespaceMetadataTransaction = NamespaceMetadataTransaction.create( Deadline.create(), account.publicKey, - UInt64.fromUint(1000), + UInt64.fromUint(5), namespaceId, 10, new Uint8Array(10), @@ -545,7 +545,7 @@ describe('TransactionHttp', () => { listener.confirmed(account.address).subscribe((transaction: TransferTransaction) => { expect(transaction.message, 'Message').not.to.be.undefined; expect(transaction.mosaics, 'Mosaic').not.to.be.undefined; - expect(transaction.recipient, 'Recipient').not.to.be.undefined; + expect(transaction.recipientAddress, 'RecipientAddress').not.to.be.undefined; done(); }); listener.status(account.address).subscribe((error) => { @@ -988,7 +988,7 @@ describe('TransactionHttp', () => { const signedTransaction = accountLinkTransaction.signWith(account, generationHash); listener.confirmed(account.address).subscribe((transaction: AccountLinkTransaction) => { - expect(transaction.remoteAccountKey, 'RemoteAccountKey').not.to.be.undefined; + expect(transaction.remotePublicKey, 'RemotePublicKey').not.to.be.undefined; expect(transaction.linkAction, 'LinkAction').not.to.be.undefined; done(); }); @@ -1408,7 +1408,7 @@ describe('TransactionHttp', () => { expect(transaction.duration, 'Duration').not.to.be.undefined; expect(transaction.hashType, 'HashType').not.to.be.undefined; expect(transaction.secret, 'Secret').not.to.be.undefined; - expect(transaction.recipient, 'Recipient').not.to.be.undefined; + expect(transaction.recipientAddress, 'RecipientAddress').not.to.be.undefined; done(); }); listener.status(account.address).subscribe((error) => { @@ -1676,7 +1676,7 @@ describe('TransactionHttp', () => { listener.confirmed(account.address).subscribe(() => { listener.confirmed(account2.address).subscribe((transaction: SecretProofTransaction) => { expect(transaction.secret, 'Secret').not.to.be.undefined; - expect(transaction.recipient, 'Recipient').not.to.be.undefined; + expect(transaction.recipientAddress, 'RecipientAddress').not.to.be.undefined; expect(transaction.hashType, 'HashType').not.to.be.undefined; expect(transaction.proof, 'Proof').not.to.be.undefined; done(); @@ -2098,7 +2098,7 @@ describe('TransactionHttp', () => { // 03. Alice collects the cosignatures, recreate, sign, and announces the transaction const cosignatureSignedTransactions = [ - new CosignatureSignedTransaction(signedTxBob.parentHash, signedTxBob.signature, signedTxBob.signer), + new CosignatureSignedTransaction(signedTxBob.parentHash, signedTxBob.signature, signedTxBob.signerPublicKey), ]; const recreatedTx = TransactionMapping.createFromPayload(aliceSignedTransaction.payload) as AggregateTransaction; @@ -2256,31 +2256,4 @@ describe('TransactionHttp', () => { }); }); }); - // describe('announceSync', () => { - // it('should return insufficient balance error', (done) => { - // const aggregateTransaction = AggregateTransaction.createBonded( - // Deadline.create(), - // [], - // NetworkType.MIJIN_TEST, - // [], - // ); - // const signedTransaction = account.sign(aggregateTransaction); - - // const lockFundsTransaction = LockFundsTransaction.create(Deadline.create(), - // NetworkCurrencyMosaic.createAbsolute(0), - // UInt64.fromUint(10000), - // signedTransaction, - // NetworkType.MIJIN_TEST); - - // transactionHttp - // .announceSync(lockFundsTransaction.signWith(account, generationHash)) - // .subscribe((shouldNotBeCalled) => { - // throw new Error('should not be called'); - // }, (err) => { - // console.log(err); - // expect(err.status).to.be.equal('Failure_LockHash_Invalid_Mosaic_Amount'); - // done(); - // }); - // }); - // }); }); diff --git a/e2e/infrastructure/transaction/CreateTransactionFromDTO.spec.ts b/e2e/infrastructure/transaction/CreateTransactionFromDTO.spec.ts index 15da95bcd9..95ba819780 100644 --- a/e2e/infrastructure/transaction/CreateTransactionFromDTO.spec.ts +++ b/e2e/infrastructure/transaction/CreateTransactionFromDTO.spec.ts @@ -38,12 +38,12 @@ describe('CreateTransactionFromDTO', () => { transaction: { // tslint:disable-next-line:max-line-length signature: '7442156D839A3AC900BC0299E8701ECDABA674DCF91283223450953B005DE72C538EA54236F5E089530074CE78067CD3325CF53750B9118154C08B20A5CDC00D', - signer: '2FC3872A792933617D70E02AFF8FBDE152821A0DF0CA5FB04CB56FC3D21C8863', + signerPublicKey: '2FC3872A792933617D70E02AFF8FBDE152821A0DF0CA5FB04CB56FC3D21C8863', version: 36865, type: 16724, maxFee: [0, 0], deadline: [3362498678, 22], - recipient: '906415867F121D037AF447E711B0F5E4D52EBBF066D96860EB', + recipientAddress: '906415867F121D037AF447E711B0F5E4D52EBBF066D96860EB', message: { payload: '746573742D6D657373616765', type: 0, @@ -58,7 +58,7 @@ describe('CreateTransactionFromDTO', () => { }; const transferTransaction = CreateTransactionFromDTO(transferTransactionDTO) as TransferTransaction; - deepEqual(transferTransaction.recipient, Address.createFromEncoded(transferTransactionDTO.transaction.recipient)); + deepEqual(transferTransaction.recipientAddress, Address.createFromEncoded(transferTransactionDTO.transaction.recipientAddress)); expect(transferTransaction.message.payload).to.be.equal('test-message'); }); @@ -77,12 +77,12 @@ describe('CreateTransactionFromDTO', () => { transaction: { // tslint:disable-next-line:max-line-length signature: '7442156D839A3AC900BC0299E8701ECDABA674DCF91283223450953B005DE72C538EA54236F5E089530074CE78067CD3325CF53750B9118154C08B20A5CDC00D', - signer: '2FC3872A792933617D70E02AFF8FBDE152821A0DF0CA5FB04CB56FC3D21C8863', + signerPublicKey: '2FC3872A792933617D70E02AFF8FBDE152821A0DF0CA5FB04CB56FC3D21C8863', version: 36865, type: 16724, maxFee: [0, 0], deadline: [3362498678, 22], - recipient: '906415867F121D037AF447E711B0F5E4D52EBBF066D96860EB', + recipientAddress: '906415867F121D037AF447E711B0F5E4D52EBBF066D96860EB', mosaics: [ { id: [3294802500, 2243684972], @@ -93,7 +93,7 @@ describe('CreateTransactionFromDTO', () => { }; const transferTransaction = CreateTransactionFromDTO(transferTransactionDTO) as TransferTransaction; - deepEqual(transferTransaction.recipient, Address.createFromEncoded(transferTransactionDTO.transaction.recipient)); + deepEqual(transferTransaction.recipientAddress, Address.createFromEncoded(transferTransactionDTO.transaction.recipientAddress)); expect(transferTransaction.message.payload).to.be.equal(''); }); @@ -114,7 +114,7 @@ describe('CreateTransactionFromDTO', () => { { signature: '5780C8DF9D46BA2BCF029DCC5D3BF55FE1CB5BE7ABCF30387C4637DD' + 'EDFC2152703CA0AD95F21BB9B942F3CC52FCFC2064C7B84CF60D1A9E69195F1943156C07', - signer: 'A5F82EC8EBB341427B6785C8111906CD0DF18838FB11B51CE0E18B5E79DFF630', + signerPublicKey: 'A5F82EC8EBB341427B6785C8111906CD0DF18838FB11B51CE0E18B5E79DFF630', }, ], deadline: [ @@ -127,7 +127,7 @@ describe('CreateTransactionFromDTO', () => { ], signature: '939673209A13FF82397578D22CC96EB8516A6760C894D9B7535E3A1E0680' + '07B9255CFA9A914C97142A7AE18533E381C846B69D2AE0D60D1DC8A55AD120E2B606', - signer: '7681ED5023141D9CDCF184E5A7B60B7D466739918ED5DA30F7E71EA7B86EFF2D', + signerPublicKey: '7681ED5023141D9CDCF184E5A7B60B7D466739918ED5DA30F7E71EA7B86EFF2D', transactions: [ { meta: { @@ -157,8 +157,8 @@ describe('CreateTransactionFromDTO', () => { ], }, ], - recipient: '9050B9837EFAB4BBE8A4B9BB32D812F9885C00D8FC1650E142', - signer: 'B4F12E7C9F6946091E2CB8B6D3A12B50D17CCBBF646386EA27CE2946A7423DCF', + recipientAddress: '9050B9837EFAB4BBE8A4B9BB32D812F9885C00D8FC1650E142', + signerPublicKey: 'B4F12E7C9F6946091E2CB8B6D3A12B50D17CCBBF646386EA27CE2946A7423DCF', type: 16724, version: 36865, }, @@ -210,7 +210,7 @@ describe('CreateTransactionFromDTO', () => { namespaceType: 0, signature: '553E696EB4A54E43A11D180EBA57E4B89D0048C9DD2604A9E0608120018B9E0' + '2F6EE63025FEEBCED3293B622AF8581334D0BDAB7541A9E7411E7EE4EF0BC5D0E', - signer: 'B4F12E7C9F6946091E2CB8B6D3A12B50D17CCBBF646386EA27CE2946A7423DCF', + signerPublicKey: 'B4F12E7C9F6946091E2CB8B6D3A12B50D17CCBBF646386EA27CE2946A7423DCF', type: 16718, version: 36865, }, @@ -238,7 +238,7 @@ describe('CreateTransactionFromDTO', () => { { signature: '5780C8DF9D46BA2BCF029DCC5D3BF55FE1CB5BE7ABCF30387C4637DD' + 'EDFC2152703CA0AD95F21BB9B942F3CC52FCFC2064C7B84CF60D1A9E69195F1943156C07', - signer: 'A5F82EC8EBB341427B6785C8111906CD0DF18838FB11B51CE0E18B5E79DFF630', + signerPublicKey: 'A5F82EC8EBB341427B6785C8111906CD0DF18838FB11B51CE0E18B5E79DFF630', }, ], deadline: [ @@ -251,7 +251,7 @@ describe('CreateTransactionFromDTO', () => { ], signature: '939673209A13FF82397578D22CC96EB8516A6760C894D9B7535E3A1E0680' + '07B9255CFA9A914C97142A7AE18533E381C846B69D2AE0D60D1DC8A55AD120E2B606', - signer: '7681ED5023141D9CDCF184E5A7B60B7D466739918ED5DA30F7E71EA7B86EFF2D', + signerPublicKey: '7681ED5023141D9CDCF184E5A7B60B7D466739918ED5DA30F7E71EA7B86EFF2D', transactions: [ { meta: { @@ -275,7 +275,7 @@ describe('CreateTransactionFromDTO', () => { 4152736179, ], namespaceType: 0, - signer: 'B4F12E7C9F6946091E2CB8B6D3A12B50D17CCBBF646386EA27CE2946A7423DCF', + signerPublicKey: 'B4F12E7C9F6946091E2CB8B6D3A12B50D17CCBBF646386EA27CE2946A7423DCF', type: 16718, version: 36865, }, @@ -329,7 +329,7 @@ describe('CreateTransactionFromDTO', () => { ], signature: '553E696EB4A54E43A11D180EBA57E4B89D0048C9DD2604A9E0608120018B9' + 'E02F6EE63025FEEBCED3293B622AF8581334D0BDAB7541A9E7411E7EE4EF0BC5D0E', - signer: 'B4F12E7C9F6946091E2CB8B6D3A12B50D17CCBBF646386EA27CE2946A7423DCF', + signerPublicKey: 'B4F12E7C9F6946091E2CB8B6D3A12B50D17CCBBF646386EA27CE2946A7423DCF', type: 16718, version: 36865, }, @@ -356,7 +356,7 @@ describe('CreateTransactionFromDTO', () => { { signature: '5780C8DF9D46BA2BCF029DCC5D3BF55FE1CB5BE7ABCF30387C4637DD' + 'EDFC2152703CA0AD95F21BB9B942F3CC52FCFC2064C7B84CF60D1A9E69195F1943156C07', - signer: 'A5F82EC8EBB341427B6785C8111906CD0DF18838FB11B51CE0E18B5E79DFF630', + signerPublicKey: 'A5F82EC8EBB341427B6785C8111906CD0DF18838FB11B51CE0E18B5E79DFF630', }, ], deadline: [ @@ -369,7 +369,7 @@ describe('CreateTransactionFromDTO', () => { ], signature: '939673209A13FF82397578D22CC96EB8516A6760C894D9B7535E3A1E0680' + '07B9255CFA9A914C97142A7AE18533E381C846B69D2AE0D60D1DC8A55AD120E2B606', - signer: '7681ED5023141D9CDCF184E5A7B60B7D466739918ED5DA30F7E71EA7B86EFF2D', + signerPublicKey: '7681ED5023141D9CDCF184E5A7B60B7D466739918ED5DA30F7E71EA7B86EFF2D', transactions: [ { meta: { @@ -393,7 +393,7 @@ describe('CreateTransactionFromDTO', () => { 3316183705, 3829351378, ], - signer: 'B4F12E7C9F6946091E2CB8B6D3A12B50D17CCBBF646386EA27CE2946A7423DCF', + signerPublicKey: 'B4F12E7C9F6946091E2CB8B6D3A12B50D17CCBBF646386EA27CE2946A7423DCF', type: 16718, version: 36865, }, @@ -468,7 +468,7 @@ describe('CreateTransactionFromDTO', () => { ], signature: '553E696EB4A54E43A11D180EBA57E4B89D0048C9DD2604A9E0608120018B9E02F6EE63025FE' + 'EBCED3293B622AF8581334D0BDAB7541A9E7411E7EE4EF0BC5D0E', - signer: 'B4F12E7C9F6946091E2CB8B6D3A12B50D17CCBBF646386EA27CE2946A7423DCF', + signerPublicKey: 'B4F12E7C9F6946091E2CB8B6D3A12B50D17CCBBF646386EA27CE2946A7423DCF', type: 16717, version: 36865, }, @@ -496,7 +496,7 @@ describe('CreateTransactionFromDTO', () => { { signature: '5780C8DF9D46BA2BCF029DCC5D3BF55FE1CB5BE7ABCF30387C4637DD' + 'EDFC2152703CA0AD95F21BB9B942F3CC52FCFC2064C7B84CF60D1A9E69195F1943156C07', - signer: 'A5F82EC8EBB341427B6785C8111906CD0DF18838FB11B51CE0E18B5E79DFF630', + signerPublicKey: 'A5F82EC8EBB341427B6785C8111906CD0DF18838FB11B51CE0E18B5E79DFF630', }, ], deadline: [ @@ -509,7 +509,7 @@ describe('CreateTransactionFromDTO', () => { ], signature: '939673209A13FF82397578D22CC96EB8516A6760C894D9B7535E3A1E0680' + '07B9255CFA9A914C97142A7AE18533E381C846B69D2AE0D60D1DC8A55AD120E2B606', - signer: '7681ED5023141D9CDCF184E5A7B60B7D466739918ED5DA30F7E71EA7B86EFF2D', + signerPublicKey: '7681ED5023141D9CDCF184E5A7B60B7D466739918ED5DA30F7E71EA7B86EFF2D', transactions: [ { meta: { @@ -554,7 +554,7 @@ describe('CreateTransactionFromDTO', () => { ], }, ], - signer: 'B4F12E7C9F6946091E2CB8B6D3A12B50D17CCBBF646386EA27CE2946A7423DCF', + signerPublicKey: 'B4F12E7C9F6946091E2CB8B6D3A12B50D17CCBBF646386EA27CE2946A7423DCF', type: 16717, version: 36865, }, @@ -606,7 +606,7 @@ describe('CreateTransactionFromDTO', () => { ], signature: '553E696EB4A54E43A11D180EBA57E4B89D0048C9DD2604A9E0608120018B9E0' + '2F6EE63025FEEBCED3293B622AF8581334D0BDAB7541A9E7411E7EE4EF0BC5D0E', - signer: 'B4F12E7C9F6946091E2CB8B6D3A12B50D17CCBBF646386EA27CE2946A7423DCF', + signerPublicKey: 'B4F12E7C9F6946091E2CB8B6D3A12B50D17CCBBF646386EA27CE2946A7423DCF', type: 16973, version: 36865, }, @@ -634,7 +634,7 @@ describe('CreateTransactionFromDTO', () => { { signature: '5780C8DF9D46BA2BCF029DCC5D3BF55FE1CB5BE7ABCF30387C4637DD' + 'EDFC2152703CA0AD95F21BB9B942F3CC52FCFC2064C7B84CF60D1A9E69195F1943156C07', - signer: 'A5F82EC8EBB341427B6785C8111906CD0DF18838FB11B51CE0E18B5E79DFF630', + signerPublicKey: 'A5F82EC8EBB341427B6785C8111906CD0DF18838FB11B51CE0E18B5E79DFF630', }, ], deadline: [ @@ -647,7 +647,7 @@ describe('CreateTransactionFromDTO', () => { ], signature: '939673209A13FF82397578D22CC96EB8516A6760C894D9B7535E3A1E0680' + '07B9255CFA9A914C97142A7AE18533E381C846B69D2AE0D60D1DC8A55AD120E2B606', - signer: '7681ED5023141D9CDCF184E5A7B60B7D466739918ED5DA30F7E71EA7B86EFF2D', + signerPublicKey: '7681ED5023141D9CDCF184E5A7B60B7D466739918ED5DA30F7E71EA7B86EFF2D', transactions: [ { meta: { @@ -670,7 +670,7 @@ describe('CreateTransactionFromDTO', () => { 3070467832, 2688515262, ], - signer: 'B4F12E7C9F6946091E2CB8B6D3A12B50D17CCBBF646386EA27CE2946A7423DCF', + signerPublicKey: 'B4F12E7C9F6946091E2CB8B6D3A12B50D17CCBBF646386EA27CE2946A7423DCF', type: 16973, version: 36865, }, @@ -721,7 +721,7 @@ describe('CreateTransactionFromDTO', () => { ], signature: '553E696EB4A54E43A11D180EBA57E4B89D0048C9DD2604A9E0608120018B9E0' + '2F6EE63025FEEBCED3293B622AF8581334D0BDAB7541A9E7411E7EE4EF0BC5D0E', - signer: 'B4F12E7C9F6946091E2CB8B6D3A12B50D17CCBBF646386EA27CE2946A7423DCF', + signerPublicKey: 'B4F12E7C9F6946091E2CB8B6D3A12B50D17CCBBF646386EA27CE2946A7423DCF', type: 16725, version: 36865, }, @@ -750,7 +750,7 @@ describe('CreateTransactionFromDTO', () => { { signature: '5780C8DF9D46BA2BCF029DCC5D3BF55FE1CB5BE7ABCF30387C4637DD' + 'EDFC2152703CA0AD95F21BB9B942F3CC52FCFC2064C7B84CF60D1A9E69195F1943156C07', - signer: 'A5F82EC8EBB341427B6785C8111906CD0DF18838FB11B51CE0E18B5E79DFF630', + signerPublicKey: 'A5F82EC8EBB341427B6785C8111906CD0DF18838FB11B51CE0E18B5E79DFF630', }, ], deadline: [ @@ -763,7 +763,7 @@ describe('CreateTransactionFromDTO', () => { ], signature: '939673209A13FF82397578D22CC96EB8516A6760C894D9B7535E3A1E0680' + '07B9255CFA9A914C97142A7AE18533E381C846B69D2AE0D60D1DC8A55AD120E2B606', - signer: '7681ED5023141D9CDCF184E5A7B60B7D466739918ED5DA30F7E71EA7B86EFF2D', + signerPublicKey: '7681ED5023141D9CDCF184E5A7B60B7D466739918ED5DA30F7E71EA7B86EFF2D', transactions: [ { meta: { @@ -786,7 +786,7 @@ describe('CreateTransactionFromDTO', () => { modificiationType: 0, }, ], - signer: 'B4F12E7C9F6946091E2CB8B6D3A12B50D17CCBBF646386EA27CE2946A7423DCF', + signerPublicKey: 'B4F12E7C9F6946091E2CB8B6D3A12B50D17CCBBF646386EA27CE2946A7423DCF', type: 16725, version: 36865, }, diff --git a/e2e/infrastructure/transaction/ValidateTransaction.ts b/e2e/infrastructure/transaction/ValidateTransaction.ts index 4d2640f915..d180783419 100644 --- a/e2e/infrastructure/transaction/ValidateTransaction.ts +++ b/e2e/infrastructure/transaction/ValidateTransaction.ts @@ -16,14 +16,14 @@ import {deepEqual} from 'assert'; import {expect} from 'chai'; -import {MultisigCosignatoryModification} from '../../../src/model/transaction/MultisigCosignatoryModification'; -import {TransactionType} from '../../../src/model/transaction/TransactionType'; -import {UInt64} from '../../../src/model/UInt64'; import {Address} from '../../../src/model/account/Address'; -import { NamespaceId } from '../../../src/model/namespace/NamespaceId'; -import { MosaicId } from '../../../src/model/mosaic/MosaicId'; import { PublicAccount } from '../../../src/model/account/PublicAccount'; import { NetworkType } from '../../../src/model/blockchain/NetworkType'; +import { MosaicId } from '../../../src/model/mosaic/MosaicId'; +import { NamespaceId } from '../../../src/model/namespace/NamespaceId'; +import {MultisigCosignatoryModification} from '../../../src/model/transaction/MultisigCosignatoryModification'; +import {TransactionType} from '../../../src/model/transaction/TransactionType'; +import {UInt64} from '../../../src/model/UInt64'; const ValidateTransaction = { validateStandaloneTx: (transaction, transactionDTO) => { @@ -41,7 +41,7 @@ const ValidateTransaction = { expect(transaction.signature) .to.be.equal(transactionDTO.transaction.signature); expect(transaction.signer.publicKey) - .to.be.equal(transactionDTO.transaction.signer); + .to.be.equal(transactionDTO.transaction.signerPublicKey); expect(transaction.networkType) .to.be.equal(parseInt(transactionDTO.transaction.version.toString(16).substr(0, 2), 16)); expect(transaction.version) @@ -80,7 +80,7 @@ const ValidateTransaction = { expect(aggregateTransaction.signature) .to.be.equal(aggregateTransactionDTO.transaction.signature); expect(aggregateTransaction.signer.publicKey) - .to.be.equal(aggregateTransactionDTO.transaction.signer); + .to.be.equal(aggregateTransactionDTO.transaction.signerPublicKey); expect(aggregateTransaction.networkType) .to.be.equal(parseInt(aggregateTransactionDTO.transaction.version.toString(16).substr(0, 2), 16)); expect(aggregateTransaction.version) @@ -147,8 +147,8 @@ const ValidateTransaction = { } }, validateTransferTx: (transferTransaction, transferTransactionDTO) => { - deepEqual(transferTransaction.recipient, - Address.createFromEncoded(transferTransactionDTO.transaction.recipient)); + deepEqual(transferTransaction.recipientAddress, + Address.createFromEncoded(transferTransactionDTO.transaction.recipientAddress)); expect(transferTransaction.message.payload) .to.be.equal('test-message'); }, diff --git a/package-lock.json b/package-lock.json index 23ffcf8fd2..c393e5d09f 100644 --- a/package-lock.json +++ b/package-lock.json @@ -37,6 +37,11 @@ "integrity": "sha512-tOSvCVrvSqFZ4A/qrqqm6p37GZoawsZtoR0SJhlF7EonNZUgrn8FfT+RNQ11h+NUpMt6QVe36033f3qEKBwfWA==", "dev": true }, + "@types/long": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/@types/long/-/long-4.0.0.tgz", + "integrity": "sha512-1w52Nyx4Gq47uuu0EVcsHBxZFJgurQ+rTKS3qMHxR1GY2T8c2AJYd6vZoZ9q1rupaDjU0yT+Jc2XTyXkjeMA+Q==" + }, "@types/mocha": { "version": "2.2.48", "resolved": "https://registry.npmjs.org/@types/mocha/-/mocha-2.2.48.tgz", @@ -2735,6 +2740,11 @@ "integrity": "sha512-U7KCmLdqsGHBLeWqYlFA0V0Sl6P08EE1ZrmA9cxjUE0WVqT9qnyVDPz1kzpFEP0jdJuFnasWIfSd7fsaNXkpbg==", "dev": true }, + "long": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/long/-/long-4.0.0.tgz", + "integrity": "sha512-XsP+KhQif4bjX1kbuSiySJFNAehNxgLb6hPRGJ9QsUr8ajHkuXGdrHmFUTUUXhDwVX2R5bY4JNZEwbUiMhV+MA==" + }, "make-error": { "version": "1.3.4", "resolved": "https://registry.npmjs.org/make-error/-/make-error-1.3.4.tgz", diff --git a/package.json b/package.json index 86325675c6..fb93cbbb0e 100644 --- a/package.json +++ b/package.json @@ -55,15 +55,17 @@ "typescript-require": "^0.2.9-1" }, "dependencies": { + "@types/long": "^4.0.0", "bluebird": "^3.5.5", "crypto-js": "^3.1.9-1", "flatbuffers": "^1.11.0", "js-joda": "^1.6.2", "js-sha256": "^0.9.0", "js-sha3": "^0.8.0", - "ripemd160": "^2.0.2", + "long": "^4.0.0", "request": "^2.83.0", "request-promise-native": "^1.0.5", + "ripemd160": "^2.0.2", "rxjs": "^6.2.1", "rxjs-compat": "^6.2.1", "utf8": "^2.1.2", diff --git a/src/infrastructure/AccountHttp.ts b/src/infrastructure/AccountHttp.ts index 9aa45bc530..4e338ce45d 100644 --- a/src/infrastructure/AccountHttp.ts +++ b/src/infrastructure/AccountHttp.ts @@ -32,7 +32,6 @@ import { NamespaceId } from '../model/namespace/NamespaceId'; import { NamespaceName } from '../model/namespace/NamespaceName'; import {AggregateTransaction} from '../model/transaction/AggregateTransaction'; import {Transaction} from '../model/transaction/Transaction'; -import {UInt64} from '../model/UInt64'; import {AccountRepository} from './AccountRepository'; import { AccountInfoDTO, AccountNamesDTO, @@ -46,6 +45,7 @@ import {Http} from './Http'; import {NetworkHttp} from './NetworkHttp'; import {QueryParams} from './QueryParams'; import {CreateTransactionFromDTO} from './transaction/CreateTransactionFromDTO'; +import { UInt64 } from '../model/UInt64'; /** * Account http repository. @@ -81,9 +81,9 @@ export class AccountHttp extends Http implements AccountRepository { const accountInfoDTO = response.body; return new AccountInfo( Address.createFromEncoded(accountInfoDTO.account.address), - new UInt64(accountInfoDTO.account.addressHeight), + UInt64.fromNumericString(accountInfoDTO.account.addressHeight), accountInfoDTO.account.publicKey, - new UInt64(accountInfoDTO.account.publicKeyHeight), + UInt64.fromNumericString(accountInfoDTO.account.publicKeyHeight), accountInfoDTO.account.accountType.valueOf(), accountInfoDTO.account.linkedAccountKey, accountInfoDTO.account.activityBuckets.map((bucket) => { @@ -96,10 +96,10 @@ export class AccountHttp extends Http implements AccountRepository { }), accountInfoDTO.account.mosaics.map((mosaicDTO) => new Mosaic( new MosaicId(mosaicDTO.id), - new UInt64(mosaicDTO.amount), + UInt64.fromNumericString(mosaicDTO.amount), )), - new UInt64(accountInfoDTO.account.importance), - new UInt64(accountInfoDTO.account.importanceHeight), + UInt64.fromNumericString(accountInfoDTO.account.importance), + UInt64.fromNumericString(accountInfoDTO.account.importanceHeight), ); }), catchError((error) => throwError(this.errorHandling(error))), @@ -158,9 +158,9 @@ export class AccountHttp extends Http implements AccountRepository { return accountsInfoMetaDataDTO.map((accountInfoDTO: AccountInfoDTO) => { return new AccountInfo( Address.createFromEncoded(accountInfoDTO.account.address), - new UInt64(accountInfoDTO.account.addressHeight), + UInt64.fromNumericString(accountInfoDTO.account.addressHeight), accountInfoDTO.account.publicKey, - new UInt64(accountInfoDTO.account.publicKeyHeight), + UInt64.fromNumericString(accountInfoDTO.account.publicKeyHeight), accountInfoDTO.account.accountType.valueOf(), accountInfoDTO.account.linkedAccountKey, accountInfoDTO.account.activityBuckets.map((bucket) => { @@ -173,10 +173,10 @@ export class AccountHttp extends Http implements AccountRepository { }), accountInfoDTO.account.mosaics.map((mosaicDTO) => new Mosaic( new MosaicId(mosaicDTO.id), - new UInt64(mosaicDTO.amount), + UInt64.fromNumericString(mosaicDTO.amount), )), - new UInt64(accountInfoDTO.account.importance), - new UInt64(accountInfoDTO.account.importanceHeight), + UInt64.fromNumericString(accountInfoDTO.account.importance), + UInt64.fromNumericString(accountInfoDTO.account.importanceHeight), ); }); @@ -191,8 +191,8 @@ export class AccountHttp extends Http implements AccountRepository { }; return observableFrom( this.accountRoutesApi.getAccountsNames(accountIdsBody)).pipe( - map((response: { response: ClientResponse; body: AccountNamesDTO[]; }) => { - const accountNames = response.body; + map((response: { response: ClientResponse; body: any; }) => { + const accountNames = response.body.accountNames; return accountNames.map((accountName) => { return new AccountNames( Address.createFromEncoded(accountName.address), @@ -207,13 +207,13 @@ export class AccountHttp extends Http implements AccountRepository { } /** * Gets a MultisigAccountInfo for an account. - * @param address - User address + * @param publicAccount - User public account * @returns Observable */ - public getMultisigAccountInfo(address: Address): Observable { + public getMultisigAccountInfo(publicAccount: PublicAccount): Observable { return this.getNetworkTypeObservable().pipe( mergeMap((networkType) => observableFrom( - this.accountRoutesApi.getAccountMultisig(address.plain())) + this.accountRoutesApi.getAccountMultisig(publicAccount.publicKey)) .pipe(map((response: { response: ClientResponse; body: MultisigAccountInfoDTO; }) => { const multisigAccountInfoDTO = response.body; return new MultisigAccountInfo( @@ -232,13 +232,13 @@ export class AccountHttp extends Http implements AccountRepository { /** * Gets a MultisigAccountGraphInfo for an account. - * @param address - User address + * @param publicAccount - User publicAccount * @returns Observable */ - public getMultisigAccountGraphInfo(address: Address): Observable { + public getMultisigAccountGraphInfo(publicAccount: PublicAccount): Observable { return this.getNetworkTypeObservable().pipe( mergeMap((networkType) => observableFrom( - this.accountRoutesApi.getAccountMultisigGraph(address.plain())) + this.accountRoutesApi.getAccountMultisigGraph(publicAccount.publicKey)) .pipe(map((response: { response: ClientResponse; body: MultisigAccountGraphInfoDTO[]; }) => { const multisigAccountGraphInfosDTO = response.body; const multisigAccounts = new Map(); diff --git a/src/infrastructure/AccountRepository.ts b/src/infrastructure/AccountRepository.ts index a853840b49..65757dc2ce 100644 --- a/src/infrastructure/AccountRepository.ts +++ b/src/infrastructure/AccountRepository.ts @@ -71,17 +71,17 @@ export interface AccountRepository { /** * Gets a MultisigAccountInfo for an account. - * @param address - User address + * @param publicAccount - User public account * @returns Observable */ - getMultisigAccountInfo(address: Address): Observable; + getMultisigAccountInfo(publicAccount: PublicAccount): Observable; /** * Gets a MultisigAccountGraphInfo for an account. - * @param address - User address + * @param publicAccount - User public account * @returns Observable */ - getMultisigAccountGraphInfo(address: Address): Observable; + getMultisigAccountGraphInfo(publicAccount: PublicAccount): Observable; /** * Gets an array of confirmed transactions for which an account is signer or receiver. diff --git a/src/infrastructure/BlockHttp.ts b/src/infrastructure/BlockHttp.ts index ad027e3db2..c01b14a7c6 100644 --- a/src/infrastructure/BlockHttp.ts +++ b/src/infrastructure/BlockHttp.ts @@ -86,16 +86,16 @@ export class BlockHttp extends Http implements BlockRepository { return new BlockInfo( blockDTO.meta.hash, blockDTO.meta.generationHash, - new UInt64(blockDTO.meta.totalFee), + UInt64.fromNumericString(blockDTO.meta.totalFee), blockDTO.meta.numTransactions, blockDTO.block.signature, PublicAccount.createFromPublicKey(blockDTO.block.signerPublicKey, networkType), networkType, parseInt((blockDTO.block.version as number).toString(16).substr(2, 2), 16), // Tx version blockDTO.block.type, - new UInt64(blockDTO.block.height), - new UInt64(blockDTO.block.timestamp), - new UInt64(blockDTO.block.difficulty), + UInt64.fromNumericString(blockDTO.block.height), + UInt64.fromNumericString(blockDTO.block.timestamp), + UInt64.fromNumericString(blockDTO.block.difficulty), blockDTO.block.feeMultiplier, blockDTO.block.previousBlockHash, blockDTO.block.transactionsHash, @@ -147,16 +147,16 @@ export class BlockHttp extends Http implements BlockRepository { return new BlockInfo( blockDTO.meta.hash, blockDTO.meta.generationHash, - new UInt64(blockDTO.meta.totalFee), + UInt64.fromNumericString(blockDTO.meta.totalFee), blockDTO.meta.numTransactions, blockDTO.block.signature, PublicAccount.createFromPublicKey(blockDTO.block.signerPublicKey, networkType), networkType, parseInt((blockDTO.block.version as number).toString(16).substr(2, 2), 16), // Tx version blockDTO.block.type, - new UInt64(blockDTO.block.height), - new UInt64(blockDTO.block.timestamp), - new UInt64(blockDTO.block.difficulty), + UInt64.fromNumericString(blockDTO.block.height), + UInt64.fromNumericString(blockDTO.block.timestamp), + UInt64.fromNumericString(blockDTO.block.difficulty), blockDTO.block.feeMultiplier, blockDTO.block.previousBlockHash, blockDTO.block.transactionsHash, diff --git a/src/infrastructure/ChainHttp.ts b/src/infrastructure/ChainHttp.ts index 7082fc17af..a5664a42e6 100644 --- a/src/infrastructure/ChainHttp.ts +++ b/src/infrastructure/ChainHttp.ts @@ -54,7 +54,7 @@ export class ChainHttp extends Http implements ChainRepository { return observableFrom(this.chainRoutesApi.getBlockchainHeight()).pipe( map((response: { response: ClientResponse; body: HeightInfoDTO; } ) => { const heightDTO = response.body; - return new UInt64(heightDTO.height); + return UInt64.fromNumericString(heightDTO.height); }), catchError((error) => throwError(this.errorHandling(error))), ); @@ -69,8 +69,8 @@ export class ChainHttp extends Http implements ChainRepository { map((response: { response: ClientResponse; body: ChainScoreDTO; } ) => { const blockchainScoreDTO = response.body; return new BlockchainScore( - new UInt64(blockchainScoreDTO.scoreLow), - new UInt64(blockchainScoreDTO.scoreHigh), + UInt64.fromNumericString(blockchainScoreDTO.scoreLow), + UInt64.fromNumericString(blockchainScoreDTO.scoreHigh), ); }), catchError((error) => throwError(this.errorHandling(error))), diff --git a/src/infrastructure/Listener.ts b/src/infrastructure/Listener.ts index 753b4cc454..ec018d7d37 100644 --- a/src/infrastructure/Listener.ts +++ b/src/infrastructure/Listener.ts @@ -129,7 +129,7 @@ export class Listener { message.meta.totalFee ? new UInt64(message.meta.totalFee) : new UInt64([0, 0]), message.meta.numTransactions, message.block.signature, - PublicAccount.createFromPublicKey(message.block.signer, networkType), + PublicAccount.createFromPublicKey(message.block.signerPublicKey, networkType), networkType, parseInt(message.block.version.toString(16).substr(2, 2), 16), // Tx version message.block.type, @@ -156,7 +156,7 @@ export class Listener { } else if (message.parentHash) { this.messageSubject.next({ channelName: ListenerChannelName.cosignature, - message: new CosignatureSignedTransaction(message.parentHash, message.signature, message.signer), + message: new CosignatureSignedTransaction(message.parentHash, message.signature, message.signerPublicKey), }); } }; @@ -389,12 +389,12 @@ export class Listener { if (address instanceof NamespaceId) { return transaction instanceof TransferTransaction - && (transaction.recipient as NamespaceId).equals(address); + && (transaction.recipientAddress as NamespaceId).equals(address); } return transaction.signer!.address.equals(address) || ( transaction instanceof TransferTransaction - && (transaction.recipient as Address).equals(address) + && (transaction.recipientAddress as Address).equals(address) ); } diff --git a/src/infrastructure/MosaicHttp.ts b/src/infrastructure/MosaicHttp.ts index c6b4060b5a..8da226cd22 100644 --- a/src/infrastructure/MosaicHttp.ts +++ b/src/infrastructure/MosaicHttp.ts @@ -26,7 +26,7 @@ import { MosaicPropertyType } from '../model/mosaic/MosaicPropertyType'; import {NamespaceId} from '../model/namespace/NamespaceId'; import { NamespaceName } from '../model/namespace/NamespaceName'; import {UInt64} from '../model/UInt64'; -import { MosaicInfoDTO, MosaicNamesDTO, MosaicRoutesApi } from './api'; +import { MosaicInfoDTO, MosaicNamesDTO, MosaicRoutesApi, MosaicsNamesDTO } from './api'; import {Http} from './Http'; import {MosaicRepository} from './MosaicRepository'; import {NetworkHttp} from './NetworkHttp'; @@ -68,25 +68,25 @@ export class MosaicHttp extends Http implements MosaicRepository { let mosaicFlag; let divisibility; let duration; - if (mosaicInfoDTO.mosaic.properties[MosaicPropertyType.MosaicFlags].value) { - mosaicFlag = mosaicInfoDTO.mosaic.properties[MosaicPropertyType.MosaicFlags].value; + if (mosaicInfoDTO.mosaic.properties.flags) { + mosaicFlag = mosaicInfoDTO.mosaic.properties.flags; } - if (mosaicInfoDTO.mosaic.properties[MosaicPropertyType.Divisibility].value) { - divisibility = mosaicInfoDTO.mosaic.properties[MosaicPropertyType.Divisibility].value; + if (mosaicInfoDTO.mosaic.properties.divisibility) { + divisibility = mosaicInfoDTO.mosaic.properties.divisibility; } - if (mosaicInfoDTO.mosaic.properties[MosaicPropertyType.Duration].value) { - duration = mosaicInfoDTO.mosaic.properties[MosaicPropertyType.Duration].value; + if (mosaicInfoDTO.mosaic.properties.duration) { + duration = mosaicInfoDTO.mosaic.properties.duration; } return new MosaicInfo( new MosaicId(mosaicInfoDTO.mosaic.id), - new UInt64(mosaicInfoDTO.mosaic.supply), - new UInt64(mosaicInfoDTO.mosaic.startHeight), + UInt64.fromNumericString(mosaicInfoDTO.mosaic.supply), + UInt64.fromNumericString(mosaicInfoDTO.mosaic.startHeight), PublicAccount.createFromPublicKey(mosaicInfoDTO.mosaic.ownerPublicKey, networkType), mosaicInfoDTO.mosaic.revision, new MosaicProperties( - mosaicFlag ? new UInt64(mosaicFlag) : UInt64.fromUint(0), - (divisibility ? new UInt64(divisibility) : UInt64.fromUint(0)).compact(), - duration ? new UInt64(duration) : undefined, + mosaicFlag ? UInt64.fromUint(mosaicFlag) : UInt64.fromUint(0), + (divisibility ? divisibility : 0), + duration ? UInt64.fromNumericString(duration) : undefined, ), ); }), @@ -113,25 +113,25 @@ export class MosaicHttp extends Http implements MosaicRepository { let mosaicFlag; let divisibility; let duration; - if (mosaicInfoDTO.mosaic.properties[MosaicPropertyType.MosaicFlags].value) { - mosaicFlag = mosaicInfoDTO.mosaic.properties[MosaicPropertyType.MosaicFlags].value; + if (mosaicInfoDTO.mosaic.properties.flags) { + mosaicFlag = mosaicInfoDTO.mosaic.properties.flags; } - if (mosaicInfoDTO.mosaic.properties[MosaicPropertyType.Divisibility].value) { - divisibility = mosaicInfoDTO.mosaic.properties[MosaicPropertyType.Divisibility].value; + if (mosaicInfoDTO.mosaic.properties.divisibility) { + divisibility = mosaicInfoDTO.mosaic.properties.divisibility; } - if (mosaicInfoDTO.mosaic.properties[MosaicPropertyType.Duration].value) { - duration = mosaicInfoDTO.mosaic.properties[MosaicPropertyType.Duration].value; + if (mosaicInfoDTO.mosaic.properties.duration) { + duration = mosaicInfoDTO.mosaic.properties.duration; } return new MosaicInfo( new MosaicId(mosaicInfoDTO.mosaic.id), - new UInt64(mosaicInfoDTO.mosaic.supply), - new UInt64(mosaicInfoDTO.mosaic.startHeight), + UInt64.fromNumericString(mosaicInfoDTO.mosaic.supply), + UInt64.fromNumericString(mosaicInfoDTO.mosaic.startHeight), PublicAccount.createFromPublicKey(mosaicInfoDTO.mosaic.ownerPublicKey, networkType), mosaicInfoDTO.mosaic.revision, new MosaicProperties( - mosaicFlag ? new UInt64(mosaicFlag) : UInt64.fromUint(0), - (divisibility ? new UInt64(divisibility) : UInt64.fromUint(0)).compact(), - duration ? new UInt64(duration) : undefined, + mosaicFlag ? UInt64.fromUint(mosaicFlag) : UInt64.fromUint(0), + (divisibility ? divisibility : 0), + duration ? UInt64.fromNumericString(duration) : undefined, ), ); }); @@ -154,9 +154,9 @@ export class MosaicHttp extends Http implements MosaicRepository { }; return observableFrom( this.mosaicRoutesApi.getMosaicsNames(mosaicIdsBody)).pipe( - map((response: { response: ClientResponse; body: MosaicNamesDTO[]; }) => { + map((response: { response: ClientResponse; body: MosaicsNamesDTO; }) => { const mosaics = response.body; - return mosaics.map((mosaic) => { + return mosaics.mosaicNames.map((mosaic) => { return new MosaicNames( new MosaicId(mosaic.mosaicId), mosaic.names.map((name) => { diff --git a/src/infrastructure/NamespaceHttp.ts b/src/infrastructure/NamespaceHttp.ts index 7a50da8d2b..75a353816e 100644 --- a/src/infrastructure/NamespaceHttp.ts +++ b/src/infrastructure/NamespaceHttp.ts @@ -69,7 +69,6 @@ export class NamespaceHttp extends Http implements NamespaceRepository { this.namespaceRoutesApi.getNamespace(namespaceId.toHex())).pipe( map((response: { response: ClientResponse; body: NamespaceInfoDTO; } ) => { const namespaceInfoDTO = response.body; - return new NamespaceInfo( namespaceInfoDTO.meta.active, namespaceInfoDTO.meta.index, @@ -77,10 +76,10 @@ export class NamespaceHttp extends Http implements NamespaceRepository { namespaceInfoDTO.namespace.registrationType as number, namespaceInfoDTO.namespace.depth, this.extractLevels(namespaceInfoDTO.namespace), - new NamespaceId(namespaceInfoDTO.namespace.parentId), + new NamespaceId(UInt64.fromHex(namespaceInfoDTO.namespace.parentId).toDTO()), PublicAccount.createFromPublicKey(namespaceInfoDTO.namespace.ownerPublicKey, networkType), - new UInt64(namespaceInfoDTO.namespace.startHeight), - new UInt64(namespaceInfoDTO.namespace.endHeight), + UInt64.fromNumericString(namespaceInfoDTO.namespace.startHeight), + UInt64.fromNumericString(namespaceInfoDTO.namespace.endHeight), this.extractAlias(namespaceInfoDTO.namespace), ); }), @@ -114,10 +113,10 @@ export class NamespaceHttp extends Http implements NamespaceRepository { namespaceInfoDTO.namespace.registrationType as number, namespaceInfoDTO.namespace.depth, this.extractLevels(namespaceInfoDTO.namespace), - new NamespaceId(namespaceInfoDTO.namespace.parentId), + new NamespaceId(UInt64.fromHex(namespaceInfoDTO.namespace.parentId).toDTO()), PublicAccount.createFromPublicKey(namespaceInfoDTO.namespace.ownerPublicKey, networkType), - new UInt64(namespaceInfoDTO.namespace.startHeight), - new UInt64(namespaceInfoDTO.namespace.endHeight), + UInt64.fromNumericString(namespaceInfoDTO.namespace.startHeight), + UInt64.fromNumericString(namespaceInfoDTO.namespace.endHeight), this.extractAlias(namespaceInfoDTO.namespace), ); }); @@ -151,10 +150,10 @@ export class NamespaceHttp extends Http implements NamespaceRepository { namespaceInfoDTO.namespace.registrationType as number, namespaceInfoDTO.namespace.depth, this.extractLevels(namespaceInfoDTO.namespace), - new NamespaceId(namespaceInfoDTO.namespace.parentId), + new NamespaceId(UInt64.fromHex(namespaceInfoDTO.namespace.parentId).toDTO()), PublicAccount.createFromPublicKey(namespaceInfoDTO.namespace.ownerPublicKey, networkType), - new UInt64(namespaceInfoDTO.namespace.startHeight), - new UInt64(namespaceInfoDTO.namespace.endHeight), + UInt64.fromNumericString(namespaceInfoDTO.namespace.startHeight), + UInt64.fromNumericString(namespaceInfoDTO.namespace.endHeight), this.extractAlias(namespaceInfoDTO.namespace), ); }); @@ -251,13 +250,13 @@ export class NamespaceHttp extends Http implements NamespaceRepository { private extractLevels(namespace: any): NamespaceId[] { const result: NamespaceId[] = []; if (namespace.level0) { - result.push(new NamespaceId(namespace.level0)); + result.push(new NamespaceId(UInt64.fromHex(namespace.level0).toDTO())); } if (namespace.level1) { - result.push(new NamespaceId(namespace.level1)); + result.push(new NamespaceId(UInt64.fromHex(namespace.level1).toDTO())); } if (namespace.level2) { - result.push(new NamespaceId(namespace.level2)); + result.push(new NamespaceId(UInt64.fromHex(namespace.level2).toDTO())); } return result; } diff --git a/src/infrastructure/NodeHttp.ts b/src/infrastructure/NodeHttp.ts index 81f81a8d25..0c7080a327 100644 --- a/src/infrastructure/NodeHttp.ts +++ b/src/infrastructure/NodeHttp.ts @@ -22,6 +22,7 @@ import { NodeTime } from '../model/node/NodeTime'; import { NodeInfoDTO, NodeRoutesApi, NodeTimeDTO } from './api'; import {Http} from './Http'; import {NodeRepository} from './NodeRepository'; +import { UInt64 } from '../model/UInt64'; /** * Node http repository. @@ -75,8 +76,11 @@ export class NodeHttp extends Http implements NodeRepository { return observableFrom(this.nodeRoutesApi.getNodeTime()).pipe( map((response: { response: ClientResponse; body: NodeTimeDTO; } ) => { const nodeTimeDTO = response.body; - return new NodeTime(nodeTimeDTO.communicationTimestamps.sendTimestamp, - nodeTimeDTO.communicationTimestamps.receiveTimestamp); + if (nodeTimeDTO.communicationTimestamps.sendTimestamp && nodeTimeDTO.communicationTimestamps.receiveTimestamp) { + return new NodeTime(UInt64.fromNumericString(nodeTimeDTO.communicationTimestamps.sendTimestamp).toDTO(), + UInt64.fromNumericString(nodeTimeDTO.communicationTimestamps.receiveTimestamp).toDTO()); + } + throw Error ('Node time not available'); }), catchError((error) => throwError(this.errorHandling(error))), ); diff --git a/src/infrastructure/TransactionHttp.ts b/src/infrastructure/TransactionHttp.ts index c96c863910..202db81867 100644 --- a/src/infrastructure/TransactionHttp.ts +++ b/src/infrastructure/TransactionHttp.ts @@ -111,8 +111,9 @@ export class TransactionHttp extends Http implements TransactionRepository { transactionStatusDTO.status, transactionStatusDTO.group, transactionStatusDTO.hash, - transactionStatusDTO.deadline ? Deadline.createFromDTO(transactionStatusDTO.deadline) : undefined, - transactionStatusDTO.height ? new UInt64(transactionStatusDTO.height) : undefined); + transactionStatusDTO.deadline ? + Deadline.createFromDTO(UInt64.fromNumericString(transactionStatusDTO.deadline).toDTO()) : undefined, + transactionStatusDTO.height ? UInt64.fromNumericString(transactionStatusDTO.height) : undefined); }), catchError((error) => throwError(this.errorHandling(error))), ); @@ -136,8 +137,9 @@ export class TransactionHttp extends Http implements TransactionRepository { transactionStatusDTO.status, transactionStatusDTO.group, transactionStatusDTO.hash, - transactionStatusDTO.deadline ? Deadline.createFromDTO(transactionStatusDTO.deadline) : undefined, - transactionStatusDTO.height ? new UInt64(transactionStatusDTO.height) : undefined); + transactionStatusDTO.deadline ? + Deadline.createFromDTO(UInt64.fromNumericString(transactionStatusDTO.deadline).toDTO()) : undefined, + transactionStatusDTO.height ? UInt64.fromNumericString(transactionStatusDTO.height) : undefined); }); }), catchError((error) => throwError(error.error.errorMessage)), @@ -194,7 +196,7 @@ export class TransactionHttp extends Http implements TransactionRepository { } public announceSync(signedTx: SignedTransaction): Observable { - const address = PublicAccount.createFromPublicKey(signedTx.signer, signedTx.networkType).address; + const address = PublicAccount.createFromPublicKey(signedTx.signerPublicKey, signedTx.networkType).address; const syncAnnounce = new SyncAnnounce( signedTx.payload, signedTx.hash, diff --git a/src/infrastructure/api/accountRoutesApi.ts b/src/infrastructure/api/accountRoutesApi.ts index 7ef90b565e..0031f2febe 100644 --- a/src/infrastructure/api/accountRoutesApi.ts +++ b/src/infrastructure/api/accountRoutesApi.ts @@ -265,7 +265,7 @@ export class AccountRoutesApi { * @param accountId Account public key or address. */ public async getAccountRestrictions (accountId: string, options: {headers: {[name: string]: string}} = {headers: {}}) : Promise<{ response: http.ClientResponse; body: AccountRestrictionsInfoDTO; }> { - const localVarPath = this.basePath + '/account/{accountId}/restrictions/' + const localVarPath = this.basePath + '/account/{accountId}/restrictions' .replace('{' + 'accountId' + '}', encodeURIComponent(String(accountId))); let localVarQueryParameters: any = {}; let localVarHeaderParams: any = (Object).assign({}, this.defaultHeaders); @@ -419,7 +419,7 @@ export class AccountRoutesApi { } /** * Returns friendly names for accounts. - * @summary Get readable names for a set of accountIds. + * @summary Get readable names for a set of accountIds * @param accountIds */ public async getAccountsNames (accountIds?: AccountIds, options: {headers: {[name: string]: string}} = {headers: {}}) : Promise<{ response: http.ClientResponse; body: AccountsNamesDTO; }> { diff --git a/src/infrastructure/api/metadataRoutesApi.ts b/src/infrastructure/api/metadataRoutesApi.ts deleted file mode 100644 index f87eac8fca..0000000000 --- a/src/infrastructure/api/metadataRoutesApi.ts +++ /dev/null @@ -1,143 +0,0 @@ -/* - * Copyright 2019 NEM - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -/** - * Catapult REST Endpoints - * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) - * - * The version of the OpenAPI document: 0.7.17 - * - * - * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). - * https://openapi-generator.tech - * Do not edit the class manually. - */ - -import localVarRequest = require('request'); -import http = require('http'); - -/* tslint:disable:no-unused-locals */ -import { KeyMetadataDTO } from '../model/keyMetadataDTO'; - -import { ObjectSerializer, Authentication, VoidAuth } from '../model/models'; - -let defaultBasePath = 'http://localhost:3000'; - -// =============================================== -// This file is autogenerated - Please do not edit -// =============================================== - -export enum MetadataRoutesApiApiKeys { -} - -export class MetadataRoutesApi { - protected _basePath = defaultBasePath; - protected defaultHeaders : any = {}; - protected _useQuerystring : boolean = false; - - protected authentications = { - 'default': new VoidAuth(), - } - - constructor(basePath?: string); - constructor(basePathOrUsername: string, password?: string, basePath?: string) { - if (password) { - if (basePath) { - this.basePath = basePath; - } - } else { - if (basePathOrUsername) { - this.basePath = basePathOrUsername - } - } - } - - set useQuerystring(value: boolean) { - this._useQuerystring = value; - } - - set basePath(basePath: string) { - this._basePath = basePath; - } - - get basePath() { - return this._basePath; - } - - public setDefaultAuthentication(auth: Authentication) { - this.authentications.default = auth; - } - - public setApiKey(key: MetadataRoutesApiApiKeys, value: string) { - (this.authentications as any)[MetadataRoutesApiApiKeys[key]].apiKey = value; - } - - /** - * Returns the account metadata given an account id. - * @summary Get account metadata - * @param accountId Public key or address of the account. - */ - public async getAccountMetadata (accountId: string, options: {headers: {[name: string]: string}} = {headers: {}}) : Promise<{ response: http.ClientResponse; body: Array; }> { - const localVarPath = this.basePath + '/account/{accountId}/metadata' - .replace('{' + 'accountId' + '}', encodeURIComponent(String(accountId))); - let localVarQueryParameters: any = {}; - let localVarHeaderParams: any = (Object).assign({}, this.defaultHeaders); - let localVarFormParams: any = {}; - - // verify required parameter 'accountId' is not null or undefined - if (accountId === null || accountId === undefined) { - throw new Error('Required parameter accountId was null or undefined when calling getAccountMetadata.'); - } - - (Object).assign(localVarHeaderParams, options.headers); - - let localVarUseFormData = false; - - let localVarRequestOptions: localVarRequest.Options = { - method: 'GET', - qs: localVarQueryParameters, - headers: localVarHeaderParams, - uri: localVarPath, - useQuerystring: this._useQuerystring, - json: true, - }; - - let authenticationPromise = Promise.resolve(); - authenticationPromise = authenticationPromise.then(() => this.authentications.default.applyToRequest(localVarRequestOptions)); - return authenticationPromise.then(() => { - if (Object.keys(localVarFormParams).length) { - if (localVarUseFormData) { - (localVarRequestOptions).formData = localVarFormParams; - } else { - localVarRequestOptions.form = localVarFormParams; - } - } - return new Promise<{ response: http.ClientResponse; body: Array; }>((resolve, reject) => { - localVarRequest(localVarRequestOptions, (error, response, body) => { - if (error) { - reject(error); - } else { - body = ObjectSerializer.deserialize(body, "Array"); - if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) { - resolve({ response: response, body: body }); - } else { - reject({ response: response, body: body }); - } - } - }); - }); - }); - } -} diff --git a/src/infrastructure/api/transactionRoutesApi.ts b/src/infrastructure/api/transactionRoutesApi.ts index 5ea283c686..c522de605a 100644 --- a/src/infrastructure/api/transactionRoutesApi.ts +++ b/src/infrastructure/api/transactionRoutesApi.ts @@ -429,7 +429,7 @@ export class TransactionRoutesApi { } /** * Returns an array of transaction statuses for a given array of transaction hashes. - * @summary Get transactions status. + * @summary Get transactions status * @param transactionHashes */ public async getTransactionsStatuses (transactionHashes: TransactionHashes, options: {headers: {[name: string]: string}} = {headers: {}}) : Promise<{ response: http.ClientResponse; body: Array; }> { diff --git a/src/infrastructure/model/accountAddressRestrictionTransactionDTO.ts b/src/infrastructure/model/accountAddressRestrictionTransactionDTO.ts index 67f79b67d6..5cfa61c82b 100644 --- a/src/infrastructure/model/accountAddressRestrictionTransactionDTO.ts +++ b/src/infrastructure/model/accountAddressRestrictionTransactionDTO.ts @@ -34,6 +34,9 @@ import { TransactionDTO } from './transactionDTO'; * Transaction to prevent incoming and outgoing transactions for a given a set of addresses. */ export class AccountAddressRestrictionTransactionDTO { + /** + * Entity\'s signature generated by the signer. + */ 'signature': string; 'signerPublicKey': string; /** @@ -41,8 +44,14 @@ export class AccountAddressRestrictionTransactionDTO { */ 'version': number; 'type': number; - 'maxFee': Array; - 'deadline': Array; + /** + * Absolute amount. An amount of 123456789 (absolute) for a mosaic with divisibility 6 means 123.456789 (relative). + */ + 'maxFee': string; + /** + * Duration expressed in number of blocks. + */ + 'deadline': string; 'restrictionType': AccountRestrictionTypeEnum; 'modifications': Array; @@ -72,12 +81,12 @@ export class AccountAddressRestrictionTransactionDTO { { "name": "maxFee", "baseName": "maxFee", - "type": "Array" + "type": "string" }, { "name": "deadline", "baseName": "deadline", - "type": "Array" + "type": "string" }, { "name": "restrictionType", diff --git a/src/infrastructure/model/accountDTO.ts b/src/infrastructure/model/accountDTO.ts index 0699243e48..7fb385221a 100644 --- a/src/infrastructure/model/accountDTO.ts +++ b/src/infrastructure/model/accountDTO.ts @@ -34,9 +34,15 @@ export class AccountDTO { * Decoded address. */ 'address': string; - 'addressHeight': Array; + /** + * Height of the blockchain. + */ + 'addressHeight': string; 'publicKey': string; - 'publicKeyHeight': Array; + /** + * Height of the blockchain. + */ + 'publicKeyHeight': string; 'accountType': AccountTypeEnum; 'linkedAccountKey': string; 'activityBuckets': Array; @@ -44,8 +50,14 @@ export class AccountDTO { * Mosaic units owned. The amount is represented in absolute amount. Thus a balance of 123456789 for a mosaic with divisibility 6 (absolute) means the account owns 123.456789. */ 'mosaics': Array; - 'importance': Array; - 'importanceHeight': Array; + /** + * Probability of an account to harvest the next block. + */ + 'importance': string; + /** + * Height of the blockchain. + */ + 'importanceHeight': string; static discriminator: string | undefined = undefined; @@ -58,7 +70,7 @@ export class AccountDTO { { "name": "addressHeight", "baseName": "addressHeight", - "type": "Array" + "type": "string" }, { "name": "publicKey", @@ -68,7 +80,7 @@ export class AccountDTO { { "name": "publicKeyHeight", "baseName": "publicKeyHeight", - "type": "Array" + "type": "string" }, { "name": "accountType", @@ -93,12 +105,12 @@ export class AccountDTO { { "name": "importance", "baseName": "importance", - "type": "Array" + "type": "string" }, { "name": "importanceHeight", "baseName": "importanceHeight", - "type": "Array" + "type": "string" } ]; static getAttributeTypeMap() { diff --git a/src/infrastructure/model/accountIdsAddresses.ts b/src/infrastructure/model/accountIdsAddresses.ts deleted file mode 100644 index 481865bc55..0000000000 --- a/src/infrastructure/model/accountIdsAddresses.ts +++ /dev/null @@ -1,48 +0,0 @@ -/* - * Copyright 2019 NEM - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -/** - * Catapult REST Endpoints - * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) - * - * The version of the OpenAPI document: 0.7.17 - * - * - * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). - * https://openapi-generator.tech - * Do not edit the class manually. - */ - - -export class AccountIdsAddresses { - /** - * Array of addresses. - */ - 'addresses'?: Array; - - static discriminator: string | undefined = undefined; - - static attributeTypeMap: Array<{name: string, baseName: string, type: string}> = [ - { - "name": "addresses", - "baseName": "addresses", - "type": "Array" - } ]; - - static getAttributeTypeMap() { - return AccountIdsAddresses.attributeTypeMap; - } -} - diff --git a/src/infrastructure/model/accountIdsPublicKeys.ts b/src/infrastructure/model/accountIdsPublicKeys.ts deleted file mode 100644 index 0f28d92ad9..0000000000 --- a/src/infrastructure/model/accountIdsPublicKeys.ts +++ /dev/null @@ -1,48 +0,0 @@ -/* - * Copyright 2019 NEM - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -/** - * Catapult REST Endpoints - * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) - * - * The version of the OpenAPI document: 0.7.17 - * - * - * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). - * https://openapi-generator.tech - * Do not edit the class manually. - */ - - -export class AccountIdsPublicKeys { - /** - * Array of public keys. - */ - 'publicKeys'?: Array; - - static discriminator: string | undefined = undefined; - - static attributeTypeMap: Array<{name: string, baseName: string, type: string}> = [ - { - "name": "publicKeys", - "baseName": "publicKeys", - "type": "Array" - } ]; - - static getAttributeTypeMap() { - return AccountIdsPublicKeys.attributeTypeMap; - } -} - diff --git a/src/infrastructure/model/accountLinkTransactionDTO.ts b/src/infrastructure/model/accountLinkTransactionDTO.ts index c7e4936937..f8aa6688eb 100644 --- a/src/infrastructure/model/accountLinkTransactionDTO.ts +++ b/src/infrastructure/model/accountLinkTransactionDTO.ts @@ -33,6 +33,9 @@ import { TransactionDTO } from './transactionDTO'; * Delegates the account importance score to a proxy account. */ export class AccountLinkTransactionDTO { + /** + * Entity\'s signature generated by the signer. + */ 'signature': string; 'signerPublicKey': string; /** @@ -40,8 +43,14 @@ export class AccountLinkTransactionDTO { */ 'version': number; 'type': number; - 'maxFee': Array; - 'deadline': Array; + /** + * Absolute amount. An amount of 123456789 (absolute) for a mosaic with divisibility 6 means 123.456789 (relative). + */ + 'maxFee': string; + /** + * Duration expressed in number of blocks. + */ + 'deadline': string; 'remotePublicKey': string; 'linkAction': AccountLinkActionEnum; @@ -71,12 +80,12 @@ export class AccountLinkTransactionDTO { { "name": "maxFee", "baseName": "maxFee", - "type": "Array" + "type": "string" }, { "name": "deadline", "baseName": "deadline", - "type": "Array" + "type": "string" }, { "name": "remotePublicKey", diff --git a/src/infrastructure/model/accountMosaicRestrictionModificationDTO.ts b/src/infrastructure/model/accountMosaicRestrictionModificationDTO.ts index 694cac403b..ff7b0144ed 100644 --- a/src/infrastructure/model/accountMosaicRestrictionModificationDTO.ts +++ b/src/infrastructure/model/accountMosaicRestrictionModificationDTO.ts @@ -29,7 +29,10 @@ import { AccountRestrictionModificationActionEnum } from './accountRestrictionMo export class AccountMosaicRestrictionModificationDTO { 'modificationAction': AccountRestrictionModificationActionEnum; - 'value': Array; + /** + * Mosaic identifier. If the most significant bit of byte 0 is set, a namespaceId (alias) is used instead of the real mosaic identifier. + */ + 'value': string; static discriminator: string | undefined = undefined; @@ -42,7 +45,7 @@ export class AccountMosaicRestrictionModificationDTO { { "name": "value", "baseName": "value", - "type": "Array" + "type": "string" } ]; static getAttributeTypeMap() { diff --git a/src/infrastructure/model/accountMosaicRestrictionModificationDTOAllOf.ts b/src/infrastructure/model/accountMosaicRestrictionModificationDTOAllOf.ts deleted file mode 100644 index ca72a0c0f3..0000000000 --- a/src/infrastructure/model/accountMosaicRestrictionModificationDTOAllOf.ts +++ /dev/null @@ -1,45 +0,0 @@ -/* - * Copyright 2019 NEM - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -/** - * Catapult REST Endpoints - * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) - * - * The version of the OpenAPI document: 0.7.18 - * - * - * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). - * https://openapi-generator.tech - * Do not edit the class manually. - */ - - -export class AccountMosaicRestrictionModificationDTOAllOf { - 'value': Array; - - static discriminator: string | undefined = undefined; - - static attributeTypeMap: Array<{name: string, baseName: string, type: string}> = [ - { - "name": "value", - "baseName": "value", - "type": "Array" - } ]; - - static getAttributeTypeMap() { - return AccountMosaicRestrictionModificationDTOAllOf.attributeTypeMap; - } -} - diff --git a/src/infrastructure/model/accountMosaicRestrictionTransactionDTO.ts b/src/infrastructure/model/accountMosaicRestrictionTransactionDTO.ts index 6fcc87c2aa..46cea522ba 100644 --- a/src/infrastructure/model/accountMosaicRestrictionTransactionDTO.ts +++ b/src/infrastructure/model/accountMosaicRestrictionTransactionDTO.ts @@ -34,6 +34,9 @@ import { TransactionDTO } from './transactionDTO'; * Transaction to prevent incoming transactions containing a given set of mosaics. */ export class AccountMosaicRestrictionTransactionDTO { + /** + * Entity\'s signature generated by the signer. + */ 'signature': string; 'signerPublicKey': string; /** @@ -41,8 +44,14 @@ export class AccountMosaicRestrictionTransactionDTO { */ 'version': number; 'type': number; - 'maxFee': Array; - 'deadline': Array; + /** + * Absolute amount. An amount of 123456789 (absolute) for a mosaic with divisibility 6 means 123.456789 (relative). + */ + 'maxFee': string; + /** + * Duration expressed in number of blocks. + */ + 'deadline': string; 'restrictionType': AccountRestrictionTypeEnum; 'modifications': Array; @@ -72,12 +81,12 @@ export class AccountMosaicRestrictionTransactionDTO { { "name": "maxFee", "baseName": "maxFee", - "type": "Array" + "type": "string" }, { "name": "deadline", "baseName": "deadline", - "type": "Array" + "type": "string" }, { "name": "restrictionType", diff --git a/src/infrastructure/model/accountOperationRestrictionModificationDTOAllOf.ts b/src/infrastructure/model/accountOperationRestrictionModificationDTOAllOf.ts deleted file mode 100644 index 33273c79d8..0000000000 --- a/src/infrastructure/model/accountOperationRestrictionModificationDTOAllOf.ts +++ /dev/null @@ -1,46 +0,0 @@ -/* - * Copyright 2019 NEM - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -/** - * Catapult REST Endpoints - * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) - * - * The version of the OpenAPI document: 0.7.18 - * - * - * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). - * https://openapi-generator.tech - * Do not edit the class manually. - */ - -import { TransactionTypeEnum } from './transactionTypeEnum'; - -export class AccountOperationRestrictionModificationDTOAllOf { - 'value': TransactionTypeEnum; - - static discriminator: string | undefined = undefined; - - static attributeTypeMap: Array<{name: string, baseName: string, type: string}> = [ - { - "name": "value", - "baseName": "value", - "type": "TransactionTypeEnum" - } ]; - - static getAttributeTypeMap() { - return AccountOperationRestrictionModificationDTOAllOf.attributeTypeMap; - } -} - diff --git a/src/infrastructure/model/accountOperationRestrictionTransactionDTO.ts b/src/infrastructure/model/accountOperationRestrictionTransactionDTO.ts index df5c260b3c..3add3b6ab5 100644 --- a/src/infrastructure/model/accountOperationRestrictionTransactionDTO.ts +++ b/src/infrastructure/model/accountOperationRestrictionTransactionDTO.ts @@ -34,6 +34,9 @@ import { TransactionDTO } from './transactionDTO'; * Transaction to prevent outgoing transactions by transaction type. */ export class AccountOperationRestrictionTransactionDTO { + /** + * Entity\'s signature generated by the signer. + */ 'signature': string; 'signerPublicKey': string; /** @@ -41,8 +44,14 @@ export class AccountOperationRestrictionTransactionDTO { */ 'version': number; 'type': number; - 'maxFee': Array; - 'deadline': Array; + /** + * Absolute amount. An amount of 123456789 (absolute) for a mosaic with divisibility 6 means 123.456789 (relative). + */ + 'maxFee': string; + /** + * Duration expressed in number of blocks. + */ + 'deadline': string; 'restrictionType': AccountRestrictionTypeEnum; 'modifications': Array; @@ -72,12 +81,12 @@ export class AccountOperationRestrictionTransactionDTO { { "name": "maxFee", "baseName": "maxFee", - "type": "Array" + "type": "string" }, { "name": "deadline", "baseName": "deadline", - "type": "Array" + "type": "string" }, { "name": "restrictionType", diff --git a/src/infrastructure/model/accountRestrictionDTO.ts b/src/infrastructure/model/accountRestrictionDTO.ts index f1290bb3a5..572230734e 100644 --- a/src/infrastructure/model/accountRestrictionDTO.ts +++ b/src/infrastructure/model/accountRestrictionDTO.ts @@ -45,7 +45,7 @@ export class AccountRestrictionDTO { { "name": "values", "baseName": "values", - "type": "Array" + "type": "Array" } ]; static getAttributeTypeMap() { diff --git a/src/infrastructure/model/accountRestrictionModificationDTO.ts b/src/infrastructure/model/accountRestrictionModificationDTO.ts deleted file mode 100644 index 7a79a19ae8..0000000000 --- a/src/infrastructure/model/accountRestrictionModificationDTO.ts +++ /dev/null @@ -1,46 +0,0 @@ -/* - * Copyright 2019 NEM - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -/** - * Catapult REST Endpoints - * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) - * - * The version of the OpenAPI document: 0.7.18 - * - * - * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). - * https://openapi-generator.tech - * Do not edit the class manually. - */ - -import { AccountRestrictionModificationActionEnum } from './accountRestrictionModificationActionEnum'; - -export class AccountRestrictionModificationDTO { - 'modificationAction': AccountRestrictionModificationActionEnum; - - static discriminator: string | undefined = undefined; - - static attributeTypeMap: Array<{name: string, baseName: string, type: string}> = [ - { - "name": "modificationAction", - "baseName": "modificationAction", - "type": "AccountRestrictionModificationActionEnum" - } ]; - - static getAttributeTypeMap() { - return AccountRestrictionModificationDTO.attributeTypeMap; - } -} - diff --git a/src/infrastructure/model/accountRestrictionModificationTypeEnum.ts b/src/infrastructure/model/accountRestrictionModificationTypeEnum.ts deleted file mode 100644 index 6ea104ef40..0000000000 --- a/src/infrastructure/model/accountRestrictionModificationTypeEnum.ts +++ /dev/null @@ -1,35 +0,0 @@ -/* - * Copyright 2019 NEM - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -/** - * Catapult REST Endpoints - * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) - * - * The version of the OpenAPI document: 0.7.17 - * - * - * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). - * https://openapi-generator.tech - * Do not edit the class manually. - */ - - -/** -* Type of account restriction modification: * 0 - Add property. * 1 - Remove property. -*/ -export enum AccountRestrictionModificationTypeEnum { - NUMBER_0 = 0, - NUMBER_1 = 1 -} diff --git a/src/infrastructure/model/accountRestrictionTransactionBodyDTO.ts b/src/infrastructure/model/accountRestrictionTransactionBodyDTO.ts deleted file mode 100644 index 5e9cd2609b..0000000000 --- a/src/infrastructure/model/accountRestrictionTransactionBodyDTO.ts +++ /dev/null @@ -1,53 +0,0 @@ -/* - * Copyright 2019 NEM - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -/** - * Catapult REST Endpoints - * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) - * - * The version of the OpenAPI document: 0.7.17 - * - * - * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). - * https://openapi-generator.tech - * Do not edit the class manually. - */ - -import { AccountRestrictionModificationDTO } from './accountRestrictionModificationDTO'; -import { AccountRestrictionTypeEnum } from './accountRestrictionTypeEnum'; - -export class AccountRestrictionTransactionBodyDTO { - 'propertyType': AccountRestrictionTypeEnum; - 'modifications': Array; - - static discriminator: string | undefined = undefined; - - static attributeTypeMap: Array<{name: string, baseName: string, type: string}> = [ - { - "name": "propertyType", - "baseName": "propertyType", - "type": "AccountRestrictionTypeEnum" - }, - { - "name": "modifications", - "baseName": "modifications", - "type": "Array" - } ]; - - static getAttributeTypeMap() { - return AccountRestrictionTransactionBodyDTO.attributeTypeMap; - } -} - diff --git a/src/infrastructure/model/accountRestrictionTransactionDTO.ts b/src/infrastructure/model/accountRestrictionTransactionDTO.ts deleted file mode 100644 index 361918f16e..0000000000 --- a/src/infrastructure/model/accountRestrictionTransactionDTO.ts +++ /dev/null @@ -1,104 +0,0 @@ -/* - * Copyright 2019 NEM - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -/** - * Catapult REST Endpoints - * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) - * - * The version of the OpenAPI document: 0.7.17 - * - * - * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). - * https://openapi-generator.tech - * Do not edit the class manually. - */ - -import { AccountRestrictionModificationDTO } from './accountRestrictionModificationDTO'; -import { AccountRestrictionTransactionBodyDTO } from './accountRestrictionTransactionBodyDTO'; -import { AccountRestrictionTypeEnum } from './accountRestrictionTypeEnum'; -import { EntityTypeEnum } from './entityTypeEnum'; -import { TransactionDTO } from './transactionDTO'; - -/** -* Transaction to prevent receiving transactions from undesired addresses, mosaics or sending certain transaction types. -*/ -export class AccountRestrictionTransactionDTO { - /** - * Signature of the entity generated by the signer. It is used to validate tha the entity data was not modified by a node. - */ - 'signature': string; - /** - * Public key of the signer account. - */ - 'signer': string; - /** - * Version of the entity. The higher byte represents the network identifier: * 0x68 (MAIN_NET) - Public main network. * 0x98 (TEST_NET) - Public test network. * 0x60 (MIJIN) - Private network. * 0x90 (MIJIN_TEST) - Private test network. - */ - 'version': number; - 'type': EntityTypeEnum; - 'maxFee': Array; - 'deadline': Array; - 'propertyType': AccountRestrictionTypeEnum; - 'modifications': Array; - - static discriminator: string | undefined = undefined; - - static attributeTypeMap: Array<{name: string, baseName: string, type: string}> = [ - { - "name": "signature", - "baseName": "signature", - "type": "string" - }, - { - "name": "signer", - "baseName": "signer", - "type": "string" - }, - { - "name": "version", - "baseName": "version", - "type": "number" - }, - { - "name": "type", - "baseName": "type", - "type": "EntityTypeEnum" - }, - { - "name": "maxFee", - "baseName": "max_fee", - "type": "Array" - }, - { - "name": "deadline", - "baseName": "deadline", - "type": "Array" - }, - { - "name": "propertyType", - "baseName": "propertyType", - "type": "AccountRestrictionTypeEnum" - }, - { - "name": "modifications", - "baseName": "modifications", - "type": "Array" - } ]; - - static getAttributeTypeMap() { - return AccountRestrictionTransactionDTO.attributeTypeMap; - } -} - diff --git a/src/infrastructure/model/activityBucketDTO.ts b/src/infrastructure/model/activityBucketDTO.ts index e91ca575ec..5111b40601 100644 --- a/src/infrastructure/model/activityBucketDTO.ts +++ b/src/infrastructure/model/activityBucketDTO.ts @@ -27,6 +27,9 @@ export class ActivityBucketDTO { + /** + * Height of the blockchain. + */ 'startHeight': string; 'totalFeesPaid': number; 'beneficiaryCount': number; diff --git a/src/infrastructure/model/addressAliasTransactionBodyDTO.ts b/src/infrastructure/model/addressAliasTransactionBodyDTO.ts index 2457bfcc01..6ade1915be 100644 --- a/src/infrastructure/model/addressAliasTransactionBodyDTO.ts +++ b/src/infrastructure/model/addressAliasTransactionBodyDTO.ts @@ -29,7 +29,10 @@ import { AliasActionEnum } from './aliasActionEnum'; export class AddressAliasTransactionBodyDTO { 'aliasAction': AliasActionEnum; - 'namespaceId': Array; + /** + * Namespace identifier. + */ + 'namespaceId': string; /** * Decoded address. */ @@ -46,7 +49,7 @@ export class AddressAliasTransactionBodyDTO { { "name": "namespaceId", "baseName": "namespaceId", - "type": "Array" + "type": "string" }, { "name": "address", diff --git a/src/infrastructure/model/addressAliasTransactionDTO.ts b/src/infrastructure/model/addressAliasTransactionDTO.ts index ffc61a7ee8..49a871712d 100644 --- a/src/infrastructure/model/addressAliasTransactionDTO.ts +++ b/src/infrastructure/model/addressAliasTransactionDTO.ts @@ -33,6 +33,9 @@ import { TransactionDTO } from './transactionDTO'; * Transaction to link a namespace to an account. */ export class AddressAliasTransactionDTO { + /** + * Entity\'s signature generated by the signer. + */ 'signature': string; 'signerPublicKey': string; /** @@ -40,10 +43,19 @@ export class AddressAliasTransactionDTO { */ 'version': number; 'type': number; - 'maxFee': Array; - 'deadline': Array; + /** + * Absolute amount. An amount of 123456789 (absolute) for a mosaic with divisibility 6 means 123.456789 (relative). + */ + 'maxFee': string; + /** + * Duration expressed in number of blocks. + */ + 'deadline': string; 'aliasAction': AliasActionEnum; - 'namespaceId': Array; + /** + * Namespace identifier. + */ + 'namespaceId': string; /** * Decoded address. */ @@ -75,12 +87,12 @@ export class AddressAliasTransactionDTO { { "name": "maxFee", "baseName": "maxFee", - "type": "Array" + "type": "string" }, { "name": "deadline", "baseName": "deadline", - "type": "Array" + "type": "string" }, { "name": "aliasAction", @@ -90,7 +102,7 @@ export class AddressAliasTransactionDTO { { "name": "namespaceId", "baseName": "namespaceId", - "type": "Array" + "type": "string" }, { "name": "address", diff --git a/src/infrastructure/model/addressMosaicRestrictionTransactionBodyDTO.ts b/src/infrastructure/model/addressMosaicRestrictionTransactionBodyDTO.ts index 041bcadfab..be7f645eb7 100644 --- a/src/infrastructure/model/addressMosaicRestrictionTransactionBodyDTO.ts +++ b/src/infrastructure/model/addressMosaicRestrictionTransactionBodyDTO.ts @@ -27,14 +27,26 @@ export class AddressMosaicRestrictionTransactionBodyDTO { - 'mosaicId': Array; - 'restrictionKey': Array; + /** + * Mosaic identifier. If the most significant bit of byte 0 is set, a namespaceId (alias) is used instead of the real mosaic identifier. + */ + 'mosaicId': string; + /** + * Restriction key relative to the reference mosaic identifier. + */ + 'restrictionKey': string; /** * Address decoded. If the bit 0 of byte 0 is not set (like in 0x90), then it is a regular address. Else (e.g. 0x91) it represents a namespace id which starts at byte 1. */ 'targetAddress': string; - 'previousRestrictionValue': Array; - 'newRestrictionValue': Array; + /** + * Previous restriction value. + */ + 'previousRestrictionValue': string; + /** + * New restriction value. + */ + 'newRestrictionValue': string; static discriminator: string | undefined = undefined; @@ -42,12 +54,12 @@ export class AddressMosaicRestrictionTransactionBodyDTO { { "name": "mosaicId", "baseName": "mosaicId", - "type": "Array" + "type": "string" }, { "name": "restrictionKey", "baseName": "restrictionKey", - "type": "Array" + "type": "string" }, { "name": "targetAddress", @@ -57,12 +69,12 @@ export class AddressMosaicRestrictionTransactionBodyDTO { { "name": "previousRestrictionValue", "baseName": "previousRestrictionValue", - "type": "Array" + "type": "string" }, { "name": "newRestrictionValue", "baseName": "newRestrictionValue", - "type": "Array" + "type": "string" } ]; static getAttributeTypeMap() { diff --git a/src/infrastructure/model/addressMosaicRestrictionTransactionDTO.ts b/src/infrastructure/model/addressMosaicRestrictionTransactionDTO.ts index 6f604daec9..c77abae6b7 100644 --- a/src/infrastructure/model/addressMosaicRestrictionTransactionDTO.ts +++ b/src/infrastructure/model/addressMosaicRestrictionTransactionDTO.ts @@ -32,6 +32,9 @@ import { TransactionDTO } from './transactionDTO'; * Transaction to set a restriction rule to an address. */ export class AddressMosaicRestrictionTransactionDTO { + /** + * Entity\'s signature generated by the signer. + */ 'signature': string; 'signerPublicKey': string; /** @@ -39,16 +42,34 @@ export class AddressMosaicRestrictionTransactionDTO { */ 'version': number; 'type': number; - 'maxFee': Array; - 'deadline': Array; - 'mosaicId': Array; - 'restrictionKey': Array; + /** + * Absolute amount. An amount of 123456789 (absolute) for a mosaic with divisibility 6 means 123.456789 (relative). + */ + 'maxFee': string; + /** + * Duration expressed in number of blocks. + */ + 'deadline': string; + /** + * Mosaic identifier. If the most significant bit of byte 0 is set, a namespaceId (alias) is used instead of the real mosaic identifier. + */ + 'mosaicId': string; + /** + * Restriction key relative to the reference mosaic identifier. + */ + 'restrictionKey': string; /** * Address decoded. If the bit 0 of byte 0 is not set (like in 0x90), then it is a regular address. Else (e.g. 0x91) it represents a namespace id which starts at byte 1. */ 'targetAddress': string; - 'previousRestrictionValue': Array; - 'newRestrictionValue': Array; + /** + * Previous restriction value. + */ + 'previousRestrictionValue': string; + /** + * New restriction value. + */ + 'newRestrictionValue': string; static discriminator: string | undefined = undefined; @@ -76,22 +97,22 @@ export class AddressMosaicRestrictionTransactionDTO { { "name": "maxFee", "baseName": "maxFee", - "type": "Array" + "type": "string" }, { "name": "deadline", "baseName": "deadline", - "type": "Array" + "type": "string" }, { "name": "mosaicId", "baseName": "mosaicId", - "type": "Array" + "type": "string" }, { "name": "restrictionKey", "baseName": "restrictionKey", - "type": "Array" + "type": "string" }, { "name": "targetAddress", @@ -101,12 +122,12 @@ export class AddressMosaicRestrictionTransactionDTO { { "name": "previousRestrictionValue", "baseName": "previousRestrictionValue", - "type": "Array" + "type": "string" }, { "name": "newRestrictionValue", "baseName": "newRestrictionValue", - "type": "Array" + "type": "string" } ]; static getAttributeTypeMap() { diff --git a/src/infrastructure/model/aggregateBondedTransactionDTO.ts b/src/infrastructure/model/aggregateBondedTransactionDTO.ts index 081fb28044..f9d52ca0a0 100644 --- a/src/infrastructure/model/aggregateBondedTransactionDTO.ts +++ b/src/infrastructure/model/aggregateBondedTransactionDTO.ts @@ -34,6 +34,9 @@ import { TransactionDTO } from './transactionDTO'; * Transaction to combine multiple transactions together. */ export class AggregateBondedTransactionDTO { + /** + * Entity\'s signature generated by the signer. + */ 'signature': string; 'signerPublicKey': string; /** @@ -41,8 +44,14 @@ export class AggregateBondedTransactionDTO { */ 'version': number; 'type': number; - 'maxFee': Array; - 'deadline': Array; + /** + * Absolute amount. An amount of 123456789 (absolute) for a mosaic with divisibility 6 means 123.456789 (relative). + */ + 'maxFee': string; + /** + * Duration expressed in number of blocks. + */ + 'deadline': string; /** * Array of transaction cosignatures. */ @@ -78,12 +87,12 @@ export class AggregateBondedTransactionDTO { { "name": "maxFee", "baseName": "maxFee", - "type": "Array" + "type": "string" }, { "name": "deadline", "baseName": "deadline", - "type": "Array" + "type": "string" }, { "name": "cosignatures", diff --git a/src/infrastructure/model/aggregateCompleteTransactionDTO.ts b/src/infrastructure/model/aggregateCompleteTransactionDTO.ts index 6260f136e7..4ec56c744c 100644 --- a/src/infrastructure/model/aggregateCompleteTransactionDTO.ts +++ b/src/infrastructure/model/aggregateCompleteTransactionDTO.ts @@ -34,6 +34,9 @@ import { TransactionDTO } from './transactionDTO'; * Transaction to combine multiple transactions together. */ export class AggregateCompleteTransactionDTO { + /** + * Entity\'s signature generated by the signer. + */ 'signature': string; 'signerPublicKey': string; /** @@ -41,8 +44,14 @@ export class AggregateCompleteTransactionDTO { */ 'version': number; 'type': number; - 'maxFee': Array; - 'deadline': Array; + /** + * Absolute amount. An amount of 123456789 (absolute) for a mosaic with divisibility 6 means 123.456789 (relative). + */ + 'maxFee': string; + /** + * Duration expressed in number of blocks. + */ + 'deadline': string; /** * Array of transaction cosignatures. */ @@ -78,12 +87,12 @@ export class AggregateCompleteTransactionDTO { { "name": "maxFee", "baseName": "maxFee", - "type": "Array" + "type": "string" }, { "name": "deadline", "baseName": "deadline", - "type": "Array" + "type": "string" }, { "name": "cosignatures", diff --git a/src/infrastructure/model/aggregateTransactionDTO.ts b/src/infrastructure/model/aggregateTransactionDTO.ts deleted file mode 100644 index ab308aa43e..0000000000 --- a/src/infrastructure/model/aggregateTransactionDTO.ts +++ /dev/null @@ -1,110 +0,0 @@ -/* - * Copyright 2019 NEM - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -/** - * Catapult REST Endpoints - * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) - * - * The version of the OpenAPI document: 0.7.17 - * - * - * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). - * https://openapi-generator.tech - * Do not edit the class manually. - */ - -import { AggregateTransactionBodyDTO } from './aggregateTransactionBodyDTO'; -import { CosignatureDTO } from './cosignatureDTO'; -import { EmbeddedTransactionInfoDTO } from './embeddedTransactionInfoDTO'; -import { EntityTypeEnum } from './entityTypeEnum'; -import { TransactionDTO } from './transactionDTO'; - -/** -* Transaction to combine multiple transactions together. -*/ -export class AggregateTransactionDTO { - /** - * Signature of the entity generated by the signer. It is used to validate tha the entity data was not modified by a node. - */ - 'signature': string; - /** - * Public key of the signer account. - */ - 'signer': string; - /** - * Version of the entity. The higher byte represents the network identifier: * 0x68 (MAIN_NET) - Public main network. * 0x98 (TEST_NET) - Public test network. * 0x60 (MIJIN) - Private network. * 0x90 (MIJIN_TEST) - Private test network. - */ - 'version': number; - 'type': EntityTypeEnum; - 'maxFee': Array; - 'deadline': Array; - /** - * Array of transaction cosignatures. - */ - 'cosignatures': Array; - /** - * Array of transactions initiated by different accounts. - */ - 'transactions': Array; - - static discriminator: string | undefined = undefined; - - static attributeTypeMap: Array<{name: string, baseName: string, type: string}> = [ - { - "name": "signature", - "baseName": "signature", - "type": "string" - }, - { - "name": "signer", - "baseName": "signer", - "type": "string" - }, - { - "name": "version", - "baseName": "version", - "type": "number" - }, - { - "name": "type", - "baseName": "type", - "type": "EntityTypeEnum" - }, - { - "name": "maxFee", - "baseName": "max_fee", - "type": "Array" - }, - { - "name": "deadline", - "baseName": "deadline", - "type": "Array" - }, - { - "name": "cosignatures", - "baseName": "cosignatures", - "type": "Array" - }, - { - "name": "transactions", - "baseName": "transactions", - "type": "Array" - } ]; - - static getAttributeTypeMap() { - return AggregateTransactionDTO.attributeTypeMap; - } -} - diff --git a/src/infrastructure/model/aliasDTO.ts b/src/infrastructure/model/aliasDTO.ts index 3b310b4752..c6f18885cb 100644 --- a/src/infrastructure/model/aliasDTO.ts +++ b/src/infrastructure/model/aliasDTO.ts @@ -29,7 +29,10 @@ import { AliasTypeEnum } from './aliasTypeEnum'; export class AliasDTO { 'type': AliasTypeEnum; - 'mosaicId'?: Array; + /** + * Mosaic identifier. + */ + 'mosaicId'?: string; /** * Decoded address. */ @@ -46,7 +49,7 @@ export class AliasDTO { { "name": "mosaicId", "baseName": "mosaicId", - "type": "Array" + "type": "string" }, { "name": "address", diff --git a/src/infrastructure/model/amount.ts b/src/infrastructure/model/amount.ts deleted file mode 100644 index 5e33dc7483..0000000000 --- a/src/infrastructure/model/amount.ts +++ /dev/null @@ -1,34 +0,0 @@ -/* - * Copyright 2019 NEM - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -/** - * Catapult REST Endpoints - * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) - * - * The version of the OpenAPI document: 0.7.18 - * - * - * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). - * https://openapi-generator.tech - * Do not edit the class manually. - */ - - -export class Amount extends Array { - - static discriminator: string | undefined = undefined; - -} - diff --git a/src/infrastructure/model/artifactExpiryReceiptDTO.ts b/src/infrastructure/model/artifactExpiryReceiptDTO.ts index 1507ef0130..bcf04c0419 100644 --- a/src/infrastructure/model/artifactExpiryReceiptDTO.ts +++ b/src/infrastructure/model/artifactExpiryReceiptDTO.ts @@ -55,7 +55,7 @@ export class ArtifactExpiryReceiptDTO { { "name": "artifactId", "baseName": "artifactId", - "type": "AnyOfarrayarray" + "type": "any" } ]; static getAttributeTypeMap() { diff --git a/src/infrastructure/model/artifactExpiryReceiptDTOAllOf.ts b/src/infrastructure/model/artifactExpiryReceiptDTOAllOf.ts index 5394c00495..2c8ad24751 100644 --- a/src/infrastructure/model/artifactExpiryReceiptDTOAllOf.ts +++ b/src/infrastructure/model/artifactExpiryReceiptDTOAllOf.ts @@ -34,7 +34,7 @@ export class ArtifactExpiryReceiptDTOAllOf { { "name": "artifactId", "baseName": "artifactId", - "type": "AnyOfarrayarray" + "type": "any" } ]; static getAttributeTypeMap() { diff --git a/src/infrastructure/model/balanceChangeReceiptDTO.ts b/src/infrastructure/model/balanceChangeReceiptDTO.ts index 1fd80d36d6..3ebfd9ff3b 100644 --- a/src/infrastructure/model/balanceChangeReceiptDTO.ts +++ b/src/infrastructure/model/balanceChangeReceiptDTO.ts @@ -39,8 +39,14 @@ export class BalanceChangeReceiptDTO { 'version': number; 'type': ReceiptTypeEnum; 'targetPublicKey': string; - 'mosaicId': Array; - 'amount': Array; + /** + * Mosaic identifier. + */ + 'mosaicId': string; + /** + * Absolute amount. An amount of 123456789 (absolute) for a mosaic with divisibility 6 means 123.456789 (relative). + */ + 'amount': string; static discriminator: string | undefined = undefined; @@ -63,12 +69,12 @@ export class BalanceChangeReceiptDTO { { "name": "mosaicId", "baseName": "mosaicId", - "type": "Array" + "type": "string" }, { "name": "amount", "baseName": "amount", - "type": "Array" + "type": "string" } ]; static getAttributeTypeMap() { diff --git a/src/infrastructure/model/balanceChangeReceiptDTOAllOf.ts b/src/infrastructure/model/balanceChangeReceiptDTOAllOf.ts index 246d25e904..daf2fcccb6 100644 --- a/src/infrastructure/model/balanceChangeReceiptDTOAllOf.ts +++ b/src/infrastructure/model/balanceChangeReceiptDTOAllOf.ts @@ -28,8 +28,14 @@ export class BalanceChangeReceiptDTOAllOf { 'targetPublicKey': string; - 'mosaicId': Array; - 'amount': Array; + /** + * Mosaic identifier. + */ + 'mosaicId': string; + /** + * Absolute amount. An amount of 123456789 (absolute) for a mosaic with divisibility 6 means 123.456789 (relative). + */ + 'amount': string; static discriminator: string | undefined = undefined; @@ -42,12 +48,12 @@ export class BalanceChangeReceiptDTOAllOf { { "name": "mosaicId", "baseName": "mosaicId", - "type": "Array" + "type": "string" }, { "name": "amount", "baseName": "amount", - "type": "Array" + "type": "string" } ]; static getAttributeTypeMap() { diff --git a/src/infrastructure/model/balanceTransferReceiptDTO.ts b/src/infrastructure/model/balanceTransferReceiptDTO.ts index 5d25ab91ba..6700717b01 100644 --- a/src/infrastructure/model/balanceTransferReceiptDTO.ts +++ b/src/infrastructure/model/balanceTransferReceiptDTO.ts @@ -43,8 +43,14 @@ export class BalanceTransferReceiptDTO { * Decoded address. */ 'recipientAddress': string; - 'mosaicId': Array; - 'amount': Array; + /** + * Mosaic identifier. + */ + 'mosaicId': string; + /** + * Absolute amount. An amount of 123456789 (absolute) for a mosaic with divisibility 6 means 123.456789 (relative). + */ + 'amount': string; static discriminator: string | undefined = undefined; @@ -72,12 +78,12 @@ export class BalanceTransferReceiptDTO { { "name": "mosaicId", "baseName": "mosaicId", - "type": "Array" + "type": "string" }, { "name": "amount", "baseName": "amount", - "type": "Array" + "type": "string" } ]; static getAttributeTypeMap() { diff --git a/src/infrastructure/model/balanceTransferReceiptDTOAllOf.ts b/src/infrastructure/model/balanceTransferReceiptDTOAllOf.ts index a2bccc9e57..6573a58e02 100644 --- a/src/infrastructure/model/balanceTransferReceiptDTOAllOf.ts +++ b/src/infrastructure/model/balanceTransferReceiptDTOAllOf.ts @@ -32,8 +32,14 @@ export class BalanceTransferReceiptDTOAllOf { * Decoded address. */ 'recipientAddress': string; - 'mosaicId': Array; - 'amount': Array; + /** + * Mosaic identifier. + */ + 'mosaicId': string; + /** + * Absolute amount. An amount of 123456789 (absolute) for a mosaic with divisibility 6 means 123.456789 (relative). + */ + 'amount': string; static discriminator: string | undefined = undefined; @@ -51,12 +57,12 @@ export class BalanceTransferReceiptDTOAllOf { { "name": "mosaicId", "baseName": "mosaicId", - "type": "Array" + "type": "string" }, { "name": "amount", "baseName": "amount", - "type": "Array" + "type": "string" } ]; static getAttributeTypeMap() { diff --git a/src/infrastructure/model/blockDTO.ts b/src/infrastructure/model/blockDTO.ts index 320b3bed72..5ed9f6f065 100644 --- a/src/infrastructure/model/blockDTO.ts +++ b/src/infrastructure/model/blockDTO.ts @@ -30,6 +30,9 @@ import { EntityDTO } from './entityDTO'; import { VerifiableEntityDTO } from './verifiableEntityDTO'; export class BlockDTO { + /** + * Entity\'s signature generated by the signer. + */ 'signature': string; 'signerPublicKey': string; /** @@ -37,9 +40,18 @@ export class BlockDTO { */ 'version': number; 'type': number; - 'height': Array; - 'timestamp': Array; - 'difficulty': Array; + /** + * Height of the blockchain. + */ + 'height': string; + /** + * Number of seconds elapsed since the creation of the nemesis block. + */ + 'timestamp': string; + /** + * Defines how difficult it will be to harvest next the block, based on previous blocks. + */ + 'difficulty': string; /** * Fee multiplier applied to transactions contained in block. */ @@ -76,17 +88,17 @@ export class BlockDTO { { "name": "height", "baseName": "height", - "type": "Array" + "type": "string" }, { "name": "timestamp", "baseName": "timestamp", - "type": "Array" + "type": "string" }, { "name": "difficulty", "baseName": "difficulty", - "type": "Array" + "type": "string" }, { "name": "feeMultiplier", diff --git a/src/infrastructure/model/blockDTOAllOf.ts b/src/infrastructure/model/blockDTOAllOf.ts index fade3adbd2..3f5e979d07 100644 --- a/src/infrastructure/model/blockDTOAllOf.ts +++ b/src/infrastructure/model/blockDTOAllOf.ts @@ -27,9 +27,18 @@ export class BlockDTOAllOf { - 'height': Array; - 'timestamp': Array; - 'difficulty': Array; + /** + * Height of the blockchain. + */ + 'height': string; + /** + * Number of seconds elapsed since the creation of the nemesis block. + */ + 'timestamp': string; + /** + * Defines how difficult it will be to harvest next the block, based on previous blocks. + */ + 'difficulty': string; /** * Fee multiplier applied to transactions contained in block. */ @@ -46,17 +55,17 @@ export class BlockDTOAllOf { { "name": "height", "baseName": "height", - "type": "Array" + "type": "string" }, { "name": "timestamp", "baseName": "timestamp", - "type": "Array" + "type": "string" }, { "name": "difficulty", "baseName": "difficulty", - "type": "Array" + "type": "string" }, { "name": "feeMultiplier", diff --git a/src/infrastructure/model/blockDuration.ts b/src/infrastructure/model/blockDuration.ts deleted file mode 100644 index ea383a2ad7..0000000000 --- a/src/infrastructure/model/blockDuration.ts +++ /dev/null @@ -1,34 +0,0 @@ -/* - * Copyright 2019 NEM - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -/** - * Catapult REST Endpoints - * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) - * - * The version of the OpenAPI document: 0.7.18 - * - * - * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). - * https://openapi-generator.tech - * Do not edit the class manually. - */ - - -export class BlockDuration extends Array { - - static discriminator: string | undefined = undefined; - -} - diff --git a/src/infrastructure/model/blockMetaDTO.ts b/src/infrastructure/model/blockMetaDTO.ts index e8f8a106a9..653ac5a8f4 100644 --- a/src/infrastructure/model/blockMetaDTO.ts +++ b/src/infrastructure/model/blockMetaDTO.ts @@ -28,7 +28,10 @@ export class BlockMetaDTO { 'hash': string; - 'totalFee': Array; + /** + * Absolute amount. An amount of 123456789 (absolute) for a mosaic with divisibility 6 means 123.456789 (relative). + */ + 'totalFee': string; 'generationHash': string; 'stateHashSubCacheMerkleRoots': Array; 'numTransactions': number; @@ -45,7 +48,7 @@ export class BlockMetaDTO { { "name": "totalFee", "baseName": "totalFee", - "type": "Array" + "type": "string" }, { "name": "generationHash", diff --git a/src/infrastructure/model/blockchainScoreDTO.ts b/src/infrastructure/model/blockchainScoreDTO.ts deleted file mode 100644 index 72e95b5fc9..0000000000 --- a/src/infrastructure/model/blockchainScoreDTO.ts +++ /dev/null @@ -1,51 +0,0 @@ -/* - * Copyright 2019 NEM - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -/** - * Catapult REST Endpoints - * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) - * - * The version of the OpenAPI document: 0.7.17 - * - * - * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). - * https://openapi-generator.tech - * Do not edit the class manually. - */ - - -export class BlockchainScoreDTO { - 'scoreHigh': Array; - 'scoreLow': Array; - - static discriminator: string | undefined = undefined; - - static attributeTypeMap: Array<{name: string, baseName: string, type: string}> = [ - { - "name": "scoreHigh", - "baseName": "scoreHigh", - "type": "Array" - }, - { - "name": "scoreLow", - "baseName": "scoreLow", - "type": "Array" - } ]; - - static getAttributeTypeMap() { - return BlockchainScoreDTO.attributeTypeMap; - } -} - diff --git a/src/infrastructure/model/chainScoreDTO.ts b/src/infrastructure/model/chainScoreDTO.ts index d935b27df0..e10f4a106b 100644 --- a/src/infrastructure/model/chainScoreDTO.ts +++ b/src/infrastructure/model/chainScoreDTO.ts @@ -27,8 +27,14 @@ export class ChainScoreDTO { - 'scoreHigh': Array; - 'scoreLow': Array; + /** + * Score of the blockchain.During synchronization, nodes try to get the blockchain with highest score in the network. + */ + 'scoreHigh': string; + /** + * Score of the blockchain.During synchronization, nodes try to get the blockchain with highest score in the network. + */ + 'scoreLow': string; static discriminator: string | undefined = undefined; @@ -36,12 +42,12 @@ export class ChainScoreDTO { { "name": "scoreHigh", "baseName": "scoreHigh", - "type": "Array" + "type": "string" }, { "name": "scoreLow", "baseName": "scoreLow", - "type": "Array" + "type": "string" } ]; static getAttributeTypeMap() { diff --git a/src/infrastructure/model/communicationTimestamps.ts b/src/infrastructure/model/communicationTimestamps.ts deleted file mode 100644 index 5731cdd6ff..0000000000 --- a/src/infrastructure/model/communicationTimestamps.ts +++ /dev/null @@ -1,51 +0,0 @@ -/* - * Copyright 2019 NEM - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -/** - * Catapult REST Endpoints - * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) - * - * The version of the OpenAPI document: 0.7.17 - * - * - * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). - * https://openapi-generator.tech - * Do not edit the class manually. - */ - - -export class CommunicationTimestamps { - 'sendTimestamp'?: Array; - 'receiveTimestamp'?: Array; - - static discriminator: string | undefined = undefined; - - static attributeTypeMap: Array<{name: string, baseName: string, type: string}> = [ - { - "name": "sendTimestamp", - "baseName": "sendTimestamp", - "type": "Array" - }, - { - "name": "receiveTimestamp", - "baseName": "receiveTimestamp", - "type": "Array" - } ]; - - static getAttributeTypeMap() { - return CommunicationTimestamps.attributeTypeMap; - } -} - diff --git a/src/infrastructure/model/communicationTimestampsDTO.ts b/src/infrastructure/model/communicationTimestampsDTO.ts index d379b4e5fe..45bae996b8 100644 --- a/src/infrastructure/model/communicationTimestampsDTO.ts +++ b/src/infrastructure/model/communicationTimestampsDTO.ts @@ -27,8 +27,14 @@ export class CommunicationTimestampsDTO { - 'sendTimestamp'?: Array; - 'receiveTimestamp'?: Array; + /** + * Number of seconds elapsed since the creation of the nemesis block. + */ + 'sendTimestamp'?: string; + /** + * Number of seconds elapsed since the creation of the nemesis block. + */ + 'receiveTimestamp'?: string; static discriminator: string | undefined = undefined; @@ -36,12 +42,12 @@ export class CommunicationTimestampsDTO { { "name": "sendTimestamp", "baseName": "sendTimestamp", - "type": "Array" + "type": "string" }, { "name": "receiveTimestamp", "baseName": "receiveTimestamp", - "type": "Array" + "type": "string" } ]; static getAttributeTypeMap() { diff --git a/src/infrastructure/model/cosignatoryModificationAction.ts b/src/infrastructure/model/cosignatoryModificationAction.ts deleted file mode 100644 index f0f7897147..0000000000 --- a/src/infrastructure/model/cosignatoryModificationAction.ts +++ /dev/null @@ -1,35 +0,0 @@ -/* - * Copyright 2019 NEM - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -/** - * Catapult REST Endpoints - * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) - * - * The version of the OpenAPI document: 0.7.18 - * - * - * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). - * https://openapi-generator.tech - * Do not edit the class manually. - */ - - -/** -* Type of modification: * 0 - Remove cosignatory. * 1 - Add cosignatory. -*/ -export enum CosignatoryModificationAction { - NUMBER_0 = 0, - NUMBER_1 = 1 -} diff --git a/src/infrastructure/model/cosignature.ts b/src/infrastructure/model/cosignature.ts index 68585d822d..83f424a46b 100644 --- a/src/infrastructure/model/cosignature.ts +++ b/src/infrastructure/model/cosignature.ts @@ -28,6 +28,9 @@ export class Cosignature { 'parentHash'?: string; + /** + * Entity\'s signature generated by the signer. + */ 'signature'?: string; 'signerPublicKey'?: string; diff --git a/src/infrastructure/model/cosignatureDTO.ts b/src/infrastructure/model/cosignatureDTO.ts index 8135e67528..1c8e907927 100644 --- a/src/infrastructure/model/cosignatureDTO.ts +++ b/src/infrastructure/model/cosignatureDTO.ts @@ -29,6 +29,9 @@ import { CosignatureDTOAllOf } from './cosignatureDTOAllOf'; import { VerifiableEntityDTO } from './verifiableEntityDTO'; export class CosignatureDTO { + /** + * Entity\'s signature generated by the signer. + */ 'signature': string; 'signerPublicKey': string; diff --git a/src/infrastructure/model/difficulty.ts b/src/infrastructure/model/difficulty.ts deleted file mode 100644 index b0f0b003e9..0000000000 --- a/src/infrastructure/model/difficulty.ts +++ /dev/null @@ -1,34 +0,0 @@ -/* - * Copyright 2019 NEM - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -/** - * Catapult REST Endpoints - * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) - * - * The version of the OpenAPI document: 0.7.18 - * - * - * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). - * https://openapi-generator.tech - * Do not edit the class manually. - */ - - -export class Difficulty extends Array { - - static discriminator: string | undefined = undefined; - -} - diff --git a/src/infrastructure/model/embeddedAccountAddressRestrictionTransactionDTO.ts b/src/infrastructure/model/embeddedAccountAddressRestrictionTransactionDTO.ts index 107916e547..6edb39aeab 100644 --- a/src/infrastructure/model/embeddedAccountAddressRestrictionTransactionDTO.ts +++ b/src/infrastructure/model/embeddedAccountAddressRestrictionTransactionDTO.ts @@ -37,8 +37,14 @@ export class EmbeddedAccountAddressRestrictionTransactionDTO { */ 'version': number; 'type': number; - 'maxFee': Array; - 'deadline': Array; + /** + * Absolute amount. An amount of 123456789 (absolute) for a mosaic with divisibility 6 means 123.456789 (relative). + */ + 'maxFee': string; + /** + * Duration expressed in number of blocks. + */ + 'deadline': string; 'restrictionType': AccountRestrictionTypeEnum; 'modifications': Array; @@ -63,12 +69,12 @@ export class EmbeddedAccountAddressRestrictionTransactionDTO { { "name": "maxFee", "baseName": "maxFee", - "type": "Array" + "type": "string" }, { "name": "deadline", "baseName": "deadline", - "type": "Array" + "type": "string" }, { "name": "restrictionType", diff --git a/src/infrastructure/model/embeddedAccountLinkTransactionDTO.ts b/src/infrastructure/model/embeddedAccountLinkTransactionDTO.ts index 31a40eef7a..6d0573c0b0 100644 --- a/src/infrastructure/model/embeddedAccountLinkTransactionDTO.ts +++ b/src/infrastructure/model/embeddedAccountLinkTransactionDTO.ts @@ -36,8 +36,14 @@ export class EmbeddedAccountLinkTransactionDTO { */ 'version': number; 'type': number; - 'maxFee': Array; - 'deadline': Array; + /** + * Absolute amount. An amount of 123456789 (absolute) for a mosaic with divisibility 6 means 123.456789 (relative). + */ + 'maxFee': string; + /** + * Duration expressed in number of blocks. + */ + 'deadline': string; 'remotePublicKey': string; 'linkAction': AccountLinkActionEnum; @@ -62,12 +68,12 @@ export class EmbeddedAccountLinkTransactionDTO { { "name": "maxFee", "baseName": "maxFee", - "type": "Array" + "type": "string" }, { "name": "deadline", "baseName": "deadline", - "type": "Array" + "type": "string" }, { "name": "remotePublicKey", diff --git a/src/infrastructure/model/embeddedAccountMosaicRestrictionTransactionDTO.ts b/src/infrastructure/model/embeddedAccountMosaicRestrictionTransactionDTO.ts index 9fdc9e072c..a88e8e3473 100644 --- a/src/infrastructure/model/embeddedAccountMosaicRestrictionTransactionDTO.ts +++ b/src/infrastructure/model/embeddedAccountMosaicRestrictionTransactionDTO.ts @@ -37,8 +37,14 @@ export class EmbeddedAccountMosaicRestrictionTransactionDTO { */ 'version': number; 'type': number; - 'maxFee': Array; - 'deadline': Array; + /** + * Absolute amount. An amount of 123456789 (absolute) for a mosaic with divisibility 6 means 123.456789 (relative). + */ + 'maxFee': string; + /** + * Duration expressed in number of blocks. + */ + 'deadline': string; 'restrictionType': AccountRestrictionTypeEnum; 'modifications': Array; @@ -63,12 +69,12 @@ export class EmbeddedAccountMosaicRestrictionTransactionDTO { { "name": "maxFee", "baseName": "maxFee", - "type": "Array" + "type": "string" }, { "name": "deadline", "baseName": "deadline", - "type": "Array" + "type": "string" }, { "name": "restrictionType", diff --git a/src/infrastructure/model/embeddedAccountOperationRestrictionTransactionDTO.ts b/src/infrastructure/model/embeddedAccountOperationRestrictionTransactionDTO.ts index 79feea1c67..b15053ef48 100644 --- a/src/infrastructure/model/embeddedAccountOperationRestrictionTransactionDTO.ts +++ b/src/infrastructure/model/embeddedAccountOperationRestrictionTransactionDTO.ts @@ -37,8 +37,14 @@ export class EmbeddedAccountOperationRestrictionTransactionDTO { */ 'version': number; 'type': number; - 'maxFee': Array; - 'deadline': Array; + /** + * Absolute amount. An amount of 123456789 (absolute) for a mosaic with divisibility 6 means 123.456789 (relative). + */ + 'maxFee': string; + /** + * Duration expressed in number of blocks. + */ + 'deadline': string; 'restrictionType': AccountRestrictionTypeEnum; 'modifications': Array; @@ -63,12 +69,12 @@ export class EmbeddedAccountOperationRestrictionTransactionDTO { { "name": "maxFee", "baseName": "maxFee", - "type": "Array" + "type": "string" }, { "name": "deadline", "baseName": "deadline", - "type": "Array" + "type": "string" }, { "name": "restrictionType", diff --git a/src/infrastructure/model/embeddedAccountRestrictionTransactionDTO.ts b/src/infrastructure/model/embeddedAccountRestrictionTransactionDTO.ts deleted file mode 100644 index 2f37f5f430..0000000000 --- a/src/infrastructure/model/embeddedAccountRestrictionTransactionDTO.ts +++ /dev/null @@ -1,92 +0,0 @@ -/* - * Copyright 2019 NEM - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -/** - * Catapult REST Endpoints - * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) - * - * The version of the OpenAPI document: 0.7.17 - * - * - * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). - * https://openapi-generator.tech - * Do not edit the class manually. - */ - -import { AccountRestrictionModificationDTO } from './accountRestrictionModificationDTO'; -import { AccountRestrictionTransactionBodyDTO } from './accountRestrictionTransactionBodyDTO'; -import { AccountRestrictionTypeEnum } from './accountRestrictionTypeEnum'; -import { EmbeddedTransactionDTO } from './embeddedTransactionDTO'; -import { EntityTypeEnum } from './entityTypeEnum'; - -export class EmbeddedAccountRestrictionTransactionDTO { - /** - * Public key of the signer account. - */ - 'signer': string; - /** - * Version of the entity. The higher byte represents the network identifier: * 0x68 (MAIN_NET) - Public main network. * 0x98 (TEST_NET) - Public test network. * 0x60 (MIJIN) - Private network. * 0x90 (MIJIN_TEST) - Private test network. - */ - 'version': number; - 'type': EntityTypeEnum; - 'maxFee': Array; - 'deadline': Array; - 'propertyType': AccountRestrictionTypeEnum; - 'modifications': Array; - - static discriminator: string | undefined = undefined; - - static attributeTypeMap: Array<{name: string, baseName: string, type: string}> = [ - { - "name": "signer", - "baseName": "signer", - "type": "string" - }, - { - "name": "version", - "baseName": "version", - "type": "number" - }, - { - "name": "type", - "baseName": "type", - "type": "EntityTypeEnum" - }, - { - "name": "maxFee", - "baseName": "max_fee", - "type": "Array" - }, - { - "name": "deadline", - "baseName": "deadline", - "type": "Array" - }, - { - "name": "propertyType", - "baseName": "propertyType", - "type": "AccountRestrictionTypeEnum" - }, - { - "name": "modifications", - "baseName": "modifications", - "type": "Array" - } ]; - - static getAttributeTypeMap() { - return EmbeddedAccountRestrictionTransactionDTO.attributeTypeMap; - } -} - diff --git a/src/infrastructure/model/embeddedAddressAliasTransactionDTO.ts b/src/infrastructure/model/embeddedAddressAliasTransactionDTO.ts index d297c9dc69..78e7a3f73c 100644 --- a/src/infrastructure/model/embeddedAddressAliasTransactionDTO.ts +++ b/src/infrastructure/model/embeddedAddressAliasTransactionDTO.ts @@ -36,10 +36,19 @@ export class EmbeddedAddressAliasTransactionDTO { */ 'version': number; 'type': number; - 'maxFee': Array; - 'deadline': Array; + /** + * Absolute amount. An amount of 123456789 (absolute) for a mosaic with divisibility 6 means 123.456789 (relative). + */ + 'maxFee': string; + /** + * Duration expressed in number of blocks. + */ + 'deadline': string; 'aliasAction': AliasActionEnum; - 'namespaceId': Array; + /** + * Namespace identifier. + */ + 'namespaceId': string; /** * Decoded address. */ @@ -66,12 +75,12 @@ export class EmbeddedAddressAliasTransactionDTO { { "name": "maxFee", "baseName": "maxFee", - "type": "Array" + "type": "string" }, { "name": "deadline", "baseName": "deadline", - "type": "Array" + "type": "string" }, { "name": "aliasAction", @@ -81,7 +90,7 @@ export class EmbeddedAddressAliasTransactionDTO { { "name": "namespaceId", "baseName": "namespaceId", - "type": "Array" + "type": "string" }, { "name": "address", diff --git a/src/infrastructure/model/embeddedAddressMosaicRestrictionTransactionDTO.ts b/src/infrastructure/model/embeddedAddressMosaicRestrictionTransactionDTO.ts index af712e147e..013187bcda 100644 --- a/src/infrastructure/model/embeddedAddressMosaicRestrictionTransactionDTO.ts +++ b/src/infrastructure/model/embeddedAddressMosaicRestrictionTransactionDTO.ts @@ -35,16 +35,34 @@ export class EmbeddedAddressMosaicRestrictionTransactionDTO { */ 'version': number; 'type': number; - 'maxFee': Array; - 'deadline': Array; - 'mosaicId': Array; - 'restrictionKey': Array; + /** + * Absolute amount. An amount of 123456789 (absolute) for a mosaic with divisibility 6 means 123.456789 (relative). + */ + 'maxFee': string; + /** + * Duration expressed in number of blocks. + */ + 'deadline': string; + /** + * Mosaic identifier. If the most significant bit of byte 0 is set, a namespaceId (alias) is used instead of the real mosaic identifier. + */ + 'mosaicId': string; + /** + * Restriction key relative to the reference mosaic identifier. + */ + 'restrictionKey': string; /** * Address decoded. If the bit 0 of byte 0 is not set (like in 0x90), then it is a regular address. Else (e.g. 0x91) it represents a namespace id which starts at byte 1. */ 'targetAddress': string; - 'previousRestrictionValue': Array; - 'newRestrictionValue': Array; + /** + * Previous restriction value. + */ + 'previousRestrictionValue': string; + /** + * New restriction value. + */ + 'newRestrictionValue': string; static discriminator: string | undefined = undefined; @@ -67,22 +85,22 @@ export class EmbeddedAddressMosaicRestrictionTransactionDTO { { "name": "maxFee", "baseName": "maxFee", - "type": "Array" + "type": "string" }, { "name": "deadline", "baseName": "deadline", - "type": "Array" + "type": "string" }, { "name": "mosaicId", "baseName": "mosaicId", - "type": "Array" + "type": "string" }, { "name": "restrictionKey", "baseName": "restrictionKey", - "type": "Array" + "type": "string" }, { "name": "targetAddress", @@ -92,12 +110,12 @@ export class EmbeddedAddressMosaicRestrictionTransactionDTO { { "name": "previousRestrictionValue", "baseName": "previousRestrictionValue", - "type": "Array" + "type": "string" }, { "name": "newRestrictionValue", "baseName": "newRestrictionValue", - "type": "Array" + "type": "string" } ]; static getAttributeTypeMap() { diff --git a/src/infrastructure/model/embeddedGlobalMosaicRestrictionTransactionDTO.ts b/src/infrastructure/model/embeddedGlobalMosaicRestrictionTransactionDTO.ts index e3f73afe55..a4a32773b0 100644 --- a/src/infrastructure/model/embeddedGlobalMosaicRestrictionTransactionDTO.ts +++ b/src/infrastructure/model/embeddedGlobalMosaicRestrictionTransactionDTO.ts @@ -36,14 +36,35 @@ export class EmbeddedGlobalMosaicRestrictionTransactionDTO { */ 'version': number; 'type': number; - 'maxFee': Array; - 'deadline': Array; - 'mosaicId': Array; - 'referenceMosaicId': Array; - 'restrictionKey': Array; - 'previousRestrictionValue': Array; + /** + * Absolute amount. An amount of 123456789 (absolute) for a mosaic with divisibility 6 means 123.456789 (relative). + */ + 'maxFee': string; + /** + * Duration expressed in number of blocks. + */ + 'deadline': string; + /** + * Mosaic identifier. If the most significant bit of byte 0 is set, a namespaceId (alias) is used instead of the real mosaic identifier. + */ + 'mosaicId': string; + /** + * Mosaic identifier. If the most significant bit of byte 0 is set, a namespaceId (alias) is used instead of the real mosaic identifier. + */ + 'referenceMosaicId': string; + /** + * Restriction key relative to the reference mosaic identifier. + */ + 'restrictionKey': string; + /** + * Previous restriction value. + */ + 'previousRestrictionValue': string; 'previousRestrictionType': MosaicRestrictionTypeEnum; - 'newRestrictionValue': Array; + /** + * New restriction value. + */ + 'newRestrictionValue': string; 'newRestrictionType': MosaicRestrictionTypeEnum; static discriminator: string | undefined = undefined; @@ -67,32 +88,32 @@ export class EmbeddedGlobalMosaicRestrictionTransactionDTO { { "name": "maxFee", "baseName": "maxFee", - "type": "Array" + "type": "string" }, { "name": "deadline", "baseName": "deadline", - "type": "Array" + "type": "string" }, { "name": "mosaicId", "baseName": "mosaicId", - "type": "Array" + "type": "string" }, { "name": "referenceMosaicId", "baseName": "referenceMosaicId", - "type": "Array" + "type": "string" }, { "name": "restrictionKey", "baseName": "restrictionKey", - "type": "Array" + "type": "string" }, { "name": "previousRestrictionValue", "baseName": "previousRestrictionValue", - "type": "Array" + "type": "string" }, { "name": "previousRestrictionType", @@ -102,7 +123,7 @@ export class EmbeddedGlobalMosaicRestrictionTransactionDTO { { "name": "newRestrictionValue", "baseName": "newRestrictionValue", - "type": "Array" + "type": "string" }, { "name": "newRestrictionType", diff --git a/src/infrastructure/model/embeddedHashLockTransactionDTO.ts b/src/infrastructure/model/embeddedHashLockTransactionDTO.ts index 55e2f6bbc4..5d471109b4 100644 --- a/src/infrastructure/model/embeddedHashLockTransactionDTO.ts +++ b/src/infrastructure/model/embeddedHashLockTransactionDTO.ts @@ -36,11 +36,23 @@ export class EmbeddedHashLockTransactionDTO { */ 'version': number; 'type': number; - 'maxFee': Array; - 'deadline': Array; + /** + * Absolute amount. An amount of 123456789 (absolute) for a mosaic with divisibility 6 means 123.456789 (relative). + */ + 'maxFee': string; + /** + * Duration expressed in number of blocks. + */ + 'deadline': string; + /** + * Entity\'s signature generated by the signer. + */ 'signature': string; 'mosaic': Mosaic; - 'duration': Array; + /** + * Duration expressed in number of blocks. + */ + 'duration': string; 'hash': string; static discriminator: string | undefined = undefined; @@ -64,12 +76,12 @@ export class EmbeddedHashLockTransactionDTO { { "name": "maxFee", "baseName": "maxFee", - "type": "Array" + "type": "string" }, { "name": "deadline", "baseName": "deadline", - "type": "Array" + "type": "string" }, { "name": "signature", @@ -84,7 +96,7 @@ export class EmbeddedHashLockTransactionDTO { { "name": "duration", "baseName": "duration", - "type": "Array" + "type": "string" }, { "name": "hash", diff --git a/src/infrastructure/model/embeddedModifyMultisigAccountTransactionDTO.ts b/src/infrastructure/model/embeddedModifyMultisigAccountTransactionDTO.ts deleted file mode 100644 index 2436ff9dd8..0000000000 --- a/src/infrastructure/model/embeddedModifyMultisigAccountTransactionDTO.ts +++ /dev/null @@ -1,103 +0,0 @@ -/* - * Copyright 2019 NEM - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -/** - * Catapult REST Endpoints - * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) - * - * The version of the OpenAPI document: 0.7.17 - * - * - * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). - * https://openapi-generator.tech - * Do not edit the class manually. - */ - -import { CosignatoryModificationDTO } from './cosignatoryModificationDTO'; -import { EmbeddedTransactionDTO } from './embeddedTransactionDTO'; -import { EntityTypeEnum } from './entityTypeEnum'; -import { ModifyMultisigAccountTransactionBodyDTO } from './modifyMultisigAccountTransactionBodyDTO'; - -export class EmbeddedModifyMultisigAccountTransactionDTO { - 'signer': string; - /** - * Entity version. The higher byte represents the network identifier: * 0x68 (MAIN_NET) - Public main network. * 0x98 (TEST_NET) - Public test network. * 0x60 (MIJIN) - Private network. * 0x90 (MIJIN_TEST) - Private test network. - */ - 'version': number; - 'type': EntityTypeEnum; - 'maxFee': Array; - 'deadline': Array; - /** - * Number of signatures needed to remove a cosignatory. If we are modifying an existing multisig account, this indicates the relative change of the minimum cosignatories. - */ - 'minRemovalDelta': number; - /** - * Number of signatures needed to approve a transaction. If we are modifying an existing multisig account, this indicates the relative change of the minimum cosignatories. - */ - 'minApprovalDelta': number; - /** - * Array of cosignatory accounts to add or delete. - */ - 'modifications': Array; - - static discriminator: string | undefined = undefined; - - static attributeTypeMap: Array<{name: string, baseName: string, type: string}> = [ - { - "name": "signer", - "baseName": "signer", - "type": "string" - }, - { - "name": "version", - "baseName": "version", - "type": "number" - }, - { - "name": "type", - "baseName": "type", - "type": "EntityTypeEnum" - }, - { - "name": "maxFee", - "baseName": "maxFee", - "type": "Array" - }, - { - "name": "deadline", - "baseName": "deadline", - "type": "Array" - }, - { - "name": "minRemovalDelta", - "baseName": "minRemovalDelta", - "type": "number" - }, - { - "name": "minApprovalDelta", - "baseName": "minApprovalDelta", - "type": "number" - }, - { - "name": "modifications", - "baseName": "modifications", - "type": "Array" - } ]; - - static getAttributeTypeMap() { - return EmbeddedModifyMultisigAccountTransactionDTO.attributeTypeMap; - } -} - diff --git a/src/infrastructure/model/embeddedMosaicAliasTransactionDTO.ts b/src/infrastructure/model/embeddedMosaicAliasTransactionDTO.ts index 6dcec84138..18723c0622 100644 --- a/src/infrastructure/model/embeddedMosaicAliasTransactionDTO.ts +++ b/src/infrastructure/model/embeddedMosaicAliasTransactionDTO.ts @@ -36,11 +36,23 @@ export class EmbeddedMosaicAliasTransactionDTO { */ 'version': number; 'type': number; - 'maxFee': Array; - 'deadline': Array; + /** + * Absolute amount. An amount of 123456789 (absolute) for a mosaic with divisibility 6 means 123.456789 (relative). + */ + 'maxFee': string; + /** + * Duration expressed in number of blocks. + */ + 'deadline': string; 'aliasAction': AliasActionEnum; - 'namespaceId': Array; - 'mosaicId': Array; + /** + * Namespace identifier. + */ + 'namespaceId': string; + /** + * Mosaic identifier. + */ + 'mosaicId': string; static discriminator: string | undefined = undefined; @@ -63,12 +75,12 @@ export class EmbeddedMosaicAliasTransactionDTO { { "name": "maxFee", "baseName": "maxFee", - "type": "Array" + "type": "string" }, { "name": "deadline", "baseName": "deadline", - "type": "Array" + "type": "string" }, { "name": "aliasAction", @@ -78,12 +90,12 @@ export class EmbeddedMosaicAliasTransactionDTO { { "name": "namespaceId", "baseName": "namespaceId", - "type": "Array" + "type": "string" }, { "name": "mosaicId", "baseName": "mosaicId", - "type": "Array" + "type": "string" } ]; static getAttributeTypeMap() { diff --git a/src/infrastructure/model/embeddedMosaicDefinitionTransactionDTO.ts b/src/infrastructure/model/embeddedMosaicDefinitionTransactionDTO.ts index 1706fc1231..63f1b06d86 100644 --- a/src/infrastructure/model/embeddedMosaicDefinitionTransactionDTO.ts +++ b/src/infrastructure/model/embeddedMosaicDefinitionTransactionDTO.ts @@ -35,13 +35,22 @@ export class EmbeddedMosaicDefinitionTransactionDTO { */ 'version': number; 'type': number; - 'maxFee': Array; - 'deadline': Array; + /** + * Absolute amount. An amount of 123456789 (absolute) for a mosaic with divisibility 6 means 123.456789 (relative). + */ + 'maxFee': string; + /** + * Duration expressed in number of blocks. + */ + 'deadline': string; /** * Random nonce used to generate the mosaic id. */ 'nonce': number; - 'id': Array; + /** + * Mosaic identifier. + */ + 'id': string; /** * - 0x00 (none) - No flags present. - 0x01 (supplyMutable) - Mosaic supports supply changes even when mosaic owner owns partial supply. - 0x02 (transferable) - Mosaic supports transfers between arbitrary accounts. When not set, mosaic can only be transferred to and from mosaic owner. - 0x04 (restrictable) - Mosaic supports custom restrictions configured by mosaic owner. */ @@ -50,7 +59,10 @@ export class EmbeddedMosaicDefinitionTransactionDTO { * Determines up to what decimal place the mosaic can be divided. Divisibility of 3 means that a mosaic can be divided into smallest parts of 0.001 mosaics. The divisibility must be in the range of 0 and 6. */ 'divisibility'?: number; - 'duration'?: Array; + /** + * Duration expressed in number of blocks. + */ + 'duration'?: string; static discriminator: string | undefined = undefined; @@ -73,12 +85,12 @@ export class EmbeddedMosaicDefinitionTransactionDTO { { "name": "maxFee", "baseName": "maxFee", - "type": "Array" + "type": "string" }, { "name": "deadline", "baseName": "deadline", - "type": "Array" + "type": "string" }, { "name": "nonce", @@ -88,7 +100,7 @@ export class EmbeddedMosaicDefinitionTransactionDTO { { "name": "id", "baseName": "id", - "type": "Array" + "type": "string" }, { "name": "flags", @@ -103,7 +115,7 @@ export class EmbeddedMosaicDefinitionTransactionDTO { { "name": "duration", "baseName": "duration", - "type": "Array" + "type": "string" } ]; static getAttributeTypeMap() { diff --git a/src/infrastructure/model/embeddedMosaicSupplyChangeTransactionDTO.ts b/src/infrastructure/model/embeddedMosaicSupplyChangeTransactionDTO.ts index 374c77788a..490020e398 100644 --- a/src/infrastructure/model/embeddedMosaicSupplyChangeTransactionDTO.ts +++ b/src/infrastructure/model/embeddedMosaicSupplyChangeTransactionDTO.ts @@ -36,11 +36,23 @@ export class EmbeddedMosaicSupplyChangeTransactionDTO { */ 'version': number; 'type': number; - 'maxFee': Array; - 'deadline': Array; - 'mosaicId': Array; + /** + * Absolute amount. An amount of 123456789 (absolute) for a mosaic with divisibility 6 means 123.456789 (relative). + */ + 'maxFee': string; + /** + * Duration expressed in number of blocks. + */ + 'deadline': string; + /** + * Mosaic identifier. If the most significant bit of byte 0 is set, a namespaceId (alias) is used instead of the real mosaic identifier. + */ + 'mosaicId': string; 'action': MosaicSupplyChangeActionEnum; - 'delta': Array; + /** + * Absolute amount. An amount of 123456789 (absolute) for a mosaic with divisibility 6 means 123.456789 (relative). + */ + 'delta': string; static discriminator: string | undefined = undefined; @@ -63,17 +75,17 @@ export class EmbeddedMosaicSupplyChangeTransactionDTO { { "name": "maxFee", "baseName": "maxFee", - "type": "Array" + "type": "string" }, { "name": "deadline", "baseName": "deadline", - "type": "Array" + "type": "string" }, { "name": "mosaicId", "baseName": "mosaicId", - "type": "Array" + "type": "string" }, { "name": "action", @@ -83,7 +95,7 @@ export class EmbeddedMosaicSupplyChangeTransactionDTO { { "name": "delta", "baseName": "delta", - "type": "Array" + "type": "string" } ]; static getAttributeTypeMap() { diff --git a/src/infrastructure/model/embeddedMultisigAccountModificationTransactionDTO.ts b/src/infrastructure/model/embeddedMultisigAccountModificationTransactionDTO.ts index 5812ab62e3..91835b0ee2 100644 --- a/src/infrastructure/model/embeddedMultisigAccountModificationTransactionDTO.ts +++ b/src/infrastructure/model/embeddedMultisigAccountModificationTransactionDTO.ts @@ -36,8 +36,14 @@ export class EmbeddedMultisigAccountModificationTransactionDTO { */ 'version': number; 'type': number; - 'maxFee': Array; - 'deadline': Array; + /** + * Absolute amount. An amount of 123456789 (absolute) for a mosaic with divisibility 6 means 123.456789 (relative). + */ + 'maxFee': string; + /** + * Duration expressed in number of blocks. + */ + 'deadline': string; /** * Number of signatures needed to remove a cosignatory. If we are modifying an existing multisig account, this indicates the relative change of the minimum cosignatories. */ @@ -72,12 +78,12 @@ export class EmbeddedMultisigAccountModificationTransactionDTO { { "name": "maxFee", "baseName": "maxFee", - "type": "Array" + "type": "string" }, { "name": "deadline", "baseName": "deadline", - "type": "Array" + "type": "string" }, { "name": "minRemovalDelta", diff --git a/src/infrastructure/model/embeddedNamespaceRegistrationTransactionDTO.ts b/src/infrastructure/model/embeddedNamespaceRegistrationTransactionDTO.ts index eec0db850c..5b8c0cfd9b 100644 --- a/src/infrastructure/model/embeddedNamespaceRegistrationTransactionDTO.ts +++ b/src/infrastructure/model/embeddedNamespaceRegistrationTransactionDTO.ts @@ -36,12 +36,27 @@ export class EmbeddedNamespaceRegistrationTransactionDTO { */ 'version': number; 'type': number; - 'maxFee': Array; - 'deadline': Array; + /** + * Absolute amount. An amount of 123456789 (absolute) for a mosaic with divisibility 6 means 123.456789 (relative). + */ + 'maxFee': string; + /** + * Duration expressed in number of blocks. + */ + 'deadline': string; 'registrationType': NamespaceRegistrationTypeEnum; - 'duration': Array; - 'parentId': Array; - 'id': Array; + /** + * Duration expressed in number of blocks. + */ + 'duration': string; + /** + * Namespace identifier. + */ + 'parentId': string; + /** + * Namespace identifier. + */ + 'id': string; /** * Namespace name. */ @@ -68,12 +83,12 @@ export class EmbeddedNamespaceRegistrationTransactionDTO { { "name": "maxFee", "baseName": "maxFee", - "type": "Array" + "type": "string" }, { "name": "deadline", "baseName": "deadline", - "type": "Array" + "type": "string" }, { "name": "registrationType", @@ -83,17 +98,17 @@ export class EmbeddedNamespaceRegistrationTransactionDTO { { "name": "duration", "baseName": "duration", - "type": "Array" + "type": "string" }, { "name": "parentId", "baseName": "parentId", - "type": "Array" + "type": "string" }, { "name": "id", "baseName": "id", - "type": "Array" + "type": "string" }, { "name": "name", diff --git a/src/infrastructure/model/embeddedRegisterNamespaceTransactionDTO.ts b/src/infrastructure/model/embeddedRegisterNamespaceTransactionDTO.ts deleted file mode 100644 index 4eaf1a199e..0000000000 --- a/src/infrastructure/model/embeddedRegisterNamespaceTransactionDTO.ts +++ /dev/null @@ -1,109 +0,0 @@ -/* - * Copyright 2019 NEM - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -/** - * Catapult REST Endpoints - * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) - * - * The version of the OpenAPI document: 0.7.17 - * - * - * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). - * https://openapi-generator.tech - * Do not edit the class manually. - */ - -import { EmbeddedTransactionDTO } from './embeddedTransactionDTO'; -import { EntityTypeEnum } from './entityTypeEnum'; -import { NamespaceTypeEnum } from './namespaceTypeEnum'; -import { RegisterNamespaceTransactionBodyDTO } from './registerNamespaceTransactionBodyDTO'; - -export class EmbeddedRegisterNamespaceTransactionDTO { - 'signer': string; - /** - * Entity version. The higher byte represents the network identifier: * 0x68 (MAIN_NET) - Public main network. * 0x98 (TEST_NET) - Public test network. * 0x60 (MIJIN) - Private network. * 0x90 (MIJIN_TEST) - Private test network. - */ - 'version': number; - 'type': EntityTypeEnum; - 'maxFee': Array; - 'deadline': Array; - 'namespaceType': NamespaceTypeEnum; - 'duration': Array; - 'namespaceId': Array; - /** - * Namespace name. - */ - 'name': string; - 'parentId': Array; - - static discriminator: string | undefined = undefined; - - static attributeTypeMap: Array<{name: string, baseName: string, type: string}> = [ - { - "name": "signer", - "baseName": "signer", - "type": "string" - }, - { - "name": "version", - "baseName": "version", - "type": "number" - }, - { - "name": "type", - "baseName": "type", - "type": "EntityTypeEnum" - }, - { - "name": "maxFee", - "baseName": "maxFee", - "type": "Array" - }, - { - "name": "deadline", - "baseName": "deadline", - "type": "Array" - }, - { - "name": "namespaceType", - "baseName": "namespaceType", - "type": "NamespaceTypeEnum" - }, - { - "name": "duration", - "baseName": "duration", - "type": "Array" - }, - { - "name": "namespaceId", - "baseName": "namespaceId", - "type": "Array" - }, - { - "name": "name", - "baseName": "name", - "type": "string" - }, - { - "name": "parentId", - "baseName": "parentId", - "type": "Array" - } ]; - - static getAttributeTypeMap() { - return EmbeddedRegisterNamespaceTransactionDTO.attributeTypeMap; - } -} - diff --git a/src/infrastructure/model/embeddedSecretLockTransactionDTO.ts b/src/infrastructure/model/embeddedSecretLockTransactionDTO.ts index 2ede009316..acf435d9c8 100644 --- a/src/infrastructure/model/embeddedSecretLockTransactionDTO.ts +++ b/src/infrastructure/model/embeddedSecretLockTransactionDTO.ts @@ -36,11 +36,26 @@ export class EmbeddedSecretLockTransactionDTO { */ 'version': number; 'type': number; - 'maxFee': Array; - 'deadline': Array; - 'duration': Array; - 'mosaicId': Array; - 'amount': Array; + /** + * Absolute amount. An amount of 123456789 (absolute) for a mosaic with divisibility 6 means 123.456789 (relative). + */ + 'maxFee': string; + /** + * Duration expressed in number of blocks. + */ + 'deadline': string; + /** + * Duration expressed in number of blocks. + */ + 'duration': string; + /** + * Mosaic identifier. If the most significant bit of byte 0 is set, a namespaceId (alias) is used instead of the real mosaic identifier. + */ + 'mosaicId': string; + /** + * Absolute amount. An amount of 123456789 (absolute) for a mosaic with divisibility 6 means 123.456789 (relative). + */ + 'amount': string; 'hashAlgorithm': LockHashAlgorithmEnum; 'secret': string; /** @@ -69,27 +84,27 @@ export class EmbeddedSecretLockTransactionDTO { { "name": "maxFee", "baseName": "maxFee", - "type": "Array" + "type": "string" }, { "name": "deadline", "baseName": "deadline", - "type": "Array" + "type": "string" }, { "name": "duration", "baseName": "duration", - "type": "Array" + "type": "string" }, { "name": "mosaicId", "baseName": "mosaicId", - "type": "Array" + "type": "string" }, { "name": "amount", "baseName": "amount", - "type": "Array" + "type": "string" }, { "name": "hashAlgorithm", diff --git a/src/infrastructure/model/embeddedSecretProofTransactionDTO.ts b/src/infrastructure/model/embeddedSecretProofTransactionDTO.ts index dc85495bf0..d189c05cdc 100644 --- a/src/infrastructure/model/embeddedSecretProofTransactionDTO.ts +++ b/src/infrastructure/model/embeddedSecretProofTransactionDTO.ts @@ -36,8 +36,14 @@ export class EmbeddedSecretProofTransactionDTO { */ 'version': number; 'type': number; - 'maxFee': Array; - 'deadline': Array; + /** + * Absolute amount. An amount of 123456789 (absolute) for a mosaic with divisibility 6 means 123.456789 (relative). + */ + 'maxFee': string; + /** + * Duration expressed in number of blocks. + */ + 'deadline': string; 'hashAlgorithm': LockHashAlgorithmEnum; 'secret': string; /** @@ -70,12 +76,12 @@ export class EmbeddedSecretProofTransactionDTO { { "name": "maxFee", "baseName": "maxFee", - "type": "Array" + "type": "string" }, { "name": "deadline", "baseName": "deadline", - "type": "Array" + "type": "string" }, { "name": "hashAlgorithm", diff --git a/src/infrastructure/model/embeddedTransactionDTO.ts b/src/infrastructure/model/embeddedTransactionDTO.ts index 66fedf8cf4..a14891767f 100644 --- a/src/infrastructure/model/embeddedTransactionDTO.ts +++ b/src/infrastructure/model/embeddedTransactionDTO.ts @@ -35,8 +35,14 @@ export class EmbeddedTransactionDTO { */ 'version': number; 'type': number; - 'maxFee': Array; - 'deadline': Array; + /** + * Absolute amount. An amount of 123456789 (absolute) for a mosaic with divisibility 6 means 123.456789 (relative). + */ + 'maxFee': string; + /** + * Duration expressed in number of blocks. + */ + 'deadline': string; static discriminator: string | undefined = undefined; @@ -59,12 +65,12 @@ export class EmbeddedTransactionDTO { { "name": "maxFee", "baseName": "maxFee", - "type": "Array" + "type": "string" }, { "name": "deadline", "baseName": "deadline", - "type": "Array" + "type": "string" } ]; static getAttributeTypeMap() { diff --git a/src/infrastructure/model/embeddedTransactionInfoDTO.ts b/src/infrastructure/model/embeddedTransactionInfoDTO.ts index 45ecaf78cf..c9a384833b 100644 --- a/src/infrastructure/model/embeddedTransactionInfoDTO.ts +++ b/src/infrastructure/model/embeddedTransactionInfoDTO.ts @@ -29,7 +29,7 @@ import { EmbeddedTransactionMetaDTO } from './embeddedTransactionMetaDTO'; export class EmbeddedTransactionInfoDTO { 'meta': EmbeddedTransactionMetaDTO; - 'transaction': object; + 'transaction': any; static discriminator: string | undefined = undefined; @@ -42,7 +42,7 @@ export class EmbeddedTransactionInfoDTO { { "name": "transaction", "baseName": "transaction", - "type": "AnyOfEmbeddedAccountLinkTransactionDTOEmbeddedMosaicDefinitionTransactionDTOEmbeddedMosaicSupplyChangeTransactionDTOEmbeddedMultisigAccountModificationTransactionDTOEmbeddedNamespaceRegistrationTransactionDTOEmbeddedAddressAliasTransactionDTOEmbeddedMosaicAliasTransactionDTOEmbeddedHashLockTransactionDTOEmbeddedSecretLockTransactionDTOEmbeddedSecretProofTransactionDTOEmbeddedAccountAddressRestrictionTransactionDTOEmbeddedAccountMosaicRestrictionTransactionDTOEmbeddedAccountOperationRestrictionTransactionDTOEmbeddedGlobalMosaicRestrictionTransactionDTOEmbeddedAddressMosaicRestrictionTransactionDTOEmbeddedTransferTransactionDTO" + "type": "any" } ]; static getAttributeTypeMap() { diff --git a/src/infrastructure/model/embeddedTransactionMetaDTO.ts b/src/infrastructure/model/embeddedTransactionMetaDTO.ts index f7258a9484..387c32a1ee 100644 --- a/src/infrastructure/model/embeddedTransactionMetaDTO.ts +++ b/src/infrastructure/model/embeddedTransactionMetaDTO.ts @@ -27,7 +27,10 @@ export class EmbeddedTransactionMetaDTO { - 'height': Array; + /** + * Height of the blockchain. + */ + 'height': string; 'aggregateHash': string; 'aggregateId': string; 'index': number; @@ -39,7 +42,7 @@ export class EmbeddedTransactionMetaDTO { { "name": "height", "baseName": "height", - "type": "Array" + "type": "string" }, { "name": "aggregateHash", diff --git a/src/infrastructure/model/embeddedTransferTransactionDTO.ts b/src/infrastructure/model/embeddedTransferTransactionDTO.ts index fc16070f21..0d8aa1b31c 100644 --- a/src/infrastructure/model/embeddedTransferTransactionDTO.ts +++ b/src/infrastructure/model/embeddedTransferTransactionDTO.ts @@ -37,8 +37,14 @@ export class EmbeddedTransferTransactionDTO { */ 'version': number; 'type': number; - 'maxFee': Array; - 'deadline': Array; + /** + * Absolute amount. An amount of 123456789 (absolute) for a mosaic with divisibility 6 means 123.456789 (relative). + */ + 'maxFee': string; + /** + * Duration expressed in number of blocks. + */ + 'deadline': string; /** * Address decoded. If the bit 0 of byte 0 is not set (like in 0x90), then it is a regular address. Else (e.g. 0x91) it represents a namespace id which starts at byte 1. */ @@ -70,12 +76,12 @@ export class EmbeddedTransferTransactionDTO { { "name": "maxFee", "baseName": "maxFee", - "type": "Array" + "type": "string" }, { "name": "deadline", "baseName": "deadline", - "type": "Array" + "type": "string" }, { "name": "recipientAddress", diff --git a/src/infrastructure/model/entityTypeEnum.ts b/src/infrastructure/model/entityTypeEnum.ts deleted file mode 100644 index 47fced18d1..0000000000 --- a/src/infrastructure/model/entityTypeEnum.ts +++ /dev/null @@ -1,53 +0,0 @@ -/* - * Copyright 2019 NEM - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -/** - * Catapult REST Endpoints - * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) - * - * The version of the OpenAPI document: 0.7.17 - * - * - * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). - * https://openapi-generator.tech - * Do not edit the class manually. - */ - - -/** -* Type of entity: * 0x414C (16716 decimal) - AccountLinkTransaction. * 0x4141 (16705 decimal) - AggregateCompleteTransaction. * 0x4241 (16961 decimal) - AggregateBondedTransaction. * 0x414D (16717 decimal) - MosaicDefinitionTransaction. * 0x424D (16973 decimal) - MosaicSupplyChangeTransaction. * 0x424E (16974 decimal) - AddressAliasTransaction. * 0x434E (17230 decimal) - MosaicAliasTransaction. * 0x4155 (16725 decimal) - ModifyMultisigAccountTransaction. * 0x414E (16718 decimal) - RegisterNamespaceTransaction. * 0x4148 (16712 decimal) - HashLockTransaction. * 0x4152 (16722 decimal) - SecretLockTransaction. * 0x4252 (16978 decimal) - SecretProofTransaction. * 0x4150 (16720 decimal) - AccountAddressRestrictionTransaction. * 0x4250 (16976 decimal) - AccountMosaicRestrictionTransaction. * 0x4350 (17232 decimal) - AccountOperationRestrictionTransaction. * 0x4151 (16721 decimal) - MosaicGlobalRestrictionTransaction. * 0x4251 (16977 decimal) - MosaicAddressRestrictionTransaction. * 0x4154 (16724 decimal) - TransferTransaction. * 0x8043 (32835 decimal) - Nemesis block. * 0x8143 (33091 decimal) - Regular block. -*/ -export enum EntityTypeEnum { - NUMBER_16716 = 16716, - NUMBER_16705 = 16705, - NUMBER_16961 = 16961, - NUMBER_16717 = 16717, - NUMBER_16973 = 16973, - NUMBER_16974 = 16974, - NUMBER_17230 = 17230, - NUMBER_16725 = 16725, - NUMBER_16718 = 16718, - NUMBER_16712 = 16712, - NUMBER_16722 = 16722, - NUMBER_16978 = 16978, - NUMBER_16720 = 16720, - NUMBER_16976 = 16976, - NUMBER_17232 = 17232, - NUMBER_16721 = 16721, - NUMBER_16977 = 16977, - NUMBER_16724 = 16724, - NUMBER_32835 = 32835, - NUMBER_33091 = 33091 -} diff --git a/src/infrastructure/model/globalMosaicRestrictionTransactionBodyDTO.ts b/src/infrastructure/model/globalMosaicRestrictionTransactionBodyDTO.ts index a7145acd7d..ba475fe259 100644 --- a/src/infrastructure/model/globalMosaicRestrictionTransactionBodyDTO.ts +++ b/src/infrastructure/model/globalMosaicRestrictionTransactionBodyDTO.ts @@ -28,12 +28,27 @@ import { MosaicRestrictionTypeEnum } from './mosaicRestrictionTypeEnum'; export class GlobalMosaicRestrictionTransactionBodyDTO { - 'mosaicId': Array; - 'referenceMosaicId': Array; - 'restrictionKey': Array; - 'previousRestrictionValue': Array; + /** + * Mosaic identifier. If the most significant bit of byte 0 is set, a namespaceId (alias) is used instead of the real mosaic identifier. + */ + 'mosaicId': string; + /** + * Mosaic identifier. If the most significant bit of byte 0 is set, a namespaceId (alias) is used instead of the real mosaic identifier. + */ + 'referenceMosaicId': string; + /** + * Restriction key relative to the reference mosaic identifier. + */ + 'restrictionKey': string; + /** + * Previous restriction value. + */ + 'previousRestrictionValue': string; 'previousRestrictionType': MosaicRestrictionTypeEnum; - 'newRestrictionValue': Array; + /** + * New restriction value. + */ + 'newRestrictionValue': string; 'newRestrictionType': MosaicRestrictionTypeEnum; static discriminator: string | undefined = undefined; @@ -42,22 +57,22 @@ export class GlobalMosaicRestrictionTransactionBodyDTO { { "name": "mosaicId", "baseName": "mosaicId", - "type": "Array" + "type": "string" }, { "name": "referenceMosaicId", "baseName": "referenceMosaicId", - "type": "Array" + "type": "string" }, { "name": "restrictionKey", "baseName": "restrictionKey", - "type": "Array" + "type": "string" }, { "name": "previousRestrictionValue", "baseName": "previousRestrictionValue", - "type": "Array" + "type": "string" }, { "name": "previousRestrictionType", @@ -67,7 +82,7 @@ export class GlobalMosaicRestrictionTransactionBodyDTO { { "name": "newRestrictionValue", "baseName": "newRestrictionValue", - "type": "Array" + "type": "string" }, { "name": "newRestrictionType", diff --git a/src/infrastructure/model/globalMosaicRestrictionTransactionDTO.ts b/src/infrastructure/model/globalMosaicRestrictionTransactionDTO.ts index 63150bf0b7..3620ce7629 100644 --- a/src/infrastructure/model/globalMosaicRestrictionTransactionDTO.ts +++ b/src/infrastructure/model/globalMosaicRestrictionTransactionDTO.ts @@ -33,6 +33,9 @@ import { TransactionDTO } from './transactionDTO'; * Transaction to set a network-wide restriction rule to a mosaic. */ export class GlobalMosaicRestrictionTransactionDTO { + /** + * Entity\'s signature generated by the signer. + */ 'signature': string; 'signerPublicKey': string; /** @@ -40,14 +43,35 @@ export class GlobalMosaicRestrictionTransactionDTO { */ 'version': number; 'type': number; - 'maxFee': Array; - 'deadline': Array; - 'mosaicId': Array; - 'referenceMosaicId': Array; - 'restrictionKey': Array; - 'previousRestrictionValue': Array; + /** + * Absolute amount. An amount of 123456789 (absolute) for a mosaic with divisibility 6 means 123.456789 (relative). + */ + 'maxFee': string; + /** + * Duration expressed in number of blocks. + */ + 'deadline': string; + /** + * Mosaic identifier. If the most significant bit of byte 0 is set, a namespaceId (alias) is used instead of the real mosaic identifier. + */ + 'mosaicId': string; + /** + * Mosaic identifier. If the most significant bit of byte 0 is set, a namespaceId (alias) is used instead of the real mosaic identifier. + */ + 'referenceMosaicId': string; + /** + * Restriction key relative to the reference mosaic identifier. + */ + 'restrictionKey': string; + /** + * Previous restriction value. + */ + 'previousRestrictionValue': string; 'previousRestrictionType': MosaicRestrictionTypeEnum; - 'newRestrictionValue': Array; + /** + * New restriction value. + */ + 'newRestrictionValue': string; 'newRestrictionType': MosaicRestrictionTypeEnum; static discriminator: string | undefined = undefined; @@ -76,32 +100,32 @@ export class GlobalMosaicRestrictionTransactionDTO { { "name": "maxFee", "baseName": "maxFee", - "type": "Array" + "type": "string" }, { "name": "deadline", "baseName": "deadline", - "type": "Array" + "type": "string" }, { "name": "mosaicId", "baseName": "mosaicId", - "type": "Array" + "type": "string" }, { "name": "referenceMosaicId", "baseName": "referenceMosaicId", - "type": "Array" + "type": "string" }, { "name": "restrictionKey", "baseName": "restrictionKey", - "type": "Array" + "type": "string" }, { "name": "previousRestrictionValue", "baseName": "previousRestrictionValue", - "type": "Array" + "type": "string" }, { "name": "previousRestrictionType", @@ -111,7 +135,7 @@ export class GlobalMosaicRestrictionTransactionDTO { { "name": "newRestrictionValue", "baseName": "newRestrictionValue", - "type": "Array" + "type": "string" }, { "name": "newRestrictionType", diff --git a/src/infrastructure/model/hashAlgorithmEnum.ts b/src/infrastructure/model/hashAlgorithmEnum.ts deleted file mode 100644 index f91360a949..0000000000 --- a/src/infrastructure/model/hashAlgorithmEnum.ts +++ /dev/null @@ -1,37 +0,0 @@ -/* - * Copyright 2019 NEM - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -/** - * Catapult REST Endpoints - * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) - * - * The version of the OpenAPI document: 0.7.17 - * - * - * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). - * https://openapi-generator.tech - * Do not edit the class manually. - */ - - -/** -* Algorithm used to hash te proof: * 0 (Op_Sha3_256) - Proof is hashed using sha3 256. * 1 (Op_Keccak_256) - Proof is hashed using Keccak (ETH compatibility). * 2 (Op_Hash_160) - Proof is hashed twice: first with Sha-256 and then with RIPEMD-160 (bitcoin’s OP_HASH160). * 3 (Op_Hash_256) - Proof is hashed twice with Sha-256 (bitcoin’s OP_HASH256). -*/ -export enum HashAlgorithmEnum { - NUMBER_0 = 0, - NUMBER_1 = 1, - NUMBER_2 = 2, - NUMBER_3 = 3 -} diff --git a/src/infrastructure/model/hashLockTransactionBodyDTO.ts b/src/infrastructure/model/hashLockTransactionBodyDTO.ts index e75ace96e9..9e4e3604a3 100644 --- a/src/infrastructure/model/hashLockTransactionBodyDTO.ts +++ b/src/infrastructure/model/hashLockTransactionBodyDTO.ts @@ -29,7 +29,10 @@ import { Mosaic } from './mosaic'; export class HashLockTransactionBodyDTO { 'mosaic': Mosaic; - 'duration': Array; + /** + * Duration expressed in number of blocks. + */ + 'duration': string; 'hash': string; static discriminator: string | undefined = undefined; @@ -43,7 +46,7 @@ export class HashLockTransactionBodyDTO { { "name": "duration", "baseName": "duration", - "type": "Array" + "type": "string" }, { "name": "hash", diff --git a/src/infrastructure/model/hashLockTransactionDTO.ts b/src/infrastructure/model/hashLockTransactionDTO.ts index ee17e69dc1..a349c08d13 100644 --- a/src/infrastructure/model/hashLockTransactionDTO.ts +++ b/src/infrastructure/model/hashLockTransactionDTO.ts @@ -33,6 +33,9 @@ import { TransactionDTO } from './transactionDTO'; * Transaction to lock funds before sending an aggregate bonded transaction. */ export class HashLockTransactionDTO { + /** + * Entity\'s signature generated by the signer. + */ 'signature': string; 'signerPublicKey': string; /** @@ -40,10 +43,19 @@ export class HashLockTransactionDTO { */ 'version': number; 'type': number; - 'maxFee': Array; - 'deadline': Array; + /** + * Absolute amount. An amount of 123456789 (absolute) for a mosaic with divisibility 6 means 123.456789 (relative). + */ + 'maxFee': string; + /** + * Duration expressed in number of blocks. + */ + 'deadline': string; 'mosaic': Mosaic; - 'duration': Array; + /** + * Duration expressed in number of blocks. + */ + 'duration': string; 'hash': string; static discriminator: string | undefined = undefined; @@ -72,12 +84,12 @@ export class HashLockTransactionDTO { { "name": "maxFee", "baseName": "maxFee", - "type": "Array" + "type": "string" }, { "name": "deadline", "baseName": "deadline", - "type": "Array" + "type": "string" }, { "name": "mosaic", @@ -87,7 +99,7 @@ export class HashLockTransactionDTO { { "name": "duration", "baseName": "duration", - "type": "Array" + "type": "string" }, { "name": "hash", diff --git a/src/infrastructure/model/height.ts b/src/infrastructure/model/height.ts deleted file mode 100644 index fc9ae32878..0000000000 --- a/src/infrastructure/model/height.ts +++ /dev/null @@ -1,34 +0,0 @@ -/* - * Copyright 2019 NEM - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -/** - * Catapult REST Endpoints - * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) - * - * The version of the OpenAPI document: 0.7.18 - * - * - * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). - * https://openapi-generator.tech - * Do not edit the class manually. - */ - - -export class Height extends Array { - - static discriminator: string | undefined = undefined; - -} - diff --git a/src/infrastructure/model/heightInfoDTO.ts b/src/infrastructure/model/heightInfoDTO.ts index 82d31767cc..7b720d9d32 100644 --- a/src/infrastructure/model/heightInfoDTO.ts +++ b/src/infrastructure/model/heightInfoDTO.ts @@ -27,7 +27,10 @@ export class HeightInfoDTO { - 'height': Array; + /** + * Height of the blockchain. + */ + 'height': string; static discriminator: string | undefined = undefined; @@ -35,7 +38,7 @@ export class HeightInfoDTO { { "name": "height", "baseName": "height", - "type": "Array" + "type": "string" } ]; static getAttributeTypeMap() { diff --git a/src/infrastructure/model/importance.ts b/src/infrastructure/model/importance.ts deleted file mode 100644 index cab79309a0..0000000000 --- a/src/infrastructure/model/importance.ts +++ /dev/null @@ -1,34 +0,0 @@ -/* - * Copyright 2019 NEM - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -/** - * Catapult REST Endpoints - * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) - * - * The version of the OpenAPI document: 0.7.18 - * - * - * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). - * https://openapi-generator.tech - * Do not edit the class manually. - */ - - -export class Importance extends Array { - - static discriminator: string | undefined = undefined; - -} - diff --git a/src/infrastructure/model/inflationReceiptDTO.ts b/src/infrastructure/model/inflationReceiptDTO.ts index b545a9ce5b..f30784e272 100644 --- a/src/infrastructure/model/inflationReceiptDTO.ts +++ b/src/infrastructure/model/inflationReceiptDTO.ts @@ -38,8 +38,14 @@ export class InflationReceiptDTO { */ 'version': number; 'type': ReceiptTypeEnum; - 'mosaicId': Array; - 'amount': Array; + /** + * Mosaic identifier. + */ + 'mosaicId': string; + /** + * Absolute amount. An amount of 123456789 (absolute) for a mosaic with divisibility 6 means 123.456789 (relative). + */ + 'amount': string; static discriminator: string | undefined = undefined; @@ -57,12 +63,12 @@ export class InflationReceiptDTO { { "name": "mosaicId", "baseName": "mosaicId", - "type": "Array" + "type": "string" }, { "name": "amount", "baseName": "amount", - "type": "Array" + "type": "string" } ]; static getAttributeTypeMap() { diff --git a/src/infrastructure/model/inflationReceiptDTOAllOf.ts b/src/infrastructure/model/inflationReceiptDTOAllOf.ts index 1efe5c2405..8b8f618c91 100644 --- a/src/infrastructure/model/inflationReceiptDTOAllOf.ts +++ b/src/infrastructure/model/inflationReceiptDTOAllOf.ts @@ -27,8 +27,14 @@ export class InflationReceiptDTOAllOf { - 'mosaicId': Array; - 'amount': Array; + /** + * Mosaic identifier. + */ + 'mosaicId': string; + /** + * Absolute amount. An amount of 123456789 (absolute) for a mosaic with divisibility 6 means 123.456789 (relative). + */ + 'amount': string; static discriminator: string | undefined = undefined; @@ -36,12 +42,12 @@ export class InflationReceiptDTOAllOf { { "name": "mosaicId", "baseName": "mosaicId", - "type": "Array" + "type": "string" }, { "name": "amount", "baseName": "amount", - "type": "Array" + "type": "string" } ]; static getAttributeTypeMap() { diff --git a/src/infrastructure/model/keyMetadataDTO.ts b/src/infrastructure/model/keyMetadataDTO.ts deleted file mode 100644 index 78d3b35a54..0000000000 --- a/src/infrastructure/model/keyMetadataDTO.ts +++ /dev/null @@ -1,58 +0,0 @@ -/* - * Copyright 2019 NEM - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -/** - * Catapult REST Endpoints - * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) - * - * The version of the OpenAPI document: 0.7.17 - * - * - * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). - * https://openapi-generator.tech - * Do not edit the class manually. - */ - -import { MetadataDTO } from './metadataDTO'; - -export class KeyMetadataDTO { - /** - * Metadata key. - */ - 'key': string; - /** - * Array of metadata objects. - */ - 'metadata': Array; - - static discriminator: string | undefined = undefined; - - static attributeTypeMap: Array<{name: string, baseName: string, type: string}> = [ - { - "name": "key", - "baseName": "key", - "type": "string" - }, - { - "name": "metadata", - "baseName": "metadata", - "type": "Array" - } ]; - - static getAttributeTypeMap() { - return KeyMetadataDTO.attributeTypeMap; - } -} - diff --git a/src/infrastructure/model/linkActionEnum.ts b/src/infrastructure/model/linkActionEnum.ts deleted file mode 100644 index cdc2da198a..0000000000 --- a/src/infrastructure/model/linkActionEnum.ts +++ /dev/null @@ -1,35 +0,0 @@ -/* - * Copyright 2019 NEM - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -/** - * Catapult REST Endpoints - * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) - * - * The version of the OpenAPI document: 0.7.17 - * - * - * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). - * https://openapi-generator.tech - * Do not edit the class manually. - */ - - -/** -* Type of action: * 0 - Link. * 1 - Unlink. -*/ -export enum LinkActionEnum { - NUMBER_0 = 0, - NUMBER_1 = 1 -} diff --git a/src/infrastructure/model/merkleProofInfo.ts b/src/infrastructure/model/merkleProofInfo.ts deleted file mode 100644 index 736671acb0..0000000000 --- a/src/infrastructure/model/merkleProofInfo.ts +++ /dev/null @@ -1,49 +0,0 @@ -/* - * Copyright 2019 NEM - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -/** - * Catapult REST Endpoints - * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) - * - * The version of the OpenAPI document: 0.7.16 - * - * - * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). - * https://openapi-generator.tech - * Do not edit the class manually. - */ - -import { MerklePathItem } from './merklePathItem'; - -export class MerkleProofInfo { - /** - * The complementary data needed to calculate the merkle root. - */ - 'merklePath'?: Array; - - static discriminator: string | undefined = undefined; - - static attributeTypeMap: Array<{name: string, baseName: string, type: string}> = [ - { - "name": "merklePath", - "baseName": "merklePath", - "type": "Array" - } ]; - - static getAttributeTypeMap() { - return MerkleProofInfo.attributeTypeMap; - } -} - diff --git a/src/infrastructure/model/metadataDTO.ts b/src/infrastructure/model/metadataDTO.ts deleted file mode 100644 index 513e8918c9..0000000000 --- a/src/infrastructure/model/metadataDTO.ts +++ /dev/null @@ -1,82 +0,0 @@ -/* - * Copyright 2019 NEM - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -/** - * Catapult REST Endpoints - * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) - * - * The version of the OpenAPI document: 0.7.17 - * - * - * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). - * https://openapi-generator.tech - * Do not edit the class manually. - */ - -import { MetadataTypeEnum } from './metadataTypeEnum'; - -export class MetadataDTO { - 'compositeHash': string; - 'sourcePublicKey': string; - 'targetPublicKey': string; - 'scopedMetadataKey': Array; - 'targetId': Array; - 'metadataType': MetadataTypeEnum; - 'value': string; - - static discriminator: string | undefined = undefined; - - static attributeTypeMap: Array<{name: string, baseName: string, type: string}> = [ - { - "name": "compositeHash", - "baseName": "compositeHash", - "type": "string" - }, - { - "name": "sourcePublicKey", - "baseName": "sourcePublicKey", - "type": "string" - }, - { - "name": "targetPublicKey", - "baseName": "targetPublicKey", - "type": "string" - }, - { - "name": "scopedMetadataKey", - "baseName": "scopedMetadataKey", - "type": "Array" - }, - { - "name": "targetId", - "baseName": "targetId", - "type": "Array" - }, - { - "name": "metadataType", - "baseName": "metadataType", - "type": "MetadataTypeEnum" - }, - { - "name": "value", - "baseName": "value", - "type": "string" - } ]; - - static getAttributeTypeMap() { - return MetadataDTO.attributeTypeMap; - } -} - diff --git a/src/infrastructure/model/metadataTypeEnum.ts b/src/infrastructure/model/metadataTypeEnum.ts deleted file mode 100644 index 51a90a395b..0000000000 --- a/src/infrastructure/model/metadataTypeEnum.ts +++ /dev/null @@ -1,36 +0,0 @@ -/* - * Copyright 2019 NEM - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -/** - * Catapult REST Endpoints - * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) - * - * The version of the OpenAPI document: 0.7.17 - * - * - * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). - * https://openapi-generator.tech - * Do not edit the class manually. - */ - - -/** -* Type of metadata: * 0 - Account * 1 - Mosaic * 2 - Namespace -*/ -export enum MetadataTypeEnum { - NUMBER_0 = 0, - NUMBER_1 = 1, - NUMBER_2 = 2 -} diff --git a/src/infrastructure/model/models.ts b/src/infrastructure/model/models.ts index ad551ae0b9..49ccd87e9b 100644 --- a/src/infrastructure/model/models.ts +++ b/src/infrastructure/model/models.ts @@ -32,7 +32,6 @@ export * from './aggregateTransactionBodyDTO'; export * from './aliasActionEnum'; export * from './aliasDTO'; export * from './aliasTypeEnum'; -export * from './amount'; export * from './announceTransactionInfoDTO'; export * from './artifactExpiryReceiptDTO'; export * from './artifactExpiryReceiptDTOAllOf'; @@ -42,7 +41,6 @@ export * from './balanceTransferReceiptDTO'; export * from './balanceTransferReceiptDTOAllOf'; export * from './blockDTO'; export * from './blockDTOAllOf'; -export * from './blockDuration'; export * from './blockInfoDTO'; export * from './blockMetaDTO'; export * from './chainScoreDTO'; @@ -52,7 +50,6 @@ export * from './cosignatoryModificationDTO'; export * from './cosignature'; export * from './cosignatureDTO'; export * from './cosignatureDTOAllOf'; -export * from './difficulty'; export * from './embeddedAccountAddressRestrictionTransactionDTO'; export * from './embeddedAccountLinkTransactionDTO'; export * from './embeddedAccountMosaicRestrictionTransactionDTO'; @@ -77,9 +74,7 @@ export * from './globalMosaicRestrictionTransactionBodyDTO'; export * from './globalMosaicRestrictionTransactionDTO'; export * from './hashLockTransactionBodyDTO'; export * from './hashLockTransactionDTO'; -export * from './height'; export * from './heightInfoDTO'; -export * from './importance'; export * from './inflationReceiptDTO'; export * from './inflationReceiptDTOAllOf'; export * from './lockHashAlgorithmEnum'; @@ -94,7 +89,6 @@ export * from './mosaicAliasTransactionDTO'; export * from './mosaicDTO'; export * from './mosaicDefinitionTransactionBodyDTO'; export * from './mosaicDefinitionTransactionDTO'; -export * from './mosaicId'; export * from './mosaicIds'; export * from './mosaicInfoDTO'; export * from './mosaicNamesDTO'; @@ -110,7 +104,6 @@ export * from './multisigAccountModificationTransactionBodyDTO'; export * from './multisigAccountModificationTransactionDTO'; export * from './multisigDTO'; export * from './namespaceDTO'; -export * from './namespaceId'; export * from './namespaceIds'; export * from './namespaceInfoDTO'; export * from './namespaceMetaDTO'; @@ -126,7 +119,6 @@ export * from './receiptTypeEnum'; export * from './resolutionEntryDTO'; export * from './resolutionStatementDTO'; export * from './rolesTypeEnum'; -export * from './score'; export * from './secretLockTransactionBodyDTO'; export * from './secretLockTransactionDTO'; export * from './secretProofTransactionBodyDTO'; @@ -136,7 +128,6 @@ export * from './serverInfoDTO'; export * from './sourceDTO'; export * from './statementsDTO'; export * from './storageInfoDTO'; -export * from './timestamp'; export * from './transactionBodyDTO'; export * from './transactionDTO'; export * from './transactionHashes'; @@ -150,7 +141,6 @@ export * from './transactionTypeEnum'; export * from './transferTransactionBodyDTO'; export * from './transferTransactionDTO'; export * from './unresolvedMosaic'; -export * from './unresolvedMosaicId'; export * from './verifiableEntityDTO'; import localVarRequest = require('request'); @@ -189,7 +179,6 @@ import { AggregateTransactionBodyDTO } from './aggregateTransactionBodyDTO'; import { AliasActionEnum } from './aliasActionEnum'; import { AliasDTO } from './aliasDTO'; import { AliasTypeEnum } from './aliasTypeEnum'; -import { Amount } from './amount'; import { AnnounceTransactionInfoDTO } from './announceTransactionInfoDTO'; import { ArtifactExpiryReceiptDTO } from './artifactExpiryReceiptDTO'; import { ArtifactExpiryReceiptDTOAllOf } from './artifactExpiryReceiptDTOAllOf'; @@ -199,7 +188,6 @@ import { BalanceTransferReceiptDTO } from './balanceTransferReceiptDTO'; import { BalanceTransferReceiptDTOAllOf } from './balanceTransferReceiptDTOAllOf'; import { BlockDTO } from './blockDTO'; import { BlockDTOAllOf } from './blockDTOAllOf'; -import { BlockDuration } from './blockDuration'; import { BlockInfoDTO } from './blockInfoDTO'; import { BlockMetaDTO } from './blockMetaDTO'; import { ChainScoreDTO } from './chainScoreDTO'; @@ -209,7 +197,6 @@ import { CosignatoryModificationDTO } from './cosignatoryModificationDTO'; import { Cosignature } from './cosignature'; import { CosignatureDTO } from './cosignatureDTO'; import { CosignatureDTOAllOf } from './cosignatureDTOAllOf'; -import { Difficulty } from './difficulty'; import { EmbeddedAccountAddressRestrictionTransactionDTO } from './embeddedAccountAddressRestrictionTransactionDTO'; import { EmbeddedAccountLinkTransactionDTO } from './embeddedAccountLinkTransactionDTO'; import { EmbeddedAccountMosaicRestrictionTransactionDTO } from './embeddedAccountMosaicRestrictionTransactionDTO'; @@ -234,9 +221,7 @@ import { GlobalMosaicRestrictionTransactionBodyDTO } from './globalMosaicRestric import { GlobalMosaicRestrictionTransactionDTO } from './globalMosaicRestrictionTransactionDTO'; import { HashLockTransactionBodyDTO } from './hashLockTransactionBodyDTO'; import { HashLockTransactionDTO } from './hashLockTransactionDTO'; -import { Height } from './height'; import { HeightInfoDTO } from './heightInfoDTO'; -import { Importance } from './importance'; import { InflationReceiptDTO } from './inflationReceiptDTO'; import { InflationReceiptDTOAllOf } from './inflationReceiptDTOAllOf'; import { LockHashAlgorithmEnum } from './lockHashAlgorithmEnum'; @@ -251,7 +236,6 @@ import { MosaicAliasTransactionDTO } from './mosaicAliasTransactionDTO'; import { MosaicDTO } from './mosaicDTO'; import { MosaicDefinitionTransactionBodyDTO } from './mosaicDefinitionTransactionBodyDTO'; import { MosaicDefinitionTransactionDTO } from './mosaicDefinitionTransactionDTO'; -import { MosaicId } from './mosaicId'; import { MosaicIds } from './mosaicIds'; import { MosaicInfoDTO } from './mosaicInfoDTO'; import { MosaicNamesDTO } from './mosaicNamesDTO'; @@ -267,7 +251,6 @@ import { MultisigAccountModificationTransactionBodyDTO } from './multisigAccount import { MultisigAccountModificationTransactionDTO } from './multisigAccountModificationTransactionDTO'; import { MultisigDTO } from './multisigDTO'; import { NamespaceDTO } from './namespaceDTO'; -import { NamespaceId } from './namespaceId'; import { NamespaceIds } from './namespaceIds'; import { NamespaceInfoDTO } from './namespaceInfoDTO'; import { NamespaceMetaDTO } from './namespaceMetaDTO'; @@ -283,7 +266,6 @@ import { ReceiptTypeEnum } from './receiptTypeEnum'; import { ResolutionEntryDTO } from './resolutionEntryDTO'; import { ResolutionStatementDTO } from './resolutionStatementDTO'; import { RolesTypeEnum } from './rolesTypeEnum'; -import { Score } from './score'; import { SecretLockTransactionBodyDTO } from './secretLockTransactionBodyDTO'; import { SecretLockTransactionDTO } from './secretLockTransactionDTO'; import { SecretProofTransactionBodyDTO } from './secretProofTransactionBodyDTO'; @@ -293,7 +275,6 @@ import { ServerInfoDTO } from './serverInfoDTO'; import { SourceDTO } from './sourceDTO'; import { StatementsDTO } from './statementsDTO'; import { StorageInfoDTO } from './storageInfoDTO'; -import { Timestamp } from './timestamp'; import { TransactionBodyDTO } from './transactionBodyDTO'; import { TransactionDTO } from './transactionDTO'; import { TransactionHashes } from './transactionHashes'; @@ -307,7 +288,6 @@ import { TransactionTypeEnum } from './transactionTypeEnum'; import { TransferTransactionBodyDTO } from './transferTransactionBodyDTO'; import { TransferTransactionDTO } from './transferTransactionDTO'; import { UnresolvedMosaic } from './unresolvedMosaic'; -import { UnresolvedMosaicId } from './unresolvedMosaicId'; import { VerifiableEntityDTO } from './verifiableEntityDTO'; /* tslint:disable:no-unused-variable */ @@ -369,7 +349,6 @@ let typeMap: {[index: string]: any} = { "AggregateCompleteTransactionDTO": AggregateCompleteTransactionDTO, "AggregateTransactionBodyDTO": AggregateTransactionBodyDTO, "AliasDTO": AliasDTO, - "Amount": Amount, "AnnounceTransactionInfoDTO": AnnounceTransactionInfoDTO, "ArtifactExpiryReceiptDTO": ArtifactExpiryReceiptDTO, "ArtifactExpiryReceiptDTOAllOf": ArtifactExpiryReceiptDTOAllOf, @@ -379,7 +358,6 @@ let typeMap: {[index: string]: any} = { "BalanceTransferReceiptDTOAllOf": BalanceTransferReceiptDTOAllOf, "BlockDTO": BlockDTO, "BlockDTOAllOf": BlockDTOAllOf, - "BlockDuration": BlockDuration, "BlockInfoDTO": BlockInfoDTO, "BlockMetaDTO": BlockMetaDTO, "ChainScoreDTO": ChainScoreDTO, @@ -388,7 +366,6 @@ let typeMap: {[index: string]: any} = { "Cosignature": Cosignature, "CosignatureDTO": CosignatureDTO, "CosignatureDTOAllOf": CosignatureDTOAllOf, - "Difficulty": Difficulty, "EmbeddedAccountAddressRestrictionTransactionDTO": EmbeddedAccountAddressRestrictionTransactionDTO, "EmbeddedAccountLinkTransactionDTO": EmbeddedAccountLinkTransactionDTO, "EmbeddedAccountMosaicRestrictionTransactionDTO": EmbeddedAccountMosaicRestrictionTransactionDTO, @@ -413,9 +390,7 @@ let typeMap: {[index: string]: any} = { "GlobalMosaicRestrictionTransactionDTO": GlobalMosaicRestrictionTransactionDTO, "HashLockTransactionBodyDTO": HashLockTransactionBodyDTO, "HashLockTransactionDTO": HashLockTransactionDTO, - "Height": Height, "HeightInfoDTO": HeightInfoDTO, - "Importance": Importance, "InflationReceiptDTO": InflationReceiptDTO, "InflationReceiptDTOAllOf": InflationReceiptDTOAllOf, "MerklePathItem": MerklePathItem, @@ -428,7 +403,6 @@ let typeMap: {[index: string]: any} = { "MosaicDTO": MosaicDTO, "MosaicDefinitionTransactionBodyDTO": MosaicDefinitionTransactionBodyDTO, "MosaicDefinitionTransactionDTO": MosaicDefinitionTransactionDTO, - "MosaicId": MosaicId, "MosaicIds": MosaicIds, "MosaicInfoDTO": MosaicInfoDTO, "MosaicNamesDTO": MosaicNamesDTO, @@ -442,7 +416,6 @@ let typeMap: {[index: string]: any} = { "MultisigAccountModificationTransactionDTO": MultisigAccountModificationTransactionDTO, "MultisigDTO": MultisigDTO, "NamespaceDTO": NamespaceDTO, - "NamespaceId": NamespaceId, "NamespaceIds": NamespaceIds, "NamespaceInfoDTO": NamespaceInfoDTO, "NamespaceMetaDTO": NamespaceMetaDTO, @@ -455,7 +428,6 @@ let typeMap: {[index: string]: any} = { "ReceiptDTO": ReceiptDTO, "ResolutionEntryDTO": ResolutionEntryDTO, "ResolutionStatementDTO": ResolutionStatementDTO, - "Score": Score, "SecretLockTransactionBodyDTO": SecretLockTransactionBodyDTO, "SecretLockTransactionDTO": SecretLockTransactionDTO, "SecretProofTransactionBodyDTO": SecretProofTransactionBodyDTO, @@ -465,7 +437,6 @@ let typeMap: {[index: string]: any} = { "SourceDTO": SourceDTO, "StatementsDTO": StatementsDTO, "StorageInfoDTO": StorageInfoDTO, - "Timestamp": Timestamp, "TransactionBodyDTO": TransactionBodyDTO, "TransactionDTO": TransactionDTO, "TransactionHashes": TransactionHashes, @@ -478,7 +449,6 @@ let typeMap: {[index: string]: any} = { "TransferTransactionBodyDTO": TransferTransactionBodyDTO, "TransferTransactionDTO": TransferTransactionDTO, "UnresolvedMosaic": UnresolvedMosaic, - "UnresolvedMosaicId": UnresolvedMosaicId, "VerifiableEntityDTO": VerifiableEntityDTO, } diff --git a/src/infrastructure/model/modifyMultisigAccountTransactionBodyDTO.ts b/src/infrastructure/model/modifyMultisigAccountTransactionBodyDTO.ts deleted file mode 100644 index d5ff699fe8..0000000000 --- a/src/infrastructure/model/modifyMultisigAccountTransactionBodyDTO.ts +++ /dev/null @@ -1,67 +0,0 @@ -/* - * Copyright 2019 NEM - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -/** - * Catapult REST Endpoints - * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) - * - * The version of the OpenAPI document: 0.7.17 - * - * - * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). - * https://openapi-generator.tech - * Do not edit the class manually. - */ - -import { CosignatoryModificationDTO } from './cosignatoryModificationDTO'; - -export class ModifyMultisigAccountTransactionBodyDTO { - /** - * Number of signatures needed to remove a cosignatory. If we are modifying an existing multisig account, this indicates the relative change of the minimum cosignatories. - */ - 'minRemovalDelta': number; - /** - * Number of signatures needed to approve a transaction. If we are modifying an existing multisig account, this indicates the relative change of the minimum cosignatories. - */ - 'minApprovalDelta': number; - /** - * Array of cosignatory accounts to add or delete. - */ - 'modifications': Array; - - static discriminator: string | undefined = undefined; - - static attributeTypeMap: Array<{name: string, baseName: string, type: string}> = [ - { - "name": "minRemovalDelta", - "baseName": "minRemovalDelta", - "type": "number" - }, - { - "name": "minApprovalDelta", - "baseName": "minApprovalDelta", - "type": "number" - }, - { - "name": "modifications", - "baseName": "modifications", - "type": "Array" - } ]; - - static getAttributeTypeMap() { - return ModifyMultisigAccountTransactionBodyDTO.attributeTypeMap; - } -} - diff --git a/src/infrastructure/model/modifyMultisigAccountTransactionDTO.ts b/src/infrastructure/model/modifyMultisigAccountTransactionDTO.ts deleted file mode 100644 index d993f92736..0000000000 --- a/src/infrastructure/model/modifyMultisigAccountTransactionDTO.ts +++ /dev/null @@ -1,112 +0,0 @@ -/* - * Copyright 2019 NEM - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -/** - * Catapult REST Endpoints - * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) - * - * The version of the OpenAPI document: 0.7.17 - * - * - * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). - * https://openapi-generator.tech - * Do not edit the class manually. - */ - -import { CosignatoryModificationDTO } from './cosignatoryModificationDTO'; -import { EntityTypeEnum } from './entityTypeEnum'; -import { ModifyMultisigAccountTransactionBodyDTO } from './modifyMultisigAccountTransactionBodyDTO'; -import { TransactionDTO } from './transactionDTO'; - -/** -* Transaction to create or modify a multisig account. -*/ -export class ModifyMultisigAccountTransactionDTO { - 'signature': string; - 'signer': string; - /** - * Entity version. The higher byte represents the network identifier: * 0x68 (MAIN_NET) - Public main network. * 0x98 (TEST_NET) - Public test network. * 0x60 (MIJIN) - Private network. * 0x90 (MIJIN_TEST) - Private test network. - */ - 'version': number; - 'type': EntityTypeEnum; - 'maxFee': Array; - 'deadline': Array; - /** - * Number of signatures needed to remove a cosignatory. If we are modifying an existing multisig account, this indicates the relative change of the minimum cosignatories. - */ - 'minRemovalDelta': number; - /** - * Number of signatures needed to approve a transaction. If we are modifying an existing multisig account, this indicates the relative change of the minimum cosignatories. - */ - 'minApprovalDelta': number; - /** - * Array of cosignatory accounts to add or delete. - */ - 'modifications': Array; - - static discriminator: string | undefined = undefined; - - static attributeTypeMap: Array<{name: string, baseName: string, type: string}> = [ - { - "name": "signature", - "baseName": "signature", - "type": "string" - }, - { - "name": "signer", - "baseName": "signer", - "type": "string" - }, - { - "name": "version", - "baseName": "version", - "type": "number" - }, - { - "name": "type", - "baseName": "type", - "type": "EntityTypeEnum" - }, - { - "name": "maxFee", - "baseName": "maxFee", - "type": "Array" - }, - { - "name": "deadline", - "baseName": "deadline", - "type": "Array" - }, - { - "name": "minRemovalDelta", - "baseName": "minRemovalDelta", - "type": "number" - }, - { - "name": "minApprovalDelta", - "baseName": "minApprovalDelta", - "type": "number" - }, - { - "name": "modifications", - "baseName": "modifications", - "type": "Array" - } ]; - - static getAttributeTypeMap() { - return ModifyMultisigAccountTransactionDTO.attributeTypeMap; - } -} - diff --git a/src/infrastructure/model/mosaic.ts b/src/infrastructure/model/mosaic.ts index ca6a7a83fb..8effc9317f 100644 --- a/src/infrastructure/model/mosaic.ts +++ b/src/infrastructure/model/mosaic.ts @@ -27,8 +27,14 @@ export class Mosaic { - 'id': Array; - 'amount': Array; + /** + * Mosaic identifier. + */ + 'id': string; + /** + * Absolute amount. An amount of 123456789 (absolute) for a mosaic with divisibility 6 means 123.456789 (relative). + */ + 'amount': string; static discriminator: string | undefined = undefined; @@ -36,12 +42,12 @@ export class Mosaic { { "name": "id", "baseName": "id", - "type": "Array" + "type": "string" }, { "name": "amount", "baseName": "amount", - "type": "Array" + "type": "string" } ]; static getAttributeTypeMap() { diff --git a/src/infrastructure/model/mosaicAliasTransactionBodyDTO.ts b/src/infrastructure/model/mosaicAliasTransactionBodyDTO.ts index ae7aacf577..17cc9aef1c 100644 --- a/src/infrastructure/model/mosaicAliasTransactionBodyDTO.ts +++ b/src/infrastructure/model/mosaicAliasTransactionBodyDTO.ts @@ -29,8 +29,14 @@ import { AliasActionEnum } from './aliasActionEnum'; export class MosaicAliasTransactionBodyDTO { 'aliasAction': AliasActionEnum; - 'namespaceId': Array; - 'mosaicId': Array; + /** + * Namespace identifier. + */ + 'namespaceId': string; + /** + * Mosaic identifier. + */ + 'mosaicId': string; static discriminator: string | undefined = undefined; @@ -43,12 +49,12 @@ export class MosaicAliasTransactionBodyDTO { { "name": "namespaceId", "baseName": "namespaceId", - "type": "Array" + "type": "string" }, { "name": "mosaicId", "baseName": "mosaicId", - "type": "Array" + "type": "string" } ]; static getAttributeTypeMap() { diff --git a/src/infrastructure/model/mosaicAliasTransactionDTO.ts b/src/infrastructure/model/mosaicAliasTransactionDTO.ts index c70c7f1e8b..42edd7b248 100644 --- a/src/infrastructure/model/mosaicAliasTransactionDTO.ts +++ b/src/infrastructure/model/mosaicAliasTransactionDTO.ts @@ -33,6 +33,9 @@ import { TransactionDTO } from './transactionDTO'; * Transaction to link a namespace to a mosaic. */ export class MosaicAliasTransactionDTO { + /** + * Entity\'s signature generated by the signer. + */ 'signature': string; 'signerPublicKey': string; /** @@ -40,11 +43,23 @@ export class MosaicAliasTransactionDTO { */ 'version': number; 'type': number; - 'maxFee': Array; - 'deadline': Array; + /** + * Absolute amount. An amount of 123456789 (absolute) for a mosaic with divisibility 6 means 123.456789 (relative). + */ + 'maxFee': string; + /** + * Duration expressed in number of blocks. + */ + 'deadline': string; 'aliasAction': AliasActionEnum; - 'namespaceId': Array; - 'mosaicId': Array; + /** + * Namespace identifier. + */ + 'namespaceId': string; + /** + * Mosaic identifier. + */ + 'mosaicId': string; static discriminator: string | undefined = undefined; @@ -72,12 +87,12 @@ export class MosaicAliasTransactionDTO { { "name": "maxFee", "baseName": "maxFee", - "type": "Array" + "type": "string" }, { "name": "deadline", "baseName": "deadline", - "type": "Array" + "type": "string" }, { "name": "aliasAction", @@ -87,12 +102,12 @@ export class MosaicAliasTransactionDTO { { "name": "namespaceId", "baseName": "namespaceId", - "type": "Array" + "type": "string" }, { "name": "mosaicId", "baseName": "mosaicId", - "type": "Array" + "type": "string" } ]; static getAttributeTypeMap() { diff --git a/src/infrastructure/model/mosaicDTO.ts b/src/infrastructure/model/mosaicDTO.ts index 43084af7f5..76a4a443bd 100644 --- a/src/infrastructure/model/mosaicDTO.ts +++ b/src/infrastructure/model/mosaicDTO.ts @@ -28,9 +28,18 @@ import { MosaicPropertiesDTO } from './mosaicPropertiesDTO'; export class MosaicDTO { - 'id': Array; - 'supply': Array; - 'startHeight': Array; + /** + * Mosaic identifier. + */ + 'id': string; + /** + * Absolute amount. An amount of 123456789 (absolute) for a mosaic with divisibility 6 means 123.456789 (relative). + */ + 'supply': string; + /** + * Height of the blockchain. + */ + 'startHeight': string; 'ownerPublicKey': string; 'ownerAddress': string; /** @@ -45,17 +54,17 @@ export class MosaicDTO { { "name": "id", "baseName": "id", - "type": "Array" + "type": "string" }, { "name": "supply", "baseName": "supply", - "type": "Array" + "type": "string" }, { "name": "startHeight", "baseName": "startHeight", - "type": "Array" + "type": "string" }, { "name": "ownerPublicKey", diff --git a/src/infrastructure/model/mosaicDefinitionDTO.ts b/src/infrastructure/model/mosaicDefinitionDTO.ts deleted file mode 100644 index 15f875c91b..0000000000 --- a/src/infrastructure/model/mosaicDefinitionDTO.ts +++ /dev/null @@ -1,79 +0,0 @@ -/* - * Copyright 2019 NEM - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -/** - * Catapult REST Endpoints - * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) - * - * The version of the OpenAPI document: 0.7.17 - * - * - * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). - * https://openapi-generator.tech - * Do not edit the class manually. - */ - -import { MosaicPropertyDTO } from './mosaicPropertyDTO'; - -export class MosaicDefinitionDTO { - 'mosaicId': Array; - 'supply': Array; - 'height': Array; - 'owner': string; - /** - * Number of definitions for the same mosaic. - */ - 'revision': number; - 'properties': Array; - - static discriminator: string | undefined = undefined; - - static attributeTypeMap: Array<{name: string, baseName: string, type: string}> = [ - { - "name": "mosaicId", - "baseName": "mosaicId", - "type": "Array" - }, - { - "name": "supply", - "baseName": "supply", - "type": "Array" - }, - { - "name": "height", - "baseName": "height", - "type": "Array" - }, - { - "name": "owner", - "baseName": "owner", - "type": "string" - }, - { - "name": "revision", - "baseName": "revision", - "type": "number" - }, - { - "name": "properties", - "baseName": "properties", - "type": "Array" - } ]; - - static getAttributeTypeMap() { - return MosaicDefinitionDTO.attributeTypeMap; - } -} - diff --git a/src/infrastructure/model/mosaicDefinitionTransactionBodyDTO.ts b/src/infrastructure/model/mosaicDefinitionTransactionBodyDTO.ts index 24d54d75bf..632ccd4416 100644 --- a/src/infrastructure/model/mosaicDefinitionTransactionBodyDTO.ts +++ b/src/infrastructure/model/mosaicDefinitionTransactionBodyDTO.ts @@ -31,7 +31,10 @@ export class MosaicDefinitionTransactionBodyDTO { * Random nonce used to generate the mosaic id. */ 'nonce': number; - 'id': Array; + /** + * Mosaic identifier. + */ + 'id': string; /** * - 0x00 (none) - No flags present. - 0x01 (supplyMutable) - Mosaic supports supply changes even when mosaic owner owns partial supply. - 0x02 (transferable) - Mosaic supports transfers between arbitrary accounts. When not set, mosaic can only be transferred to and from mosaic owner. - 0x04 (restrictable) - Mosaic supports custom restrictions configured by mosaic owner. */ @@ -40,7 +43,10 @@ export class MosaicDefinitionTransactionBodyDTO { * Determines up to what decimal place the mosaic can be divided. Divisibility of 3 means that a mosaic can be divided into smallest parts of 0.001 mosaics. The divisibility must be in the range of 0 and 6. */ 'divisibility'?: number; - 'duration'?: Array; + /** + * Duration expressed in number of blocks. + */ + 'duration'?: string; static discriminator: string | undefined = undefined; @@ -53,7 +59,7 @@ export class MosaicDefinitionTransactionBodyDTO { { "name": "id", "baseName": "id", - "type": "Array" + "type": "string" }, { "name": "flags", @@ -68,7 +74,7 @@ export class MosaicDefinitionTransactionBodyDTO { { "name": "duration", "baseName": "duration", - "type": "Array" + "type": "string" } ]; static getAttributeTypeMap() { diff --git a/src/infrastructure/model/mosaicDefinitionTransactionDTO.ts b/src/infrastructure/model/mosaicDefinitionTransactionDTO.ts index c47dd20ec2..6a55c18c05 100644 --- a/src/infrastructure/model/mosaicDefinitionTransactionDTO.ts +++ b/src/infrastructure/model/mosaicDefinitionTransactionDTO.ts @@ -32,6 +32,9 @@ import { TransactionDTO } from './transactionDTO'; * Transaction to create a new mosaic. */ export class MosaicDefinitionTransactionDTO { + /** + * Entity\'s signature generated by the signer. + */ 'signature': string; 'signerPublicKey': string; /** @@ -39,13 +42,22 @@ export class MosaicDefinitionTransactionDTO { */ 'version': number; 'type': number; - 'maxFee': Array; - 'deadline': Array; + /** + * Absolute amount. An amount of 123456789 (absolute) for a mosaic with divisibility 6 means 123.456789 (relative). + */ + 'maxFee': string; + /** + * Duration expressed in number of blocks. + */ + 'deadline': string; /** * Random nonce used to generate the mosaic id. */ 'nonce': number; - 'id': Array; + /** + * Mosaic identifier. + */ + 'id': string; /** * - 0x00 (none) - No flags present. - 0x01 (supplyMutable) - Mosaic supports supply changes even when mosaic owner owns partial supply. - 0x02 (transferable) - Mosaic supports transfers between arbitrary accounts. When not set, mosaic can only be transferred to and from mosaic owner. - 0x04 (restrictable) - Mosaic supports custom restrictions configured by mosaic owner. */ @@ -54,7 +66,10 @@ export class MosaicDefinitionTransactionDTO { * Determines up to what decimal place the mosaic can be divided. Divisibility of 3 means that a mosaic can be divided into smallest parts of 0.001 mosaics. The divisibility must be in the range of 0 and 6. */ 'divisibility'?: number; - 'duration'?: Array; + /** + * Duration expressed in number of blocks. + */ + 'duration'?: string; static discriminator: string | undefined = undefined; @@ -82,12 +97,12 @@ export class MosaicDefinitionTransactionDTO { { "name": "maxFee", "baseName": "maxFee", - "type": "Array" + "type": "string" }, { "name": "deadline", "baseName": "deadline", - "type": "Array" + "type": "string" }, { "name": "nonce", @@ -97,7 +112,7 @@ export class MosaicDefinitionTransactionDTO { { "name": "id", "baseName": "id", - "type": "Array" + "type": "string" }, { "name": "flags", @@ -112,7 +127,7 @@ export class MosaicDefinitionTransactionDTO { { "name": "duration", "baseName": "duration", - "type": "Array" + "type": "string" } ]; static getAttributeTypeMap() { diff --git a/src/infrastructure/model/mosaicFlagsEnum.ts b/src/infrastructure/model/mosaicFlagsEnum.ts deleted file mode 100644 index d0ed00ecc9..0000000000 --- a/src/infrastructure/model/mosaicFlagsEnum.ts +++ /dev/null @@ -1,37 +0,0 @@ -/* - * Copyright 2019 NEM - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -/** - * Catapult REST Endpoints - * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) - * - * The version of the OpenAPI document: 0.7.18 - * - * - * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). - * https://openapi-generator.tech - * Do not edit the class manually. - */ - - -/** -* Mosaic Flags: * 0x00 (none) - No flags present. * 0x01 (supplyMutable) - Mosaic supports supply changes even when mosaic owner owns partial supply. * 0x02 (transferable) - Mosaic supports transfers between arbitrary accounts. When not set, mosaic can only be transferred to and from mosaic owner. * 0x04 (restrictable) - Mosaic supports custom restrictions configured by mosaic owner. -*/ -export enum MosaicFlagsEnum { - NUMBER_0 = 0, - NUMBER_1 = 1, - NUMBER_2 = 2, - NUMBER_4 = 4 -} diff --git a/src/infrastructure/model/mosaicId.ts b/src/infrastructure/model/mosaicId.ts deleted file mode 100644 index 3dc1aeaf4d..0000000000 --- a/src/infrastructure/model/mosaicId.ts +++ /dev/null @@ -1,34 +0,0 @@ -/* - * Copyright 2019 NEM - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -/** - * Catapult REST Endpoints - * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) - * - * The version of the OpenAPI document: 0.7.18 - * - * - * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). - * https://openapi-generator.tech - * Do not edit the class manually. - */ - - -export class MosaicId extends Array { - - static discriminator: string | undefined = undefined; - -} - diff --git a/src/infrastructure/model/mosaicMetaDTO.ts b/src/infrastructure/model/mosaicMetaDTO.ts deleted file mode 100644 index 22af9d42ba..0000000000 --- a/src/infrastructure/model/mosaicMetaDTO.ts +++ /dev/null @@ -1,45 +0,0 @@ -/* - * Copyright 2019 NEM - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -/** - * Catapult REST Endpoints - * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) - * - * The version of the OpenAPI document: 0.7.18 - * - * - * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). - * https://openapi-generator.tech - * Do not edit the class manually. - */ - - -export class MosaicMetaDTO { - 'id': string; - - static discriminator: string | undefined = undefined; - - static attributeTypeMap: Array<{name: string, baseName: string, type: string}> = [ - { - "name": "id", - "baseName": "id", - "type": "string" - } ]; - - static getAttributeTypeMap() { - return MosaicMetaDTO.attributeTypeMap; - } -} - diff --git a/src/infrastructure/model/mosaicNamesDTO.ts b/src/infrastructure/model/mosaicNamesDTO.ts index ad61d50362..37c482345a 100644 --- a/src/infrastructure/model/mosaicNamesDTO.ts +++ b/src/infrastructure/model/mosaicNamesDTO.ts @@ -27,7 +27,10 @@ export class MosaicNamesDTO { - 'mosaicId': Array; + /** + * Mosaic identifier. + */ + 'mosaicId': string; /** * Mosaic linked namespace names. */ @@ -39,7 +42,7 @@ export class MosaicNamesDTO { { "name": "mosaicId", "baseName": "mosaicId", - "type": "Array" + "type": "string" }, { "name": "names", diff --git a/src/infrastructure/model/mosaicPropertiesDTO.ts b/src/infrastructure/model/mosaicPropertiesDTO.ts index 0f914d0f72..dd0b28d201 100644 --- a/src/infrastructure/model/mosaicPropertiesDTO.ts +++ b/src/infrastructure/model/mosaicPropertiesDTO.ts @@ -35,7 +35,10 @@ export class MosaicPropertiesDTO { * Determines up to what decimal place the mosaic can be divided. Divisibility of 3 means that a mosaic can be divided into smallest parts of 0.001 mosaics. The divisibility must be in the range of 0 and 6. */ 'divisibility'?: number; - 'duration'?: Array; + /** + * Duration expressed in number of blocks. + */ + 'duration'?: string; static discriminator: string | undefined = undefined; @@ -53,7 +56,7 @@ export class MosaicPropertiesDTO { { "name": "duration", "baseName": "duration", - "type": "Array" + "type": "string" } ]; static getAttributeTypeMap() { diff --git a/src/infrastructure/model/mosaicPropertyDTO.ts b/src/infrastructure/model/mosaicPropertyDTO.ts deleted file mode 100644 index e4cdab62ad..0000000000 --- a/src/infrastructure/model/mosaicPropertyDTO.ts +++ /dev/null @@ -1,52 +0,0 @@ -/* - * Copyright 2019 NEM - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -/** - * Catapult REST Endpoints - * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) - * - * The version of the OpenAPI document: 0.7.17 - * - * - * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). - * https://openapi-generator.tech - * Do not edit the class manually. - */ - -import { MosaicPropertyIdEnum } from './mosaicPropertyIdEnum'; - -export class MosaicPropertyDTO { - 'id'?: MosaicPropertyIdEnum; - 'value'?: Array; - - static discriminator: string | undefined = undefined; - - static attributeTypeMap: Array<{name: string, baseName: string, type: string}> = [ - { - "name": "id", - "baseName": "id", - "type": "MosaicPropertyIdEnum" - }, - { - "name": "value", - "baseName": "value", - "type": "Array" - } ]; - - static getAttributeTypeMap() { - return MosaicPropertyDTO.attributeTypeMap; - } -} - diff --git a/src/infrastructure/model/mosaicPropertyIdEnum.ts b/src/infrastructure/model/mosaicPropertyIdEnum.ts deleted file mode 100644 index 3ee5630832..0000000000 --- a/src/infrastructure/model/mosaicPropertyIdEnum.ts +++ /dev/null @@ -1,36 +0,0 @@ -/* - * Copyright 2019 NEM - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -/** - * Catapult REST Endpoints - * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) - * - * The version of the OpenAPI document: 0.7.17 - * - * - * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). - * https://openapi-generator.tech - * Do not edit the class manually. - */ - - -/** -* Identifier of the mosaic property: * 0 - MosaicFlags * 1 - Divisibility * 2 - Duration -*/ -export enum MosaicPropertyIdEnum { - NUMBER_0 = 0, - NUMBER_1 = 1, - NUMBER_2 = 2 -} diff --git a/src/infrastructure/model/mosaicSupplyChangeDirectionEnum.ts b/src/infrastructure/model/mosaicSupplyChangeDirectionEnum.ts deleted file mode 100644 index b00e1b9ddc..0000000000 --- a/src/infrastructure/model/mosaicSupplyChangeDirectionEnum.ts +++ /dev/null @@ -1,35 +0,0 @@ -/* - * Copyright 2019 NEM - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -/** - * Catapult REST Endpoints - * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) - * - * The version of the OpenAPI document: 0.7.17 - * - * - * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). - * https://openapi-generator.tech - * Do not edit the class manually. - */ - - -/** -* Direction of mosaic supply change: * 0 - Decrease. * 1 - Increase. -*/ -export enum MosaicSupplyChangeDirectionEnum { - NUMBER_0 = 0, - NUMBER_1 = 1 -} diff --git a/src/infrastructure/model/mosaicSupplyChangeTransactionBodyDTO.ts b/src/infrastructure/model/mosaicSupplyChangeTransactionBodyDTO.ts index b08e1eccaa..3ae9aa3427 100644 --- a/src/infrastructure/model/mosaicSupplyChangeTransactionBodyDTO.ts +++ b/src/infrastructure/model/mosaicSupplyChangeTransactionBodyDTO.ts @@ -28,9 +28,15 @@ import { MosaicSupplyChangeActionEnum } from './mosaicSupplyChangeActionEnum'; export class MosaicSupplyChangeTransactionBodyDTO { - 'mosaicId': Array; + /** + * Mosaic identifier. If the most significant bit of byte 0 is set, a namespaceId (alias) is used instead of the real mosaic identifier. + */ + 'mosaicId': string; 'action': MosaicSupplyChangeActionEnum; - 'delta': Array; + /** + * Absolute amount. An amount of 123456789 (absolute) for a mosaic with divisibility 6 means 123.456789 (relative). + */ + 'delta': string; static discriminator: string | undefined = undefined; @@ -38,7 +44,7 @@ export class MosaicSupplyChangeTransactionBodyDTO { { "name": "mosaicId", "baseName": "mosaicId", - "type": "Array" + "type": "string" }, { "name": "action", @@ -48,7 +54,7 @@ export class MosaicSupplyChangeTransactionBodyDTO { { "name": "delta", "baseName": "delta", - "type": "Array" + "type": "string" } ]; static getAttributeTypeMap() { diff --git a/src/infrastructure/model/mosaicSupplyChangeTransactionDTO.ts b/src/infrastructure/model/mosaicSupplyChangeTransactionDTO.ts index 1153b87dda..1e15d2146a 100644 --- a/src/infrastructure/model/mosaicSupplyChangeTransactionDTO.ts +++ b/src/infrastructure/model/mosaicSupplyChangeTransactionDTO.ts @@ -33,6 +33,9 @@ import { TransactionDTO } from './transactionDTO'; * Transaction to increase or decrease the supply of a mosaic. */ export class MosaicSupplyChangeTransactionDTO { + /** + * Entity\'s signature generated by the signer. + */ 'signature': string; 'signerPublicKey': string; /** @@ -40,11 +43,23 @@ export class MosaicSupplyChangeTransactionDTO { */ 'version': number; 'type': number; - 'maxFee': Array; - 'deadline': Array; - 'mosaicId': Array; + /** + * Absolute amount. An amount of 123456789 (absolute) for a mosaic with divisibility 6 means 123.456789 (relative). + */ + 'maxFee': string; + /** + * Duration expressed in number of blocks. + */ + 'deadline': string; + /** + * Mosaic identifier. If the most significant bit of byte 0 is set, a namespaceId (alias) is used instead of the real mosaic identifier. + */ + 'mosaicId': string; 'action': MosaicSupplyChangeActionEnum; - 'delta': Array; + /** + * Absolute amount. An amount of 123456789 (absolute) for a mosaic with divisibility 6 means 123.456789 (relative). + */ + 'delta': string; static discriminator: string | undefined = undefined; @@ -72,17 +87,17 @@ export class MosaicSupplyChangeTransactionDTO { { "name": "maxFee", "baseName": "maxFee", - "type": "Array" + "type": "string" }, { "name": "deadline", "baseName": "deadline", - "type": "Array" + "type": "string" }, { "name": "mosaicId", "baseName": "mosaicId", - "type": "Array" + "type": "string" }, { "name": "action", @@ -92,7 +107,7 @@ export class MosaicSupplyChangeTransactionDTO { { "name": "delta", "baseName": "delta", - "type": "Array" + "type": "string" } ]; static getAttributeTypeMap() { diff --git a/src/infrastructure/model/mosaicsNamesDTO.ts b/src/infrastructure/model/mosaicsNamesDTO.ts index 046c1b14a6..ce9a87db83 100644 --- a/src/infrastructure/model/mosaicsNamesDTO.ts +++ b/src/infrastructure/model/mosaicsNamesDTO.ts @@ -31,13 +31,13 @@ export class MosaicsNamesDTO { /** * Array of mosaic names. */ - 'accountNames': Array; + 'mosaicNames': Array; static discriminator: string | undefined = undefined; static attributeTypeMap: Array<{name: string, baseName: string, type: string}> = [ { - "name": "accountNames", + "name": "mosaicNames", "baseName": "accountNames", "type": "Array" } ]; diff --git a/src/infrastructure/model/multisigAccountModificationTransactionDTO.ts b/src/infrastructure/model/multisigAccountModificationTransactionDTO.ts index 15b582cedc..9387c0be24 100644 --- a/src/infrastructure/model/multisigAccountModificationTransactionDTO.ts +++ b/src/infrastructure/model/multisigAccountModificationTransactionDTO.ts @@ -33,6 +33,9 @@ import { TransactionDTO } from './transactionDTO'; * Transaction to create or modify a multisig account. */ export class MultisigAccountModificationTransactionDTO { + /** + * Entity\'s signature generated by the signer. + */ 'signature': string; 'signerPublicKey': string; /** @@ -40,8 +43,14 @@ export class MultisigAccountModificationTransactionDTO { */ 'version': number; 'type': number; - 'maxFee': Array; - 'deadline': Array; + /** + * Absolute amount. An amount of 123456789 (absolute) for a mosaic with divisibility 6 means 123.456789 (relative). + */ + 'maxFee': string; + /** + * Duration expressed in number of blocks. + */ + 'deadline': string; /** * Number of signatures needed to remove a cosignatory. If we are modifying an existing multisig account, this indicates the relative change of the minimum cosignatories. */ @@ -81,12 +90,12 @@ export class MultisigAccountModificationTransactionDTO { { "name": "maxFee", "baseName": "maxFee", - "type": "Array" + "type": "string" }, { "name": "deadline", "baseName": "deadline", - "type": "Array" + "type": "string" }, { "name": "minRemovalDelta", diff --git a/src/infrastructure/model/multisigModificationTypeEnum.ts b/src/infrastructure/model/multisigModificationTypeEnum.ts deleted file mode 100644 index 1b32f9e4c7..0000000000 --- a/src/infrastructure/model/multisigModificationTypeEnum.ts +++ /dev/null @@ -1,35 +0,0 @@ -/* - * Copyright 2019 NEM - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -/** - * Catapult REST Endpoints - * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) - * - * The version of the OpenAPI document: 0.7.17 - * - * - * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). - * https://openapi-generator.tech - * Do not edit the class manually. - */ - - -/** -* Type of modification: * 0 - Add cosignatory. * 1 - Remove cosignatory. -*/ -export enum MultisigModificationTypeEnum { - NUMBER_0 = 0, - NUMBER_1 = 1 -} diff --git a/src/infrastructure/model/namespaceDTO.ts b/src/infrastructure/model/namespaceDTO.ts index 29039daa20..b4c950b164 100644 --- a/src/infrastructure/model/namespaceDTO.ts +++ b/src/infrastructure/model/namespaceDTO.ts @@ -34,18 +34,36 @@ export class NamespaceDTO { * Level of the namespace. */ 'depth': number; - 'level0': Array; - 'level1'?: Array; - 'level2'?: Array; + /** + * Namespace identifier. + */ + 'level0': string; + /** + * Namespace identifier. + */ + 'level1'?: string; + /** + * Namespace identifier. + */ + 'level2'?: string; 'alias': AliasDTO; - 'parentId': Array; + /** + * Namespace identifier. + */ + 'parentId': string; 'ownerPublicKey': string; /** * Decoded address. */ 'ownerAddress': string; - 'startHeight': Array; - 'endHeight': Array; + /** + * Height of the blockchain. + */ + 'startHeight': string; + /** + * Height of the blockchain. + */ + 'endHeight': string; static discriminator: string | undefined = undefined; @@ -63,17 +81,17 @@ export class NamespaceDTO { { "name": "level0", "baseName": "level0", - "type": "Array" + "type": "string" }, { "name": "level1", "baseName": "level1", - "type": "Array" + "type": "string" }, { "name": "level2", "baseName": "level2", - "type": "Array" + "type": "string" }, { "name": "alias", @@ -83,7 +101,7 @@ export class NamespaceDTO { { "name": "parentId", "baseName": "parentId", - "type": "Array" + "type": "string" }, { "name": "ownerPublicKey", @@ -98,12 +116,12 @@ export class NamespaceDTO { { "name": "startHeight", "baseName": "startHeight", - "type": "Array" + "type": "string" }, { "name": "endHeight", "baseName": "endHeight", - "type": "Array" + "type": "string" } ]; static getAttributeTypeMap() { diff --git a/src/infrastructure/model/namespaceId.ts b/src/infrastructure/model/namespaceId.ts deleted file mode 100644 index dea7b3c938..0000000000 --- a/src/infrastructure/model/namespaceId.ts +++ /dev/null @@ -1,34 +0,0 @@ -/* - * Copyright 2019 NEM - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -/** - * Catapult REST Endpoints - * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) - * - * The version of the OpenAPI document: 0.7.18 - * - * - * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). - * https://openapi-generator.tech - * Do not edit the class manually. - */ - - -export class NamespaceId extends Array { - - static discriminator: string | undefined = undefined; - -} - diff --git a/src/infrastructure/model/namespaceNameDTO.ts b/src/infrastructure/model/namespaceNameDTO.ts index dab03546e4..5255164455 100644 --- a/src/infrastructure/model/namespaceNameDTO.ts +++ b/src/infrastructure/model/namespaceNameDTO.ts @@ -27,8 +27,14 @@ export class NamespaceNameDTO { - 'parentId'?: Array; - 'namespaceId': Array; + /** + * Namespace identifier. + */ + 'parentId'?: string; + /** + * Namespace identifier. + */ + 'namespaceId': string; /** * Namespace name. */ @@ -40,12 +46,12 @@ export class NamespaceNameDTO { { "name": "parentId", "baseName": "parentId", - "type": "Array" + "type": "string" }, { "name": "namespaceId", "baseName": "namespaceId", - "type": "Array" + "type": "string" }, { "name": "name", diff --git a/src/infrastructure/model/namespaceRegistrationTransactionBodyDTO.ts b/src/infrastructure/model/namespaceRegistrationTransactionBodyDTO.ts index de50865b73..a3c21552a0 100644 --- a/src/infrastructure/model/namespaceRegistrationTransactionBodyDTO.ts +++ b/src/infrastructure/model/namespaceRegistrationTransactionBodyDTO.ts @@ -29,9 +29,18 @@ import { NamespaceRegistrationTypeEnum } from './namespaceRegistrationTypeEnum'; export class NamespaceRegistrationTransactionBodyDTO { 'registrationType': NamespaceRegistrationTypeEnum; - 'duration': Array; - 'parentId': Array; - 'id': Array; + /** + * Duration expressed in number of blocks. + */ + 'duration': string; + /** + * Namespace identifier. + */ + 'parentId': string; + /** + * Namespace identifier. + */ + 'id': string; /** * Namespace name. */ @@ -48,17 +57,17 @@ export class NamespaceRegistrationTransactionBodyDTO { { "name": "duration", "baseName": "duration", - "type": "Array" + "type": "string" }, { "name": "parentId", "baseName": "parentId", - "type": "Array" + "type": "string" }, { "name": "id", "baseName": "id", - "type": "Array" + "type": "string" }, { "name": "name", diff --git a/src/infrastructure/model/namespaceRegistrationTransactionDTO.ts b/src/infrastructure/model/namespaceRegistrationTransactionDTO.ts index 9070bb4551..16d1c746dd 100644 --- a/src/infrastructure/model/namespaceRegistrationTransactionDTO.ts +++ b/src/infrastructure/model/namespaceRegistrationTransactionDTO.ts @@ -33,6 +33,9 @@ import { TransactionDTO } from './transactionDTO'; * Transaction to create or renew a namespace. */ export class NamespaceRegistrationTransactionDTO { + /** + * Entity\'s signature generated by the signer. + */ 'signature': string; 'signerPublicKey': string; /** @@ -40,12 +43,27 @@ export class NamespaceRegistrationTransactionDTO { */ 'version': number; 'type': number; - 'maxFee': Array; - 'deadline': Array; + /** + * Absolute amount. An amount of 123456789 (absolute) for a mosaic with divisibility 6 means 123.456789 (relative). + */ + 'maxFee': string; + /** + * Duration expressed in number of blocks. + */ + 'deadline': string; 'registrationType': NamespaceRegistrationTypeEnum; - 'duration': Array; - 'parentId': Array; - 'id': Array; + /** + * Duration expressed in number of blocks. + */ + 'duration': string; + /** + * Namespace identifier. + */ + 'parentId': string; + /** + * Namespace identifier. + */ + 'id': string; /** * Namespace name. */ @@ -77,12 +95,12 @@ export class NamespaceRegistrationTransactionDTO { { "name": "maxFee", "baseName": "maxFee", - "type": "Array" + "type": "string" }, { "name": "deadline", "baseName": "deadline", - "type": "Array" + "type": "string" }, { "name": "registrationType", @@ -92,17 +110,17 @@ export class NamespaceRegistrationTransactionDTO { { "name": "duration", "baseName": "duration", - "type": "Array" + "type": "string" }, { "name": "parentId", "baseName": "parentId", - "type": "Array" + "type": "string" }, { "name": "id", "baseName": "id", - "type": "Array" + "type": "string" }, { "name": "name", diff --git a/src/infrastructure/model/namespaceTypeEnum.ts b/src/infrastructure/model/namespaceTypeEnum.ts deleted file mode 100644 index 0a3f387bac..0000000000 --- a/src/infrastructure/model/namespaceTypeEnum.ts +++ /dev/null @@ -1,35 +0,0 @@ -/* - * Copyright 2019 NEM - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -/** - * Catapult REST Endpoints - * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) - * - * The version of the OpenAPI document: 0.7.17 - * - * - * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). - * https://openapi-generator.tech - * Do not edit the class manually. - */ - - -/** -* Type of namespace: * 0 - Root namespace. * 1 - Subnamespace. -*/ -export enum NamespaceTypeEnum { - NUMBER_0 = 0, - NUMBER_1 = 1 -} diff --git a/src/infrastructure/model/registerNamespaceTransactionBodyDTO.ts b/src/infrastructure/model/registerNamespaceTransactionBodyDTO.ts deleted file mode 100644 index f9a83e6357..0000000000 --- a/src/infrastructure/model/registerNamespaceTransactionBodyDTO.ts +++ /dev/null @@ -1,73 +0,0 @@ -/* - * Copyright 2019 NEM - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -/** - * Catapult REST Endpoints - * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) - * - * The version of the OpenAPI document: 0.7.17 - * - * - * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). - * https://openapi-generator.tech - * Do not edit the class manually. - */ - -import { NamespaceTypeEnum } from './namespaceTypeEnum'; - -export class RegisterNamespaceTransactionBodyDTO { - 'namespaceType': NamespaceTypeEnum; - 'duration': Array; - 'namespaceId': Array; - /** - * Namespace name. - */ - 'name': string; - 'parentId': Array; - - static discriminator: string | undefined = undefined; - - static attributeTypeMap: Array<{name: string, baseName: string, type: string}> = [ - { - "name": "namespaceType", - "baseName": "namespaceType", - "type": "NamespaceTypeEnum" - }, - { - "name": "duration", - "baseName": "duration", - "type": "Array" - }, - { - "name": "namespaceId", - "baseName": "namespaceId", - "type": "Array" - }, - { - "name": "name", - "baseName": "name", - "type": "string" - }, - { - "name": "parentId", - "baseName": "parentId", - "type": "Array" - } ]; - - static getAttributeTypeMap() { - return RegisterNamespaceTransactionBodyDTO.attributeTypeMap; - } -} - diff --git a/src/infrastructure/model/registerNamespaceTransactionDTO.ts b/src/infrastructure/model/registerNamespaceTransactionDTO.ts deleted file mode 100644 index c964079be4..0000000000 --- a/src/infrastructure/model/registerNamespaceTransactionDTO.ts +++ /dev/null @@ -1,118 +0,0 @@ -/* - * Copyright 2019 NEM - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -/** - * Catapult REST Endpoints - * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) - * - * The version of the OpenAPI document: 0.7.17 - * - * - * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). - * https://openapi-generator.tech - * Do not edit the class manually. - */ - -import { EntityTypeEnum } from './entityTypeEnum'; -import { NamespaceTypeEnum } from './namespaceTypeEnum'; -import { RegisterNamespaceTransactionBodyDTO } from './registerNamespaceTransactionBodyDTO'; -import { TransactionDTO } from './transactionDTO'; - -/** -* Transaction to create or renew a namespace. -*/ -export class RegisterNamespaceTransactionDTO { - 'signature': string; - 'signer': string; - /** - * Entity version. The higher byte represents the network identifier: * 0x68 (MAIN_NET) - Public main network. * 0x98 (TEST_NET) - Public test network. * 0x60 (MIJIN) - Private network. * 0x90 (MIJIN_TEST) - Private test network. - */ - 'version': number; - 'type': EntityTypeEnum; - 'maxFee': Array; - 'deadline': Array; - 'namespaceType': NamespaceTypeEnum; - 'duration': Array; - 'namespaceId': Array; - /** - * Namespace name. - */ - 'name': string; - 'parentId': Array; - - static discriminator: string | undefined = undefined; - - static attributeTypeMap: Array<{name: string, baseName: string, type: string}> = [ - { - "name": "signature", - "baseName": "signature", - "type": "string" - }, - { - "name": "signer", - "baseName": "signer", - "type": "string" - }, - { - "name": "version", - "baseName": "version", - "type": "number" - }, - { - "name": "type", - "baseName": "type", - "type": "EntityTypeEnum" - }, - { - "name": "maxFee", - "baseName": "maxFee", - "type": "Array" - }, - { - "name": "deadline", - "baseName": "deadline", - "type": "Array" - }, - { - "name": "namespaceType", - "baseName": "namespaceType", - "type": "NamespaceTypeEnum" - }, - { - "name": "duration", - "baseName": "duration", - "type": "Array" - }, - { - "name": "namespaceId", - "baseName": "namespaceId", - "type": "Array" - }, - { - "name": "name", - "baseName": "name", - "type": "string" - }, - { - "name": "parentId", - "baseName": "parentId", - "type": "Array" - } ]; - - static getAttributeTypeMap() { - return RegisterNamespaceTransactionDTO.attributeTypeMap; - } -} - diff --git a/src/infrastructure/model/resolutionEntryDTO.ts b/src/infrastructure/model/resolutionEntryDTO.ts index cbd07c4340..9acb4180a1 100644 --- a/src/infrastructure/model/resolutionEntryDTO.ts +++ b/src/infrastructure/model/resolutionEntryDTO.ts @@ -42,7 +42,7 @@ export class ResolutionEntryDTO { { "name": "resolved", "baseName": "resolved", - "type": "AnyOfstringarray" + "type": "AnyOfstringstring" } ]; static getAttributeTypeMap() { diff --git a/src/infrastructure/model/accountMetaDTO.ts b/src/infrastructure/model/resolutionStatementBodyDTO.ts similarity index 60% rename from src/infrastructure/model/accountMetaDTO.ts rename to src/infrastructure/model/resolutionStatementBodyDTO.ts index f5b7b16602..4d9f6bddbf 100644 --- a/src/infrastructure/model/accountMetaDTO.ts +++ b/src/infrastructure/model/resolutionStatementBodyDTO.ts @@ -17,7 +17,7 @@ * Catapult REST Endpoints * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) * - * The version of the OpenAPI document: 0.7.16 + * The version of the OpenAPI document: 0.7.18 * * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). @@ -25,13 +25,18 @@ * Do not edit the class manually. */ +import { ResolutionEntryDTO } from './resolutionEntryDTO'; -export class AccountMetaDTO { - 'height': Array; - 'hash': string; - 'merkleComponentHash': string; - 'index': number; - 'id': string; +export class ResolutionStatementBodyDTO { + /** + * Height of the blockchain. + */ + 'height': string; + 'unresolved': any; + /** + * Array of resolution entries linked to the unresolved namespaceId. It is an array instead of a single resolution entry since within one block the resolution might change for different sources due to alias related transactions. + */ + 'resolutionEntries': Array; static discriminator: string | undefined = undefined; @@ -39,31 +44,21 @@ export class AccountMetaDTO { { "name": "height", "baseName": "height", - "type": "Array" - }, - { - "name": "hash", - "baseName": "hash", - "type": "string" - }, - { - "name": "merkleComponentHash", - "baseName": "merkleComponentHash", "type": "string" }, { - "name": "index", - "baseName": "index", - "type": "number" + "name": "unresolved", + "baseName": "unresolved", + "type": "any" }, { - "name": "id", - "baseName": "id", - "type": "string" + "name": "resolutionEntries", + "baseName": "resolutionEntries", + "type": "Array" } ]; static getAttributeTypeMap() { - return AccountMetaDTO.attributeTypeMap; + return ResolutionStatementBodyDTO.attributeTypeMap; } } diff --git a/src/infrastructure/model/resolutionStatementDTO.ts b/src/infrastructure/model/resolutionStatementDTO.ts index 836087fadc..45493f4c6e 100644 --- a/src/infrastructure/model/resolutionStatementDTO.ts +++ b/src/infrastructure/model/resolutionStatementDTO.ts @@ -25,36 +25,21 @@ * Do not edit the class manually. */ -import { ResolutionEntryDTO } from './resolutionEntryDTO'; +import { ResolutionStatementBodyDTO } from './resolutionStatementBodyDTO'; /** * A resolution statement keeps the relation between a namespace alias used in a transaction and the real address or mosaicId. */ export class ResolutionStatementDTO { - 'height': Array; - 'unresolved': any; - /** - * Array of resolution entries linked to the unresolved namespaceId. It is an array instead of a single UInt64 field since within one block the resolution might change for different sources due to alias related transactions. - */ - 'resolutionEntries': Array; + 'statement': ResolutionStatementBodyDTO; static discriminator: string | undefined = undefined; static attributeTypeMap: Array<{name: string, baseName: string, type: string}> = [ { - "name": "height", - "baseName": "height", - "type": "Array" - }, - { - "name": "unresolved", - "baseName": "unresolved", - "type": "AnyOfarraystring" - }, - { - "name": "resolutionEntries", - "baseName": "resolutionEntries", - "type": "Array" + "name": "statement", + "baseName": "statement", + "type": "ResolutionStatementBodyDTO" } ]; static getAttributeTypeMap() { diff --git a/src/infrastructure/model/score.ts b/src/infrastructure/model/score.ts deleted file mode 100644 index 6f7935ceb6..0000000000 --- a/src/infrastructure/model/score.ts +++ /dev/null @@ -1,34 +0,0 @@ -/* - * Copyright 2019 NEM - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -/** - * Catapult REST Endpoints - * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) - * - * The version of the OpenAPI document: 0.7.18 - * - * - * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). - * https://openapi-generator.tech - * Do not edit the class manually. - */ - - -export class Score extends Array { - - static discriminator: string | undefined = undefined; - -} - diff --git a/src/infrastructure/model/secretLockTransactionBodyDTO.ts b/src/infrastructure/model/secretLockTransactionBodyDTO.ts index 930ffb634c..976228fdf1 100644 --- a/src/infrastructure/model/secretLockTransactionBodyDTO.ts +++ b/src/infrastructure/model/secretLockTransactionBodyDTO.ts @@ -28,9 +28,18 @@ import { LockHashAlgorithmEnum } from './lockHashAlgorithmEnum'; export class SecretLockTransactionBodyDTO { - 'duration': Array; - 'mosaicId': Array; - 'amount': Array; + /** + * Duration expressed in number of blocks. + */ + 'duration': string; + /** + * Mosaic identifier. If the most significant bit of byte 0 is set, a namespaceId (alias) is used instead of the real mosaic identifier. + */ + 'mosaicId': string; + /** + * Absolute amount. An amount of 123456789 (absolute) for a mosaic with divisibility 6 means 123.456789 (relative). + */ + 'amount': string; 'hashAlgorithm': LockHashAlgorithmEnum; 'secret': string; /** @@ -44,17 +53,17 @@ export class SecretLockTransactionBodyDTO { { "name": "duration", "baseName": "duration", - "type": "Array" + "type": "string" }, { "name": "mosaicId", "baseName": "mosaicId", - "type": "Array" + "type": "string" }, { "name": "amount", "baseName": "amount", - "type": "Array" + "type": "string" }, { "name": "hashAlgorithm", diff --git a/src/infrastructure/model/secretLockTransactionDTO.ts b/src/infrastructure/model/secretLockTransactionDTO.ts index f20e138255..1e97682b9d 100644 --- a/src/infrastructure/model/secretLockTransactionDTO.ts +++ b/src/infrastructure/model/secretLockTransactionDTO.ts @@ -33,6 +33,9 @@ import { TransactionDTO } from './transactionDTO'; * Transaction to sends mosaics to a recipient if the proof used is revealed. If the duration is reached, the locked funds go back to the sender of the transaction. */ export class SecretLockTransactionDTO { + /** + * Entity\'s signature generated by the signer. + */ 'signature': string; 'signerPublicKey': string; /** @@ -40,11 +43,26 @@ export class SecretLockTransactionDTO { */ 'version': number; 'type': number; - 'maxFee': Array; - 'deadline': Array; - 'duration': Array; - 'mosaicId': Array; - 'amount': Array; + /** + * Absolute amount. An amount of 123456789 (absolute) for a mosaic with divisibility 6 means 123.456789 (relative). + */ + 'maxFee': string; + /** + * Duration expressed in number of blocks. + */ + 'deadline': string; + /** + * Duration expressed in number of blocks. + */ + 'duration': string; + /** + * Mosaic identifier. If the most significant bit of byte 0 is set, a namespaceId (alias) is used instead of the real mosaic identifier. + */ + 'mosaicId': string; + /** + * Absolute amount. An amount of 123456789 (absolute) for a mosaic with divisibility 6 means 123.456789 (relative). + */ + 'amount': string; 'hashAlgorithm': LockHashAlgorithmEnum; 'secret': string; /** @@ -78,27 +96,27 @@ export class SecretLockTransactionDTO { { "name": "maxFee", "baseName": "maxFee", - "type": "Array" + "type": "string" }, { "name": "deadline", "baseName": "deadline", - "type": "Array" + "type": "string" }, { "name": "duration", "baseName": "duration", - "type": "Array" + "type": "string" }, { "name": "mosaicId", "baseName": "mosaicId", - "type": "Array" + "type": "string" }, { "name": "amount", "baseName": "amount", - "type": "Array" + "type": "string" }, { "name": "hashAlgorithm", diff --git a/src/infrastructure/model/secretProofTransactionDTO.ts b/src/infrastructure/model/secretProofTransactionDTO.ts index 944f98b96c..516a9aa64a 100644 --- a/src/infrastructure/model/secretProofTransactionDTO.ts +++ b/src/infrastructure/model/secretProofTransactionDTO.ts @@ -33,6 +33,9 @@ import { TransactionDTO } from './transactionDTO'; * Transaction to reveal a proof. */ export class SecretProofTransactionDTO { + /** + * Entity\'s signature generated by the signer. + */ 'signature': string; 'signerPublicKey': string; /** @@ -40,8 +43,14 @@ export class SecretProofTransactionDTO { */ 'version': number; 'type': number; - 'maxFee': Array; - 'deadline': Array; + /** + * Absolute amount. An amount of 123456789 (absolute) for a mosaic with divisibility 6 means 123.456789 (relative). + */ + 'maxFee': string; + /** + * Duration expressed in number of blocks. + */ + 'deadline': string; 'hashAlgorithm': LockHashAlgorithmEnum; 'secret': string; /** @@ -79,12 +88,12 @@ export class SecretProofTransactionDTO { { "name": "maxFee", "baseName": "maxFee", - "type": "Array" + "type": "string" }, { "name": "deadline", "baseName": "deadline", - "type": "Array" + "type": "string" }, { "name": "hashAlgorithm", diff --git a/src/infrastructure/model/timestamp.ts b/src/infrastructure/model/timestamp.ts deleted file mode 100644 index 53de3dd493..0000000000 --- a/src/infrastructure/model/timestamp.ts +++ /dev/null @@ -1,34 +0,0 @@ -/* - * Copyright 2019 NEM - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -/** - * Catapult REST Endpoints - * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) - * - * The version of the OpenAPI document: 0.7.18 - * - * - * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). - * https://openapi-generator.tech - * Do not edit the class manually. - */ - - -export class Timestamp extends Array { - - static discriminator: string | undefined = undefined; - -} - diff --git a/src/infrastructure/model/transactionBodyDTO.ts b/src/infrastructure/model/transactionBodyDTO.ts index ef8d14e4e8..2e5c8791dd 100644 --- a/src/infrastructure/model/transactionBodyDTO.ts +++ b/src/infrastructure/model/transactionBodyDTO.ts @@ -27,8 +27,14 @@ export class TransactionBodyDTO { - 'maxFee': Array; - 'deadline': Array; + /** + * Absolute amount. An amount of 123456789 (absolute) for a mosaic with divisibility 6 means 123.456789 (relative). + */ + 'maxFee': string; + /** + * Duration expressed in number of blocks. + */ + 'deadline': string; static discriminator: string | undefined = undefined; @@ -36,12 +42,12 @@ export class TransactionBodyDTO { { "name": "maxFee", "baseName": "maxFee", - "type": "Array" + "type": "string" }, { "name": "deadline", "baseName": "deadline", - "type": "Array" + "type": "string" } ]; static getAttributeTypeMap() { diff --git a/src/infrastructure/model/transactionDTO.ts b/src/infrastructure/model/transactionDTO.ts index 01f02e771e..5ca7fc0fce 100644 --- a/src/infrastructure/model/transactionDTO.ts +++ b/src/infrastructure/model/transactionDTO.ts @@ -30,6 +30,9 @@ import { TransactionBodyDTO } from './transactionBodyDTO'; import { VerifiableEntityDTO } from './verifiableEntityDTO'; export class TransactionDTO { + /** + * Entity\'s signature generated by the signer. + */ 'signature': string; 'signerPublicKey': string; /** @@ -37,8 +40,14 @@ export class TransactionDTO { */ 'version': number; 'type': number; - 'maxFee': Array; - 'deadline': Array; + /** + * Absolute amount. An amount of 123456789 (absolute) for a mosaic with divisibility 6 means 123.456789 (relative). + */ + 'maxFee': string; + /** + * Duration expressed in number of blocks. + */ + 'deadline': string; static discriminator: string | undefined = undefined; @@ -66,12 +75,12 @@ export class TransactionDTO { { "name": "maxFee", "baseName": "maxFee", - "type": "Array" + "type": "string" }, { "name": "deadline", "baseName": "deadline", - "type": "Array" + "type": "string" } ]; static getAttributeTypeMap() { diff --git a/src/infrastructure/model/transactionInfoDTO.ts b/src/infrastructure/model/transactionInfoDTO.ts index 1e1323aa7a..03729e0b15 100644 --- a/src/infrastructure/model/transactionInfoDTO.ts +++ b/src/infrastructure/model/transactionInfoDTO.ts @@ -29,7 +29,7 @@ import { TransactionMetaDTO } from './transactionMetaDTO'; export class TransactionInfoDTO { 'meta': TransactionMetaDTO; - 'transaction': object; + 'transaction': any; static discriminator: string | undefined = undefined; @@ -42,7 +42,7 @@ export class TransactionInfoDTO { { "name": "transaction", "baseName": "transaction", - "type": "AnyOfAccountLinkTransactionDTOAggregateCompleteTransactionDTOAggregateBondedTransactionDTOMosaicDefinitionTransactionDTOMosaicSupplyChangeTransactionDTOMultisigAccountModificationTransactionDTONamespaceRegistrationTransactionDTOAddressAliasTransactionDTOMosaicAliasTransactionDTOHashLockTransactionDTOSecretLockTransactionDTOSecretProofTransactionDTOAccountAddressRestrictionTransactionDTOAccountMosaicRestrictionTransactionDTOAccountOperationRestrictionTransactionDTOGlobalMosaicRestrictionTransactionDTOAddressMosaicRestrictionTransactionDTOTransferTransactionDTO" + "type": "any" } ]; static getAttributeTypeMap() { diff --git a/src/infrastructure/model/transactionMetaDTO.ts b/src/infrastructure/model/transactionMetaDTO.ts index 7c31969749..8c954af497 100644 --- a/src/infrastructure/model/transactionMetaDTO.ts +++ b/src/infrastructure/model/transactionMetaDTO.ts @@ -27,7 +27,10 @@ export class TransactionMetaDTO { - 'height': Array; + /** + * Height of the blockchain. + */ + 'height': string; 'hash': string; 'merkleComponentHash': string; 'index': number; @@ -39,7 +42,7 @@ export class TransactionMetaDTO { { "name": "height", "baseName": "height", - "type": "Array" + "type": "string" }, { "name": "hash", diff --git a/src/infrastructure/model/accountAddressRestrictionModificationDTOAllOf.ts b/src/infrastructure/model/transactionStatementBodyDTO.ts similarity index 67% rename from src/infrastructure/model/accountAddressRestrictionModificationDTOAllOf.ts rename to src/infrastructure/model/transactionStatementBodyDTO.ts index c493566d8d..437e218cc0 100644 --- a/src/infrastructure/model/accountAddressRestrictionModificationDTOAllOf.ts +++ b/src/infrastructure/model/transactionStatementBodyDTO.ts @@ -25,24 +25,40 @@ * Do not edit the class manually. */ +import { SourceDTO } from './sourceDTO'; -export class AccountAddressRestrictionModificationDTOAllOf { +export class TransactionStatementBodyDTO { /** - * Address decoded. If the bit 0 of byte 0 is not set (like in 0x90), then it is a regular address. Else (e.g. 0x91) it represents a namespace id which starts at byte 1. + * Height of the blockchain. */ - 'value': string; + 'height': string; + 'source': SourceDTO; + /** + * Array of receipts. + */ + 'receipts': Array; static discriminator: string | undefined = undefined; static attributeTypeMap: Array<{name: string, baseName: string, type: string}> = [ { - "name": "value", - "baseName": "value", + "name": "height", + "baseName": "height", "type": "string" + }, + { + "name": "source", + "baseName": "source", + "type": "SourceDTO" + }, + { + "name": "receipts", + "baseName": "receipts", + "type": "Array" } ]; static getAttributeTypeMap() { - return AccountAddressRestrictionModificationDTOAllOf.attributeTypeMap; + return TransactionStatementBodyDTO.attributeTypeMap; } } diff --git a/src/infrastructure/model/transactionStatementDTO.ts b/src/infrastructure/model/transactionStatementDTO.ts index 466e8c47d9..c424e1e39d 100644 --- a/src/infrastructure/model/transactionStatementDTO.ts +++ b/src/infrastructure/model/transactionStatementDTO.ts @@ -25,36 +25,21 @@ * Do not edit the class manually. */ -import { SourceDTO } from './sourceDTO'; +import { TransactionStatementBodyDTO } from './transactionStatementBodyDTO'; /** * Collection of receipts related to a transaction. */ export class TransactionStatementDTO { - 'height': Array; - 'source': SourceDTO; - /** - * Array of receipts. - */ - 'receipts': Array; + 'statement': TransactionStatementBodyDTO; static discriminator: string | undefined = undefined; static attributeTypeMap: Array<{name: string, baseName: string, type: string}> = [ { - "name": "height", - "baseName": "height", - "type": "Array" - }, - { - "name": "source", - "baseName": "source", - "type": "SourceDTO" - }, - { - "name": "receipts", - "baseName": "receipts", - "type": "Array" + "name": "statement", + "baseName": "statement", + "type": "TransactionStatementBodyDTO" } ]; static getAttributeTypeMap() { diff --git a/src/infrastructure/model/transactionStatusDTO.ts b/src/infrastructure/model/transactionStatusDTO.ts index 6f8576bf2c..9fd7156054 100644 --- a/src/infrastructure/model/transactionStatusDTO.ts +++ b/src/infrastructure/model/transactionStatusDTO.ts @@ -30,8 +30,14 @@ export class TransactionStatusDTO { 'group'?: string; 'status': string; 'hash'?: string; - 'deadline'?: Array; - 'height'?: Array; + /** + * Duration expressed in number of blocks. + */ + 'deadline'?: string; + /** + * Height of the blockchain. + */ + 'height'?: string; static discriminator: string | undefined = undefined; @@ -54,12 +60,12 @@ export class TransactionStatusDTO { { "name": "deadline", "baseName": "deadline", - "type": "Array" + "type": "string" }, { "name": "height", "baseName": "height", - "type": "Array" + "type": "string" } ]; static getAttributeTypeMap() { diff --git a/src/infrastructure/model/transferTransactionDTO.ts b/src/infrastructure/model/transferTransactionDTO.ts index 58c918940e..3ed76c11ac 100644 --- a/src/infrastructure/model/transferTransactionDTO.ts +++ b/src/infrastructure/model/transferTransactionDTO.ts @@ -34,6 +34,9 @@ import { TransferTransactionBodyDTO } from './transferTransactionBodyDTO'; * Transaction to transfer mosaics and a message to another account. */ export class TransferTransactionDTO { + /** + * Entity\'s signature generated by the signer. + */ 'signature': string; 'signerPublicKey': string; /** @@ -41,8 +44,14 @@ export class TransferTransactionDTO { */ 'version': number; 'type': number; - 'maxFee': Array; - 'deadline': Array; + /** + * Absolute amount. An amount of 123456789 (absolute) for a mosaic with divisibility 6 means 123.456789 (relative). + */ + 'maxFee': string; + /** + * Duration expressed in number of blocks. + */ + 'deadline': string; /** * Address decoded. If the bit 0 of byte 0 is not set (like in 0x90), then it is a regular address. Else (e.g. 0x91) it represents a namespace id which starts at byte 1. */ @@ -79,12 +88,12 @@ export class TransferTransactionDTO { { "name": "maxFee", "baseName": "maxFee", - "type": "Array" + "type": "string" }, { "name": "deadline", "baseName": "deadline", - "type": "Array" + "type": "string" }, { "name": "recipientAddress", diff --git a/src/infrastructure/model/unresolvedMosaic.ts b/src/infrastructure/model/unresolvedMosaic.ts index afffdede96..7a09e3c8d8 100644 --- a/src/infrastructure/model/unresolvedMosaic.ts +++ b/src/infrastructure/model/unresolvedMosaic.ts @@ -27,8 +27,14 @@ export class UnresolvedMosaic { - 'id': Array; - 'amount': Array; + /** + * Mosaic identifier. If the most significant bit of byte 0 is set, a namespaceId (alias) is used instead of the real mosaic identifier. + */ + 'id': string; + /** + * Absolute amount. An amount of 123456789 (absolute) for a mosaic with divisibility 6 means 123.456789 (relative). + */ + 'amount': string; static discriminator: string | undefined = undefined; @@ -36,12 +42,12 @@ export class UnresolvedMosaic { { "name": "id", "baseName": "id", - "type": "Array" + "type": "string" }, { "name": "amount", "baseName": "amount", - "type": "Array" + "type": "string" } ]; static getAttributeTypeMap() { diff --git a/src/infrastructure/model/unresolvedMosaicId.ts b/src/infrastructure/model/unresolvedMosaicId.ts deleted file mode 100644 index 22de281923..0000000000 --- a/src/infrastructure/model/unresolvedMosaicId.ts +++ /dev/null @@ -1,34 +0,0 @@ -/* - * Copyright 2019 NEM - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -/** - * Catapult REST Endpoints - * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) - * - * The version of the OpenAPI document: 0.7.18 - * - * - * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). - * https://openapi-generator.tech - * Do not edit the class manually. - */ - - -export class UnresolvedMosaicId extends Array { - - static discriminator: string | undefined = undefined; - -} - diff --git a/src/infrastructure/model/verifiableEntityDTO.ts b/src/infrastructure/model/verifiableEntityDTO.ts index 482ba53b4e..71d3cd1396 100644 --- a/src/infrastructure/model/verifiableEntityDTO.ts +++ b/src/infrastructure/model/verifiableEntityDTO.ts @@ -27,6 +27,9 @@ export class VerifiableEntityDTO { + /** + * Entity\'s signature generated by the signer. + */ 'signature': string; static discriminator: string | undefined = undefined; diff --git a/src/infrastructure/receipt/CreateReceiptFromDTO.ts b/src/infrastructure/receipt/CreateReceiptFromDTO.ts index 3e55489873..6b0cb84eba 100644 --- a/src/infrastructure/receipt/CreateReceiptFromDTO.ts +++ b/src/infrastructure/receipt/CreateReceiptFromDTO.ts @@ -92,7 +92,7 @@ const createResolutionStatement = (statementDTO, resolutionType): ResolutionStat switch (resolutionType) { case ResolutionType.Address: return new ResolutionStatement( - statementDTO.height, + UInt64.fromNumericString(statementDTO.height), Address.createFromEncoded(statementDTO.unresolved), statementDTO.resolutionEntries.map((entry) => { return new ResolutionEntry(new AddressAlias(AliasType.Address, Address.createFromEncoded(entry.resolved)), @@ -100,8 +100,9 @@ const createResolutionStatement = (statementDTO, resolutionType): ResolutionStat }), ); case ResolutionType.Mosaic: + console.log(statementDTO); return new ResolutionStatement( - statementDTO.height, + UInt64.fromNumericString(statementDTO.height), new MosaicId(statementDTO.unresolved), statementDTO.resolutionEntries.map((entry) => { return new ResolutionEntry(new MosaicAlias(AliasType.Mosaic, new MosaicId(entry.resolved)), @@ -122,7 +123,7 @@ const createResolutionStatement = (statementDTO, resolutionType): ResolutionStat */ const createTransactionStatement = (statementDTO, networkType): TransactionStatement => { return new TransactionStatement( - statementDTO.height, + UInt64.fromNumericString(statementDTO.height), new ReceiptSource(statementDTO.source.primaryId, statementDTO.source.secondaryId), statementDTO.receipts.map((receipt) => { return CreateReceiptFromDTO(receipt, networkType); @@ -139,9 +140,9 @@ const createTransactionStatement = (statementDTO, networkType): TransactionState */ const createBalanceChangeReceipt = (receiptDTO, networkType): Receipt => { return new BalanceChangeReceipt( - PublicAccount.createFromPublicKey(receiptDTO.account, networkType), + PublicAccount.createFromPublicKey(receiptDTO.targetPublicKey, networkType), new MosaicId(receiptDTO.mosaicId), - new UInt64(receiptDTO.amount), + UInt64.fromNumericString(receiptDTO.amount), receiptDTO.version, receiptDTO.type, ); @@ -156,10 +157,10 @@ const createBalanceChangeReceipt = (receiptDTO, networkType): Receipt => { */ const createBalanceTransferReceipt = (receiptDTO, networkType): Receipt => { return new BalanceTransferReceipt( - PublicAccount.createFromPublicKey(receiptDTO.sender, networkType), - Address.createFromEncoded(receiptDTO.recipient), + PublicAccount.createFromPublicKey(receiptDTO.senderPublicKey, networkType), + Address.createFromEncoded(receiptDTO.recipientAddress), new MosaicId(receiptDTO.mosaicId), - new UInt64(receiptDTO.amount), + UInt64.fromNumericString(receiptDTO.amount), receiptDTO.version, receiptDTO.type, ); @@ -188,18 +189,18 @@ const createArtifactExpiryReceipt = (receiptDTO): Receipt => { const createInflationReceipt = (receiptDTO): Receipt => { return new InflationReceipt( new MosaicId(receiptDTO.mosaicId), - new UInt64(receiptDTO.amount), + UInt64.fromNumericString(receiptDTO.amount), receiptDTO.version, receiptDTO.type, ); }; -const extractArtifactId = (receiptType: ReceiptType, id: number[]): MosaicId | NamespaceId => { +const extractArtifactId = (receiptType: ReceiptType, id: string): MosaicId | NamespaceId => { switch (receiptType) { case ReceiptType.Mosaic_Expired: return new MosaicId(id); case ReceiptType.Namespace_Expired: - return new NamespaceId(id); + return new NamespaceId(UInt64.fromHex(id).toDTO()); default: throw new Error('Receipt type is not supported.'); } diff --git a/src/infrastructure/transaction/CreateTransactionFromDTO.ts b/src/infrastructure/transaction/CreateTransactionFromDTO.ts index 0f4b8cb204..8d866f8925 100644 --- a/src/infrastructure/transaction/CreateTransactionFromDTO.ts +++ b/src/infrastructure/transaction/CreateTransactionFromDTO.ts @@ -69,7 +69,7 @@ export const CreateTransactionFromDTO = (transactionDTO): Transaction => { transactionDTO.transaction.type === TransactionType.AGGREGATE_BONDED) { const innerTransactions = transactionDTO.transaction.transactions.map((innerTransactionDTO) => { const aggregateTransactionInfo = innerTransactionDTO.meta ? new AggregateTransactionInfo( - new UInt64(innerTransactionDTO.meta.height), + UInt64.fromNumericString(innerTransactionDTO.meta.height), innerTransactionDTO.meta.index, innerTransactionDTO.meta.id, innerTransactionDTO.meta.aggregateHash, @@ -85,20 +85,20 @@ export const CreateTransactionFromDTO = (transactionDTO): Transaction => { transactionDTO.transaction.type, extractTransactionVersion(transactionDTO.transaction.version), Deadline.createFromDTO(transactionDTO.transaction.deadline), - new UInt64(transactionDTO.transaction.maxFee || [0, 0]), + UInt64.fromNumericString(transactionDTO.transaction.maxFee || '0'), innerTransactions, transactionDTO.transaction.cosignatures ? transactionDTO.transaction.cosignatures .map((aggregateCosignatureDTO) => { return new AggregateTransactionCosignature( aggregateCosignatureDTO.signature, - PublicAccount.createFromPublicKey(aggregateCosignatureDTO.signer, + PublicAccount.createFromPublicKey(aggregateCosignatureDTO.signerPublicKey, extractNetworkType(transactionDTO.transaction.version))); }) : [], transactionDTO.transaction.signature, - transactionDTO.transaction.signer ? PublicAccount.createFromPublicKey(transactionDTO.transaction.signer, + transactionDTO.transaction.signerPublicKey ? PublicAccount.createFromPublicKey(transactionDTO.transaction.signerPublicKey, extractNetworkType(transactionDTO.transaction.version)) : undefined, transactionDTO.meta ? new TransactionInfo( - new UInt64(transactionDTO.meta.height), + UInt64.fromNumericString(transactionDTO.meta.height), transactionDTO.meta.index, transactionDTO.meta.id, transactionDTO.meta.hash, @@ -107,7 +107,7 @@ export const CreateTransactionFromDTO = (transactionDTO): Transaction => { ); } else { const transactionInfo = transactionDTO.meta ? new TransactionInfo( - new UInt64(transactionDTO.meta.height), + UInt64.fromNumericString(transactionDTO.meta.height), transactionDTO.meta.index, transactionDTO.meta.id, transactionDTO.meta.hash, @@ -131,12 +131,12 @@ const CreateStandaloneTransactionFromDTO = (transactionDTO, transactionInfo): Tr extractNetworkType(transactionDTO.version), extractTransactionVersion(transactionDTO.version), Deadline.createFromDTO(transactionDTO.deadline), - new UInt64(transactionDTO.maxFee || [0, 0]), - extractRecipient(transactionDTO.recipient), + UInt64.fromNumericString(transactionDTO.maxFee || '0'), + extractRecipient(transactionDTO.recipientAddress), extractMosaics(transactionDTO.mosaics), extractMessage(transactionDTO.message !== undefined ? transactionDTO.message : undefined), transactionDTO.signature, - transactionDTO.signer ? PublicAccount.createFromPublicKey(transactionDTO.signer, + transactionDTO.signerPublicKey ? PublicAccount.createFromPublicKey(transactionDTO.signerPublicKey, extractNetworkType(transactionDTO.version)) : undefined, transactionInfo, ); @@ -145,14 +145,14 @@ const CreateStandaloneTransactionFromDTO = (transactionDTO, transactionInfo): Tr extractNetworkType(transactionDTO.version), extractTransactionVersion(transactionDTO.version), Deadline.createFromDTO(transactionDTO.deadline), - new UInt64(transactionDTO.maxFee || [0, 0]), - transactionDTO.namespaceType, + UInt64.fromNumericString(transactionDTO.maxFee || '0'), + transactionDTO.registrationType, transactionDTO.name, - new NamespaceId(transactionDTO.namespaceId), - transactionDTO.namespaceType === 0 ? new UInt64(transactionDTO.duration) : undefined, - transactionDTO.namespaceType === 1 ? new NamespaceId(transactionDTO.parentId) : undefined, + new NamespaceId(UInt64.fromHex(transactionDTO.id).toDTO()), + transactionDTO.registrationType === 0 ? UInt64.fromNumericString(transactionDTO.duration) : undefined, + transactionDTO.registrationType === 1 ? new NamespaceId(UInt64.fromHex(transactionDTO.parentId).toDTO()) : undefined, transactionDTO.signature, - transactionDTO.signer ? PublicAccount.createFromPublicKey(transactionDTO.signer, + transactionDTO.signerPublicKey ? PublicAccount.createFromPublicKey(transactionDTO.signerPublicKey, extractNetworkType(transactionDTO.version)) : undefined, transactionInfo, ); @@ -161,17 +161,16 @@ const CreateStandaloneTransactionFromDTO = (transactionDTO, transactionInfo): Tr extractNetworkType(transactionDTO.version), extractTransactionVersion(transactionDTO.version), Deadline.createFromDTO(transactionDTO.deadline), - new UInt64(transactionDTO.maxFee || [0, 0]), + UInt64.fromNumericString(transactionDTO.maxFee || '0'), transactionDTO.nonce, - new MosaicId(transactionDTO.mosaicId), + new MosaicId(transactionDTO.id), new MosaicProperties( - new UInt64(transactionDTO.properties[MosaicPropertyType.MosaicFlags].value), - (new UInt64(transactionDTO.properties[MosaicPropertyType.Divisibility].value)).compact(), - transactionDTO.properties.length === 3 && transactionDTO.properties[MosaicPropertyType.Duration].value ? - new UInt64(transactionDTO.properties[MosaicPropertyType.Duration].value) : undefined, + UInt64.fromUint(transactionDTO.flags), + transactionDTO.divisibility, + UInt64.fromNumericString(transactionDTO.duration), ), transactionDTO.signature, - transactionDTO.signer ? PublicAccount.createFromPublicKey(transactionDTO.signer, + transactionDTO.signerPublicKey ? PublicAccount.createFromPublicKey(transactionDTO.signerPublicKey, extractNetworkType(transactionDTO.version)) : undefined, transactionInfo, ); @@ -180,12 +179,12 @@ const CreateStandaloneTransactionFromDTO = (transactionDTO, transactionInfo): Tr extractNetworkType(transactionDTO.version), extractTransactionVersion(transactionDTO.version), Deadline.createFromDTO(transactionDTO.deadline), - new UInt64(transactionDTO.maxFee || [0, 0]), + UInt64.fromNumericString(transactionDTO.maxFee || '0'), new MosaicId(transactionDTO.mosaicId), transactionDTO.direction, - new UInt64(transactionDTO.delta), + UInt64.fromNumericString(transactionDTO.delta), transactionDTO.signature, - transactionDTO.signer ? PublicAccount.createFromPublicKey(transactionDTO.signer, + transactionDTO.signerPublicKey ? PublicAccount.createFromPublicKey(transactionDTO.signerPublicKey, extractNetworkType(transactionDTO.version)) : undefined, transactionInfo, ); @@ -194,7 +193,7 @@ const CreateStandaloneTransactionFromDTO = (transactionDTO, transactionInfo): Tr extractNetworkType(transactionDTO.version), extractTransactionVersion(transactionDTO.version), Deadline.createFromDTO(transactionDTO.deadline), - new UInt64(transactionDTO.maxFee || [0, 0]), + UInt64.fromNumericString(transactionDTO.maxFee || '0'), transactionDTO.minApprovalDelta, transactionDTO.minRemovalDelta, transactionDTO.modifications ? transactionDTO.modifications.map((modificationDTO) => new MultisigCosignatoryModification( @@ -202,7 +201,7 @@ const CreateStandaloneTransactionFromDTO = (transactionDTO, transactionInfo): Tr PublicAccount.createFromPublicKey(modificationDTO.cosignatoryPublicKey, extractNetworkType(transactionDTO.version)), )) : [], transactionDTO.signature, - transactionDTO.signer ? PublicAccount.createFromPublicKey(transactionDTO.signer, + transactionDTO.signerPublicKey ? PublicAccount.createFromPublicKey(transactionDTO.signerPublicKey, extractNetworkType(transactionDTO.version)) : undefined, transactionInfo, ); @@ -212,46 +211,46 @@ const CreateStandaloneTransactionFromDTO = (transactionDTO, transactionInfo): Tr networkType, extractTransactionVersion(transactionDTO.version), Deadline.createFromDTO(transactionDTO.deadline), - new UInt64(transactionDTO.maxFee || [0, 0]), - new Mosaic(new MosaicId(transactionDTO.mosaicId), new UInt64(transactionDTO.amount)), - new UInt64(transactionDTO.duration), + UInt64.fromNumericString(transactionDTO.maxFee || '0'), + new Mosaic(new MosaicId(transactionDTO.mosaicId), UInt64.fromNumericString(transactionDTO.amount)), + UInt64.fromNumericString(transactionDTO.duration), new SignedTransaction('', transactionDTO.hash, '', TransactionType.AGGREGATE_BONDED, networkType), transactionDTO.signature, - transactionDTO.signer ? PublicAccount.createFromPublicKey(transactionDTO.signer, networkType) : undefined, + transactionDTO.signerPublicKey ? PublicAccount.createFromPublicKey(transactionDTO.signerPublicKey, networkType) : undefined, transactionInfo, ); } else if (transactionDTO.type === TransactionType.SECRET_LOCK) { - const recipient = transactionDTO.recipient; + const recipientAddress = transactionDTO.recipientAddress; return new SecretLockTransaction( extractNetworkType(transactionDTO.version), extractTransactionVersion(transactionDTO.version), Deadline.createFromDTO(transactionDTO.deadline), - new UInt64(transactionDTO.maxFee || [0, 0]), - new Mosaic(new MosaicId(transactionDTO.mosaicId), new UInt64(transactionDTO.amount)), - new UInt64(transactionDTO.duration), + UInt64.fromNumericString(transactionDTO.maxFee || '0'), + new Mosaic(new MosaicId(transactionDTO.mosaicId), UInt64.fromNumericString(transactionDTO.amount)), + UInt64.fromNumericString(transactionDTO.duration), transactionDTO.hashAlgorithm, transactionDTO.secret, - typeof recipient === 'object' && recipient.hasOwnProperty('address') ? - Address.createFromRawAddress(recipient.address) : Address.createFromEncoded(recipient), + typeof recipientAddress === 'object' && recipientAddress.hasOwnProperty('address') ? + Address.createFromRawAddress(recipientAddress.address) : Address.createFromEncoded(recipientAddress), transactionDTO.signature, - transactionDTO.signer ? PublicAccount.createFromPublicKey(transactionDTO.signer, + transactionDTO.signerPublicKey ? PublicAccount.createFromPublicKey(transactionDTO.signerPublicKey, extractNetworkType(transactionDTO.version)) : undefined, transactionInfo, ); } else if (transactionDTO.type === TransactionType.SECRET_PROOF) { - const recipient = transactionDTO.recipient; + const recipientAddress = transactionDTO.recipientAddress; return new SecretProofTransaction( extractNetworkType(transactionDTO.version), extractTransactionVersion(transactionDTO.version), Deadline.createFromDTO(transactionDTO.deadline), - new UInt64(transactionDTO.maxFee || [0, 0]), + UInt64.fromNumericString(transactionDTO.maxFee || '0'), transactionDTO.hashAlgorithm, transactionDTO.secret, - typeof recipient === 'object' && recipient.hasOwnProperty('address') ? - Address.createFromRawAddress(recipient.address) : Address.createFromEncoded(recipient), + typeof recipientAddress === 'object' && recipientAddress.hasOwnProperty('address') ? + Address.createFromRawAddress(recipientAddress.address) : Address.createFromEncoded(recipientAddress), transactionDTO.proof, transactionDTO.signature, - transactionDTO.signer ? PublicAccount.createFromPublicKey(transactionDTO.signer, + transactionDTO.signerPublicKey ? PublicAccount.createFromPublicKey(transactionDTO.signerPublicKey, extractNetworkType(transactionDTO.version)) : undefined, transactionInfo, ); @@ -260,12 +259,12 @@ const CreateStandaloneTransactionFromDTO = (transactionDTO, transactionInfo): Tr extractNetworkType(transactionDTO.version), extractTransactionVersion(transactionDTO.version), Deadline.createFromDTO(transactionDTO.deadline), - new UInt64(transactionDTO.maxFee || [0, 0]), + UInt64.fromNumericString(transactionDTO.maxFee || '0'), transactionDTO.aliasAction, - new NamespaceId(transactionDTO.namespaceId), + new NamespaceId(UInt64.fromHex(transactionDTO.namespaceId).toDTO()), new MosaicId(transactionDTO.mosaicId), transactionDTO.signature, - transactionDTO.signer ? PublicAccount.createFromPublicKey(transactionDTO.signer, + transactionDTO.signerPublicKey ? PublicAccount.createFromPublicKey(transactionDTO.signerPublicKey, extractNetworkType(transactionDTO.version)) : undefined, transactionInfo, ); @@ -274,12 +273,12 @@ const CreateStandaloneTransactionFromDTO = (transactionDTO, transactionInfo): Tr extractNetworkType(transactionDTO.version), extractTransactionVersion(transactionDTO.version), Deadline.createFromDTO(transactionDTO.deadline), - new UInt64(transactionDTO.maxFee || [0, 0]), + UInt64.fromNumericString(transactionDTO.maxFee || '0'), transactionDTO.aliasAction, - new NamespaceId(transactionDTO.namespaceId), + new NamespaceId(UInt64.fromHex(transactionDTO.namespaceId).toDTO()), extractRecipient(transactionDTO.address) as Address, transactionDTO.signature, - transactionDTO.signer ? PublicAccount.createFromPublicKey(transactionDTO.signer, + transactionDTO.signerPublicKey ? PublicAccount.createFromPublicKey(transactionDTO.signerPublicKey, extractNetworkType(transactionDTO.version)) : undefined, transactionInfo, ); @@ -288,14 +287,14 @@ const CreateStandaloneTransactionFromDTO = (transactionDTO, transactionInfo): Tr extractNetworkType(transactionDTO.version), extractTransactionVersion(transactionDTO.version), Deadline.createFromDTO(transactionDTO.deadline), - new UInt64(transactionDTO.maxFee || [0, 0]), + UInt64.fromNumericString(transactionDTO.maxFee || '0'), transactionDTO.restrictionType, transactionDTO.modifications ? transactionDTO.modifications.map((modificationDTO) => new AccountRestrictionModification( - modificationDTO.type, + modificationDTO.modificationAction, modificationDTO.value, )) : [], transactionDTO.signature, - transactionDTO.signer ? PublicAccount.createFromPublicKey(transactionDTO.signer, + transactionDTO.signerPublicKey ? PublicAccount.createFromPublicKey(transactionDTO.signerPublicKey, extractNetworkType(transactionDTO.version)) : undefined, transactionInfo, ); @@ -304,14 +303,14 @@ const CreateStandaloneTransactionFromDTO = (transactionDTO, transactionInfo): Tr extractNetworkType(transactionDTO.version), extractTransactionVersion(transactionDTO.version), Deadline.createFromDTO(transactionDTO.deadline), - new UInt64(transactionDTO.maxFee || [0, 0]), + UInt64.fromNumericString(transactionDTO.maxFee || '0'), transactionDTO.restrictionType, transactionDTO.modifications ? transactionDTO.modifications.map((modificationDTO) => new AccountRestrictionModification( - modificationDTO.type, + modificationDTO.modificationAction, modificationDTO.value, )) : [], transactionDTO.signature, - transactionDTO.signer ? PublicAccount.createFromPublicKey(transactionDTO.signer, + transactionDTO.signerPublicKey ? PublicAccount.createFromPublicKey(transactionDTO.signerPublicKey, extractNetworkType(transactionDTO.version)) : undefined, transactionInfo, ); @@ -320,14 +319,14 @@ const CreateStandaloneTransactionFromDTO = (transactionDTO, transactionInfo): Tr extractNetworkType(transactionDTO.version), extractTransactionVersion(transactionDTO.version), Deadline.createFromDTO(transactionDTO.deadline), - new UInt64(transactionDTO.maxFee || [0, 0]), + UInt64.fromNumericString(transactionDTO.maxFee || '0'), transactionDTO.restrictionType, transactionDTO.modifications ? transactionDTO.modifications.map((modificationDTO) => new AccountRestrictionModification( - modificationDTO.type, + modificationDTO.modificationAction, modificationDTO.value, )) : [], transactionDTO.signature, - transactionDTO.signer ? PublicAccount.createFromPublicKey(transactionDTO.signer, + transactionDTO.signerPublicKey ? PublicAccount.createFromPublicKey(transactionDTO.signerPublicKey, extractNetworkType(transactionDTO.version)) : undefined, transactionInfo, ); @@ -336,11 +335,11 @@ const CreateStandaloneTransactionFromDTO = (transactionDTO, transactionInfo): Tr extractNetworkType(transactionDTO.version), extractTransactionVersion(transactionDTO.version), Deadline.createFromDTO(transactionDTO.deadline), - new UInt64(transactionDTO.maxFee || [0, 0]), - transactionDTO.remoteAccountKey, + UInt64.fromNumericString(transactionDTO.maxFee || '0'), + transactionDTO.remotePublicKey, transactionDTO.linkAction, transactionDTO.signature, - transactionDTO.signer ? PublicAccount.createFromPublicKey(transactionDTO.signer, + transactionDTO.signerPublicKey ? PublicAccount.createFromPublicKey(transactionDTO.signerPublicKey, extractNetworkType(transactionDTO.version)) : undefined, transactionInfo, ); @@ -349,16 +348,16 @@ const CreateStandaloneTransactionFromDTO = (transactionDTO, transactionInfo): Tr extractNetworkType(transactionDTO.version), extractTransactionVersion(transactionDTO.version), Deadline.createFromDTO(transactionDTO.deadline), - new UInt64(transactionDTO.maxFee || [0, 0]), + UInt64.fromNumericString(transactionDTO.maxFee || '0'), new MosaicId(transactionDTO.mosaicId), new MosaicId(transactionDTO.referenceMosaicId), - new UInt64(transactionDTO.restrictionKey), - new UInt64(transactionDTO.previousRestrictionValue), + UInt64.fromNumericString(transactionDTO.restrictionKey), + UInt64.fromNumericString(transactionDTO.previousRestrictionValue), transactionDTO.previousRestrictionType, - new UInt64(transactionDTO.newRestrictionValue), + UInt64.fromNumericString(transactionDTO.newRestrictionValue), transactionDTO.newRestrictionType, transactionDTO.signature, - transactionDTO.signer ? PublicAccount.createFromPublicKey(transactionDTO.signer, + transactionDTO.signerPublicKey ? PublicAccount.createFromPublicKey(transactionDTO.signerPublicKey, extractNetworkType(transactionDTO.version)) : undefined, transactionInfo, ); @@ -368,30 +367,31 @@ const CreateStandaloneTransactionFromDTO = (transactionDTO, transactionInfo): Tr extractNetworkType(transactionDTO.version), extractTransactionVersion(transactionDTO.version), Deadline.createFromDTO(transactionDTO.deadline), - new UInt64(transactionDTO.maxFee || [0, 0]), + UInt64.fromNumericString(transactionDTO.maxFee || '0'), new MosaicId(transactionDTO.mosaicId), - new UInt64(transactionDTO.restrictionKey), + UInt64.fromNumericString(transactionDTO.restrictionKey), typeof targetAddress === 'object' && targetAddress.hasOwnProperty('address') ? Address.createFromRawAddress(targetAddress.address) : Address.createFromEncoded(targetAddress), - new UInt64(transactionDTO.previousRestrictionValue), - new UInt64(transactionDTO.newRestrictionValue), + UInt64.fromNumericString(transactionDTO.previousRestrictionValue), + UInt64.fromNumericString(transactionDTO.newRestrictionValue), transactionDTO.signature, - transactionDTO.signer ? PublicAccount.createFromPublicKey(transactionDTO.signer, + transactionDTO.signerPublicKey ? PublicAccount.createFromPublicKey(transactionDTO.signerPublicKey, extractNetworkType(transactionDTO.version)) : undefined, transactionInfo, ); } else if (transactionDTO.type === TransactionType.ACCOUNT_METADATA_TRANSACTION) { + console.log('AccountMetadataTransaction', transactionDTO); return new AccountMetadataTransaction( extractNetworkType(transactionDTO.version), extractTransactionVersion(transactionDTO.version), Deadline.createFromDTO(transactionDTO.deadline), - new UInt64(transactionDTO.maxFee || [0, 0]), + UInt64.fromNumericString(transactionDTO.maxFee || '0'), transactionDTO.targetPublicKey, - new UInt64(transactionDTO.scopedMetadataKey), + UInt64.fromNumericString(transactionDTO.scopedMetadataKey), transactionDTO.valueSizeDelta, convert.hexToUint8(transactionDTO.value), transactionDTO.signature, - transactionDTO.signer ? PublicAccount.createFromPublicKey(transactionDTO.signer, + transactionDTO.signerPublicKey ? PublicAccount.createFromPublicKey(transactionDTO.signerPublicKey, extractNetworkType(transactionDTO.version)) : undefined, transactionInfo, ); @@ -400,14 +400,14 @@ const CreateStandaloneTransactionFromDTO = (transactionDTO, transactionInfo): Tr extractNetworkType(transactionDTO.version), extractTransactionVersion(transactionDTO.version), Deadline.createFromDTO(transactionDTO.deadline), - new UInt64(transactionDTO.maxFee || [0, 0]), + UInt64.fromNumericString(transactionDTO.maxFee || '0'), transactionDTO.targetPublicKey, - new UInt64(transactionDTO.scopedMetadataKey), + UInt64.fromNumericString(transactionDTO.scopedMetadataKey), new MosaicId(transactionDTO.targetMosaicId), transactionDTO.valueSizeDelta, convert.hexToUint8(transactionDTO.value), transactionDTO.signature, - transactionDTO.signer ? PublicAccount.createFromPublicKey(transactionDTO.signer, + transactionDTO.signerPublicKey ? PublicAccount.createFromPublicKey(transactionDTO.signerPublicKey, extractNetworkType(transactionDTO.version)) : undefined, transactionInfo, ); @@ -416,14 +416,14 @@ const CreateStandaloneTransactionFromDTO = (transactionDTO, transactionInfo): Tr extractNetworkType(transactionDTO.version), extractTransactionVersion(transactionDTO.version), Deadline.createFromDTO(transactionDTO.deadline), - new UInt64(transactionDTO.maxFee || [0, 0]), + UInt64.fromNumericString(transactionDTO.maxFee || '0'), transactionDTO.targetPublicKey, - new UInt64(transactionDTO.scopedMetadataKey), + UInt64.fromNumericString(transactionDTO.scopedMetadataKey), new NamespaceId(transactionDTO.targetNamespaceId), transactionDTO.valueSizeDelta, convert.hexToUint8(transactionDTO.value), transactionDTO.signature, - transactionDTO.signer ? PublicAccount.createFromPublicKey(transactionDTO.signer, + transactionDTO.signerPublicKey ? PublicAccount.createFromPublicKey(transactionDTO.signerPublicKey, extractNetworkType(transactionDTO.version)) : undefined, transactionInfo, ); @@ -450,36 +450,36 @@ export const extractTransactionVersion = (version: number): number => { }; /** - * Extract recipient value from encoded hexadecimal notation. + * Extract recipientAddress value from encoded hexadecimal notation. * * If bit 0 of byte 0 is not set (e.g. 0x90), then it is a regular address. * Else (e.g. 0x91) it represents a namespace id which starts at byte 1. * - * @param recipient {string} Encoded hexadecimal recipient notation + * @param recipientAddress {string} Encoded hexadecimal recipientAddress notation * @return {Address | NamespaceId} */ -export const extractRecipient = (recipient: any): Address | NamespaceId => { - if (typeof recipient === 'string') { +export const extractRecipient = (recipientAddress: any): Address | NamespaceId => { + if (typeof recipientAddress === 'string') { // If bit 0 of byte 0 is not set (like in 0x90), then it is a regular address. // Else (e.g. 0x91) it represents a namespace id which starts at byte 1. - const bit0 = convert.hexToUint8(recipient.substr(1, 2))[0]; + const bit0 = convert.hexToUint8(recipientAddress.substr(1, 2))[0]; if ((bit0 & 16) === 16) { // namespaceId encoded hexadecimal notation provided // only 8 bytes are relevant to resolve the NamespaceId - const relevantPart = recipient.substr(2, 16); + const relevantPart = recipientAddress.substr(2, 16); return NamespaceId.createFromEncoded(relevantPart); } // read address from encoded hexadecimal notation - return Address.createFromEncoded(recipient); - } else if (typeof recipient === 'object') { // Is JSON object - if (recipient.hasOwnProperty('address')) { - return Address.createFromRawAddress(recipient.address); - } else if (recipient.hasOwnProperty('id')) { - return new NamespaceId(recipient.id); + return Address.createFromEncoded(recipientAddress); + } else if (typeof recipientAddress === 'object') { // Is JSON object + if (recipientAddress.hasOwnProperty('address')) { + return Address.createFromRawAddress(recipientAddress.address); + } else if (recipientAddress.hasOwnProperty('id')) { + return new NamespaceId(recipientAddress.id); } } - throw new Error(`Recipient: ${recipient} type is not recognised`); + throw new Error(`Recipient: ${recipientAddress} type is not recognised`); }; /** @@ -500,17 +500,17 @@ export const extractMosaics = (mosaics: any): Mosaic[] => { return mosaics.map((mosaicDTO) => { // convert ID to UInt8 bytes array and get first byte (most significant byte) - const uint64 = new Id(mosaicDTO.id); - const bytes = convert.hexToUint8(UInt64Library.toHex(uint64.toDTO())); + const bytes = convert.hexToUint8(mosaicDTO.id).reverse(); const byte0 = bytes[0]; // if most significant bit of byte 0 is set, then we have a namespaceId if ((byte0 & 128) === 128) { - return new Mosaic(new NamespaceId(mosaicDTO.id), new UInt64(mosaicDTO.amount)); + const namespaceId = new NamespaceId(UInt64.fromHex(mosaicDTO.id).toDTO()); + return new Mosaic(namespaceId, UInt64.fromNumericString(mosaicDTO.amount)); } // most significant bit of byte 0 is not set => mosaicId - return new Mosaic(new MosaicId(mosaicDTO.id), new UInt64(mosaicDTO.amount)); + return new Mosaic(new MosaicId(mosaicDTO.id), UInt64.fromNumericString(mosaicDTO.amount)); }); }; diff --git a/src/infrastructure/transaction/SerializeTransactionToJSON.ts b/src/infrastructure/transaction/SerializeTransactionToJSON.ts index 0a7a35ea6f..291c90e67e 100644 --- a/src/infrastructure/transaction/SerializeTransactionToJSON.ts +++ b/src/infrastructure/transaction/SerializeTransactionToJSON.ts @@ -48,7 +48,7 @@ export const SerializeTransactionToJSON = (transaction: Transaction): any => { switch (transaction.type) { case TransactionType.LINK_ACCOUNT: return { - remoteAccountKey: (transaction as AccountLinkTransaction).remoteAccountKey, + remotePublicKey: (transaction as AccountLinkTransaction).remotePublicKey, linkAction: (transaction as AccountLinkTransaction).linkAction, }; case TransactionType.ADDRESS_ALIAS: @@ -147,18 +147,18 @@ export const SerializeTransactionToJSON = (transaction: Transaction): any => { duration: (transaction as SecretLockTransaction).duration.toDTO(), hashAlgorithm: (transaction as SecretLockTransaction).hashType, secret: (transaction as SecretLockTransaction).secret, - recipient: (transaction as SecretLockTransaction).recipient.toDTO(), + recipientAddress: (transaction as SecretLockTransaction).recipientAddress.toDTO(), }; case TransactionType.SECRET_PROOF: return { hashAlgorithm: (transaction as SecretProofTransaction).hashType, secret: (transaction as SecretProofTransaction).secret, - recipient: (transaction as SecretProofTransaction).recipient.toDTO(), + recipientAddress: (transaction as SecretProofTransaction).recipientAddress.toDTO(), proof: (transaction as SecretProofTransaction).proof, }; case TransactionType.TRANSFER: return { - recipient: (transaction as TransferTransaction).recipient.toDTO(), + recipientAddress: (transaction as TransferTransaction).recipientAddress.toDTO(), mosaics: (transaction as TransferTransaction).mosaics.map((mosaic) => { return mosaic.toDTO(); }), diff --git a/src/model/UInt64.ts b/src/model/UInt64.ts index 61048f0170..bf0e54af96 100644 --- a/src/model/UInt64.ts +++ b/src/model/UInt64.ts @@ -14,6 +14,7 @@ * limitations under the License. */ +import * as Long from 'long'; import { RawUInt64 as uint64 } from '../core/format'; /** @@ -53,6 +54,19 @@ export class UInt64 { return new UInt64(dto); } + /** + * Parses a numeric string into a UInt64. + * @param {string} input A numeric string. + * @returns {module:coders/uint64~uint64} The uint64 representation of the input. + */ + public static fromNumericString(input: string): UInt64 { + const input_long = Long.fromString(input, true); + if (! /^\d+$/.test(input) || (input.substr(0, 1) === '0' && input.length > 1) || !Long.isLong(input_long)) { + throw new Error('Input string is not a valid numeric string'); + } + + return new UInt64([input_long.getLowBitsUnsigned(), input_long.getHighBitsUnsigned()]); + } /** * Constructor * @param uintArray diff --git a/src/model/receipt/BalanceChangeReceipt.ts b/src/model/receipt/BalanceChangeReceipt.ts index ecf450b4bc..facda63e4e 100644 --- a/src/model/receipt/BalanceChangeReceipt.ts +++ b/src/model/receipt/BalanceChangeReceipt.ts @@ -28,7 +28,7 @@ export class BalanceChangeReceipt extends Receipt { /** * Balance change expiry receipt - * @param account - The target account public account. + * @param targetPublicAccount - The target account public account. * @param mosaicId - The mosaic id. * @param amount - The amount of mosaic. * @param version - The receipt version @@ -37,9 +37,9 @@ export class BalanceChangeReceipt extends Receipt { */ constructor( /** - * The target account public account. + * The target targetPublicKey public account. */ - public readonly account: PublicAccount, + public readonly targetPublicAccount: PublicAccount, /** * The mosaic id. */ diff --git a/src/model/receipt/BalanceTransferReceipt.ts b/src/model/receipt/BalanceTransferReceipt.ts index 5bef0ab084..4111fbc50c 100644 --- a/src/model/receipt/BalanceTransferReceipt.ts +++ b/src/model/receipt/BalanceTransferReceipt.ts @@ -31,7 +31,7 @@ export class BalanceTransferReceipt extends Receipt { /** * Balance transfer expiry receipt * @param sender - The public account of the sender. - * @param recipient - The mosaic recipient address. + * @param recipientAddress - The mosaic recipient address. * @param mosaicId - The mosaic id. * @param amount - The amount of mosaic. * @param version - The receipt version @@ -46,7 +46,7 @@ export class BalanceTransferReceipt extends Receipt { /** * The mosaic recipient address. */ - public readonly recipient: Address | NamespaceId, + public readonly recipientAddress: Address | NamespaceId, /** * The mosaic id. */ diff --git a/src/model/receipt/ResolutionStatement.ts b/src/model/receipt/ResolutionStatement.ts index 46fc6eb576..da899710cb 100644 --- a/src/model/receipt/ResolutionStatement.ts +++ b/src/model/receipt/ResolutionStatement.ts @@ -16,8 +16,7 @@ import { Address } from '../account/Address'; import { MosaicId } from '../mosaic/MosaicId'; -import { Receipt } from './Receipt'; -import { ReceiptType } from './ReceiptType'; +import { UInt64 } from '../UInt64'; import { ResolutionEntry } from './ResolutionEntry'; /** @@ -37,7 +36,7 @@ export class ResolutionStatement { /** * The block height. */ - public readonly height: number[], + public readonly height: UInt64, /** * An unresolved address or unresolved mosaicId. */ diff --git a/src/model/receipt/TransactionStatement.ts b/src/model/receipt/TransactionStatement.ts index 24df0135e6..7e4092e79a 100644 --- a/src/model/receipt/TransactionStatement.ts +++ b/src/model/receipt/TransactionStatement.ts @@ -14,6 +14,7 @@ * limitations under the License. */ +import { UInt64 } from '../UInt64'; import { Receipt } from './Receipt'; import { ReceiptSource } from './ReceiptSource'; @@ -35,7 +36,7 @@ export class TransactionStatement { /** * The block height. */ - public readonly height: number[], + public readonly height: UInt64, /** * The receipt source. */ diff --git a/src/model/transaction/AccountAddressRestrictionTransaction.ts b/src/model/transaction/AccountAddressRestrictionTransaction.ts index 82c70a84f3..3ff874c446 100644 --- a/src/model/transaction/AccountAddressRestrictionTransaction.ts +++ b/src/model/transaction/AccountAddressRestrictionTransaction.ts @@ -97,7 +97,7 @@ export class AccountAddressRestrictionTransaction extends Transaction { signSchema: SignSchema = SignSchema.SHA3): Transaction | InnerTransaction { const builder = isEmbedded ? EmbeddedAccountAddressRestrictionTransactionBuilder.loadFromBinary(Convert.hexToUint8(payload)) : AccountAddressRestrictionTransactionBuilder.loadFromBinary(Convert.hexToUint8(payload)); - const signer = Convert.uint8ToHex(builder.getSignerPublicKey().key); + const signerPublicKey = Convert.uint8ToHex(builder.getSignerPublicKey().key); const networkType = Convert.hexToUint8(builder.getVersion().toString(16))[0]; const transaction = AccountAddressRestrictionTransaction.create( isEmbedded ? Deadline.create() : Deadline.createFromDTO( @@ -112,7 +112,8 @@ export class AccountAddressRestrictionTransaction extends Transaction { networkType, isEmbedded ? new UInt64([0, 0]) : new UInt64((builder as AccountAddressRestrictionTransactionBuilder).fee.amount), ); - return isEmbedded ? transaction.toAggregate(PublicAccount.createFromPublicKey(signer, networkType, signSchema)) : transaction; + return isEmbedded ? + transaction.toAggregate(PublicAccount.createFromPublicKey(signerPublicKey, networkType, signSchema)) : transaction; } /** diff --git a/src/model/transaction/AccountLinkTransaction.ts b/src/model/transaction/AccountLinkTransaction.ts index ad1d67ab7e..e15e56929e 100644 --- a/src/model/transaction/AccountLinkTransaction.ts +++ b/src/model/transaction/AccountLinkTransaction.ts @@ -42,13 +42,13 @@ export class AccountLinkTransaction extends Transaction { /** * Create a link account transaction object * @param deadline - The deadline to include the transaction. - * @param remoteAccountKey - The public key of the remote account. + * @param remotePublicKey - The public key of the remote account. * @param linkAction - The account link action. * @param maxFee - (Optional) Max fee defined by the sender * @returns {AccountLinkTransaction} */ public static create(deadline: Deadline, - remoteAccountKey: string, + remotePublicKey: string, linkAction: LinkAction, networkType: NetworkType, maxFee: UInt64 = new UInt64([0, 0])): AccountLinkTransaction { @@ -56,7 +56,7 @@ export class AccountLinkTransaction extends Transaction { TransactionVersion.LINK_ACCOUNT, deadline, maxFee, - remoteAccountKey, + remotePublicKey, linkAction); } @@ -65,7 +65,7 @@ export class AccountLinkTransaction extends Transaction { * @param version * @param deadline * @param maxFee - * @param remoteAccountKey + * @param remotePublicKey * @param linkAction * @param signature * @param signer @@ -78,7 +78,7 @@ export class AccountLinkTransaction extends Transaction { /** * The public key of the remote account. */ - public readonly remoteAccountKey: string, + public readonly remotePublicKey: string, /** * The account link action. */ @@ -101,7 +101,7 @@ export class AccountLinkTransaction extends Transaction { signSchema: SignSchema = SignSchema.SHA3): Transaction | InnerTransaction { const builder = isEmbedded ? EmbeddedAccountLinkTransactionBuilder.loadFromBinary(Convert.hexToUint8(payload)) : AccountLinkTransactionBuilder.loadFromBinary(Convert.hexToUint8(payload)); - const signer = Convert.uint8ToHex(builder.getSignerPublicKey().key); + const signerPublicKey = Convert.uint8ToHex(builder.getSignerPublicKey().key); const networkType = Convert.hexToUint8(builder.getVersion().toString(16))[0]; const transaction = AccountLinkTransaction.create( isEmbedded ? Deadline.create() : Deadline.createFromDTO((builder as AccountLinkTransactionBuilder).getDeadline().timestamp), @@ -110,7 +110,8 @@ export class AccountLinkTransaction extends Transaction { networkType, isEmbedded ? new UInt64([0, 0]) : new UInt64((builder as AccountLinkTransactionBuilder).fee.amount), ); - return isEmbedded ? transaction.toAggregate(PublicAccount.createFromPublicKey(signer, networkType, signSchema)) : transaction; + return isEmbedded ? + transaction.toAggregate(PublicAccount.createFromPublicKey(signerPublicKey, networkType, signSchema)) : transaction; } /** @@ -144,7 +145,7 @@ export class AccountLinkTransaction extends Transaction { TransactionType.LINK_ACCOUNT.valueOf(), new AmountDto(this.maxFee.toDTO()), new TimestampDto(this.deadline.toDTO()), - new KeyDto(Convert.hexToUint8(this.remoteAccountKey)), + new KeyDto(Convert.hexToUint8(this.remotePublicKey)), this.linkAction.valueOf(), ); return transactionBuilder.serialize(); @@ -159,7 +160,7 @@ export class AccountLinkTransaction extends Transaction { new KeyDto(Convert.hexToUint8(this.signer!.publicKey)), this.versionToDTO(), TransactionType.LINK_ACCOUNT.valueOf(), - new KeyDto(Convert.hexToUint8(this.remoteAccountKey)), + new KeyDto(Convert.hexToUint8(this.remotePublicKey)), this.linkAction.valueOf(), ); return transactionBuilder.serialize(); diff --git a/src/model/transaction/AccountMetadataTransaction.ts b/src/model/transaction/AccountMetadataTransaction.ts index 5065687eab..90b7c0c349 100644 --- a/src/model/transaction/AccountMetadataTransaction.ts +++ b/src/model/transaction/AccountMetadataTransaction.ts @@ -119,7 +119,7 @@ export class AccountMetadataTransaction extends Transaction { signSchema: SignSchema = SignSchema.SHA3): Transaction | InnerTransaction { const builder = isEmbedded ? EmbeddedAccountMetadataTransactionBuilder.loadFromBinary(Convert.hexToUint8(payload)) : AccountMetadataTransactionBuilder.loadFromBinary(Convert.hexToUint8(payload)); - const signer = Convert.uint8ToHex(builder.getSignerPublicKey().key); + const signerPublicKey = Convert.uint8ToHex(builder.getSignerPublicKey().key); const networkType = Convert.hexToUint8(builder.getVersion().toString(16))[0]; const transaction = AccountMetadataTransaction.create( isEmbedded ? Deadline.create() : Deadline.createFromDTO((builder as AccountMetadataTransactionBuilder).getDeadline().timestamp), @@ -130,7 +130,8 @@ export class AccountMetadataTransaction extends Transaction { networkType, isEmbedded ? new UInt64([0, 0]) : new UInt64((builder as AccountMetadataTransactionBuilder).fee.amount), ); - return isEmbedded ? transaction.toAggregate(PublicAccount.createFromPublicKey(signer, networkType, signSchema)) : transaction; + return isEmbedded ? + transaction.toAggregate(PublicAccount.createFromPublicKey(signerPublicKey, networkType, signSchema)) : transaction; } /** diff --git a/src/model/transaction/AccountMosaicRestrictionTransaction.ts b/src/model/transaction/AccountMosaicRestrictionTransaction.ts index 836eaeea80..af24e4164d 100644 --- a/src/model/transaction/AccountMosaicRestrictionTransaction.ts +++ b/src/model/transaction/AccountMosaicRestrictionTransaction.ts @@ -97,7 +97,7 @@ export class AccountMosaicRestrictionTransaction extends Transaction { signSchema: SignSchema = SignSchema.SHA3): Transaction | InnerTransaction { const builder = isEmbedded ? EmbeddedAccountMosaicRestrictionTransactionBuilder.loadFromBinary(Convert.hexToUint8(payload)) : AccountMosaicRestrictionTransactionBuilder.loadFromBinary(Convert.hexToUint8(payload)); - const signer = Convert.uint8ToHex(builder.getSignerPublicKey().key); + const signerPublicKey = Convert.uint8ToHex(builder.getSignerPublicKey().key); const networkType = Convert.hexToUint8(builder.getVersion().toString(16))[0]; const transaction = AccountMosaicRestrictionTransaction.create( isEmbedded ? Deadline.create() : Deadline.createFromDTO( @@ -112,7 +112,8 @@ export class AccountMosaicRestrictionTransaction extends Transaction { networkType, isEmbedded ? new UInt64([0, 0]) : new UInt64((builder as AccountMosaicRestrictionTransactionBuilder).fee.amount), ); - return isEmbedded ? transaction.toAggregate(PublicAccount.createFromPublicKey(signer, networkType, signSchema)) : transaction; + return isEmbedded ? + transaction.toAggregate(PublicAccount.createFromPublicKey(signerPublicKey, networkType, signSchema)) : transaction; } /** diff --git a/src/model/transaction/AccountRestrictionModification.ts b/src/model/transaction/AccountRestrictionModification.ts index c928aa0515..30c1e8a442 100644 --- a/src/model/transaction/AccountRestrictionModification.ts +++ b/src/model/transaction/AccountRestrictionModification.ts @@ -41,22 +41,22 @@ export class AccountRestrictionModification { /** * Create an address filter for account restriction modification * @param modificationType - modification type. 0: Add, 1: Remove - * @param address - modification value (Address) + * @param value - modification value (Address) * @returns {AccountRestrictionModification} */ public static createForAddress(modificationType: AccountRestrictionModificationAction, - address: Address): AccountRestrictionModification { - return new AccountRestrictionModification(modificationType, address.plain()); + value: Address): AccountRestrictionModification { + return new AccountRestrictionModification(modificationType, value.plain()); } /** * Create an mosaic filter for account restriction modification * @param modificationType - modification type. 0: Add, 1: Remove - * @param mosaicId - modification value (Mosaic) + * @param value - modification value (Mosaic) * @returns {AccountRestrictionModification} */ public static createForMosaic(modificationType: AccountRestrictionModificationAction, - mosaicId: MosaicId): AccountRestrictionModification { - return new AccountRestrictionModification(modificationType, mosaicId.id.toDTO()); + value: MosaicId): AccountRestrictionModification { + return new AccountRestrictionModification(modificationType, value.id.toDTO()); } /** @@ -66,8 +66,8 @@ export class AccountRestrictionModification { * @returns {AccountRestrictionModification} */ public static createForOperation(modificationType: AccountRestrictionModificationAction, - operation: number): AccountRestrictionModification { - return new AccountRestrictionModification(modificationType, operation); + value: number): AccountRestrictionModification { + return new AccountRestrictionModification(modificationType, value); } /** @@ -76,7 +76,7 @@ export class AccountRestrictionModification { toDTO() { return { value: this.value, - type: this.modificationType, + modificationAction: this.modificationType, }; } } diff --git a/src/model/transaction/AddressAliasTransaction.ts b/src/model/transaction/AddressAliasTransaction.ts index ef10ab183c..f5e530baed 100644 --- a/src/model/transaction/AddressAliasTransaction.ts +++ b/src/model/transaction/AddressAliasTransaction.ts @@ -115,7 +115,7 @@ export class AddressAliasTransaction extends Transaction { signSchema: SignSchema = SignSchema.SHA3): Transaction | InnerTransaction { const builder = isEmbedded ? EmbeddedAddressAliasTransactionBuilder.loadFromBinary(Convert.hexToUint8(payload)) : AddressAliasTransactionBuilder.loadFromBinary(Convert.hexToUint8(payload)); - const signer = Convert.uint8ToHex(builder.getSignerPublicKey().key); + const signerPublicKey = Convert.uint8ToHex(builder.getSignerPublicKey().key); const networkType = Convert.hexToUint8(builder.getVersion().toString(16))[0]; const transaction = AddressAliasTransaction.create( isEmbedded ? Deadline.create() : Deadline.createFromDTO((builder as AddressAliasTransactionBuilder).getDeadline().timestamp), @@ -126,7 +126,8 @@ export class AddressAliasTransaction extends Transaction { networkType, isEmbedded ? new UInt64([0, 0]) : new UInt64((builder as AddressAliasTransactionBuilder).fee.amount), ); - return isEmbedded ? transaction.toAggregate(PublicAccount.createFromPublicKey(signer, networkType, signSchema)) : transaction; + return isEmbedded ? + transaction.toAggregate(PublicAccount.createFromPublicKey(signerPublicKey, networkType, signSchema)) : transaction; } /** diff --git a/src/model/transaction/AggregateTransaction.ts b/src/model/transaction/AggregateTransaction.ts index 0f473c5667..83b02def86 100644 --- a/src/model/transaction/AggregateTransaction.ts +++ b/src/model/transaction/AggregateTransaction.ts @@ -124,17 +124,6 @@ export class AggregateTransaction extends Transaction { ); } - /** - * @description add inner transactions to current list - * @param {InnerTransaction[]} transaction - * @returns {AggregateTransaction} - * @memberof AggregateTransaction - */ - public addTransactions(transactions: InnerTransaction[]): AggregateTransaction { - const innerTransactions = this.innerTransactions.concat(transactions); - return Object.assign({__proto__: Object.getPrototypeOf(this)}, this, {innerTransactions}); - } - /** * Create a transaction object from payload * @param {string} payload Binary payload @@ -195,6 +184,18 @@ export class AggregateTransaction extends Transaction { new UInt64(builder.fee.amount), ); } + + /** + * @description add inner transactions to current list + * @param {InnerTransaction[]} transaction + * @returns {AggregateTransaction} + * @memberof AggregateTransaction + */ + public addTransactions(transactions: InnerTransaction[]): AggregateTransaction { + const innerTransactions = this.innerTransactions.concat(transactions); + return Object.assign({__proto__: Object.getPrototypeOf(this)}, this, {innerTransactions}); + } + /** * @internal * Sign transaction with cosignatories creating a new SignedTransaction @@ -244,7 +245,7 @@ export class AggregateTransaction extends Transaction { const signedTransaction = this.signWith(initiatorAccount, generationHash, signSchema); let signedPayload = signedTransaction.payload; cosignatureSignedTransactions.forEach((cosignedTransaction) => { - signedPayload += cosignedTransaction.signer + cosignedTransaction.signature; + signedPayload += cosignedTransaction.signerPublicKey + cosignedTransaction.signature; }); // Calculate new size diff --git a/src/model/transaction/AggregateTransactionCosignature.ts b/src/model/transaction/AggregateTransactionCosignature.ts index 59930f4989..4e9fc3a33b 100644 --- a/src/model/transaction/AggregateTransactionCosignature.ts +++ b/src/model/transaction/AggregateTransactionCosignature.ts @@ -42,7 +42,7 @@ export class AggregateTransactionCosignature { public toDTO() { return { signature: this.signature, - signer: this.signer.toDTO(), + signerPublicKey: this.signer.toDTO(), }; } } diff --git a/src/model/transaction/CosignatureSignedTransaction.ts b/src/model/transaction/CosignatureSignedTransaction.ts index 3d20586663..2aca6cbe99 100644 --- a/src/model/transaction/CosignatureSignedTransaction.ts +++ b/src/model/transaction/CosignatureSignedTransaction.ts @@ -21,7 +21,7 @@ export class CosignatureSignedTransaction { /** * @param parentHash * @param signature - * @param signer + * @param signerPublicKey */ constructor( /** @@ -33,7 +33,7 @@ export class CosignatureSignedTransaction { */ public readonly signature: string, /** - * The signer of the transaction. + * The signer publicKey of the transaction. */ - public readonly signer: string) {} + public readonly signerPublicKey: string) {} } diff --git a/src/model/transaction/Deadline.ts b/src/model/transaction/Deadline.ts index 8d2e216e03..b912a03ac0 100644 --- a/src/model/transaction/Deadline.ts +++ b/src/model/transaction/Deadline.ts @@ -58,8 +58,9 @@ export class Deadline { * @param value * @returns {Deadline} */ - public static createFromDTO(value: number[]): Deadline { - const dateSeconds = (new UInt64(value)).compact(); + public static createFromDTO(value: string | number[]): Deadline { + const uint64Value = 'string' === typeof value ? UInt64.fromNumericString(value) : new UInt64(value); + const dateSeconds = uint64Value.compact(); const deadline = LocalDateTime.ofInstant( Instant.ofEpochMilli(Math.round(dateSeconds + Deadline.timestampNemesisBlock * 1000)), ZoneId.SYSTEM); diff --git a/src/model/transaction/LockFundsTransaction.ts b/src/model/transaction/LockFundsTransaction.ts index 816ccf1a41..38f1615fbf 100644 --- a/src/model/transaction/LockFundsTransaction.ts +++ b/src/model/transaction/LockFundsTransaction.ts @@ -126,7 +126,7 @@ export class LockFundsTransaction extends Transaction { signSchema: SignSchema = SignSchema.SHA3): Transaction | InnerTransaction { const builder = isEmbedded ? EmbeddedHashLockTransactionBuilder.loadFromBinary(Convert.hexToUint8(payload)) : HashLockTransactionBuilder.loadFromBinary(Convert.hexToUint8(payload)); - const signer = Convert.uint8ToHex(builder.getSignerPublicKey().key); + const signerPublicKey = Convert.uint8ToHex(builder.getSignerPublicKey().key); const networkType = Convert.hexToUint8(builder.getVersion().toString(16))[0]; const transaction = LockFundsTransaction.create( isEmbedded ? Deadline.create() : Deadline.createFromDTO((builder as HashLockTransactionBuilder).getDeadline().timestamp), @@ -140,7 +140,8 @@ export class LockFundsTransaction extends Transaction { networkType, isEmbedded ? new UInt64([0, 0]) : new UInt64((builder as HashLockTransactionBuilder).fee.amount), ); - return isEmbedded ? transaction.toAggregate(PublicAccount.createFromPublicKey(signer, networkType, signSchema)) : transaction; + return isEmbedded ? + transaction.toAggregate(PublicAccount.createFromPublicKey(signerPublicKey, networkType, signSchema)) : transaction; } /** diff --git a/src/model/transaction/MosaicAddressRestrictionTransaction.ts b/src/model/transaction/MosaicAddressRestrictionTransaction.ts index f13d59a5ac..d1c5f82b33 100644 --- a/src/model/transaction/MosaicAddressRestrictionTransaction.ts +++ b/src/model/transaction/MosaicAddressRestrictionTransaction.ts @@ -133,7 +133,7 @@ export class MosaicAddressRestrictionTransaction extends Transaction { signSchema: SignSchema = SignSchema.SHA3): Transaction | InnerTransaction { const builder = isEmbedded ? EmbeddedMosaicAddressRestrictionTransactionBuilder.loadFromBinary(Convert.hexToUint8(payload)) : MosaicAddressRestrictionTransactionBuilder.loadFromBinary(Convert.hexToUint8(payload)); - const signer = Convert.uint8ToHex(builder.getSignerPublicKey().key); + const signerPublicKey = Convert.uint8ToHex(builder.getSignerPublicKey().key); const networkType = Convert.hexToUint8(builder.getVersion().toString(16))[0]; const transaction = MosaicAddressRestrictionTransaction.create( isEmbedded ? Deadline.create() : Deadline.createFromDTO( @@ -146,7 +146,8 @@ export class MosaicAddressRestrictionTransaction extends Transaction { networkType, isEmbedded ? new UInt64([0, 0]) : new UInt64((builder as MosaicAddressRestrictionTransactionBuilder).fee.amount), ); - return isEmbedded ? transaction.toAggregate(PublicAccount.createFromPublicKey(signer, networkType, signSchema)) : transaction; + return isEmbedded ? + transaction.toAggregate(PublicAccount.createFromPublicKey(signerPublicKey, networkType, signSchema)) : transaction; } /** diff --git a/src/model/transaction/MosaicAliasTransaction.ts b/src/model/transaction/MosaicAliasTransaction.ts index 13c6b06deb..b31f47564e 100644 --- a/src/model/transaction/MosaicAliasTransaction.ts +++ b/src/model/transaction/MosaicAliasTransaction.ts @@ -112,7 +112,7 @@ export class MosaicAliasTransaction extends Transaction { signSchema: SignSchema = SignSchema.SHA3): Transaction | InnerTransaction { const builder = isEmbedded ? EmbeddedMosaicAliasTransactionBuilder.loadFromBinary(Convert.hexToUint8(payload)) : MosaicAliasTransactionBuilder.loadFromBinary(Convert.hexToUint8(payload)); - const signer = Convert.uint8ToHex(builder.getSignerPublicKey().key); + const signerPublicKey = Convert.uint8ToHex(builder.getSignerPublicKey().key); const networkType = Convert.hexToUint8(builder.getVersion().toString(16))[0]; const transaction = MosaicAliasTransaction.create( isEmbedded ? Deadline.create() : Deadline.createFromDTO((builder as MosaicAliasTransactionBuilder).getDeadline().timestamp), @@ -122,7 +122,8 @@ export class MosaicAliasTransaction extends Transaction { networkType, isEmbedded ? new UInt64([0, 0]) : new UInt64((builder as MosaicAliasTransactionBuilder).fee.amount), ); - return isEmbedded ? transaction.toAggregate(PublicAccount.createFromPublicKey(signer, networkType, signSchema)) : transaction; + return isEmbedded ? + transaction.toAggregate(PublicAccount.createFromPublicKey(signerPublicKey, networkType, signSchema)) : transaction; } /** diff --git a/src/model/transaction/MosaicDefinitionTransaction.ts b/src/model/transaction/MosaicDefinitionTransaction.ts index 470f83dceb..8447738813 100644 --- a/src/model/transaction/MosaicDefinitionTransaction.ts +++ b/src/model/transaction/MosaicDefinitionTransaction.ts @@ -118,7 +118,7 @@ export class MosaicDefinitionTransaction extends Transaction { signSchema: SignSchema = SignSchema.SHA3): Transaction | InnerTransaction { const builder = isEmbedded ? EmbeddedMosaicDefinitionTransactionBuilder.loadFromBinary(Convert.hexToUint8(payload)) : MosaicDefinitionTransactionBuilder.loadFromBinary(Convert.hexToUint8(payload)); - const signer = Convert.uint8ToHex(builder.getSignerPublicKey().key); + const signerPublicKey = Convert.uint8ToHex(builder.getSignerPublicKey().key); const networkType = Convert.hexToUint8(builder.getVersion().toString(16))[0]; const transaction = MosaicDefinitionTransaction.create( isEmbedded ? Deadline.create() : Deadline.createFromDTO( @@ -135,7 +135,8 @@ export class MosaicDefinitionTransaction extends Transaction { networkType, isEmbedded ? new UInt64([0, 0]) : new UInt64((builder as MosaicDefinitionTransactionBuilder).fee.amount), ); - return isEmbedded ? transaction.toAggregate(PublicAccount.createFromPublicKey(signer, networkType, signSchema)) : transaction; + return isEmbedded ? + transaction.toAggregate(PublicAccount.createFromPublicKey(signerPublicKey, networkType, signSchema)) : transaction; } /** diff --git a/src/model/transaction/MosaicGlobalRestrictionTransaction.ts b/src/model/transaction/MosaicGlobalRestrictionTransaction.ts index 9f771f79a8..1b49985af5 100644 --- a/src/model/transaction/MosaicGlobalRestrictionTransaction.ts +++ b/src/model/transaction/MosaicGlobalRestrictionTransaction.ts @@ -150,7 +150,7 @@ export class MosaicGlobalRestrictionTransaction extends Transaction { signSchema: SignSchema = SignSchema.SHA3): Transaction | InnerTransaction { const builder = isEmbedded ? EmbeddedMosaicGlobalRestrictionTransactionBuilder.loadFromBinary(Convert.hexToUint8(payload)) : MosaicGlobalRestrictionTransactionBuilder.loadFromBinary(Convert.hexToUint8(payload)); - const signer = Convert.uint8ToHex(builder.getSignerPublicKey().key); + const signerPublicKey = Convert.uint8ToHex(builder.getSignerPublicKey().key); const networkType = Convert.hexToUint8(builder.getVersion().toString(16))[0]; const transaction = MosaicGlobalRestrictionTransaction.create( isEmbedded ? Deadline.create() : Deadline.createFromDTO( @@ -165,7 +165,8 @@ export class MosaicGlobalRestrictionTransaction extends Transaction { networkType, isEmbedded ? new UInt64([0, 0]) : new UInt64((builder as MosaicGlobalRestrictionTransactionBuilder).fee.amount), ); - return isEmbedded ? transaction.toAggregate(PublicAccount.createFromPublicKey(signer, networkType, signSchema)) : transaction; + return isEmbedded ? + transaction.toAggregate(PublicAccount.createFromPublicKey(signerPublicKey, networkType, signSchema)) : transaction; } /** diff --git a/src/model/transaction/MosaicMetadataTransaction.ts b/src/model/transaction/MosaicMetadataTransaction.ts index 37688f395c..b85bc36de7 100644 --- a/src/model/transaction/MosaicMetadataTransaction.ts +++ b/src/model/transaction/MosaicMetadataTransaction.ts @@ -129,7 +129,7 @@ export class MosaicMetadataTransaction extends Transaction { signSchema: SignSchema = SignSchema.SHA3): Transaction | InnerTransaction { const builder = isEmbedded ? EmbeddedMosaicMetadataTransactionBuilder.loadFromBinary(Convert.hexToUint8(payload)) : MosaicMetadataTransactionBuilder.loadFromBinary(Convert.hexToUint8(payload)); - const signer = Convert.uint8ToHex(builder.getSignerPublicKey().key); + const signerPublicKey = Convert.uint8ToHex(builder.getSignerPublicKey().key); const networkType = Convert.hexToUint8(builder.getVersion().toString(16))[0]; const transaction = MosaicMetadataTransaction.create( isEmbedded ? Deadline.create() : Deadline.createFromDTO((builder as MosaicMetadataTransactionBuilder).getDeadline().timestamp), @@ -141,7 +141,8 @@ export class MosaicMetadataTransaction extends Transaction { networkType, isEmbedded ? new UInt64([0, 0]) : new UInt64((builder as MosaicMetadataTransactionBuilder).fee.amount), ); - return isEmbedded ? transaction.toAggregate(PublicAccount.createFromPublicKey(signer, networkType, signSchema)) : transaction; + return isEmbedded ? + transaction.toAggregate(PublicAccount.createFromPublicKey(signerPublicKey, networkType, signSchema)) : transaction; } /** diff --git a/src/model/transaction/MosaicSupplyChangeTransaction.ts b/src/model/transaction/MosaicSupplyChangeTransaction.ts index cb241ba6e8..bfed50a0a8 100644 --- a/src/model/transaction/MosaicSupplyChangeTransaction.ts +++ b/src/model/transaction/MosaicSupplyChangeTransaction.ts @@ -113,7 +113,7 @@ export class MosaicSupplyChangeTransaction extends Transaction { signSchema: SignSchema = SignSchema.SHA3): Transaction | InnerTransaction { const builder = isEmbedded ? EmbeddedMosaicSupplyChangeTransactionBuilder.loadFromBinary(Convert.hexToUint8(payload)) : MosaicSupplyChangeTransactionBuilder.loadFromBinary(Convert.hexToUint8(payload)); - const signer = Convert.uint8ToHex(builder.getSignerPublicKey().key); + const signerPublicKey = Convert.uint8ToHex(builder.getSignerPublicKey().key); const networkType = Convert.hexToUint8(builder.getVersion().toString(16))[0]; const transaction = MosaicSupplyChangeTransaction.create( isEmbedded ? Deadline.create() : Deadline.createFromDTO( @@ -124,7 +124,8 @@ export class MosaicSupplyChangeTransaction extends Transaction { networkType, isEmbedded ? new UInt64([0, 0]) : new UInt64((builder as MosaicSupplyChangeTransactionBuilder).fee.amount), ); - return isEmbedded ? transaction.toAggregate(PublicAccount.createFromPublicKey(signer, networkType, signSchema)) : transaction; + return isEmbedded ? + transaction.toAggregate(PublicAccount.createFromPublicKey(signerPublicKey, networkType, signSchema)) : transaction; } /** diff --git a/src/model/transaction/MultisigAccountModificationTransaction.ts b/src/model/transaction/MultisigAccountModificationTransaction.ts index 6a754b69f8..680e1d71fb 100644 --- a/src/model/transaction/MultisigAccountModificationTransaction.ts +++ b/src/model/transaction/MultisigAccountModificationTransaction.ts @@ -115,7 +115,7 @@ export class MultisigAccountModificationTransaction extends Transaction { signSchema: SignSchema = SignSchema.SHA3): Transaction | InnerTransaction { const builder = isEmbedded ? EmbeddedMultisigAccountModificationTransactionBuilder.loadFromBinary(Convert.hexToUint8(payload)) : MultisigAccountModificationTransactionBuilder.loadFromBinary(Convert.hexToUint8(payload)); - const signer = Convert.uint8ToHex(builder.getSignerPublicKey().key); + const signerPublicKey = Convert.uint8ToHex(builder.getSignerPublicKey().key); const networkType = Convert.hexToUint8(builder.getVersion().toString(16))[0]; const transaction = MultisigAccountModificationTransaction.create( isEmbedded ? Deadline.create() : Deadline.createFromDTO( @@ -134,7 +134,8 @@ export class MultisigAccountModificationTransaction extends Transaction { networkType, isEmbedded ? new UInt64([0, 0]) : new UInt64((builder as MultisigAccountModificationTransactionBuilder).fee.amount), ); - return isEmbedded ? transaction.toAggregate(PublicAccount.createFromPublicKey(signer, networkType, signSchema)) : transaction; + return isEmbedded ? + transaction.toAggregate(PublicAccount.createFromPublicKey(signerPublicKey, networkType, signSchema)) : transaction; } /** diff --git a/src/model/transaction/NamespaceMetadataTransaction.ts b/src/model/transaction/NamespaceMetadataTransaction.ts index 043d575a16..a90e8717d1 100644 --- a/src/model/transaction/NamespaceMetadataTransaction.ts +++ b/src/model/transaction/NamespaceMetadataTransaction.ts @@ -129,7 +129,7 @@ export class NamespaceMetadataTransaction extends Transaction { signSchema: SignSchema = SignSchema.SHA3): Transaction | InnerTransaction { const builder = isEmbedded ? EmbeddedNamespaceMetadataTransactionBuilder.loadFromBinary(Convert.hexToUint8(payload)) : NamespaceMetadataTransactionBuilder.loadFromBinary(Convert.hexToUint8(payload)); - const signer = Convert.uint8ToHex(builder.getSignerPublicKey().key); + const signerPublicKey = Convert.uint8ToHex(builder.getSignerPublicKey().key); const networkType = Convert.hexToUint8(builder.getVersion().toString(16))[0]; const transaction = NamespaceMetadataTransaction.create( isEmbedded ? Deadline.create() : @@ -142,7 +142,8 @@ export class NamespaceMetadataTransaction extends Transaction { networkType, isEmbedded ? new UInt64([0, 0]) : new UInt64((builder as NamespaceMetadataTransactionBuilder).fee.amount), ); - return isEmbedded ? transaction.toAggregate(PublicAccount.createFromPublicKey(signer, networkType, signSchema)) : transaction; + return isEmbedded ? + transaction.toAggregate(PublicAccount.createFromPublicKey(signerPublicKey, networkType, signSchema)) : transaction; } /** diff --git a/src/model/transaction/NamespaceRegistrationTransaction.ts b/src/model/transaction/NamespaceRegistrationTransaction.ts index e7355f24d0..75015f6b49 100644 --- a/src/model/transaction/NamespaceRegistrationTransaction.ts +++ b/src/model/transaction/NamespaceRegistrationTransaction.ts @@ -160,7 +160,7 @@ export class NamespaceRegistrationTransaction extends Transaction { const builder = isEmbedded ? EmbeddedNamespaceRegistrationTransactionBuilder.loadFromBinary(Convert.hexToUint8(payload)) : NamespaceRegistrationTransactionBuilder.loadFromBinary(Convert.hexToUint8(payload)); const namespaceType = builder.getRegistrationType().valueOf(); - const signer = Convert.uint8ToHex(builder.getSignerPublicKey().key); + const signerPublicKey = Convert.uint8ToHex(builder.getSignerPublicKey().key); const networkType = Convert.hexToUint8(builder.getVersion().toString(16))[0]; const transaction = namespaceType === NamespaceRegistrationType.RootNamespace ? NamespaceRegistrationTransaction.createRootNamespace( @@ -178,7 +178,8 @@ export class NamespaceRegistrationTransaction extends Transaction { networkType, isEmbedded ? new UInt64([0, 0]) : new UInt64((builder as NamespaceRegistrationTransactionBuilder).fee.amount), ); - return isEmbedded ? transaction.toAggregate(PublicAccount.createFromPublicKey(signer, networkType, signSchema)) : transaction; + return isEmbedded ? + transaction.toAggregate(PublicAccount.createFromPublicKey(signerPublicKey, networkType, signSchema)) : transaction; } /** diff --git a/src/model/transaction/SecretLockTransaction.ts b/src/model/transaction/SecretLockTransaction.ts index 367eedd940..f06be2630f 100644 --- a/src/model/transaction/SecretLockTransaction.ts +++ b/src/model/transaction/SecretLockTransaction.ts @@ -51,7 +51,7 @@ export class SecretLockTransaction extends Transaction { * @param duration - The funds lock duration. * @param hashType - The hash algorithm secret is generated with. * @param secret - The proof hashed. - * @param recipient - The recipient of the funds. + * @param recipientAddress - The recipient address of the funds. * @param networkType - The network type. * @param maxFee - (Optional) Max fee defined by the sender * @@ -62,7 +62,7 @@ export class SecretLockTransaction extends Transaction { duration: UInt64, hashType: HashType, secret: string, - recipient: Address, + recipientAddress: Address, networkType: NetworkType, maxFee: UInt64 = new UInt64([0, 0])): SecretLockTransaction { return new SecretLockTransaction( @@ -74,7 +74,7 @@ export class SecretLockTransaction extends Transaction { duration, hashType, secret, - recipient, + recipientAddress, ); } @@ -87,7 +87,7 @@ export class SecretLockTransaction extends Transaction { * @param duration * @param hashType * @param secret - * @param recipient + * @param recipientAddress * @param signature * @param signer * @param transactionInfo @@ -113,9 +113,9 @@ export class SecretLockTransaction extends Transaction { */ public readonly secret: string, /** - * The recipient of the funds. + * The recipientAddress of the funds. */ - public readonly recipient: Address, + public readonly recipientAddress: Address, signature?: string, signer?: PublicAccount, transactionInfo?: TransactionInfo) { @@ -137,7 +137,7 @@ export class SecretLockTransaction extends Transaction { signSchema: SignSchema = SignSchema.SHA3): Transaction | InnerTransaction { const builder = isEmbedded ? EmbeddedSecretLockTransactionBuilder.loadFromBinary(Convert.hexToUint8(payload)) : SecretLockTransactionBuilder.loadFromBinary(Convert.hexToUint8(payload)); - const signer = Convert.uint8ToHex(builder.getSignerPublicKey().key); + const signerPublicKey = Convert.uint8ToHex(builder.getSignerPublicKey().key); const networkType = Convert.hexToUint8(builder.getVersion().toString(16))[0]; const transaction = SecretLockTransaction.create( isEmbedded ? Deadline.create() : Deadline.createFromDTO( @@ -153,7 +153,8 @@ export class SecretLockTransaction extends Transaction { networkType, isEmbedded ? new UInt64([0, 0]) : new UInt64((builder as SecretLockTransactionBuilder).fee.amount), ); - return isEmbedded ? transaction.toAggregate(PublicAccount.createFromPublicKey(signer, networkType, signSchema)) : transaction; + return isEmbedded ? + transaction.toAggregate(PublicAccount.createFromPublicKey(signerPublicKey, networkType, signSchema)) : transaction; } /** @@ -207,7 +208,7 @@ export class SecretLockTransaction extends Transaction { new BlockDurationDto(this.duration.toDTO()), this.hashType.valueOf(), new Hash256Dto(this.getSecretByte()), - new UnresolvedAddressDto(RawAddress.stringToAddress(this.recipient.plain())), + new UnresolvedAddressDto(RawAddress.stringToAddress(this.recipientAddress.plain())), ); return transactionBuilder.serialize(); } @@ -226,7 +227,7 @@ export class SecretLockTransaction extends Transaction { new BlockDurationDto(this.duration.toDTO()), this.hashType.valueOf(), new Hash256Dto(this.getSecretByte()), - new UnresolvedAddressDto(RawAddress.stringToAddress(this.recipient.plain())), + new UnresolvedAddressDto(RawAddress.stringToAddress(this.recipientAddress.plain())), ); return transactionBuilder.serialize(); } diff --git a/src/model/transaction/SecretProofTransaction.ts b/src/model/transaction/SecretProofTransaction.ts index 1ae58c7228..f5b47109cf 100644 --- a/src/model/transaction/SecretProofTransaction.ts +++ b/src/model/transaction/SecretProofTransaction.ts @@ -45,7 +45,7 @@ export class SecretProofTransaction extends Transaction { * @param deadline - The deadline to include the transaction. * @param hashType - The hash algorithm secret is generated with. * @param secret - The seed proof hashed. - * @param recipient - UnresolvedAddress + * @param recipientAddress - UnresolvedAddress * @param proof - The seed proof. * @param networkType - The network type. * @param maxFee - (Optional) Max fee defined by the sender @@ -55,7 +55,7 @@ export class SecretProofTransaction extends Transaction { public static create(deadline: Deadline, hashType: HashType, secret: string, - recipient: Address, + recipientAddress: Address, proof: string, networkType: NetworkType, maxFee: UInt64 = new UInt64([0, 0])): SecretProofTransaction { @@ -66,7 +66,7 @@ export class SecretProofTransaction extends Transaction { maxFee, hashType, secret, - recipient, + recipientAddress, proof, ); } @@ -78,7 +78,7 @@ export class SecretProofTransaction extends Transaction { * @param maxFee * @param hashType * @param secret - * @param recipient + * @param recipientAddress * @param proof * @param signature * @param signer @@ -90,7 +90,7 @@ export class SecretProofTransaction extends Transaction { maxFee: UInt64, public readonly hashType: HashType, public readonly secret: string, - public readonly recipient: Address, + public readonly recipientAddress: Address, public readonly proof: string, signature?: string, signer?: PublicAccount, @@ -113,7 +113,7 @@ export class SecretProofTransaction extends Transaction { signSchema: SignSchema = SignSchema.SHA3): Transaction | InnerTransaction { const builder = isEmbedded ? EmbeddedSecretProofTransactionBuilder.loadFromBinary(Convert.hexToUint8(payload)) : SecretProofTransactionBuilder.loadFromBinary(Convert.hexToUint8(payload)); - const signer = Convert.uint8ToHex(builder.getSignerPublicKey().key); + const signerPublicKey = Convert.uint8ToHex(builder.getSignerPublicKey().key); const networkType = Convert.hexToUint8(builder.getVersion().toString(16))[0]; const transaction = SecretProofTransaction.create( isEmbedded ? Deadline.create() : Deadline.createFromDTO( @@ -125,7 +125,8 @@ export class SecretProofTransaction extends Transaction { networkType, isEmbedded ? new UInt64([0, 0]) : new UInt64((builder as SecretProofTransactionBuilder).fee.amount), ); - return isEmbedded ? transaction.toAggregate(PublicAccount.createFromPublicKey(signer, networkType, signSchema)) : transaction; + return isEmbedded ? + transaction.toAggregate(PublicAccount.createFromPublicKey(signerPublicKey, networkType, signSchema)) : transaction; } /** @@ -184,7 +185,7 @@ export class SecretProofTransaction extends Transaction { new TimestampDto(this.deadline.toDTO()), this.hashType.valueOf(), new Hash256Dto(this.getSecretByte()), - new UnresolvedAddressDto(RawAddress.stringToAddress(this.recipient.plain())), + new UnresolvedAddressDto(RawAddress.stringToAddress(this.recipientAddress.plain())), this.getProofByte(), ); return transactionBuilder.serialize(); @@ -201,7 +202,7 @@ export class SecretProofTransaction extends Transaction { TransactionType.SECRET_PROOF.valueOf(), this.hashType.valueOf(), new Hash256Dto(this.getSecretByte()), - new UnresolvedAddressDto(RawAddress.stringToAddress(this.recipient.plain())), + new UnresolvedAddressDto(RawAddress.stringToAddress(this.recipientAddress.plain())), this.getProofByte(), ); return transactionBuilder.serialize(); diff --git a/src/model/transaction/SignedTransaction.ts b/src/model/transaction/SignedTransaction.ts index 30150202f7..ea4a367cdf 100644 --- a/src/model/transaction/SignedTransaction.ts +++ b/src/model/transaction/SignedTransaction.ts @@ -38,9 +38,9 @@ export class SignedTransaction { */ public readonly hash: string, /** - * Transaction signer + * Transaction signerPublicKey */ - public readonly signer: string, + public readonly signerPublicKey: string, /** * Transaction type */ @@ -61,7 +61,7 @@ export class SignedTransaction { return { payload: this.payload, hash: this.hash, - signer: this.signer, + signerPublicKey: this.signerPublicKey, type: this.type, networkType: this.networkType, }; diff --git a/src/model/transaction/Transaction.ts b/src/model/transaction/Transaction.ts index 29d3ae1b3d..35f496d0cf 100644 --- a/src/model/transaction/Transaction.ts +++ b/src/model/transaction/Transaction.ts @@ -146,10 +146,10 @@ export abstract class Transaction { * @returns {Array.<*>} AggregateTransaction bytes */ public aggregateTransaction(): number[] { - const signer = Convert.hexToUint8(this.signer!.publicKey); + const signerPublicKey = Convert.hexToUint8(this.signer!.publicKey); let resultBytes = Array.from(this.generateBytes()); resultBytes.splice(0, 4 + 64 + 32); - resultBytes = Array.from(signer).concat(resultBytes); + resultBytes = Array.from(signerPublicKey).concat(resultBytes); resultBytes.splice(32 + 2 + 2, 16); return Array.from((new Uint8Array([ (resultBytes.length + 4 & 0x000000ff), @@ -249,7 +249,7 @@ export abstract class Transaction { public get size(): number { const byteSize = 4 // size + 64 // signature - + 32 // signer + + 32 // signerPublicKey + 2 // version + 2 // type + 8 // maxFee @@ -283,7 +283,7 @@ export abstract class Transaction { }; if (this.signer) { - Object.assign(commonTransactionObject, {signer: this.signer.publicKey}); + Object.assign(commonTransactionObject, {signerPublicKey: this.signer.publicKey}); } const childClassObject = SerializeTransactionToJSON(this); diff --git a/src/model/transaction/TransferTransaction.ts b/src/model/transaction/TransferTransaction.ts index 63e5909a70..c2d7d325f7 100644 --- a/src/model/transaction/TransferTransaction.ts +++ b/src/model/transaction/TransferTransaction.ts @@ -52,7 +52,7 @@ export class TransferTransaction extends Transaction { /** * Create a transfer transaction object * @param deadline - The deadline to include the transaction. - * @param recipient - The recipient of the transaction. + * @param recipientAddress - The recipient address of the transaction. * @param mosaics - The array of mosaics. * @param message - The transaction message. * @param networkType - The network type. @@ -60,7 +60,7 @@ export class TransferTransaction extends Transaction { * @returns {TransferTransaction} */ public static create(deadline: Deadline, - recipient: Address | NamespaceId, + recipientAddress: Address | NamespaceId, mosaics: Mosaic[], message: Message, networkType: NetworkType, @@ -69,7 +69,7 @@ export class TransferTransaction extends Transaction { TransactionVersion.TRANSFER, deadline, maxFee, - recipient, + recipientAddress, mosaics, message); } @@ -79,7 +79,7 @@ export class TransferTransaction extends Transaction { * @param version * @param deadline * @param maxFee - * @param recipient + * @param recipientAddress * @param mosaics * @param message * @param signature @@ -91,9 +91,9 @@ export class TransferTransaction extends Transaction { deadline: Deadline, maxFee: UInt64, /** - * The address of the recipient. + * The address of the recipient address. */ - public readonly recipient: Address | NamespaceId, + public readonly recipientAddress: Address | NamespaceId, /** * The array of Mosaic objects. */ @@ -122,7 +122,7 @@ export class TransferTransaction extends Transaction { TransferTransactionBuilder.loadFromBinary(Convert.hexToUint8(payload)); const messageType = builder.getMessage()[0]; const messageHex = Convert.uint8ToHex(builder.getMessage()).substring(2); - const signer = Convert.uint8ToHex(builder.getSignerPublicKey().key); + const signerPublicKey = Convert.uint8ToHex(builder.getSignerPublicKey().key); const networkType = Convert.hexToUint8(builder.getVersion().toString(16))[0]; const transaction = TransferTransaction.create( isEmbedded ? Deadline.create() : Deadline.createFromDTO( @@ -139,7 +139,8 @@ export class TransferTransaction extends Transaction { networkType, isEmbedded ? new UInt64([0, 0]) : new UInt64((builder as TransferTransactionBuilder).fee.amount), ); - return isEmbedded ? transaction.toAggregate(PublicAccount.createFromPublicKey(signer, networkType, signSchema)) : transaction; + return isEmbedded ? + transaction.toAggregate(PublicAccount.createFromPublicKey(signerPublicKey, networkType, signSchema)) : transaction; } /** @@ -149,13 +150,13 @@ export class TransferTransaction extends Transaction { */ public recipientToString(): string { - if (this.recipient instanceof NamespaceId) { + if (this.recipientAddress instanceof NamespaceId) { // namespaceId recipient, return hexadecimal notation - return (this.recipient as NamespaceId).toHex(); + return (this.recipientAddress as NamespaceId).toHex(); } // address recipient - return (this.recipient as Address).plain(); + return (this.recipientAddress as Address).plain(); } /** @@ -208,7 +209,7 @@ export class TransferTransaction extends Transaction { const byteSize = super.size; // recipient and number of mosaics are static byte size - const byteRecipient = 25; + const byteRecipientAddress = 25; const byteNumMosaics = 2; // read message payload size @@ -217,7 +218,7 @@ export class TransferTransaction extends Transaction { // mosaicId / namespaceId are written on 8 bytes const byteMosaics = 8 * this.mosaics.length; - return byteSize + byteRecipient + byteNumMosaics + bytePayload + byteMosaics; + return byteSize + byteRecipientAddress + byteNumMosaics + bytePayload + byteMosaics; } /** diff --git a/src/service/AggregateTransactionService.ts b/src/service/AggregateTransactionService.ts index 73a2a7b8d1..376b648d96 100644 --- a/src/service/AggregateTransactionService.ts +++ b/src/service/AggregateTransactionService.ts @@ -49,17 +49,17 @@ export class AggregateTransactionService { * Include both initiator & cosigners */ const signers = (aggregateTransaction.cosignatures.map((cosigner) => cosigner.signer.publicKey)); - if (signedTransaction.signer) { - signers.push(signedTransaction.signer); + if (signedTransaction.signerPublicKey) { + signers.push(signedTransaction.signerPublicKey); } return observableFrom(aggregateTransaction.innerTransactions).pipe( - mergeMap((innerTransaction) => this.accountHttp.getMultisigAccountInfo(innerTransaction.signer.address) + mergeMap((innerTransaction) => this.accountHttp.getMultisigAccountInfo(innerTransaction.signer) .pipe( /** * For multisig account, we need to get the graph info in case it has multiple levels */ mergeMap((_) => _.minApproval !== 0 && _.minRemoval !== 0 ? - this.accountHttp.getMultisigAccountGraphInfo(_.account.address) + this.accountHttp.getMultisigAccountGraphInfo(_.account) .pipe( map((graphInfo) => this.validateCosignatories(graphInfo, signers, innerTransaction)), ) : observableOf(signers.find((s) => s === _.account.publicKey ) !== undefined), diff --git a/test/core/utils/TransactionMapping.spec.ts b/test/core/utils/TransactionMapping.spec.ts index 2d5cb4be71..d69f24dbfa 100644 --- a/test/core/utils/TransactionMapping.spec.ts +++ b/test/core/utils/TransactionMapping.spec.ts @@ -353,14 +353,14 @@ describe('TransactionMapping - createFromPayload', () => { it('should create SecretLockTransaction', () => { const proof = 'B778A39A3663719DFC5E48C9D78431B1E45C2AF9DF538782BF199C189DABEAC7'; - const recipient = Address.createFromRawAddress('SDBDG4IT43MPCW2W4CBBCSJJT42AYALQN7A4VVWL'); + const recipientAddress = Address.createFromRawAddress('SDBDG4IT43MPCW2W4CBBCSJJT42AYALQN7A4VVWL'); const secretLockTransaction = SecretLockTransaction.create( Deadline.create(), NetworkCurrencyMosaic.createAbsolute(10), UInt64.fromUint(100), HashType.Op_Sha3_256, sha3_256.create().update(convert.hexToUint8(proof)).hex(), - recipient, + recipientAddress, NetworkType.MIJIN_TEST, ); @@ -372,7 +372,7 @@ describe('TransactionMapping - createFromPayload', () => { expect(transaction.duration.equals(UInt64.fromUint(100))).to.be.equal(true); expect(transaction.hashType).to.be.equal(0); expect(transaction.secret).to.be.equal('9B3155B37159DA50AA52D5967C509B410F5A36A3B1E31ECB5AC76675D79B4A5E'); - expect(transaction.recipient.plain()).to.be.equal(recipient.plain()); + expect(transaction.recipientAddress.plain()).to.be.equal(recipientAddress.plain()); }); @@ -393,7 +393,7 @@ describe('TransactionMapping - createFromPayload', () => { expect(secretProofTransaction.hashType).to.be.equal(0); expect(secretProofTransaction.secret).to.be.equal('9b3155b37159da50aa52d5967c509b410f5a36a3b1e31ecb5ac76675d79b4a5e' ); expect(secretProofTransaction.proof).to.be.equal(proof); - expect(secretProofTransaction.recipient.plain()).to.be.equal(account.address.plain()); + expect(secretProofTransaction.recipientAddress.plain()).to.be.equal(account.address.plain()); }); @@ -505,7 +505,7 @@ describe('TransactionMapping - createFromPayload', () => { const transaction = TransactionMapping.createFromPayload(signedTransaction.payload) as AccountLinkTransaction; expect(transaction.linkAction).to.be.equal(1); - expect(transaction.remoteAccountKey).to.be.equal(account.publicKey); + expect(transaction.remotePublicKey).to.be.equal(account.publicKey); }); it('should create NamespaceRegistrationTransaction - Root', () => { @@ -679,7 +679,7 @@ describe('TransactionMapping - createFromDTO (Transaction.toJSON() feed)', () => const transaction = TransactionMapping.createFromDTO(transferTransaction.toJSON()) as TransferTransaction; - expect((transaction.recipient as Address).plain()).to.be.equal('SBILTA367K2LX2FEXG5TFWAS7GEFYAGY7QLFBYKC'); + expect((transaction.recipientAddress as Address).plain()).to.be.equal('SBILTA367K2LX2FEXG5TFWAS7GEFYAGY7QLFBYKC'); expect(transaction.message.payload).to.be.equal('test-message'); }); @@ -695,7 +695,8 @@ describe('TransactionMapping - createFromDTO (Transaction.toJSON() feed)', () => ); const transaction = TransactionMapping.createFromDTO(transferTransaction.toJSON()) as TransferTransaction; - expect((transaction.recipient as NamespaceId).id.toHex().toUpperCase()).to.be.equal(new UInt64([33347626, 3779697293]).toHex()); + expect((transaction.recipientAddress as NamespaceId).id.toHex().toUpperCase()) + .to.be.equal(new UInt64([33347626, 3779697293]).toHex()); expect(transaction.message.payload).to.be.equal('test-message'); }); @@ -712,7 +713,7 @@ describe('TransactionMapping - createFromDTO (Transaction.toJSON() feed)', () => const transaction = TransactionMapping.createFromDTO(transferTransaction.toJSON()) as TransferTransaction; - expect((transaction.recipient as Address).plain()).to.be.equal('SBILTA367K2LX2FEXG5TFWAS7GEFYAGY7QLFBYKC'); + expect((transaction.recipientAddress as Address).plain()).to.be.equal('SBILTA367K2LX2FEXG5TFWAS7GEFYAGY7QLFBYKC'); expect(transaction.message.type).to.be.equal(MessageType.EncryptedMessage); }); @@ -726,7 +727,7 @@ describe('TransactionMapping - createFromDTO (Transaction.toJSON() feed)', () => const transaction = TransactionMapping.createFromDTO(accountLinkTransaction.toJSON()) as AccountLinkTransaction; - expect(transaction.remoteAccountKey).to.be.equal(account.publicKey); + expect(transaction.remotePublicKey).to.be.equal(account.publicKey); expect(transaction.linkAction).to.be.equal(LinkAction.Link); }); @@ -875,14 +876,14 @@ describe('TransactionMapping - createFromDTO (Transaction.toJSON() feed)', () => it('should create SecretLockTransaction', () => { const proof = 'B778A39A3663719DFC5E48C9D78431B1E45C2AF9DF538782BF199C189DABEAC7'; - const recipient = Address.createFromRawAddress('SDBDG4IT43MPCW2W4CBBCSJJT42AYALQN7A4VVWL'); + const recipientAddress = Address.createFromRawAddress('SDBDG4IT43MPCW2W4CBBCSJJT42AYALQN7A4VVWL'); const secretLockTransaction = SecretLockTransaction.create( Deadline.create(), NetworkCurrencyMosaic.createAbsolute(10), UInt64.fromUint(100), HashType.Op_Sha3_256, sha3_256.create().update(convert.hexToUint8(proof)).hex(), - recipient, + recipientAddress, NetworkType.MIJIN_TEST, ); @@ -911,7 +912,7 @@ describe('TransactionMapping - createFromDTO (Transaction.toJSON() feed)', () => expect(transaction.type).to.be.equal(TransactionType.SECRET_PROOF); expect(transaction.hashType).to.be.equal(HashType.Op_Sha3_256); expect(transaction.secret).to.be.equal(sha3_256.create().update(convert.hexToUint8(proof)).hex()); - deepEqual(transaction.recipient, account.address); + deepEqual(transaction.recipientAddress, account.address); expect(transaction.proof).to.be.equal(proof); }); diff --git a/test/infrastructure/SerializeTransactionToJSON.spec.ts b/test/infrastructure/SerializeTransactionToJSON.spec.ts index b8428ffdf7..6db916c916 100644 --- a/test/infrastructure/SerializeTransactionToJSON.spec.ts +++ b/test/infrastructure/SerializeTransactionToJSON.spec.ts @@ -71,7 +71,7 @@ describe('SerializeTransactionToJSON', () => { const json = accountLinkTransaction.toJSON(); - expect(json.transaction.remoteAccountKey).to.be.equal(account.publicKey); + expect(json.transaction.remotePublicKey).to.be.equal(account.publicKey); expect(json.transaction.linkAction).to.be.equal(LinkAction.Link); }); @@ -251,14 +251,14 @@ describe('SerializeTransactionToJSON', () => { it('should create SecretLockTransaction', () => { const proof = 'B778A39A3663719DFC5E48C9D78431B1E45C2AF9DF538782BF199C189DABEAC7'; - const recipient = Address.createFromRawAddress('SDBDG4IT43MPCW2W4CBBCSJJT42AYALQN7A4VVWL'); + const recipientAddress = Address.createFromRawAddress('SDBDG4IT43MPCW2W4CBBCSJJT42AYALQN7A4VVWL'); const secretLockTransaction = SecretLockTransaction.create( Deadline.create(), NetworkCurrencyMosaic.createAbsolute(10), UInt64.fromUint(100), HashType.Op_Sha3_256, sha3_256.create().update(convert.hexToUint8(proof)).hex(), - recipient, + recipientAddress, NetworkType.MIJIN_TEST, ); diff --git a/test/model/UInt64.spec.ts b/test/model/UInt64.spec.ts index d1c9aed3d0..bf1d26bebc 100644 --- a/test/model/UInt64.spec.ts +++ b/test/model/UInt64.spec.ts @@ -122,4 +122,22 @@ describe('Uint64', () => { }); }); }); + + describe('fromNumericString', () => { + it('should create Uint64 object from string', () => { + const value = '1000'; + const uint64 = UInt64.fromNumericString(value); + expect(uint64.lower).to.be.equal(1000); + + // To make sure new method works on existing tests + const value2 = '51110867862'; + const uint64_2 = UInt64.fromNumericString(value2); + expect(uint64_2.lower).to.be.equal(3866227606); + expect(uint64_2.higher).to.be.equal(11); + }); + it('should throw exception when creating Uint64 object from string', () => { + expect(() => { UInt64.fromNumericString('000012345678'); }).to.throw('Input string is not a valid numeric string'); + expect(() => { UInt64.fromNumericString('ABC12345678'); }).to.throw('Input string is not a valid numeric string'); + }); + }); }); diff --git a/test/model/blockchain/BlockInfo.spec.ts b/test/model/blockchain/BlockInfo.spec.ts index 53977295ad..2fa0e5f777 100644 --- a/test/model/blockchain/BlockInfo.spec.ts +++ b/test/model/blockchain/BlockInfo.spec.ts @@ -34,7 +34,7 @@ describe('BlockInfo', () => { previousBlockHash: '0000000000000000000000000000000000000000000000000000000000000000', signature: '37351C8244AC166BE6664E3FA954E99A3239AC46E51E2B32CEA1C72DD0851100A7731868' + 'E932E1A9BEF8A27D48E1FFEE401E933EB801824373E7537E51733E0F', - signer: 'B4F12E7C9F6946091E2CB8B6D3A12B50D17CCBBF646386EA27CE2946A7423DCF', + signerPublicKey: 'B4F12E7C9F6946091E2CB8B6D3A12B50D17CCBBF646386EA27CE2946A7423DCF', beneficiaryPublicKey: 'B4F12E7C9F6946091E2CB8B6D3A12B50D17CCBBF646386EA27CE2946A7423DCF', timestamp: new UInt64([ 0, 0 ]), type: 32768, @@ -55,7 +55,7 @@ describe('BlockInfo', () => { blockDTO.meta.totalFee, blockDTO.meta.numTransactions, blockDTO.block.signature, - PublicAccount.createFromPublicKey(blockDTO.block.signer, network), + PublicAccount.createFromPublicKey(blockDTO.block.signerPublicKey, network), network, parseInt(blockDTO.block.version.toString(16).substr(2, 2), 16), // Tx version blockDTO.block.type, @@ -75,7 +75,7 @@ describe('BlockInfo', () => { deepEqual(blockInfo.totalFee, blockDTO.meta.totalFee); expect(blockInfo.numTransactions).to.be.equal(blockDTO.meta.numTransactions); expect(blockInfo.signature).to.be.equal(blockDTO.block.signature); - expect(blockInfo.signer.publicKey).to.be.equal(blockDTO.block.signer); + expect(blockInfo.signer.publicKey).to.be.equal(blockDTO.block.signerPublicKey); expect(blockInfo.networkType).to.be.equal(parseInt(blockDTO.block.version.toString(16).substr(0, 2), 16)); expect(blockInfo.version).to.be.equal(parseInt(blockDTO.block.version.toString(16).substr(2, 2), 16)); expect(blockInfo.type).to.be.equal(blockDTO.block.type); diff --git a/test/model/receipt/Receipt.spec.ts b/test/model/receipt/Receipt.spec.ts index a4db016ef0..420f9e6b8f 100644 --- a/test/model/receipt/Receipt.spec.ts +++ b/test/model/receipt/Receipt.spec.ts @@ -141,13 +141,13 @@ describe('Receipt', () => { version: 1, type: 4685, sender: account.publicKey, - recipient: '9103B60AAF2762688300000000000000000000000000000000', + recipientAddress: '9103B60AAF2762688300000000000000000000000000000000', mosaicId: [481110499, 231112638], amount: [1000, 0], }; const receipt = new BalanceTransferReceipt( PublicAccount.createFromPublicKey(receiptDTO.sender, netWorkType), - Address.createFromEncoded(receiptDTO.recipient), + Address.createFromEncoded(receiptDTO.recipientAddress), new MosaicId(receiptDTO.mosaicId), new UInt64(receiptDTO.amount), receiptDTO.version, @@ -158,7 +158,7 @@ describe('Receipt', () => { deepEqual(receipt.mosaicId.toDTO(), receiptDTO.mosaicId); deepEqual(receipt.type, ReceiptType.Mosaic_Levy); deepEqual(receipt.version, ReceiptVersion.BALANCE_TRANSFER); - deepEqual(receipt.recipient, Address.createFromEncoded('9103B60AAF2762688300000000000000000000000000000000')); + deepEqual(receipt.recipientAddress, Address.createFromEncoded('9103B60AAF2762688300000000000000000000000000000000')); }); it('should createComplete a balance transfer receipt - Mosaic Rental Fee', () => { @@ -166,14 +166,14 @@ describe('Receipt', () => { version: 1, type: 4941, sender: account.publicKey, - recipient: '9103B60AAF2762688300000000000000000000000000000000', + recipientAddress: '9103B60AAF2762688300000000000000000000000000000000', mosaicId: [3646934825, 3576016193], amount: [1000, 0], }; const receipt = new BalanceTransferReceipt( PublicAccount.createFromPublicKey(receiptDTO.sender, netWorkType), - Address.createFromEncoded(receiptDTO.recipient), + Address.createFromEncoded(receiptDTO.recipientAddress), new MosaicId(receiptDTO.mosaicId), new UInt64(receiptDTO.amount), receiptDTO.version, @@ -181,7 +181,7 @@ describe('Receipt', () => { ); deepEqual(receipt.amount.toDTO(), receiptDTO.amount); - deepEqual(receipt.recipient, Address.createFromEncoded('9103B60AAF2762688300000000000000000000000000000000')); + deepEqual(receipt.recipientAddress, Address.createFromEncoded('9103B60AAF2762688300000000000000000000000000000000')); deepEqual(receipt.mosaicId.toDTO(), receiptDTO.mosaicId); deepEqual(receipt.type, ReceiptType.Mosaic_Rental_Fee); deepEqual(receipt.version, ReceiptVersion.BALANCE_TRANSFER); @@ -204,7 +204,7 @@ describe('Receipt', () => { receiptDTO.type, ); - deepEqual(receipt.account.publicKey, receiptDTO.account); + deepEqual(receipt.targetPublicAccount.publicKey, receiptDTO.account); deepEqual(receipt.amount.toDTO(), receiptDTO.amount); deepEqual(receipt.mosaicId.toDTO(), receiptDTO.mosaicId); deepEqual(receipt.type, ReceiptType.Harvest_Fee); @@ -228,7 +228,7 @@ describe('Receipt', () => { receiptDTO.type, ); - deepEqual(receipt.account.publicKey, receiptDTO.account); + deepEqual(receipt.targetPublicAccount.publicKey, receiptDTO.account); deepEqual(receipt.amount.toDTO(), receiptDTO.amount); deepEqual(receipt.mosaicId.toDTO(), receiptDTO.mosaicId); deepEqual(receipt.type, ReceiptType.LockHash_Created); @@ -280,7 +280,7 @@ describe('Receipt', () => { ); deepEqual(statement.source.primaryId, statementDto.source.primaryId); deepEqual(statement.source.secondaryId, statementDto.source.secondaryId); - deepEqual((statement.receipts[0] as BalanceChangeReceipt).account.publicKey, account.publicKey); + deepEqual((statement.receipts[0] as BalanceChangeReceipt).targetPublicAccount.publicKey, account.publicKey); }); it('should createComplete resolution statement - mosaic', () => { diff --git a/test/model/transaction/AccountLinkTransaction.spec.ts b/test/model/transaction/AccountLinkTransaction.spec.ts index ec2fe1630d..36a9033600 100644 --- a/test/model/transaction/AccountLinkTransaction.spec.ts +++ b/test/model/transaction/AccountLinkTransaction.spec.ts @@ -64,7 +64,7 @@ describe('AccountLinkTransaction', () => { ); expect(accountLinkTransaction.linkAction).to.be.equal(1); - expect(accountLinkTransaction.remoteAccountKey).to.be.equal(account.publicKey); + expect(accountLinkTransaction.remotePublicKey).to.be.equal(account.publicKey); const signedTransaction = accountLinkTransaction.signWith(account, generationHash); @@ -83,7 +83,7 @@ describe('AccountLinkTransaction', () => { ); expect(accountLinkTransaction.linkAction).to.be.equal(0); - expect(accountLinkTransaction.remoteAccountKey).to.be.equal(account.publicKey); + expect(accountLinkTransaction.remotePublicKey).to.be.equal(account.publicKey); const signedTransaction = accountLinkTransaction.signWith(account, generationHash); diff --git a/test/model/transaction/AggregateTransaction.spec.ts b/test/model/transaction/AggregateTransaction.spec.ts index 4f331e0bdd..c228da0c68 100644 --- a/test/model/transaction/AggregateTransaction.spec.ts +++ b/test/model/transaction/AggregateTransaction.spec.ts @@ -309,7 +309,7 @@ describe('AggregateTransaction', () => { { signature: '5780C8DF9D46BA2BCF029DCC5D3BF55FE1CB5BE7ABCF30387C4637DD' + 'EDFC2152703CA0AD95F21BB9B942F3CC52FCFC2064C7B84CF60D1A9E69195F1943156C07', - signer: 'A5F82EC8EBB341427B6785C8111906CD0DF18838FB11B51CE0E18B5E79DFF630', + signerPublicKey: 'A5F82EC8EBB341427B6785C8111906CD0DF18838FB11B51CE0E18B5E79DFF630', }, ], deadline: [ @@ -322,7 +322,7 @@ describe('AggregateTransaction', () => { ], signature: '939673209A13FF82397578D22CC96EB8516A6760C894D9B7535E3A1E0680' + '07B9255CFA9A914C97142A7AE18533E381C846B69D2AE0D60D1DC8A55AD120E2B606', - signer: '7681ED5023141D9CDCF184E5A7B60B7D466739918ED5DA30F7E71EA7B86EFF2D', + signerPublicKey: '7681ED5023141D9CDCF184E5A7B60B7D466739918ED5DA30F7E71EA7B86EFF2D', transactions: [ { meta: { @@ -461,8 +461,8 @@ describe('AggregateTransaction', () => { // First Alice need to append cosignatories to current transaction. const cosignatureSignedTransactions = [ - new CosignatureSignedTransaction(signedTxBob.parentHash, signedTxBob.signature, signedTxBob.signer), - new CosignatureSignedTransaction(signedTxCarol.parentHash, signedTxCarol.signature, signedTxCarol.signer), + new CosignatureSignedTransaction(signedTxBob.parentHash, signedTxBob.signature, signedTxBob.signerPublicKey), + new CosignatureSignedTransaction(signedTxCarol.parentHash, signedTxCarol.signature, signedTxCarol.signerPublicKey), ]; const recreatedTx = TransactionMapping.createFromPayload(aliceSignedTransaction.payload) as AggregateTransaction; @@ -470,7 +470,7 @@ describe('AggregateTransaction', () => { const signedTransaction = recreatedTx.signTransactionGivenSignatures(accountAlice, cosignatureSignedTransactions, generationHash); expect(signedTransaction.type).to.be.equal(TransactionType.AGGREGATE_COMPLETE); - expect(signedTransaction.signer).to.be.equal(accountAlice.publicKey); + expect(signedTransaction.signerPublicKey).to.be.equal(accountAlice.publicKey); expect(signedTransaction.payload.indexOf(accountBob.publicKey) > -1).to.be.true; expect(signedTransaction.payload.indexOf(accountCarol.publicKey) > -1).to.be.true; diff --git a/test/model/transaction/CosignatureTransaction.spec.ts b/test/model/transaction/CosignatureTransaction.spec.ts index b3f8de15af..2d20adf711 100644 --- a/test/model/transaction/CosignatureTransaction.spec.ts +++ b/test/model/transaction/CosignatureTransaction.spec.ts @@ -50,7 +50,7 @@ describe('CosignatureTransaction', () => { { signature: '5780C8DF9D46BA2BCF029DCC5D3BF55FE1CB5BE7ABCF30387C4637DD' + 'EDFC2152703CA0AD95F21BB9B942F3CC52FCFC2064C7B84CF60D1A9E69195F1943156C07', - signer: 'A5F82EC8EBB341427B6785C8111906CD0DF18838FB11B51CE0E18B5E79DFF630', + signerPublicKey: 'A5F82EC8EBB341427B6785C8111906CD0DF18838FB11B51CE0E18B5E79DFF630', }, ], deadline: [ @@ -63,7 +63,7 @@ describe('CosignatureTransaction', () => { ], signature: '939673209A13FF82397578D22CC96EB8516A6760C894D9B7535E3A1E0680' + '07B9255CFA9A914C97142A7AE18533E381C846B69D2AE0D60D1DC8A55AD120E2B606', - signer: '7681ED5023141D9CDCF184E5A7B60B7D466739918ED5DA30F7E71EA7B86EFF2D', + signerPublicKey: '7681ED5023141D9CDCF184E5A7B60B7D466739918ED5DA30F7E71EA7B86EFF2D', transactions: [ { meta: { @@ -93,8 +93,8 @@ describe('CosignatureTransaction', () => { ], }, ], - recipient: '9050B9837EFAB4BBE8A4B9BB32D812F9885C00D8FC1650E142', - signer: 'B4F12E7C9F6946091E2CB8B6D3A12B50D17CCBBF646386EA27CE2946A7423DCF', + recipientAddress: '9050B9837EFAB4BBE8A4B9BB32D812F9885C00D8FC1650E142', + signerPublicKey: 'B4F12E7C9F6946091E2CB8B6D3A12B50D17CCBBF646386EA27CE2946A7423DCF', type: 16724, version: 36865, }, @@ -114,7 +114,7 @@ describe('CosignatureTransaction', () => { expect(cosignatureSignedTransaction.parentHash).to.be.equal(aggregateTransferTransaction.transactionInfo!.hash); expect(cosignatureSignedTransaction.signature).to.be.equal('BF3BC39F2292C028CB0FFA438A9F567A7C4D7' + '93D2F8522C8DEAC74BEFBCB61AF6414ADF27B2176D6A24FEF612AA6DB2F562176A11C46BA6D5E05430042CB5705'); - expect(cosignatureSignedTransaction.signer).to.be.equal(account.publicKey); + expect(cosignatureSignedTransaction.signerPublicKey).to.be.equal(account.publicKey); }); it('should sign a transaction with transaction payload', () => { @@ -126,7 +126,7 @@ describe('CosignatureTransaction', () => { const signedTx = CosignatureTransaction.signTransactionPayload(account, txPayload, generationHash); - expect(signedTx.signer).to.be.equal('C2F93346E27CE6AD1A9F8F5E3066F8326593A406BDF357ACB041E2F9AB402EFE'); - expect(signedTx.signer).to.be.equal(account.publicKey); + expect(signedTx.signerPublicKey).to.be.equal('C2F93346E27CE6AD1A9F8F5E3066F8326593A406BDF357ACB041E2F9AB402EFE'); + expect(signedTx.signerPublicKey).to.be.equal(account.publicKey); }); }); diff --git a/test/model/transaction/Deadline.spec.ts b/test/model/transaction/Deadline.spec.ts index 5732205497..cdea144bfb 100644 --- a/test/model/transaction/Deadline.spec.ts +++ b/test/model/transaction/Deadline.spec.ts @@ -45,7 +45,7 @@ describe('Deadline', () => { }); it('should createComplete date with Deadline array', () => { - const deadline = Deadline.createFromDTO([3866227606, 11]); + const deadline = Deadline.createFromDTO('51110867862'); expect(deadline.toDTO()[0]).to.be.equal(3866227606); expect(deadline.toDTO()[1]).to.be.equal(11); diff --git a/test/model/transaction/SecretLockTransaction.spec.ts b/test/model/transaction/SecretLockTransaction.spec.ts index 9b5a00780d..29f497d441 100644 --- a/test/model/transaction/SecretLockTransaction.spec.ts +++ b/test/model/transaction/SecretLockTransaction.spec.ts @@ -36,14 +36,14 @@ describe('SecretLockTransaction', () => { }); it('should default maxFee field be set to 0', () => { const proof = 'B778A39A3663719DFC5E48C9D78431B1E45C2AF9DF538782BF199C189DABEAC7'; - const recipient = Address.createFromRawAddress('SDBDG4IT43MPCW2W4CBBCSJJT42AYALQN7A4VVWL'); + const recipientAddress = Address.createFromRawAddress('SDBDG4IT43MPCW2W4CBBCSJJT42AYALQN7A4VVWL'); const secretLockTransaction = SecretLockTransaction.create( Deadline.create(), NetworkCurrencyMosaic.createAbsolute(10), UInt64.fromUint(100), HashType.Op_Sha3_256, sha3_256.create().update(convert.hexToUint8(proof)).hex(), - recipient, + recipientAddress, NetworkType.MIJIN_TEST, ); @@ -53,14 +53,14 @@ describe('SecretLockTransaction', () => { it('should filled maxFee override transaction maxFee', () => { const proof = 'B778A39A3663719DFC5E48C9D78431B1E45C2AF9DF538782BF199C189DABEAC7'; - const recipient = Address.createFromRawAddress('SDBDG4IT43MPCW2W4CBBCSJJT42AYALQN7A4VVWL'); + const recipientAddress = Address.createFromRawAddress('SDBDG4IT43MPCW2W4CBBCSJJT42AYALQN7A4VVWL'); const secretLockTransaction = SecretLockTransaction.create( Deadline.create(), NetworkCurrencyMosaic.createAbsolute(10), UInt64.fromUint(100), HashType.Op_Sha3_256, sha3_256.create().update(convert.hexToUint8(proof)).hex(), - recipient, + recipientAddress, NetworkType.MIJIN_TEST, new UInt64([1, 0]), ); @@ -71,14 +71,14 @@ describe('SecretLockTransaction', () => { it('should be created with HashType: Op_Sha3_256 secret', () => { const proof = 'B778A39A3663719DFC5E48C9D78431B1E45C2AF9DF538782BF199C189DABEAC7'; - const recipient = Address.createFromRawAddress('SDBDG4IT43MPCW2W4CBBCSJJT42AYALQN7A4VVWL'); + const recipientAddress = Address.createFromRawAddress('SDBDG4IT43MPCW2W4CBBCSJJT42AYALQN7A4VVWL'); const secretLockTransaction = SecretLockTransaction.create( Deadline.create(), NetworkCurrencyMosaic.createAbsolute(10), UInt64.fromUint(100), HashType.Op_Sha3_256, sha3_256.create().update(convert.hexToUint8(proof)).hex(), - recipient, + recipientAddress, NetworkType.MIJIN_TEST, ); deepEqual(secretLockTransaction.mosaic.id.id, NetworkCurrencyMosaic.NAMESPACE_ID.id); @@ -86,19 +86,19 @@ describe('SecretLockTransaction', () => { expect(secretLockTransaction.duration.equals(UInt64.fromUint(100))).to.be.equal(true); expect(secretLockTransaction.hashType).to.be.equal(0); expect(secretLockTransaction.secret).to.be.equal('9b3155b37159da50aa52d5967c509b410f5a36a3b1e31ecb5ac76675d79b4a5e'); - expect(secretLockTransaction.recipient).to.be.equal(recipient); + expect(secretLockTransaction.recipientAddress).to.be.equal(recipientAddress); }); it('should be created and sign SecretLock Transaction', () => { const proof = 'B778A39A3663719DFC5E48C9D78431B1E45C2AF9DF538782BF199C189DABEAC7'; - const recipient = Address.createFromRawAddress('SDBDG4IT43MPCW2W4CBBCSJJT42AYALQN7A4VVWL'); + const recipientAddress = Address.createFromRawAddress('SDBDG4IT43MPCW2W4CBBCSJJT42AYALQN7A4VVWL'); const secretLockTransaction = SecretLockTransaction.create( Deadline.create(), NetworkCurrencyMosaic.createAbsolute(10), UInt64.fromUint(100), HashType.Op_Sha3_256, sha3_256.create().update(convert.hexToUint8(proof)).hex(), - recipient, + recipientAddress, NetworkType.MIJIN_TEST, ); const signedTx = secretLockTransaction.signWith(account, generationHash); @@ -112,14 +112,14 @@ describe('SecretLockTransaction', () => { it('should throw exception when the input is not related to HashTyp: Op_Sha3_256', () => { expect(() => { - const recipient = Address.createFromRawAddress('SDBDG4IT43MPCW2W4CBBCSJJT42AYALQN7A4VVWL'); + const recipientAddress = Address.createFromRawAddress('SDBDG4IT43MPCW2W4CBBCSJJT42AYALQN7A4VVWL'); const secretLockTransaction = SecretLockTransaction.create( Deadline.create(), NetworkCurrencyMosaic.createAbsolute(10), UInt64.fromUint(100), HashType.Op_Sha3_256, 'non valid hash', - recipient, + recipientAddress, NetworkType.MIJIN_TEST, ); }).to.throw(Error); @@ -127,14 +127,14 @@ describe('SecretLockTransaction', () => { it('should be created with HashType: Op_Keccak_256 secret', () => { const proof = 'B778A39A3663719DFC5E48C9D78431B1E45C2AF9DF538782BF199C189DABEAC7'; - const recipient = Address.createFromRawAddress('SDBDG4IT43MPCW2W4CBBCSJJT42AYALQN7A4VVWL'); + const recipientAddress = Address.createFromRawAddress('SDBDG4IT43MPCW2W4CBBCSJJT42AYALQN7A4VVWL'); const secretLockTransaction = SecretLockTransaction.create( Deadline.create(), NetworkCurrencyMosaic.createAbsolute(10), UInt64.fromUint(100), HashType.Op_Keccak_256, keccak_256.create().update(convert.hexToUint8(proof)).hex(), - recipient, + recipientAddress, NetworkType.MIJIN_TEST, ); deepEqual(secretLockTransaction.mosaic.id.id, NetworkCurrencyMosaic.NAMESPACE_ID.id); @@ -142,33 +142,33 @@ describe('SecretLockTransaction', () => { expect(secretLockTransaction.duration.equals(UInt64.fromUint(100))).to.be.equal(true); expect(secretLockTransaction.hashType).to.be.equal(1); expect(secretLockTransaction.secret).to.be.equal('241c1d54c18c8422def03aa16b4b243a8ba491374295a1a6965545e6ac1af314'); - expect(secretLockTransaction.recipient).to.be.equal(recipient); + expect(secretLockTransaction.recipientAddress).to.be.equal(recipientAddress); }); it('should throw exception when the input is not related to HashTyp: Op_Keccak_256', () => { expect(() => { - const recipient = Address.createFromRawAddress('SDBDG4IT43MPCW2W4CBBCSJJT42AYALQN7A4VVWL'); + const recipientAddress = Address.createFromRawAddress('SDBDG4IT43MPCW2W4CBBCSJJT42AYALQN7A4VVWL'); const secretLockTransaction = SecretLockTransaction.create( Deadline.create(), NetworkCurrencyMosaic.createAbsolute(10), UInt64.fromUint(100), HashType.Op_Keccak_256, 'non valid hash', - recipient, + recipientAddress, NetworkType.MIJIN_TEST, ); }).to.throw(Error); }); it('should be created with HashType: Op_Hash_160 secret', () => { const proof = 'B778A39A3663719DFC5E48C9D78431B1E45C2AF9'; - const recipient = Address.createFromRawAddress('SDBDG4IT43MPCW2W4CBBCSJJT42AYALQN7A4VVWL'); + const recipientAddress = Address.createFromRawAddress('SDBDG4IT43MPCW2W4CBBCSJJT42AYALQN7A4VVWL'); const secretLockTransaction = SecretLockTransaction.create( Deadline.create(), NetworkCurrencyMosaic.createAbsolute(10), UInt64.fromUint(100), HashType.Op_Hash_160, CryptoJS.RIPEMD160(CryptoJS.SHA256(proof).toString(CryptoJS.enc.Hex)).toString(CryptoJS.enc.Hex), - recipient, + recipientAddress, NetworkType.MIJIN_TEST, ); deepEqual(secretLockTransaction.mosaic.id.id, NetworkCurrencyMosaic.NAMESPACE_ID.id); @@ -176,33 +176,33 @@ describe('SecretLockTransaction', () => { expect(secretLockTransaction.duration.equals(UInt64.fromUint(100))).to.be.equal(true); expect(secretLockTransaction.hashType).to.be.equal(2); expect(secretLockTransaction.secret).to.be.equal('3fc43d717d824302e3821de8129ea2f7786912e5'); - expect(secretLockTransaction.recipient).to.be.equal(recipient); + expect(secretLockTransaction.recipientAddress).to.be.equal(recipientAddress); }); it('should throw exception when the input is not related to HashTyp: Op_Hash_160', () => { expect(() => { - const recipient = Address.createFromRawAddress('SDBDG4IT43MPCW2W4CBBCSJJT42AYALQN7A4VVWL'); + const recipientAddress = Address.createFromRawAddress('SDBDG4IT43MPCW2W4CBBCSJJT42AYALQN7A4VVWL'); const secretLockTransaction = SecretLockTransaction.create( Deadline.create(), NetworkCurrencyMosaic.createAbsolute(10), UInt64.fromUint(100), HashType.Op_Hash_160, 'non valid hash', - recipient, + recipientAddress, NetworkType.MIJIN_TEST, ); }).to.throw(Error); }); it('should be created with HashType: Op_Hash_256 secret', () => { const proof = 'B778A39A3663719DFC5E48C9D78431B1E45C2AF9DF538782BF199C189DABEAC7'; - const recipient = Address.createFromRawAddress('SDBDG4IT43MPCW2W4CBBCSJJT42AYALQN7A4VVWL'); + const recipientAddress = Address.createFromRawAddress('SDBDG4IT43MPCW2W4CBBCSJJT42AYALQN7A4VVWL'); const secretLockTransaction = SecretLockTransaction.create( Deadline.create(), NetworkCurrencyMosaic.createAbsolute(10), UInt64.fromUint(100), HashType.Op_Hash_256, CryptoJS.SHA256(CryptoJS.SHA256(proof).toString(CryptoJS.enc.Hex)).toString(CryptoJS.enc.Hex), - recipient, + recipientAddress, NetworkType.MIJIN_TEST, ); deepEqual(secretLockTransaction.mosaic.id.id, NetworkCurrencyMosaic.NAMESPACE_ID.id); @@ -210,19 +210,19 @@ describe('SecretLockTransaction', () => { expect(secretLockTransaction.duration.equals(UInt64.fromUint(100))).to.be.equal(true); expect(secretLockTransaction.hashType).to.be.equal(3); expect(secretLockTransaction.secret).to.be.equal('c346f5ecf5bcfa54ab14fad815c8239bdeb051df8835d212dba2af59f688a00e'); - expect(secretLockTransaction.recipient).to.be.equal(recipient); + expect(secretLockTransaction.recipientAddress).to.be.equal(recipientAddress); }); it('should throw exception when the input is not related to HashTyp: Op_Hash_256', () => { expect(() => { - const recipient = Address.createFromRawAddress('SDBDG4IT43MPCW2W4CBBCSJJT42AYALQN7A4VVWL'); + const recipientAddress = Address.createFromRawAddress('SDBDG4IT43MPCW2W4CBBCSJJT42AYALQN7A4VVWL'); const secretLockTransaction = SecretLockTransaction.create( Deadline.create(), NetworkCurrencyMosaic.createAbsolute(10), UInt64.fromUint(100), HashType.Op_Hash_256, 'non valid hash', - recipient, + recipientAddress, NetworkType.MIJIN_TEST, ); }).to.throw(Error); @@ -231,14 +231,14 @@ describe('SecretLockTransaction', () => { describe('size', () => { it('should return 202 for SecretLockTransaction with proof of 32 bytes', () => { const proof = 'B778A39A3663719DFC5E48C9D78431B1E45C2AF9DF538782BF199C189DABEAC7'; - const recipient = Address.createFromRawAddress('SDBDG4IT43MPCW2W4CBBCSJJT42AYALQN7A4VVWL'); + const recipientAddress = Address.createFromRawAddress('SDBDG4IT43MPCW2W4CBBCSJJT42AYALQN7A4VVWL'); const secretLockTransaction = SecretLockTransaction.create( Deadline.create(), NetworkCurrencyMosaic.createAbsolute(10), UInt64.fromUint(100), HashType.Op_Hash_256, CryptoJS.SHA256(CryptoJS.SHA256(proof).toString(CryptoJS.enc.Hex)).toString(CryptoJS.enc.Hex), - recipient, + recipientAddress, NetworkType.MIJIN_TEST, ); expect(secretLockTransaction.size).to.be.equal(202); diff --git a/test/model/transaction/TransactionStatus.spec.ts b/test/model/transaction/TransactionStatus.spec.ts index dc82a6276a..f0ac87f8a6 100644 --- a/test/model/transaction/TransactionStatus.spec.ts +++ b/test/model/transaction/TransactionStatus.spec.ts @@ -23,7 +23,7 @@ import {UInt64} from '../../../src/model/UInt64'; describe('TransactionStatus', () => { it('should createComplete TransactionStatus object', () => { const transactionStatusDTO = { - deadline: Deadline.createFromDTO([ 1, 0 ]), + deadline: Deadline.createFromDTO('1'), group: 'confirmed', hash: '18C036C20B32348D63684E09A13128A2C18F6A75650D3A5FB43853D716E5E219', height: new UInt64([ 1, 0 ]), diff --git a/test/model/transaction/TransactionStatusError.spec.ts b/test/model/transaction/TransactionStatusError.spec.ts index af3faf27bf..7d2d64a17f 100644 --- a/test/model/transaction/TransactionStatusError.spec.ts +++ b/test/model/transaction/TransactionStatusError.spec.ts @@ -23,7 +23,7 @@ describe('TransactionStatusError', () => { it('should createComplete an TransactionStatusError object', () => { const statusInfoErrorDTO = { - deadline: [ 1010, 0 ], + deadline: '1010', hash: 'transaction-hash', status: 'error-message', }; diff --git a/test/model/transaction/TransferTransaction.spec.ts b/test/model/transaction/TransferTransaction.spec.ts index 969bf81a1b..ae35b77b77 100644 --- a/test/model/transaction/TransferTransaction.spec.ts +++ b/test/model/transaction/TransferTransaction.spec.ts @@ -71,8 +71,8 @@ describe('TransferTransaction', () => { expect(transferTransaction.message.payload).to.be.equal('test-message'); expect(transferTransaction.mosaics.length).to.be.equal(0); - expect(transferTransaction.recipient).to.be.instanceof(Address); - expect((transferTransaction.recipient as Address).plain()).to.be.equal('SBILTA367K2LX2FEXG5TFWAS7GEFYAGY7QLFBYKC'); + expect(transferTransaction.recipientAddress).to.be.instanceof(Address); + expect((transferTransaction.recipientAddress as Address).plain()).to.be.equal('SBILTA367K2LX2FEXG5TFWAS7GEFYAGY7QLFBYKC'); const signedTransaction = transferTransaction.signWith(account, generationHash); @@ -95,8 +95,8 @@ describe('TransferTransaction', () => { expect(transferTransaction.message.payload).to.be.equal('test-message'); expect(transferTransaction.mosaics.length).to.be.equal(1); - expect(transferTransaction.recipient).to.be.instanceof(Address); - expect((transferTransaction.recipient as Address).plain()).to.be.equal('SBILTA367K2LX2FEXG5TFWAS7GEFYAGY7QLFBYKC'); + expect(transferTransaction.recipientAddress).to.be.instanceof(Address); + expect((transferTransaction.recipientAddress as Address).plain()).to.be.equal('SBILTA367K2LX2FEXG5TFWAS7GEFYAGY7QLFBYKC'); const signedTransaction = transferTransaction.signWith(account, generationHash); @@ -108,7 +108,7 @@ describe('TransferTransaction', () => { '44B262C46CEABB8500E1F50500000000'); }); - it('should createComplete an TransferTransaction object with NamespaceId recipient', () => { + it('should createComplete an TransferTransaction object with NamespaceId recipientAddress', () => { const addressAlias = new NamespaceId('nem.owner'); const transferTransaction = TransferTransaction.create( Deadline.create(), @@ -122,9 +122,9 @@ describe('TransferTransaction', () => { expect(transferTransaction.message.payload).to.be.equal('test-message'); expect(transferTransaction.mosaics.length).to.be.equal(1); - expect(transferTransaction.recipient).to.be.instanceof(NamespaceId); - expect(transferTransaction.recipient).to.be.equal(addressAlias); - expect((transferTransaction.recipient as NamespaceId).toHex()).to.be.equal(addressAlias.toHex()); + expect(transferTransaction.recipientAddress).to.be.instanceof(NamespaceId); + expect(transferTransaction.recipientAddress).to.be.equal(addressAlias); + expect((transferTransaction.recipientAddress as NamespaceId).toHex()).to.be.equal(addressAlias.toHex()); const signedTransaction = transferTransaction.signWith(account, generationHash); @@ -207,8 +207,8 @@ describe('TransferTransaction', () => { expect(transferTransaction.message.payload).to.be.equal('test-message'); expect(transferTransaction.mosaics.length).to.be.equal(1); - expect(transferTransaction.recipient).to.be.instanceof(Address); - expect((transferTransaction.recipient as Address).plain()).to.be.equal('SBILTA367K2LX2FEXG5TFWAS7GEFYAGY7QLFBYKC'); + expect(transferTransaction.recipientAddress).to.be.instanceof(Address); + expect((transferTransaction.recipientAddress as Address).plain()).to.be.equal('SBILTA367K2LX2FEXG5TFWAS7GEFYAGY7QLFBYKC'); const signedTransaction = transferTransaction.signWith(account, generationHash); From 6b8c7b313de76a9c4fd66522ae4fea4ae7c8a83c Mon Sep 17 00:00:00 2001 From: Steven Liu Date: Wed, 11 Sep 2019 14:22:24 +0100 Subject: [PATCH 05/10] Fixed e2d tests --- e2e/infrastructure/TransactionHttp.spec.ts | 166 ++++++++++----------- src/infrastructure/AccountRepository.ts | 1 + src/infrastructure/MosaicHttp.ts | 24 +-- src/infrastructure/TransactionHttp.ts | 15 +- src/infrastructure/model/mosaicDTO.ts | 31 +++- 5 files changed, 132 insertions(+), 105 deletions(-) diff --git a/e2e/infrastructure/TransactionHttp.spec.ts b/e2e/infrastructure/TransactionHttp.spec.ts index b558c448b3..48ae7eedac 100644 --- a/e2e/infrastructure/TransactionHttp.spec.ts +++ b/e2e/infrastructure/TransactionHttp.spec.ts @@ -171,88 +171,88 @@ describe('TransactionHttp', () => { }); }); - // describe('MosaicDefinitionTransaction', () => { - // let listener: Listener; - // before (() => { - // listener = new Listener(config.apiUrl); - // return listener.open(); - // }); - // after(() => { - // return listener.close(); - // }); - // it('aggregate', (done) => { - // const nonce = MosaicNonce.createRandom(); - // const mosaicDefinitionTransaction = MosaicDefinitionTransaction.create( - // Deadline.create(), - // nonce, - // MosaicId.createFromNonce(nonce, account.publicAccount), - // MosaicProperties.create({ - // supplyMutable: true, - // transferable: true, - // divisibility: 3, - // restrictable: true, - // }), - // NetworkType.MIJIN_TEST, - // ); - // const aggregateTransaction = AggregateTransaction.createComplete(Deadline.create(), - // [mosaicDefinitionTransaction.toAggregate(account.publicAccount)], - // NetworkType.MIJIN_TEST, - // []); - // const signedTransaction = aggregateTransaction.signWith(account, generationHash); - // listener.confirmed(account.address).subscribe((transaction: Transaction) => { - // done(); - // }); - // listener.status(account.address).subscribe((error) => { - // console.log('Error:', error); - // assert(false); - // done(); - // }); - // transactionHttp.announce(signedTransaction); - // }); - // }); - - // describe('AccountMetadataTransaction', () => { - // let listener: Listener; - // before (() => { - // listener = new Listener(config.apiUrl); - // return listener.open(); - // }); - // after(() => { - // return listener.close(); - // }); - // it('aggregate', (done) => { - // const accountMetadataTransaction = AccountMetadataTransaction.create( - // Deadline.create(), - // account.publicKey, - // UInt64.fromUint(5), - // 10, - // new Uint8Array(10), - // NetworkType.MIJIN_TEST, - // ); - - // const aggregateTransaction = AggregateTransaction.createComplete(Deadline.create(), - // [accountMetadataTransaction.toAggregate(account.publicAccount)], - // NetworkType.MIJIN_TEST, - // [], - // ); - // const signedTransaction = aggregateTransaction.signWith(account, generationHash); - // listener.confirmed(account.address).subscribe((transaction: AggregateTransaction) => { - // transaction.innerTransactions.forEach((innerTx) => { - // expect((innerTx as AccountMetadataTransaction).targetPublicKey, 'TargetPublicKey').not.to.be.undefined; - // expect((innerTx as AccountMetadataTransaction).scopedMetadataKey, 'ScopedMetadataKey').not.to.be.undefined; - // expect((innerTx as AccountMetadataTransaction).valueSizeDelta, 'ValueSizeDelta').not.to.be.undefined; - // expect((innerTx as AccountMetadataTransaction).value, 'Value').not.to.be.undefined; - // }); - // done(); - // }); - // listener.status(account.address).subscribe((error) => { - // console.log('Error:', error); - // assert(false); - // done(); - // }); - // transactionHttp.announce(signedTransaction); - // }); - // }); + describe('MosaicDefinitionTransaction', () => { + let listener: Listener; + before (() => { + listener = new Listener(config.apiUrl); + return listener.open(); + }); + after(() => { + return listener.close(); + }); + it('aggregate', (done) => { + const nonce = MosaicNonce.createRandom(); + const mosaicDefinitionTransaction = MosaicDefinitionTransaction.create( + Deadline.create(), + nonce, + MosaicId.createFromNonce(nonce, account.publicAccount), + MosaicProperties.create({ + supplyMutable: true, + transferable: true, + divisibility: 3, + restrictable: true, + }), + NetworkType.MIJIN_TEST, + ); + const aggregateTransaction = AggregateTransaction.createComplete(Deadline.create(), + [mosaicDefinitionTransaction.toAggregate(account.publicAccount)], + NetworkType.MIJIN_TEST, + []); + const signedTransaction = aggregateTransaction.signWith(account, generationHash); + listener.confirmed(account.address).subscribe((transaction: Transaction) => { + done(); + }); + listener.status(account.address).subscribe((error) => { + console.log('Error:', error); + assert(false); + done(); + }); + transactionHttp.announce(signedTransaction); + }); + }); + + describe('AccountMetadataTransaction', () => { + let listener: Listener; + before (() => { + listener = new Listener(config.apiUrl); + return listener.open(); + }); + after(() => { + return listener.close(); + }); + it('aggregate', (done) => { + const accountMetadataTransaction = AccountMetadataTransaction.create( + Deadline.create(), + account.publicKey, + UInt64.fromUint(5), + 1, + new Uint8Array(11), + NetworkType.MIJIN_TEST, + ); + + const aggregateTransaction = AggregateTransaction.createComplete(Deadline.create(), + [accountMetadataTransaction.toAggregate(account.publicAccount)], + NetworkType.MIJIN_TEST, + [], + ); + const signedTransaction = aggregateTransaction.signWith(account, generationHash); + listener.confirmed(account.address).subscribe((transaction: AggregateTransaction) => { + transaction.innerTransactions.forEach((innerTx) => { + expect((innerTx as AccountMetadataTransaction).targetPublicKey, 'TargetPublicKey').not.to.be.undefined; + expect((innerTx as AccountMetadataTransaction).scopedMetadataKey, 'ScopedMetadataKey').not.to.be.undefined; + expect((innerTx as AccountMetadataTransaction).valueSizeDelta, 'ValueSizeDelta').not.to.be.undefined; + expect((innerTx as AccountMetadataTransaction).value, 'Value').not.to.be.undefined; + }); + done(); + }); + listener.status(account.address).subscribe((error) => { + console.log('Error:', error); + assert(false); + done(); + }); + transactionHttp.announce(signedTransaction); + }); + }); describe('MosaicMetadataTransaction', () => { let listener: Listener; @@ -313,7 +313,7 @@ describe('TransactionHttp', () => { const registerNamespaceTransaction = NamespaceRegistrationTransaction.createRootNamespace( Deadline.create(), namespaceName, - UInt64.fromUint(5), + UInt64.fromUint(10), NetworkType.MIJIN_TEST, ); namespaceId = new NamespaceId(namespaceName); diff --git a/src/infrastructure/AccountRepository.ts b/src/infrastructure/AccountRepository.ts index 65757dc2ce..5d3989e1cf 100644 --- a/src/infrastructure/AccountRepository.ts +++ b/src/infrastructure/AccountRepository.ts @@ -49,6 +49,7 @@ export interface AccountRepository { /** * Get readable names for a set of accountIds. + * Address can be created by calling 'Address.createFromRawAddress' or 'Address.createFromPublicKey' * Returns friendly names for accounts. * @param accountIds List of Address * @return Observable diff --git a/src/infrastructure/MosaicHttp.ts b/src/infrastructure/MosaicHttp.ts index 8da226cd22..f436baedf4 100644 --- a/src/infrastructure/MosaicHttp.ts +++ b/src/infrastructure/MosaicHttp.ts @@ -68,14 +68,14 @@ export class MosaicHttp extends Http implements MosaicRepository { let mosaicFlag; let divisibility; let duration; - if (mosaicInfoDTO.mosaic.properties.flags) { - mosaicFlag = mosaicInfoDTO.mosaic.properties.flags; + if (mosaicInfoDTO.mosaic.flags) { + mosaicFlag = mosaicInfoDTO.mosaic.flags; } - if (mosaicInfoDTO.mosaic.properties.divisibility) { - divisibility = mosaicInfoDTO.mosaic.properties.divisibility; + if (mosaicInfoDTO.mosaic.divisibility) { + divisibility = mosaicInfoDTO.mosaic.divisibility; } - if (mosaicInfoDTO.mosaic.properties.duration) { - duration = mosaicInfoDTO.mosaic.properties.duration; + if (mosaicInfoDTO.mosaic.duration) { + duration = mosaicInfoDTO.mosaic.duration; } return new MosaicInfo( new MosaicId(mosaicInfoDTO.mosaic.id), @@ -113,14 +113,14 @@ export class MosaicHttp extends Http implements MosaicRepository { let mosaicFlag; let divisibility; let duration; - if (mosaicInfoDTO.mosaic.properties.flags) { - mosaicFlag = mosaicInfoDTO.mosaic.properties.flags; + if (mosaicInfoDTO.mosaic.flags) { + mosaicFlag = mosaicInfoDTO.mosaic.flags; } - if (mosaicInfoDTO.mosaic.properties.divisibility) { - divisibility = mosaicInfoDTO.mosaic.properties.divisibility; + if (mosaicInfoDTO.mosaic.divisibility) { + divisibility = mosaicInfoDTO.mosaic.divisibility; } - if (mosaicInfoDTO.mosaic.properties.duration) { - duration = mosaicInfoDTO.mosaic.properties.duration; + if (mosaicInfoDTO.mosaic.duration) { + duration = mosaicInfoDTO.mosaic.duration; } return new MosaicInfo( new MosaicId(mosaicInfoDTO.mosaic.id), diff --git a/src/infrastructure/TransactionHttp.ts b/src/infrastructure/TransactionHttp.ts index 202db81867..74b5b71e0f 100644 --- a/src/infrastructure/TransactionHttp.ts +++ b/src/infrastructure/TransactionHttp.ts @@ -72,9 +72,13 @@ export class TransactionHttp extends Http implements TransactionRepository { * @returns Observable */ public getTransaction(transactionId: string): Observable { - return observableFrom(this.transactionRoutesApi.getTransaction(transactionId)).pipe(map((transactionDTO) => { + return observableFrom(this.transactionRoutesApi.getTransaction(transactionId)).pipe( + map((response: { response: ClientResponse; body: TransactionInfoDTO; } ) => { + const transactionDTO = response.body; return CreateTransactionFromDTO(transactionDTO); - })); + }), + catchError((error) => throwError(this.errorHandling(error))), + ); } /** @@ -231,15 +235,16 @@ export class TransactionHttp extends Http implements TransactionRepository { */ public getTransactionEffectiveFee(transactionId: string): Observable { return observableFrom(this.transactionRoutesApi.getTransaction(transactionId)).pipe( - mergeMap((transactionDTO) => { + mergeMap((response: { response: ClientResponse; body: TransactionInfoDTO; } ) => { // parse transaction to take advantage of `size` getter overload + const transactionDTO = response.body; const transaction = CreateTransactionFromDTO(transactionDTO); const uintHeight = (transaction.transactionInfo as TransactionInfo).height; // now read block details return observableFrom(this.blockRoutesApi.getBlockByHeight(uintHeight.compact())).pipe( - map((response: { response: ClientResponse; body: BlockInfoDTO; } ) => { - const blockDTO = response.body; + map((blockResponse: { response: ClientResponse; body: BlockInfoDTO; } ) => { + const blockDTO = blockResponse.body; // @see https://nemtech.github.io/concepts/transaction.html#fees // effective_fee = feeMultiplier x transaction::size return blockDTO.block.feeMultiplier * transaction.size; diff --git a/src/infrastructure/model/mosaicDTO.ts b/src/infrastructure/model/mosaicDTO.ts index 76a4a443bd..e15419eac9 100644 --- a/src/infrastructure/model/mosaicDTO.ts +++ b/src/infrastructure/model/mosaicDTO.ts @@ -46,7 +46,18 @@ export class MosaicDTO { * Number of definitions for the same mosaic. */ 'revision': number; - 'properties': MosaicPropertiesDTO; + /** + * - 0x00 (none) - No flags present. - 0x01 (supplyMutable) - Mosaic supports supply changes even when mosaic owner owns partial supply. - 0x02 (transferable) - Mosaic supports transfers between arbitrary accounts. When not set, mosaic can only be transferred to and from mosaic owner. - 0x04 (restrictable) - Mosaic supports custom restrictions configured by mosaic owner. + */ + 'flags': number; + /** + * Determines up to what decimal place the mosaic can be divided. Divisibility of 3 means that a mosaic can be divided into smallest parts of 0.001 mosaics. The divisibility must be in the range of 0 and 6. + */ + 'divisibility': number; + /** + * Duration expressed in number of blocks. + */ + 'duration': string; static discriminator: string | undefined = undefined; @@ -82,10 +93,20 @@ export class MosaicDTO { "type": "number" }, { - "name": "properties", - "baseName": "properties", - "type": "MosaicPropertiesDTO" - } ]; + "name": "flags", + "baseName": "flags", + "type": "number" + }, + { + "name": "divisibility", + "baseName": "divisibility", + "type": "number" + }, + { + "name": "duration", + "baseName": "duration", + "type": "string" + }, ]; static getAttributeTypeMap() { return MosaicDTO.attributeTypeMap; From 8dc12f34bc44f8277c462f6b362bda58b9673ce9 Mon Sep 17 00:00:00 2001 From: Steven Liu Date: Wed, 11 Sep 2019 21:39:19 +0100 Subject: [PATCH 06/10] - Refactored mosaic property - Changed account transactions to use Address - Fixed tests --- e2e/infrastructure/AccountHttp.spec.ts | 14 +- e2e/infrastructure/Listener.spec.ts | 12 +- e2e/infrastructure/MosaicHttp.spec.ts | 1 + e2e/infrastructure/TransactionHttp.spec.ts | 5 +- .../transaction/ValidateTransaction.ts | 4 +- src/infrastructure/AccountHttp.ts | 42 ++-- src/infrastructure/AccountRepository.ts | 31 ++- src/infrastructure/MosaicHttp.ts | 13 +- src/infrastructure/NamespaceHttp.ts | 4 +- src/infrastructure/api/accountRoutesApi.ts | 70 +++--- src/infrastructure/model/mosaicsNamesDTO.ts | 2 +- .../receipt/CreateReceiptFromDTO.ts | 7 +- .../transaction/CreateTransactionFromDTO.ts | 8 +- .../transaction/SerializeTransactionToJSON.ts | 59 ++--- src/model/Id.ts | 2 +- src/model/UInt64.ts | 9 + src/model/model.ts | 1 - src/model/mosaic/Mosaic.ts | 4 +- src/model/mosaic/MosaicId.ts | 2 +- src/model/mosaic/MosaicInfo.ts | 2 +- src/model/mosaic/MosaicProperties.ts | 28 +-- src/model/mosaic/MosaicPropertyType.ts | 27 -- src/model/namespace/NamespaceId.ts | 2 +- src/model/transaction/Deadline.ts | 9 + src/model/transaction/Transaction.ts | 4 +- src/service/AggregateTransactionService.ts | 6 +- test/core/utils/TransactionMapping.spec.ts | 7 +- .../SerializeTransactionToJSON.spec.ts | 20 +- .../receipt/CreateReceiptFromDTO.spec.ts | 100 ++++---- test/model/Id.spec.ts | 4 +- test/model/UInt64.spec.ts | 9 + test/model/mosaic/MosaicInfo.spec.ts | 54 ++-- test/model/mosaic/MosaicProperties.spec.ts | 32 +-- .../mosaic/NetworkCurrencyMosaic.spec.ts | 6 +- .../model/mosaic/NetworkHarvestMosaic.spec.ts | 5 +- test/model/namespace/NamespaceInfo.spec.ts | 4 +- test/model/receipt/Receipt.spec.ts | 232 +++++++++--------- .../transaction/AggregateTransaction.spec.ts | 20 +- .../CosignatureTransaction.spec.ts | 30 +-- .../MosaicDefinitionTransaction.spec.ts | 1 + .../TransactionStatusError.spec.ts | 3 +- .../transaction/TransferTransaction.spec.ts | 2 +- 42 files changed, 429 insertions(+), 468 deletions(-) delete mode 100644 src/model/mosaic/MosaicPropertyType.ts diff --git a/e2e/infrastructure/AccountHttp.spec.ts b/e2e/infrastructure/AccountHttp.spec.ts index 94bd22c52d..28385c02ec 100644 --- a/e2e/infrastructure/AccountHttp.spec.ts +++ b/e2e/infrastructure/AccountHttp.spec.ts @@ -134,7 +134,7 @@ describe('AccountHttp', () => { const registerNamespaceTransaction = NamespaceRegistrationTransaction.createRootNamespace( Deadline.create(), namespaceName, - UInt64.fromUint(5), + UInt64.fromUint(9), NetworkType.MIJIN_TEST, ); namespaceId = new NamespaceId(namespaceName); @@ -306,7 +306,7 @@ describe('AccountHttp', () => { describe('getMultisigAccountGraphInfo', () => { it('should call getMultisigAccountGraphInfo successfully', (done) => { setTimeout(() => { - accountHttp.getMultisigAccountGraphInfo(multisigAccount.publicAccount).subscribe((multisigAccountGraphInfo) => { + accountHttp.getMultisigAccountGraphInfo(multisigAccount.publicAccount.address).subscribe((multisigAccountGraphInfo) => { expect(multisigAccountGraphInfo.multisigAccounts.get(0)![0]. account.publicKey).to.be.equal(multisigAccount.publicKey); done(); @@ -317,7 +317,7 @@ describe('AccountHttp', () => { describe('getMultisigAccountInfo', () => { it('should call getMultisigAccountInfo successfully', (done) => { setTimeout(() => { - accountHttp.getMultisigAccountInfo(multisigAccount.publicAccount).subscribe((multisigAccountInfo) => { + accountHttp.getMultisigAccountInfo(multisigAccount.publicAccount.address).subscribe((multisigAccountInfo) => { expect(multisigAccountInfo.account.publicKey).to.be.equal(multisigAccount.publicKey); done(); }); @@ -327,7 +327,7 @@ describe('AccountHttp', () => { describe('outgoingTransactions', () => { it('should call outgoingTransactions successfully', (done) => { - accountHttp.outgoingTransactions(publicAccount).subscribe((transactions) => { + accountHttp.outgoingTransactions(publicAccount.address).subscribe((transactions) => { expect(transactions.length).to.be.greaterThan(0); done(); }); @@ -336,7 +336,7 @@ describe('AccountHttp', () => { describe('aggregateBondedTransactions', () => { it('should call aggregateBondedTransactions successfully', (done) => { - accountHttp.aggregateBondedTransactions(publicAccount).subscribe(() => { + accountHttp.aggregateBondedTransactions(publicAccount.address).subscribe(() => { done(); }, (error) => { console.log('Error:', error); @@ -347,7 +347,7 @@ describe('AccountHttp', () => { describe('transactions', () => { it('should call transactions successfully', (done) => { - accountHttp.transactions(publicAccount).subscribe((transactions) => { + accountHttp.transactions(publicAccount.address).subscribe((transactions) => { expect(transactions.length).to.be.greaterThan(0); done(); }); @@ -356,7 +356,7 @@ describe('AccountHttp', () => { describe('unconfirmedTransactions', () => { it('should call unconfirmedTransactions successfully', (done) => { - accountHttp.unconfirmedTransactions(publicAccount).subscribe((transactions) => { + accountHttp.unconfirmedTransactions(publicAccount.address).subscribe((transactions) => { expect(transactions.length).to.be.equal(0); done(); }); diff --git a/e2e/infrastructure/Listener.spec.ts b/e2e/infrastructure/Listener.spec.ts index 38a5f84b59..0db0368aaa 100644 --- a/e2e/infrastructure/Listener.spec.ts +++ b/e2e/infrastructure/Listener.spec.ts @@ -281,11 +281,11 @@ describe('Listener', () => { }); it('aggregateBondedTransactionsRemoved', (done) => { listener.confirmed(cosignAccount1.address).subscribe((res) => { - listener.aggregateBondedRemoved(cosignAccount1.address).subscribe((res) => { + listener.aggregateBondedRemoved(cosignAccount1.address).subscribe(() => { done(); }); - listener.aggregateBondedAdded(cosignAccount1.address).subscribe((res) => { - accountHttp.aggregateBondedTransactions(cosignAccount1.publicAccount).subscribe((transactions) => { + listener.aggregateBondedAdded(cosignAccount1.address).subscribe(() => { + accountHttp.aggregateBondedTransactions(cosignAccount1.publicAccount.address).subscribe((transactions) => { const transactionToCosign = transactions[0]; TransactionUtils.cosignTransaction(transactionToCosign, cosignAccount2, transactionHttp); }); @@ -321,11 +321,11 @@ describe('Listener', () => { return listener.close(); }); it('cosignatureAdded', (done) => { - listener.cosignatureAdded(cosignAccount1.address).subscribe((res) => { + listener.cosignatureAdded(cosignAccount1.address).subscribe(() => { done(); }); - listener.aggregateBondedAdded(cosignAccount1.address).subscribe((res) => { - accountHttp.aggregateBondedTransactions(cosignAccount1.publicAccount).subscribe((transactions) => { + listener.aggregateBondedAdded(cosignAccount1.address).subscribe(() => { + accountHttp.aggregateBondedTransactions(cosignAccount1.publicAccount.address).subscribe((transactions) => { const transactionToCosign = transactions[0]; TransactionUtils.cosignTransaction(transactionToCosign, cosignAccount2, transactionHttp); }); diff --git a/e2e/infrastructure/MosaicHttp.spec.ts b/e2e/infrastructure/MosaicHttp.spec.ts index 42500ef042..4f7fbae6de 100644 --- a/e2e/infrastructure/MosaicHttp.spec.ts +++ b/e2e/infrastructure/MosaicHttp.spec.ts @@ -78,6 +78,7 @@ describe('MosaicHttp', () => { supplyMutable: true, transferable: true, divisibility: 3, + duration: UInt64.fromUint(0), }), NetworkType.MIJIN_TEST, ); diff --git a/e2e/infrastructure/TransactionHttp.spec.ts b/e2e/infrastructure/TransactionHttp.spec.ts index 48ae7eedac..ff29a8ea3d 100644 --- a/e2e/infrastructure/TransactionHttp.spec.ts +++ b/e2e/infrastructure/TransactionHttp.spec.ts @@ -25,8 +25,8 @@ import { NamespaceHttp } from '../../src/infrastructure/infrastructure'; import {Listener} from '../../src/infrastructure/Listener'; import {TransactionHttp} from '../../src/infrastructure/TransactionHttp'; import {Account} from '../../src/model/account/Account'; -import { AccountRestrictionType } from '../../src/model/account/AccountRestrictionType'; import { AccountRestrictionModificationAction } from '../../src/model/account/AccountRestrictionModificationAction'; +import { AccountRestrictionType } from '../../src/model/account/AccountRestrictionType'; import {NetworkType} from '../../src/model/blockchain/NetworkType'; import { Mosaic } from '../../src/model/mosaic/Mosaic'; import {MosaicId} from '../../src/model/mosaic/MosaicId'; @@ -190,6 +190,7 @@ describe('TransactionHttp', () => { supplyMutable: true, transferable: true, divisibility: 3, + duration: UInt64.fromUint(0), restrictable: true, }), NetworkType.MIJIN_TEST, @@ -2118,7 +2119,7 @@ describe('TransactionHttp', () => { describe('transactions', () => { it('should call transactions successfully', (done) => { - accountHttp.transactions(account.publicAccount).subscribe((transactions) => { + accountHttp.transactions(account.publicAccount.address).subscribe((transactions) => { const transaction = transactions[0]; transactionId = transaction.transactionInfo!.id; transactionHash = transaction.transactionInfo!.hash; diff --git a/e2e/infrastructure/transaction/ValidateTransaction.ts b/e2e/infrastructure/transaction/ValidateTransaction.ts index d180783419..d99276ffd3 100644 --- a/e2e/infrastructure/transaction/ValidateTransaction.ts +++ b/e2e/infrastructure/transaction/ValidateTransaction.ts @@ -136,14 +136,14 @@ const ValidateTransaction = { expect(registerNamespaceTransaction.namespaceName) .to.be.equal(registerNamespaceTransactionDTO.transaction.name); deepEqual(registerNamespaceTransaction.namespaceId, - new NamespaceId(registerNamespaceTransactionDTO.transaction.namespaceId)); + new NamespaceId(UInt64.fromHex(registerNamespaceTransactionDTO.transaction.namespaceId).toDTO())); if (registerNamespaceTransaction.namespaceType === 0) { deepEqual(registerNamespaceTransaction.duration, new UInt64(registerNamespaceTransactionDTO.transaction.duration)); } else { deepEqual(registerNamespaceTransaction.parentId, - new NamespaceId(registerNamespaceTransactionDTO.transaction.parentId)); + new NamespaceId(UInt64.fromHex(registerNamespaceTransactionDTO.transaction.parentId).toDTO())); } }, validateTransferTx: (transferTransaction, transferTransactionDTO) => { diff --git a/src/infrastructure/AccountHttp.ts b/src/infrastructure/AccountHttp.ts index 4e338ce45d..43e6629f17 100644 --- a/src/infrastructure/AccountHttp.ts +++ b/src/infrastructure/AccountHttp.ts @@ -207,13 +207,13 @@ export class AccountHttp extends Http implements AccountRepository { } /** * Gets a MultisigAccountInfo for an account. - * @param publicAccount - User public account + * @param address - * Address can be created rawAddress or publicKey * @returns Observable */ - public getMultisigAccountInfo(publicAccount: PublicAccount): Observable { + public getMultisigAccountInfo(address: Address): Observable { return this.getNetworkTypeObservable().pipe( mergeMap((networkType) => observableFrom( - this.accountRoutesApi.getAccountMultisig(publicAccount.publicKey)) + this.accountRoutesApi.getAccountMultisig(address.plain())) .pipe(map((response: { response: ClientResponse; body: MultisigAccountInfoDTO; }) => { const multisigAccountInfoDTO = response.body; return new MultisigAccountInfo( @@ -232,13 +232,13 @@ export class AccountHttp extends Http implements AccountRepository { /** * Gets a MultisigAccountGraphInfo for an account. - * @param publicAccount - User publicAccount + * @param address - * Address can be created rawAddress or publicKey * @returns Observable */ - public getMultisigAccountGraphInfo(publicAccount: PublicAccount): Observable { + public getMultisigAccountGraphInfo(address: Address): Observable { return this.getNetworkTypeObservable().pipe( mergeMap((networkType) => observableFrom( - this.accountRoutesApi.getAccountMultisigGraph(publicAccount.publicKey)) + this.accountRoutesApi.getAccountMultisigGraph(address.plain())) .pipe(map((response: { response: ClientResponse; body: MultisigAccountGraphInfoDTO[]; }) => { const multisigAccountGraphInfosDTO = response.body; const multisigAccounts = new Map(); @@ -265,13 +265,13 @@ export class AccountHttp extends Http implements AccountRepository { /** * Gets an array of confirmed transactions for which an account is signer or receiver. - * @param publicAccount - User public account + * @param address - * Address can be created rawAddress or publicKey * @param queryParams - (Optional) Query params * @returns Observable */ - public transactions(publicAccount: PublicAccount, queryParams?: QueryParams): Observable { + public transactions(address: Address, queryParams?: QueryParams): Observable { return observableFrom( - this.accountRoutesApi.transactions(publicAccount.publicKey, + this.accountRoutesApi.transactions(address.plain(), this.queryParams(queryParams).pageSize, this.queryParams(queryParams).id, this.queryParams(queryParams).order)).pipe( @@ -288,13 +288,13 @@ export class AccountHttp extends Http implements AccountRepository { /** * Gets an array of transactions for which an account is the recipient of a transaction. * A transaction is said to be incoming with respect to an account if the account is the recipient of a transaction. - * @param publicAccount - User public account + * @param address - * Address can be created rawAddress or publicKey * @param queryParams - (Optional) Query params * @returns Observable */ - public incomingTransactions(publicAccount: PublicAccount, queryParams?: QueryParams): Observable { + public incomingTransactions(address: Address, queryParams?: QueryParams): Observable { return observableFrom( - this.accountRoutesApi.incomingTransactions(publicAccount.publicKey, + this.accountRoutesApi.incomingTransactions(address.plain(), this.queryParams(queryParams).pageSize, this.queryParams(queryParams).id, this.queryParams(queryParams).order)).pipe( @@ -311,13 +311,13 @@ export class AccountHttp extends Http implements AccountRepository { /** * Gets an array of transactions for which an account is the sender a transaction. * A transaction is said to be outgoing with respect to an account if the account is the sender of a transaction. - * @param publicAccount - User public account + * @param address - * Address can be created rawAddress or publicKey * @param queryParams - (Optional) Query params * @returns Observable */ - public outgoingTransactions(publicAccount: PublicAccount, queryParams?: QueryParams): Observable { + public outgoingTransactions(address: Address, queryParams?: QueryParams): Observable { return observableFrom( - this.accountRoutesApi.outgoingTransactions(publicAccount.publicKey, + this.accountRoutesApi.outgoingTransactions(address.plain(), this.queryParams(queryParams).pageSize, this.queryParams(queryParams).id, this.queryParams(queryParams).order)).pipe( @@ -335,13 +335,13 @@ export class AccountHttp extends Http implements AccountRepository { * Gets the array of transactions for which an account is the sender or receiver and which have not yet been included in a block. * Unconfirmed transactions are those transactions that have not yet been included in a block. * Unconfirmed transactions are not guaranteed to be included in any block. - * @param publicAccount - User public account + * @param address - * Address can be created rawAddress or publicKey * @param queryParams - (Optional) Query params * @returns Observable */ - public unconfirmedTransactions(publicAccount: PublicAccount, queryParams?: QueryParams): Observable { + public unconfirmedTransactions(address: Address, queryParams?: QueryParams): Observable { return observableFrom( - this.accountRoutesApi.unconfirmedTransactions(publicAccount.publicKey, + this.accountRoutesApi.unconfirmedTransactions(address.plain(), this.queryParams(queryParams).pageSize, this.queryParams(queryParams).id, this.queryParams(queryParams).order)).pipe( @@ -358,13 +358,13 @@ export class AccountHttp extends Http implements AccountRepository { /** * Gets an array of transactions for which an account is the sender or has sign the transaction. * A transaction is said to be aggregate bonded with respect to an account if there are missing signatures. - * @param publicAccount - User public account + * @param address - * Address can be created rawAddress or publicKey * @param queryParams - (Optional) Query params * @returns Observable */ - public aggregateBondedTransactions(publicAccount: PublicAccount, queryParams?: QueryParams): Observable { + public aggregateBondedTransactions(address: Address, queryParams?: QueryParams): Observable { return observableFrom( - this.accountRoutesApi.partialTransactions(publicAccount.publicKey, + this.accountRoutesApi.partialTransactions(address.plain(), this.queryParams(queryParams).pageSize, this.queryParams(queryParams).id, this.queryParams(queryParams).order)).pipe( diff --git a/src/infrastructure/AccountRepository.ts b/src/infrastructure/AccountRepository.ts index 5d3989e1cf..eb6ce27524 100644 --- a/src/infrastructure/AccountRepository.ts +++ b/src/infrastructure/AccountRepository.ts @@ -49,9 +49,8 @@ export interface AccountRepository { /** * Get readable names for a set of accountIds. - * Address can be created by calling 'Address.createFromRawAddress' or 'Address.createFromPublicKey' * Returns friendly names for accounts. - * @param accountIds List of Address + * @param accountIds List of Address - * Address can be created rawAddress or publicKey * @return Observable */ getAccountsNames(accountIds: Address[]): Observable; @@ -72,65 +71,65 @@ export interface AccountRepository { /** * Gets a MultisigAccountInfo for an account. - * @param publicAccount - User public account + * @param address - * Address can be created rawAddress or publicKey * @returns Observable */ - getMultisigAccountInfo(publicAccount: PublicAccount): Observable; + getMultisigAccountInfo(address: Address): Observable; /** * Gets a MultisigAccountGraphInfo for an account. - * @param publicAccount - User public account + * @param address - * Address can be created rawAddress or publicKey * @returns Observable */ - getMultisigAccountGraphInfo(publicAccount: PublicAccount): Observable; + getMultisigAccountGraphInfo(address: Address): Observable; /** * Gets an array of confirmed transactions for which an account is signer or receiver. - * @param publicAccount - User public account + * @param address - * Address can be created rawAddress or publicKey * @param queryParams - (Optional) Query params * @returns Observable */ - transactions(publicAccount: PublicAccount, + transactions(address: Address, queryParams?: QueryParams): Observable; /** * Gets an array of transactions for which an account is the recipient of a transaction. * A transaction is said to be incoming with respect to an account if the account is the recipient of a transaction. - * @param publicAccount - User public account + * @param address - * Address can be created rawAddress or publicKey * @param queryParams - (Optional) Query params * @returns Observable */ - incomingTransactions(publicAccount: PublicAccount, + incomingTransactions(address: Address, queryParams?: QueryParams): Observable; /** * Gets an array of transactions for which an account is the sender a transaction. * A transaction is said to be outgoing with respect to an account if the account is the sender of a transaction. - * @param publicAccount - User public account + * @param address - * Address can be created rawAddress or publicKey * @param queryParams - (Optional) Query params * @returns Observable */ - outgoingTransactions(publicAccount: PublicAccount, + outgoingTransactions(address: Address, queryParams?: QueryParams): Observable; /** * Gets the array of transactions for which an account is the sender or receiver and which have not yet been included in a block. * Unconfirmed transactions are those transactions that have not yet been included in a block. * Unconfirmed transactions are not guaranteed to be included in any block. - * @param publicAccount - User public account + * @param address - * Address can be created rawAddress or publicKey * @param queryParams - (Optional) Query params * @returns Observable */ - unconfirmedTransactions(publicAccount: PublicAccount, + unconfirmedTransactions(address: Address, queryParams?: QueryParams): Observable; /** * Gets an array of transactions for which an account is the sender or has sign the transaction. * A transaction is said to be aggregate bonded with respect to an account if there are missing signatures. - * @param publicAccount - User public account + * @param address - * Address can be created rawAddress or publicKey * @param queryParams - (Optional) Query params * @returns Observable */ - aggregateBondedTransactions(publicAccount: PublicAccount, + aggregateBondedTransactions(address: Address, queryParams?: QueryParams): Observable; } diff --git a/src/infrastructure/MosaicHttp.ts b/src/infrastructure/MosaicHttp.ts index f436baedf4..27ca2383bf 100644 --- a/src/infrastructure/MosaicHttp.ts +++ b/src/infrastructure/MosaicHttp.ts @@ -22,7 +22,6 @@ import {MosaicId} from '../model/mosaic/MosaicId'; import {MosaicInfo} from '../model/mosaic/MosaicInfo'; import { MosaicNames } from '../model/mosaic/MosaicNames'; import {MosaicProperties} from '../model/mosaic/MosaicProperties'; -import { MosaicPropertyType } from '../model/mosaic/MosaicPropertyType'; import {NamespaceId} from '../model/namespace/NamespaceId'; import { NamespaceName } from '../model/namespace/NamespaceName'; import {UInt64} from '../model/UInt64'; @@ -84,9 +83,9 @@ export class MosaicHttp extends Http implements MosaicRepository { PublicAccount.createFromPublicKey(mosaicInfoDTO.mosaic.ownerPublicKey, networkType), mosaicInfoDTO.mosaic.revision, new MosaicProperties( - mosaicFlag ? UInt64.fromUint(mosaicFlag) : UInt64.fromUint(0), - (divisibility ? divisibility : 0), - duration ? UInt64.fromNumericString(duration) : undefined, + mosaicFlag, + divisibility, + UInt64.fromNumericString(duration), ), ); }), @@ -129,9 +128,9 @@ export class MosaicHttp extends Http implements MosaicRepository { PublicAccount.createFromPublicKey(mosaicInfoDTO.mosaic.ownerPublicKey, networkType), mosaicInfoDTO.mosaic.revision, new MosaicProperties( - mosaicFlag ? UInt64.fromUint(mosaicFlag) : UInt64.fromUint(0), - (divisibility ? divisibility : 0), - duration ? UInt64.fromNumericString(duration) : undefined, + mosaicFlag, + divisibility, + UInt64.fromNumericString(duration), ), ); }); diff --git a/src/infrastructure/NamespaceHttp.ts b/src/infrastructure/NamespaceHttp.ts index 75a353816e..9a6aa62b71 100644 --- a/src/infrastructure/NamespaceHttp.ts +++ b/src/infrastructure/NamespaceHttp.ts @@ -178,9 +178,9 @@ export class NamespaceHttp extends Http implements NamespaceRepository { const namespaceNamesDTO = response.body; return namespaceNamesDTO.map((namespaceNameDTO) => { return new NamespaceName( - new NamespaceId(namespaceNameDTO.namespaceId), + new NamespaceId(UInt64.fromHex(namespaceNameDTO.namespaceId).toDTO()), namespaceNameDTO.name, - namespaceNameDTO.parentId ? new NamespaceId(namespaceNameDTO.parentId) : undefined, + namespaceNameDTO.parentId ? new NamespaceId(UInt64.fromHex(namespaceNameDTO.parentId).toDTO()) : undefined, ); }); }), diff --git a/src/infrastructure/api/accountRoutesApi.ts b/src/infrastructure/api/accountRoutesApi.ts index 0031f2febe..6f32b3dc29 100644 --- a/src/infrastructure/api/accountRoutesApi.ts +++ b/src/infrastructure/api/accountRoutesApi.ts @@ -471,21 +471,21 @@ export class AccountRoutesApi { /** * Gets an array of incoming transactions. A transaction is said to be incoming with respect to an account if the account is the recipient of the transaction. * @summary Get incoming transactions - * @param publicKey Public key. + * @param accountId Account public key or address. * @param pageSize Number of transactions to return for each request. * @param id Transaction identifier up to which transactions are returned. * @param ordering Ordering criteria: * -id - Descending order by id. * id - Ascending order by id. */ - public async incomingTransactions (publicKey: string, pageSize?: number, id?: string, ordering?: string, options: {headers: {[name: string]: string}} = {headers: {}}) : Promise<{ response: http.ClientResponse; body: Array; }> { - const localVarPath = this.basePath + '/account/{publicKey}/transactions/incoming' - .replace('{' + 'publicKey' + '}', encodeURIComponent(String(publicKey))); + public async incomingTransactions (accountId: string, pageSize?: number, id?: string, ordering?: string, options: {headers: {[name: string]: string}} = {headers: {}}) : Promise<{ response: http.ClientResponse; body: Array; }> { + const localVarPath = this.basePath + '/account/{accountId}/transactions/incoming' + .replace('{' + 'accountId' + '}', encodeURIComponent(String(accountId))); let localVarQueryParameters: any = {}; let localVarHeaderParams: any = (Object).assign({}, this.defaultHeaders); let localVarFormParams: any = {}; - // verify required parameter 'publicKey' is not null or undefined - if (publicKey === null || publicKey === undefined) { - throw new Error('Required parameter publicKey was null or undefined when calling incomingTransactions.'); + // verify required parameter 'accountId' is not null or undefined + if (accountId === null || accountId === undefined) { + throw new Error('Required parameter accountId was null or undefined when calling incomingTransactions.'); } if (pageSize !== undefined) { @@ -542,21 +542,21 @@ export class AccountRoutesApi { /** * Gets an array of outgoing transactions. A transaction is said to be outgoing with respect to an account if the account is the sender of the transaction. * @summary Get outgoing transactions - * @param publicKey Public key. + * @param accountId Account public key or address. * @param pageSize Number of transactions to return for each request. * @param id Transaction identifier up to which transactions are returned. * @param ordering Ordering criteria: * -id - Descending order by id. * id - Ascending order by id. */ - public async outgoingTransactions (publicKey: string, pageSize?: number, id?: string, ordering?: string, options: {headers: {[name: string]: string}} = {headers: {}}) : Promise<{ response: http.ClientResponse; body: Array; }> { - const localVarPath = this.basePath + '/account/{publicKey}/transactions/outgoing' - .replace('{' + 'publicKey' + '}', encodeURIComponent(String(publicKey))); + public async outgoingTransactions (accountId: string, pageSize?: number, id?: string, ordering?: string, options: {headers: {[name: string]: string}} = {headers: {}}) : Promise<{ response: http.ClientResponse; body: Array; }> { + const localVarPath = this.basePath + '/account/{accountId}/transactions/outgoing' + .replace('{' + 'accountId' + '}', encodeURIComponent(String(accountId))); let localVarQueryParameters: any = {}; let localVarHeaderParams: any = (Object).assign({}, this.defaultHeaders); let localVarFormParams: any = {}; - // verify required parameter 'publicKey' is not null or undefined - if (publicKey === null || publicKey === undefined) { - throw new Error('Required parameter publicKey was null or undefined when calling outgoingTransactions.'); + // verify required parameter 'accountId' is not null or undefined + if (accountId === null || accountId === undefined) { + throw new Error('Required parameter accountId was null or undefined when calling outgoingTransactions.'); } if (pageSize !== undefined) { @@ -613,21 +613,21 @@ export class AccountRoutesApi { /** * Gets an array of aggregate bonded transactions where the account is the sender or requires to cosign the transaction. * @summary Get aggregate bonded transactions information - * @param publicKey Public key. + * @param accountId Account public key or address. * @param pageSize Number of transactions to return for each request. * @param id Transaction identifier up to which transactions are returned. * @param ordering Ordering criteria: * -id - Descending order by id. * id - Ascending order by id. */ - public async partialTransactions (publicKey: string, pageSize?: number, id?: string, ordering?: string, options: {headers: {[name: string]: string}} = {headers: {}}) : Promise<{ response: http.ClientResponse; body: Array; }> { - const localVarPath = this.basePath + '/account/{publicKey}/transactions/partial' - .replace('{' + 'publicKey' + '}', encodeURIComponent(String(publicKey))); + public async partialTransactions (accountId: string, pageSize?: number, id?: string, ordering?: string, options: {headers: {[name: string]: string}} = {headers: {}}) : Promise<{ response: http.ClientResponse; body: Array; }> { + const localVarPath = this.basePath + '/account/{accountId}/transactions/partial' + .replace('{' + 'accountId' + '}', encodeURIComponent(String(accountId))); let localVarQueryParameters: any = {}; let localVarHeaderParams: any = (Object).assign({}, this.defaultHeaders); let localVarFormParams: any = {}; - // verify required parameter 'publicKey' is not null or undefined - if (publicKey === null || publicKey === undefined) { - throw new Error('Required parameter publicKey was null or undefined when calling partialTransactions.'); + // verify required parameter 'accountId' is not null or undefined + if (accountId === null || accountId === undefined) { + throw new Error('Required parameter accountId was null or undefined when calling partialTransactions.'); } if (pageSize !== undefined) { @@ -684,21 +684,21 @@ export class AccountRoutesApi { /** * Gets an array of transactions for which an account is the sender or receiver. * @summary Get confirmed transactions - * @param publicKey Public key. + * @param accountId Account public key or address. * @param pageSize Number of transactions to return for each request. * @param id Transaction identifier up to which transactions are returned. * @param ordering Ordering criteria: * -id - Descending order by id. * id - Ascending order by id. */ - public async transactions (publicKey: string, pageSize?: number, id?: string, ordering?: string, options: {headers: {[name: string]: string}} = {headers: {}}) : Promise<{ response: http.ClientResponse; body: Array; }> { - const localVarPath = this.basePath + '/account/{publicKey}/transactions' - .replace('{' + 'publicKey' + '}', encodeURIComponent(String(publicKey))); + public async transactions (accountId: string, pageSize?: number, id?: string, ordering?: string, options: {headers: {[name: string]: string}} = {headers: {}}) : Promise<{ response: http.ClientResponse; body: Array; }> { + const localVarPath = this.basePath + '/account/{accountId}/transactions' + .replace('{' + 'accountId' + '}', encodeURIComponent(String(accountId))); let localVarQueryParameters: any = {}; let localVarHeaderParams: any = (Object).assign({}, this.defaultHeaders); let localVarFormParams: any = {}; - // verify required parameter 'publicKey' is not null or undefined - if (publicKey === null || publicKey === undefined) { - throw new Error('Required parameter publicKey was null or undefined when calling transactions.'); + // verify required parameter 'accountId' is not null or undefined + if (accountId === null || accountId === undefined) { + throw new Error('Required parameter accountId was null or undefined when calling transactions.'); } if (pageSize !== undefined) { @@ -755,21 +755,21 @@ export class AccountRoutesApi { /** * Gets the array of transactions not included in a block where an account is the sender or receiver. * @summary Get unconfirmed transactions - * @param publicKey Public key. + * @param accountId Account public key or address. * @param pageSize Number of transactions to return for each request. * @param id Transaction identifier up to which transactions are returned. * @param ordering Ordering criteria: * -id - Descending order by id. * id - Ascending order by id. */ - public async unconfirmedTransactions (publicKey: string, pageSize?: number, id?: string, ordering?: string, options: {headers: {[name: string]: string}} = {headers: {}}) : Promise<{ response: http.ClientResponse; body: Array; }> { - const localVarPath = this.basePath + '/account/{publicKey}/transactions/unconfirmed' - .replace('{' + 'publicKey' + '}', encodeURIComponent(String(publicKey))); + public async unconfirmedTransactions (accountId: string, pageSize?: number, id?: string, ordering?: string, options: {headers: {[name: string]: string}} = {headers: {}}) : Promise<{ response: http.ClientResponse; body: Array; }> { + const localVarPath = this.basePath + '/account/{accountId}/transactions/unconfirmed' + .replace('{' + 'accountId' + '}', encodeURIComponent(String(accountId))); let localVarQueryParameters: any = {}; let localVarHeaderParams: any = (Object).assign({}, this.defaultHeaders); let localVarFormParams: any = {}; - // verify required parameter 'publicKey' is not null or undefined - if (publicKey === null || publicKey === undefined) { - throw new Error('Required parameter publicKey was null or undefined when calling unconfirmedTransactions.'); + // verify required parameter 'accountId' is not null or undefined + if (accountId === null || accountId === undefined) { + throw new Error('Required parameter accountId was null or undefined when calling unconfirmedTransactions.'); } if (pageSize !== undefined) { diff --git a/src/infrastructure/model/mosaicsNamesDTO.ts b/src/infrastructure/model/mosaicsNamesDTO.ts index ce9a87db83..617cd3fa47 100644 --- a/src/infrastructure/model/mosaicsNamesDTO.ts +++ b/src/infrastructure/model/mosaicsNamesDTO.ts @@ -38,7 +38,7 @@ export class MosaicsNamesDTO { static attributeTypeMap: Array<{name: string, baseName: string, type: string}> = [ { "name": "mosaicNames", - "baseName": "accountNames", + "baseName": "mosaicNames", "type": "Array" } ]; diff --git a/src/infrastructure/receipt/CreateReceiptFromDTO.ts b/src/infrastructure/receipt/CreateReceiptFromDTO.ts index 6b0cb84eba..1cff8ea86e 100644 --- a/src/infrastructure/receipt/CreateReceiptFromDTO.ts +++ b/src/infrastructure/receipt/CreateReceiptFromDTO.ts @@ -45,9 +45,9 @@ import {UInt64} from '../../model/UInt64'; */ export const CreateStatementFromDTO = (receiptDTO, networkType): Statement => { return new Statement( - receiptDTO.transactionStatements.map((statement) => createTransactionStatement(statement, networkType)), - receiptDTO.addressResolutionStatements.map((statement) => createResolutionStatement(statement, ResolutionType.Address)), - receiptDTO.mosaicResolutionStatements.map((statement) => createResolutionStatement(statement, ResolutionType.Mosaic)), + receiptDTO.transactionStatements.map((statement) => createTransactionStatement(statement.statement, networkType)), + receiptDTO.addressResolutionStatements.map((statement) => createResolutionStatement(statement.statement, ResolutionType.Address)), + receiptDTO.mosaicResolutionStatements.map((statement) => createResolutionStatement(statement.statement, ResolutionType.Mosaic)), ); }; @@ -100,7 +100,6 @@ const createResolutionStatement = (statementDTO, resolutionType): ResolutionStat }), ); case ResolutionType.Mosaic: - console.log(statementDTO); return new ResolutionStatement( UInt64.fromNumericString(statementDTO.height), new MosaicId(statementDTO.unresolved), diff --git a/src/infrastructure/transaction/CreateTransactionFromDTO.ts b/src/infrastructure/transaction/CreateTransactionFromDTO.ts index 8d866f8925..a6d62fd368 100644 --- a/src/infrastructure/transaction/CreateTransactionFromDTO.ts +++ b/src/infrastructure/transaction/CreateTransactionFromDTO.ts @@ -22,7 +22,6 @@ import {Id} from '../../model/Id'; import {Mosaic} from '../../model/mosaic/Mosaic'; import {MosaicId} from '../../model/mosaic/MosaicId'; import {MosaicProperties} from '../../model/mosaic/MosaicProperties'; -import { MosaicPropertyType } from '../../model/mosaic/MosaicPropertyType'; import {NamespaceId} from '../../model/namespace/NamespaceId'; import {AccountAddressRestrictionTransaction} from '../../model/transaction/AccountAddressRestrictionTransaction'; import { AccountLinkTransaction } from '../../model/transaction/AccountLinkTransaction'; @@ -165,7 +164,7 @@ const CreateStandaloneTransactionFromDTO = (transactionDTO, transactionInfo): Tr transactionDTO.nonce, new MosaicId(transactionDTO.id), new MosaicProperties( - UInt64.fromUint(transactionDTO.flags), + transactionDTO.flags, transactionDTO.divisibility, UInt64.fromNumericString(transactionDTO.duration), ), @@ -380,7 +379,6 @@ const CreateStandaloneTransactionFromDTO = (transactionDTO, transactionInfo): Tr transactionInfo, ); } else if (transactionDTO.type === TransactionType.ACCOUNT_METADATA_TRANSACTION) { - console.log('AccountMetadataTransaction', transactionDTO); return new AccountMetadataTransaction( extractNetworkType(transactionDTO.version), extractTransactionVersion(transactionDTO.version), @@ -419,7 +417,7 @@ const CreateStandaloneTransactionFromDTO = (transactionDTO, transactionInfo): Tr UInt64.fromNumericString(transactionDTO.maxFee || '0'), transactionDTO.targetPublicKey, UInt64.fromNumericString(transactionDTO.scopedMetadataKey), - new NamespaceId(transactionDTO.targetNamespaceId), + new NamespaceId(UInt64.fromHex(transactionDTO.targetNamespaceId).toDTO()), transactionDTO.valueSizeDelta, convert.hexToUint8(transactionDTO.value), transactionDTO.signature, @@ -476,7 +474,7 @@ export const extractRecipient = (recipientAddress: any): Address | NamespaceId if (recipientAddress.hasOwnProperty('address')) { return Address.createFromRawAddress(recipientAddress.address); } else if (recipientAddress.hasOwnProperty('id')) { - return new NamespaceId(recipientAddress.id); + return new NamespaceId(UInt64.fromHex(recipientAddress.id).toDTO()); } } throw new Error(`Recipient: ${recipientAddress} type is not recognised`); diff --git a/src/infrastructure/transaction/SerializeTransactionToJSON.ts b/src/infrastructure/transaction/SerializeTransactionToJSON.ts index 291c90e67e..074b2dc816 100644 --- a/src/infrastructure/transaction/SerializeTransactionToJSON.ts +++ b/src/infrastructure/transaction/SerializeTransactionToJSON.ts @@ -54,7 +54,7 @@ export const SerializeTransactionToJSON = (transaction: Transaction): any => { case TransactionType.ADDRESS_ALIAS: return { aliasAction: (transaction as AddressAliasTransaction).aliasAction, - namespaceId: (transaction as AddressAliasTransaction).namespaceId.toDTO(), + namespaceId: (transaction as AddressAliasTransaction).namespaceId.toHex(), address: (transaction as AddressAliasTransaction).address.toDTO(), }; case TransactionType.AGGREGATE_BONDED: @@ -70,8 +70,8 @@ export const SerializeTransactionToJSON = (transaction: Transaction): any => { case TransactionType.LOCK: return { mosaicId: (transaction as LockFundsTransaction).mosaic.id.id, - amount: (transaction as LockFundsTransaction).mosaic.amount.toDTO(), - duration: (transaction as LockFundsTransaction).duration.toDTO(), + amount: (transaction as LockFundsTransaction).mosaic.amount.toString(), + duration: (transaction as LockFundsTransaction).duration.toString(), hash: (transaction as LockFundsTransaction).hash, }; case TransactionType.ACCOUNT_RESTRICTION_ADDRESS: @@ -108,20 +108,23 @@ export const SerializeTransactionToJSON = (transaction: Transaction): any => { case TransactionType.MOSAIC_ALIAS: return { aliasAction: (transaction as MosaicAliasTransaction).aliasAction, - namespaceId: (transaction as MosaicAliasTransaction).namespaceId.toDTO(), - mosaicId: (transaction as MosaicAliasTransaction).mosaicId.toDTO(), + namespaceId: (transaction as MosaicAliasTransaction).namespaceId.toHex(), + mosaicId: (transaction as MosaicAliasTransaction).mosaicId.toHex(), }; case TransactionType.MOSAIC_DEFINITION: + const properties = (transaction as MosaicDefinitionTransaction).mosaicProperties.toDTO(); return { nonce: (transaction as MosaicDefinitionTransaction).nonce, - mosaicId: (transaction as MosaicDefinitionTransaction).mosaicId.toDTO(), - properties: (transaction as MosaicDefinitionTransaction).mosaicProperties.toDTO(), + mosaicId: (transaction as MosaicDefinitionTransaction).mosaicId.toHex(), + flags: properties.flags, + divisibility: properties.divisibility, + duration: properties.duration, }; case TransactionType.MOSAIC_SUPPLY_CHANGE: return { - mosaicId: (transaction as MosaicSupplyChangeTransaction).mosaicId.toDTO(), + mosaicId: (transaction as MosaicSupplyChangeTransaction).mosaicId.toHex(), direction: (transaction as MosaicSupplyChangeTransaction).direction, - delta: (transaction as MosaicSupplyChangeTransaction).delta.toDTO(), + delta: (transaction as MosaicSupplyChangeTransaction).delta.toString(), }; case TransactionType.REGISTER_NAMESPACE: const registerNamespaceDuration = (transaction as NamespaceRegistrationTransaction).duration; @@ -130,21 +133,21 @@ export const SerializeTransactionToJSON = (transaction: Transaction): any => { const jsonObject = { namespaceType: (transaction as NamespaceRegistrationTransaction).namespaceType, namespaceName: (transaction as NamespaceRegistrationTransaction).namespaceName, - namespaceId: (transaction as NamespaceRegistrationTransaction).namespaceId.toDTO(), + id: (transaction as NamespaceRegistrationTransaction).namespaceId.toHex(), }; if (registerNamespaceDuration) { - Object.assign(jsonObject, {duration: registerNamespaceDuration.toDTO()}); + Object.assign(jsonObject, {duration: registerNamespaceDuration.toString()}); } if (registerNamespaceParentId) { - Object.assign(jsonObject, {parentId: registerNamespaceParentId.toDTO()}); + Object.assign(jsonObject, {parentId: registerNamespaceParentId.toHex()}); } return jsonObject; case TransactionType.SECRET_LOCK: return { mosaicId: (transaction as SecretLockTransaction).mosaic.id.id, - amount: (transaction as SecretLockTransaction).mosaic.amount.toDTO(), - duration: (transaction as SecretLockTransaction).duration.toDTO(), + amount: (transaction as SecretLockTransaction).mosaic.amount.toString(), + duration: (transaction as SecretLockTransaction).duration.toString(), hashAlgorithm: (transaction as SecretLockTransaction).hashType, secret: (transaction as SecretLockTransaction).secret, recipientAddress: (transaction as SecretLockTransaction).recipientAddress.toDTO(), @@ -166,27 +169,27 @@ export const SerializeTransactionToJSON = (transaction: Transaction): any => { }; case TransactionType.MOSAIC_GLOBAL_RESTRICTION: return { - mosaicId: (transaction as MosaicGlobalRestrictionTransaction).mosaicId.toDTO(), - referenceMosaicId: (transaction as MosaicGlobalRestrictionTransaction).referenceMosaicId.toDTO(), - restrictionKey: (transaction as MosaicGlobalRestrictionTransaction).restrictionKey.toDTO(), - previousRestrictionValue: (transaction as MosaicGlobalRestrictionTransaction).previousRestrictionValue.toDTO(), + mosaicId: (transaction as MosaicGlobalRestrictionTransaction).mosaicId.toHex(), + referenceMosaicId: (transaction as MosaicGlobalRestrictionTransaction).referenceMosaicId.toHex(), + restrictionKey: (transaction as MosaicGlobalRestrictionTransaction).restrictionKey.toString(), + previousRestrictionValue: (transaction as MosaicGlobalRestrictionTransaction).previousRestrictionValue.toString(), previousRestrictionType: (transaction as MosaicGlobalRestrictionTransaction).previousRestrictionType, - newRestrictionValue: (transaction as MosaicGlobalRestrictionTransaction).newRestrictionValue.toDTO(), + newRestrictionValue: (transaction as MosaicGlobalRestrictionTransaction).newRestrictionValue.toString(), newRestrictionType: (transaction as MosaicGlobalRestrictionTransaction).newRestrictionType, }; case TransactionType.MOSAIC_ADDRESS_RESTRICTION: return { - mosaicId: (transaction as MosaicAddressRestrictionTransaction).mosaicId.toDTO(), - restrictionKey: (transaction as MosaicAddressRestrictionTransaction).restrictionKey.toDTO(), + mosaicId: (transaction as MosaicAddressRestrictionTransaction).mosaicId.toHex(), + restrictionKey: (transaction as MosaicAddressRestrictionTransaction).restrictionKey.toString(), targetAddress: (transaction as MosaicAddressRestrictionTransaction).targetAddress.toDTO(), - previousRestrictionValue: (transaction as MosaicAddressRestrictionTransaction).previousRestrictionValue.toDTO(), - newRestrictionValue: (transaction as MosaicAddressRestrictionTransaction).newRestrictionValue.toDTO(), + previousRestrictionValue: (transaction as MosaicAddressRestrictionTransaction).previousRestrictionValue.toString(), + newRestrictionValue: (transaction as MosaicAddressRestrictionTransaction).newRestrictionValue.toString(), }; case TransactionType.ACCOUNT_METADATA_TRANSACTION: return { targetPublicKey: (transaction as AccountMetadataTransaction).targetPublicKey, - scopedMetadataKey: (transaction as AccountMetadataTransaction).scopedMetadataKey.toDTO(), + scopedMetadataKey: (transaction as AccountMetadataTransaction).scopedMetadataKey.toString(), valueSizeDelta: (transaction as AccountMetadataTransaction).valueSizeDelta, valueSize: (transaction as AccountMetadataTransaction).value.length, value: Convert.uint8ToHex((transaction as AccountMetadataTransaction).value), @@ -195,9 +198,9 @@ export const SerializeTransactionToJSON = (transaction: Transaction): any => { case TransactionType.MOSAIC_METADATA_TRANSACTION: return { targetPublicKey: (transaction as MosaicMetadataTransaction).targetPublicKey, - scopedMetadataKey: (transaction as MosaicMetadataTransaction).scopedMetadataKey.toDTO(), + scopedMetadataKey: (transaction as MosaicMetadataTransaction).scopedMetadataKey.toString(), valueSizeDelta: (transaction as MosaicMetadataTransaction).valueSizeDelta, - targetMosaicId: (transaction as MosaicMetadataTransaction).targetMosaicId.id.toDTO(), + targetMosaicId: (transaction as MosaicMetadataTransaction).targetMosaicId.id.toHex(), valueSize: (transaction as MosaicMetadataTransaction).value.length, value: Convert.uint8ToHex((transaction as MosaicMetadataTransaction).value), @@ -205,9 +208,9 @@ export const SerializeTransactionToJSON = (transaction: Transaction): any => { case TransactionType.NAMESPACE_METADATA_TRANSACTION: return { targetPublicKey: (transaction as NamespaceMetadataTransaction).targetPublicKey, - scopedMetadataKey: (transaction as NamespaceMetadataTransaction).scopedMetadataKey.toDTO(), + scopedMetadataKey: (transaction as NamespaceMetadataTransaction).scopedMetadataKey.toString(), valueSizeDelta: (transaction as NamespaceMetadataTransaction).valueSizeDelta, - targetNamespaceId: (transaction as NamespaceMetadataTransaction).targetNamespaceId.id.toDTO(), + targetNamespaceId: (transaction as NamespaceMetadataTransaction).targetNamespaceId.id.toHex(), valueSize: (transaction as NamespaceMetadataTransaction).value.length, value: Convert.uint8ToHex((transaction as NamespaceMetadataTransaction).value), diff --git a/src/model/Id.ts b/src/model/Id.ts index a2a2e3b5d6..c7dff7defa 100644 --- a/src/model/Id.ts +++ b/src/model/Id.ts @@ -35,7 +35,7 @@ export class Id extends UInt64 { const part1 = this.higher.toString(16); const part2 = this.lower.toString(16); - return this.pad(part1, 8) + this.pad(part2, 8); + return (this.pad(part1, 8) + this.pad(part2, 8)).toUpperCase(); } /** diff --git a/src/model/UInt64.ts b/src/model/UInt64.ts index bf0e54af96..0d8916ff48 100644 --- a/src/model/UInt64.ts +++ b/src/model/UInt64.ts @@ -98,6 +98,15 @@ export class UInt64 { return uint64.toHex(this.toDTO()); } + /** + * Get numeric string representation + * + * @return {string} + */ + public toString(): string { + return this.compact().toString(); + } + /** * Compact higher and lower uint parts into a uint * @returns {number} diff --git a/src/model/model.ts b/src/model/model.ts index 45c2a98c64..696f98ba8a 100644 --- a/src/model/model.ts +++ b/src/model/model.ts @@ -56,7 +56,6 @@ export * from '../service/MosaicAmountView'; export * from './mosaic/NetworkCurrencyMosaic'; export * from './mosaic/NetworkHarvestMosaic'; export * from './mosaic/MosaicNames'; -export * from './mosaic/MosaicPropertyType'; export * from './mosaic/MosaicRestrictionType'; // Namespace diff --git a/src/model/mosaic/Mosaic.ts b/src/model/mosaic/Mosaic.ts index ab39f08193..2b392b9e3d 100644 --- a/src/model/mosaic/Mosaic.ts +++ b/src/model/mosaic/Mosaic.ts @@ -48,8 +48,8 @@ export class Mosaic { */ public toDTO() { return { - amount: this.amount.toDTO(), - id: this.id.id.toDTO(), + amount: this.amount.toString(), + id: this.id.id.toHex(), }; } diff --git a/src/model/mosaic/MosaicId.ts b/src/model/mosaic/MosaicId.ts index d46c109152..c16e12ef62 100644 --- a/src/model/mosaic/MosaicId.ts +++ b/src/model/mosaic/MosaicId.ts @@ -67,7 +67,7 @@ export class MosaicId { * @returns {string} */ public toHex(): string { - return this.id.toHex(); + return this.id.toHex().toUpperCase(); } /** diff --git a/src/model/mosaic/MosaicInfo.ts b/src/model/mosaic/MosaicInfo.ts index 078bcd3d9e..1077924abe 100644 --- a/src/model/mosaic/MosaicInfo.ts +++ b/src/model/mosaic/MosaicInfo.ts @@ -73,7 +73,7 @@ export class MosaicInfo { * Mosaic duration * @returns {UInt64} */ - public get duration(): UInt64 | undefined { + public get duration(): UInt64 { return this.properties.duration; } diff --git a/src/model/mosaic/MosaicProperties.ts b/src/model/mosaic/MosaicProperties.ts index e7ff66be40..17fa8c6b62 100644 --- a/src/model/mosaic/MosaicProperties.ts +++ b/src/model/mosaic/MosaicProperties.ts @@ -15,7 +15,6 @@ */ import {UInt64} from '../UInt64'; -import { MosaicPropertyType } from './MosaicPropertyType'; /** * Mosaic properties model @@ -48,7 +47,7 @@ export class MosaicProperties { * @param divisibility * @param duration */ - constructor(flags: UInt64, + constructor(flags: number, /** * The divisibility determines up to what decimal place the mosaic can be divided into. * Thus a divisibility of 3 means that a mosaic can be divided into smallest parts of 0.001 mosaics @@ -63,8 +62,8 @@ export class MosaicProperties { * After the duration finishes mosaic is inactive and can be renewed. * Duration is optional when defining the mosaic */ - public readonly duration?: UInt64) { - let binaryFlags = '00' + (flags.lower >>> 0).toString(2); + public readonly duration: UInt64) { + let binaryFlags = '00' + (flags >>> 0).toString(2); binaryFlags = binaryFlags.substr(binaryFlags.length - 3, 3); this.supplyMutable = binaryFlags[2] === '1'; this.transferable = binaryFlags[1] === '1'; @@ -80,29 +79,22 @@ export class MosaicProperties { supplyMutable: boolean, transferable: boolean, divisibility: number, + duration: UInt64, restrictable?: boolean, - duration?: UInt64, }) { const restrictable = params.restrictable ? 4 : 0; const flags = (params.supplyMutable ? 1 : 0) + (params.transferable ? 2 : 0) + restrictable; - return new MosaicProperties(UInt64.fromUint(flags), params.divisibility, params.duration); + return new MosaicProperties(flags, params.divisibility, params.duration); } /** * Create DTO object */ toDTO() { - const dto = [ - {id: MosaicPropertyType.MosaicFlags, value: UInt64.fromUint((this.supplyMutable ? 1 : 0) + - (this.transferable ? 2 : 0) + - (this.transferable ? 4 : 0)).toDTO()}, - {id: MosaicPropertyType.Divisibility, value: UInt64.fromUint(this.divisibility).toDTO()}, - ]; - - if (this.duration !== undefined) { - dto.push({id: MosaicPropertyType.Duration, value: this.duration.toDTO()}); - } - - return dto; + return { + flags: (this.supplyMutable ? 1 : 0) + (this.transferable ? 2 : 0) + (this.transferable ? 4 : 0), + divisibility: this.divisibility, + duration: this.duration ? this.duration.toString() : '0', + }; } } diff --git a/src/model/mosaic/MosaicPropertyType.ts b/src/model/mosaic/MosaicPropertyType.ts deleted file mode 100644 index e98c72bd94..0000000000 --- a/src/model/mosaic/MosaicPropertyType.ts +++ /dev/null @@ -1,27 +0,0 @@ -/* - * Copyright 2019 NEM - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -/** - * The mosaic property id means: - * 0 - MosaicFlags - * 1 - Divisibility - * 2 - Duration - */ -export enum MosaicPropertyType { - MosaicFlags = 0, - Divisibility = 1, - Duration = 2, -} diff --git a/src/model/namespace/NamespaceId.ts b/src/model/namespace/NamespaceId.ts index d0b4af4767..c056c698b1 100644 --- a/src/model/namespace/NamespaceId.ts +++ b/src/model/namespace/NamespaceId.ts @@ -86,7 +86,7 @@ export class NamespaceId { */ public toDTO() { return { - id: this.id.toDTO(), + id: this.id.toHex(), fullName: this.fullName ? this.fullName : '', }; } diff --git a/src/model/transaction/Deadline.ts b/src/model/transaction/Deadline.ts index b912a03ac0..8b0c062278 100644 --- a/src/model/transaction/Deadline.ts +++ b/src/model/transaction/Deadline.ts @@ -82,4 +82,13 @@ export class Deadline { (this.value.atZone(ZoneId.SYSTEM).toInstant().toEpochMilli() - Deadline.timestampNemesisBlock * 1000), ).toDTO(); } + + /** + * @internal + */ + public toString(): string { + return UInt64.fromUint( + (this.value.atZone(ZoneId.SYSTEM).toInstant().toEpochMilli() - Deadline.timestampNemesisBlock * 1000), + ).toString(); + } } diff --git a/src/model/transaction/Transaction.ts b/src/model/transaction/Transaction.ts index 35f496d0cf..0ee907d713 100644 --- a/src/model/transaction/Transaction.ts +++ b/src/model/transaction/Transaction.ts @@ -277,8 +277,8 @@ export abstract class Transaction { type: this.type, networkType: this.networkType, version: this.versionToDTO(), - maxFee: this.maxFee.toDTO(), - deadline: this.deadline.toDTO(), + maxFee: this.maxFee.toString(), + deadline: this.deadline.toString(), signature: this.signature ? this.signature : '', }; diff --git a/src/service/AggregateTransactionService.ts b/src/service/AggregateTransactionService.ts index 376b648d96..0cf768939c 100644 --- a/src/service/AggregateTransactionService.ts +++ b/src/service/AggregateTransactionService.ts @@ -20,9 +20,9 @@ import { TransactionMapping } from '../core/utils/TransactionMapping'; import { AccountHttp } from '../infrastructure/AccountHttp'; import { MultisigAccountGraphInfo } from '../model/account/MultisigAccountGraphInfo'; import { AggregateTransaction } from '../model/transaction/AggregateTransaction'; +import { CosignatoryModificationAction } from '../model/transaction/CosignatoryModificationAction'; import { InnerTransaction } from '../model/transaction/InnerTransaction'; import { MultisigAccountModificationTransaction } from '../model/transaction/MultisigAccountModificationTransaction'; -import { CosignatoryModificationAction } from '../model/transaction/CosignatoryModificationAction'; import { SignedTransaction } from '../model/transaction/SignedTransaction'; import { TransactionType } from '../model/transaction/TransactionType'; @@ -53,13 +53,13 @@ export class AggregateTransactionService { signers.push(signedTransaction.signerPublicKey); } return observableFrom(aggregateTransaction.innerTransactions).pipe( - mergeMap((innerTransaction) => this.accountHttp.getMultisigAccountInfo(innerTransaction.signer) + mergeMap((innerTransaction) => this.accountHttp.getMultisigAccountInfo(innerTransaction.signer.address) .pipe( /** * For multisig account, we need to get the graph info in case it has multiple levels */ mergeMap((_) => _.minApproval !== 0 && _.minRemoval !== 0 ? - this.accountHttp.getMultisigAccountGraphInfo(_.account) + this.accountHttp.getMultisigAccountGraphInfo(_.account.address) .pipe( map((graphInfo) => this.validateCosignatories(graphInfo, signers, innerTransaction)), ) : observableOf(signers.find((s) => s === _.account.publicKey ) !== undefined), diff --git a/test/core/utils/TransactionMapping.spec.ts b/test/core/utils/TransactionMapping.spec.ts index d69f24dbfa..ff1d6d7212 100644 --- a/test/core/utils/TransactionMapping.spec.ts +++ b/test/core/utils/TransactionMapping.spec.ts @@ -221,6 +221,7 @@ describe('TransactionMapping - createFromPayload', () => { supplyMutable: false, transferable: false, divisibility: 3, + duration: UInt64.fromUint(0), }), NetworkType.MIJIN_TEST, ); @@ -245,6 +246,7 @@ describe('TransactionMapping - createFromPayload', () => { supplyMutable: false, transferable: false, divisibility: 3, + duration: UInt64.fromUint(0), }), NetworkType.MIJIN_TEST, ); @@ -269,6 +271,7 @@ describe('TransactionMapping - createFromPayload', () => { supplyMutable: false, transferable: false, divisibility: 3, + duration: UInt64.fromUint(0), }), NetworkType.MIJIN_TEST, ); @@ -293,6 +296,7 @@ describe('TransactionMapping - createFromPayload', () => { supplyMutable: false, transferable: false, divisibility: 3, + duration: UInt64.fromUint(0), }), NetworkType.MIJIN_TEST, ); @@ -1025,7 +1029,6 @@ describe('TransactionMapping - createFromDTO (Transaction.toJSON() feed)', () => 'parent-test-namespace', NetworkType.MIJIN_TEST, ); - const transaction = TransactionMapping.createFromDTO(registerNamespaceTransaction.toJSON()) as NamespaceRegistrationTransaction; @@ -1138,7 +1141,7 @@ describe('TransactionMapping - createFromDTO (Transaction.toJSON() feed)', () => expect(transaction.type).to.be.equal(TransactionType.NAMESPACE_METADATA_TRANSACTION); expect(transaction.targetPublicKey).to.be.equal(account.publicKey); - expect(transaction.scopedMetadataKey.toHex()).to.be.equal(UInt64.fromUint(1000).toHex()); + expect(transaction.scopedMetadataKey.toString()).to.be.equal(UInt64.fromUint(1000).toString()); expect(transaction.valueSizeDelta).to.be.equal(1); expect(transaction.targetNamespaceId.toHex()).to.be.equal(new NamespaceId([2262289484, 3405110546]).toHex()); expect(convert.uint8ToHex(transaction.value)).to.be.equal(convert.uint8ToHex(new Uint8Array(10))); diff --git a/test/infrastructure/SerializeTransactionToJSON.spec.ts b/test/infrastructure/SerializeTransactionToJSON.spec.ts index 6db916c916..393e64e52c 100644 --- a/test/infrastructure/SerializeTransactionToJSON.spec.ts +++ b/test/infrastructure/SerializeTransactionToJSON.spec.ts @@ -175,9 +175,10 @@ describe('SerializeTransactionToJSON', () => { new MosaicNonce(new Uint8Array([0xE6, 0xDE, 0x84, 0xB8])), // nonce new MosaicId(UInt64.fromUint(1).toDTO()), // ID MosaicProperties.create({ - supplyMutable: false, - transferable: false, - divisibility: 3, + supplyMutable: true, + transferable: true, + divisibility: 5, + restrictable: true, duration: UInt64.fromUint(1000), }), NetworkType.MIJIN_TEST, @@ -186,10 +187,9 @@ describe('SerializeTransactionToJSON', () => { const json = mosaicDefinitionTransaction.toJSON(); expect(json.transaction.type).to.be.equal(TransactionType.MOSAIC_DEFINITION); - expect(json.transaction.properties.length).to.be.equal(3); - expect(new UInt64(json.transaction.properties[1].value).compact()).to.be.equal(UInt64.fromUint(3).compact()); - expect(new UInt64(json.transaction.properties[2].value).compact()).to.be.equal(UInt64.fromUint(1000).compact()); - expect(new UInt64(json.transaction.properties[2].value).lower).to.be.equal(UInt64.fromUint(1000).lower); + expect(json.transaction.flags).to.be.equal(7); + expect(json.transaction.divisibility).to.be.equal(5); + expect(json.transaction.duration).to.be.equal('1000'); }); @@ -199,9 +199,10 @@ describe('SerializeTransactionToJSON', () => { new MosaicNonce(new Uint8Array([0xE6, 0xDE, 0x84, 0xB8])), // nonce new MosaicId(UInt64.fromUint(1).toDTO()), // ID MosaicProperties.create({ - supplyMutable: false, + supplyMutable: true, transferable: false, divisibility: 3, + duration: UInt64.fromUint(0), }), NetworkType.MIJIN_TEST, ); @@ -209,7 +210,8 @@ describe('SerializeTransactionToJSON', () => { const json = mosaicDefinitionTransaction.toJSON(); expect(json.transaction.type).to.be.equal(TransactionType.MOSAIC_DEFINITION); - expect(json.transaction.properties.length).to.be.equal(2); + expect(json.transaction.divisibility).to.be.equal(3); + expect(json.transaction.flags).to.be.equal(1); }); diff --git a/test/infrastructure/receipt/CreateReceiptFromDTO.spec.ts b/test/infrastructure/receipt/CreateReceiptFromDTO.spec.ts index 115fd21c71..463645d450 100644 --- a/test/infrastructure/receipt/CreateReceiptFromDTO.spec.ts +++ b/test/infrastructure/receipt/CreateReceiptFromDTO.spec.ts @@ -24,6 +24,7 @@ import { MosaicId } from '../../../src/model/mosaic/MosaicId'; import { AddressAlias } from '../../../src/model/namespace/AddressAlias'; import { MosaicAlias } from '../../../src/model/namespace/MosaicAlias'; import { ReceiptType } from '../../../src/model/receipt/ReceiptType'; +import { UInt64 } from '../../../src/model/UInt64'; describe('Receipt - CreateStatementFromDTO', () => { let account: Account; @@ -35,87 +36,88 @@ describe('Receipt - CreateStatementFromDTO', () => { account = Account.createFromPrivateKey('D242FB34C2C4DD36E995B9C865F93940065E326661BA5A4A247331D211FE3A3D', NetworkType.MIJIN_TEST); account2 = Account.createFromPrivateKey('E5DCCEBDB01A8B03A7DB7BA5888E2E33FD4617B5F6FED48C4C09C0780F422713', NetworkType.MIJIN_TEST); statementDto = {transactionStatements: [ - { - height: [52, 0], + { + statement: { + height: '52', source: { - primaryId: 0, - secondaryId: 0, + primaryId: 0, + secondaryId: 0, }, receipts: [ { version: 1, type: 8515, - account: account.publicKey, - mosaicId: [3646934825, 3576016193], - amount: [1000, 0], + targetPublicKey: account.publicKey, + mosaicId: '85BBEA6CC462B244', + amount: '1000', }, ], }, + }, ], addressResolutionStatements: [ - { - height: [1488, 0], + { + statement: { + height: '1488', unresolved: '9103B60AAF2762688300000000000000000000000000000000', resolutionEntries: [ - { + { source: { - primaryId: 4, - secondaryId: 0, + primaryId: 4, + secondaryId: 0, }, resolved: '917E7E29A01014C2F300000000000000000000000000000000', - }, + }, ], }, - { - height: [1488, 0], + }, + { + statement: { + height: '1488', unresolved: '917E7E29A01014C2F300000000000000000000000000000000', resolutionEntries: [ - { + { source: { - primaryId: 2, - secondaryId: 0, + primaryId: 2, + secondaryId: 0, }, resolved: '9103B60AAF2762688300000000000000000000000000000000', - }, + }, ], }, + }, ], mosaicResolutionStatements: [ - { - height: [ - 1506, - 0, - ], - unresolved: [4014740460, 2448037180], + { + statement: { + height: '1506', + unresolved: '85BBEA6CC462B244', resolutionEntries: [ - { + { source: { - primaryId: 1, - secondaryId: 0, + primaryId: 1, + secondaryId: 0, }, - resolved: [2553890912, 2234768168], - }, + resolved: '941299B2B7E1291C', + }, ], }, - { - height: [ - 1506, - 0, - ], - unresolved: [ - 2234768168, - 2553890912, - ], + }, + { + statement: { + height: '1506', + unresolved: '85BBEA6CC462B244', resolutionEntries: [ - { + { source: { - primaryId: 5, - secondaryId: 0, + primaryId: 5, + secondaryId: 0, }, - resolved: [2553890912, 2234768168], - }, + resolved: '941299B2B7E1291C', + }, ], }, + }, ]}; }); it('should create Statement', () => { @@ -128,22 +130,22 @@ describe('Receipt - CreateStatementFromDTO', () => { expect(statement.mosaicResolutionStatements.length).to.be.equal(2); expect(statement.transactionStatements[0].receipts.length).to.be.equal(1); - deepEqual(statement.transactionStatements[0].height, [52, 0]); + deepEqual(statement.transactionStatements[0].height, UInt64.fromNumericString('52')); expect(statement.transactionStatements[0].source.primaryId).to.be.equal(0); expect(statement.transactionStatements[0].source.secondaryId).to.be.equal(0); expect(statement.transactionStatements[0].receipts[0].type).to.be.equal(ReceiptType.Harvest_Fee); - deepEqual(statement.addressResolutionStatements[0].height, [1488, 0]); + deepEqual(statement.addressResolutionStatements[0].height, UInt64.fromNumericString('1488')); deepEqual(unresolvedAddress.plain(), Address.createFromEncoded('9103B60AAF2762688300000000000000000000000000000000').plain()); expect(statement.addressResolutionStatements[0].resolutionEntries.length).to.be.equal(1); expect((statement.addressResolutionStatements[0].resolutionEntries[0].resolved as AddressAlias) .address.plain()).to.be.equal(Address.createFromEncoded('917E7E29A01014C2F300000000000000000000000000000000').plain()); - deepEqual(statement.mosaicResolutionStatements[0].height, [1506, 0]); - deepEqual(unresolvedMosaicId.toDTO(), [4014740460, 2448037180]); + deepEqual(statement.mosaicResolutionStatements[0].height, UInt64.fromNumericString('1506')); + deepEqual(unresolvedMosaicId.toHex(), '85BBEA6CC462B244'); expect(statement.mosaicResolutionStatements[0].resolutionEntries.length).to.be.equal(1); deepEqual((statement.mosaicResolutionStatements[0].resolutionEntries[0].resolved as MosaicAlias) - .mosaicId.id.toDTO(), [2553890912, 2234768168]); + .mosaicId.id.toHex(), '941299B2B7E1291C'); }); }); diff --git a/test/model/Id.spec.ts b/test/model/Id.spec.ts index 5bc8d25446..06a15c5ef5 100644 --- a/test/model/Id.spec.ts +++ b/test/model/Id.spec.ts @@ -21,12 +21,12 @@ describe('Id', () => { describe('toHex()', () => { it('should generate mosaic xem id', () => { const idName = new Id([3646934825, 3576016193]).toHex(); - expect(idName).to.be.equal('d525ad41d95fcf29'); + expect(idName).to.be.equal('D525AD41D95FCF29'); }); it('should generate namespace nem id', () => { const idName = new Id([929036875, 2226345261]).toHex(); - expect(idName).to.be.equal('84b3552d375ffa4b'); + expect(idName).to.be.equal('84B3552D375FFA4B'); }); }); diff --git a/test/model/UInt64.spec.ts b/test/model/UInt64.spec.ts index bf1d26bebc..5c75ac46ec 100644 --- a/test/model/UInt64.spec.ts +++ b/test/model/UInt64.spec.ts @@ -140,4 +140,13 @@ describe('Uint64', () => { expect(() => { UInt64.fromNumericString('ABC12345678'); }).to.throw('Input string is not a valid numeric string'); }); }); + + describe('toNuermicString', () => { + it('should return numeric string representation', () => { + const value = '1000'; + const uint64 = UInt64.fromNumericString(value); + + expect(uint64.toString()).to.be.equal(value); + }); + }); }); diff --git a/test/model/mosaic/MosaicInfo.spec.ts b/test/model/mosaic/MosaicInfo.spec.ts index 4303e0dd8d..71bb380bc0 100644 --- a/test/model/mosaic/MosaicInfo.spec.ts +++ b/test/model/mosaic/MosaicInfo.spec.ts @@ -24,7 +24,7 @@ import {MosaicProperties} from '../../../src/model/mosaic/MosaicProperties'; import {UInt64} from '../../../src/model/UInt64'; describe('MosaicInfo', () => { - const mosaicInfoDTO = { + let mosaicInfoDTO = { meta: { id: '59FDA0733F17CF0001772CBC', }, @@ -36,11 +36,9 @@ describe('MosaicInfo', () => { 'B4F12E7C9F6946091E2CB8B6D3A12B50D17CCBBF646386EA27CE2946A7423DCF', NetworkType.MIJIN_TEST), revision: 1, - properties: [ - new UInt64([6, 0]), // divisibility - new UInt64([3, 0]), // flags - new UInt64([1000, 0]), // duration - ], + flags: 7, + divisibility: 3, + duration: '1000', }, }; @@ -56,9 +54,9 @@ describe('MosaicInfo', () => { mosaicInfoDTO.mosaic.owner, mosaicInfoDTO.mosaic.revision, new MosaicProperties( - mosaicInfoDTO.mosaic.properties[0], - mosaicInfoDTO.mosaic.properties[1].compact(), - mosaicInfoDTO.mosaic.properties[2], + mosaicInfoDTO.mosaic.flags, + mosaicInfoDTO.mosaic.divisibility, + UInt64.fromNumericString(mosaicInfoDTO.mosaic.duration), ), ); @@ -68,12 +66,13 @@ describe('MosaicInfo', () => { expect(mosaicInfo.owner).to.be.equal(mosaicInfoDTO.mosaic.owner); deepEqual(mosaicInfo.revision, mosaicInfoDTO.mosaic.revision); - expect(mosaicInfo.divisibility).to.be.equal(mosaicInfoDTO.mosaic.properties[1].lower); - deepEqual(mosaicInfo.duration, mosaicInfoDTO.mosaic.properties[2]); + expect(mosaicInfo.divisibility).to.be.equal(mosaicInfoDTO.mosaic.divisibility); + deepEqual(mosaicInfo.duration.toString(), mosaicInfoDTO.mosaic.duration); }); it('should createComplete an MosaicInfo object without duration', () => { + mosaicInfoDTO.mosaic.duration = '0'; const mosaicInfo = new MosaicInfo( mosaicInfoDTO.mosaic.mosaicId, mosaicInfoDTO.mosaic.supply, @@ -81,8 +80,9 @@ describe('MosaicInfo', () => { mosaicInfoDTO.mosaic.owner, mosaicInfoDTO.mosaic.revision, new MosaicProperties( - mosaicInfoDTO.mosaic.properties[0], - mosaicInfoDTO.mosaic.properties[1].compact(), + mosaicInfoDTO.mosaic.flags, + mosaicInfoDTO.mosaic.divisibility, + UInt64.fromNumericString(mosaicInfoDTO.mosaic.duration), ), ); @@ -92,8 +92,8 @@ describe('MosaicInfo', () => { expect(mosaicInfo.owner).to.be.equal(mosaicInfoDTO.mosaic.owner); deepEqual(mosaicInfo.revision, mosaicInfoDTO.mosaic.revision); - expect(mosaicInfo.divisibility).to.be.equal(mosaicInfoDTO.mosaic.properties[1].lower); - deepEqual(mosaicInfo.duration, undefined); + expect(mosaicInfo.divisibility).to.be.equal(mosaicInfoDTO.mosaic.divisibility); + deepEqual(mosaicInfo.duration.toDTO(), [0, 0]); }); @@ -108,8 +108,8 @@ describe('MosaicInfo', () => { MosaicProperties.create({ supplyMutable: true, transferable: false, - divisibility: mosaicInfoDTO.mosaic.properties[1].compact(), - duration: mosaicInfoDTO.mosaic.properties[2], + divisibility: mosaicInfoDTO.mosaic.divisibility, + duration: UInt64.fromNumericString(mosaicInfoDTO.mosaic.duration), }), ) ; @@ -126,8 +126,8 @@ describe('MosaicInfo', () => { MosaicProperties.create({ supplyMutable: false, transferable: false, - divisibility: mosaicInfoDTO.mosaic.properties[1].compact(), - duration: mosaicInfoDTO.mosaic.properties[2], + divisibility: mosaicInfoDTO.mosaic.divisibility, + duration: UInt64.fromNumericString(mosaicInfoDTO.mosaic.duration), }), ); expect(mosaicInfo.isSupplyMutable()).to.be.equal(false); @@ -145,8 +145,8 @@ describe('MosaicInfo', () => { MosaicProperties.create({ supplyMutable: false, transferable: true, - divisibility: mosaicInfoDTO.mosaic.properties[1].compact(), - duration: mosaicInfoDTO.mosaic.properties[2], + divisibility: mosaicInfoDTO.mosaic.divisibility, + duration: UInt64.fromNumericString(mosaicInfoDTO.mosaic.duration), }), ); expect(mosaicInfo.isTransferable()).to.be.equal(true); @@ -162,8 +162,8 @@ describe('MosaicInfo', () => { MosaicProperties.create({ supplyMutable: false, transferable: false, - divisibility: mosaicInfoDTO.mosaic.properties[1].compact(), - duration: mosaicInfoDTO.mosaic.properties[2], + divisibility: mosaicInfoDTO.mosaic.divisibility, + duration: UInt64.fromNumericString(mosaicInfoDTO.mosaic.duration), }), ); expect(mosaicInfo.isTransferable()).to.be.equal(false); @@ -181,9 +181,9 @@ describe('MosaicInfo', () => { MosaicProperties.create({ supplyMutable: false, transferable: false, - divisibility: mosaicInfoDTO.mosaic.properties[1].compact(), + divisibility: mosaicInfoDTO.mosaic.divisibility, restrictable: true, - duration: mosaicInfoDTO.mosaic.properties[2], + duration: UInt64.fromNumericString(mosaicInfoDTO.mosaic.duration), }), ); expect(mosaicInfo.isRestrictable()).to.be.equal(true); @@ -199,8 +199,8 @@ describe('MosaicInfo', () => { MosaicProperties.create({ supplyMutable: false, transferable: false, - divisibility: mosaicInfoDTO.mosaic.properties[1].compact(), - duration: mosaicInfoDTO.mosaic.properties[2], + divisibility: mosaicInfoDTO.mosaic.divisibility, + duration: UInt64.fromNumericString(mosaicInfoDTO.mosaic.duration), }), ); expect(mosaicInfo.isRestrictable()).to.be.equal(false); diff --git a/test/model/mosaic/MosaicProperties.spec.ts b/test/model/mosaic/MosaicProperties.spec.ts index 99e8caefe8..6e93b785c0 100644 --- a/test/model/mosaic/MosaicProperties.spec.ts +++ b/test/model/mosaic/MosaicProperties.spec.ts @@ -22,29 +22,20 @@ import {UInt64} from '../../../src/model/UInt64'; describe('MosaicProperties', () => { it('should createComplete an MosaicProperties object with constructor', () => { - const propertiesDTO = [ - new UInt64([ - 7, - 0, - ]), - new UInt64([ - 3, - 0, - ]), - new UInt64([ - 1000, - 0, - ]), - ]; + const propertiesDTO = { + flags: 7, + divisibility: 3, + duration: '1000', + }; const mosaicProperties = new MosaicProperties( - propertiesDTO[0], - propertiesDTO[1].compact(), - propertiesDTO[2], + propertiesDTO.flags, + propertiesDTO.divisibility, + UInt64.fromNumericString(propertiesDTO.duration), ); - expect(mosaicProperties.divisibility).to.be.equal(propertiesDTO[1].lower); - deepEqual(mosaicProperties.duration, propertiesDTO[2]); + expect(mosaicProperties.divisibility).to.be.equal(propertiesDTO.divisibility); + deepEqual(mosaicProperties.duration.toString(), propertiesDTO.duration); expect(mosaicProperties.supplyMutable).to.be.equal(true); expect(mosaicProperties.transferable).to.be.equal(true); @@ -73,10 +64,11 @@ describe('MosaicProperties', () => { supplyMutable: false, transferable: false, divisibility: 10, + duration: UInt64.fromUint(0), }); expect(mosaicProperties.divisibility).to.be.equal(10); - deepEqual(mosaicProperties.duration, undefined); + deepEqual(mosaicProperties.duration.toDTO(), [0, 0]); expect(mosaicProperties.supplyMutable).to.be.equal(false); expect(mosaicProperties.transferable).to.be.equal(false); diff --git a/test/model/mosaic/NetworkCurrencyMosaic.spec.ts b/test/model/mosaic/NetworkCurrencyMosaic.spec.ts index 8314ed8015..dd0acf6e2c 100644 --- a/test/model/mosaic/NetworkCurrencyMosaic.spec.ts +++ b/test/model/mosaic/NetworkCurrencyMosaic.spec.ts @@ -16,9 +16,9 @@ import {deepEqual} from 'assert'; import {expect} from 'chai'; -import {MosaicId} from '../../../src/model/mosaic/MosaicId'; import {NetworkCurrencyMosaic} from '../../../src/model/mosaic/NetworkCurrencyMosaic'; import {NamespaceId} from '../../../src/model/namespace/NamespaceId'; +import { UInt64 } from '../../../src/model/UInt64'; describe('NetworkCurrencyMosaic', () => { @@ -26,14 +26,14 @@ describe('NetworkCurrencyMosaic', () => { const currency = NetworkCurrencyMosaic.createRelative(1000); - deepEqual(currency.id.id.toHex(), '85bbea6cc462b244'); // holds NAMESPACE_ID + deepEqual(currency.id.id.toHex(), '85BBEA6CC462B244'); // holds NAMESPACE_ID expect(currency.amount.compact()).to.be.equal(1000 * 1000000); }); it('should set amount in smallest unit when toDTO()', () => { const currency = NetworkCurrencyMosaic.createRelative(1000); - expect(currency.toDTO().amount[0]).to.be.equal(1000 * 1000000); + expect(UInt64.fromNumericString(currency.toDTO().amount).toDTO()[0]).to.be.equal(1000 * 1000000); }); it('should have valid statics', () => { diff --git a/test/model/mosaic/NetworkHarvestMosaic.spec.ts b/test/model/mosaic/NetworkHarvestMosaic.spec.ts index 53289b405b..baa710071a 100644 --- a/test/model/mosaic/NetworkHarvestMosaic.spec.ts +++ b/test/model/mosaic/NetworkHarvestMosaic.spec.ts @@ -19,6 +19,7 @@ import {expect} from 'chai'; import {MosaicId} from '../../../src/model/mosaic/MosaicId'; import {NetworkHarvestMosaic} from '../../../src/model/mosaic/NetworkHarvestMosaic'; import {NamespaceId} from '../../../src/model/namespace/NamespaceId'; +import { UInt64 } from '../../../src/model/UInt64'; describe('NetworkHarvestMosaic', () => { @@ -26,14 +27,14 @@ describe('NetworkHarvestMosaic', () => { const currency = NetworkHarvestMosaic.createRelative(1000); - deepEqual(currency.id.id.toHex(), '941299b2b7e1291c'); + deepEqual(currency.id.id.toHex(), '941299B2B7E1291C'); expect(currency.amount.compact()).to.be.equal(1000 * 1000); }); it('should set amount in smallest unit when toDTO()', () => { const currency = NetworkHarvestMosaic.createRelative(1000); - expect(currency.toDTO().amount[0]).to.be.equal(1000 * 1000); + expect(UInt64.fromNumericString(currency.toDTO().amount).toDTO()[0]).to.be.equal(1000 * 1000); }); it('should have valid statics', () => { diff --git a/test/model/namespace/NamespaceInfo.spec.ts b/test/model/namespace/NamespaceInfo.spec.ts index d69235e6d2..e0a4457905 100644 --- a/test/model/namespace/NamespaceInfo.spec.ts +++ b/test/model/namespace/NamespaceInfo.spec.ts @@ -98,12 +98,12 @@ describe('NamespaceInfo', () => { it('should return the NamespaceId in string format', () => { const namespaceInfo = createRootFromDTO(rootNamespaceDTO); - expect(namespaceInfo.id.toHex()).to.be.equal('84b3552d375ffa4b'); + expect(namespaceInfo.id.toHex()).to.be.equal('84B3552D375FFA4B'); }); it('should return the NamespaceId in string format for sub-namespace', () => { const namespaceInfo = createSubnamespaceFromDTO(subNamespaceDTO); - expect(namespaceInfo.id.toHex()).to.be.equal('f7ce33276a3288c1'); + expect(namespaceInfo.id.toHex()).to.be.equal('F7CE33276A3288C1'); }); it('isRoot() should return true when the Namespace has type 0', () => { diff --git a/test/model/receipt/Receipt.spec.ts b/test/model/receipt/Receipt.spec.ts index 420f9e6b8f..b17b1ef31c 100644 --- a/test/model/receipt/Receipt.spec.ts +++ b/test/model/receipt/Receipt.spec.ts @@ -50,88 +50,86 @@ describe('Receipt', () => { account2 = Account.createFromPrivateKey('E5DCCEBDB01A8B03A7DB7BA5888E2E33FD4617B5F6FED48C4C09C0780F422713', NetworkType.MIJIN_TEST); transactionStatementsDTO = [ { - height: [52, 0], - source: { - primaryId: 0, - secondaryId: 0, - }, - receipts: [ - { - version: 1, - type: 8515, - account: account.publicKey, - mosaicId: [3646934825, 3576016193], - amount: [1000, 0], + statement: { + height: '52', + source: { + primaryId: 0, + secondaryId: 0, }, - ], + receipts: [ + { + version: 1, + type: 8515, + targetPublicKey: account.publicKey, + mosaicId: '85BBEA6CC462B244', + amount: '1000', + }, + ], + }, }, ]; addressResolutionStatementsDTO = [ { - height: [1488, 0], - unresolved: '9103B60AAF2762688300000000000000000000000000000000', - resolutionEntries: [ - { - source: { - primaryId: 4, - secondaryId: 0, + statement: { + height: '1488', + unresolved: '9103B60AAF2762688300000000000000000000000000000000', + resolutionEntries: [ + { + source: { + primaryId: 4, + secondaryId: 0, + }, + resolved: '917E7E29A01014C2F300000000000000000000000000000000', }, - resolved: '917E7E29A01014C2F300000000000000000000000000000000', - }, - ], + ], + }, }, { - height: [1488, 0], - unresolved: '917E7E29A01014C2F300000000000000000000000000000000', - resolutionEntries: [ - { - source: { - primaryId: 2, - secondaryId: 0, + statement: { + height: '1488', + unresolved: '917E7E29A01014C2F300000000000000000000000000000000', + resolutionEntries: [ + { + source: { + primaryId: 2, + secondaryId: 0, + }, + resolved: '9103B60AAF2762688300000000000000000000000000000000', }, - resolved: '9103B60AAF2762688300000000000000000000000000000000', - }, - ], + ], + }, }, ]; mosaicResolutionStatementsDTO = [ { - height: [ - 1506, - 0, - ], - unresolved: [ - 4014740460, - 2448037180, - ], - resolutionEntries: [ - { - source: { - primaryId: 1, - secondaryId: 0, + statement: { + height: '1506', + unresolved: '85BBEA6CC462B244', + resolutionEntries: [ + { + source: { + primaryId: 1, + secondaryId: 0, + }, + resolved: '941299B2B7E1291C', }, - resolved: [2553890912, 2234768168], - }, - ], + ], + }, }, { - height: [ - 1506, - 0, - ], - unresolved: [ - 2234768168, - 2553890912, - ], - resolutionEntries: [ - { - source: { - primaryId: 5, - secondaryId: 0, + statement: { + height: '1506', + unresolved: '85BBEA6CC462B244', + resolutionEntries: [ + { + source: { + primaryId: 5, + secondaryId: 0, + }, + resolved: '941299B2B7E1291C', }, - resolved: [2553890912, 2234768168], - }, - ], + ], + }, }, ]; }); @@ -140,22 +138,22 @@ describe('Receipt', () => { const receiptDTO = { version: 1, type: 4685, - sender: account.publicKey, + senderPublicKey: account.publicKey, recipientAddress: '9103B60AAF2762688300000000000000000000000000000000', - mosaicId: [481110499, 231112638], - amount: [1000, 0], + mosaicId: '941299B2B7E1291C', + amount: '1000', }; const receipt = new BalanceTransferReceipt( - PublicAccount.createFromPublicKey(receiptDTO.sender, netWorkType), + PublicAccount.createFromPublicKey(receiptDTO.senderPublicKey, netWorkType), Address.createFromEncoded(receiptDTO.recipientAddress), new MosaicId(receiptDTO.mosaicId), - new UInt64(receiptDTO.amount), + UInt64.fromNumericString(receiptDTO.amount), receiptDTO.version, receiptDTO.type, ); - deepEqual(receipt.amount.toDTO(), receiptDTO.amount); - deepEqual(receipt.mosaicId.toDTO(), receiptDTO.mosaicId); + deepEqual(receipt.amount.toString(), receiptDTO.amount); + deepEqual(receipt.mosaicId.toHex(), receiptDTO.mosaicId); deepEqual(receipt.type, ReceiptType.Mosaic_Levy); deepEqual(receipt.version, ReceiptVersion.BALANCE_TRANSFER); deepEqual(receipt.recipientAddress, Address.createFromEncoded('9103B60AAF2762688300000000000000000000000000000000')); @@ -165,24 +163,24 @@ describe('Receipt', () => { const receiptDTO = { version: 1, type: 4941, - sender: account.publicKey, + senderPublicKey: account.publicKey, recipientAddress: '9103B60AAF2762688300000000000000000000000000000000', - mosaicId: [3646934825, 3576016193], - amount: [1000, 0], + mosaicId: '941299B2B7E1291C', + amount: '1000', }; const receipt = new BalanceTransferReceipt( - PublicAccount.createFromPublicKey(receiptDTO.sender, netWorkType), + PublicAccount.createFromPublicKey(receiptDTO.senderPublicKey, netWorkType), Address.createFromEncoded(receiptDTO.recipientAddress), new MosaicId(receiptDTO.mosaicId), - new UInt64(receiptDTO.amount), + UInt64.fromNumericString(receiptDTO.amount), receiptDTO.version, receiptDTO.type, ); - deepEqual(receipt.amount.toDTO(), receiptDTO.amount); + deepEqual(receipt.amount.toString(), receiptDTO.amount); deepEqual(receipt.recipientAddress, Address.createFromEncoded('9103B60AAF2762688300000000000000000000000000000000')); - deepEqual(receipt.mosaicId.toDTO(), receiptDTO.mosaicId); + deepEqual(receipt.mosaicId.toHex(), receiptDTO.mosaicId); deepEqual(receipt.type, ReceiptType.Mosaic_Rental_Fee); deepEqual(receipt.version, ReceiptVersion.BALANCE_TRANSFER); }); @@ -191,22 +189,22 @@ describe('Receipt', () => { const receiptDTO = { version: 1, type: 8515, - account: account.publicKey, - mosaicId: [3646934825, 3576016193], - amount: [1000, 0], + targetPublicKey: account.publicKey, + mosaicId: '941299B2B7E1291C', + amount: '1000', }; const receipt = new BalanceChangeReceipt( - PublicAccount.createFromPublicKey(receiptDTO.account, netWorkType), + PublicAccount.createFromPublicKey(receiptDTO.targetPublicKey, netWorkType), new MosaicId(receiptDTO.mosaicId), - new UInt64(receiptDTO.amount), + UInt64.fromNumericString(receiptDTO.amount), receiptDTO.version, receiptDTO.type, ); - deepEqual(receipt.targetPublicAccount.publicKey, receiptDTO.account); - deepEqual(receipt.amount.toDTO(), receiptDTO.amount); - deepEqual(receipt.mosaicId.toDTO(), receiptDTO.mosaicId); + deepEqual(receipt.targetPublicAccount.publicKey, receiptDTO.targetPublicKey); + deepEqual(receipt.amount.toString(), receiptDTO.amount); + deepEqual(receipt.mosaicId.toHex(), receiptDTO.mosaicId); deepEqual(receipt.type, ReceiptType.Harvest_Fee); deepEqual(receipt.version, ReceiptVersion.BALANCE_CHANGE); }); @@ -215,22 +213,22 @@ describe('Receipt', () => { const receiptDTO = { version: 1, type: 12616, - account: account.publicKey, - mosaicId: [3646934825, 3576016193], - amount: [1000, 0], + targetPublicKey: account.publicKey, + mosaicId: '941299B2B7E1291C', + amount: '1000', }; const receipt = new BalanceChangeReceipt( - PublicAccount.createFromPublicKey(receiptDTO.account, netWorkType), + PublicAccount.createFromPublicKey(receiptDTO.targetPublicKey, netWorkType), new MosaicId(receiptDTO.mosaicId), - new UInt64(receiptDTO.amount), + UInt64.fromNumericString(receiptDTO.amount), receiptDTO.version, receiptDTO.type, ); - deepEqual(receipt.targetPublicAccount.publicKey, receiptDTO.account); - deepEqual(receipt.amount.toDTO(), receiptDTO.amount); - deepEqual(receipt.mosaicId.toDTO(), receiptDTO.mosaicId); + deepEqual(receipt.targetPublicAccount.publicKey, receiptDTO.targetPublicKey); + deepEqual(receipt.amount.toString(), receiptDTO.amount); + deepEqual(receipt.mosaicId.toHex().toUpperCase(), receiptDTO.mosaicId); deepEqual(receipt.type, ReceiptType.LockHash_Created); deepEqual(receipt.version, ReceiptVersion.BALANCE_CHANGE); }); @@ -239,7 +237,7 @@ describe('Receipt', () => { const receiptDTO = { version: 1, type: 16718, - artifactId: [3646934825, 3576016193], + artifactId: 'D525AD41D95FCF29', }; const receipt = new ArtifactExpiryReceipt( @@ -248,7 +246,7 @@ describe('Receipt', () => { receiptDTO.type, ); - deepEqual(receipt.artifactId.id.toDTO(), receiptDTO.artifactId); + deepEqual(receipt.artifactId.id.toHex().toUpperCase(), receiptDTO.artifactId); deepEqual(receipt.type, ReceiptType.Namespace_Expired); deepEqual(receipt.version, ReceiptVersion.ARTIFACT_EXPIRY); }); @@ -257,7 +255,7 @@ describe('Receipt', () => { const receiptDTO = { version: 1, type: 16717, - artifactId: [3646934825, 3576016193], + artifactId: '941299B2B7E1291C', }; const receipt = new ArtifactExpiryReceipt( @@ -265,7 +263,7 @@ describe('Receipt', () => { receiptDTO.version, receiptDTO.type, ); - deepEqual(receipt.artifactId.toDTO(), receiptDTO.artifactId); + deepEqual(receipt.artifactId.toHex().toUpperCase(), receiptDTO.artifactId); deepEqual(receipt.type, ReceiptType.Mosaic_Expired); deepEqual(receipt.version, ReceiptVersion.ARTIFACT_EXPIRY); }); @@ -273,36 +271,36 @@ describe('Receipt', () => { it('should createComplete a transaction statement', () => { const statementDto = transactionStatementsDTO[0]; const statement = new TransactionStatement( - statementDto.height, - new ReceiptSource( statementDto.source.primaryId, statementDto.source.secondaryId), - statementDto.receipts.map((receipt) => + statementDto.statement.height, + new ReceiptSource( statementDto.statement.source.primaryId, statementDto.statement.source.secondaryId), + statementDto.statement.receipts.map((receipt) => CreateReceiptFromDTO(receipt, netWorkType)), ); - deepEqual(statement.source.primaryId, statementDto.source.primaryId); - deepEqual(statement.source.secondaryId, statementDto.source.secondaryId); + deepEqual(statement.source.primaryId, statementDto.statement.source.primaryId); + deepEqual(statement.source.secondaryId, statementDto.statement.source.secondaryId); deepEqual((statement.receipts[0] as BalanceChangeReceipt).targetPublicAccount.publicKey, account.publicKey); }); it('should createComplete resolution statement - mosaic', () => { const statementDto = mosaicResolutionStatementsDTO[0]; const statement = new ResolutionStatement( - statementDto.height, - new MosaicId(statementDto.unresolved), - statementDto.resolutionEntries.map((resolved) => { + statementDto.statement.height, + new MosaicId(statementDto.statement.unresolved), + statementDto.statement.resolutionEntries.map((resolved) => { return new ResolutionEntry(new MosaicAlias(AliasType.Mosaic, new MosaicId(resolved.resolved)), new ReceiptSource( resolved.source.primaryId, resolved.source.secondaryId)); }), ); - deepEqual((statement.unresolved as MosaicId).toDTO(), statementDto.unresolved); - deepEqual((statement.resolutionEntries[0].resolved as MosaicAlias).mosaicId.id.toDTO(), [2553890912, 2234768168]); + deepEqual((statement.unresolved as MosaicId).toHex(), statementDto.statement.unresolved); + deepEqual((statement.resolutionEntries[0].resolved as MosaicAlias).mosaicId.id.toHex(), '941299B2B7E1291C'); }); it('should createComplete resolution statement - address', () => { const statementDto = addressResolutionStatementsDTO[0]; const statement = new ResolutionStatement( - statementDto.height, - Address.createFromEncoded(statementDto.unresolved), - statementDto.resolutionEntries.map((resolved) => { + statementDto.statement.height, + Address.createFromEncoded(statementDto.statement.unresolved), + statementDto.statement.resolutionEntries.map((resolved) => { return new ResolutionEntry(new AddressAlias(AliasType.Address, Address.createFromEncoded(resolved.resolved)), new ReceiptSource( resolved.source.primaryId, resolved.source.secondaryId)); }), @@ -317,19 +315,19 @@ describe('Receipt', () => { const receiptDTO = { version: 1, type: 20803, - mosaicId: [3646934825, 3576016193], - amount: 1000, + mosaicId: '941299B2B7E1291C', + amount: '1000', }; const receipt = new InflationReceipt( new MosaicId(receiptDTO.mosaicId), - UInt64.fromUint(receiptDTO.amount), + UInt64.fromNumericString(receiptDTO.amount), receiptDTO.version, receiptDTO.type, ); - deepEqual(receipt.amount.compact(), receiptDTO.amount); - deepEqual(receipt.mosaicId.toDTO(), receiptDTO.mosaicId); + deepEqual(receipt.amount.compact().toString(), receiptDTO.amount); + deepEqual(receipt.mosaicId.toHex().toUpperCase(), receiptDTO.mosaicId); deepEqual(receipt.type, ReceiptType.Inflation); deepEqual(receipt.version, ReceiptVersion.INFLATION_RECEIPT); }); diff --git a/test/model/transaction/AggregateTransaction.spec.ts b/test/model/transaction/AggregateTransaction.spec.ts index c228da0c68..6757737c1e 100644 --- a/test/model/transaction/AggregateTransaction.spec.ts +++ b/test/model/transaction/AggregateTransaction.spec.ts @@ -296,10 +296,7 @@ describe('AggregateTransaction', () => { const aggregateTransactionDTO = { meta: { hash: '671653C94E2254F2A23EFEDB15D67C38332AED1FBD24B063C0A8E675582B6A96', - height: [ - 18160, - 0, - ], + height: '18160', id: '5A0069D83F17CF0001777E55', index: 0, merkleComponentHash: '81E5E7AE49998802DABC816EC10158D3A7879702FF29084C2C992CD1289877A7', @@ -312,14 +309,8 @@ describe('AggregateTransaction', () => { signerPublicKey: 'A5F82EC8EBB341427B6785C8111906CD0DF18838FB11B51CE0E18B5E79DFF630', }, ], - deadline: [ - 3266625578, - 11, - ], - maxFee: [ - 0, - 0, - ], + deadline: '1000', + maxFee: '0', signature: '939673209A13FF82397578D22CC96EB8516A6760C894D9B7535E3A1E0680' + '07B9255CFA9A914C97142A7AE18533E381C846B69D2AE0D60D1DC8A55AD120E2B606', signerPublicKey: '7681ED5023141D9CDCF184E5A7B60B7D466739918ED5DA30F7E71EA7B86EFF2D', @@ -328,10 +319,7 @@ describe('AggregateTransaction', () => { meta: { aggregateHash: '3D28C804EDD07D5A728E5C5FFEC01AB07AFA5766AE6997B38526D36015A4D006', aggregateId: '5A0069D83F17CF0001777E55', - height: [ - 18160, - 0, - ], + height: '18160', id: '5A0069D83F17CF0001777E56', index: 0, }, diff --git a/test/model/transaction/CosignatureTransaction.spec.ts b/test/model/transaction/CosignatureTransaction.spec.ts index 2d20adf711..63cc933f53 100644 --- a/test/model/transaction/CosignatureTransaction.spec.ts +++ b/test/model/transaction/CosignatureTransaction.spec.ts @@ -37,10 +37,7 @@ describe('CosignatureTransaction', () => { const aggregateTransferTransactionDTO = { meta: { hash: '671653C94E2254F2A23EFEDB15D67C38332AED1FBD24B063C0A8E675582B6A96', - height: [ - 18160, - 0, - ], + height: '18160', id: '5A0069D83F17CF0001777E55', index: 0, merkleComponentHash: '81E5E7AE49998802DABC816EC10158D3A7879702FF29084C2C992CD1289877A7', @@ -53,14 +50,8 @@ describe('CosignatureTransaction', () => { signerPublicKey: 'A5F82EC8EBB341427B6785C8111906CD0DF18838FB11B51CE0E18B5E79DFF630', }, ], - deadline: [ - 3266625578, - 11, - ], - maxFee: [ - 0, - 0, - ], + deadline: '1000', + maxFee: '0', signature: '939673209A13FF82397578D22CC96EB8516A6760C894D9B7535E3A1E0680' + '07B9255CFA9A914C97142A7AE18533E381C846B69D2AE0D60D1DC8A55AD120E2B606', signerPublicKey: '7681ED5023141D9CDCF184E5A7B60B7D466739918ED5DA30F7E71EA7B86EFF2D', @@ -69,10 +60,7 @@ describe('CosignatureTransaction', () => { meta: { aggregateHash: '3D28C804EDD07D5A728E5C5FFEC01AB07AFA5766AE6997B38526D36015A4D006', aggregateId: '5A0069D83F17CF0001777E55', - height: [ - 18160, - 0, - ], + height: '18160', id: '5A0069D83F17CF0001777E56', index: 0, }, @@ -83,14 +71,8 @@ describe('CosignatureTransaction', () => { }, mosaics: [ { - amount: [ - 3863990592, - 95248, - ], - id: [ - 3646934825, - 3576016193, - ], + amount: '100', + id: '85BBEA6CC462B244', }, ], recipientAddress: '9050B9837EFAB4BBE8A4B9BB32D812F9885C00D8FC1650E142', diff --git a/test/model/transaction/MosaicDefinitionTransaction.spec.ts b/test/model/transaction/MosaicDefinitionTransaction.spec.ts index f444278cbe..afa46f015a 100644 --- a/test/model/transaction/MosaicDefinitionTransaction.spec.ts +++ b/test/model/transaction/MosaicDefinitionTransaction.spec.ts @@ -161,6 +161,7 @@ describe('MosaicDefinitionTransaction', () => { supplyMutable: false, transferable: false, divisibility: 3, + duration: UInt64.fromUint(0), }), NetworkType.MIJIN_TEST, ); diff --git a/test/model/transaction/TransactionStatusError.spec.ts b/test/model/transaction/TransactionStatusError.spec.ts index 7d2d64a17f..46cf4f1ba4 100644 --- a/test/model/transaction/TransactionStatusError.spec.ts +++ b/test/model/transaction/TransactionStatusError.spec.ts @@ -18,6 +18,7 @@ import {deepEqual} from 'assert'; import {expect} from 'chai'; import {TransactionStatusError} from '../../../src/model/transaction/TransactionStatusError'; import {Deadline} from '../../../src/model/transaction/Deadline'; +import { UInt64 } from '../../../src/model/UInt64'; describe('TransactionStatusError', () => { @@ -35,6 +36,6 @@ describe('TransactionStatusError', () => { expect(transactionStatusError.hash).to.be.equal(statusInfoErrorDTO.hash); expect(transactionStatusError.status).to.be.equal(statusInfoErrorDTO.status); - deepEqual(transactionStatusError.deadline.toDTO(), statusInfoErrorDTO.deadline); + deepEqual(transactionStatusError.deadline.toDTO(), UInt64.fromNumericString(statusInfoErrorDTO.deadline).toDTO()); }); }); diff --git a/test/model/transaction/TransferTransaction.spec.ts b/test/model/transaction/TransferTransaction.spec.ts index ae35b77b77..c42cbb2d33 100644 --- a/test/model/transaction/TransferTransaction.spec.ts +++ b/test/model/transaction/TransferTransaction.spec.ts @@ -169,7 +169,7 @@ describe('TransferTransaction', () => { ); // test recipientToString with NamespaceId recipient - expect(transferTransaction.recipientToString()).to.be.equal('d85742d268617751'); + expect(transferTransaction.recipientToString()).to.be.equal('D85742D268617751'); const signedTransaction = transferTransaction.signWith(account, generationHash); From e157d43a53fb88c97dac15bcfdab14b97bf79f6a Mon Sep 17 00:00:00 2001 From: Steven Liu Date: Wed, 11 Sep 2019 21:41:35 +0100 Subject: [PATCH 07/10] - Removed cosign transaction `isAnnounced` --- src/model/transaction/CosignatureTransaction.ts | 3 --- 1 file changed, 3 deletions(-) diff --git a/src/model/transaction/CosignatureTransaction.ts b/src/model/transaction/CosignatureTransaction.ts index 62e4a248ed..eeec13d66a 100644 --- a/src/model/transaction/CosignatureTransaction.ts +++ b/src/model/transaction/CosignatureTransaction.ts @@ -41,9 +41,6 @@ export class CosignatureTransaction { * @returns {CosignatureTransaction} */ public static create(transactionToCosign: AggregateTransaction): CosignatureTransaction { - if (transactionToCosign.isUnannounced()) { - throw new Error('Transaction to cosign should be announced first'); - } return new CosignatureTransaction(transactionToCosign); } From 540412d3ea0d886cd0856a5bd2741aa91a28e291 Mon Sep 17 00:00:00 2001 From: Steven Liu Date: Wed, 11 Sep 2019 22:00:09 +0100 Subject: [PATCH 08/10] throw execption when use transactionHttp.announce to announce aggregate bonded tx --- src/infrastructure/TransactionHttp.ts | 3 +++ 1 file changed, 3 insertions(+) diff --git a/src/infrastructure/TransactionHttp.ts b/src/infrastructure/TransactionHttp.ts index 74b5b71e0f..37bf4d486e 100644 --- a/src/infrastructure/TransactionHttp.ts +++ b/src/infrastructure/TransactionHttp.ts @@ -156,6 +156,9 @@ export class TransactionHttp extends Http implements TransactionRepository { * @returns Observable */ public announce(signedTransaction: SignedTransaction): Observable { + if (signedTransaction.type !== TransactionType.AGGREGATE_BONDED) { + throw new Error('Announcing aggregate bonded transaction should use \'announceAggregateBonded\''); + } return observableFrom(this.transactionRoutesApi.announceTransaction(signedTransaction)).pipe( map((response: { response: ClientResponse; body: AnnounceTransactionInfoDTO; } ) => { const transactionAnnounceResponseDTO = response.body; From 5e95c84e88e6bbdd59887fbd35cc5868fbf11a2e Mon Sep 17 00:00:00 2001 From: Steven Liu Date: Fri, 13 Sep 2019 15:37:16 +0100 Subject: [PATCH 09/10] Fixed bug on transactionHttp aggregateBonded announce check --- src/infrastructure/TransactionHttp.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/infrastructure/TransactionHttp.ts b/src/infrastructure/TransactionHttp.ts index 37bf4d486e..a374d53975 100644 --- a/src/infrastructure/TransactionHttp.ts +++ b/src/infrastructure/TransactionHttp.ts @@ -156,7 +156,7 @@ export class TransactionHttp extends Http implements TransactionRepository { * @returns Observable */ public announce(signedTransaction: SignedTransaction): Observable { - if (signedTransaction.type !== TransactionType.AGGREGATE_BONDED) { + if (signedTransaction.type === TransactionType.AGGREGATE_BONDED) { throw new Error('Announcing aggregate bonded transaction should use \'announceAggregateBonded\''); } return observableFrom(this.transactionRoutesApi.announceTransaction(signedTransaction)).pipe( From 4f86890dfae98f2688f92986e48894e0dab22411 Mon Sep 17 00:00:00 2001 From: Steven Liu Date: Sun, 15 Sep 2019 17:44:17 +0100 Subject: [PATCH 10/10] - Refactored to use factory method for NamespaceId creation - Fixed createFromEncoded bug --- .../transaction/ValidateTransaction.ts | 4 ++-- src/infrastructure/NamespaceHttp.ts | 18 +++++++++--------- .../receipt/CreateReceiptFromDTO.ts | 2 +- .../transaction/CreateTransactionFromDTO.ts | 14 +++++++------- src/model/namespace/NamespaceId.ts | 2 +- test/model/namespace/NamespaceId.spec.ts | 13 +++++++------ 6 files changed, 27 insertions(+), 26 deletions(-) diff --git a/e2e/infrastructure/transaction/ValidateTransaction.ts b/e2e/infrastructure/transaction/ValidateTransaction.ts index d99276ffd3..66789cc3a1 100644 --- a/e2e/infrastructure/transaction/ValidateTransaction.ts +++ b/e2e/infrastructure/transaction/ValidateTransaction.ts @@ -136,14 +136,14 @@ const ValidateTransaction = { expect(registerNamespaceTransaction.namespaceName) .to.be.equal(registerNamespaceTransactionDTO.transaction.name); deepEqual(registerNamespaceTransaction.namespaceId, - new NamespaceId(UInt64.fromHex(registerNamespaceTransactionDTO.transaction.namespaceId).toDTO())); + NamespaceId.createFromEncoded(registerNamespaceTransactionDTO.transaction.namespaceId)); if (registerNamespaceTransaction.namespaceType === 0) { deepEqual(registerNamespaceTransaction.duration, new UInt64(registerNamespaceTransactionDTO.transaction.duration)); } else { deepEqual(registerNamespaceTransaction.parentId, - new NamespaceId(UInt64.fromHex(registerNamespaceTransactionDTO.transaction.parentId).toDTO())); + NamespaceId.createFromEncoded(registerNamespaceTransactionDTO.transaction.parentId)); } }, validateTransferTx: (transferTransaction, transferTransactionDTO) => { diff --git a/src/infrastructure/NamespaceHttp.ts b/src/infrastructure/NamespaceHttp.ts index 9a6aa62b71..21331dcd86 100644 --- a/src/infrastructure/NamespaceHttp.ts +++ b/src/infrastructure/NamespaceHttp.ts @@ -29,7 +29,7 @@ import {NamespaceId} from '../model/namespace/NamespaceId'; import {NamespaceInfo} from '../model/namespace/NamespaceInfo'; import {NamespaceName} from '../model/namespace/NamespaceName'; import {UInt64} from '../model/UInt64'; -import { NamespaceInfoDTO, NamespaceNameDTO, NamespaceRoutesApi, NamespaceDTO } from './api'; +import { NamespaceInfoDTO, NamespaceNameDTO, NamespaceRoutesApi } from './api'; import {Http} from './Http'; import {NamespaceRepository} from './NamespaceRepository'; import {NetworkHttp} from './NetworkHttp'; @@ -76,7 +76,7 @@ export class NamespaceHttp extends Http implements NamespaceRepository { namespaceInfoDTO.namespace.registrationType as number, namespaceInfoDTO.namespace.depth, this.extractLevels(namespaceInfoDTO.namespace), - new NamespaceId(UInt64.fromHex(namespaceInfoDTO.namespace.parentId).toDTO()), + NamespaceId.createFromEncoded(namespaceInfoDTO.namespace.parentId), PublicAccount.createFromPublicKey(namespaceInfoDTO.namespace.ownerPublicKey, networkType), UInt64.fromNumericString(namespaceInfoDTO.namespace.startHeight), UInt64.fromNumericString(namespaceInfoDTO.namespace.endHeight), @@ -113,7 +113,7 @@ export class NamespaceHttp extends Http implements NamespaceRepository { namespaceInfoDTO.namespace.registrationType as number, namespaceInfoDTO.namespace.depth, this.extractLevels(namespaceInfoDTO.namespace), - new NamespaceId(UInt64.fromHex(namespaceInfoDTO.namespace.parentId).toDTO()), + NamespaceId.createFromEncoded(namespaceInfoDTO.namespace.parentId), PublicAccount.createFromPublicKey(namespaceInfoDTO.namespace.ownerPublicKey, networkType), UInt64.fromNumericString(namespaceInfoDTO.namespace.startHeight), UInt64.fromNumericString(namespaceInfoDTO.namespace.endHeight), @@ -150,7 +150,7 @@ export class NamespaceHttp extends Http implements NamespaceRepository { namespaceInfoDTO.namespace.registrationType as number, namespaceInfoDTO.namespace.depth, this.extractLevels(namespaceInfoDTO.namespace), - new NamespaceId(UInt64.fromHex(namespaceInfoDTO.namespace.parentId).toDTO()), + NamespaceId.createFromEncoded(namespaceInfoDTO.namespace.parentId), PublicAccount.createFromPublicKey(namespaceInfoDTO.namespace.ownerPublicKey, networkType), UInt64.fromNumericString(namespaceInfoDTO.namespace.startHeight), UInt64.fromNumericString(namespaceInfoDTO.namespace.endHeight), @@ -178,9 +178,9 @@ export class NamespaceHttp extends Http implements NamespaceRepository { const namespaceNamesDTO = response.body; return namespaceNamesDTO.map((namespaceNameDTO) => { return new NamespaceName( - new NamespaceId(UInt64.fromHex(namespaceNameDTO.namespaceId).toDTO()), + NamespaceId.createFromEncoded(namespaceNameDTO.namespaceId), namespaceNameDTO.name, - namespaceNameDTO.parentId ? new NamespaceId(UInt64.fromHex(namespaceNameDTO.parentId).toDTO()) : undefined, + namespaceNameDTO.parentId ? NamespaceId.createFromEncoded(namespaceNameDTO.parentId) : undefined, ); }); }), @@ -250,13 +250,13 @@ export class NamespaceHttp extends Http implements NamespaceRepository { private extractLevels(namespace: any): NamespaceId[] { const result: NamespaceId[] = []; if (namespace.level0) { - result.push(new NamespaceId(UInt64.fromHex(namespace.level0).toDTO())); + result.push(NamespaceId.createFromEncoded(namespace.level0)); } if (namespace.level1) { - result.push(new NamespaceId(UInt64.fromHex(namespace.level1).toDTO())); + result.push(NamespaceId.createFromEncoded(namespace.level1)); } if (namespace.level2) { - result.push(new NamespaceId(UInt64.fromHex(namespace.level2).toDTO())); + result.push(NamespaceId.createFromEncoded(namespace.level2)); } return result; } diff --git a/src/infrastructure/receipt/CreateReceiptFromDTO.ts b/src/infrastructure/receipt/CreateReceiptFromDTO.ts index 1cff8ea86e..1cb61fe1b1 100644 --- a/src/infrastructure/receipt/CreateReceiptFromDTO.ts +++ b/src/infrastructure/receipt/CreateReceiptFromDTO.ts @@ -199,7 +199,7 @@ const extractArtifactId = (receiptType: ReceiptType, id: string): MosaicId | Nam case ReceiptType.Mosaic_Expired: return new MosaicId(id); case ReceiptType.Namespace_Expired: - return new NamespaceId(UInt64.fromHex(id).toDTO()); + return NamespaceId.createFromEncoded(id); default: throw new Error('Receipt type is not supported.'); } diff --git a/src/infrastructure/transaction/CreateTransactionFromDTO.ts b/src/infrastructure/transaction/CreateTransactionFromDTO.ts index a6d62fd368..2165727001 100644 --- a/src/infrastructure/transaction/CreateTransactionFromDTO.ts +++ b/src/infrastructure/transaction/CreateTransactionFromDTO.ts @@ -147,9 +147,9 @@ const CreateStandaloneTransactionFromDTO = (transactionDTO, transactionInfo): Tr UInt64.fromNumericString(transactionDTO.maxFee || '0'), transactionDTO.registrationType, transactionDTO.name, - new NamespaceId(UInt64.fromHex(transactionDTO.id).toDTO()), + NamespaceId.createFromEncoded(transactionDTO.id), transactionDTO.registrationType === 0 ? UInt64.fromNumericString(transactionDTO.duration) : undefined, - transactionDTO.registrationType === 1 ? new NamespaceId(UInt64.fromHex(transactionDTO.parentId).toDTO()) : undefined, + transactionDTO.registrationType === 1 ? NamespaceId.createFromEncoded(transactionDTO.parentId) : undefined, transactionDTO.signature, transactionDTO.signerPublicKey ? PublicAccount.createFromPublicKey(transactionDTO.signerPublicKey, extractNetworkType(transactionDTO.version)) : undefined, @@ -260,7 +260,7 @@ const CreateStandaloneTransactionFromDTO = (transactionDTO, transactionInfo): Tr Deadline.createFromDTO(transactionDTO.deadline), UInt64.fromNumericString(transactionDTO.maxFee || '0'), transactionDTO.aliasAction, - new NamespaceId(UInt64.fromHex(transactionDTO.namespaceId).toDTO()), + NamespaceId.createFromEncoded(transactionDTO.namespaceId), new MosaicId(transactionDTO.mosaicId), transactionDTO.signature, transactionDTO.signerPublicKey ? PublicAccount.createFromPublicKey(transactionDTO.signerPublicKey, @@ -274,7 +274,7 @@ const CreateStandaloneTransactionFromDTO = (transactionDTO, transactionInfo): Tr Deadline.createFromDTO(transactionDTO.deadline), UInt64.fromNumericString(transactionDTO.maxFee || '0'), transactionDTO.aliasAction, - new NamespaceId(UInt64.fromHex(transactionDTO.namespaceId).toDTO()), + NamespaceId.createFromEncoded(transactionDTO.namespaceId), extractRecipient(transactionDTO.address) as Address, transactionDTO.signature, transactionDTO.signerPublicKey ? PublicAccount.createFromPublicKey(transactionDTO.signerPublicKey, @@ -417,7 +417,7 @@ const CreateStandaloneTransactionFromDTO = (transactionDTO, transactionInfo): Tr UInt64.fromNumericString(transactionDTO.maxFee || '0'), transactionDTO.targetPublicKey, UInt64.fromNumericString(transactionDTO.scopedMetadataKey), - new NamespaceId(UInt64.fromHex(transactionDTO.targetNamespaceId).toDTO()), + NamespaceId.createFromEncoded(transactionDTO.targetNamespaceId), transactionDTO.valueSizeDelta, convert.hexToUint8(transactionDTO.value), transactionDTO.signature, @@ -474,7 +474,7 @@ export const extractRecipient = (recipientAddress: any): Address | NamespaceId if (recipientAddress.hasOwnProperty('address')) { return Address.createFromRawAddress(recipientAddress.address); } else if (recipientAddress.hasOwnProperty('id')) { - return new NamespaceId(UInt64.fromHex(recipientAddress.id).toDTO()); + return NamespaceId.createFromEncoded(recipientAddress.id); } } throw new Error(`Recipient: ${recipientAddress} type is not recognised`); @@ -503,7 +503,7 @@ export const extractMosaics = (mosaics: any): Mosaic[] => { // if most significant bit of byte 0 is set, then we have a namespaceId if ((byte0 & 128) === 128) { - const namespaceId = new NamespaceId(UInt64.fromHex(mosaicDTO.id).toDTO()); + const namespaceId = NamespaceId.createFromEncoded(mosaicDTO.id); return new Mosaic(namespaceId, UInt64.fromNumericString(mosaicDTO.amount)); } diff --git a/src/model/namespace/NamespaceId.ts b/src/model/namespace/NamespaceId.ts index c056c698b1..7f4e019077 100644 --- a/src/model/namespace/NamespaceId.ts +++ b/src/model/namespace/NamespaceId.ts @@ -55,7 +55,7 @@ export class NamespaceId { * @returns {NamespaceId} */ public static createFromEncoded(encoded: string): NamespaceId { - const uint = convert.hexToUint8(encoded).reverse(); + const uint = convert.hexToUint8(encoded); const hex = convert.uint8ToHex(uint); const namespace = new NamespaceId(Id.fromHex(hex).toDTO()); return namespace; diff --git a/test/model/namespace/NamespaceId.spec.ts b/test/model/namespace/NamespaceId.spec.ts index ecb7d9fec1..1e373c4878 100644 --- a/test/model/namespace/NamespaceId.spec.ts +++ b/test/model/namespace/NamespaceId.spec.ts @@ -18,6 +18,7 @@ import {deepEqual} from 'assert'; import {expect} from 'chai'; import {Id} from '../../../src/model/Id'; import {NamespaceId} from '../../../src/model/namespace/NamespaceId'; +import { UInt64 } from '../../../src/model/UInt64'; describe('NamespaceId', () => { it('should be created from root namespace name', () => { @@ -39,12 +40,12 @@ describe('NamespaceId', () => { }); const vectors = [ - {encoded: '4bfa5f372d55b384', uint: [929036875, 2226345261]}, // new NamespaceId('nem') - {encoded: '08a12f89ee5a49f8', uint: [2301600008, 4165556974]}, // new NamespaceId('nem.owner.test1') - {encoded: '1f810565e8f4aeab', uint: [1694859551, 2880369896]}, // new NamespaceId('nem.owner.test2') - {encoded: '552d1c0a2bc9b8ae', uint: [169618773, 2931345707]}, // new NamespaceId('nem.owner.test3') - {encoded: 'bfca1440d49ae090', uint: [1075104447, 2430638804]}, // new NamespaceId('nem.owner.test4') - {encoded: 'ccf10b96814211ab', uint: [2517365196, 2870035073]}, // new NamespaceId('nem.owner.test5') + {encoded: '84B3552D375FFA4B', uint: [929036875, 2226345261]}, // new NamespaceId('nem') + {encoded: 'F8495AEE892FA108', uint: [2301600008, 4165556974]}, // new NamespaceId('nem.owner.test1') + {encoded: 'ABAEF4E86505811F', uint: [1694859551, 2880369896]}, // new NamespaceId('nem.owner.test2') + {encoded: 'AEB8C92B0A1C2D55', uint: [169618773, 2931345707]}, // new NamespaceId('nem.owner.test3') + {encoded: '90E09AD44014CABF', uint: [1075104447, 2430638804]}, // new NamespaceId('nem.owner.test4') + {encoded: 'AB114281960BF1CC', uint: [2517365196, 2870035073]}, // new NamespaceId('nem.owner.test5') ]; it('should be created from encoded vectors', () => {