Skip to content

Commit

Permalink
Merge pull request #5402 from BitGo/coin-2847-transaction-get-fee
Browse files Browse the repository at this point in the history
fix(sdk-coin-apt): make transaction getFee() method public
  • Loading branch information
bhavidhingra authored Jan 21, 2025
2 parents 19476e3 + 15433ba commit 225c0de
Show file tree
Hide file tree
Showing 3 changed files with 3 additions and 1 deletion.
1 change: 1 addition & 0 deletions modules/sdk-coin-apt/src/lib/iface.ts
Original file line number Diff line number Diff line change
Expand Up @@ -19,5 +19,6 @@ export interface TransferTxData {
sequenceNumber: number;
maxGasAmount: number;
gasUnitPrice: number;
gasUsed: number;
expirationTime: number;
}
2 changes: 1 addition & 1 deletion modules/sdk-coin-apt/src/lib/transaction/transaction.ts
Original file line number Diff line number Diff line change
Expand Up @@ -243,7 +243,7 @@ export abstract class Transaction extends BaseTransaction {
this._rawTransaction = simpleTxn.rawTransaction;
}

protected getFee(): string {
public getFee(): string {
return new BigNumber(this.gasUsed).multipliedBy(this.gasUnitPrice).toString();
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -50,6 +50,7 @@ export class TransferTransaction extends Transaction {
sequenceNumber: this.sequenceNumber,
maxGasAmount: this.maxGasAmount,
gasUnitPrice: this.gasUnitPrice,
gasUsed: this.gasUsed,
expirationTime: this.expirationTime,
};
}
Expand Down

0 comments on commit 225c0de

Please sign in to comment.