Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 7 additions & 1 deletion modules/sdk-core/src/bitgo/baseCoin/iBaseCoin.ts
Original file line number Diff line number Diff line change
Expand Up @@ -277,8 +277,14 @@ export interface ParseTransactionOptions {
[index: string]: unknown;
}

// TODO (SDKT-9): reverse engineer and add options
/**
* This is only used for determining the PayGo fee of a transaction which is only relevant for UTXO coins.
* Some coins return various other fields here, but they are only used internally by the respective coins.
*/
export interface ParsedTransaction {
// the callsite assumes that this is the PayGo amount
implicitExternalSpendAmount?: number | bigint;
// coins may add internal fields
[index: string]: unknown;
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -304,16 +304,16 @@ export class PendingApproval implements IPendingApproval {
prebuildParams = _.extend({}, prebuildParams, { reqId: reqId });
const signedTransaction = await this.wallet.prebuildAndSignTransaction(prebuildParams);
// compare PAYGo fees
const originalParsedTransaction = (await this.baseCoin.parseTransaction({
const originalParsedTransaction = await this.baseCoin.parseTransaction({
txParams: prebuildParams,
wallet: this.wallet,
txPrebuild: originalPrebuild,
})) as any;
const recreatedParsedTransaction = (await this.baseCoin.parseTransaction({
});
const recreatedParsedTransaction = await this.baseCoin.parseTransaction({
txParams: prebuildParams,
wallet: this.wallet,
txPrebuild: signedTransaction,
})) as any;
});

if (_.isUndefined(recreatedParsedTransaction.implicitExternalSpendAmount)) {
return signedTransaction;
Expand Down