minor updates

This commit is contained in:
Dominik Golonka 2017-01-23 21:43:02 +01:00
parent 4860de01e3
commit 7428cbf4a3
13 changed files with 59 additions and 22 deletions

View File

@ -0,0 +1,12 @@
<?xml version="1.0" encoding="UTF-8"?>
<module type="JAVA_MODULE" version="4">
<component name="NewModuleRootManager" inherit-compiler-output="true">
<exclude-output />
<content url="file://$MODULE_DIR$">
<sourceFolder url="file://$MODULE_DIR$/java" isTestSource="false" />
</content>
<orderEntry type="inheritedJdk" />
<orderEntry type="sourceFolder" forTests="false" />
<orderEntry type="library" name="libs" level="project" />
</component>
</module>

View File

@ -27,7 +27,7 @@ import com.generalbytes.batm.server.extensions.IPaymentProcessor;
import com.generalbytes.batm.server.extensions.IRateSource; import com.generalbytes.batm.server.extensions.IRateSource;
import com.generalbytes.batm.server.extensions.IWallet; import com.generalbytes.batm.server.extensions.IWallet;
import com.generalbytes.batm.server.extensions.extra.tokencoin.sources.FixPriceRateSource; import com.generalbytes.batm.server.extensions.extra.tokencoin.sources.FixPriceRateSource;
import com.generalbytes.batm.server.extensions.extra.tokencoin.wallets.tokencoid.TokenWallet; import com.generalbytes.batm.server.extensions.extra.tokencoin.wallets.tokencoind.TokenWallet;
import com.generalbytes.batm.server.extensions.watchlist.IWatchList; import com.generalbytes.batm.server.extensions.watchlist.IWatchList;
import java.math.BigDecimal; import java.math.BigDecimal;
@ -48,7 +48,7 @@ public class TKNExtension implements IExtension{
StringTokenizer st = new StringTokenizer(walletLogin,":"); StringTokenizer st = new StringTokenizer(walletLogin,":");
String walletType = st.nextToken(); String walletType = st.nextToken();
if ("tokencoid".equalsIgnoreCase(walletType)) { if ("tokencoind".equalsIgnoreCase(walletType)) {
//"nud:protocol:user:password:ip:port:accountname" //"nud:protocol:user:password:ip:port:accountname"
String host = st.nextToken(); String host = st.nextToken();
@ -84,7 +84,7 @@ public class TKNExtension implements IExtension{
StringTokenizer st = new StringTokenizer(sourceLogin,":"); StringTokenizer st = new StringTokenizer(sourceLogin,":");
String rsType = st.nextToken(); String rsType = st.nextToken();
if ("tknfix".equalsIgnoreCase(rsType)) { if ("tknfix".equalsIgnoreCase(rsType)) { // fixed price
BigDecimal rate = BigDecimal.ZERO; BigDecimal rate = BigDecimal.ZERO;
if (st.hasMoreTokens()) { if (st.hasMoreTokens()) {
try { try {
@ -92,7 +92,7 @@ public class TKNExtension implements IExtension{
} catch (Throwable e) { } catch (Throwable e) {
} }
} }
String preferedFiatCurrency = ICurrencies.USD; String preferedFiatCurrency = ICurrencies.EUR;
if (st.hasMoreTokens()) { if (st.hasMoreTokens()) {
preferedFiatCurrency = st.nextToken(); preferedFiatCurrency = st.nextToken();
} }

View File

@ -28,7 +28,7 @@ import java.util.Set;
public class FixPriceRateSource implements IRateSource { public class FixPriceRateSource implements IRateSource {
private BigDecimal rate = BigDecimal.ZERO; private BigDecimal rate = BigDecimal.ZERO;
private String preferedFiatCurrency = ICurrencies.USD; private String preferedFiatCurrency = ICurrencies.EUR;
public FixPriceRateSource(BigDecimal rate, String preferedFiatCurrency) { public FixPriceRateSource(BigDecimal rate, String preferedFiatCurrency) {
this.rate = rate; this.rate = rate;

View File

@ -16,18 +16,16 @@
* *
************************************************************************************/ ************************************************************************************/
package com.generalbytes.batm.server.extensions.extra.tokencoin.wallets.tokencoid; package com.generalbytes.batm.server.extensions.extra.tokencoin.wallets.tokencoind;
import com.generalbytes.batm.server.extensions.ICurrencies; import com.generalbytes.batm.server.extensions.ICurrencies;
import com.generalbytes.batm.server.extensions.IWallet; import com.generalbytes.batm.server.extensions.IWallet;
import com.generalbytes.batm.server.extensions.extra.tokencoin.TKNAddressValidator; import com.generalbytes.batm.server.extensions.extra.tokencoin.wallets.tokencoind.dto.*;
import com.generalbytes.batm.server.extensions.extra.tokencoin.wallets.tokencoid.dto.*;
import org.slf4j.Logger; import org.slf4j.Logger;
import org.slf4j.LoggerFactory; import org.slf4j.LoggerFactory;
import si.mazi.rescu.RestProxyFactory; import si.mazi.rescu.RestProxyFactory;
import java.math.BigDecimal; import java.math.BigDecimal;
import java.math.BigInteger;
import java.util.HashSet; import java.util.HashSet;
import java.util.Set; import java.util.Set;

View File

@ -16,12 +16,12 @@
* *
************************************************************************************/ ************************************************************************************/
package com.generalbytes.batm.server.extensions.extra.tokencoin.wallets.tokencoid; package com.generalbytes.batm.server.extensions.extra.tokencoin.wallets.tokencoind;
import com.generalbytes.batm.server.extensions.extra.tokencoin.wallets.tokencoid.dto.AccountResponse; import com.generalbytes.batm.server.extensions.extra.tokencoin.wallets.tokencoind.dto.AccountResponse;
import com.generalbytes.batm.server.extensions.extra.tokencoin.wallets.tokencoid.dto.TokenAccountsResponse; import com.generalbytes.batm.server.extensions.extra.tokencoin.wallets.tokencoind.dto.TokenAccountsResponse;
import com.generalbytes.batm.server.extensions.extra.tokencoin.wallets.tokencoid.dto.TokenSendResponse; import com.generalbytes.batm.server.extensions.extra.tokencoin.wallets.tokencoind.dto.TokenSendResponse;
import com.generalbytes.batm.server.extensions.extra.tokencoin.wallets.tokencoid.dto.SendResponse; import com.generalbytes.batm.server.extensions.extra.tokencoin.wallets.tokencoind.dto.SendResponse;
import javax.ws.rs.*; import javax.ws.rs.*;
import javax.ws.rs.core.MediaType; import javax.ws.rs.core.MediaType;
@ -43,6 +43,6 @@ public interface TokenWalletAPI {
public TokenSendResponse send(@FormParam("email") String email, @FormParam("password") String password, @FormParam("masterPassword") String masterPassword, @FormParam("accountId") String accountId, @FormParam("recipient") String recipient, @QueryParam("amount") BigDecimal amountNQT, @FormParam("message") String message); public TokenSendResponse send(@FormParam("email") String email, @FormParam("password") String password, @FormParam("masterPassword") String masterPassword, @FormParam("accountId") String accountId, @FormParam("recipient") String recipient, @QueryParam("amount") BigDecimal amountNQT, @FormParam("message") String message);
@POST @POST
@Path("/{id}/{recipient}/{amount}/{message}/send") @Path("/Accounts/{id}/{recipient}/{amount}/{message}/send")
public SendResponse send2( @PathParam("accountId") String accountId, @PathParam("recipient") String recipient, @PathParam("amount") BigDecimal amountNQT, @PathParam("message") String requestType); public SendResponse send2( @PathParam("id") String accountId, @PathParam("recipient") String recipient, @PathParam("amount") BigDecimal amountNQT, @PathParam("message") String requestType);
} }

View File

@ -16,7 +16,7 @@
* *
************************************************************************************/ ************************************************************************************/
package com.generalbytes.batm.server.extensions.extra.tokencoin.wallets.tokencoid.dto; package com.generalbytes.batm.server.extensions.extra.tokencoin.wallets.tokencoind.dto;
public class Account { public class Account {
private String id_account; private String id_account;

View File

@ -15,7 +15,7 @@
* Web : http://www.generalbytes.com * Web : http://www.generalbytes.com
* *
************************************************************************************/ ************************************************************************************/
package com.generalbytes.batm.server.extensions.extra.tokencoin.wallets.tokencoid.dto; package com.generalbytes.batm.server.extensions.extra.tokencoin.wallets.tokencoind.dto;
import java.math.BigDecimal; import java.math.BigDecimal;

View File

@ -16,7 +16,7 @@
* *
************************************************************************************/ ************************************************************************************/
package com.generalbytes.batm.server.extensions.extra.tokencoin.wallets.tokencoid.dto; package com.generalbytes.batm.server.extensions.extra.tokencoin.wallets.tokencoind.dto;
public class SendResponse { public class SendResponse {
private String transaction; private String transaction;

View File

@ -16,7 +16,7 @@
* *
************************************************************************************/ ************************************************************************************/
package com.generalbytes.batm.server.extensions.extra.tokencoin.wallets.tokencoid.dto; package com.generalbytes.batm.server.extensions.extra.tokencoin.wallets.tokencoind.dto;
public class TokenAccountsResponse extends TokenResponse { public class TokenAccountsResponse extends TokenResponse {
private Data data; private Data data;

View File

@ -16,7 +16,7 @@
* *
************************************************************************************/ ************************************************************************************/
package com.generalbytes.batm.server.extensions.extra.tokencoin.wallets.tokencoid.dto; package com.generalbytes.batm.server.extensions.extra.tokencoin.wallets.tokencoind.dto;
public abstract class TokenResponse { public abstract class TokenResponse {
private String status; private String status;

View File

@ -16,7 +16,7 @@
* *
************************************************************************************/ ************************************************************************************/
package com.generalbytes.batm.server.extensions.extra.tokencoin.wallets.tokencoid.dto; package com.generalbytes.batm.server.extensions.extra.tokencoin.wallets.tokencoind.dto;
public class TokenSendResponse extends TokenResponse { public class TokenSendResponse extends TokenResponse {
private Data data; private Data data;

View File

@ -0,0 +1,14 @@
<?xml version="1.0" encoding="UTF-8"?>
<module type="JAVA_MODULE" version="4">
<component name="NewModuleRootManager" inherit-compiler-output="true">
<exclude-output />
<content url="file://$MODULE_DIR$">
<sourceFolder url="file://$MODULE_DIR$/java" isTestSource="false" />
</content>
<orderEntry type="inheritedJdk" />
<orderEntry type="sourceFolder" forTests="false" />
<orderEntry type="library" name="libs" level="project" />
<orderEntry type="library" name="libs1" level="project" />
<orderEntry type="module" module-name="main" />
</component>
</module>

View File

@ -0,0 +1,13 @@
<?xml version="1.0" encoding="UTF-8"?>
<module type="JAVA_MODULE" version="4">
<component name="NewModuleRootManager" inherit-compiler-output="true">
<exclude-output />
<content url="file://$MODULE_DIR$">
<sourceFolder url="file://$MODULE_DIR$/java" isTestSource="false" />
</content>
<orderEntry type="inheritedJdk" />
<orderEntry type="sourceFolder" forTests="false" />
<orderEntry type="library" name="jopt-simple-4.9" level="project" />
<orderEntry type="module" module-name="main" />
</component>
</module>