Skip to content

Commit

Permalink
add comments
Browse files Browse the repository at this point in the history
  • Loading branch information
ashisherc committed Dec 16, 2024
1 parent 665bb89 commit 6cb3c0a
Showing 1 changed file with 12 additions and 0 deletions.
12 changes: 12 additions & 0 deletions src/transaction/Transaction.ts
Original file line number Diff line number Diff line change
Expand Up @@ -194,6 +194,12 @@ export class Transaction {
}
}

/**
* The method will add a certificate to the transaction to be included in cbor
* This method will automatically scan and include each unique required witnesses in the map
* to help sign the transaction
* @param certificate a certificate to include in the transaction
*/
addCertificate(certificate: Certificate): void {
switch (certificate.type) {
case CertificateType.STAKE_DELEGATION: {
Expand Down Expand Up @@ -774,6 +780,12 @@ export class Transaction {
};
}

/**
* This method scans the certificates added in the transaction to calculate
* additional ADA required for transaction validity. Essentially ADA to be used
* in the deposit for stake key registration etc.
* @returns additional ADA required for a valid transaction
*/
getAdditionalOutputAda(): BigNumber {
return _.reduce(
this.certificates,
Expand Down

0 comments on commit 6cb3c0a

Please sign in to comment.