From 10c7ad407a042e7440c956f3d0e6b4558ae5a3cb Mon Sep 17 00:00:00 2001 From: Tuditi Date: Fri, 28 Jul 2023 10:04:20 +0200 Subject: [PATCH 1/8] chore: make private fields readonly --- bindings/nodejs/lib/types/block/address.ts | 8 +++--- .../nodejs/lib/types/block/input/input.ts | 8 +++--- .../nodejs/lib/types/block/output/feature.ts | 15 +++++++---- .../nodejs/lib/types/block/output/output.ts | 26 +++++++++---------- .../lib/types/block/output/token-scheme.ts | 8 +++--- .../types/block/output/unlock-condition.ts | 22 +++++++++------- .../nodejs/lib/types/block/payload/payload.ts | 2 +- .../block/payload/transaction/essence.ts | 12 ++++----- .../types/block/payload/transaction/unlock.ts | 4 +-- bindings/nodejs/lib/types/block/signature.ts | 6 ++--- .../milestone_options/milestone-options.ts | 2 +- .../prepared-create-token-transaction.ts | 2 +- .../lib/types/wallet/prepared-transaction.ts | 6 ++--- 13 files changed, 64 insertions(+), 57 deletions(-) diff --git a/bindings/nodejs/lib/types/block/address.ts b/bindings/nodejs/lib/types/block/address.ts index e011adc1e7..ff3da06b8b 100644 --- a/bindings/nodejs/lib/types/block/address.ts +++ b/bindings/nodejs/lib/types/block/address.ts @@ -12,7 +12,7 @@ enum AddressType { } abstract class Address { - private type: AddressType; + readonly type: AddressType; constructor(type: AddressType) { this.type = type; @@ -44,7 +44,7 @@ abstract class Address { * Ed25519 Address. */ class Ed25519Address extends Address { - private pubKeyHash: HexEncodedString; + readonly pubKeyHash: HexEncodedString; constructor(address: HexEncodedString) { super(AddressType.Ed25519); @@ -63,7 +63,7 @@ class Ed25519Address extends Address { } class AliasAddress extends Address { - private aliasId: AliasId; + readonly aliasId: AliasId; constructor(address: AliasId) { super(AddressType.Alias); this.aliasId = address; @@ -83,7 +83,7 @@ class AliasAddress extends Address { * NFT address. */ class NftAddress extends Address { - private nftId: NftId; + readonly nftId: NftId; constructor(address: NftId) { super(AddressType.Nft); this.nftId = address; diff --git a/bindings/nodejs/lib/types/block/input/input.ts b/bindings/nodejs/lib/types/block/input/input.ts index 9f4a2c4210..551eb037c4 100644 --- a/bindings/nodejs/lib/types/block/input/input.ts +++ b/bindings/nodejs/lib/types/block/input/input.ts @@ -14,7 +14,7 @@ enum InputType { } abstract class Input { - private type: InputType; + readonly type: InputType; constructor(type: InputType) { this.type = type; @@ -35,7 +35,7 @@ class TreasuryInput extends Input { /** * The milestone id of the input. */ - milestoneId: HexEncodedString; + readonly milestoneId: HexEncodedString; constructor(milestoneId: HexEncodedString) { super(InputType.Treasury); @@ -50,11 +50,11 @@ class UTXOInput extends Input { /** * The transaction Id. */ - transactionId: HexEncodedString; + readonly transactionId: HexEncodedString; /** * The output index. */ - transactionOutputIndex: number; + readonly transactionOutputIndex: number; constructor( transactionId: HexEncodedString, diff --git a/bindings/nodejs/lib/types/block/output/feature.ts b/bindings/nodejs/lib/types/block/output/feature.ts index b44902c93d..d02dffb63d 100644 --- a/bindings/nodejs/lib/types/block/output/feature.ts +++ b/bindings/nodejs/lib/types/block/output/feature.ts @@ -14,7 +14,8 @@ enum FeatureType { } abstract class Feature { - private type: FeatureType; + readonly type: FeatureType; + constructor(type: FeatureType) { this.type = type; } @@ -29,7 +30,8 @@ abstract class Feature { * Sender feature. */ class SenderFeature extends Feature { - private address: Address; + readonly address: Address; + constructor(sender: Address) { super(FeatureType.Sender); this.address = sender; @@ -45,7 +47,8 @@ class SenderFeature extends Feature { * Issuer feature. */ class IssuerFeature extends Feature { - private address: Address; + readonly address: Address; + constructor(issuer: Address) { super(FeatureType.Issuer); this.address = issuer; @@ -61,7 +64,8 @@ class IssuerFeature extends Feature { * Metadata feature. */ class MetadataFeature extends Feature { - private data: string; + readonly data: string; + constructor(data: string) { super(FeatureType.Metadata); this.data = data; @@ -77,7 +81,8 @@ class MetadataFeature extends Feature { * Tag feature. */ class TagFeature extends Feature { - private tag: string; + readonly tag: string; + constructor(tag: string) { super(FeatureType.Tag); this.tag = tag; diff --git a/bindings/nodejs/lib/types/block/output/output.ts b/bindings/nodejs/lib/types/block/output/output.ts index 8186236c4b..b7ba62f3cc 100644 --- a/bindings/nodejs/lib/types/block/output/output.ts +++ b/bindings/nodejs/lib/types/block/output/output.ts @@ -27,9 +27,9 @@ enum OutputType { } abstract class Output /*implements ICommonOutput*/ { - private amount: string; + readonly amount: string; - private type: OutputType; + readonly type: OutputType; constructor(type: OutputType, amount: bigint | string) { this.type = type; @@ -80,14 +80,14 @@ abstract class CommonOutput extends Output /*implements ICommonOutput*/ { @Type(() => UnlockCondition, { discriminator: UnlockConditionDiscriminator, }) - private unlockConditions: UnlockCondition[]; + readonly unlockConditions: UnlockCondition[]; - private nativeTokens?: INativeToken[]; + readonly nativeTokens?: INativeToken[]; @Type(() => Feature, { discriminator: FeatureDiscriminator, }) - private features?: Feature[]; + readonly features?: Feature[]; constructor( type: OutputType, @@ -149,7 +149,7 @@ abstract class ImmutableFeaturesOutput extends CommonOutput { @Type(() => Feature, { discriminator: FeatureDiscriminator, }) - private immutableFeatures?: Feature[]; + readonly immutableFeatures?: Feature[]; constructor( type: OutputType, @@ -167,7 +167,7 @@ abstract class ImmutableFeaturesOutput extends CommonOutput { } abstract class StateMetadataOutput extends ImmutableFeaturesOutput /*implements IBasicOutput*/ { - private stateMetadata?: HexEncodedString; + readonly stateMetadata?: HexEncodedString; constructor( type: OutputType, @@ -185,9 +185,9 @@ abstract class StateMetadataOutput extends ImmutableFeaturesOutput /*implements } class AliasOutput extends StateMetadataOutput /*implements IAliasOutput*/ { - private aliasId: HexEncodedString; - private stateIndex: number; - private foundryCounter: number; + readonly aliasId: HexEncodedString; + readonly stateIndex: number; + readonly foundryCounter: number; constructor( unlockConditions: UnlockCondition[], @@ -225,7 +225,7 @@ class AliasOutput extends StateMetadataOutput /*implements IAliasOutput*/ { * NFT output. */ class NftOutput extends ImmutableFeaturesOutput /*implements INftOutput*/ { - private nftId: HexEncodedString; + readonly nftId: HexEncodedString; constructor( amount: bigint, @@ -247,12 +247,12 @@ class NftOutput extends ImmutableFeaturesOutput /*implements INftOutput*/ { * Foundry output. */ class FoundryOutput extends ImmutableFeaturesOutput /*implements IFoundryOutput*/ { - private serialNumber: number; + readonly serialNumber: number; @Type(() => TokenScheme, { discriminator: TokenSchemeDiscriminator, }) - private tokenScheme: TokenScheme; + readonly tokenScheme: TokenScheme; constructor( amount: bigint, diff --git a/bindings/nodejs/lib/types/block/output/token-scheme.ts b/bindings/nodejs/lib/types/block/output/token-scheme.ts index fd46c25cb6..0602ab43a2 100644 --- a/bindings/nodejs/lib/types/block/output/token-scheme.ts +++ b/bindings/nodejs/lib/types/block/output/token-scheme.ts @@ -8,7 +8,7 @@ enum TokenSchemeType { } abstract class TokenScheme { - private type: TokenSchemeType; + readonly type: TokenSchemeType; constructor(type: TokenSchemeType) { this.type = type; @@ -26,9 +26,9 @@ abstract class TokenScheme { * Simple token scheme. */ class SimpleTokenScheme extends TokenScheme { - private mintedTokens: bigint; - private meltedTokens: bigint; - private maximumSupply: bigint; + readonly mintedTokens: bigint; + readonly meltedTokens: bigint; + readonly maximumSupply: bigint; constructor( mintedTokens: bigint, diff --git a/bindings/nodejs/lib/types/block/output/unlock-condition.ts b/bindings/nodejs/lib/types/block/output/unlock-condition.ts index 6b3a8d2397..f78430d91a 100644 --- a/bindings/nodejs/lib/types/block/output/unlock-condition.ts +++ b/bindings/nodejs/lib/types/block/output/unlock-condition.ts @@ -18,7 +18,7 @@ enum UnlockConditionType { } abstract class UnlockCondition { - private type: UnlockConditionType; + readonly type: UnlockConditionType; constructor(type: UnlockConditionType) { this.type = type; @@ -75,7 +75,8 @@ class AddressUnlockCondition extends UnlockCondition /*implements IAddressUnlock @Type(() => Address, { discriminator: AddressDiscriminator, }) - private address: Address; + readonly address: Address; + constructor(address: Address) { super(UnlockConditionType.Address); this.address = address; @@ -92,12 +93,12 @@ class AddressUnlockCondition extends UnlockCondition /*implements IAddressUnlock * Storage Deposit Return Unlock Condition. */ class StorageDepositReturnUnlockCondition extends UnlockCondition /*implements IStorageDepositReturnUnlockCondition*/ { - private amount: string; + readonly amount: string; @Type(() => Address, { discriminator: AddressDiscriminator, }) - private returnAddress: Address; + readonly returnAddress: Address; constructor(returnAddress: Address, amount: bigint | string) { super(UnlockConditionType.StorageDepositReturn); @@ -126,7 +127,7 @@ class StorageDepositReturnUnlockCondition extends UnlockCondition /*implements I * Timelock Unlock Condition. */ class TimelockUnlockCondition extends UnlockCondition /*implements ITimelockUnlockCondition*/ { - private unixTime: number; + readonly unixTime: number; constructor(unixTime: number) { super(UnlockConditionType.Timelock); @@ -144,8 +145,8 @@ class ExpirationUnlockCondition extends UnlockCondition /*implements IExpiration @Type(() => Address, { discriminator: AddressDiscriminator, }) - private returnAddress: Address; - private unixTime: number; + readonly returnAddress: Address; + readonly unixTime: number; constructor(returnAddress: Address, unixTime: number) { super(UnlockConditionType.Expiration); @@ -174,7 +175,7 @@ class StateControllerAddressUnlockCondition extends UnlockCondition /*implements @Type(() => Address, { discriminator: AddressDiscriminator, }) - private address: Address; + readonly address: Address; constructor(address: Address) { super(UnlockConditionType.StateControllerAddress); this.address = address; @@ -194,7 +195,7 @@ class GovernorAddressUnlockCondition extends UnlockCondition /*implements IGover @Type(() => Address, { discriminator: AddressDiscriminator, }) - private address: Address; + readonly address: Address; constructor(address: Address) { super(UnlockConditionType.GovernorAddress); this.address = address; @@ -214,7 +215,8 @@ class ImmutableAliasAddressUnlockCondition extends UnlockCondition /*implements @Type(() => Address, { discriminator: AddressDiscriminator, }) - private address: Address; + readonly address: Address; + constructor(address: AliasAddress) { super(UnlockConditionType.ImmutableAliasAddress); this.address = address; diff --git a/bindings/nodejs/lib/types/block/payload/payload.ts b/bindings/nodejs/lib/types/block/payload/payload.ts index 82e85c9c37..f498600e47 100644 --- a/bindings/nodejs/lib/types/block/payload/payload.ts +++ b/bindings/nodejs/lib/types/block/payload/payload.ts @@ -16,7 +16,7 @@ enum PayloadType { } abstract class Payload { - private type: PayloadType; + readonly type: PayloadType; constructor(type: PayloadType) { this.type = type; diff --git a/bindings/nodejs/lib/types/block/payload/transaction/essence.ts b/bindings/nodejs/lib/types/block/payload/transaction/essence.ts index 403948257c..8a90c7176f 100644 --- a/bindings/nodejs/lib/types/block/payload/transaction/essence.ts +++ b/bindings/nodejs/lib/types/block/payload/transaction/essence.ts @@ -16,7 +16,7 @@ enum TransactionEssenceType { } abstract class TransactionEssence { - private type: TransactionEssenceType; + readonly type: TransactionEssenceType; constructor(type: TransactionEssenceType) { this.type = type; @@ -35,23 +35,23 @@ abstract class TransactionEssence { */ class RegularTransactionEssence extends TransactionEssence { /// The unique value denoting whether the block was meant for mainnet, testnet, or a private network. - networkId: number; - inputsCommitment: HexEncodedString; + readonly networkId: number; + readonly inputsCommitment: HexEncodedString; @Type(() => Input, { discriminator: InputDiscriminator, }) - inputs: [Input]; + readonly inputs: [Input]; @Type(() => Output, { discriminator: OutputDiscriminator, }) - outputs: [Output]; + readonly outputs: [Output]; @Type(() => Payload, { discriminator: PayloadDiscriminator, }) - payload: Payload | undefined; + readonly payload: Payload | undefined; constructor( networkId: number, diff --git a/bindings/nodejs/lib/types/block/payload/transaction/unlock.ts b/bindings/nodejs/lib/types/block/payload/transaction/unlock.ts index 0bfefd6a54..e45b3faaf6 100644 --- a/bindings/nodejs/lib/types/block/payload/transaction/unlock.ts +++ b/bindings/nodejs/lib/types/block/payload/transaction/unlock.ts @@ -15,7 +15,7 @@ enum UnlockType { } abstract class Unlock { - private type: UnlockType; + readonly type: UnlockType; constructor(type: UnlockType) { this.type = type; @@ -37,7 +37,7 @@ class SignatureUnlock extends Unlock { * The signature. */ @Type(() => Ed25519Signature) - signature: Ed25519Signature; + readonly signature: Ed25519Signature; constructor(signature: Ed25519Signature) { super(UnlockType.Signature); diff --git a/bindings/nodejs/lib/types/block/signature.ts b/bindings/nodejs/lib/types/block/signature.ts index 9f7ec48d6a..0eb2846d70 100644 --- a/bindings/nodejs/lib/types/block/signature.ts +++ b/bindings/nodejs/lib/types/block/signature.ts @@ -12,7 +12,7 @@ enum SignatureType { } abstract class Signature { - private type: SignatureType; + readonly type: SignatureType; constructor(type: SignatureType) { this.type = type; @@ -33,11 +33,11 @@ class Ed25519Signature extends Signature { /** * The public key. */ - publicKey: HexEncodedString; + readonly publicKey: HexEncodedString; /** * The signature. */ - signature: HexEncodedString; + readonly signature: HexEncodedString; constructor(publicKey: HexEncodedString, signature: HexEncodedString) { super(SignatureType.Ed25519); diff --git a/bindings/nodejs/lib/types/models/milestone_options/milestone-options.ts b/bindings/nodejs/lib/types/models/milestone_options/milestone-options.ts index d186737b4f..b094b12683 100644 --- a/bindings/nodejs/lib/types/models/milestone_options/milestone-options.ts +++ b/bindings/nodejs/lib/types/models/milestone_options/milestone-options.ts @@ -10,7 +10,7 @@ enum MilestoneOptionType { } abstract class MilestoneOption { - private type: MilestoneOptionType; + readonly type: MilestoneOptionType; constructor(type: MilestoneOptionType) { this.type = type; diff --git a/bindings/nodejs/lib/types/wallet/prepared-create-token-transaction.ts b/bindings/nodejs/lib/types/wallet/prepared-create-token-transaction.ts index 30ecb6623d..1eace7d6ff 100644 --- a/bindings/nodejs/lib/types/wallet/prepared-create-token-transaction.ts +++ b/bindings/nodejs/lib/types/wallet/prepared-create-token-transaction.ts @@ -9,7 +9,7 @@ import { PreparedTransaction } from './prepared-transaction'; * The class PreparedCreateNativeTokenTransaction represents prepared data for issuing a transaction to create a native token. */ export class PreparedCreateNativeTokenTransaction extends PreparedTransaction { - private _tokenId: string; + readonly _tokenId: string; constructor( preparedData: PreparedCreateNativeTokenTransactionData, diff --git a/bindings/nodejs/lib/types/wallet/prepared-transaction.ts b/bindings/nodejs/lib/types/wallet/prepared-transaction.ts index 00e5edacba..2a1543519b 100644 --- a/bindings/nodejs/lib/types/wallet/prepared-transaction.ts +++ b/bindings/nodejs/lib/types/wallet/prepared-transaction.ts @@ -15,8 +15,8 @@ import { * the transaction and sign+submit/send the transaction. */ export class PreparedTransaction { - private _preparedData: PreparedTransactionData; - private _account: Account; + readonly _preparedData: PreparedTransactionData; + readonly _account: Account; constructor(preparedData: PreparedTransactionData, account: Account) { this._preparedData = preparedData; @@ -49,7 +49,7 @@ export class PreparedTransaction { } /** - * This function signs a prepared transaction essence using the account's private key and returns + * This function signs a prepared transaction essence using the account's readonly key and returns * the signed transaction essence. * * Returns: From 05bdedb9e7e59b2fba950edbbd94548bf76ad3d8 Mon Sep 17 00:00:00 2001 From: Tuditi Date: Fri, 28 Jul 2023 10:49:47 +0200 Subject: [PATCH 2/8] fix: lint --- bindings/nodejs/lib/types/block/output/feature.ts | 6 +++--- bindings/nodejs/lib/types/block/output/unlock-condition.ts | 2 +- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/bindings/nodejs/lib/types/block/output/feature.ts b/bindings/nodejs/lib/types/block/output/feature.ts index ab183be5a4..41a042b82f 100644 --- a/bindings/nodejs/lib/types/block/output/feature.ts +++ b/bindings/nodejs/lib/types/block/output/feature.ts @@ -35,7 +35,7 @@ class SenderFeature extends Feature { discriminator: AddressDiscriminator, }) readonly address: Address; - + constructor(sender: Address) { super(FeatureType.Sender); this.address = sender; @@ -55,7 +55,7 @@ class IssuerFeature extends Feature { discriminator: AddressDiscriminator, }) readonly address: Address; - + constructor(issuer: Address) { super(FeatureType.Issuer); this.address = issuer; @@ -89,7 +89,7 @@ class MetadataFeature extends Feature { */ class TagFeature extends Feature { readonly tag: string; - + constructor(tag: string) { super(FeatureType.Tag); this.tag = tag; diff --git a/bindings/nodejs/lib/types/block/output/unlock-condition.ts b/bindings/nodejs/lib/types/block/output/unlock-condition.ts index f78430d91a..d6595e070e 100644 --- a/bindings/nodejs/lib/types/block/output/unlock-condition.ts +++ b/bindings/nodejs/lib/types/block/output/unlock-condition.ts @@ -216,7 +216,7 @@ class ImmutableAliasAddressUnlockCondition extends UnlockCondition /*implements discriminator: AddressDiscriminator, }) readonly address: Address; - + constructor(address: AliasAddress) { super(UnlockConditionType.ImmutableAliasAddress); this.address = address; From 1c95b841fbf9fb9e14dd353809327418e8252399 Mon Sep 17 00:00:00 2001 From: Tuditi Date: Fri, 28 Jul 2023 10:49:57 +0200 Subject: [PATCH 3/8] chore: changelog --- bindings/nodejs/CHANGELOG.md | 1 + 1 file changed, 1 insertion(+) diff --git a/bindings/nodejs/CHANGELOG.md b/bindings/nodejs/CHANGELOG.md index f1ac21596a..5551406f66 100644 --- a/bindings/nodejs/CHANGELOG.md +++ b/bindings/nodejs/CHANGELOG.md @@ -25,6 +25,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 - Constructor types in `RegularTransactionEssence`; - `SenderFeature.getSender()` and `IssuerFeature.getIssuer()` now return the correct types; +- Private properties on classes are now readonly. ## 1.0.1 - 2023-07-25 From b225ac22335a9a50c63fd71135d06baffe66d990 Mon Sep 17 00:00:00 2001 From: Tuditi Date: Fri, 28 Jul 2023 11:52:09 +0200 Subject: [PATCH 4/8] fix: comment --- bindings/nodejs/lib/types/wallet/prepared-transaction.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/bindings/nodejs/lib/types/wallet/prepared-transaction.ts b/bindings/nodejs/lib/types/wallet/prepared-transaction.ts index 2a1543519b..042b6ed75e 100644 --- a/bindings/nodejs/lib/types/wallet/prepared-transaction.ts +++ b/bindings/nodejs/lib/types/wallet/prepared-transaction.ts @@ -49,7 +49,7 @@ export class PreparedTransaction { } /** - * This function signs a prepared transaction essence using the account's readonly key and returns + * This function signs a prepared transaction essence using the account's private key and returns * the signed transaction essence. * * Returns: From 88c40c9b190ab31a6f19f731e20f4c9c6cdb36c9 Mon Sep 17 00:00:00 2001 From: Tuditi Date: Fri, 28 Jul 2023 11:52:36 +0200 Subject: [PATCH 5/8] chore: update changelog --- bindings/nodejs/CHANGELOG.md | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/bindings/nodejs/CHANGELOG.md b/bindings/nodejs/CHANGELOG.md index 5551406f66..6ad15d1a37 100644 --- a/bindings/nodejs/CHANGELOG.md +++ b/bindings/nodejs/CHANGELOG.md @@ -25,8 +25,10 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 - Constructor types in `RegularTransactionEssence`; - `SenderFeature.getSender()` and `IssuerFeature.getIssuer()` now return the correct types; -- Private properties on classes are now readonly. +### Changed + +- Private properties on classes are now readonly. ## 1.0.1 - 2023-07-25 From 29226001a75709cda5e32d228ac608305a130ecf Mon Sep 17 00:00:00 2001 From: Thibault Martinez Date: Fri, 28 Jul 2023 13:00:06 +0200 Subject: [PATCH 6/8] Nits --- bindings/nodejs/CHANGELOG.md | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/bindings/nodejs/CHANGELOG.md b/bindings/nodejs/CHANGELOG.md index 6ad15d1a37..399e260f7b 100644 --- a/bindings/nodejs/CHANGELOG.md +++ b/bindings/nodejs/CHANGELOG.md @@ -21,15 +21,15 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 ## 1.0.2 - 2023-MM-DD +### Changed + +- Private properties on classes are now readonly; + ### Fixed - Constructor types in `RegularTransactionEssence`; - `SenderFeature.getSender()` and `IssuerFeature.getIssuer()` now return the correct types; -### Changed - -- Private properties on classes are now readonly. - ## 1.0.1 - 2023-07-25 ### Changed From 2d1fdbd88ba6a81d7f4c82c49572cd2e8976ccda Mon Sep 17 00:00:00 2001 From: Tuditi Date: Fri, 28 Jul 2023 13:38:54 +0200 Subject: [PATCH 7/8] fix: undo breaking change --- bindings/nodejs/lib/types/block/input/input.ts | 6 +++--- .../lib/types/block/payload/transaction/essence.ts | 10 +++++----- .../lib/types/block/payload/transaction/unlock.ts | 2 +- bindings/nodejs/lib/types/block/signature.ts | 6 +++--- 4 files changed, 12 insertions(+), 12 deletions(-) diff --git a/bindings/nodejs/lib/types/block/input/input.ts b/bindings/nodejs/lib/types/block/input/input.ts index 551eb037c4..661d737be8 100644 --- a/bindings/nodejs/lib/types/block/input/input.ts +++ b/bindings/nodejs/lib/types/block/input/input.ts @@ -35,7 +35,7 @@ class TreasuryInput extends Input { /** * The milestone id of the input. */ - readonly milestoneId: HexEncodedString; + milestoneId: HexEncodedString; constructor(milestoneId: HexEncodedString) { super(InputType.Treasury); @@ -50,11 +50,11 @@ class UTXOInput extends Input { /** * The transaction Id. */ - readonly transactionId: HexEncodedString; + transactionId: HexEncodedString; /** * The output index. */ - readonly transactionOutputIndex: number; + transactionOutputIndex: number; constructor( transactionId: HexEncodedString, diff --git a/bindings/nodejs/lib/types/block/payload/transaction/essence.ts b/bindings/nodejs/lib/types/block/payload/transaction/essence.ts index c5e31a1820..66fe8b00d2 100644 --- a/bindings/nodejs/lib/types/block/payload/transaction/essence.ts +++ b/bindings/nodejs/lib/types/block/payload/transaction/essence.ts @@ -35,23 +35,23 @@ abstract class TransactionEssence { */ class RegularTransactionEssence extends TransactionEssence { /// The unique value denoting whether the block was meant for mainnet, testnet, or a private network. - readonly networkId: number; - readonly inputsCommitment: HexEncodedString; + networkId: number; + inputsCommitment: HexEncodedString; @Type(() => Input, { discriminator: InputDiscriminator, }) - readonly inputs: Input[]; + inputs: Input[]; @Type(() => Output, { discriminator: OutputDiscriminator, }) - readonly outputs: Output[]; + outputs: Output[]; @Type(() => Payload, { discriminator: PayloadDiscriminator, }) - readonly payload: Payload | undefined; + payload: Payload | undefined; constructor( networkId: number, diff --git a/bindings/nodejs/lib/types/block/payload/transaction/unlock.ts b/bindings/nodejs/lib/types/block/payload/transaction/unlock.ts index e45b3faaf6..45b7f0f2ce 100644 --- a/bindings/nodejs/lib/types/block/payload/transaction/unlock.ts +++ b/bindings/nodejs/lib/types/block/payload/transaction/unlock.ts @@ -37,7 +37,7 @@ class SignatureUnlock extends Unlock { * The signature. */ @Type(() => Ed25519Signature) - readonly signature: Ed25519Signature; + signature: Ed25519Signature; constructor(signature: Ed25519Signature) { super(UnlockType.Signature); diff --git a/bindings/nodejs/lib/types/block/signature.ts b/bindings/nodejs/lib/types/block/signature.ts index 0eb2846d70..cc8c235110 100644 --- a/bindings/nodejs/lib/types/block/signature.ts +++ b/bindings/nodejs/lib/types/block/signature.ts @@ -12,7 +12,7 @@ enum SignatureType { } abstract class Signature { - readonly type: SignatureType; + type: SignatureType; constructor(type: SignatureType) { this.type = type; @@ -33,11 +33,11 @@ class Ed25519Signature extends Signature { /** * The public key. */ - readonly publicKey: HexEncodedString; + publicKey: HexEncodedString; /** * The signature. */ - readonly signature: HexEncodedString; + signature: HexEncodedString; constructor(publicKey: HexEncodedString, signature: HexEncodedString) { super(SignatureType.Ed25519); From ff1e439eaad56ca6076ca51427c950e106267cf4 Mon Sep 17 00:00:00 2001 From: Tuditi <45079109+Tuditi@users.noreply.github.com> Date: Fri, 28 Jul 2023 14:29:56 +0200 Subject: [PATCH 8/8] Update bindings/nodejs/lib/types/block/signature.ts Co-authored-by: Abdulrahim Al Methiab <31316147+abdulmth@users.noreply.github.com> --- bindings/nodejs/lib/types/block/signature.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/bindings/nodejs/lib/types/block/signature.ts b/bindings/nodejs/lib/types/block/signature.ts index cc8c235110..bf7c811eaa 100644 --- a/bindings/nodejs/lib/types/block/signature.ts +++ b/bindings/nodejs/lib/types/block/signature.ts @@ -12,7 +12,7 @@ enum SignatureType { } abstract class Signature { - type: SignatureType; + readonly type: SignatureType; constructor(type: SignatureType) { this.type = type;