MCPcopy Create free account
hub / github.com/ElementsProject/elements / estimaterawfee

Function estimaterawfee

src/rpc/mining.cpp:1168–1287  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

1166}
1167
1168static RPCHelpMan estimaterawfee()
1169{
1170 return RPCHelpMan{"estimaterawfee",
1171 "\nWARNING: This interface is unstable and may disappear or change!\n"
1172 "\nWARNING: This is an advanced API call that is tightly coupled to the specific\n"
1173 " implementation of fee estimation. The parameters it can be called with\n"
1174 " and the results it returns will change if the internal implementation changes.\n"
1175 "\nEstimates the approximate fee per kilobyte needed for a transaction to begin\n"
1176 "confirmation within conf_target blocks if possible. Uses virtual transaction size as\n"
1177 "defined in BIP 141 (witness data is discounted).\n",
1178 {
1179 {"conf_target", RPCArg::Type::NUM, RPCArg::Optional::NO, "Confirmation target in blocks (1 - 1008)"},
1180 {"threshold", RPCArg::Type::NUM, RPCArg::Default{0.95}, "The proportion of transactions in a given feerate range that must have been\n"
1181 " confirmed within conf_target in order to consider those feerates as high enough and proceed to check\n"
1182 " lower buckets."},
1183 },
1184 RPCResult{
1185 RPCResult::Type::OBJ, "", "Results are returned for any horizon which tracks blocks up to the confirmation target",
1186 {
1187 {RPCResult::Type::OBJ, "short", /*optional=*/true, "estimate for short time horizon",
1188 {
1189 {RPCResult::Type::NUM, "feerate", /*optional=*/true, "estimate fee rate in " + CURRENCY_UNIT + "/kvB"},
1190 {RPCResult::Type::NUM, "decay", "exponential decay (per block) for historical moving average of confirmation data"},
1191 {RPCResult::Type::NUM, "scale", "The resolution of confirmation targets at this time horizon"},
1192 {RPCResult::Type::OBJ, "pass", /*optional=*/true, "information about the lowest range of feerates to succeed in meeting the threshold",
1193 {
1194 {RPCResult::Type::NUM, "startrange", "start of feerate range"},
1195 {RPCResult::Type::NUM, "endrange", "end of feerate range"},
1196 {RPCResult::Type::NUM, "withintarget", "number of txs over history horizon in the feerate range that were confirmed within target"},
1197 {RPCResult::Type::NUM, "totalconfirmed", "number of txs over history horizon in the feerate range that were confirmed at any point"},
1198 {RPCResult::Type::NUM, "inmempool", "current number of txs in mempool in the feerate range unconfirmed for at least target blocks"},
1199 {RPCResult::Type::NUM, "leftmempool", "number of txs over history horizon in the feerate range that left mempool unconfirmed after target"},
1200 }},
1201 {RPCResult::Type::OBJ, "fail", /*optional=*/true, "information about the highest range of feerates to fail to meet the threshold",
1202 {
1203 {RPCResult::Type::ELISION, "", ""},
1204 }},
1205 {RPCResult::Type::ARR, "errors", /*optional=*/true, "Errors encountered during processing (if there are any)",
1206 {
1207 {RPCResult::Type::STR, "error", ""},
1208 }},
1209 }},
1210 {RPCResult::Type::OBJ, "medium", /*optional=*/true, "estimate for medium time horizon",
1211 {
1212 {RPCResult::Type::ELISION, "", ""},
1213 }},
1214 {RPCResult::Type::OBJ, "long", /*optional=*/true, "estimate for long time horizon",
1215 {
1216 {RPCResult::Type::ELISION, "", ""},
1217 }},
1218 }},
1219 RPCExamples{
1220 HelpExampleCli("estimaterawfee", "6 0.9")
1221 },
1222 [&](const RPCHelpMan& self, const JSONRPCRequest& request) -> UniValue
1223{
1224 RPCTypeCheck(request.params, {UniValue::VNUM, UniValue::VNUM}, true);
1225 RPCTypeCheckArgument(request.params[0], UniValue::VNUM);

Callers

nothing calls this directly

Calls 15

HelpExampleCliFunction · 0.85
RPCTypeCheckFunction · 0.85
RPCTypeCheckArgumentFunction · 0.85
ParseConfirmTargetFunction · 0.85
JSONRPCErrorFunction · 0.85
ValueFromAmountFunction · 0.85
HighestTargetTrackedMethod · 0.80
get_realMethod · 0.80
estimateRawFeeMethod · 0.80
GetFeePerKMethod · 0.80
CFeeRateClass · 0.50

Tested by

no test coverage detected