diff --git a/server_extensions_extra/src/main/java/com/generalbytes/batm/server/extensions/extra/potcoin/wallets/potwallet/Potwallet.java b/server_extensions_extra/src/main/java/com/generalbytes/batm/server/extensions/extra/potcoin/wallets/potwallet/Potwallet.java index ad47524..b56b62e 100644 --- a/server_extensions_extra/src/main/java/com/generalbytes/batm/server/extensions/extra/potcoin/wallets/potwallet/Potwallet.java +++ b/server_extensions_extra/src/main/java/com/generalbytes/batm/server/extensions/extra/potcoin/wallets/potwallet/Potwallet.java @@ -39,6 +39,7 @@ public class Potwallet implements IWallet { this.publicKey = publicKey; this.privateKey = privateKey; this.walletId = walletId; + api = RestProxyFactory.createProxy(PotwalletAPI.class, "https://api.potwallet.com"); } @@ -106,7 +107,7 @@ public class Potwallet implements IWallet { } try{ accessHash = generateHash(privateKey, "https://api.potwallet.com/v1/send", nonce); - PotwalletResponse response = api.sendPots(publicKey, accessHash, nonce, destinationAddress, amount.stripTrailingZeros()); + PotwalletResponse response = api.sendPots(publicKey, accessHash, nonce, new PotwalletSendRequest(destinationAddress, amount.stripTrailingZeros())); if (response != null && response.getMessage() != null && response.getSuccess()) { return new String(response.getMessage()); } diff --git a/server_extensions_extra/src/main/java/com/generalbytes/batm/server/extensions/extra/potcoin/wallets/potwallet/PotwalletAPI.java b/server_extensions_extra/src/main/java/com/generalbytes/batm/server/extensions/extra/potcoin/wallets/potwallet/PotwalletAPI.java index 871b285..37029ac 100644 --- a/server_extensions_extra/src/main/java/com/generalbytes/batm/server/extensions/extra/potcoin/wallets/potwallet/PotwalletAPI.java +++ b/server_extensions_extra/src/main/java/com/generalbytes/batm/server/extensions/extra/potcoin/wallets/potwallet/PotwalletAPI.java @@ -17,5 +17,5 @@ public interface PotwalletAPI { @POST @Path("/send") @Consumes(MediaType.APPLICATION_JSON) - PotwalletResponse sendPots(@HeaderParam("Access-Public") String publicKey, @HeaderParam("Access-Hash") String accessHash, @HeaderParam("Access-Nonce") String nonce, @PathParam("address") String address, @PathParam("amount") BigDecimal amount) throws IOException; + PotwalletResponse sendPots(@HeaderParam("Access-Public") String publicKey, @HeaderParam("Access-Hash") String accessHash, @HeaderParam("Access-Nonce") String nonce, PotwalletSendRequest request) throws IOException; } diff --git a/server_extensions_extra/src/main/java/com/generalbytes/batm/server/extensions/extra/potcoin/wallets/potwallet/PotwalletSendRequest.java b/server_extensions_extra/src/main/java/com/generalbytes/batm/server/extensions/extra/potcoin/wallets/potwallet/PotwalletSendRequest.java new file mode 100644 index 0000000..ac51fd8 --- /dev/null +++ b/server_extensions_extra/src/main/java/com/generalbytes/batm/server/extensions/extra/potcoin/wallets/potwallet/PotwalletSendRequest.java @@ -0,0 +1,18 @@ +package com.generalbytes.batm.server.extensions.extra.potcoin.wallets.potwallet; + +import com.fasterxml.jackson.annotation.JsonProperty; + +import java.math.BigDecimal; + +public class PotwalletSendRequest { + @JsonProperty("address") + String address; + + @JsonProperty("amount") + BigDecimal amount; + + public PotwalletSendRequest(String address, BigDecimal amount) { + this.address = address; + this.amount = amount; + } +}