Update local cpfp API to accept array of transactions
This commit is contained in:
@@ -154,17 +154,17 @@ export class TransactionRawComponent implements OnInit, OnDestroy {
|
||||
if (this.hasPrevouts && this.fetchCpfp) {
|
||||
try {
|
||||
this.isLoadingCpfpInfo = true;
|
||||
const cpfpInfo: CpfpInfo = await firstValueFrom(this.apiService.getCpfpLocalTx$({
|
||||
const cpfpInfo: CpfpInfo[] = await firstValueFrom(this.apiService.getCpfpLocalTx$([{
|
||||
txid: transaction.txid,
|
||||
weight: transaction.weight,
|
||||
sigops: transaction.sigops,
|
||||
fee: transaction.fee,
|
||||
vin: transaction.vin,
|
||||
vout: transaction.vout
|
||||
}));
|
||||
}]));
|
||||
|
||||
if (cpfpInfo && cpfpInfo.ancestors.length > 0) {
|
||||
const { ancestors, effectiveFeePerVsize } = cpfpInfo;
|
||||
if (cpfpInfo?.[0]?.ancestors?.length) {
|
||||
const { ancestors, effectiveFeePerVsize } = cpfpInfo[0];
|
||||
transaction.effectiveFeePerVsize = effectiveFeePerVsize;
|
||||
this.cpfpInfo = { ancestors, effectiveFeePerVsize };
|
||||
this.hasCpfp = true;
|
||||
|
||||
@@ -569,8 +569,8 @@ export class ApiService {
|
||||
return this.httpClient.post(this.apiBaseUrl + this.apiBasePath + '/api/v1/prevouts', outpoints);
|
||||
}
|
||||
|
||||
getCpfpLocalTx$(tx: any): Observable<CpfpInfo> {
|
||||
return this.httpClient.post<CpfpInfo>(this.apiBaseUrl + this.apiBasePath + '/api/v1/cpfp', tx);
|
||||
getCpfpLocalTx$(tx: any[]): Observable<CpfpInfo[]> {
|
||||
return this.httpClient.post<CpfpInfo[]>(this.apiBaseUrl + this.apiBasePath + '/api/v1/cpfp', tx);
|
||||
}
|
||||
|
||||
// Cache methods
|
||||
|
||||
Reference in New Issue
Block a user