@Override public void applySpecification(final ExchangeSpecification specification) { if (specification.getPassword() == null) { throw new IllegalStateException("password must be set to enable the wallet's RPC interface"); } super.applySpecification(specification); }
public CampBXResponse cancelCampBXOrder(String orderId) throws IOException { ParsedId parsedId = parseOrderId(orderId); CampBXResponse campBXResponse = campBX.tradeCancel( exchange.getExchangeSpecification().getUserName(), exchange.getExchangeSpecification().getPassword(), parsedId.type, Long.parseLong(parsedId.id)); return campBXResponse; }
public CampBXResponse requestCampBXBitcoinDepositAddress() throws IOException { CampBXResponse campBXResponse = campBX.getDepositAddress( exchange.getExchangeSpecification().getUserName(), exchange.getExchangeSpecification().getPassword()); return campBXResponse; } }
public MyFunds getCampBXAccountInfo() throws IOException { MyFunds myFunds = campBX.getMyFunds( exchange.getExchangeSpecification().getUserName(), exchange.getExchangeSpecification().getPassword()); return myFunds; }
public MyOpenOrders getCampBXOpenOrders() throws IOException { MyOpenOrders myOpenOrders = campBX.getOpenOrders( exchange.getExchangeSpecification().getUserName(), exchange.getExchangeSpecification().getPassword()); return myOpenOrders; }
protected CoinfloorAuthenticatedService(Exchange exchange) { super(exchange); ExchangeSpecification specification = exchange.getExchangeSpecification(); if (specification.getUserName() == null || specification.getPassword() == null) { logger.info( "Authenticated endpoints are not available - username and password have not been configured"); coinfloor = null; return; } ClientConfig config = getClientConfig(); ClientConfigUtil.addBasicAuthCredentials( config, specification.getUserName(), specification.getPassword()); coinfloor = RestProxyFactory.createProxy( CoinfloorAuthenticated.class, exchange.getExchangeSpecification().getSslUri(), config); } }
public CampBXResponse withdrawCampBXFunds(BigDecimal amount, String address) throws IOException { CampBXResponse campBXResponse = campBX.withdrawBtc( exchange.getExchangeSpecification().getUserName(), exchange.getExchangeSpecification().getPassword(), address, amount); return campBXResponse; }
/** * Corresponds to <code>POST withdrawals/crypto</code> * * @param withdrawRequest * @return * @throws IOException */ public AbucoinsCryptoWithdrawal abucoinsWithdrawalsMake( AbucoinsCryptoWithdrawalRequest withdrawRequest) throws IOException { return abucoinsAuthenticated.withdrawalsMake( withdrawRequest, exchange.getExchangeSpecification().getApiKey(), signatureCreator, exchange.getExchangeSpecification().getPassword(), timestamp()); }
/** * Corresponds to <code>POST deposits/make</code> * * @param cryptoRequest * @return * @throws IOException */ public AbucoinsCryptoDeposit abucoinsDepositMake(AbucoinsCryptoDepositRequest cryptoRequest) throws IOException { return abucoinsAuthenticated.depositsMake( cryptoRequest, exchange.getExchangeSpecification().getApiKey(), signatureCreator, exchange.getExchangeSpecification().getPassword(), timestamp()); }
protected BitcoinCoreAccountServiceRaw(Exchange exchange) { super(exchange); ExchangeSpecification specification = exchange.getExchangeSpecification(); ClientConfig config = getClientConfig(); String user = specification.getUserName(); ClientConfigUtil.addBasicAuthCredentials( config, user == null ? "" : user, specification.getPassword()); bitcoinCore = RestProxyFactory.createProxy(BitcoinCore.class, specification.getPlainTextUri(), config); }
/** * Corresponds to <code>DELETE orders/{order-id}</delete> * * @return * @throws IOException */ public String deleteAbucoinsOrder(String orderID) throws IOException { String resp = abucoinsAuthenticated.deleteOrder( orderID, exchange.getExchangeSpecification().getApiKey(), signatureCreator, exchange.getExchangeSpecification().getPassword(), timestamp()); String[] ids = AbucoinsAdapters.adaptToSetOfIDs(resp); return ids[0]; }
public CampBXResponse placeCampBXMarketOrder(MarketOrder marketOrder) throws IOException { CampBX.AdvTradeMode mode = marketOrder.getType() == Order.OrderType.ASK ? CampBX.AdvTradeMode.AdvancedSell : CampBX.AdvTradeMode.AdvancedBuy; CampBXResponse campBXResponse = campBX.tradeAdvancedMarketEnter( exchange.getExchangeSpecification().getUserName(), exchange.getExchangeSpecification().getPassword(), mode, marketOrder.getOriginalAmount(), CampBX.MarketPrice.Market, null, null, null); return campBXResponse; }
public CampBXResponse placeCampBXLimitOrder(LimitOrder limitOrder) throws IOException { CampBX.TradeMode mode = limitOrder.getType() == Order.OrderType.ASK ? CampBX.TradeMode.QuickSell : CampBX.TradeMode.QuickBuy; CampBXResponse campBXResponse = campBX.tradeEnter( exchange.getExchangeSpecification().getUserName(), exchange.getExchangeSpecification().getPassword(), mode, limitOrder.getOriginalAmount(), limitOrder.getLimitPrice()); return campBXResponse; }
public CoinEggTradeServiceRaw(Exchange exchange) { super(exchange); ExchangeSpecification spec = exchange.getExchangeSpecification(); this.apiKey = spec.getApiKey(); this.signer = CoinEggDigest.createInstance(spec.getSecretKey()); this.tradePassword = spec.getPassword(); this.nonceFactory = exchange.getNonceFactory(); this.coinEggAuthenticated = RestProxyFactory.createProxy( CoinEggAuthenticated.class, exchange.getExchangeSpecification().getSslUri()); }
public CoinEggAccountServiceRaw(Exchange exchange) { super(exchange); ExchangeSpecification spec = exchange.getExchangeSpecification(); this.apiKey = spec.getApiKey(); this.signer = CoinEggDigest.createInstance(spec.getSecretKey()); this.tradePassword = spec.getPassword(); this.nonceFactory = exchange.getNonceFactory(); this.coinEggAuthenticated = RestProxyFactory.createProxy( CoinEggAuthenticated.class, exchange.getExchangeSpecification().getSslUri()); }
/** * Corresponds to <code>GET /accounts/<account-id></code> * * @param accountID * @return * @throws IOException */ public AbucoinsAccount getAbucoinsAccount(String accountID) throws IOException { AbucoinsAccount account = abucoinsAuthenticated.getAccount( accountID, exchange.getExchangeSpecification().getApiKey(), signatureCreator, exchange.getExchangeSpecification().getPassword(), timestamp()); if (account.getMessage() != null) throw new ExchangeException(account.getMessage()); return account; }
/** * Helper method that wraps {@link #getAbucoinsOrders(AbucoinsOrderRequest)} allowing you to get * an order by order-id. * * @param orderID The OrderID of the order to retreive. * @return * @throws IOException */ public AbucoinsOrder getAbucoinsOrder(String orderID) throws IOException { AbucoinsOrder order = abucoinsAuthenticated.getOrder( orderID, exchange.getExchangeSpecification().getApiKey(), signatureCreator, exchange.getExchangeSpecification().getPassword(), timestamp()); if (order.getMessage() != null) throw new ExchangeException(order.getMessage()); return order; }
/** * Corresponds to <code>POST orders</delete> * * @return * @throws IOException */ public AbucoinsCreateOrderResponse createAbucoinsOrder(AbucoinsBaseCreateOrderRequest req) throws IOException { AbucoinsCreateOrderResponse resp = abucoinsAuthenticated.createOrder( exchange.getExchangeSpecification().getApiKey(), signatureCreator, exchange.getExchangeSpecification().getPassword(), timestamp(), req); if (resp.getMessage() != null) throw new ExchangeException(resp.getMessage()); return resp; }
/** * Corresponds to <code>GET /accounts</code> * * @return * @throws IOException */ public AbucoinsAccount[] getAbucoinsAccounts() throws IOException { AbucoinsAccounts accounts = abucoinsAuthenticated.getAccounts( exchange.getExchangeSpecification().getApiKey(), signatureCreator, exchange.getExchangeSpecification().getPassword(), timestamp()); if (accounts.getAccounts().length == 1 && accounts.getAccounts()[0].getMessage() != null) throw new ExchangeException(accounts.getAccounts()[0].getMessage()); return accounts.getAccounts(); }
/** * Corresponds to <code>GET /payment-methods</code> * * @return * @throws IOException */ public AbucoinsPaymentMethod[] getPaymentMethods() throws IOException { AbucoinsPaymentMethods paymentMethods = abucoinsAuthenticated.getPaymentMethods( exchange.getExchangeSpecification().getApiKey(), signatureCreator, exchange.getExchangeSpecification().getPassword(), timestamp()); if (paymentMethods.getPaymentMethods().length == 1 && paymentMethods.getPaymentMethods()[0].getMessage() != null) throw new ExchangeException(paymentMethods.getPaymentMethods()[0].getMessage()); return paymentMethods.getPaymentMethods(); }