Commit 4c6c1063 authored by zeroleak's avatar zeroleak
Browse files

cleanup

parent 7563fcc2
......@@ -117,25 +117,6 @@ Response:
}
```
### Configure utxo: ```POST /rest/utxos/{hash}:{index}```
Parameters:
* hash, index: utxo to configure
Payload:
* poolId: id of pool to join
```
{
poolId: "0.01btc"
}
```
Response:
```
{
(utxo detail)
}
```
### Tx0 preview ```POST /rest/tx0/preview```
Payload:
* inputs {hash, index} (mandatory): utxos to spend for tx0
......
......@@ -17,7 +17,7 @@
<dependency>
<groupId>io.samourai.code.whirlpool</groupId>
<artifactId>whirlpool-client</artifactId>
<version>0.23.25</version>
<version>develop-SNAPSHOT</version>
<scope>compile</scope>
</dependency>
<dependency>
......
......@@ -2,7 +2,6 @@ package com.samourai.whirlpool.cli.api.controllers.utxo;
import com.samourai.whirlpool.cli.api.controllers.AbstractRestController;
import com.samourai.whirlpool.cli.api.protocol.CliApiEndpoint;
import com.samourai.whirlpool.cli.api.protocol.beans.ApiUtxo;
import com.samourai.whirlpool.cli.api.protocol.beans.ApiUtxoRef;
import com.samourai.whirlpool.cli.api.protocol.rest.*;
import com.samourai.whirlpool.cli.services.CliWalletService;
......@@ -47,26 +46,6 @@ public class UtxoController extends AbstractRestController {
return whirlpoolUtos;
}
@RequestMapping(value = CliApiEndpoint.REST_UTXO_CONFIGURE, method = RequestMethod.POST)
public ApiUtxo configureUtxo(
@RequestHeader HttpHeaders headers,
@PathVariable("hash") String utxoHash,
@PathVariable("index") int utxoIndex,
@Valid @RequestBody ApiUtxoConfigureRequest payload)
throws Exception {
checkHeaders(headers);
// find utxo
WhirlpoolUtxo whirlpoolUtxo = findUtxo(utxoHash, utxoIndex);
WhirlpoolWallet whirlpoolWallet = cliWalletService.getSessionWallet();
// configure pool
whirlpoolWallet.setPool(whirlpoolUtxo, payload.poolId);
ApiUtxo apiUtxo = new ApiUtxo(whirlpoolUtxo);
return apiUtxo;
}
@RequestMapping(value = CliApiEndpoint.REST_TX0_PREVIEW, method = RequestMethod.POST)
public ApiTx0PreviewResponse tx0Preview(
@RequestHeader HttpHeaders headers, @Valid @RequestBody ApiTx0PreviewRequest payload)
......
......@@ -20,7 +20,6 @@ public class CliApiEndpoint {
public static final String REST_MIX_STOP = REST_PREFIX + "mix/stop";
public static final String REST_UTXOS = REST_PREFIX + "utxos";
public static final String REST_UTXO_CONFIGURE = REST_PREFIX + "utxos/{hash}:{index}";
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";
public static final String REST_TX0 = REST_PREFIX + "tx0";
......@@ -41,7 +40,6 @@ public class CliApiEndpoint {
REST_MIX_START,
REST_MIX_STOP,
REST_UTXOS,
REST_UTXO_CONFIGURE,
REST_UTXO_STARTMIX,
REST_UTXO_STOPMIX,
REST_TX0_PREVIEW,
......
......@@ -6,6 +6,8 @@ public class ApiTx0PreviewResponse {
private long tx0MinerFee;
private long mixMinerFee;
private long premixMinerFee;
private int tx0MinerFeePrice;
private int mixMinerFeePrice;
private long feeValue;
private long feeChange;
private long premixValue;
......@@ -17,6 +19,8 @@ public class ApiTx0PreviewResponse {
this.tx0MinerFee = tx0Preview.getTx0MinerFee();
this.mixMinerFee = tx0Preview.getMixMinerFee();
this.premixMinerFee = tx0Preview.getPremixMinerFee();
this.tx0MinerFeePrice = tx0Preview.getTx0MinerFeePrice();
this.mixMinerFeePrice = tx0Preview.getMixMinerFeePrice();
this.feeValue = tx0Preview.getFeeValue();
this.feeChange = tx0Preview.getFeeChange();
this.premixValue = tx0Preview.getPremixValue();
......@@ -37,6 +41,14 @@ public class ApiTx0PreviewResponse {
return premixMinerFee;
}
public int getTx0MinerFeePrice() {
return tx0MinerFeePrice;
}
public int getMixMinerFeePrice() {
return mixMinerFeePrice;
}
public long getFeeValue() {
return feeValue;
}
......
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