Commit 92bc55a2 authored by zeroleak's avatar zeroleak
Browse files

API: add tx0 for multiple utxos

parent a736567e
......@@ -89,6 +89,21 @@ public class UtxoController extends AbstractRestController {
return new ApiTx0PreviewResponse(tx0Preview);
}
@Deprecated // TODO remove on next release
@RequestMapping(value = CliApiEndpoint.REST_UTXO_TX0_SINGLE_PREVIEW, method = RequestMethod.POST)
public ApiTx0PreviewResponse tx0PreviewSingle(
@RequestHeader HttpHeaders headers,
@PathVariable("hash") String utxoHash,
@PathVariable("index") int utxoIndex,
@Valid @RequestBody ApiTx0PreviewRequest payload)
throws Exception {
checkHeaders(headers);
// forward to new API
payload.inputs = new ApiUtxoRef[] {new ApiUtxoRef(utxoHash, utxoIndex)};
return tx0Preview(headers, payload);
}
@RequestMapping(value = CliApiEndpoint.REST_UTXO_TX0, method = RequestMethod.POST)
public ApiTx0Response tx0(
@RequestHeader HttpHeaders headers, @Valid @RequestBody ApiTx0Request payload)
......@@ -110,6 +125,21 @@ public class UtxoController extends AbstractRestController {
return new ApiTx0Response(tx0);
}
@Deprecated // TODO remove on next release
@RequestMapping(value = CliApiEndpoint.REST_UTXO_TX0_SINGLE, method = RequestMethod.POST)
public ApiTx0Response tx0Single(
@RequestHeader HttpHeaders headers,
@PathVariable("hash") String utxoHash,
@PathVariable("index") int utxoIndex,
@Valid @RequestBody ApiTx0Request payload)
throws Exception {
checkHeaders(headers);
// forward to new API
payload.inputs = new ApiUtxoRef[] {new ApiUtxoRef(utxoHash, utxoIndex)};
return tx0(headers, payload);
}
@RequestMapping(value = CliApiEndpoint.REST_UTXO_STARTMIX, method = RequestMethod.POST)
public void startMix(
@RequestHeader HttpHeaders headers,
......
......@@ -23,6 +23,9 @@ public class CliApiEndpoint {
public static final String REST_UTXO_CONFIGURE = REST_PREFIX + "utxos/{hash}:{index}";
public static final String REST_UTXO_TX0 = REST_PREFIX + "tx0";
public static final String REST_UTXO_TX0_PREVIEW = REST_PREFIX + "tx0/preview";
public static final String REST_UTXO_TX0_SINGLE = REST_PREFIX + "utxos/{hash}:{index}/tx0";
public static final String REST_UTXO_TX0_SINGLE_PREVIEW =
REST_PREFIX + "utxos/{hash}:{index}/tx0Preview";
public static final String REST_UTXO_STARTMIX = REST_PREFIX + "utxos/{hash}:{index}/startMix";
public static final String REST_UTXO_STOPMIX = REST_PREFIX + "utxos/{hash}:{index}/stopMix";
......@@ -44,6 +47,8 @@ public class CliApiEndpoint {
REST_UTXO_CONFIGURE,
REST_UTXO_TX0_PREVIEW,
REST_UTXO_TX0,
REST_UTXO_TX0_SINGLE_PREVIEW,
REST_UTXO_TX0_SINGLE,
REST_UTXO_STARTMIX,
REST_UTXO_STOPMIX
};
......
......@@ -5,7 +5,7 @@ import com.samourai.whirlpool.client.wallet.beans.Tx0FeeTarget;
import javax.validation.constraints.NotNull;
public class ApiTx0PreviewRequest {
@NotNull public ApiUtxoRef[] inputs;
/*@NotNull TODO next release*/ public ApiUtxoRef[] inputs;
@NotNull public Tx0FeeTarget feeTarget;
@NotNull public String poolId;
......
......@@ -59,9 +59,9 @@ public class RunSetExternalXpub {
log.info("⣿ WARNING!");
log.info(CliUtils.LOG_SEPARATOR);
log.info(
"⣿ Your funds will be automatically sent to external XPub after being mixed *at least* "
"⣿ Your funds will be automatically sent to external XPub after *at least* "
+ mixs
+ " times. This number may randomly slightly increase to improve your privacy.");
+ " (re)mixs. This threshold may randomly slightly increase to improve your privacy.");
log.info("⣿ XPub: " + xpub);
log.info("⣿ Derivation path: m/84'/" + chain + "'/" + startIndex + "+'");
log.info("⣿ Sample destination addresses:");
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment