diff --git a/src/types/Transaction.ts b/src/types/Transaction.ts index 7ce8badef..cdb61d4cc 100644 --- a/src/types/Transaction.ts +++ b/src/types/Transaction.ts @@ -502,8 +502,6 @@ export class Transaction { const hex = new HexBytes(signature); const approval = new Approval(publicKey, hex); - this.approvals.push(approval); - if (this.originTransactionV1) { this.originTransactionV1.approvals.push(approval); } else if (this.originDeployV1) { diff --git a/src/types/keypair/PrivateKey.ts b/src/types/keypair/PrivateKey.ts index e62359767..eae86d1fd 100644 --- a/src/types/keypair/PrivateKey.ts +++ b/src/types/keypair/PrivateKey.ts @@ -78,12 +78,21 @@ export class PrivateKey { return this.priv.toPem(); } + /** + * Signs a message using the private key. + * @param msg - The message to sign. + * @returns A promise resolving to the signature bytes. + */ + public async sign(msg: Uint8Array): Promise { + return await this.priv.sign(msg); + } + /** * Signs a message using the private key and includes the algorithm byte in the signature. * @param msg - The message to sign. * @returns A promise resolving to the signature bytes with the algorithm byte. */ - public async sign(msg: Uint8Array): Promise { + public async signAndAddAlgorithmBytes(msg: Uint8Array): Promise { const signature = await this.priv.sign(msg); const algBytes = Uint8Array.of(this.alg); return concat([algBytes, signature]);