MCPcopy Create free account
hub / github.com/NoteProtocol/NoteWallet / getFeePerKb

Method getFeePerKb

src/btc/btc-wallet.ts:543–571  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

541 }
542
543 async getFeePerKb() {
544 const {
545 bitcoin: {fees},
546 } = mempoolJS({
547 hostname:
548 this.config.network === "testnet"
549 ? "mempool.space/testnet4"
550 : "mempool.space",
551 });
552
553 const feesRecommended = await fees.getFeesRecommended();
554 return {
555 slowFee:
556 Math.min(
557 //@ts-ignore
558 feesRecommended.economyFee,
559 feesRecommended.hourFee,
560 feesRecommended.halfHourFee
561 ) * 1000,
562 avgFee:
563 Math.max(feesRecommended.hourFee, feesRecommended.halfHourFee) * 1000,
564 fastFee:
565 Math.max(
566 feesRecommended.hourFee,
567 feesRecommended.halfHourFee,
568 feesRecommended.fastestFee
569 ) * 1000,
570 };
571 }
572}

Callers 5

sendEstimateMethod · 0.95
sendMethod · 0.95
mintP2TRNoteMethod · 0.95
mintP2TRNoteV1Method · 0.95

Calls

no outgoing calls

Tested by

no test coverage detected