Examples of CoinbaseException


Examples of com.coinbase.api.exception.CoinbaseException

    public Money getBalance(String accountId) throws IOException, CoinbaseException {
        URL accountBalanceUrl;
        try {
            accountBalanceUrl = new URL(_baseUrl, "accounts/" + accountId + "/balance");
        } catch (MalformedURLException ex) {
            throw new CoinbaseException("Invalid account id");
        }
        return deserialize(doHttp(accountBalanceUrl, "GET", null), Money.class);
    }
View Full Code Here

Examples of com.coinbase.api.exception.CoinbaseException

    public void setPrimaryAccount(String accountId) throws CoinbaseException, IOException {
        URL setPrimaryUrl;
        try {
            setPrimaryUrl = new URL(_baseUrl, "accounts/" + accountId + "/primary");
        } catch (MalformedURLException ex) {
            throw new CoinbaseException("Invalid account id");
        }
        post(setPrimaryUrl, new Request(), Response.class);
    }
View Full Code Here

Examples of com.coinbase.api.exception.CoinbaseException

    public void deleteAccount(String accountId) throws CoinbaseException, IOException {
        URL accountUrl;
        try {
            accountUrl = new URL(_baseUrl, "accounts/" + accountId);
        } catch (MalformedURLException ex) {
            throw new CoinbaseException("Invalid account id");
        }
        delete(accountUrl, Response.class);
    }
View Full Code Here

Examples of com.coinbase.api.exception.CoinbaseException

    public void updateAccount(String accountId, Account account) throws CoinbaseException, IOException {
        URL accountUrl;
        try {
            accountUrl = new URL(_baseUrl, "accounts/" + accountId);
        } catch (MalformedURLException ex) {
            throw new CoinbaseException("Invalid account id");
        }

        Request request = new Request();
        request.setAccount(account);
        put(accountUrl, request, Response.class);
View Full Code Here

Examples of com.coinbase.api.exception.CoinbaseException

        return deserialize(doHttp(spotPriceUrl, "GET", null), Money.class);
    }

    public Quote getBuyQuote(Money btcAmount) throws IOException, CoinbaseException {
        if (!btcAmount.getCurrencyUnit().getCode().equals("BTC")) {
            throw new CoinbaseException("Only BTC amounts are supported for quotes");
        }

        URL buyPriceUrl;
        try {
            buyPriceUrl = new URL(
View Full Code Here

Examples of com.coinbase.api.exception.CoinbaseException

        return deserialize(doHttp(buyPriceUrl, "GET", null), Quote.class);
    }

    public Quote getSellQuote(Money btcAmount) throws IOException, CoinbaseException {
        if (!btcAmount.getCurrencyUnit().getCode().equals("BTC")) {
            throw new CoinbaseException("Only BTC amounts are supported for quotes");
        }

        URL sellPriceUrl;
        try {
            sellPriceUrl = new URL(
View Full Code Here

Examples of com.coinbase.api.exception.CoinbaseException

                _baseUrl,
                "transactions?page=" + page +
                (_accountId != null ? "&account_id=" + _accountId : "")
            );
        } catch (MalformedURLException ex) {
            throw new CoinbaseException("Invalid account id");
        }
        return get(transactionsUrl, TransactionsResponse.class);
    }
View Full Code Here

Examples of com.coinbase.api.exception.CoinbaseException

    public Transaction getTransaction(String id) throws IOException, CoinbaseException {
        URL transactionUrl;
        try {
            transactionUrl = new URL(_baseUrl, "transactions/" + id);
        } catch (MalformedURLException ex) {
            throw new CoinbaseException("Invalid transaction id");
        }
        return get(transactionUrl, TransactionResponse.class).getTransaction();
    }
View Full Code Here

Examples of com.coinbase.api.exception.CoinbaseException

    public void resendRequest(String id) throws CoinbaseException, IOException {
        URL resendRequestUrl;
        try {
            resendRequestUrl = new URL(_baseUrl, "transactions/" + id + "/resend_request");
        } catch (MalformedURLException ex) {
            throw new CoinbaseException("Invalid transaction id");
        }
        put(resendRequestUrl, newAccountSpecificRequest(), Response.class);
    }
View Full Code Here

Examples of com.coinbase.api.exception.CoinbaseException

    public void deleteRequest(String id) throws CoinbaseException, IOException {
        URL cancelRequestUrl;
        try {
            cancelRequestUrl = new URL(_baseUrl, "transactions/" + id + "/cancel_request");
        } catch (MalformedURLException ex) {
            throw new CoinbaseException("Invalid transaction id");
        }
        delete(cancelRequestUrl, Response.class);
    }
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.