Skip to content

Commit dd7f082

Browse files
Merge pull request #8577 from BitGo/WCI-35-36
docs(express): CalculateMinerFeeV1 and V2
2 parents fb05d42 + 5d4245f commit dd7f082

2 files changed

Lines changed: 12 additions & 24 deletions

File tree

modules/express/src/typedRoutes/api/v1/calculateMinerFeeInfo.ts

Lines changed: 10 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -3,37 +3,34 @@ import { httpRoute, httpRequest, optional } from '@api-ts/io-ts-http';
33
import { BitgoExpressError } from '../../schemas/error';
44

55
export const CalculateMinerFeeInfoRequestBody = {
6-
/** fee rate in satoshis per kilobyte, if not provided a fallback fee rate will be used */
6+
/** Custom minimum fee rate in a coin's base unit per kilobyte (or virtual kilobyte)--for example, satoshis per kvByte or microAlgos per kByte. If the applied `feeRate` does not meet a coin's required minimum transaction fee amount, the minimum is still applied (for example, 1000 sat/kvByte or a flat 1000 microAlgos) */
77
feeRate: optional(t.number),
8-
/** number of P2SH (multisig) inputs in the transaction */
8+
/** Number of P2SH (multi-signature) inputs */
99
nP2shInputs: t.number,
10-
/** number of P2PKH (single sig) inputs in the transaction */
10+
/** Number of P2PKH (single-signature) inputs */
1111
nP2pkhInputs: t.number,
12-
/** number of P2SH-P2WSH (segwit) inputs in the transaction */
12+
/** Number of P2SH_P2WSH (wrapped segwit multi-signature) inputs */
1313
nP2shP2wshInputs: t.number,
14-
/** number of outputs in the transaction */
14+
/** Number of outputs */
1515
nOutputs: t.number,
1616
/** whether the transaction contains uncompressed public keys (affects size calculation) */
1717
containsUncompressedPublicKeys: optional(t.boolean),
1818
};
1919

2020
export const CalculateMinerFeeInfoResponse = t.type({
21-
/** estimated size of the transaction in bytes */
21+
/** Estimated size of the transaction in bytes */
2222
size: t.number,
23-
/** estimated fee in satoshis for the transaction */
23+
/** Estimated fee in base units for the transaction */
2424
fee: t.number,
25-
/** fee rate that was used to estimate the fee (in satoshis per kilobyte) */
25+
/** The fee rate in base units per kB used to estimate the fee for the transaction */
2626
feeRate: t.number,
2727
});
2828

2929
/**
30-
* Calculate miner fee info (v1)
31-
*
32-
* Calculates the estimated size and fee for a transaction based on the number and types of inputs and outputs.
33-
* This is useful for estimating the fee before creating a transaction.
30+
* Calculate the fee and estimated size in bytes for a Bitcoin transaction
3431
*
3532
* @operationId express.v1.calculateminerfeeinfo
36-
* @tag express
33+
* @tag Express
3734
*/
3835
export const PostV1CalculateMinerFeeInfo = httpRoute({
3936
path: '/api/v1/calculateminerfeeinfo',

modules/express/src/typedRoutes/api/v2/calculateMinerFeeInfo.ts

Lines changed: 2 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -3,19 +3,10 @@ import { BitgoExpressError } from '../../schemas/error';
33
import { CalculateMinerFeeInfoRequestBody, CalculateMinerFeeInfoResponse } from '../v1/calculateMinerFeeInfo';
44

55
/**
6-
* Calculate miner fee info
7-
*
8-
* Calculates the estimated size and fee for a transaction based on the number and types of inputs and outputs.
9-
* This is useful for estimating the fee before creating a transaction.
10-
*
11-
* The calculation takes into account:
12-
* 1. The number and types of inputs (P2SH, P2PKH, P2SH-P2WSH)
13-
* 2. The number of outputs
14-
* 3. Whether the transaction contains uncompressed public keys
15-
* 4. The fee rate (in satoshis per kilobyte)
6+
* Calculate the fee and estimated size in bytes for a Bitcoin transaction
167
*
178
* @operationId express.calculateminerfeeinfo
18-
* @tag express
9+
* @tag Express
1910
*/
2011
export const PostV2CalculateMinerFeeInfo = httpRoute({
2112
path: '/api/v2/calculateminerfeeinfo',

0 commit comments

Comments
 (0)