Full Code of irufus/gdax-java for AI

master 2287988f0063 cached
115 files
214.2 KB
53.5k tokens
886 symbols
1 requests
Download .txt
Showing preview only (250K chars total). Download the full file or copy to clipboard to get everything.
Repository: irufus/gdax-java
Branch: master
Commit: 2287988f0063
Files: 115
Total size: 214.2 KB

Directory structure:
gitextract_ohny94n4/

├── .github/
│   └── workflows/
│       └── build.yaml
├── .gitignore
├── CONTRIBUTING.md
├── LICENSE
├── README.md
├── api/
│   ├── build.gradle
│   └── src/
│       ├── main/
│       │   └── java/
│       │       └── com/
│       │           └── coinbase/
│       │               └── exchange/
│       │                   └── api/
│       │                       ├── accounts/
│       │                       │   ├── Account.java
│       │                       │   ├── AccountHistory.java
│       │                       │   └── AccountService.java
│       │                       ├── deposits/
│       │                       │   └── DepositService.java
│       │                       ├── exchange/
│       │                       │   ├── CoinbaseExchange.java
│       │                       │   └── CoinbaseExchangeImpl.java
│       │                       ├── marketdata/
│       │                       │   ├── MarketData.java
│       │                       │   ├── MarketDataService.java
│       │                       │   ├── Message.java
│       │                       │   ├── MessageEX.java
│       │                       │   ├── OrderItem.java
│       │                       │   └── Trade.java
│       │                       ├── orders/
│       │                       │   ├── Order.java
│       │                       │   ├── OrderBuilder.java
│       │                       │   └── OrderService.java
│       │                       ├── payments/
│       │                       │   ├── AccountLimit.java
│       │                       │   ├── Amount.java
│       │                       │   ├── BankCountry.java
│       │                       │   ├── CoinbaseAccount.java
│       │                       │   ├── DepositInformation.java
│       │                       │   ├── Limit.java
│       │                       │   ├── PaymentService.java
│       │                       │   ├── PaymentType.java
│       │                       │   └── SepaDepositInformation.java
│       │                       ├── products/
│       │                       │   └── ProductService.java
│       │                       ├── reports/
│       │                       │   ├── ReportRequest.java
│       │                       │   ├── ReportResponse.java
│       │                       │   ├── ReportService.java
│       │                       │   └── TimePeriod.java
│       │                       ├── transfers/
│       │                       │   ├── Transfer.java
│       │                       │   └── TransferService.java
│       │                       ├── useraccount/
│       │                       │   ├── UserAccountData.java
│       │                       │   └── UserAccountService.java
│       │                       └── withdrawals/
│       │                           └── WithdrawalsService.java
│       └── test/
│           ├── java/
│           │   └── com/
│           │       └── coinbase/
│           │           └── exchange/
│           │               └── api/
│           │                   ├── BaseIntegrationTest.java
│           │                   ├── TestExchangeApplication.java
│           │                   ├── accounts/
│           │                   │   ├── AccountsIntegrationTest.java
│           │                   │   ├── DepositIntegrationTest.java
│           │                   │   ├── UserAccountServiceIntegrationTest.java
│           │                   │   └── WithdrawalIntegrationTest.java
│           │                   ├── authentication/
│           │                   │   └── AuthenticationIntegrationIntegrationTest.java
│           │                   ├── config/
│           │                   │   └── IntegrationTestConfiguration.java
│           │                   ├── marketdata/
│           │                   │   ├── MarketDataIntegrationTest.java
│           │                   │   └── OrderItemDeserializerTest.java
│           │                   ├── orders/
│           │                   │   └── OrderIntegrationTest.java
│           │                   ├── payments/
│           │                   │   └── PaymentIntegrationTest.java
│           │                   ├── products/
│           │                   │   └── ProductsIntegrationTest.java
│           │                   └── transfers/
│           │                       └── TransferServiceIntegrationTest.java
│           └── resources/
│               └── application-test.yml
├── build.gradle
├── gradle/
│   └── wrapper/
│       ├── gradle-wrapper.jar
│       └── gradle-wrapper.properties
├── gradlew
├── gradlew.bat
├── model/
│   ├── build.gradle
│   └── src/
│       └── main/
│           └── java/
│               └── com/
│                   └── coinbase/
│                       └── exchange/
│                           └── model/
│                               ├── Candle.java
│                               ├── Candles.java
│                               ├── CoinbasePaymentRequest.java
│                               ├── CryptoPaymentRequest.java
│                               ├── Currency.java
│                               ├── Detail.java
│                               ├── Fill.java
│                               ├── Granularity.java
│                               ├── Hold.java
│                               ├── MonetaryRequest.java
│                               ├── NewLimitOrderSingle.java
│                               ├── NewMarketOrderSingle.java
│                               ├── NewOrderSingle.java
│                               ├── PaymentRequest.java
│                               ├── PaymentResponse.java
│                               ├── Product.java
│                               └── ProductOrderBook.java
├── security/
│   ├── build.gradle
│   └── src/
│       └── main/
│           └── java/
│               └── com/
│                   └── coinbase/
│                       └── exchange/
│                           └── security/
│                               ├── Signature.java
│                               └── constants/
│                                   └── ExchangeConstants.java
├── settings.gradle
└── websocketfeed/
    ├── build.gradle
    └── src/
        ├── main/
        │   └── java/
        │       └── com/
        │           └── coinbase/
        │               └── exchange/
        │                   └── websocketfeed/
        │                       ├── ActivateOrderBookMessage.java
        │                       ├── ChangedOrderBookMessage.java
        │                       ├── Channel.java
        │                       ├── ChannelName.java
        │                       ├── DoneOrderBookMessage.java
        │                       ├── ErrorOrderBookMessage.java
        │                       ├── FeedMessage.java
        │                       ├── HeartBeat.java
        │                       ├── L2UpdateMessage.java
        │                       ├── MatchedOrderBookMessage.java
        │                       ├── OpenedOrderBookMessage.java
        │                       ├── OrderBookMessage.java
        │                       ├── ReceivedOrderBookMessage.java
        │                       ├── SnapshotMessage.java
        │                       ├── StatusMessage.java
        │                       ├── Subscribe.java
        │                       ├── SubscriptionsMessage.java
        │                       ├── TickerMessage.java
        │                       ├── WebsocketFeed.java
        │                       └── WebsocketMessageHandler.java
        └── test/
            └── java/
                └── com/
                    └── coinbase/
                        └── exchange/
                            └── websocketfeed/
                                ├── ActivateOrderBookMessageTest.java
                                ├── ChangedOrderBookMessageTest.java
                                ├── DoneOrderBookMessageTest.java
                                ├── ErrorOrderBookMessageTest.java
                                ├── HeartBeatTest.java
                                ├── L2UpdateMessageTest.java
                                ├── MatchedOrderBookMessageTest.java
                                ├── OpenedOrderBookMessageTest.java
                                ├── ReceivedOrderBookMessageTest.java
                                ├── SnapshotMessageTest.java
                                ├── StatusMessageTest.java
                                └── TickerMessageTest.java

================================================
FILE CONTENTS
================================================

================================================
FILE: .github/workflows/build.yaml
================================================
name: build
on: [push]

jobs:
  byz-build:
    name: Coinbase Pro Build
    runs-on: ubuntu-latest
    steps:
      - uses: actions/checkout@v2
      - name: set up JDK
        uses: actions/setup-java@v1
        with:
          java-version: 11
      - name: Build (non-master branch)
        if: github.ref != 'refs/heads/master'
        run: ./gradlew build

================================================
FILE: .gitignore
================================================
*.iml
.idea/
.gradle/
*.log
**/classes/
**/build/
**/out/
**/application.*.yml

================================================
FILE: CONTRIBUTING.md
================================================
# Contributing

If you'd like to contribute you'd be more than welcome. The code base is ever growing and in order to make it usable by as many people as possible, we'd like your ideas, suggestions, feedback, as well as accepting your code improvements.

Join us on the Gitter.im channel (chat link at the top of the main README.md file)

If you'd like to contribute code, fork the repo, make your changes, then create a pull request back into the irufus/gdax-java codebase. Your code will then be reviewed prior to merging it in.

Please ensure where possible, tests are included with any new features. Tests in this project are JUnit. Mockito, PowerMockito, etc. are all possible. The only real restriction is to Keep It Simple (where possible).

Please also update/amend the README.md as necessary regarding changes so that it is kept up to date.

# TESTING

Tests act as documentation for the code, demonstrating actual usage.
If you're not familiar with TDD then now is a great time to begin!
Test Driven Development will:
- help determine what to build
- help you to prioritise which elements need to be in place first
- help you to implement a solution using the minimal amount of code
- frontload the stress of the design of your code, which should emerge from/be driven by the tests

Not testing code leads to poor implementations that are hard to read, debug and are typically unmaintainable.

If you'd like to contribute to the codebase, your code must be robust. To ensure its Robust you must provide tests that cover the scenarios your solution should handle.

Currently tests follow a given/when/then approach. That is:
- `given` some setup and preconditions
- `when` I invoke method X on some object under test
- `then` some results should be expected.

You'll spot this pattern clearly in the test code because most of the precondition code is grouped together, then there's a separated line calling to some method on the testObject (typically), and finally a group of assertions at the end of the test. These three sections are typically grouped using new lines as separators.

Test naming - typically tests are named in the following way: `shouldDoXWhenY`.

If you spot a bug, write a test for it to highlight the issue, create a fix, and submit a pull request for review.

Code that has very little in the way of testing is more likely to be rejected.

The current codebase tests what is sensible and possible to test. Mainly getting things.

## I want to create some new element in the codebase

Where do you start?

Add this template, add the relevant tests you want, then begin implementing your code.

Note Dependency injection is far more predictable in spring if constructor injection is used i.e. put the `@Autowired`/`@Inject` annotation on the constructor rather than a field in your class. 
If a class only has one constructor the `@Autowired` annotation is not necessary.

```java
@Component
public class NewComponent {

    @Autowired
    public NewComponent() {
        // put object into a consistent state ready for interacting with.
    }
}
```

If you want to utilise an existing service, you just need the configuration similar to below:

```java
@SpringBootConfiguration
public class ApplicationConfiguration {

    @Bean
    public ObjectMapper objectMapper() {
        ObjectMapper objectMapper = new ObjectMapper();
        objectMapper.registerModule(new JavaTimeModule());
        return objectMapper;
    }

    @Bean
    public Signature signature(@Value("${exchange.secret}") String secret) {
        return new Signature(secret);
    }
    
    @Bean
    public CoinbaseExchange coinbasePro(@Value("${exchange.key}") String publicKey,
                                        @Value("${exchange.passphrase}") String passphrase,
                                        @Value("${exchange.baseUrl}") String baseUrl,
                                        Signature signature,
                                        ObjectMapper objectMapper) {
        return new CoinbaseExchangeImpl(publicKey, passphrase, baseUrl, signature, objectMapper);
    }

   /**
    * now you can create services by wiring in the CoinbaseExchange object to handle incoming/outgoing requests.
    **/

    @Bean
    public AccountService accountService(CoinbaseExchange exchange) {
        return new AccountService(exchange);
    }
} 
```

```java
@Component
public class MyApplication {

    private AccountService accountService;

    @Autowired
    public MyApplication(AccountService accountService) {
        this.accountService = accountService;
    }

    public void printMyAccounts() {
        List<Account> accounts = accountService.getAccounts();
        for(Account account: accounts) {
            System.out.println(accounts.getBalance());
        }
    }
}
```

If you can do TDD, great. If not, add it after you've coded a solution.

Tests all follow a "given, when, then" style... *given* some preconditions `X`, *when* I exercise a given method `Y` (typically a method call on its own line), *then* the results are expected to be `Z` (if not the test fails).

================================================
FILE: LICENSE
================================================
The MIT License (MIT)

Copyright (c) 2015 Ishmael Rufus

Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in all
copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
SOFTWARE.



================================================
FILE: README.md
================================================
# Coinbase Pro

[![Join the chat at https://gitter.im/irufus/gdax-java](https://badges.gitter.im/irufus/gdax-java.svg)](https://gitter.im/irufus/gdax-java?utm_source=badge&utm_medium=badge&utm_campaign=pr-badge&utm_content=badge)

Java based wrapper for the [Coinbase Pro API](https://docs.pro.coinbase.com/)

## Notes:

> Coinbase Pro primary data sources and servers run in the Amazon US East data center. To minimize latency for API access, we recommend making requests from servers located near the US East data center.
> Some of the methods do not yet have tests and so may not work as expected until someone tries them and fixes them at a later date. Please raise an issue in github if you want something in particular as a priority.
> This codebase is maintained independently of Coinbase. We are not in any way affiliated with coinbase or coinbase pro.

## Functions supported:
- [x] Authentication (GET, POST, DELETE supported)
- [x] Get Account
- [x] Get Accounts
- [x] Get Account History
- [x] Get Holds
- [x] Place a new Order (limit order)
- [x] Get an Order
- [x] Cancel an Order
- [x] List all open Orders
- [x] Get Market Data
- [x] List fills
- [x] List Products
- [x] HTTP Error code support
- [x] List of Currencies - from Accounts
- [x] Withdrawals - from coinbase accounts / payment methods / crypto account address
- [x] Deposits - from coinbase accounts / payment methods
- [x] Transfers - from coinbase accounts
- [x] Payment methods - coinbase / payment methods
- [x] Reports
- [x] Pagination support for all calls that support it.
- [x] Pagination support for all calls that support it.
- [x] Sandbox support - *sandbox support was dropped by gdax so this is now redundant*
    
### In Development

Check the issues on the repo for open items to work on.
Please join the gitter channel if you have any questions. Support always welcome. 
Note the channel uses the legacy name of 'gdax-java' rather than 'coinbase-pro-java'

### Contributing

Please see CONTRIBUTE.md if your interested in getting involved.

## Usage
--------

**If you commit your secure keys, passphrase or secrete, disable/delete them from Coinbase Pro immediately**.

1. tests can be run with `./gradlew test`, and `./gradlew integrationTest`.
    1. unit tests have file/class names ending `Test` and run locally
    1. integration tests have file/class names ending `IntegrationTest` and should run against the sandbox api 

## Examples

To make use of this library you only need a reference to the Service that you want. 
 - For Accounts, get an instance of the `AccountService` See CONTRIBUTING.md for an example of how to do this 
 - For MarketData, use the `MarketDataService`, and so on.

## Examples
--------

At present the Services and Data objects returned should match the interface specified in the Coinbase Pro api here: [https://docs.pro.coinbase.com/#api](https://docs.pro.coinbase.com/#api)

Each `Service` class requires the `CoinbaseExchange` object (see CONTRIBUTING.md for examples of how to create this) so that methods calling the REST endpoints can be made, using a `RestTemplate` that has
the correct headers and signatures is used.

## API
--------

This library is as set up as follows:
(Note: this section is likely to change over time)

- `AccountService.getAccounts()` - returns a List Accounts
- `AccountService.getAccountHistory(String accountId)` - returns the history for a given account as a List
- `AccountService.getHolds(String accountId)` - returns a List of all held funds for a given account.
- `DepositService.depositViaPaymentMethod(BigDecimal amount, String currency, String paymentMethodId)` - makes a deposit from a stored payment method into your GDAX account
- `DepositService.coinbaseDeposit(BigDecimal amount, String currency, String coinbaseAccountId)` - makes a deposit from a coinbase account into your GDAX account
- `MarketDataService.getMarketDataOrderBook(String productId, String level)` - a call to ProductService.getProducts() will return the order book for a given product. You can then use the WebsocketFeed api to keep your orderbook up to date. This is implemented in this codebase. Level can be 1 (top bid/ask only), 2 (top 50 bids/asks only), 3 (entire order book - takes a while to pull the data.)
- `OrderService.getOpenOrders(String accountId)` - returns a List of Orders for any outstanding orders
- `OrderService.cancelOrder(String orderId)` - cancels a given order
- `OrderService.createOrder(NewOrderSingle aSingleOrder)` - construct an order and send it to this method to place an order for a given product on the exchange.
- `PaymentService.getCoinbaseAccounts()` - gets the coinbase accounts for the logged in user
- `PaymentService.getPaymentTypes()` - gets the payment types available for the logged in user
- `ProductService.getProducts()` - returns a List of Products available from the exchange - BTC-USD, BTC-EUR, BTC-GBP, etc.
- `ReportService.createReport(String product, String startDate, String endDate)` - not certain about this one as its untested but presumably it generates a report of a given product's trade history for the dates supplied - dates are assumed to be ISO 8601 compliant
- `TransferService.transfer(String type, BigDecimal amount, String coinbaseAccountId)` - initiates a transfer to your (standard) Coinbase account. 
- `UserAccountService.getTrailingVolume()` - Returns the 30 day trailing volume information from all accounts
- `WithdrawalsService` - methods that enable Withdrawals from a Coinbase-Pro account to a Coinbase Account/Payment method


## WebsocketFeed API
---------------------

The WebsocketFeed is implemented and works. However, there are techniques to using it successfully for production use - e.g. monitoring for 'heartbeats'. 

To use the WSF check out the API documentation and look at usages of `websocketFeed.subscribe(String)` as an example that already works.

## Updates - v 0.11.0
-------------------
- decoupling the `api` code from the spring boot desktop client application so the api can be used and eventually published as a library.
- decoupling `model` code so that it can become shared/common for multiple projects and make building out a FIX client potentially easier
- decoupling the `websocketfeed` code from the api implementation
- new `security` module so websocketfeed and api can share the `Signature` code
- removal of the `gui` desktop app - this needs rebuilding properly (with tests)
- new modularised multi-project gradle build
- centralised dependency versioning for libraries, in the root `build.gradle` as its easier to manage them in a single location
- segregating the unit tests from the integration tests
- updated api/sandbox-api endpoints for use with tests
- renaming project to `Coinbase-Pro-java` in the `settings.gradle` file
- remove joda time lib in favour of the standard library Instant implementation `JavaTimeModule` for the `ObjectMapper`
- updated libraries to newer versions: spring boot, jackson, gson, etc.
- removal of Gson in favour of Jackson libs
- updated classes to use constructor injection rather than field based 


## Updates - v 0.9.1
-------------------
- building an order book that works ready for a desktop client.

## Updates
---------
- converted to using Gradle as a build tool
- converted to using SpringBoot for DI and request building
- updated all libraries used - removed some unnecessary libraries
- refactored the code to remove error handling from every method (rightly/wrongly) - its easier to maintain and extend now as a result
- more modular code that matches the service api - favour composition over inheritance
- removed a lot of boilerplate code
- logging added - Logging will output an equivalent curl command now for each get/post/delete request so that when debugging you can copy the curl request and execute it on the command line.
- service tests added for sanity - no unit tests against the data objects
- better configuration options using `application.yml` for your live environment and `application-test.yml` for your sandbox environment.
- banner displayed (specific to each environment) :)
- generally more structure.
- added pagination to all the relevant calls (some not supported since it seems pointless due to the limited offering from gdax - e.g. products)
- GDAX is updating its API without updating documentation - I've fixed an issue with market data because of this.
- WebsocketFeed added
- OrderBook GUI component added - enable in the `application.yml` by setting enabled to `true`
- LiveOrderBook (full channel) Implemented and viewable via the GUI when enabled

## TODO
-------
- add pagination versions of all endpoints, or offer a way to append to the endpoint urls.

From the GDAX API documentation the Websocket implementation follows the following implementation:
  Send a subscribe message for the product(s) of interest and the full channel.
  Queue any messages received over the websocket stream.
  Make a REST request for the order book snapshot from the REST feed.
  Playback queued messages, discarding sequence numbers before or equal to the snapshot sequence number.
  Apply playback messages to the snapshot as needed (see below).
  After playback is complete, apply real-time stream messages in sequential order, queuing any that arrive out of order for later processing.
  Discard messages once they've been processed.



================================================
FILE: api/build.gradle
================================================
test {
    useJUnitPlatform()
}

dependencies {
    compile project(':model')
    compile project(':security')
    implementation 'com.fasterxml.jackson.core:jackson-core'
    implementation 'com.fasterxml.jackson.core:jackson-databind'
    implementation 'com.fasterxml.jackson.core:jackson-annotations'
    implementation 'com.fasterxml.jackson.datatype:jackson-datatype-jdk8'
    implementation 'org.springframework.boot:spring-boot-starter-web'
    implementation 'org.springframework:spring-context'
    implementation 'org.slf4j:slf4j-api'
    implementation 'ch.qos.logback:logback-classic'
    implementation 'ch.qos.logback:logback-core'

    testImplementation 'junit:junit'
    testImplementation 'org.junit.jupiter:junit-jupiter-api'
    testImplementation 'org.junit.jupiter:junit-jupiter-params'
    testImplementation 'org.junit.jupiter:junit-jupiter-engine'
    testImplementation 'org.junit.platform:junit-platform-suite-api'
    testImplementation 'org.springframework.boot:spring-boot-test'
    testImplementation 'org.springframework.boot:spring-boot-starter-test'
}

================================================
FILE: api/src/main/java/com/coinbase/exchange/api/accounts/Account.java
================================================
package com.coinbase.exchange.api.accounts;

import java.math.BigDecimal;

/**
 * Created by irufus on 2/18/15.
 */
public class Account {
    private String id;
    private String currency;
    private BigDecimal balance;
    private BigDecimal available;
    private BigDecimal hold;
    private String profile_id;

    public Account() {
        this.balance = BigDecimal.ZERO;
        this.available = BigDecimal.ZERO;
        this.hold = BigDecimal.ZERO;
    }

    public Account(String id,
                   String currency,
                   BigDecimal balance,
                   BigDecimal available,
                   BigDecimal hold,
                   String profile_id) {
        this.id = id;
        this.currency = currency;
        this.balance = balance;
        this.available = available;
        this.hold = hold;
        this.profile_id = profile_id;
    }

    public String getId() {
        return id;
    }

    public void setId(String id) {
        this.id = id;
    }

    public BigDecimal getBalance() {
        return balance;
    }

    public void setBalance(BigDecimal balance) {
        this.balance = balance;
    }

    public BigDecimal getHold() {
        return hold;
    }

    public void setHold(BigDecimal hold) {
        this.hold = hold;
    }

    public BigDecimal getAvailable() {
        return available;
    }

    public void setAvailable(BigDecimal available) {
        this.available = available;
    }

    public String getCurrency() {
        return currency;
    }

    public void setCurrency(String currency) {
        this.currency = currency;
    }

    public String getProfile_id() {
        return profile_id;
    }

    public void setProfile_id(String profile_id) {
        this.profile_id = profile_id;
    }
}


================================================
FILE: api/src/main/java/com/coinbase/exchange/api/accounts/AccountHistory.java
================================================
package com.coinbase.exchange.api.accounts;

import com.coinbase.exchange.model.Detail;

import java.math.BigDecimal;

/**
 * Created by irufus on 2/18/15.
 */
public class AccountHistory {
    private Integer id;
    private String created_at;
    private BigDecimal amount;
    private BigDecimal balance;
    private String type;
    private Detail detail;

    public AccountHistory() {}

    public Integer getId() {
        return id;
    }

    public void setId(Integer id) {
        this.id = id;
    }

    public String getCreated_at() {
        return created_at;
    }

    public void setCreated_at(String created_at) {
        this.created_at = created_at;
    }

    public BigDecimal getAmount() {
        return amount;
    }

    public void setAmount(BigDecimal amount) {
        this.amount = amount;
    }

    public BigDecimal getBalance() {
        return balance;
    }

    public void setBalance(BigDecimal balance) {
        this.balance = balance;
    }

    public String getType() {
        return type;
    }

    public void setType(String type) {
        this.type = type;
    }

    public Detail getDetail() {
        return detail;
    }

    public void setDetail(Detail detail) {
        this.detail = detail;
    }
}


================================================
FILE: api/src/main/java/com/coinbase/exchange/api/accounts/AccountService.java
================================================
package com.coinbase.exchange.api.accounts;

import com.coinbase.exchange.model.Hold;
import com.coinbase.exchange.api.exchange.CoinbaseExchange;
import org.springframework.core.ParameterizedTypeReference;

import java.util.List;

/**
 * Created by robevansuk on 25/01/2017.
 */
public class AccountService {

    final CoinbaseExchange exchange;

    public AccountService(final CoinbaseExchange exchange) {
        this.exchange = exchange;
    }

    public static final String ACCOUNTS_ENDPOINT = "/accounts";

    public List<Account> getAccounts(){
        return exchange.getAsList(ACCOUNTS_ENDPOINT, new ParameterizedTypeReference<Account[]>(){});
    }

    public Account getAccount(String id) {
        return exchange.get(ACCOUNTS_ENDPOINT + "/" + id, new ParameterizedTypeReference<Account>() {});
    }

    public List<AccountHistory> getAccountHistory(String accountId) {
        String accountHistoryEndpoint = ACCOUNTS_ENDPOINT + "/" + accountId + "/ledger";
        return exchange.getAsList(accountHistoryEndpoint, new ParameterizedTypeReference<AccountHistory[]>(){});
    }

    public List<AccountHistory> getPagedAccountHistory(String accountId,
                                                       String beforeOrAfter,
                                                       Integer pageNumber,
                                                       Integer limit) {

        String accountHistoryEndpoint = ACCOUNTS_ENDPOINT + "/" + accountId + "/ledger";
        return exchange.pagedGetAsList(accountHistoryEndpoint,
                new ParameterizedTypeReference<AccountHistory[]>(){},
                beforeOrAfter,
                pageNumber,
                limit);
    }

    public List<Hold> getHolds(String accountId) {
        String holdsEndpoint = ACCOUNTS_ENDPOINT + "/" + accountId + "/holds";
        return exchange.getAsList(holdsEndpoint, new ParameterizedTypeReference<Hold[]>(){});
    }

    public List<Hold> getPagedHolds(String accountId,
                                    String beforeOrAfter,
                                    Integer pageNumber,
                                    Integer limit) {
        String holdsEndpoint = ACCOUNTS_ENDPOINT + "/" + accountId + "/holds";
        return exchange.pagedGetAsList(holdsEndpoint,
                new ParameterizedTypeReference<Hold[]>(){},
                beforeOrAfter,
                pageNumber,
                limit);
    }

}


================================================
FILE: api/src/main/java/com/coinbase/exchange/api/deposits/DepositService.java
================================================
package com.coinbase.exchange.api.deposits;

import com.coinbase.exchange.model.CoinbasePaymentRequest;
import com.coinbase.exchange.model.PaymentResponse;
import com.coinbase.exchange.api.exchange.CoinbaseExchange;
import org.springframework.core.ParameterizedTypeReference;

import java.math.BigDecimal;

/**
 * Created by robevansuk on 16/02/2017.
 */
public class DepositService {

    private static final String DEPOSIT_ENDPOINT = "/deposits";
    private static final String PAYMENTS = "/payment-method";
    private static final String COINBASE_PAYMENT = "/coinbase-account";

    final CoinbaseExchange exchange;

    public DepositService(final CoinbaseExchange exchange) {
        this.exchange = exchange;
    }

    /**
     * @param amount
     * @param currency
     * @param paymentMethodId
     * @return PaymentResponse
     */
    public PaymentResponse depositViaPaymentMethod(BigDecimal amount, String currency, final String paymentMethodId) {
        CoinbasePaymentRequest coinbasePaymentRequest = new CoinbasePaymentRequest(amount, currency, paymentMethodId);
        return exchange.post(DEPOSIT_ENDPOINT + PAYMENTS,
                new ParameterizedTypeReference<PaymentResponse>(){},
                coinbasePaymentRequest);
    }

    /**
     * @param amount
     * @param currency
     * @param coinbaseAccountId
     * @return PaymentResponse
     */
    public PaymentResponse depositViaCoinbase(BigDecimal amount, String currency, String coinbaseAccountId) {
        CoinbasePaymentRequest coinbasePaymentRequest = new CoinbasePaymentRequest(amount, currency, coinbaseAccountId);
        return exchange.post(DEPOSIT_ENDPOINT + COINBASE_PAYMENT,
                new ParameterizedTypeReference<PaymentResponse>(){},
                coinbasePaymentRequest);
    }
}


================================================
FILE: api/src/main/java/com/coinbase/exchange/api/exchange/CoinbaseExchange.java
================================================
package com.coinbase.exchange.api.exchange;

import org.springframework.core.ParameterizedTypeReference;
import org.springframework.http.HttpEntity;

import java.util.List;

public interface CoinbaseExchange {

    String getBaseUrl();
    <R> HttpEntity<String> securityHeaders(String endpoint, String method, String body);
    <T> T get(String endpoint, ParameterizedTypeReference<T> type);
    <T> T pagedGet(String endpoint, ParameterizedTypeReference<T> responseType, String beforeOrAfter, Integer pageNumber, Integer limit);
    <T> List<T> getAsList(String endpoint, ParameterizedTypeReference<T[]> type);
    <T> List<T> pagedGetAsList(String endpoint, ParameterizedTypeReference<T[]> responseType, String beforeOrAfter, Integer pageNumber, Integer limit);
    <T, R> T post(String endpoint, ParameterizedTypeReference<T> type, R jsonObject);
    <T> T delete(String endpoint, ParameterizedTypeReference<T> type);
}


================================================
FILE: api/src/main/java/com/coinbase/exchange/api/exchange/CoinbaseExchangeImpl.java
================================================
package com.coinbase.exchange.api.exchange;

import com.coinbase.exchange.security.Signature;
import com.fasterxml.jackson.core.JsonProcessingException;
import com.fasterxml.jackson.databind.ObjectMapper;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.core.ParameterizedTypeReference;
import org.springframework.http.HttpEntity;
import org.springframework.http.HttpHeaders;
import org.springframework.http.HttpMethod;
import org.springframework.http.ResponseEntity;
import org.springframework.web.client.HttpClientErrorException;
import org.springframework.web.client.RestTemplate;

import java.time.Instant;
import java.util.Arrays;
import java.util.List;

import static java.util.Collections.emptyList;

/**
 * This class acts as a central point for providing user configuration and making GET/POST/PUT requests as well as
 * getting responses as Lists of objects rather than arrays.
 */
public class CoinbaseExchangeImpl implements CoinbaseExchange {

    static final Logger log = LoggerFactory.getLogger(CoinbaseExchangeImpl.class.getName());

    private final String publicKey;
    private final String passphrase;
    private final String baseUrl;
    private final Signature signature;
    private final ObjectMapper objectMapper;
    private final RestTemplate restTemplate;

    public CoinbaseExchangeImpl(final String publicKey,
                                final String passphrase,
                                final String baseUrl,
                                final Signature signature,
                                final ObjectMapper objectMapper) {
        this.publicKey = publicKey;
        this.passphrase = passphrase;
        this.baseUrl = baseUrl;
        this.signature = signature;
        this.objectMapper = objectMapper;
        this.restTemplate = new RestTemplate();
    }

    @Override
    public <T> T get(String resourcePath, ParameterizedTypeReference<T> responseType) {
        try {
            ResponseEntity<T> responseEntity = restTemplate.exchange(getBaseUrl() + resourcePath,
                    HttpMethod.GET,
                    securityHeaders(resourcePath,
                    "GET",
                     ""),
                    responseType);
            return responseEntity.getBody();
        } catch (HttpClientErrorException ex) {
            log.error("GET request Failed for '" + resourcePath + "': " + ex.getResponseBodyAsString());
        }
        return null;
    }

    @Override
    public <T> List<T> getAsList(String resourcePath, ParameterizedTypeReference<T[]> responseType) {
       T[] result = get(resourcePath, responseType);

       return result == null ? emptyList() : Arrays.asList(result);
    }

    @Override
    public <T> T pagedGet(String resourcePath,
                          ParameterizedTypeReference<T> responseType,
                          String beforeOrAfter,
                          Integer pageNumber,
                          Integer limit) {
        resourcePath += "?" + beforeOrAfter + "=" + pageNumber + "&limit=" + limit;
        return get(resourcePath, responseType);
    }

    @Override
    public <T> List<T> pagedGetAsList(String resourcePath,
                          ParameterizedTypeReference<T[]> responseType,
                          String beforeOrAfter,
                          Integer pageNumber,
                          Integer limit) {
        T[] result = pagedGet(resourcePath, responseType, beforeOrAfter, pageNumber, limit );
        return result == null ? emptyList() : Arrays.asList(result);
    }

    @Override
    public <T> T delete(String resourcePath, ParameterizedTypeReference<T> responseType) {
        try {
            ResponseEntity<T> response = restTemplate.exchange(getBaseUrl() + resourcePath,
                HttpMethod.DELETE,
                securityHeaders(resourcePath, "DELETE", ""),
                responseType);
            return response.getBody();
        } catch (HttpClientErrorException ex) {
            log.error("DELETE request Failed for '" + resourcePath + "': " + ex.getResponseBodyAsString());
        }
        return null;
    }

    @Override
    public <T, R> T post(String resourcePath,  ParameterizedTypeReference<T> responseType, R jsonObj) {
        String jsonBody = toJson(jsonObj);

        try {
            ResponseEntity<T> response = restTemplate.exchange(getBaseUrl() + resourcePath,
                    HttpMethod.POST,
                    securityHeaders(resourcePath, "POST", jsonBody),
                    responseType);
            return response.getBody();
        } catch (HttpClientErrorException ex) {
            log.error("POST request Failed for '" + resourcePath + "': " + ex.getResponseBodyAsString());
        }
        return null;
    }

    @Override
    public String getBaseUrl() {
        return baseUrl;
    }

    @Override
    public HttpEntity<String> securityHeaders(String endpoint, String method, String jsonBody) {
        HttpHeaders headers = new HttpHeaders();

        String timestamp = Instant.now().getEpochSecond() + "";
        String resource = endpoint.replace(getBaseUrl(), "");

        headers.add("accept", "application/json");
        headers.add("content-type", "application/json");
        headers.add("User-Agent", "gdax-java unofficial coinbase pro api library");
        headers.add("CB-ACCESS-KEY", publicKey);
        headers.add("CB-ACCESS-SIGN", signature.generate(resource, method, jsonBody, timestamp));
        headers.add("CB-ACCESS-TIMESTAMP", timestamp);
        headers.add("CB-ACCESS-PASSPHRASE", passphrase);

        curlRequest(method, jsonBody, headers, resource);

        return new HttpEntity<>(jsonBody, headers);
    }

    /**
     * Purely here for logging an equivalent curl request for debugging
     * note that the signature is time-sensitive and has a time to live of about 1 minute after which the request
     * is no longer valid.
     */
    private void curlRequest(String method, String jsonBody, HttpHeaders headers, String resource) {
        String curlTest = "curl ";
        for (String key : headers.keySet()){
            curlTest +=  "-H '" + key + ":" + headers.get(key).get(0) + "' ";
        }
        if (jsonBody!=null && !jsonBody.equals(""))
            curlTest += "-d '" + jsonBody + "' ";

        curlTest += "-X " + method + " " + getBaseUrl() + resource;
        log.debug(curlTest);
    }

    private String toJson(Object object) {
        try {
            return objectMapper.writeValueAsString(object);
        } catch (JsonProcessingException e) {
            log.error("Unable to serialize", e);
            throw new RuntimeException("Unable to serialize");
        }
    }
}


================================================
FILE: api/src/main/java/com/coinbase/exchange/api/marketdata/MarketData.java
================================================
package com.coinbase.exchange.api.marketdata;

import java.util.List;

/**
 * Created by robevansuk on 09/02/2017.
 */
public class MarketData {

    private Long sequence;
    private List<OrderItem> bids; // price, size, orders
    private List<OrderItem> asks; // price, size, orders

    public MarketData() { }

    public MarketData(Long sequence, List<OrderItem> bids, List<OrderItem> asks) {
        this.sequence = sequence;
        this.bids = bids;
        this.asks = asks;
    }

    public Long getSequence() {
        return sequence;
    }

    public void setSequence(Long sequence) {
        this.sequence = sequence;
    }

    public List<OrderItem> getBids() {
        return bids;
    }

    public void setBids(List<OrderItem> bids) {
        this.bids = bids;
    }

    public List<OrderItem> getAsks() {
        return asks;
    }

    public void setAsks(List<OrderItem> asks) {
        this.asks = asks;
    }
}


================================================
FILE: api/src/main/java/com/coinbase/exchange/api/marketdata/MarketDataService.java
================================================
package com.coinbase.exchange.api.marketdata;

import com.coinbase.exchange.api.exchange.CoinbaseExchange;
import org.springframework.core.ParameterizedTypeReference;

import java.util.List;

/**
 * Created by robevansuk on 07/02/2017.
 */
public class MarketDataService {

    final CoinbaseExchange exchange;

    public MarketDataService(final CoinbaseExchange exchange) {
        this.exchange = exchange;
    }

    public static final String PRODUCT_ENDPOINT = "/products";

    public MarketData getMarketDataOrderBook(String productId, int level) {
        String marketDataEndpoint = PRODUCT_ENDPOINT + "/" + productId + "/book";
        if(level != 1)
            marketDataEndpoint += "?level=" + level;
       return exchange.get(marketDataEndpoint, new ParameterizedTypeReference<MarketData>(){});
    }

    public List<Trade> getTrades(String productId) {
        String tradesEndpoint = PRODUCT_ENDPOINT + "/" + productId + "/trades";
        return exchange.getAsList(tradesEndpoint, new ParameterizedTypeReference<Trade[]>(){});
    }
}


================================================
FILE: api/src/main/java/com/coinbase/exchange/api/marketdata/Message.java
================================================
package com.coinbase.exchange.api.marketdata;

import java.math.BigDecimal;

/**
 * Created by irufus on 2/28/15.
 */
public class Message {
    private String type;
    private Long sequence;
    private String order_id;
    private BigDecimal size;
    private BigDecimal price;
    private String side;
    private BigDecimal remaining_size;
    private String reason;
    private String maker_order_id;
    private String taker_order_id;
    private String time;

    public BigDecimal getRemaining_size() {
        return remaining_size;
    }

    public void setRemaining_size(BigDecimal remaining_size) {
        this.remaining_size = remaining_size;
    }

    public String getSide() {
        return side;
    }

    public void setSide(String side) {
        this.side = side;
    }

    public BigDecimal getPrice() {
        return price;
    }

    public void setPrice(BigDecimal price) {
        this.price = price;
    }

    public BigDecimal getSize() {
        return size;
    }

    public void setSize(BigDecimal size) {
        this.size = size;
    }

    public String getOrder_id() {
        return order_id;
    }

    public void setOrder_id(String order_id) {
        this.order_id = order_id;
    }

    public Long getSequence() {
        return sequence;
    }

    public void setSequence(Long sequence) {
        this.sequence = sequence;
    }

    public String getType() {
        return type;
    }

    public void setType(String type) {
        this.type = type;
    }

    public String getReason() {
        return reason;
    }

    public void setReason(String reason) {
        this.reason = reason;
    }

    public String getMaker_order_id() {
        return maker_order_id;
    }

    public void setMaker_order_id(String maker_order_id) {
        this.maker_order_id = maker_order_id;
    }

    public String getTaker_order_id() {
        return taker_order_id;
    }

    public void setTaker_order_id(String taker_order_id) {
        this.taker_order_id = taker_order_id;
    }

    public String getTime() {
        return time;
    }

    public void setTime(String time) {
        this.time = time;
    }

}


================================================
FILE: api/src/main/java/com/coinbase/exchange/api/marketdata/MessageEX.java
================================================
package com.coinbase.exchange.api.marketdata;

/**
 * Created by irufus on 3/2/15.
 */
public class MessageEX {
    public static class MessageType{
        public final static String RECEIEVED = "received";
        public final static String OPEN = "open";
        public final static String DONE = "done";
        public final static String MATCH = "match";
        public final static String CHANGE = "change";
        public final static String ERROR = "error";
    }
    public static class MessageSide{
        public final static String BUY = "buy";
        public final static String SELL = "sell";
    }
}


================================================
FILE: api/src/main/java/com/coinbase/exchange/api/marketdata/OrderItem.java
================================================
package com.coinbase.exchange.api.marketdata;

import com.fasterxml.jackson.annotation.JsonCreator;
import org.springframework.util.CollectionUtils;

import java.math.BigDecimal;
import java.util.List;

/**
 * Created by robevansuk on 20/03/2017.
 */
public class OrderItem implements Comparable {

    private final BigDecimal price;
    private final BigDecimal size;
    private final String orderId;
    private final BigDecimal num;

    @JsonCreator
    public OrderItem(List<String> limitOrders) {
        if (CollectionUtils.isEmpty(limitOrders) || limitOrders.size() < 3) {
            throw new IllegalArgumentException("LimitOrders was empty - check connection to the exchange");
        }
        price =  new BigDecimal(limitOrders.get(0));
        size = new BigDecimal(limitOrders.get(1));
        if (isString(limitOrders.get(2))) {
            orderId = limitOrders.get(2);
            num = new BigDecimal(1);
        } else {
            orderId = null;
            num = new BigDecimal(1);
        }
    }

    public BigDecimal getPrice() {
        return price;
    }

    public BigDecimal getSize() {
        return size;
    }

    public String getOrderId() {
        return orderId;
    }

    public BigDecimal getNum() {
        return num;
    }

    @Override
    public int compareTo(Object o) {
        return this.getPrice().compareTo(((OrderItem)o).getPrice()) * -1;
    }

    public boolean isString(String value) {
        boolean isDecimalSeparatorFound = false;

        for (char c : value.substring( 1 ).toCharArray()) {
            if (!Character.isDigit( c ) ) {
                if (c == '.' && !isDecimalSeparatorFound) {
                    isDecimalSeparatorFound = true;
                    continue;
                }
                return false;
            }
        }
        return true;
    }
}


================================================
FILE: api/src/main/java/com/coinbase/exchange/api/marketdata/Trade.java
================================================
package com.coinbase.exchange.api.marketdata;

import java.math.BigDecimal;
import java.time.Instant;

/**
 * Created by robevansuk on 12/03/2017.
 */
public class Trade {
    Instant time;
    Long trade_id;
    BigDecimal price;
    BigDecimal size;
    String side;

    public Trade() {}

    public Trade(Instant time, Long trade_id, BigDecimal price, BigDecimal size, String side) {
        this.time = time;
        this.trade_id = trade_id;
        this.price = price;
        this.size = size;
        this.side = side;
    }

    public Instant getTime() {
        return time;
    }

    public void setTime(Instant time) {
        this.time = time;
    }

    public Long getTrade_id() {
        return trade_id;
    }

    public void setTrade_id(Long trade_id) {
        this.trade_id = trade_id;
    }

    public BigDecimal getPrice() {
        return price;
    }

    public void setPrice(BigDecimal price) {
        this.price = price;
    }

    public BigDecimal getSize() {
        return size;
    }

    public void setSize(BigDecimal size) {
        this.size = size;
    }

    public String getSide() {
        return side;
    }

    public void setSide(String side) {
        this.side = side;
    }

    public String toString(){
        return side.toUpperCase() + " " + size +"@" + price;
    }
}


================================================
FILE: api/src/main/java/com/coinbase/exchange/api/orders/Order.java
================================================
package com.coinbase.exchange.api.orders;

/**
 * Created by robevansuk on 03/02/2017.
 */
public class Order {
    String id;
    String size;
    String price;
    String product_id;
    String side;
    String stp;
    String type;
    String time_in_force;
    String post_only;
    String created_at;
    String fill_fees;
    String filled_size;
    String executed_value;
    String status;

    public Order() {}

    public Order(String id, String price, String size, String product_id, String side, String stp, String type,
                 String time_in_force, String post_only, String created_at, String fill_fees, String filled_size,
                 String executed_value, String status, Boolean settled) {
        this.id = id;
        this.price = price;
        this.size = size;
        this.product_id = product_id;
        this.side = side;
        this.stp = stp;
        this.type = type;
        this.time_in_force = time_in_force;
        this.post_only = post_only;
        this.created_at = created_at;
        this.fill_fees = fill_fees;
        this.filled_size = filled_size;
        this.executed_value = executed_value;
        this.status = status;
        this.settled = settled;
    }

    Boolean settled;

    public Order(OrderBuilder builder) {
        this.id = builder.getId();
        this.size = builder.getSize();
        this.price = builder.getPrice();
        this.product_id = builder.getProduct_id();
        this.status = builder.getStatus();
        this.filled_size = builder.getFilled_size();
        this.fill_fees = builder.getFill_fees();
        this.settled = builder.getSettled();
        this.side = builder.getSide();
        this.created_at = builder.getCreated_at();
    }

    public String getId() {
        return id;
    }

    public void setId(String id) {
        this.id = id;
    }

    public String getPrice() {
        return price;
    }

    public void setPrice(String price) {
        this.price = price;
    }

    public String getSize() {
        return size;
    }

    public void setSize(String size) {
        this.size = size;
    }

    public String getProduct_id() {
        return product_id;
    }

    public void setProduct_id(String product_id) {
        this.product_id = product_id;
    }

    public String getSide() {
        return side;
    }

    public void setSide(String side) {
        this.side = side;
    }

    public String getStp() {
        return stp;
    }

    public void setStp(String stp) {
        this.stp = stp;
    }

    public String getType() {
        return type;
    }

    public void setType(String type) {
        this.type = type;
    }

    public String getTime_in_force() {
        return time_in_force;
    }

    public void setTime_in_force(String time_in_force) {
        this.time_in_force = time_in_force;
    }

    public String getPost_only() {
        return post_only;
    }

    public void setPost_only(String post_only) {
        this.post_only = post_only;
    }

    public String getCreated_at() {
        return created_at;
    }

    public void setCreated_at(String created_at) {
        this.created_at = created_at;
    }

    public String getFill_fees() {
        return fill_fees;
    }

    public void setFill_fees(String fill_fees) {
        this.fill_fees = fill_fees;
    }

    public String getFilled_size() {
        return filled_size;
    }

    public void setFilled_size(String filled_size) {
        this.filled_size = filled_size;
    }

    public String getExecuted_value() {
        return executed_value;
    }

    public void setExecuted_value(String executed_value) {
        this.executed_value = executed_value;
    }

    public String getStatus() {
        return status;
    }

    public void setStatus(String status) {
        this.status = status;
    }

    public Boolean getSettled() {
        return settled;
    }

    public void setSettled(Boolean settled) {
        this.settled = settled;
    }

    public String toString() {
        String orderString = getSide();
        orderString += ": " + getProduct_id();
        orderString += ": " + getPrice();
        orderString += ": " + getSize();
        return orderString;
    }

}


================================================
FILE: api/src/main/java/com/coinbase/exchange/api/orders/OrderBuilder.java
================================================
package com.coinbase.exchange.api.orders;

/**
 * Created by irufus on 2/18/15.
 */
public class OrderBuilder {

    private String id;
    private String size;
    private String price;
    private String product_id;
    private String status;
    private String filled_size;
    private String fill_fees;
    private String side;
    private String created_at;
    private Boolean settled;

    public OrderBuilder setId(String id) {
        this.id = id;
        return this;
    }

    public OrderBuilder setSize(String size) {
        this.size = size;
        return this;
    }

    public OrderBuilder setPrice(String price) {
        this.price = price;
        return this;
    }

    public OrderBuilder setProduct_id(String product_id) {
        this.product_id = product_id;
        return this;
    }

    public OrderBuilder setStatus(String status) {
        this.status = status;
        return this;
    }

    public OrderBuilder setFilled_size(String filled_size) {
        this.filled_size = filled_size;
        return this;
    }

    public OrderBuilder setFill_fees(String fill_fees) {
        this.fill_fees = fill_fees;
        return this;
    }

    public OrderBuilder setSettled(Boolean settled) {
        this.settled = settled;
        return this;
    }

    public OrderBuilder setSide(String side) {
        this.side = side;
        return this;
    }

    public OrderBuilder setCreated_at(String created_at) {
        this.created_at = created_at;
        return this;
    }

    public String getId() {
        return id;
    }

    public String getSize() {
        return size;
    }

    public String getPrice() {
        return price;
    }

    public String getProduct_id() {
        return product_id;
    }

    public String getStatus() {
        return status;
    }

    public String getFilled_size() {
        return filled_size;
    }

    public String getFill_fees() {
        return fill_fees;
    }

    public Boolean getSettled() {
        return settled;
    }

    public String getSide() {
        return side;
    }

    public String getCreated_at() {
        return created_at;
    }

    public Order build() {
        return new Order(this);
    }
}


================================================
FILE: api/src/main/java/com/coinbase/exchange/api/orders/OrderService.java
================================================
package com.coinbase.exchange.api.orders;

import com.coinbase.exchange.model.Fill;
import com.coinbase.exchange.model.Hold;
import com.coinbase.exchange.model.NewOrderSingle;
import com.coinbase.exchange.api.exchange.CoinbaseExchange;
import org.springframework.core.ParameterizedTypeReference;

import java.util.Arrays;
import java.util.List;

/**
 * Created by robevansuk on 03/02/2017.
 */
public class OrderService {
    public static final String ORDERS_ENDPOINT = "/orders";
    public static final String FILLS_ENDPOINT = "/fills";

    final CoinbaseExchange exchange;

    public OrderService(final CoinbaseExchange exchange) {
        this.exchange = exchange;
    }

    public List<Hold> getHolds(String accountId) {
        return exchange.getAsList(ORDERS_ENDPOINT + "/" + accountId + "/holds", new ParameterizedTypeReference<Hold[]>(){});
    }

    public List<Order> getOpenOrders(String accountId) {
        return exchange.getAsList(ORDERS_ENDPOINT + "/" + accountId + "/orders", new ParameterizedTypeReference<Order[]>(){});
    }

    public Order getOrder(String orderId) {
        return exchange.get(ORDERS_ENDPOINT + "/" + orderId,new ParameterizedTypeReference<Order>(){});
    }

    public Order createOrder(NewOrderSingle order) {
        return exchange.post(ORDERS_ENDPOINT, new ParameterizedTypeReference<Order>(){}, order);
    }

    public String cancelOrder(String orderId) {
        String deleteEndpoint = ORDERS_ENDPOINT + "/" + orderId;
        return exchange.delete(deleteEndpoint, new ParameterizedTypeReference<String>(){});
    }

    public List<Order> getOpenOrders() {
        return exchange.getAsList(ORDERS_ENDPOINT, new ParameterizedTypeReference<Order[]>(){});
    }

    public List<Order> cancelAllOpenOrders() {
        return Arrays.asList(exchange.delete(ORDERS_ENDPOINT, new ParameterizedTypeReference<Order[]>(){}));
    }

    public List<Fill> getFillsByProductId(String product_id, int resultLimit) {
        return exchange.getAsList(FILLS_ENDPOINT + "?product_id=" + product_id + "&limit=" + resultLimit, new ParameterizedTypeReference<Fill[]>(){});
    }
    
    public List<Fill> getFillByOrderId(String order_id, int resultLimit) {
        return exchange.getAsList(FILLS_ENDPOINT + "?order_id=" + order_id + "&limit=" + resultLimit, new ParameterizedTypeReference<Fill[]>(){});
    }
}




================================================
FILE: api/src/main/java/com/coinbase/exchange/api/payments/AccountLimit.java
================================================
package com.coinbase.exchange.api.payments;

/**
 * Created by robevansuk on 16/02/2017.
 */
public class AccountLimit {

    Integer period_in_days;
    Amount total;
    Amount remaining;

    public AccountLimit() {}

    public AccountLimit(Integer period_in_days, Amount total, Amount remaining) {
        this.period_in_days = period_in_days;
        this.total = total;
        this.remaining = remaining;
    }

    public Integer getPeriod_in_days() {
        return period_in_days;
    }

    public void setPeriod_in_days(Integer period_in_days) {
        this.period_in_days = period_in_days;
    }

    public Amount getTotal() {
        return total;
    }

    public void setTotal(Amount total) {
        this.total = total;
    }

    public Amount getRemaining() {
        return remaining;
    }

    public void setRemaining(Amount remaining) {
        this.remaining = remaining;
    }
}


================================================
FILE: api/src/main/java/com/coinbase/exchange/api/payments/Amount.java
================================================
package com.coinbase.exchange.api.payments;

import java.math.BigDecimal;

/**
 * Created by robevansuk on 16/02/2017.
 */
public class Amount {

    BigDecimal amount;
    String currency;

    public Amount() {}

    public Amount(BigDecimal amount, String currency) {
        this.amount = amount;
        this.currency = currency;
    }

    public BigDecimal getAmount() {
        return amount;
    }

    public void setAmount(BigDecimal amount) {
        this.amount = amount;
    }

    public String getCurrency() {
        return currency;
    }

    public void setCurrency(String currency) {
        this.currency = currency;
    }
}


================================================
FILE: api/src/main/java/com/coinbase/exchange/api/payments/BankCountry.java
================================================
package com.coinbase.exchange.api.payments;

/**
 * Created by robevansuk on 16/02/2017.
 */
public class BankCountry {

    String code;
    String name;

    public BankCountry() {}

    public BankCountry(String code, String name) {
        this.code = code;
        this.name = name;
    }

    public String getCode() {
        return code;
    }

    public void setCode(String code) {
        this.code = code;
    }

    public String getName() {
        return name;
    }

    public void setName(String name) {
        this.name = name;
    }
}


================================================
FILE: api/src/main/java/com/coinbase/exchange/api/payments/CoinbaseAccount.java
================================================
package com.coinbase.exchange.api.payments;

import java.math.BigDecimal;

/**
 * Created by robevansuk on 16/02/2017.
 */
public class CoinbaseAccount {

    private String id; //UUID
    private String name;
    private BigDecimal balance;
    private String currency;
    private String type;
    private Boolean primary;
    private Boolean active;
    private DepositInformation wire_deposit_information;
    private SepaDepositInformation sepa_deposit_information;

    public CoinbaseAccount() {}

    public CoinbaseAccount(String id,
                           String name,
                           BigDecimal balance,
                           String currency,
                           String type,
                           Boolean primary,
                           Boolean active,
                           DepositInformation wire_deposit_information,
                           SepaDepositInformation sepa_deposit_information) {
        this.id = id;
        this.name = name;
        this.balance = balance;
        this.currency = currency;
        this.type = type;
        this.primary = primary;
        this.active = active;
        this.wire_deposit_information = wire_deposit_information;
        this.sepa_deposit_information = sepa_deposit_information;
    }

    public String getId() {
        return id;
    }

    public void setId(String id) {
        this.id = id;
    }

    public String getName() {
        return name;
    }

    public void setName(String name) {
        this.name = name;
    }

    public BigDecimal getBalance() {
        return balance;
    }

    public void setBalance(BigDecimal balance) {
        this.balance = balance;
    }

    public String getCurrency() {
        return currency;
    }

    public void setCurrency(String currency) {
        this.currency = currency;
    }

    public String getType() {
        return type;
    }

    public void setType(String type) {
        this.type = type;
    }

    public Boolean getPrimary() {
        return primary;
    }

    public void setPrimary(Boolean primary) {
        this.primary = primary;
    }

    public Boolean getActive() {
        return active;
    }

    public void setActive(Boolean active) {
        this.active = active;
    }

    public DepositInformation getWire_deposit_information() {
        return wire_deposit_information;
    }

    public void setWire_deposit_information(DepositInformation wire_deposit_information) {
        this.wire_deposit_information = wire_deposit_information;
    }

    public SepaDepositInformation getSepa_deposit_information() {
        return sepa_deposit_information;
    }

    public void setSepa_deposit_information(SepaDepositInformation sepa_deposit_information) {
        this.sepa_deposit_information = sepa_deposit_information;
    }
}


================================================
FILE: api/src/main/java/com/coinbase/exchange/api/payments/DepositInformation.java
================================================
package com.coinbase.exchange.api.payments;

/**
 * Created by robevansuk on 16/02/2017.
 */
public class DepositInformation {

    String account_number;
    String routing_number;
    String bank_name;
    String bank_address;
    BankCountry bank_country;
    String account_name;
    String account_address;
    String reference;

    public DepositInformation() {}

    public DepositInformation(String account_number,
                              String routing_number,
                              String bank_name,
                              String bank_address,
                              BankCountry bank_country,
                              String account_name,
                              String account_address,
                              String reference) {
        this.account_number = account_number;
        this.routing_number = routing_number;
        this.bank_name = bank_name;
        this.bank_address = bank_address;
        this.bank_country = bank_country;
        this.account_name = account_name;
        this.account_address = account_address;
        this.reference = reference;
    }

    public String getAccount_number() {
        return account_number;
    }

    public void setAccount_number(String account_number) {
        this.account_number = account_number;
    }

    public String getRouting_number() {
        return routing_number;
    }

    public void setRouting_number(String routing_number) {
        this.routing_number = routing_number;
    }

    public String getBank_name() {
        return bank_name;
    }

    public void setBank_name(String bank_name) {
        this.bank_name = bank_name;
    }

    public String getBank_address() {
        return bank_address;
    }

    public void setBank_address(String bank_address) {
        this.bank_address = bank_address;
    }

    public BankCountry getBank_country() {
        return bank_country;
    }

    public void setBank_country(BankCountry bank_country) {
        this.bank_country = bank_country;
    }

    public String getAccount_name() {
        return account_name;
    }

    public void setAccount_name(String account_name) {
        this.account_name = account_name;
    }

    public String getAccount_address() {
        return account_address;
    }

    public void setAccount_address(String account_address) {
        this.account_address = account_address;
    }

    public String getReference() {
        return reference;
    }

    public void setReference(String reference) {
        this.reference = reference;
    }
}


================================================
FILE: api/src/main/java/com/coinbase/exchange/api/payments/Limit.java
================================================
package com.coinbase.exchange.api.payments;

/**
 * Created by robevansuk on 16/02/2017.
 */
public class Limit {

    AccountLimit[] buy;
    AccountLimit[] instant_buy;
    AccountLimit[] sell;
    AccountLimit[] deposit;

    public Limit() {}

    public Limit(AccountLimit[] buy, AccountLimit[] instant_buy, AccountLimit[] sell, AccountLimit[] deposit) {
        this.buy = buy;
        this.instant_buy = instant_buy;
        this.sell = sell;
        this.deposit = deposit;
    }

    public AccountLimit[] getBuy() {
        return buy;
    }

    public void setBuy(AccountLimit[] buy) {
        this.buy = buy;
    }

    public AccountLimit[] getInstant_buy() {
        return instant_buy;
    }

    public void setInstant_buy(AccountLimit[] instant_buy) {
        this.instant_buy = instant_buy;
    }

    public AccountLimit[] getSell() {
        return sell;
    }

    public void setSell(AccountLimit[] sell) {
        this.sell = sell;
    }

    public AccountLimit[] getDeposit() {
        return deposit;
    }

    public void setDeposit(AccountLimit[] deposit) {
        this.deposit = deposit;
    }
}


================================================
FILE: api/src/main/java/com/coinbase/exchange/api/payments/PaymentService.java
================================================
package com.coinbase.exchange.api.payments;

import com.coinbase.exchange.api.exchange.CoinbaseExchange;
import org.springframework.core.ParameterizedTypeReference;

import java.util.List;

/**
 * Created by robevansuk on 16/02/2017.
 */
public class PaymentService {

    private static final String PAYMENT_METHODS_ENDPOINT = "/payment-methods";
    private static final String COINBASE_ACCOUNTS_ENDPOINT = "/coinbase-accounts";

    final CoinbaseExchange coinbaseExchange;

    public PaymentService(final CoinbaseExchange coinbaseExchange) {
        this.coinbaseExchange = coinbaseExchange;
    }

    public List<PaymentType> getPaymentTypes() {
        return coinbaseExchange.getAsList(PAYMENT_METHODS_ENDPOINT, new ParameterizedTypeReference<PaymentType[]>(){});
    }

    public List<CoinbaseAccount> getCoinbaseAccounts() {
        return coinbaseExchange.getAsList(COINBASE_ACCOUNTS_ENDPOINT, new ParameterizedTypeReference<CoinbaseAccount[]>() {});
    }
}

================================================
FILE: api/src/main/java/com/coinbase/exchange/api/payments/PaymentType.java
================================================
package com.coinbase.exchange.api.payments;

/**
 * Created by robevansuk on 16/02/2017.
 */
public class PaymentType {
    private String id; // UUID
    private String type; // ach_bank_account
    private String name; // Bank of America - eBan... ********7134
    private String currency; // USD
    private Boolean primary_buy;
    private Boolean primary_sell;
    private Boolean allow_buy;
    private Boolean allow_sell;
    private Boolean allow_deposit;
    private Boolean allow_withdraw;
    private Limit limits;

    public PaymentType() {}

    public PaymentType(String id,
                       String type,
                       String name,
                       String currency,
                       Boolean primary_buy,
                       Boolean primary_sell,
                       Boolean allow_buy,
                       Boolean allow_sell,
                       Boolean allow_deposit,
                       Boolean allow_withdraw,
                       Limit limits) {
        this.id = id;
        this.type = type;
        this.name = name;
        this.currency = currency;
        this.primary_buy = primary_buy;
        this.primary_sell = primary_sell;
        this.allow_buy = allow_buy;
        this.allow_sell = allow_sell;
        this.allow_deposit = allow_deposit;
        this.allow_withdraw = allow_withdraw;
        this.limits = limits;
    }

    public String getId() {
        return id;
    }

    public void setId(String id) {
        this.id = id;
    }

    public String getType() {
        return type;
    }

    public void setType(String type) {
        this.type = type;
    }

    public String getName() {
        return name;
    }

    public void setName(String name) {
        this.name = name;
    }

    public String getCurrency() {
        return currency;
    }

    public void setCurrency(String currency) {
        this.currency = currency;
    }

    public Boolean getPrimary_buy() {
        return primary_buy;
    }

    public void setPrimary_buy(Boolean primary_buy) {
        this.primary_buy = primary_buy;
    }

    public Boolean getPrimary_sell() {
        return primary_sell;
    }

    public void setPrimary_sell(Boolean primary_sell) {
        this.primary_sell = primary_sell;
    }

    public Boolean getAllow_buy() {
        return allow_buy;
    }

    public void setAllow_buy(Boolean allow_buy) {
        this.allow_buy = allow_buy;
    }

    public Boolean getAllow_sell() {
        return allow_sell;
    }

    public void setAllow_sell(Boolean allow_sell) {
        this.allow_sell = allow_sell;
    }

    public Boolean getAllow_deposit() {
        return allow_deposit;
    }

    public void setAllow_deposit(Boolean allow_deposit) {
        this.allow_deposit = allow_deposit;
    }

    public Boolean getAllow_withdraw() {
        return allow_withdraw;
    }

    public void setAllow_withdraw(Boolean allow_withdraw) {
        this.allow_withdraw = allow_withdraw;
    }

    public Limit getLimits() {
        return limits;
    }

    public void setLimits(Limit limits) {
        this.limits = limits;
    }
}


================================================
FILE: api/src/main/java/com/coinbase/exchange/api/payments/SepaDepositInformation.java
================================================
package com.coinbase.exchange.api.payments;

/**
 * Created by robevansuk on 16/02/2017.
 */
public class SepaDepositInformation {

    String iban;
    String swift;
    String bank_name;
    String bank_address;
    String bank_country_name;
    String account_name;
    String account_address;
    String reference;

    public SepaDepositInformation() {}

    public SepaDepositInformation(String iban,
                                  String swift,
                                  String bank_name,
                                  String bank_address,
                                  String bank_country_name,
                                  String account_name,
                                  String account_address,
                                  String reference) {
        this.iban = iban;
        this.swift = swift;
        this.bank_name = bank_name;
        this.bank_address = bank_address;
        this.bank_country_name = bank_country_name;
        this.account_name = account_name;
        this.account_address = account_address;
        this.reference = reference;
    }

    public String getIban() {
        return iban;
    }

    public void setIban(String iban) {
        this.iban = iban;
    }

    public String getSwift() {
        return swift;
    }

    public void setSwift(String swift) {
        this.swift = swift;
    }

    public String getBank_name() {
        return bank_name;
    }

    public void setBank_name(String bank_name) {
        this.bank_name = bank_name;
    }

    public String getBank_address() {
        return bank_address;
    }

    public void setBank_address(String bank_address) {
        this.bank_address = bank_address;
    }

    public String getBank_country_name() {
        return bank_country_name;
    }

    public void setBank_country_name(String bank_country_name) {
        this.bank_country_name = bank_country_name;
    }

    public String getAccount_name() {
        return account_name;
    }

    public void setAccount_name(String account_name) {
        this.account_name = account_name;
    }

    public String getAccount_address() {
        return account_address;
    }

    public void setAccount_address(String account_address) {
        this.account_address = account_address;
    }

    public String getReference() {
        return reference;
    }

    public void setReference(String reference) {
        this.reference = reference;
    }
}


================================================
FILE: api/src/main/java/com/coinbase/exchange/api/products/ProductService.java
================================================
package com.coinbase.exchange.api.products;

import com.coinbase.exchange.api.exchange.CoinbaseExchange;
import com.coinbase.exchange.model.Candles;
import com.coinbase.exchange.model.Granularity;
import com.coinbase.exchange.model.Product;
import org.springframework.core.ParameterizedTypeReference;

import java.time.Instant;
import java.time.format.DateTimeFormatter;
import java.time.format.DateTimeFormatterBuilder;
import java.util.HashMap;
import java.util.List;
import java.util.Map;

import static java.util.stream.Collectors.joining;

/**
 * Created by robevansuk on 03/02/2017.
 */
public class ProductService {

    public static final String PRODUCTS_ENDPOINT = "/products";

    final CoinbaseExchange exchange;

    public ProductService(final CoinbaseExchange exchange) {
        this.exchange = exchange;
    }

    // no paged products necessary
    public List<Product> getProducts() {
        return exchange.getAsList(PRODUCTS_ENDPOINT, new ParameterizedTypeReference<Product[]>() {
        });
    }

    public Candles getCandles(String productId) {
        return new Candles(exchange.get(PRODUCTS_ENDPOINT + "/" + productId + "/candles", new ParameterizedTypeReference<List<String[]>>() {
        }));
    }

    public Candles getCandles(String productId, Map<String, String> queryParams) {
        StringBuffer url = new StringBuffer(PRODUCTS_ENDPOINT + "/" + productId + "/candles");
        if (queryParams != null && queryParams.size() != 0) {
            url.append("?");
            url.append(queryParams.entrySet().stream()
                    .map(entry -> entry.getKey() + "=" + entry.getValue())
                    .collect(joining("&")));
        }
        return new Candles(exchange.get(url.toString(), new ParameterizedTypeReference<List<String[]>>() {}));
    }

    /**
     * If either one of the start or end fields are not provided then both fields will be ignored.
     * If a custom time range is not declared then one ending now is selected.
     */
    public Candles getCandles(String productId, Instant startTime, Instant endTime, Granularity granularity) {

        Map<String, String> queryParams = new HashMap<>();

        if (startTime != null) {
            queryParams.put("start", startTime.toString());
        }
        if (endTime != null) {
            queryParams.put("end", endTime.toString());
        }
        if (granularity != null) {
            queryParams.put("granularity", granularity.get());
        }

        return getCandles(productId, queryParams);
    }

    /**
     * The granularity field must be one of the following values: {60, 300, 900, 3600, 21600, 86400}
     */
    public Candles getCandles(String productId, Granularity granularity) {
        return getCandles(productId, null, null, granularity);
    }

    /**
     *  If either one of the start or end fields are not provided then both fields will be ignored.
     */
    public Candles getCandles(String productId, Instant start, Instant end) {
        return getCandles(productId, start, end, null);
    }
}


================================================
FILE: api/src/main/java/com/coinbase/exchange/api/reports/ReportRequest.java
================================================
package com.coinbase.exchange.api.reports;

/**
 * Created by robevansuk on 16/02/2017.
 */
public class ReportRequest {

    String type;
    String start_date;
    String end_date;

    public ReportRequest() {}

    public ReportRequest(String type, String start_date, String end_date) {
        this.type = type;
        this.start_date = start_date;
        this.end_date = end_date;
    }

    public String getType() {
        return type;
    }

    public void setType(String type) {
        this.type = type;
    }

    public String getStart_date() {
        return start_date;
    }

    public void setStart_date(String start_date) {
        this.start_date = start_date;
    }

    public String getEnd_date() {
        return end_date;
    }

    public void setEnd_date(String end_date) {
        this.end_date = end_date;
    }
}


================================================
FILE: api/src/main/java/com/coinbase/exchange/api/reports/ReportResponse.java
================================================
package com.coinbase.exchange.api.reports;

/**
 * Created by robevansuk on 16/02/2017.
 */
public class ReportResponse {

    String id;
    String type;
    String status;
    String created_at;
    String completed_at;
    String expires_at;
    String file_url;
    TimePeriod params;

    public ReportResponse() {}

    public ReportResponse(String id,
                         String type,
                         String status,
                         String created_at,
                         String completed_at,
                         String expires_at,
                         String file_url,
                         TimePeriod params) {
        this.id = id;
        this.type = type;
        this.status = status;
        this.created_at = created_at;
        this.completed_at = completed_at;
        this.expires_at = expires_at;
        this.file_url = file_url;
        this.params = params;
    }

    public String getId() {
        return id;
    }

    public void setId(String id) {
        this.id = id;
    }

    public String getType() {
        return type;
    }

    public void setType(String type) {
        this.type = type;
    }

    public String getStatus() {
        return status;
    }

    public void setStatus(String status) {
        this.status = status;
    }

    public String getCreated_at() {
        return created_at;
    }

    public void setCreated_at(String created_at) {
        this.created_at = created_at;
    }

    public String getCompleted_at() {
        return completed_at;
    }

    public void setCompleted_at(String completed_at) {
        this.completed_at = completed_at;
    }

    public String getExpires_at() {
        return expires_at;
    }

    public void setExpires_at(String expires_at) {
        this.expires_at = expires_at;
    }

    public String getFile_url() {
        return file_url;
    }

    public void setFile_url(String file_url) {
        this.file_url = file_url;
    }

    public TimePeriod getParams() {
        return params;
    }

    public void setParams(TimePeriod params) {
        this.params = params;
    }
}


================================================
FILE: api/src/main/java/com/coinbase/exchange/api/reports/ReportService.java
================================================
package com.coinbase.exchange.api.reports;

import com.coinbase.exchange.api.exchange.CoinbaseExchange;
import org.springframework.core.ParameterizedTypeReference;

/**
 * Created by robevansuk on 16/02/2017.
 */
public class ReportService {

    private static final String REPORTS_ENDPOINT = "/reports";

    final CoinbaseExchange coinbaseExchange;

    public ReportService(final CoinbaseExchange coinbaseExchange) {
        this.coinbaseExchange = coinbaseExchange;
    }

    // TODO untested
    public ReportResponse createReport(String type, String startDate, String endDate){
        ReportRequest reportRequest = new ReportRequest(type, startDate, endDate);
        return coinbaseExchange.post(REPORTS_ENDPOINT, new ParameterizedTypeReference<ReportResponse>(){}, reportRequest);
    }

    // TODO untested
    public ReportResponse getReportStatus(String id) {
        return coinbaseExchange.get(REPORTS_ENDPOINT + "/" + id, new ParameterizedTypeReference<ReportResponse>(){});
    }
}


================================================
FILE: api/src/main/java/com/coinbase/exchange/api/reports/TimePeriod.java
================================================
package com.coinbase.exchange.api.reports;

/**
 * Created by robevansuk on 16/02/2017.
 */
public class TimePeriod {

    String start_date;
    String end_date;

    public TimePeriod() {}

    public TimePeriod(String start_date, String end_date) {
        this.start_date = start_date;
        this.end_date = end_date;
    }

    public String getStart_date() {
        return start_date;
    }

    public void setStart_date(String start_date) {
        this.start_date = start_date;
    }

    public String getEnd_date() {
        return end_date;
    }

    public void setEnd_date(String end_date) {
        this.end_date = end_date;
    }
}


================================================
FILE: api/src/main/java/com/coinbase/exchange/api/transfers/Transfer.java
================================================
package com.coinbase.exchange.api.transfers;

import java.math.BigDecimal;

/**
 * Created by robevansuk on 15/02/2017.
 */
public class Transfer {

    String type; // deposit/withdraw
    BigDecimal amount;
    String coinbase_account_id;

    public Transfer() {}

    public Transfer(String type, BigDecimal amount, String coinbase_account_id) {
        this.type = type;
        this.amount = amount;
        this.coinbase_account_id = coinbase_account_id;
    }

    public String getType() {
        return type;
    }

    public void setType(String type) {
        this.type = type;
    }

    public BigDecimal getAmount() {
        return amount;
    }

    public void setAmount(BigDecimal amount) {
        this.amount = amount;
    }

    public String getCoinbase_account_id() {
        return coinbase_account_id;
    }

    public void setCoinbase_account_id(String coinbase_account_id) {
        this.coinbase_account_id = coinbase_account_id;
    }
}


================================================
FILE: api/src/main/java/com/coinbase/exchange/api/transfers/TransferService.java
================================================
package com.coinbase.exchange.api.transfers;

import com.coinbase.exchange.api.exchange.CoinbaseExchange;
import org.springframework.core.ParameterizedTypeReference;

import java.math.BigDecimal;

/**
 * This class is best used in conjunction with the coinbase library
 * to get the coinbase account Id's. see: https://github.com/coinbase/coinbase-java
 *
 * Created by robevansuk on 15/02/2017.
 */
public class TransferService {

    static final String TRANSFER_ENDPOINT = "/transfers";

    final CoinbaseExchange coinbaseExchange;

    public TransferService(final CoinbaseExchange coinbaseExchange) {
        this.coinbaseExchange = coinbaseExchange;
    }

    /**
     * TODO untested due to lack of a coinbaseaccountID to test with.
     * @param type
     * @param amount
     * @param coinbaseAccountId
     * @return
     */
    public String transfer(String type, BigDecimal amount, String coinbaseAccountId) {
        return coinbaseExchange.post(TRANSFER_ENDPOINT,
                new ParameterizedTypeReference<String>(){},
                new Transfer(type, amount, coinbaseAccountId));
    }

}


================================================
FILE: api/src/main/java/com/coinbase/exchange/api/useraccount/UserAccountData.java
================================================
package com.coinbase.exchange.api.useraccount;

import java.math.BigDecimal;

/**
 * Created by robevansuk on 17/02/2017.
 */
public class UserAccountData {

    String product_id;
    BigDecimal exchange_volume;
    BigDecimal volume;
    String recorded_at;

    public UserAccountData() {}

    public UserAccountData(String product_id, BigDecimal exchange_volume, BigDecimal volume, String recorded_at) {
        this.product_id = product_id;
        this.exchange_volume = exchange_volume;
        this.volume = volume;
        this.recorded_at = recorded_at;
    }

    public String getProduct_id() {
        return product_id;
    }

    public void setProduct_id(String product_id) {
        this.product_id = product_id;
    }

    public BigDecimal getExchange_volume() {
        return exchange_volume;
    }

    public void setExchange_volume(BigDecimal exchange_volume) {
        this.exchange_volume = exchange_volume;
    }

    public BigDecimal getVolume() {
        return volume;
    }

    public void setVolume(BigDecimal volume) {
        this.volume = volume;
    }

    public String getRecorded_at() {
        return recorded_at;
    }

    public void setRecorded_at(String recorded_at) {
        this.recorded_at = recorded_at;
    }
}


================================================
FILE: api/src/main/java/com/coinbase/exchange/api/useraccount/UserAccountService.java
================================================
package com.coinbase.exchange.api.useraccount;

import com.coinbase.exchange.api.exchange.CoinbaseExchange;
import org.springframework.core.ParameterizedTypeReference;

import java.util.List;

/**
 * Created by robevansuk on 17/02/2017.
 */
public class UserAccountService {

    private static final String USER_ACCOUNT_ENDPOINT = "/users/self/trailing-volume";

    final CoinbaseExchange coinbaseExchange;

    public UserAccountService(final CoinbaseExchange coinbaseExchange) {
        this.coinbaseExchange = coinbaseExchange;
    }

    /**
     * Returns the 30 day trailing volume information from all accounts
     * @return UserAccountData
     */
    public List<UserAccountData> getTrailingVolume(){
        return coinbaseExchange.getAsList(USER_ACCOUNT_ENDPOINT, new ParameterizedTypeReference<UserAccountData[]>() {});
    }
}


================================================
FILE: api/src/main/java/com/coinbase/exchange/api/withdrawals/WithdrawalsService.java
================================================
package com.coinbase.exchange.api.withdrawals;

import com.coinbase.exchange.api.exchange.CoinbaseExchange;
import com.coinbase.exchange.model.CoinbasePaymentRequest;
import com.coinbase.exchange.model.CryptoPaymentRequest;
import com.coinbase.exchange.model.MonetaryRequest;
import com.coinbase.exchange.model.PaymentRequest;
import com.coinbase.exchange.model.PaymentResponse;
import org.springframework.core.ParameterizedTypeReference;

import java.math.BigDecimal;
import java.math.RoundingMode;

/**
 * Created by robevansuk on 16/02/2017.
 */
public class WithdrawalsService {

    private static final String WITHDRAWALS_ENDPOINT = "/withdrawals";
    private static final String PAYMENT_METHOD = "/payment-method";
    private static final String COINBASE = "/coinbase-account";
    private static final String CRYPTO = "/crypto";

    final CoinbaseExchange coinbaseExchange;

    public WithdrawalsService(final CoinbaseExchange coinbaseExchange) {
        this.coinbaseExchange = coinbaseExchange;
    }

    public PaymentResponse makeWithdrawalToPaymentMethod(BigDecimal amount, String currency, String paymentMethodId) {
        PaymentRequest request = new PaymentRequest(amount, currency, paymentMethodId);
        return makeWithdrawal(request, PAYMENT_METHOD);
    }

    // TODO untested - needs coinbase account ID to work.
    public PaymentResponse makeWithdrawalToCoinbase(BigDecimal amount, String currency, String coinbaseAccountId) {
        CoinbasePaymentRequest request = new CoinbasePaymentRequest(amount.setScale(8, RoundingMode.HALF_DOWN), currency, coinbaseAccountId);
        return makeWithdrawal(request, COINBASE);
    }

    // TODO untested - needs a crypto currency account address
    public PaymentResponse makeWithdrawalToCryptoAccount(BigDecimal amount, String currency, String cryptoAccountAddress) {
        CryptoPaymentRequest request = new CryptoPaymentRequest(amount.setScale(8, RoundingMode.HALF_DOWN), currency, cryptoAccountAddress);
        return makeWithdrawal(request, CRYPTO);
    }


    private PaymentResponse makeWithdrawal(MonetaryRequest request, String withdrawalType) {
        return coinbaseExchange.post(WITHDRAWALS_ENDPOINT+ withdrawalType,
                new ParameterizedTypeReference<PaymentResponse>() {},
                request);
    }
}


================================================
FILE: api/src/test/java/com/coinbase/exchange/api/BaseIntegrationTest.java
================================================
package com.coinbase.exchange.api;

import com.coinbase.exchange.api.exchange.CoinbaseExchange;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.boot.test.context.SpringBootTest;

/**
 * This is an integration test. Tests extending this class should be
 * run it against the Coinbase Pro sandbox API. To do this you will need
 * to provide credentials in resources/application-test.yml
 *
 * Created by robevansuk on 20/01/2017.
 */
@SpringBootTest(properties = {
                    "spring.profiles.active=test"
                })
public abstract class BaseIntegrationTest {

    @Autowired
    public CoinbaseExchange exchange;
}


================================================
FILE: api/src/test/java/com/coinbase/exchange/api/TestExchangeApplication.java
================================================
package com.coinbase.exchange.api;

import org.springframework.boot.SpringApplication;
import org.springframework.boot.autoconfigure.SpringBootApplication;

/**
 * The main codebase is a library. In order to test it we can
 * instantiate a spring boot application that will wire in the various
 * config from application-test.yaml properties and connect to the exchange.
 * This makes running integration tests relatively simple.
 */
@SpringBootApplication
public class TestExchangeApplication {

    public static void main(String[] args) {
        SpringApplication.run(TestExchangeApplication.class, args);
    }

}


================================================
FILE: api/src/test/java/com/coinbase/exchange/api/accounts/AccountsIntegrationTest.java
================================================
package com.coinbase.exchange.api.accounts;

import com.coinbase.exchange.api.BaseIntegrationTest;
import com.coinbase.exchange.api.config.IntegrationTestConfiguration;
import com.coinbase.exchange.model.Hold;
import org.junit.jupiter.api.BeforeEach;
import org.junit.jupiter.api.Test;
import org.junit.jupiter.api.extension.ExtendWith;
import org.springframework.context.annotation.Import;
import org.springframework.test.context.junit.jupiter.SpringExtension;

import java.util.List;

import static org.junit.jupiter.api.Assertions.assertNotNull;
import static org.junit.jupiter.api.Assertions.assertTrue;

/**
 * See class doc for BaseIntegrationTest
 *
 * Created by robevansuk on 03/02/2017.
 */
@ExtendWith(SpringExtension.class)
@Import({IntegrationTestConfiguration.class})
public class AccountsIntegrationTest extends BaseIntegrationTest {

    AccountService accountService;

    @BeforeEach
    void setUp() {
        this.accountService = new AccountService(exchange);
    }

    @Test
    public void canGetAccounts() {
        List<Account> accounts  = accountService.getAccounts();
        assertNotNull(accounts);
    }

    @Test
    public void getAccount() {
        List<Account> accounts  = accountService.getAccounts();
        Account account = accountService.getAccount(accounts.get(0).getId());
        assertNotNull(account);
    }

    @Test
    public void canGetAccountHistory() {
        List<Account> accounts = accountService.getAccounts();
        List<AccountHistory> history = accountService.getAccountHistory(accounts.get(0).getId());
        assertNotNull(history); // anything but null/error.
    }

    @Test
    public void canGetAccountHolds() {
        List<Account> accounts = accountService.getAccounts();
        List<Hold> holds = accountService.getHolds(accounts.get(0).getId());
        assertNotNull(holds);
        // only check the holds if they exist
        if (holds.size()>0) {
            assertTrue(holds.get(0).getAmount().floatValue() >= 0.0f);
        }
    }

    /**
     * note that for paged requests the before param takes precedence
     * only if before is null and after is not-null will the after param be inserted.
     */
    @Test
    public void canGetPagedAccountHistory() {
        List<Account> accounts = accountService.getAccounts();
        assertTrue(accounts.size() > 0);
        String beforeOrAfter = "before";
        int pageNumber = 1;
        int limit = 5;
        List<AccountHistory> firstPageAccountHistory = accountService.getPagedAccountHistory(accounts.get(0).getId(),
                beforeOrAfter, pageNumber, limit);
        assertNotNull(firstPageAccountHistory);
        assertTrue(firstPageAccountHistory.size() <= limit);
    }

    @Test
    public void canGetPagedHolds() {
        List<Account> accounts = accountService.getAccounts();

        assertTrue(accounts!=null);
        assertTrue(accounts.size() > 0);

        String beforeOrAfter = "after";
        int pageNumber = 1;
        int limit = 5;

        List<Hold> firstPageOfHolds = accountService.getPagedHolds(accounts.get(0).getId(),
                beforeOrAfter,
                pageNumber,
                limit);

        assertNotNull(firstPageOfHolds);
        assertTrue(firstPageOfHolds.size() <= limit);
    }
}


================================================
FILE: api/src/test/java/com/coinbase/exchange/api/accounts/DepositIntegrationTest.java
================================================
package com.coinbase.exchange.api.accounts;

import com.coinbase.exchange.api.BaseIntegrationTest;
import com.coinbase.exchange.api.config.IntegrationTestConfiguration;
import com.coinbase.exchange.api.deposits.DepositService;
import com.coinbase.exchange.api.payments.CoinbaseAccount;
import com.coinbase.exchange.api.payments.PaymentService;
import com.coinbase.exchange.model.PaymentResponse;
import org.junit.Ignore;
import org.junit.jupiter.api.BeforeEach;
import org.junit.jupiter.api.Test;
import org.junit.jupiter.api.extension.ExtendWith;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.context.annotation.Import;
import org.springframework.test.context.junit.jupiter.SpringExtension;

import java.math.BigDecimal;
import java.util.List;

import static org.junit.jupiter.api.Assertions.assertEquals;
import static org.junit.jupiter.api.Assertions.assertNotNull;
import static org.junit.jupiter.api.Assertions.assertTrue;

/**
 * See class doc for BaseIntegrationTest
 */
@ExtendWith(SpringExtension.class)
@Import({IntegrationTestConfiguration.class})
@Ignore
public class DepositIntegrationTest extends BaseIntegrationTest {
    private final static Logger log = LoggerFactory.getLogger(DepositIntegrationTest.class);

    PaymentService paymentService;
    AccountService accountService;
    DepositService testee;

    @BeforeEach
    void setUp() {
        this.paymentService = new PaymentService(exchange);
        this.accountService = new AccountService(exchange);
        this.testee = new DepositService(exchange);
    }

    @Test
    public void depositToGDAXExchangeFromCoinbase(){
        // given
        List<CoinbaseAccount> coinbaseAccountList = paymentService.getCoinbaseAccounts();
        assertTrue(coinbaseAccountList.size() > 0);
        List<Account> gdaxAccountList = accountService.getAccounts();
        assertTrue(gdaxAccountList.size() > 0);
        CoinbaseAccount coinbaseAccount = getCoinbaseAccount(coinbaseAccountList);
        Account gdaxAccount = getAccount(gdaxAccountList);
        log.info("Testing depositToGDAXExchangeFromCoinbase with " + coinbaseAccount.getId());

        BigDecimal initGDAXValue = gdaxAccount.getBalance();
        BigDecimal depositAmount = new BigDecimal(100);

        PaymentResponse response = testee.depositViaCoinbase(depositAmount, coinbaseAccount.getCurrency(), coinbaseAccount.getId());
        log.info("Returned: " + response.getId());

        // when
        gdaxAccount = accountService.getAccount(gdaxAccount.getId());

        // then
        assertEquals(0, initGDAXValue.add(depositAmount).compareTo(gdaxAccount.getBalance()));
    }

    private Account getAccount(List<Account> gdaxAccountList) {
        Account gdaxAccount = null;
        for(Account account: gdaxAccountList){
            if(account.getCurrency().equalsIgnoreCase("USD")){
                gdaxAccount = account;
                break;
            }
        }
        assertNotNull(gdaxAccount);
        return gdaxAccount;
    }

    private CoinbaseAccount getCoinbaseAccount(List<CoinbaseAccount> coinbaseAccountList) {
        CoinbaseAccount coinbaseAccount = null;
        for(CoinbaseAccount account : coinbaseAccountList){
            if(account.getCurrency().equalsIgnoreCase("USD")){
                coinbaseAccount = account;
                break;
            }
        }
        assertNotNull(coinbaseAccount);
        return coinbaseAccount;
    }
}


================================================
FILE: api/src/test/java/com/coinbase/exchange/api/accounts/UserAccountServiceIntegrationTest.java
================================================
package com.coinbase.exchange.api.accounts;

import com.coinbase.exchange.api.BaseIntegrationTest;
import com.coinbase.exchange.api.config.IntegrationTestConfiguration;
import com.coinbase.exchange.api.useraccount.UserAccountData;
import com.coinbase.exchange.api.useraccount.UserAccountService;
import org.junit.jupiter.api.BeforeEach;
import org.junit.jupiter.api.Test;
import org.junit.jupiter.api.extension.ExtendWith;
import org.springframework.context.annotation.Import;
import org.springframework.test.context.junit.jupiter.SpringExtension;

import java.util.List;

import static org.junit.jupiter.api.Assertions.assertNotNull;

/**
 * See class doc for BaseIntegrationTest
 */
@ExtendWith(SpringExtension.class)
@Import({IntegrationTestConfiguration.class})
public class UserAccountServiceIntegrationTest extends BaseIntegrationTest {

    UserAccountService userAccountService;

    @BeforeEach
    void setUp() {
        this.userAccountService = new UserAccountService(exchange);
    }

    /**
     * Trailing volume could be empty so all we have to do is make sure it's not returning null
     */
    @Test
    public void getTrailingVolume(){
        List<UserAccountData> data = userAccountService.getTrailingVolume();
        assertNotNull(data);
    }
}


================================================
FILE: api/src/test/java/com/coinbase/exchange/api/accounts/WithdrawalIntegrationTest.java
================================================
package com.coinbase.exchange.api.accounts;

import com.coinbase.exchange.api.BaseIntegrationTest;
import com.coinbase.exchange.api.config.IntegrationTestConfiguration;
import com.coinbase.exchange.api.payments.CoinbaseAccount;
import com.coinbase.exchange.api.payments.PaymentService;
import com.coinbase.exchange.api.payments.PaymentType;
import com.coinbase.exchange.api.withdrawals.WithdrawalsService;
import com.coinbase.exchange.model.PaymentResponse;
import org.junit.Ignore;
import org.junit.jupiter.api.BeforeEach;
import org.junit.jupiter.api.Test;
import org.junit.jupiter.api.extension.ExtendWith;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.context.annotation.Import;
import org.springframework.test.context.junit.jupiter.SpringExtension;

import java.math.BigDecimal;
import java.util.List;

import static org.junit.jupiter.api.Assertions.assertEquals;
import static org.junit.jupiter.api.Assertions.assertNotNull;
import static org.junit.jupiter.api.Assertions.assertTrue;

/**
 * See class doc for BaseIntegrationTest
 */
@ExtendWith(SpringExtension.class)
@Import({IntegrationTestConfiguration.class})
@Ignore
public class WithdrawalIntegrationTest extends BaseIntegrationTest {

    private final static Logger log  = LoggerFactory.getLogger(WithdrawalIntegrationTest.class);

    PaymentService paymentService;
    WithdrawalsService withdrawalsService;
    AccountService accountService;

    @BeforeEach
    void setUp() {
        this.paymentService = new PaymentService(exchange);
        this.withdrawalsService = new WithdrawalsService(exchange);
        this.accountService = new AccountService(exchange);
    }

    @Test
    public void withdrawToCoinbaseAccount(){
        List<Account> gdaxAccounts = accountService.getAccounts();
        List<PaymentType> paymentTypes = paymentService.getPaymentTypes();
        List<CoinbaseAccount> coinbaseAccounts = paymentService.getCoinbaseAccounts();
        assertTrue(paymentTypes.size() > 0);

        PaymentType mainType = getUsdPaymentType(paymentTypes);
        Account gdaxAccount = getUsdAccount(gdaxAccounts);
        CoinbaseAccount account = getUsdCoinbaseAccount(coinbaseAccounts);

        log.info("Testing withdrawToPayment with " + mainType.getId());

        BigDecimal gdaxUSDValue = gdaxAccount.getBalance();
        BigDecimal withdrawAmount = new BigDecimal(100);
        PaymentResponse response = withdrawalsService.makeWithdrawalToCoinbase(withdrawAmount, mainType.getCurrency(), account.getId());
        assertTrue(response.getId().length() > 0 && response.getAmount().compareTo(withdrawAmount) == 0);
        log.info("Returned: " + response.getId());
        gdaxAccount = accountService.getAccount(gdaxAccount.getId());
        assertEquals(0, gdaxUSDValue.subtract(withdrawAmount).compareTo(gdaxAccount.getBalance()));
    }

    private CoinbaseAccount getUsdCoinbaseAccount(List<CoinbaseAccount> coinbaseAccounts) {
        CoinbaseAccount account = null;
        for(CoinbaseAccount coinbaseAccount : coinbaseAccounts){
            if(coinbaseAccount.getCurrency().equalsIgnoreCase("USD")){
                account = coinbaseAccount;
            }
        }
        assertNotNull(account);
        return account;
    }

    private Account getUsdAccount(List<Account> gdaxAccounts) {
        Account gdaxAccount = null;
        for(Account account : gdaxAccounts){
            if(account.getCurrency().equalsIgnoreCase("USD")){
                gdaxAccount = account;
                break;
            }
        }
        assertNotNull(gdaxAccount);
        return gdaxAccount;
    }

    private PaymentType getUsdPaymentType(List<PaymentType> paymentTypes) {
        PaymentType mainType = null;
        for(PaymentType paymentType : paymentTypes){
           if(paymentType.getCurrency().equalsIgnoreCase("USD")){
               mainType = paymentType;
               break;
           }
        }
        assertNotNull(mainType);
        return mainType;
    }
}


================================================
FILE: api/src/test/java/com/coinbase/exchange/api/authentication/AuthenticationIntegrationIntegrationTest.java
================================================
package com.coinbase.exchange.api.authentication;

import com.coinbase.exchange.api.BaseIntegrationTest;
import com.coinbase.exchange.api.accounts.Account;
import com.coinbase.exchange.api.accounts.AccountService;
import com.coinbase.exchange.api.config.IntegrationTestConfiguration;
import org.junit.jupiter.api.BeforeEach;
import org.junit.jupiter.api.Test;
import org.junit.jupiter.api.extension.ExtendWith;
import org.springframework.context.annotation.Import;
import org.springframework.test.context.junit.jupiter.SpringExtension;

import java.util.List;

import static org.junit.jupiter.api.Assertions.assertNotNull;
import static org.junit.jupiter.api.Assertions.assertTrue;

/**
 * See class doc for BaseIntegrationTest
 *
 * Created by irufus (sakamura@gmail.com)
 * @Description The primary function of this class is to run through basic tests for the Authentication and GdaxExchange classes
 */
@ExtendWith(SpringExtension.class)
@Import({IntegrationTestConfiguration.class})
public class AuthenticationIntegrationIntegrationTest extends BaseIntegrationTest {

    AccountService accountService;

    @BeforeEach
    void setUp() {
        accountService = new AccountService(exchange);
    }

    // ensure a basic request can be made. Not a great test. Improve.
    @Test
    public void simpleAuthenticationTest(){
        List<Account> accounts = accountService.getAccounts();
        assertNotNull(accounts);
        assertTrue(accounts.size() > 0);
    }

}


================================================
FILE: api/src/test/java/com/coinbase/exchange/api/config/IntegrationTestConfiguration.java
================================================
package com.coinbase.exchange.api.config;

import com.coinbase.exchange.api.exchange.CoinbaseExchange;
import com.coinbase.exchange.api.exchange.CoinbaseExchangeImpl;
import com.coinbase.exchange.security.Signature;
import com.fasterxml.jackson.databind.ObjectMapper;
import com.fasterxml.jackson.datatype.jsr310.JavaTimeModule;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.boot.SpringBootConfiguration;
import org.springframework.context.annotation.Bean;

@SpringBootConfiguration
public class IntegrationTestConfiguration {

    @Bean
    public ObjectMapper objectMapper() {
        return new ObjectMapper().registerModule(new JavaTimeModule());
    }

    @Bean
    public CoinbaseExchange coinbaseExchange(@Value("${exchange.key}") String apiKey,
                                             @Value("${exchange.passphrase}") String passphrase,
                                             @Value("${exchange.api.baseUrl}") String baseUrl,
                                             @Value("${exchange.secret}") String secretKey,
                                             ObjectMapper objectMapper) {
        return new CoinbaseExchangeImpl(apiKey,
                passphrase,
                baseUrl,
                new Signature(secretKey),
                objectMapper);
    }

}


================================================
FILE: api/src/test/java/com/coinbase/exchange/api/marketdata/MarketDataIntegrationTest.java
================================================
package com.coinbase.exchange.api.marketdata;

import com.coinbase.exchange.api.BaseIntegrationTest;
import com.coinbase.exchange.api.config.IntegrationTestConfiguration;
import com.coinbase.exchange.api.products.ProductService;
import com.coinbase.exchange.model.Product;
import org.junit.jupiter.api.BeforeEach;
import org.junit.jupiter.api.Test;
import org.junit.jupiter.api.extension.ExtendWith;
import org.springframework.context.annotation.Import;
import org.springframework.test.context.junit.jupiter.SpringExtension;

import java.util.List;

import static org.junit.jupiter.api.Assertions.assertNotNull;
import static org.junit.jupiter.api.Assertions.assertTrue;

/**
 * See class doc for BaseIntegrationTest
 *
 * Created by robevansuk on 14/02/2017.
 */
@ExtendWith(SpringExtension.class)
@Import({IntegrationTestConfiguration.class})
public class MarketDataIntegrationTest extends BaseIntegrationTest {

    ProductService productService;
    MarketDataService testee;

    @BeforeEach
    void setUp() {
        productService = new ProductService(exchange);
        testee = new MarketDataService(exchange);
    }

    @Test
    public void canGetMarketDataForLevelOneBidAndAsk() {
        MarketData marketData = testee.getMarketDataOrderBook("BTC-GBP", 1);
        System.out.println(marketData);
        assertTrue(marketData.getSequence() > 0);
    }

    @Test
    public void canGetMarketDataForLevelTwoBidAndAsk() {
        MarketData marketData = testee.getMarketDataOrderBook("BTC-GBP", 2);
        System.out.println(marketData);
        assertTrue(marketData.getSequence() > 0);
    }

    /**
     * note that the returned results are slightly different for level 3. For level 3 you will see an
     * order Id rather than the count of orders at a certain price.
     */
    @Test
    public void canGetMarketDataForLevelThreeBidAndAsk() {
        MarketData marketData = testee.getMarketDataOrderBook("BTC-GBP", 3);
        System.out.println(marketData);
        assertTrue(marketData.getSequence() > 0);
    }

    @Test
    public void canGetLevel1DataForAllProducts(){
        List<Product> products = productService.getProducts();
        for(Product product : products){
            System.out.print("\nTesting: " + product.getId());
            MarketData data = testee.getMarketDataOrderBook(product.getId(), 1);
            assertNotNull(data);

            if(data.getBids().size() > 0 && data.getAsks().size() > 0) {
                System.out.print(" B: " + data.getBids().get(0).getPrice() + " A: " + data.getAsks().get(0).getPrice());
            } else {
                System.out.print(" NO DATA ");
            }
            try {
                Thread.sleep(1000);
            } catch (InterruptedException e) {
                e.printStackTrace();
            }
        }
    }
}


================================================
FILE: api/src/test/java/com/coinbase/exchange/api/marketdata/OrderItemDeserializerTest.java
================================================
package com.coinbase.exchange.api.marketdata;

import com.fasterxml.jackson.databind.ObjectMapper;
import org.junit.jupiter.api.Test;

import java.io.IOException;

import static org.junit.jupiter.api.Assertions.assertEquals;

/**
 * Created by ren7881 on 20/03/2017.
 */
public class OrderItemDeserializerTest {

    private ObjectMapper mapper = new ObjectMapper();

    /**
     * This is now out of date - the api delivers a list of strings - amount, price, order Id. NOT number of orders as this test shows.
     * @throws IOException
     */
    @Test
    public void testDesirialization() throws IOException {
        String test = "{\n" +
                "    \"sequence\": \"3\",\n" +
                "    \"bids\": [\n" +
                "        [ \"111.96\", \"2.11111\", 3 ],\n" +
                "        [ \"295.96\", \"4.39088265\", 2 ]\n" +
                "    ],\n" +
                "    \"asks\": [\n" +
                "        [ \"555.97\", \"66.5656565\", 10 ],\n" +
                "        [ \"295.97\", \"25.23542881\", 12 ]\n" +
                "    ]\n" +
                "}";

        MarketData marketData = mapper.readValue(test, MarketData.class);
        assertEquals(marketData.getAsks().size(), 2);
        assertEquals(marketData.getBids().size(), 2);
        assertEquals(marketData.getSequence(), 3L);
    }
}

================================================
FILE: api/src/test/java/com/coinbase/exchange/api/orders/OrderIntegrationTest.java
================================================
package com.coinbase.exchange.api.orders;

import com.coinbase.exchange.api.BaseIntegrationTest;
import com.coinbase.exchange.api.accounts.Account;
import com.coinbase.exchange.api.accounts.AccountService;
import com.coinbase.exchange.api.config.IntegrationTestConfiguration;
import com.coinbase.exchange.api.marketdata.MarketData;
import com.coinbase.exchange.api.marketdata.MarketDataService;
import com.coinbase.exchange.api.products.ProductService;
import com.coinbase.exchange.model.Fill;
import com.coinbase.exchange.model.NewLimitOrderSingle;
import com.coinbase.exchange.model.NewMarketOrderSingle;
import org.junit.Ignore;
import org.junit.jupiter.api.BeforeEach;
import org.junit.jupiter.api.Test;
import org.junit.jupiter.api.extension.ExtendWith;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.context.annotation.Import;
import org.springframework.test.context.junit.jupiter.SpringExtension;

import java.math.BigDecimal;
import java.math.RoundingMode;
import java.util.List;
import java.util.Optional;

import static org.junit.jupiter.api.Assertions.assertEquals;
import static org.junit.jupiter.api.Assertions.assertNotNull;
import static org.junit.jupiter.api.Assertions.assertTrue;

/**
 * See class doc for BaseIntegrationTest
 *
 * Created by Ishmael (sakamura@gmail.com) on 6/18/2016.
 */
@ExtendWith(SpringExtension.class)
@Import({IntegrationTestConfiguration.class})
public class OrderIntegrationTest extends BaseIntegrationTest {

    private static final Logger log = LoggerFactory.getLogger(OrderIntegrationTest.class);

    ProductService productService;
    AccountService accountService;
    MarketDataService marketDataService;

    OrderService testee;

    // accounts: BTC, USD, GBP, EUR, CAD
    // products: BTC-USD, BTC-GBP, BTC-EUR, ETH-BTC, ETH-USD, LTC-BTC, LTC-USD


    @BeforeEach
    void setUp() {
        this.productService = new ProductService(exchange);
        this.accountService = new AccountService(exchange);
        this.marketDataService = new MarketDataService(exchange);
        this.testee = new OrderService(exchange);
    }

    /**
     * Test is too complex. This test tests placing an order and
     * then cancelling it without leaving a mess.
     * Note: You'll need credit available in your test account
     */
    @Ignore
    public void canMakeLimitOrderAndGetTheOrderAndCancelIt() {
        List<Account> accounts = accountService.getAccounts();
        Optional<Account> accountsWithMoreThanZeroCoinsAvailable = accounts.stream()
                .filter(account -> account.getBalance().compareTo(BigDecimal.ONE) > 0 && account.getCurrency().contains("BTC"))
                .findFirst();

        assertTrue(accountsWithMoreThanZeroCoinsAvailable.isPresent());

        String productId;
        if (accountsWithMoreThanZeroCoinsAvailable.get().getCurrency().equals("BTC")) {
            productId = accountsWithMoreThanZeroCoinsAvailable.get().getCurrency() + "-USD";
        } else {
            productId = accountsWithMoreThanZeroCoinsAvailable.get().getCurrency() + "-BTC";
        }

        MarketData marketData = getMarketDataOrderBook(productId);

        assertNotNull(marketData);

        BigDecimal price = getAskPrice(marketData).setScale(8, RoundingMode.HALF_UP);
        BigDecimal size = new BigDecimal("0.01").setScale(8, RoundingMode.HALF_UP);

        NewLimitOrderSingle limitOrder = getNewLimitOrderSingle(productId, price, size);

        Order order = testee.createOrder(limitOrder);

        assertNotNull(order);
        assertEquals(productId, order.getProduct_id());
        assertEquals(size, new BigDecimal(order.getSize()).setScale(8, RoundingMode.HALF_UP));
        assertEquals(price, new BigDecimal(order.getPrice()).setScale(8, RoundingMode.HALF_UP));
        assertEquals("limit", order.getType());

        testee.cancelOrder(order.getId());
        List<Order> orders = testee.getOpenOrders();
        orders.stream().forEach(o -> assertTrue(o.getId() != order.getId()));
    }

    @Test
    public void cancelAllOrders() {
        List<Order> cancelledOrders = testee.cancelAllOpenOrders();
        assertTrue(cancelledOrders.size() >= 0);
    }

    @Test
    public void getAllOpenOrders() {
        List<Order> openOrders = testee.getOpenOrders();
        assertTrue(openOrders.size() >= 0);
    }

    @Test
    public void getFillsByProductId() {
        List<Fill> fills = testee.getFillsByProductId("BTC-USD", 100);
        assertTrue(fills.size() >= 0);
    }

    @Ignore
    public void shouldGetFilledByOrderIdWhenMakingMarketOrderBuy() {
        NewMarketOrderSingle marketOrder = createNewMarketOrder("BTC-USD", "buy", new BigDecimal(0.01));
        Order order = testee.createOrder(marketOrder);

        List<Fill> fills = testee.getFillByOrderId(order.getId(), 100);

        assertEquals(1, fills.size());
    }

    @Ignore
    public void createMarketOrderBuy() {
        NewMarketOrderSingle marketOrder = createNewMarketOrder("BTC-USD", "buy", new BigDecimal(0.01));
        Order order = testee.createOrder(marketOrder);

        assertNotNull(order); //make sure we created an order
        String orderId = order.getId();
        assertTrue(orderId.length() > 0); //ensure we have an actual orderId
        Order filledOrder = testee.getOrder(orderId);
        assertNotNull(filledOrder); //ensure our order hit the system
        assertTrue(new BigDecimal(filledOrder.getSize()).compareTo(BigDecimal.ZERO) > 0); //ensure we got a fill
        log.info("Order opened and filled: " + filledOrder.getSize() + " @ " + filledOrder.getExecuted_value()
                + " at the cost of " + filledOrder.getFill_fees());
    }

    @Ignore
    public void createMarketOrderSell() {
        NewMarketOrderSingle marketOrder = createNewMarketOrder("BTC-USD", "sell", new BigDecimal(0.01));
        Order order = testee.createOrder(marketOrder);
        assertNotNull(order); //make sure we created an order
        String orderId = order.getId();
        assertTrue(orderId.length() > 0); //ensure we have an actual orderId
        Order filledOrder = testee.getOrder(orderId);
        assertNotNull(filledOrder); //ensure our order hit the system
        assertTrue(new BigDecimal(filledOrder.getSize()).compareTo(BigDecimal.ZERO) > 0); //ensure we got a fill
        log.info("Order opened and filled: " + filledOrder.getSize() + " @ " + filledOrder.getExecuted_value()
                + " at the cost of " + filledOrder.getFill_fees());
    }

    private NewMarketOrderSingle createNewMarketOrder(String product, String action, BigDecimal size) {
        NewMarketOrderSingle marketOrder = new NewMarketOrderSingle();
        marketOrder.setProduct_id(product);
        marketOrder.setSide(action);
        marketOrder.setSize(size);
        return marketOrder;
    }

    private MarketData getMarketDataOrderBook(String product) {
        return marketDataService.getMarketDataOrderBook(product, 1);
    }

    private NewLimitOrderSingle getNewLimitOrderSingle(String productId, BigDecimal price, BigDecimal size) {
        NewLimitOrderSingle limitOrder = new NewLimitOrderSingle();
        limitOrder.setProduct_id(productId);
        if (productId.contains("-BTC")) {
            limitOrder.setSide("sell");
        } else {
            limitOrder.setSide("buy");
        }
        limitOrder.setType("limit");
        limitOrder.setPrice(price);
        limitOrder.setSize(size);
        return limitOrder;
    }

    private BigDecimal getAskPrice(MarketData marketData) {
        return marketData.getAsks().get(0).getPrice().setScale(4, RoundingMode.HALF_UP);
    }

    /**
     * @param accountsAvailable Available accounts to trade from
     * @return null or String
     */
    private MarketData getTradeableProductData(List<Account> accountsAvailable) {
        MarketData data = null;
        for (Account account : accountsAvailable) {
            System.out.println("Do nothing");
        }
        return data;
    }
}


================================================
FILE: api/src/test/java/com/coinbase/exchange/api/payments/PaymentIntegrationTest.java
================================================
package com.coinbase.exchange.api.payments;

import com.coinbase.exchange.api.BaseIntegrationTest;
import com.coinbase.exchange.api.config.IntegrationTestConfiguration;
import org.junit.jupiter.api.BeforeEach;
import org.junit.jupiter.api.Test;
import org.junit.jupiter.api.extension.ExtendWith;
import org.springframework.context.annotation.Import;
import org.springframework.test.context.junit.jupiter.SpringExtension;

import java.util.List;

import static org.junit.jupiter.api.Assertions.assertTrue;

@ExtendWith(SpringExtension.class)
@Import({IntegrationTestConfiguration.class})
public class PaymentIntegrationTest extends BaseIntegrationTest {

    PaymentService testee;

    @BeforeEach
    void setUp() {
        testee = new PaymentService(exchange);
    }

    @Test
    public void hasAvailablePayments(){
        List<PaymentType> types = testee.getPaymentTypes();
        assertTrue(types.size() > 0);
    }
    @Test
    public void hasCoinbaseAccounts(){
        List<CoinbaseAccount> accounts = testee.getCoinbaseAccounts();
        assertTrue(accounts.size() > 0);
    }
}


================================================
FILE: api/src/test/java/com/coinbase/exchange/api/products/ProductsIntegrationTest.java
================================================
package com.coinbase.exchange.api.products;

import com.coinbase.exchange.api.BaseIntegrationTest;
import com.coinbase.exchange.api.config.IntegrationTestConfiguration;
import com.coinbase.exchange.model.Candles;
import com.coinbase.exchange.model.Granularity;
import com.coinbase.exchange.model.Product;
import org.junit.jupiter.api.BeforeEach;
import org.junit.jupiter.api.Test;
import org.junit.jupiter.api.extension.ExtendWith;
import org.springframework.context.annotation.Import;
import org.springframework.test.context.junit.jupiter.SpringExtension;

import java.time.Duration;
import java.time.Instant;
import java.time.temporal.ChronoUnit;
import java.util.List;

import static org.junit.jupiter.api.Assertions.assertEquals;
import static org.junit.jupiter.api.Assertions.assertTrue;

/**
 * See class doc for BaseIntegrationTest
 * <p>
 * Created by robevansuk on 08/02/2017.
 */
@ExtendWith(SpringExtension.class)
@Import({IntegrationTestConfiguration.class})
public class ProductsIntegrationTest extends BaseIntegrationTest {

    private static final String TEST_PRODUCT_ID = "BTC-GBP";
    public static final int ONE_DAY_IN_SECONDS = 60 * 60 * 24;
    public static final int SIX_HOURS_IN_SECONDS = 60 * 60 * 6;
    public static final int ONE_HOUR_IN_SECONDS = 60 * 60;
    public static final int FIFTEEN_MINS_IN_SECONDS = 60 * 15;
    public static final int FIVE_MINS_IN_SECONDS = 60 * 5;
    public static final int ONE_MIN_IN_SECONDS = 60;

    private ProductService productService;

    @BeforeEach
    void setUp() {
        this.productService = new ProductService(exchange);
    }

    @Test
    public void canGetProducts() {
        List<Product> products = productService.getProducts();
        products.forEach(item -> System.out.println(item.getId()));
        assertTrue(products.size() >= 0);
    }

    @Test
    void shouldGetCandles() {
        Candles candles = productService.getCandles(TEST_PRODUCT_ID);

        assertEquals(300, candles.getCandleList().size());
    }

    @Test
    void shouldGetCandlesForAGanularityOf_OneDay() {
        Candles candles = productService.getCandles(TEST_PRODUCT_ID, Granularity.ONE_DAY);

        assertEquals(300, candles.getCandleList().size());
        assertEquals(ONE_DAY_IN_SECONDS, getDuration(candles).getSeconds());
    }

    @Test
    void shouldGetCandlesForAGanularityOf_SixHours() {
        Candles candles = productService.getCandles(TEST_PRODUCT_ID, Granularity.SIX_HOURS);

        assertEquals(300, candles.getCandleList().size());
        assertEquals(SIX_HOURS_IN_SECONDS, getDuration(candles).getSeconds());
    }

    @Test
    void shouldGetCandlesForAGanularityOf_OneHour() {
        Candles candles = productService.getCandles(TEST_PRODUCT_ID, Granularity.ONE_HOUR);

        assertEquals(300, candles.getCandleList().size());
        assertEquals(ONE_HOUR_IN_SECONDS, getDuration(candles).getSeconds());
    }

    @Test
    void shouldGetCandlesForAGanularityOf_FifteenMins() {
        Candles candles = productService.getCandles(TEST_PRODUCT_ID, Granularity.FIFTEEN_MIN);

        assertEquals(300, candles.getCandleList().size());
        assertEquals(FIFTEEN_MINS_IN_SECONDS, getDuration(candles).getSeconds());
    }

    @Test
    void shouldGetCandlesForAGanularityOf_FiveMins() {
        Candles candles = productService.getCandles(TEST_PRODUCT_ID, Granularity.FIVE_MIN);

        assertEquals(300, candles.getCandleList().size());
        assertEquals(FIVE_MINS_IN_SECONDS, getDuration(candles).getSeconds());
    }

    @Test
    void shouldGetCandlesForAGanularityOf_OneMin() {
        Candles candles = productService.getCandles(TEST_PRODUCT_ID, Granularity.ONE_MIN);

        assertEquals(300, candles.getCandleList().size());
        assertEquals(ONE_MIN_IN_SECONDS, getDuration(candles).getSeconds());
    }

    @Test
    void shouldGetCandlesForWithAStartAndEndTime() {
        Instant startTime = Instant.now().minus(400, ChronoUnit.DAYS);
        Instant endTime = Instant.now().minus(100, ChronoUnit.DAYS);

        Candles candles = productService.getCandles(TEST_PRODUCT_ID, startTime, endTime, Granularity.ONE_DAY);

        // can't predict how many candles we'll get back but going back more than 300 days
        // doesn't return 300 candles here.. easiest just to assert we get more than 100 back.
        assertTrue(candles.getCandleList().size() > 100);
    }

    private Duration getDuration(Candles candles) {
        Instant candleTime1 = candles.getCandleList().get(0).getTime();
        Instant candleTime2 = candles.getCandleList().get(1).getTime();
        return Duration.between(candleTime2, candleTime1);
    }
}


================================================
FILE: api/src/test/java/com/coinbase/exchange/api/transfers/TransferServiceIntegrationTest.java
================================================
package com.coinbase.exchange.api.transfers;

import com.coinbase.exchange.api.BaseIntegrationTest;
import com.coinbase.exchange.api.config.IntegrationTestConfiguration;
import org.junit.Ignore;
import org.junit.jupiter.api.BeforeEach;
import org.junit.jupiter.api.extension.ExtendWith;
import org.springframework.context.annotation.Import;
import org.springframework.test.context.junit.jupiter.SpringExtension;

/**
 * See class doc for BaseIntegrationTest
 *
 * Created by robevansuk on 15/02/2017.
 */
@ExtendWith(SpringExtension.class)
@Import({IntegrationTestConfiguration.class})
public class TransferServiceIntegrationTest extends BaseIntegrationTest {

    private TransferService transferService;

    @BeforeEach
    void setUp() {
        this.transferService = new TransferService(exchange);
    }


    @Ignore
    public void canTransferFromCoinbaseAccountToGdax() {
        // TODO
    }
}


================================================
FILE: api/src/test/resources/application-test.yml
================================================
exchange:
  api:
    baseUrl: "https://api-public.sandbox.pro.coinbase.com"
  key: ""
  secret: ""
  passphrase: ""

websocket:
  baseUrl: "wss://ws-feed-public.sandbox.pro.coinbase.com"

gui:
  enabled: true

================================================
FILE: build.gradle
================================================
buildscript {
    repositories {
        jcenter()
    }
    dependencies {
        classpath 'com.github.jengelman.gradle.plugins:shadow:5.1.0'
    }
}

apply plugin: 'com.github.johnrengelman.shadow'

wrapper {
    distributionType = Wrapper.DistributionType.ALL
}

allprojects {
    apply plugin: 'java'

    group = 'com.coinbase.exchange'
    description = 'Client for the Coinbase Pro API'
    version = '0.11.0'

    repositories {
        mavenCentral()
    }

    test {
        exclude '**/*IntegrationTest*'
    }

    /**
     * User can run these as optional against the sandbox api exchange
     **/
    task integrationTest(type: Test) {
        include '**/*IntegrationTest*'
    }
}

subprojects { }

// apply dependency constraints to all java modules
configure(subprojects.findAll { true }) {

    sourceCompatibility = 1.11
    targetCompatibility = 1.11

    dependencies {
        constraints {
            implementation 'com.fasterxml.jackson.core:jackson-core:2.11.0'
            implementation 'com.fasterxml.jackson.core:jackson-databind:2.11.0'
            implementation 'com.fasterxml.jackson.core:jackson-annotations:2.11.0'
            implementation 'com.fasterxml.jackson.datatype:jackson-datatype-jdk8:2.11.0'
            implementation 'com.fasterxml.jackson.datatype:jackson-datatype-jsr310:2.11.0'
            implementation 'org.slf4j:slf4j-api:1.7.28'
            implementation 'ch.qos.logback:logback-classic:1.2.3'
            implementation 'ch.qos.logback:logback-core:1.2.3'
            implementation 'org.springframework.boot:spring-boot-starter-web:2.2.7.RELEASE'
            implementation 'org.springframework:spring-context:5.2.6.RELEASE'

            // --------------------------------------
            testImplementation 'junit:junit:4.12'
            testImplementation 'org.junit.jupiter:junit-jupiter-api:5.5.2'
            testImplementation 'org.junit.jupiter:junit-jupiter-params:5.5.2'
            testImplementation 'org.junit.jupiter:junit-jupiter-engine:5.5.2'
            testImplementation 'org.junit.platform:junit-platform-suite-api:1.3.2'

            testImplementation 'org.springframework.boot:spring-boot-test:2.2.7.RELEASE'
            testImplementation 'org.springframework.boot:spring-boot-starter-test:2.2.7.RELEASE'

            testImplementation 'org.mockito:mockito-core:3.0.0'
            testImplementation 'org.mockito:mockito-junit-jupiter:3.0.0'

            testImplementation 'org.assertj:assertj-core:3.13.2'
        }
    }
}

dependencies {
    compile project(":api")
    compile project(":model")
    compile project(":security")
    compile project(":websocketfeed")
}


================================================
FILE: gradle/wrapper/gradle-wrapper.properties
================================================
#Fri Jan 20 14:01:00 GMT 2017
distributionBase=GRADLE_USER_HOME
distributionPath=wrapper/dists
zipStoreBase=GRADLE_USER_HOME
zipStorePath=wrapper/dists
distributionUrl=https\://services.gradle.org/distributions/gradle-5.3.1-all.zip


================================================
FILE: gradlew
================================================
#!/usr/bin/env sh

##############################################################################
##
##  Gradle start up script for UN*X
##
##############################################################################

# Attempt to set APP_HOME
# Resolve links: $0 may be a link
PRG="$0"
# Need this for relative symlinks.
while [ -h "$PRG" ] ; do
    ls=`ls -ld "$PRG"`
    link=`expr "$ls" : '.*-> \(.*\)$'`
    if expr "$link" : '/.*' > /dev/null; then
        PRG="$link"
    else
        PRG=`dirname "$PRG"`"/$link"
    fi
done
SAVED="`pwd`"
cd "`dirname \"$PRG\"`/" >/dev/null
APP_HOME="`pwd -P`"
cd "$SAVED" >/dev/null

APP_NAME="Gradle"
APP_BASE_NAME=`basename "$0"`

# Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script.
DEFAULT_JVM_OPTS=""

# Use the maximum available, or set MAX_FD != -1 to use that value.
MAX_FD="maximum"

warn ( ) {
    echo "$*"
}

die ( ) {
    echo
    echo "$*"
    echo
    exit 1
}

# OS specific support (must be 'true' or 'false').
cygwin=false
msys=false
darwin=false
nonstop=false
case "`uname`" in
  CYGWIN* )
    cygwin=true
    ;;
  Darwin* )
    darwin=true
    ;;
  MINGW* )
    msys=true
    ;;
  NONSTOP* )
    nonstop=true
    ;;
esac

CLASSPATH=$APP_HOME/gradle/wrapper/gradle-wrapper.jar

# Determine the Java command to use to start the JVM.
if [ -n "$JAVA_HOME" ] ; then
    if [ -x "$JAVA_HOME/jre/sh/java" ] ; then
        # IBM's JDK on AIX uses strange locations for the executables
        JAVACMD="$JAVA_HOME/jre/sh/java"
    else
        JAVACMD="$JAVA_HOME/bin/java"
    fi
    if [ ! -x "$JAVACMD" ] ; then
        die "ERROR: JAVA_HOME is set to an invalid directory: $JAVA_HOME

Please set the JAVA_HOME variable in your environment to match the
location of your Java installation."
    fi
else
    JAVACMD="java"
    which java >/dev/null 2>&1 || die "ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH.

Please set the JAVA_HOME variable in your environment to match the
location of your Java installation."
fi

# Increase the maximum file descriptors if we can.
if [ "$cygwin" = "false" -a "$darwin" = "false" -a "$nonstop" = "false" ] ; then
    MAX_FD_LIMIT=`ulimit -H -n`
    if [ $? -eq 0 ] ; then
        if [ "$MAX_FD" = "maximum" -o "$MAX_FD" = "max" ] ; then
            MAX_FD="$MAX_FD_LIMIT"
        fi
        ulimit -n $MAX_FD
        if [ $? -ne 0 ] ; then
            warn "Could not set maximum file descriptor limit: $MAX_FD"
        fi
    else
        warn "Could not query maximum file descriptor limit: $MAX_FD_LIMIT"
    fi
fi

# For Darwin, add options to specify how the application appears in the dock
if $darwin; then
    GRADLE_OPTS="$GRADLE_OPTS \"-Xdock:name=$APP_NAME\" \"-Xdock:icon=$APP_HOME/media/gradle.icns\""
fi

# For Cygwin, switch paths to Windows format before running java
if $cygwin ; then
    APP_HOME=`cygpath --path --mixed "$APP_HOME"`
    CLASSPATH=`cygpath --path --mixed "$CLASSPATH"`
    JAVACMD=`cygpath --unix "$JAVACMD"`

    # We build the pattern for arguments to be converted via cygpath
    ROOTDIRSRAW=`find -L / -maxdepth 1 -mindepth 1 -type d 2>/dev/null`
    SEP=""
    for dir in $ROOTDIRSRAW ; do
        ROOTDIRS="$ROOTDIRS$SEP$dir"
        SEP="|"
    done
    OURCYGPATTERN="(^($ROOTDIRS))"
    # Add a user-defined pattern to the cygpath arguments
    if [ "$GRADLE_CYGPATTERN" != "" ] ; then
        OURCYGPATTERN="$OURCYGPATTERN|($GRADLE_CYGPATTERN)"
    fi
    # Now convert the arguments - kludge to limit ourselves to /bin/sh
    i=0
    for arg in "$@" ; do
        CHECK=`echo "$arg"|egrep -c "$OURCYGPATTERN" -`
        CHECK2=`echo "$arg"|egrep -c "^-"`                                 ### Determine if an option

        if [ $CHECK -ne 0 ] && [ $CHECK2 -eq 0 ] ; then                    ### Added a condition
            eval `echo args$i`=`cygpath --path --ignore --mixed "$arg"`
        else
            eval `echo args$i`="\"$arg\""
        fi
        i=$((i+1))
    done
    case $i in
        (0) set -- ;;
        (1) set -- "$args0" ;;
        (2) set -- "$args0" "$args1" ;;
        (3) set -- "$args0" "$args1" "$args2" ;;
        (4) set -- "$args0" "$args1" "$args2" "$args3" ;;
        (5) set -- "$args0" "$args1" "$args2" "$args3" "$args4" ;;
        (6) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" ;;
        (7) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" "$args6" ;;
        (8) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" "$args6" "$args7" ;;
        (9) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" "$args6" "$args7" "$args8" ;;
    esac
fi

# Escape application args
save ( ) {
    for i do printf %s\\n "$i" | sed "s/'/'\\\\''/g;1s/^/'/;\$s/\$/' \\\\/" ; done
    echo " "
}
APP_ARGS=$(save "$@")

# Collect all arguments for the java command, following the shell quoting and substitution rules
eval set -- $DEFAULT_JVM_OPTS $JAVA_OPTS $GRADLE_OPTS "\"-Dorg.gradle.appname=$APP_BASE_NAME\"" -classpath "\"$CLASSPATH\"" org.gradle.wrapper.GradleWrapperMain "$APP_ARGS"

# by default we should be in the correct project dir, but when run from Finder on Mac, the cwd is wrong
if [ "$(uname)" = "Darwin" ] && [ "$HOME" = "$PWD" ]; then
  cd "$(dirname "$0")"
fi

exec "$JAVACMD" "$@"


================================================
FILE: gradlew.bat
================================================
@if "%DEBUG%" == "" @echo off
@rem ##########################################################################
@rem
@rem  Gradle startup script for Windows
@rem
@rem ##########################################################################

@rem Set local scope for the variables with windows NT shell
if "%OS%"=="Windows_NT" setlocal

set DIRNAME=%~dp0
if "%DIRNAME%" == "" set DIRNAME=.
set APP_BASE_NAME=%~n0
set APP_HOME=%DIRNAME%

@rem Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script.
set DEFAULT_JVM_OPTS=

@rem Find java.exe
if defined JAVA_HOME goto findJavaFromJavaHome

set JAVA_EXE=java.exe
%JAVA_EXE% -version >NUL 2>&1
if "%ERRORLEVEL%" == "0" goto init

echo.
echo ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH.
echo.
echo Please set the JAVA_HOME variable in your environment to match the
echo location of your Java installation.

goto fail

:findJavaFromJavaHome
set JAVA_HOME=%JAVA_HOME:"=%
set JAVA_EXE=%JAVA_HOME%/bin/java.exe

if exist "%JAVA_EXE%" goto init

echo.
echo ERROR: JAVA_HOME is set to an invalid directory: %JAVA_HOME%
echo.
echo Please set the JAVA_HOME variable in your environment to match the
echo location of your Java installation.

goto fail

:init
@rem Get command-line arguments, handling Windows variants

if not "%OS%" == "Windows_NT" goto win9xME_args

:win9xME_args
@rem Slurp the command line arguments.
set CMD_LINE_ARGS=
set _SKIP=2

:win9xME_args_slurp
if "x%~1" == "x" goto execute

set CMD_LINE_ARGS=%*

:execute
@rem Setup the command line

set CLASSPATH=%APP_HOME%\gradle\wrapper\gradle-wrapper.jar

@rem Execute Gradle
"%JAVA_EXE%" %DEFAULT_JVM_OPTS% %JAVA_OPTS% %GRADLE_OPTS% "-Dorg.gradle.appname=%APP_BASE_NAME%" -classpath "%CLASSPATH%" org.gradle.wrapper.GradleWrapperMain %CMD_LINE_ARGS%

:end
@rem End local scope for the variables with windows NT shell
if "%ERRORLEVEL%"=="0" goto mainEnd

:fail
rem Set variable GRADLE_EXIT_CONSOLE if you need the _script_ return code instead of
rem the _cmd.exe /c_ return code!
if  not "" == "%GRADLE_EXIT_CONSOLE%" exit 1
exit /b 1

:mainEnd
if "%OS%"=="Windows_NT" endlocal

:omega


================================================
FILE: model/build.gradle
================================================
dependencies {
    implementation 'com.fasterxml.jackson.core:jackson-core'
    implementation 'com.fasterxml.jackson.core:jackson-databind'
    implementation 'com.fasterxml.jackson.core:jackson-annotations'
    implementation 'com.fasterxml.jackson.datatype:jackson-datatype-jdk8'
}


================================================
FILE: model/src/main/java/com/coinbase/exchange/model/Candle.java
================================================
package com.coinbase.exchange.model;

import java.math.BigDecimal;
import java.time.Instant;

public class Candle {

    private Instant time;
    private BigDecimal low;
    private BigDecimal high;
    private BigDecimal open;
    private BigDecimal close;
    private BigDecimal volume;

    public Candle(String[] entry) {
        this(Instant.ofEpochSecond(Long.parseLong(entry[0])),
                new BigDecimal(entry[1]),
                new BigDecimal(entry[2]),
                new BigDecimal(entry[3]),
                new BigDecimal(entry[4]),
                new BigDecimal(entry[5]));
    }

    public Candle(Instant time, BigDecimal low, BigDecimal high, BigDecimal open, BigDecimal close, BigDecimal volume) {
        this.time   = time;
        this.low    = low;
        this.high   = high;
        this.open   = open;
        this.close  = close;
        this.volume = volume;
    }

    public Instant getTime() {
        return time;
    }

    public BigDecimal getLow() {
        return low;
    }

    public BigDecimal getHigh() {
        return high;
    }

    public BigDecimal getOpen() {
        return open;
    }

    public BigDecimal getClose() {
        return close;
    }

    public BigDecimal getVolume() {
        return volume;
    }

    public void setTime(Instant time) {
        this.time = time;
    }

    public void setLow(BigDecimal low) {
        this.low = low;
    }

    public void setHigh(BigDecimal high) {
        this.high = high;
    }

    public void setOpen(BigDecimal open) {
        this.open = open;
    }

    public void setClose(BigDecimal close) {
        this.close = close;
    }

    public void setVolume(BigDecimal volume) {
        this.volume = volume;
    }
}


================================================
FILE: model/src/main/java/com/coinbase/exchange/model/Candles.java
================================================
package com.coinbase.exchange.model;

import java.util.List;
import java.util.stream.Collectors;

public class Candles {

    List<Candle> candleList;

    public Candles(List<String[]> candles) {
        this.candleList = candles.stream().map(Candle::new).collect(Collectors.toList());
    }

    public List<Candle> getCandleList() {
        return candleList;
    }
}


================================================
FILE: model/src/main/java/com/coinbase/exchange/model/CoinbasePaymentRequest.java
================================================
package com.coinbase.exchange.model;

import java.math.BigDecimal;

/**
 * Created by robevansuk on 15/02/2017.
 */
public class CoinbasePaymentRequest extends MonetaryRequest {

    private String coinbase_account_id;
    private String payment_method_id;

    public CoinbasePaymentRequest(BigDecimal amount, String currency, String coinbase_account_id) {
        super(amount, currency);
        this.coinbase_account_id = coinbase_account_id;
        this.payment_method_id = coinbase_account_id; //Duplicated field for gdax compliance, I believe
        //We could probably remove coinbase_account_id but there are no tests for this specific thing
    }
    public String getCoinbase_account_id() {
        return coinbase_account_id;
    }
    public void setCoinbase_account_id(String coinbase_account_id) {
        this.coinbase_account_id = coinbase_account_id;
    }
}


================================================
FILE: model/src/main/java/com/coinbase/exchange/model/CryptoPaymentRequest.java
================================================
package com.coinbase.exchange.model;

import java.math.BigDecimal;

public class CryptoPaymentRequest extends MonetaryRequest {
    private String crypto_address;

    public CryptoPaymentRequest(BigDecimal amount, String currency, String cryptoAddress) {
        super(amount, currency);
        this.crypto_address = cryptoAddress;
    }
    public String getCryptoAddress() {
        return crypto_address;
    }
    public void setCryptoAddress(String cryptoAddress) {
        this.crypto_address = cryptoAddress;
    }
}


================================================
FILE: model/src/main/java/com/coinbase/exchange/model/Currency.java
================================================
package com.coinbase.exchange.model;

import com.fasterxml.jackson.annotation.JsonIgnoreProperties;

import java.math.BigDecimal;

@JsonIgnoreProperties(ignoreUnknown = true)
public class Currency {
    private String id;
    private String name;
    private BigDecimal min_size;
    private String status;
    private String status_message;
    private BigDecimal max_precision;
    private String[] convertible_to;
    private String funding_account_id;
    private Object details;

    public Currency() {
    }

    public Currency(String id, String name, BigDecimal min_size, String status, String status_message, BigDecimal max_precision, String[] convertible_to, String funding_account_id, String details) {
        this();
        this.id = id;
        this.name = name;
        this.min_size = min_size;
        this.status = status;
        this.status_message = status_message;
        this.max_precision = max_precision;
        this.convertible_to = convertible_to;
        this.funding_account_id = funding_account_id;
        this.details = details;
    }

    public String getId() {
        return id;
    }

    public void setId(String id) {
        this.id = id;
    }

    public String getName() {
        return name;
    }

    public void setName(String name) {
        this.name = name;
    }

    public BigDecimal getMin_size() {
        return min_size;
    }

    public void setMin_size(BigDecimal min_size) {
        this.min_size = min_size;
    }

    public String getStatus() {
        return status;
    }

    public void setStatus(String status) {
        this.status = status;
    }

    public String getStatus_message() {
        return status_message;
    }

    public void setStatus_message(String status_message) {
        this.status_message = status_message;
    }

    public BigDecimal getMax_precision() {
        return max_precision;
    }

    public void setMax_precision(BigDecimal max_precision) {
        this.max_precision = max_precision;
    }

    public String[] getConvertible_to() {
        return convertible_to;
    }

    public void setConvertible_to(String[] convertible_to) {
        this.convertible_to = convertible_to;
    }

    public String getFunding_account_id() {
        return funding_account_id;
    }

    public void setFunding_account_id(String funding_account_id) {
        this.funding_account_id = funding_account_id;
    }

    public Object getDetails() {
        return details;
    }

    public void setDetails(Object details) {
        this.details = details;
    }
}


================================================
FILE: model/src/main/java/com/coinbase/exchange/model/Detail.java
================================================
package com.coinbase.exchange.model;

/**
 * Created by irufus on 2/25/15.
 */
public class Detail {
    private String order_id;
    private Integer trade_id;
    private String product_id;

    public String getOrder_id() {
        return order_id;
    }

    public void setOrder_id(String order_id) {
        this.order_id = order_id;
    }

    public Integer getTrade_id() {
        return trade_id;
    }

    public void setTrade_id(Integer trade_id) {
        this.trade_id = trade_id;
    }

    public String getProduct_id() {
        return product_id;
    }

    public void setProduct_id(String product_id) {
        this.product_id = product_id;
    }
}


================================================
FILE: model/src/main/java/com/coinbase/exchange/model/Fill.java
================================================
package com.coinbase.exchange.model;

import java.math.BigDecimal;

/**
 * Created by irufus on 2/18/15.
 */
public class Fill {
    private Integer trade_id;
    private String product_id;
    private BigDecimal size;
    private String order_id;
    private String created_at;
    private String liquidity;
    private BigDecimal fee;
    private Boolean settled;
    private String side;

    public String getSide() {
        return side;
    }

    public void setSide(String side) {
        this.side = side;
    }

    public Boolean getSettled() {
        return settled;
    }

    public void setSettled(Boolean settled) {
        this.settled = settled;
    }

    public BigDecimal getFee() {
        return fee;
    }

    public void setFee(BigDecimal fee) {
        this.fee = fee;
    }

    public String getCreated_at() {
        return created_at;
    }

    public void setCreated_at(String created_at) {
        this.created_at = created_at;
    }

    public String getLiquidity() {
        return liquidity;
    }

    public void setLiquidity(String liquidity) {
        this.liquidity = liquidity;
    }

    public String getOrder_id() {
        return order_id;
    }

    public void setOrder_id(String order_id) {
        this.order_id = order_id;
    }

    public BigDecimal getSize() {
        return size;
    }

    public void setSize(BigDecimal size) {
        this.size = size;
    }

    public String getProduct_id() {
        return product_id;
    }

    public void setProduct_id(String product_id) {
        this.product_id = product_id;
    }

    public Integer getTrade_id() {
        return trade_id;
    }

    public void setTrade_id(Integer trade_id) {
        this.trade_id = trade_id;
    }
}


================================================
FILE: model/src/main/java/com/coinbase/exchange/model/Granularity.java
================================================
package com.coinbase.exchange.model;

public enum Granularity {
    ONE_DAY("1d"),
    SIX_HOURS("6h"),
    ONE_HOUR("1h"),
    FIFTEEN_MIN("15m"),
    FIVE_MIN("5m"),
    ONE_MIN("1m");

    private String granularity;

    Granularity(String granularity) {
        this.granularity = granularity;
    }

    /**
     * The granularity field must be one of the following values:
     * {60, 300, 900, 3600, 21600, 86400}.
     */
    public String get(){
        switch(granularity) {
            case "1d": return "86400";
            case "6h": return "21600";
            case "1h": return "3600";
            case "15m": return "900";
            case "5m": return "300";
            case "1m": return "60";
        }
        return "";
    }
}


================================================
FILE: model/src/main/java/com/coinbase/exchange/model/Hold.java
================================================
package com.coinbase.exchange.model;

import java.math.BigDecimal;

/**
 * Created by irufus on 2/18/15.
 * Updated by robevansuk on 17/2/17
 */
public class Hold {
    String id;
    String account_id;
    String created_at;
    String update_at;
    BigDecimal amount;
    String type;
    String ref;

    public Hold () {}

    public Hold(String id, String account_id, String created_at, String update_at, BigDecimal amount, String type, String ref) {
        this.id = id;
        this.account_id = account_id;
        this.created_at = created_at;
        this.update_at = update_at;
        this.amount = amount;
        this.type = type;
        this.ref = ref;
    }

    public String getId() {
        return id;
    }

    public void setId(String id) {
        this.id = id;
    }

    public String getAccount_id() {
        return account_id;
    }

    public void setAccount_id(String account_id) {
        this.account_id = account_id;
    }

    public String getCreated_at() {
        return created_at;
    }

    public void setCreated_at(String created_at) {
        this.created_at = created_at;
    }

    public String getUpdate_at() {
        return update_at;
    }

    public void setUpdate_at(String update_at) {
        this.update_at = update_at;
    }

    public BigDecimal getAmount() {
        return amount;
    }

    public void setAmount(BigDecimal amount) {
        this.amount = amount;
    }

    public String getType() {
        return type;
    }

    public void setType(String type) {
        this.type = type;
    }

    public String getRef() {
        return ref;
    }

    public void setRef(String ref) {
        this.ref = ref;
    }
}


================================================
FILE: model/src/main/java/com/coinbase/exchange/model/MonetaryRequest.java
================================================
package com.coinbase.exchange.model;

import java.math.BigDecimal;

public abstract class MonetaryRequest {
    protected BigDecimal amount;
    protected String currency;

    public MonetaryRequest(BigDecimal amount, String currency){
        this.amount = amount;
        this.currency = currency;
    }

    public BigDecimal getAmount() {
        return amount;
    }

    public void setAmount(BigDecimal amount) {
        this.amount = amount;
    }

    public String getCurrency() {
        return currency;
    }

    public void setCurrency(String currency) {
        this.currency = currency;
    }
}


================================================
FILE: model/src/main/java/com/coinbase/exchange/model/NewLimitOrderSingle.java
================================================
package com.coinbase.exchange.model;

import java.math.BigDecimal;
import java.math.RoundingMode;

/**
 * Created by irufus on 7/31/15.
 */
public class NewLimitOrderSingle extends NewOrderSingle {
    private BigDecimal size;
    private BigDecimal price;
    private Boolean post_only;

    public NewLimitOrderSingle() {}

    public NewLimitOrderSingle(BigDecimal size, BigDecimal price, Boolean post_only, String product_id) {
        this.size = size;
        this.price = price;
        this.post_only = post_only;
        super.setProduct_id(product_id);
    }

    public NewLimitOrderSingle(BigDecimal size, BigDecimal price, Boolean post_only,
                               String clientOid,
                               String type,
                               String side,
                               String product_id,
                               String stp,
                               String funds) {
        this.size = size;
        this.price = price;
        this.post_only = post_only;
        setClient_oid(clientOid);
        setType(type);
        setSide(side);
        setProduct_id(product_id);
        setStp(stp);
        setFunds(funds);
    }

    public Boolean getPost_only() {
        return post_only;
    }

    public void setPost_only(Boolean post_only) {
        this.post_only = post_only;
    }

    public BigDecimal getPrice() {
        return price.setScale(8, RoundingMode.HALF_UP);
    }

    public void setPrice(BigDecimal price) {
        this.price = price;
    }

    public BigDecimal getSize() {
        return size.setScale(8, RoundingMode.HALF_UP);
    }

    public void setSize(BigDecimal size) {
        this.size = size;
    }

}


================================================
FILE: model/src/main/java/com/coinbase/exchange/model/NewMarketOrderSingle.java
================================================
package com.coinbase.exchange.model;

import java.math.BigDecimal;

/**
 * Created by irufus on 7/31/15.
 */
public class NewMarketOrderSingle extends NewOrderSingle {

    private BigDecimal size; //optional: Desired amount in BTC

    public NewMarketOrderSingle(BigDecimal size) {
        this.size = size;
    }

    public NewMarketOrderSingle(){
        super.setType("market");
    }

    public BigDecimal getSize() {
        return size;
    }

    public void setSize(BigDecimal size) {
        this.size = size;
    }

}


================================================
FILE: model/src/main/java/com/coinbase/exchange/model/NewOrderSingle.java
================================================
package com.coinbase.exchange.model;

/**
 *
 * <pre>
 * {
 *     "id": "d0c5340b-6d6c-49d9-b567-48c4bfca13d2",
 *     "price": "0.10000000",
 *     "size": "0.01000000",
 *     "product_id": "BTC-USD",
 *     "side": "buy",
 *     "stp": "dc",
 *     "type": "limit",
 *     "time_in_force": "GTC",
 *     "post_only": false,
 *     "created_at": "2016-12-08T20:02:28.53864Z",
 *     "fill_fees": "0.0000000000000000",
 *     "filled_size": "0.00000000",
 *     "executed_value": "0.0000000000000000",
 *     "status": "pending",
 *     "settled": false
 * }
 * </pre>
 */
public abstract class NewOrderSingle {

    private String client_oid; //optional
    private String type; //default is limit, other types are market and stop
    private String side;
    private String product_id;
    private String stp; //optional: values are dc, co , cn , cb
    private String funds;

    public NewOrderSingle() {
    }

    public String getStp() {
        return stp;
    }

    public void setStp(String stp) {
        this.stp = stp;
    }

    public String getProduct_id() {
        return product_id;
    }

    public void setProduct_id(String product_id) {
        this.product_id = product_id;
    }

    public String getSide() {
        return side;
    }

    public void setSide(String side) {
        this.side = side;
    }

    public String getClient_oid() {
        return client_oid;
    }

    public void setClient_oid(String client_oid) {
        this.client_oid = client_oid;
    }

    public String getFunds() {
        return funds;
    }

    public void setFunds(String funds) {
        this.funds = funds;
    }

    public String getType() {
        return type;
    }

    public void setType(String type) {
        this.type = type;
    }
}


================================================
FILE: model/src/main/java/com/coinbase/exchange/model/PaymentRequest.java
================================================
package com.coinbase.exchange.model;

import java.math.BigDecimal;

/**
 * Created by robevansuk on 15/02/2017.
 */
public class PaymentRequest extends MonetaryRequest {

    private String payment_method_id;

    public PaymentRequest(BigDecimal amount, String currency, String payment_method_id) {
        super(amount, currency);
        this.payment_method_id = payment_method_id;
    }

    public String getPayment_method_id() {
        return payment_method_id;
    }
    public void setPayment_method_id(String payment_method_id) {
        this.payment_method_id = payment_method_id;
    }
}


================================================
FILE: model/src/main/java/com/coinbase/exchange/model/PaymentResponse.java
================================================
package com.coinbase.exchange.model;

import java.math.BigDecimal;

/**
 * Created by robevansuk on 15/02/2017.
 */
public class PaymentResponse {

    String id;
    BigDecimal amount;
    String currency;
    String payout_at;

    public PaymentResponse() {}

    public PaymentResponse(String id, BigDecimal amount, String currency, String payout_at) {
        this.id = id;
        this.amount = amount;
        this.currency = currency;
        this.payout_at = payout_at;
    }

    public String getId() {
        return id;
    }

    public void setId(String id) {
        this.id = id;
    }

    public BigDecimal getAmount() {
        return amount;
    }

    public void setAmount(BigDecimal amount) {
        this.amount = amount;
    }

    public String getCurrency() {
        return currency;
    }

    public void setCurrency(String currency) {
        this.currency = currency;
    }

    public String getPayout_at() {
        return payout_at;
    }

    public void setPayout_at(String payout_at) {
        this.payout_at = payout_at;
    }
}


================================================
FILE: model/src/main/java/com/coinbase/exchange/model/Product.java
================================================
package com.coinbase.exchange.model;

import com.fasterxml.jackson.annotation.JsonIgnoreProperties;

import java.math.BigDecimal;

/**
 * <pre>
 *     {
 *       "id": "BTC-USD",
 *       "base_currency": "BTC",
 *       "quote_currency": "USD",
 *       "base_min_size": "0.001",
 *       "base_max_size": "280",
 *       "base_increment": "0.00000001",
 *       "quote_increment": "0.01",
 *       "display_name": "BTC/USD",
 *       "status": "online",
 *       "margin_enabled": false,
 *       "status_message": "",
 *       "min_market_funds": "5",
 *       "max_market_funds": "1000000",
 *       "post_only": false,
 *       "limit_only": false,
 *       "cancel_only": false,
 *       "type": "spot"
 *     }
 * </pre>
 */
@JsonIgnoreProperties(ignoreUnknown = true)
public class Product {
    private String id;
    private String base_currency;
    private String quote_currency;
    private Double base_min_size;
    private Double base_max_size;
    private Double quote_increment;
    private double base_increment;
    private String display_name;
    private String status;
    private Boolean margin_enabled;
    private String status_message;
    private BigDecimal min_market_funds;
    private Integer max_market_funds;
    private Boolean post_only;
    private Boolean limit_only;
    private Boolean cancel_only;
    private String type;

    public Double getQuote_increment() {
        return quote_increment;
    }

    public void setQuote_increment(Double quote_increment) {
        this.quote_increment = quote_increment;
    }

    public Double getBase_max_size() {
        return base_max_size;
    }

    public void setBase_max_size(Double base_max_size) {
        this.base_max_size = base_max_size;
    }

    public Double getBase_min_size() {
        return base_min_size;
    }

    public void setBase_min_size(Double base_min_size) {
        this.base_min_size = base_min_size;
    }

    public String getQuote_currency() {
        return quote_currency;
    }

    public void setQuote_currency(String quote_currency) {
        this.quote_currency = quote_currency;
    }

    public String getBase_currency() {
        return base_currency;
    }

    public void setBase_currency(String base_currency) {
        this.base_currency = base_currency;
    }

    public String getId() {
        return id;
    }

    public void setId(String id) {
        this.id = id;
    }

    public void setBase_increment(double base_increment) {
        this.base_increment = base_increment;
    }

    public double getBase_increment() {
        return base_increment;
    }

    public void setDisplay_name(String display_name) {
        this.display_name = display_name;
    }

    public String getDisplay_name() {
        return display_name;
    }

    public String getStatus() {
        return status;
    }

    public void setStatus(String status) {
        this.status = status;
    }

    public Boolean getMargin_enabled() {
        return margin_enabled;
    }

    public void setMargin_enabled(Boolean margin_enabled) {
        this.margin_enabled = margin_enabled;
    }

    public String getStatus_message() {
        return status_message;
    }

    public void setStatus_message(String status_message) {
        this.status_message = status_message;
    }

    public BigDecimal getMin_market_funds() {
        return min_market_funds;
    }

    public void setMin_market_funds(BigDecimal min_market_funds) {
        this.min_market_funds = min_market_funds;
    }

    public Integer getMax_market_funds() {
        return max_market_funds;
    }

    public void setMax_market_funds(Integer max_market_funds) {
        this.max_market_funds = max_market_funds;
    }

    public Boolean getPost_only() {
        return post_only;
    }

    public void setPost_only(Boolean post_only) {
        this.post_only = post_only;
    }

    public Boolean getLimit_only() {
        return limit_only;
    }

    public void setLimit_only(Boolean limit_only) {
        this.limit_only = limit_only;
    }

    public Boolean getCancel_only() {
        return cancel_only;
    }

    public void setCancel_only(Boolean cancel_only) {
        this.cancel_only = cancel_only;
    }

    public String getType() {
        return type;
    }

    public void setType(String type) {
        this.type = type;
    }
}


================================================
FILE: model/src/main/java/com/coinbase/exchange/model/ProductOrderBook.java
================================================
package com.coinbase.exchange.model;

import java.util.List;

/**
 * Created by irufus on 8/3/15.
 */
public class ProductOrderBook {

    private Integer sequence;
    private List<List<String>> bids;
    private List<List<String>> asks;

    public List<List<String>> getAsks() {
        return asks;
    }

    public void setAsks(List<List<String>> asks) {
        this.asks = asks;
    }

    public List<List<String>> getBids() {
        return bids;
    }

    public void setBids(List<List<String>> bids) {
        this.bids = bids;
    }

    public Integer getSequence() {
        return sequence;
    }

    public void setSequence(Integer sequence) {
        this.sequence = sequence;
    }
}


================================================
FILE: security/build.gradle
================================================
plugins {
    id 'java'
}

group 'com.coinbase.exchange'
version '0.11.0'

repositories {
    mavenCentral()
}

dependencies {
    testCompile group: 'junit', name: 'junit', version: '4.12'
}


================================================
FILE: security/src/main/java/com/coinbase/exchange/security/Signature.java
================================================
package com.coinbase.exchange.security;

import com.coinbase.exchange.security.constants.ExchangeConstants;

import javax.crypto.Mac;
import javax.crypto.spec.SecretKeySpec;
import javax.management.RuntimeErrorException;
import java.security.InvalidKeyException;
import java.util.Base64;

/**
 * Created by robevansuk on 17/03/2017.
 */
public class Signature {

    private final String secretKey;

    public Signature(final String secretKey) {
        this.secretKey = secretKey;
    }

    /**
     * The CB-ACCESS-SIGN header is generated by creating a sha256 HMAC using
     * the base64-decoded secret key on the prehash string for:
     * timestamp + method + requestPath + body (where + represents string concatenation)
     * and base64-encode the output.
     * The timestamp value is the same as the CB-ACCESS-TIMESTAMP header.
     * @param requestPath
     * @param method
     * @param body
     * @param timestamp
     * @return
     */
    public String generate(String requestPath, String method, String body, String timestamp) {
        try {
            String prehash = timestamp + method.toUpperCase() + requestPath + body;
            byte[] secretDecoded = Base64.getDecoder().decode(secretKey);
            SecretKeySpec keyspec = new SecretKeySpec(secretDecoded, ExchangeConstants.SHARED_MAC.getAlgorithm());
            Mac sha256 = (Mac) ExchangeConstants.SHARED_MAC.clone();
            sha256.init(keyspec);
            return Base64.getEncoder().encodeToString(sha256.doFinal(prehash.getBytes()));
        } catch (CloneNotSupportedException | InvalidKeyException e) {
            e.printStackTrace();
            throw new RuntimeErrorException(new Error("Cannot set up authentication headers."));
        }
    }
}


================================================
FILE: security/src/main/java/com/coinbase/exchange/security/constants/ExchangeConstants.java
================================================
package com.coinbase.exchange.security.constants;

import javax.crypto.Mac;
import java.security.NoSuchAlgorithmException;

/**
 * Created by robevansuk on 25/01/2017.
 */
public class ExchangeConstants {

    public static Mac SHARED_MAC;

    static {
        try {
            SHARED_MAC = Mac.getInstance("HmacSHA256");
        } catch (NoSuchAlgorithmException nsaEx) {
            nsaEx.printStackTrace();
        }
    }
}


================================================
FILE: settings.gradle
================================================
rootProject.name = 'coinbase-pro-java'

include 'api'
include 'security'
include 'websocketfeed'
include 'model'
include 'security'



================================================
FILE: websocketfeed/build.gradle
================================================
dependencies {
    compile project(':model')
    compile project(':security')
    implementation 'org.springframework.boot:spring-boot-starter-web'
    implementation 'com.fasterxml.jackson.core:jackson-core'
    implementation 'com.fasterxml.jackson.core:jackson-databind'
    implementation 'com.fasterxml.jackson.core:jackson-annotations'
    implementation 'com.fasterxml.jackson.datatype:jackson-datatype-jdk8'
    implementation 'org.slf4j:slf4j-api'
    implementation 'ch.qos.logback:logback-classic'
    implementation 'ch.qos.logback:logback-core'

    testImplementation 'org.junit.jupiter:junit-jupiter-engine'
    testImplementation 'org.junit.jupiter:junit-jupiter-api'
    testImplementation 'org.junit.jupiter:junit-jupiter-params'
    testImplementation 'org.junit.jupiter:junit-jupiter-engine'
    testImplementation 'com.fasterxml.jackson.datatype:jackson-datatype-jsr310'
}


================================================
FILE: websocketfeed/src/main/java/com/coinbase/exchange/websocketfeed/ActivateOrderBookMessage.java
================================================
package com.coinbase.exchange.websocketfeed;

import com.fasterxml.jackson.annotation.JsonProperty;

import java.math.BigDecimal;
import java.time.Instant;

/**
 * An activate message is sent when a stop order is placed.
 * When the stop is triggered the order will be placed and go through the order lifecycle.
 * Example:
 * <pre>
 * {
 *   "type": "activate",
 *   "product_id": "test-product",
 *   "timestamp": "1483736448.299000",
 *   "user_id": "12",
 *   "profile_id": "30000727-d308-cf50-7b1c-c06deb1934fc",
 *   "order_id": "7b52009b-64fd-0a2a-49e6-d8a939753077",
 *   "stop_type": "entry",
 *   "side": "buy",
 *   "stop_price": "80",
 *   "size": "2",
 *   "funds": "50",
 *   "private": true
 * }
 * </pre>
 */
public class ActivateOrderBookMessage extends OrderBookMessage {
    private String stop_type;
    private BigDecimal stop_price;
    private Instant timestamp;

    public ActivateOrderBookMessage() {
        setType("activate");
    }

    public ActivateOrderBookMessage(String stop_type, BigDecimal stop_price, Instant timestamp, boolean privateFlag) {
        this();
        this.stop_type = stop_type;
        this.stop_price = stop_price;
        this.timestamp = timestamp;
        this.privateFlag = privateFlag;
    }

    @JsonProperty("private")
    private boolean privateFlag;

    public String getStop_type() {
        return stop_type;
    }

    public void setStop_type(String stop_type) {
        this.stop_type = stop_type;
    }

    public BigDecimal getStop_price() {
        return stop_price;
    }

    public void setStop_price(BigDecimal stop_price) {
        this.stop_price = stop_price;
    }

    public Instant getTimestamp() {
        return timestamp;
    }

    public void setTimestamp(Instant timestamp) {
        this.timestamp = timestamp;
    }

    public boolean isPrivateFlag() {
        return privateFlag;
    }

    public void setPrivateFlag(boolean privateFlag) {
        this.privateFlag = privateFlag;
    }

}


================================================
FILE: websocketfeed/src/main/java/com/coinbase/exchange/websocketfeed/ChangedOrderBookMessage.java
================================================
package com.coinbase.exchange.websocketfeed;

/**
 * An order has changed. This is the result of self-trade prevention
 * adjusting the order size or available funds. Orders can only
 * decrease in size or funds. change messages are sent anytime an
 * order changes in size; this includes resting orders (open) as
 * well as received but not yet open. change messages are also
 * sent when a new market order goes through self trade prevention
 * and the funds for the market order have changed.
 * <pre>
 * {
 *     "type": "change",
 *     "time": "2014-11-07T08:19:27.028459Z",
 *     "sequence": 80,
 *     "order_id": "ac928c66-ca53-498f-9c13-a110027a60e8",
 *     "product_id": "BTC-USD",
 *     "new_size": "5.23512",
 *     "old_size": "12.234412",
 *     "price": "400.23",
 *     "side": "sell"
 * }
 * </pre>
 * change messages for received but not yet open orders can be
 * ignored when building a real-time order book. The side field
 * of a change message and price can be used as indicators for whether
 * the change message is relevant if building from a level 2 book.
 *
 * Any change message where the price is null indicates that the change
 * message is for a market order. Change messages for limit orders will
 * always have a price specified.
 * <pre>
 * {
 *     "type": "change",
 *     "time": "2014-11-07T08:19:27.028459Z",
 *     "sequence": 80,
 *     "order_id": "ac928c66-ca53-498f-9c13-a110027a60e8",
 *     "product_id": "BTC-USD",
 *     "new_funds": "5.23512",
 *     "old_funds": "12.234412",
 *     "price": "400.23",
 *     "side": "sell"
 * }
 * </pre>
 */
public class ChangedOrderBookMessage extends OrderBookMessage {

    public ChangedOrderBookMessage() {
        setType("change");
    }

}


================================================
FILE: websocketfeed/src/main/java/com/coinbase/exchange/websocketfeed/Channel.java
================================================
package com.coinbase.exchange.websocketfeed;

import com.fasterxml.jackson.annotation.JsonInclude;
import com.fasterxml.jackson.annotation.JsonProperty;

import static com.coinbase.exchange.websocketfeed.ChannelName.full;
import static com.coinbase.exchange.websocketfeed.ChannelName.heartbeat;
import static com.coinbase.exchange.websocketfeed.ChannelName.level2;
import static com.coinbase.exchange.websocketfeed.ChannelName.matches;
import static com.coinbase.exchange.websocketfeed.ChannelName.status;
import static com.coinbase.exchange.websocketfeed.ChannelName.ticker;
import static com.coinbase.exchange.websocketfeed.ChannelName.user;

public class Channel {
    public static final Channel CHANNEL_HEARTBEAT = new Channel(heartbeat, null);
    public static final Channel CHANNEL_STATUS = new Channel(status, null);
    public static final Channel CHANNEL_TICKER = new Channel(ticker, null);
    public static final Channel CHANNEL_LEVEL2 = new Channel(level2, null);
    public static final Channel CHANNEL_USER = new Channel(user, null);
    public static final Channel CHANNEL_MATCHES = new Channel(matches, null);
    public static final Channel CHANNEL_FULL = new Channel(full, null);

    private ChannelName name;

    @JsonProperty("product_ids")
    @JsonInclude(JsonInclude.Include.NON_NULL)
    private String[] product_ids;

    public Channel() {
    }

    public Channel(ChannelName name, String[] product_ids) {
        this.name = name;
        this.product_ids = product_ids;
    }

    public ChannelName getName() {
        return name;
    }

    public void setName(ChannelName name) {
        this.name = name;
    }

    public String[] getProduct_ids() {
        return product_ids;
    }

    public void setProduct_ids(String[] product_ids) {
        this.product_ids = product_ids;
    }
}


================================================
FILE: websocketfeed/src/main/java/com/coinbase/exchange/websocketfeed/ChannelName.java
================================================
package com.coinbase.exchange.websocketfeed;

public enum ChannelName {
    heartbeat, status, ticker, level2, user, matches, full
}


================================================
FILE: websocketfeed/src/main/java/com/coinbase/exchange/websocketfeed/DoneOrderBookMessage.java
================================================
package com.coinbase.exchange.websocketfeed;

/**
 * <pre>
 *  {
 *    "type": "done",
 *    "time": "2014-11-07T08:19:27.028459Z",
 *    "product_id": "BTC-USD",
 *    "sequence": 10,
 *    "price": "200.2",
 *    "order_id": "d50ec984-77a8-460a-b958-66f114b0de9b",
 *    "reason": "filled", // canceled
 *    "side": "sell",
 *    "remaining_size": "0.2"
 *  }
 * </pre>
 */
public class DoneOrderBookMessage extends OrderBookMessage {

    public DoneOrderBookMessage() {
        setType("done");
    }
}


================================================
FILE: websocketfeed/src/main/java/com/coinbase/exchange/websocketfeed/ErrorOrderBookMessage.java
================================================
package com.coinbase.exchange.websocketfeed;

/**
 * If you send a message that is not recognized or an error
 * occurs, the error message will be sent and you will be
 * disconnected.
 * <pre>
 * {
 *     "type": "error",
 *     "message": "error message"
 * }
 * </pre>
 */
public class ErrorOrderBookMessage extends FeedMessage {

    private String message;

    public ErrorOrderBookMessage() {
        setType("error");
    }

    public ErrorOrderBookMessage(String message) {
        this();
        this.message = message;
    }

    //    @JsonCreator
//    public ErrorOrderBookMessage(String type, Long sequence, Instant time, String product_id, String message) {
//        super(type, sequence, time, product_id);
//        this.message = message;
//    }

    public String getMessage() {
        return message;
    }

    public void setMessage(String message) {
        this.message = message;
    }
}


================================================
FILE: websocketfeed/src/main/java/com/coinbase/exchange/websocketfeed/FeedMessage.java
================================================
package com.coinbase.exchange.websocketfeed;

import com.fasterxml.jackson.annotation.JsonIgnoreProperties;
import com.fasterxml.jackson.annotation.JsonSubTypes;
import com.fasterxml.jackson.annotation.JsonTypeInfo;

import java.time.Instant;

@JsonIgnoreProperties(ignoreUnknown = true)
@JsonTypeInfo(use = JsonTypeInfo.Id.NAME, property = "type")
@JsonSubTypes({
        @JsonSubTypes.Type(value = ErrorOrderBookMessage.class, name = "error"),
        @JsonSubTypes.Type(value = SubscriptionsMessage.class, name = "subscriptions"),
        @JsonSubTypes.Type(value = HeartBeat.class, name = "heartbeat"),
        @JsonSubTypes.Type(value = ChangedOrderBookMessage.class, name = "change"),
        @JsonSubTypes.Type(value = DoneOrderBookMessage.class, name = "done"),
        @JsonSubTypes.Type(value = MatchedOrderBookMessage.class, name = "match"),
        @JsonSubTypes.Type(value = MatchedOrderBookMessage.class, name = "last_match"),
        @JsonSubTypes.Type(value = OpenedOrderBookMessage.class, name = "open"),
        @JsonSubTypes.Type(value = ReceivedOrderBookMessage.class, name = "received"),
        @JsonSubTypes.Type(value = TickerMessage.class, name = "ticker"),
        @JsonSubTypes.Type(value = ActivateOrderBookMessage.class, name = "activate"),
        @JsonSubTypes.Type(value = StatusMessage.class, name = "status"),
        @JsonSubTypes.Type(value = SnapshotMessage.class, name = "snapshot"),
        @JsonSubTypes.Type(value = L2UpdateMessage.class, name = "l2update"),
})
public abstract class FeedMessage {

    private String type;  // "received" | "open" | "done" | "match" | "change" | "activate"
    private Long sequence;
    private Instant time;
    private String product_id;

    public String getType() {
        return type;
    }

    public void setType(String type) {
        this.type = type;
    }

    public Long getSequence() {
        return sequence;
    }

    public void setSequence(Long sequence) {
        this.sequence = sequence;
    }

    public Instant getTime() {
        return time;
    }

    public void setTime(Instant time) {
        this.time = time;
    }

    public String getProduct_id() {
        return product_id;
    }

    public void setProduct_id(String product_id) {
        this.product_id = product_id;
    }

}


================================================
FILE: websocketfeed/src/main/java/com/coinbase/exchange/websocketfeed/HeartBeat.java
================================================
package com.coinbase.exchange.websocketfeed;

/**
 * A message sent once a second when heartbeat is turned on.
 * <pre>
 * {
 *     "type": "heartbeat",                   // inherited
 *     "sequence": 90,                        // inherited
 *     "last_trade_id": 20,
 *     "product_id": "BTC-USD",               // inherited
 *     "time": "2014-11-07T08:19:28.464459Z"  // inherited
 * }
 * </pre>
 */
public class HeartBeat extends FeedMessage {

    private Long last_trade_id;

    public HeartBeat() {
        setType("heartbeat");
    }

    public HeartBeat(Long last_trade_id) {
        this();
        this.last_trade_id = last_trade_id;
    }

    public Long getLast_trade_id() {
        return last_trade_id;
    }

    public void setLast_trade_id(Long last_trade_id) {
        this.last_trade_id = last_trade_id;
    }
}


================================================
FILE: websocketfeed/src/main/java/com/coinbase/exchange/websocketfeed/L2UpdateMessage.java
================================================
package com.coinbase.exchange.websocketfeed;

/**
 * Subsequent updates will have the type l2update.
 * The changes property of l2updates is an array with [side, price, size] tuples.
 * The time property of l2update is the time of the event as recorded by our trading engine. Please note that size is the updated size at that price level, not a delta. A size of "0" indicates the price level can be removed.
 * Example:
 * <pre>
 * {
 *   "type": "l2update",
 *   "product_id": "BTC-GBP",
 *   "changes": [
 *     [
 *       "buy",
 *       "5454.12",
 *       "0.00000000"
 *     ]
 *   ],
 *   "time": "2020-04-10T15:28:07.393966Z"
 * }
 * </pre>
 */
public class L2UpdateMessage extends FeedMessage {

    private String[][] changes;

    public L2UpdateMessage() {
        setType("l2update");
    }

    public L2UpdateMessage(String[][] changes) {
        this();
        this.changes = changes;
    }

    public String[][] getChanges() {
        return changes;
    }

    public void setChanges(String[][] changes) {
        this.changes = changes;
    }
}


================================================
FILE: websocketfeed/src/main/java/com/coinbase/exchange/websocketfeed/MatchedOrderBookMessage.java
================================================
package com.coinbase.exchange.websocketfeed;

/**
 * A trade occurred between two orders. The aggressor or taker order is
 * the one executing immediately after being received and the maker order
 * is a resting order on the book. The side field indicates the maker
 * order side. If the side is sell this indicates the maker was a sell
 * order and the match is considered an up-tick. A buy side match is a
 * down-tick.
 * <pre>
 *  {
 *    "type": "match",
 *    "trade_id": 10,
 *    "sequence": 50,
 *    "maker_order_id": "ac928c66-ca53-498f-9c13-a110027a60e8",
 *    "taker_order_id": "132fb6ae-456b-4654-b4e0-d681ac05cea1",
 *    "time": "2014-11-07T08:19:27.028459Z",
 *    "product_id": "BTC-USD",
 *    "size": "5.23512",
 *    "price": "400.23",
 *    "side": "sell"
 *  }
 * </pre>
 * If authenticated, and you were the taker, the message would also have
 * the following fields:
 * <pre>
 *  taker_user_id: "5844eceecf7e803e259d0365",
 *  user_id: "5844eceecf7e803e259d0365",
 *  taker_profile_id: "765d1549-9660-4be2-97d4-fa2d65fa3352",
 *  profile_id: "765d1549-9660-4be2-97d4-fa2d65fa3352"
 * </pre>
 */
public class MatchedOrderBookMessage extends OrderBookMessage {

    public MatchedOrderBookMessage() {
        setType("match");
    }
}


================================================
FILE: websocketfeed/src/main/java/com/coinbase/exchange/websocketfeed/OpenedOrderBookMessage.java
================================================
package com.coinbase.exchange.websocketfeed;

/**
 * <pre>
 *  {
 *    "type": "open",
 *    "time": "2014-11-07T08:19:27.028459Z",
 *    "product_id": "BTC-USD",
 *    "sequence": 10,
 *    "order_id": "d50ec984-77a8-460a-b958-66f114b0de9b",
 *    "price": "200.2",
 *    "remaining_size": "1.00",
 *    "side": "sell"
 *  }
 * </pre>
 */
public class OpenedOrderBookMessage extends OrderBookMessage {

    public OpenedOrderBookMessage() {
        setType("open");
    }
}


================================================
FILE: websocketfeed/src/main/java/com/coinbase/exchange/websocketfeed/OrderBookMessage.java
================================================
package com.coinbase.exchange.websocketfeed;

import java.math.BigDecimal;
import java.math.RoundingMode;
import java.time.Instant;

/**
 * Generic message that will be passed as an argument to other message types
 * so the relevant parts can be determined and the messages typed.
 * Created by robevansuk on 15/03/2017.
 */
public class OrderBookMessage extends FeedMessage implements Comparable<OrderBookMessage> {

    String trade_id;
    String side;
    String order_id;
    String order_type;

    BigDecimal funds;

    BigDecimal size;
    BigDecimal price;

    BigDecimal new_size;
    BigDecimal old_size;
    BigDecimal new_funds;
    BigDecimal old_funds;

    String reason;
    BigDecimal remaining_size;

    String maker_order_id;
    String taker_order_id;
    String taker_user_id;
    String user_id;
    String taker_profile_id;
    String profile_id;

    String last_trade_id;

    String client_oid;
    String stp;

    String message;
    String open_24h;
    String volume_24h;
    String low_24h;
    String high_24h;
    String volume_30d;
    String best_bid;
    String best_ask;
    String last_size;
    Channel[] channels;

    public OrderBookMessage() {

    }

    public OrderBookMessage(String type, String time, String product_id,
                            String trade_id, Long sequence, String side,
                            String order_id, String order_type, BigDecimal funds,
                            BigDecimal size, BigDecimal price, BigDecimal new_size,
                            BigDecimal old_size, BigDecimal new_funds,
                            BigDecimal old_funds, String reason,
                            BigDecimal remaining_size, String maker_order_id,
                            String taker_order_id, String taker_user_id, String user_id,
                            String taker_profile_id, String profile_id, String last_trade_id,
                            String client_oid, String stp,
                            String message,
                            String open_24h, String volume_24h, String low_24h,
                            String high_24h, String volume_30d, String best_bid,
                            String best_ask, String last_size, Channel[] channels) {
        setType(type);
        setTime(Instant.parse(time));
        setProduct_id(product_id);
        setSequence(sequence);
        this.trade_id = trade_id;
        this.side = side;
        this.order_id = order_id;
        this.order_type = order_type;
        this.funds = funds;
        this.size = size;
        this.price = price;
        this.new_size = new_size;
        this.old_size = old_size;
        this.new_funds = new_funds;
        this.old_funds = old_funds;
        this.reason = reason;
        this.remaining_size = remaining_size;
        this.maker_order_id = maker_order_id;
        this.taker_order_id = taker_order_id;
        this.taker_user_id = taker_user_id;
        this.user_id = user_id;
        this.taker_profile_id = taker_profile_id;
        this.profile_id = profile_id;
        this.last_trade_id = last_trade_id;
        this.client_oid = client_oid;
        this.stp = stp;
        this.message = message;
        this.open_24h = open_24h;
        this.volume_24h = volume_24h;
        this.low_24h = low_24h;
        this.high_24h = high_24h;
        this.volume_30d = volume_30d;
        this.best_bid = best_bid;
        this.best_ask = best_ask;
        this.last_size = last_size;
        this.channels = channels;
    }

    public String getClient_oid() {
        return client_oid;
    }

    public void setClient_oid(String client_oid) {
        this.client_oid = client_oid;
    }

    public String getStp() {
        return stp;
    }

    public void setStp(String stp) {
        this.stp = stp;
    }

    public String getTrade_id() {
        return trade_id;
    }

    public void setTrade_id(String trade_id) {
        this.trade_id = trade_id;
    }

    public String getSide() {
        return side;
    }

    public void setSide(String side) {
        this.side = side;
    }

    public String getOrder_id() {
        return order_id;
    }

    public void setOrder_id(String order_id) {
        this.order_id = order_id;
    }

    public String getOrder_type() {
        return order_type;
    }

    public void setOrder_type(String order_type) {
        this.order_type = order_type;
    }

    public BigDecimal getFunds() {
        return funds;
    }

    public void setFunds(BigDecimal funds) {
        this.funds = funds;
    }

    public BigDecimal getSize() {
        return size;
    }

    public void setSize(BigDecimal size) {
        this.size = size;
    }

    public BigDecimal getPrice() {
        return price.setScale(8, RoundingMode.HALF_UP);
    }

    public void setPrice(BigDecimal price) {
        this.price = price;
    }

    public BigDecimal getNew_size() {
        return new_size;
    }

    public void setNew_size(BigDecimal new_size) {
        this.new_size = new_size;
    }

    public BigDecimal getOld_size() {
        return old_size;
    }

    public void setOld_size(BigDecimal old_size) {
        this.old_size = old_size;
    }

    public BigDecimal getNew_funds() {
        return new_funds;
    }

    public void setNew_funds(BigDecimal new_funds) {
        this.new_funds = new_funds;
    }

    public BigDecimal getOld_funds() {
        return old_funds;
    }

    public void setOld_funds(BigDecimal old_funds) {
        this.old_funds = old_funds;
    }

    public String getReason() {
        return reason;
    }

    public void setReason(String reason) {
        this.reason = reason;
    }

    public BigDecimal getRemaining_size() {
        return remaining_size;
    }

    public void setRemaining_size(BigDecimal remaining_size) {
        this.remaining_size = remaining_size;
    }

    public String getMaker_order_id() {
        return maker_order_id;
    }

    public void setMaker_order_id(String maker_order_id) {
        this.maker_order_id = maker_order_id;
    }

    public String getTaker_order_id() {
        return taker_order_id;
    }

    public void setTaker_order_id(String taker_order_id) {
        this.taker_order_id = taker_order_id;
    }

    public String getTaker_user_id() {
        return taker_user_id;
    }

    public void setTaker_user_id(String taker_user_id) {
        this.taker_user_id = taker_user_id;
    }

    public String getUser_id() {
        return user_id;
    }

    public void setUser_id(String user_id) {
        this.user_id = user_id;
    }

    public String getTaker_profile_id() {
        return taker_profile_id;
    }

    public void setTaker_profile_id(String taker_profile_id) {
        this.taker_profile_id = taker_profile_id;
    }

    public String getProfile_id() {
        return profile_id;
    }

    public void setProfile_id(String profile_id) {
        this.profile_id = profile_id;
    }
    public String getLast_trade_id() {
        return last_trade_id;
    }

    public void setLast_trade_id(String last_trade_id) {
        this.last_trade_id = last_trade_id;
    }

    public String getMessage() {
        return message;
    }

    public void setMessage(String message) {
        this.message = message;
    }

    public String getOpen_24h() {
        return open_24h;
    }

    public void setOpen_24h(String open_24h) {
        this.open_24h = open_24h;
    }

    public String getVolume_24h() {
        return volume_24h;
    }

    public void setVolume_24h(String volume_24h) {
        this.volume_24h = volume_24h;
    }

    public String getLow_24h() {
        return low_24h;
    }

    public void setLow_24h(String low_24h) {
        this.low_24h = low_24h;
    }

    public String getHigh_24h() {
        return high_24h;
    }

    public void setHigh_24h(String high_24h) {
        this.high_24h = high_24h;
    }

    public String getVolume_30d() {
        return volume_30d;
    }

    public void setVolume_30d(String volume_30d) {
        this.volume_30d = volume_30d;
    }

    public String getBest_bid() {
        return best_bid;
    }

    public void setBest_bid(String best_bid) {
        this.best_bid = best_bid;
    }

    public String getBest_ask() {
        return best_ask;
    }

    public void setBest_ask(String best_ask) {
        this.best_ask = best_ask;
    }

    public String getLast_size() {
        return last_size;
    }

    public void setLast_size(String last_size) {
        this.last_size = last_size;
    }

    public Channel[] getChannels() {
        return channels;
    }

    public void setChannels(Channel[] channels) {
        this.channels = channels;
    }

    @Override
    public int compareTo(OrderBookMessage other) {
        return this.getSequence().compareTo(other.getSequence());
    }

    @Override
    public String toString() {
        return "OrderBookMessage{" +
                "side='" + side + '\'' +
                ", type='" + getType() + '\'' +
                ", size=" + size +
                ", price=" + getPrice() +
                ", remaining_size=" + remaining_size +
                ", sequence=" + getSequence() +
                '}';
    }

    public static class OrderBookMessageBuilder {
        private final OrderBookMessage message = new OrderBookMessage();

        public OrderBookMessageBuilder setType(String type) {
            message.setType(type);
            return this;
        }
        public OrderBookMessageBuilder setSide(String side) {
            message.setSide(side);
            return this;
        }

        public OrderBookMessageBuilder setPrice(BigDecimal price) {
            message.setPrice(price);
            return this;
        }

        public OrderBookMessageBuilder setSize(BigDecimal size) {
            message.setSize(size);
            return this;
        }

        public OrderBookMessageBuilder setRemainingSize(BigDecimal remaininSize) {
            message.setRemaining_size(remaininSize);
            return this;
        }

        public OrderBookMessageBuilder setSequence(Long id) {
            message.setSequence(id);
            return this;
        }

        public OrderBookMessage build() {
            return message;
        }
    }
}


================================================
FILE: websocketfeed/src/main/java/com/coinbase/exchange/websocketfeed/ReceivedOrderBookMessage.java
================================================
package com.coinbase.exchange.websocketfeed;


/**
 * A valid order has been received and is now active. This message is
 * emitted for every single valid order as soon as the matching engine
 * receives it whether it fills immediately or not.
 *
 * The received message does not indicate a resting order on the order book.
 * It simply indicates a new incoming order which as been accepted by the
 * matching engine for processing. Received orders may cause match message
 * to follow if they are able to begin being filled (taker behavior).
 * Self-trade prevention may also trigger change messages to follow if the
 * order size needs to be adjusted. Orders which are not fully filled or
 * canceled due to self-trade prevention result in an open message and
 * become resting orders on the order book.
 *
 * Market orders (indicated by the order_type field) may have an optional
 * funds field which indicates how much quote currency will be used to buy
 * or sell. For example, a funds field of 100.00 for the BTC-USD product
 * would indicate a purchase of up to 100.00 USD worth of bitcoin.
 * <pre>
 * {
 *    "type": "received",
 *    "time": "2014-11-07T08:19:27.028459Z",
 *    "product_id": "BTC-USD",
 *    "sequence": 10,
 *    "order_id": "d50ec984-77a8-460a-b958-66f114b0de9b",
 *    "size": "1.34",
 *    "price": "502.1",
 *    "side": "buy",
 *    "order_type": "limit"
 *  }
 *
 *  {
 *    "type": "received",
 *    "time": "2014-11-09T08:19:27.028459Z",
 *    "product_id": "BTC-USD",
 *    "sequence": 12,
 *    "order_id": "dddec984-77a8-460a-b958-66f114b0de9b",
 *    "funds": "3000.234",
 *    "side": "buy",
 *    "order_type": "market"
 *  }
 * </pre>
 */
public class ReceivedOrderBookMessage extends OrderBookMessage {

    public ReceivedOrderBookMessage() {
        setType("received");
    }
}


================================================
FILE: websocketfeed/src/main/java/com/coinbase/exchange/websocketfeed/SnapshotMessage.java
================================================
package com.coinbase.exchange.websocketfeed;

/**
 * A snapshot of the order book
 * Example:
 * <pre>
 * {
 *     "type": "snapshot",
 *     "product_id": "BTC-USD",
 *     "bids": [["10101.10", "0.45054140"]],
 *     "asks": [["10102.55", "0.57753524"]]
 * }
 * </pre>
 */
public class SnapshotMessage extends FeedMessage {

    private String[][] bids;
    private String[][] asks;

    public SnapshotMessage() {
        setType("snapshot");
    }

    public SnapshotMessage(String[][] bids, String[][] asks) {
        this();
        this.bids = bids;
        this.asks = asks;
    }

    public String[][] getBids() {
        return bids;
    }

    public void setBids(String[][] bids) {
        this.bids = bids;
    }

    public String[][] getAsks() {
        return asks;
    }

    public void setAsks(String[][] asks) {
        this.asks = asks;
    }
}


================================================
FILE: websocketfeed/src/main/java/com/coinbase/exchange/websocketfeed/StatusMessage.java
================================================
package com.coinbase.exchange.websocketfeed;

import com.coinbase.exchange.model.Currency;
import com.coinbase.exchange.model.Product;

/**
 * The status channel will send all products and currencies on a preset interval.
 * Example:
 * <pre>
 * {
 *     "type": "status",
 *     "products": [
 *         {
 *             "id": "BTC-USD",
 *             "base_currency": "BTC",
 *             "quote_currency": "USD",
 *             "base_min_size": "0.001",
 *             "base_max_size": "70",
 *             "base_increment": "0.00000001",
 *             "quote_increment": "0.01",
 *             "display_name": "BTC/USD",
 *             "status": "online",
 *             "status_message": null,
 *             "min_market_funds": "10",
 *             "max_market_funds": "1000000",
 *             "post_only": false,
 *             "limit_only": false,
 *             "cancel_only": false
 *         }
 *     ],
 *     "currencies": [
 *         {
 *             "id": "USD",
 *             "name": "United States Dollar",
 *             "min_size": "0.01000000",
 *             "status": "online",
 *             "status_message": null,
 *             "max_precision": "0.01",
 *             "convertible_to": ["USDC"],
 *             "details": {}
 *         },
 *         {
 *             "id": "USDC",
 *             "name": "USD Coin",
 *             "min_size": "0.00000100",
 *             "status": "online",
 *             "status_message": null,
 *             "max_precision": "0.000001",
 *             "convertible_to": ["USD"],
 *             "details": {}
 *         },
 *         {
 *             "id": "BTC",
 *             "name": "Bitcoin",
 *             "min_size":" 0.00000001",
 *             "status": "online",
 *             "status_message": null,
 *             "max_precision": "0.00000001",
 *             "convertible_to": []
 *         }
 *     ]
 * }
 * </pre>
 */
public class StatusMessage extends FeedMessage {

    private Product[] products;
    private Currency[] currencies;

    public StatusMessage() {
        setType("status");
    }

    public StatusMessage(Product[] products, Currency[] currencies) {
        this();
        this.products = products;
        this.currencies = currencies;
    }

    public Product[] getProducts() {
        return products;
    }

    public void setProducts(Product[] products) {
        this.products = products;
    }

    public Currency[] getCurrencies() {
        return currencies;
    }

    public void setCurrencies(Currency[] currencies) {
        this.currencies = currencies;
    }
}

================================================
FILE: websocketfeed/src/main/java/com/coinbase/exchange/websocketfeed/Subscribe.java
================================================
package com.coinbase.exchange.websocketfeed;

import static com.coinbase.exchange.websocketfeed.ChannelName.full;

/**
 * To begin receiving feed messages, you must first send a subscribe message
 * indicating which channels and products to receive.
 * Example:
 * Subscribe to ETH-USD and ETH-EUR with the level2, heartbeat and ticker channels,
 * plus receive the ticker entries for ETH-BTC and ETH-USD
 * <pre>
 * {
 *   "type": "subscribe",
 *   "product_ids": [
 *     "ETH-USD",
 *     "ETH-EUR"
 *   ],
 *   "channels": [
 *     "level2",
 *     "heartbeat",
 *     {
 *       "name": "ticker",
 *       "product_ids": [
 *         "ETH-BTC",
 *         "ETH-USD"
 *       ]
 *     }
 *   ]
 * }
 * </pre>
 *
 * See docs https://docs.pro.coinbase.com/#subscribe
 */
public class Subscribe {

    private final static String SUBSCRIBE_MSG_TYPE = "subscribe";

    private String type = SUBSCRIBE_MSG_TYPE;
    private String[] product_ids;
    private Channel[] channels;

    // Used for signing the subscribe message to the Websocket feed
    private String signature;
    private String passphrase;
    private String timestamp;
    private String apiKey;

    public Subscribe() { }

    public Subscribe(String[] product_ids) {
        this.product_ids = product_ids;
        this.channels = new Channel[]{new Channel(full, product_ids)};
    }

    public String getType() {
        return type;
    }

    public void setType(String type) {
        this.type = type;
    }

    public String[] getProduct_ids() {
        return product_ids;
    }

    public void setProduct_ids(String[] product_ids) {
        this.product_ids = product_ids;
    }

    public Subscribe setSignature(String signature) {
        this.signature = signature;
        return this;
    }

    public Subscribe setPassphrase(String passphrase) {
        this.passphrase = passphrase;
        return this;
    }

    public Subscribe setTimestamp(String timestamp) {
        this.timestamp = timestamp;
        return this;
    }

    public Subscribe setKey(String apiKey) {
        this.apiKey = apiKey;
        return this;
    }

    public void setChannels(Channel[] channels) {
        this.channels = channels;
    }

    public Channel[] getChannels() {
        return channels;
    }
}


================================================
FILE: websocketfeed/src/main/java/com/coinbase/exchange/websocketfeed/SubscriptionsMessage.java
================================================
package com.coinbase.exchange.websocketfeed;

/**
 * <pre>
 * {
 *     "type": "subscriptions",
 *     "channels": [
 *         {
 *             "name": "level2",
 *             "product_ids": [
 *                 "ETH-USD",
 *                 "ETH-EUR"
 *             ],
 *         },
 *         {
 *             "name": "heartbeat",
 *             "product_ids": [
 *                 "ETH-USD",
 *                 "ETH-EUR"
 *             ],
 *         },
 *         {
 *             "name": "ticker",
 *             "product_ids": [
 *                 "ETH-USD",
 *                 "ETH-EUR",
 *                 "ETH-BTC"
 *             ]
 *         }
 *     ]
 * }
 * </pre>
 */
public class SubscriptionsMessage extends FeedMessage {

    private Channel[] channels;



    public Channel[] getChannels() {
        return channels;
    }

    public void setChannels(Channel[] channels) {
        this.channels = channels;
    }
}


================================================
FILE: websocketfeed/src/main/java/com/coinbase/exchange/websocketfeed/TickerMessage.java
================================================
package com.coinbase.exchange.websocketfeed;

import java.math.BigDecimal;
import java.time.Instant;

/**
 * The ticker channel provides real-time price updates every time a match happens
 * <pre>
 * {
 *     "type": "ticker",
 *     "trade_id": 20153558,
 *     "sequence": 3262786978,
 *     "time": "2017-09-02T17:05:49.250000Z",
 *     "product_id": "BTC-USD",
 *     "price": "4388.01000000",
 *     "side": "buy", // Taker side
 *     "last_size": "0.03000000",
 *     "best_bid": "4388",
 *     "best_ask": "4388.01"
 * }
 * </pre>
 */
public class TickerMessage extends FeedMessage {

    private Long trade_id;
    private Long sequence;
    private Instant time;
    private String product_id;
    private BigDecimal price;
    private String side;
    private BigDecimal last_size;
    private BigDecimal best_bid;
    private BigDecimal best_ask;

    public TickerMessage() {
        setType("ticker");
    }

    public TickerMessage(Long trade_id,
                         Long sequence,
                    
Download .txt
gitextract_ohny94n4/

├── .github/
│   └── workflows/
│       └── build.yaml
├── .gitignore
├── CONTRIBUTING.md
├── LICENSE
├── README.md
├── api/
│   ├── build.gradle
│   └── src/
│       ├── main/
│       │   └── java/
│       │       └── com/
│       │           └── coinbase/
│       │               └── exchange/
│       │                   └── api/
│       │                       ├── accounts/
│       │                       │   ├── Account.java
│       │                       │   ├── AccountHistory.java
│       │                       │   └── AccountService.java
│       │                       ├── deposits/
│       │                       │   └── DepositService.java
│       │                       ├── exchange/
│       │                       │   ├── CoinbaseExchange.java
│       │                       │   └── CoinbaseExchangeImpl.java
│       │                       ├── marketdata/
│       │                       │   ├── MarketData.java
│       │                       │   ├── MarketDataService.java
│       │                       │   ├── Message.java
│       │                       │   ├── MessageEX.java
│       │                       │   ├── OrderItem.java
│       │                       │   └── Trade.java
│       │                       ├── orders/
│       │                       │   ├── Order.java
│       │                       │   ├── OrderBuilder.java
│       │                       │   └── OrderService.java
│       │                       ├── payments/
│       │                       │   ├── AccountLimit.java
│       │                       │   ├── Amount.java
│       │                       │   ├── BankCountry.java
│       │                       │   ├── CoinbaseAccount.java
│       │                       │   ├── DepositInformation.java
│       │                       │   ├── Limit.java
│       │                       │   ├── PaymentService.java
│       │                       │   ├── PaymentType.java
│       │                       │   └── SepaDepositInformation.java
│       │                       ├── products/
│       │                       │   └── ProductService.java
│       │                       ├── reports/
│       │                       │   ├── ReportRequest.java
│       │                       │   ├── ReportResponse.java
│       │                       │   ├── ReportService.java
│       │                       │   └── TimePeriod.java
│       │                       ├── transfers/
│       │                       │   ├── Transfer.java
│       │                       │   └── TransferService.java
│       │                       ├── useraccount/
│       │                       │   ├── UserAccountData.java
│       │                       │   └── UserAccountService.java
│       │                       └── withdrawals/
│       │                           └── WithdrawalsService.java
│       └── test/
│           ├── java/
│           │   └── com/
│           │       └── coinbase/
│           │           └── exchange/
│           │               └── api/
│           │                   ├── BaseIntegrationTest.java
│           │                   ├── TestExchangeApplication.java
│           │                   ├── accounts/
│           │                   │   ├── AccountsIntegrationTest.java
│           │                   │   ├── DepositIntegrationTest.java
│           │                   │   ├── UserAccountServiceIntegrationTest.java
│           │                   │   └── WithdrawalIntegrationTest.java
│           │                   ├── authentication/
│           │                   │   └── AuthenticationIntegrationIntegrationTest.java
│           │                   ├── config/
│           │                   │   └── IntegrationTestConfiguration.java
│           │                   ├── marketdata/
│           │                   │   ├── MarketDataIntegrationTest.java
│           │                   │   └── OrderItemDeserializerTest.java
│           │                   ├── orders/
│           │                   │   └── OrderIntegrationTest.java
│           │                   ├── payments/
│           │                   │   └── PaymentIntegrationTest.java
│           │                   ├── products/
│           │                   │   └── ProductsIntegrationTest.java
│           │                   └── transfers/
│           │                       └── TransferServiceIntegrationTest.java
│           └── resources/
│               └── application-test.yml
├── build.gradle
├── gradle/
│   └── wrapper/
│       ├── gradle-wrapper.jar
│       └── gradle-wrapper.properties
├── gradlew
├── gradlew.bat
├── model/
│   ├── build.gradle
│   └── src/
│       └── main/
│           └── java/
│               └── com/
│                   └── coinbase/
│                       └── exchange/
│                           └── model/
│                               ├── Candle.java
│                               ├── Candles.java
│                               ├── CoinbasePaymentRequest.java
│                               ├── CryptoPaymentRequest.java
│                               ├── Currency.java
│                               ├── Detail.java
│                               ├── Fill.java
│                               ├── Granularity.java
│                               ├── Hold.java
│                               ├── MonetaryRequest.java
│                               ├── NewLimitOrderSingle.java
│                               ├── NewMarketOrderSingle.java
│                               ├── NewOrderSingle.java
│                               ├── PaymentRequest.java
│                               ├── PaymentResponse.java
│                               ├── Product.java
│                               └── ProductOrderBook.java
├── security/
│   ├── build.gradle
│   └── src/
│       └── main/
│           └── java/
│               └── com/
│                   └── coinbase/
│                       └── exchange/
│                           └── security/
│                               ├── Signature.java
│                               └── constants/
│                                   └── ExchangeConstants.java
├── settings.gradle
└── websocketfeed/
    ├── build.gradle
    └── src/
        ├── main/
        │   └── java/
        │       └── com/
        │           └── coinbase/
        │               └── exchange/
        │                   └── websocketfeed/
        │                       ├── ActivateOrderBookMessage.java
        │                       ├── ChangedOrderBookMessage.java
        │                       ├── Channel.java
        │                       ├── ChannelName.java
        │                       ├── DoneOrderBookMessage.java
        │                       ├── ErrorOrderBookMessage.java
        │                       ├── FeedMessage.java
        │                       ├── HeartBeat.java
        │                       ├── L2UpdateMessage.java
        │                       ├── MatchedOrderBookMessage.java
        │                       ├── OpenedOrderBookMessage.java
        │                       ├── OrderBookMessage.java
        │                       ├── ReceivedOrderBookMessage.java
        │                       ├── SnapshotMessage.java
        │                       ├── StatusMessage.java
        │                       ├── Subscribe.java
        │                       ├── SubscriptionsMessage.java
        │                       ├── TickerMessage.java
        │                       ├── WebsocketFeed.java
        │                       └── WebsocketMessageHandler.java
        └── test/
            └── java/
                └── com/
                    └── coinbase/
                        └── exchange/
                            └── websocketfeed/
                                ├── ActivateOrderBookMessageTest.java
                                ├── ChangedOrderBookMessageTest.java
                                ├── DoneOrderBookMessageTest.java
                                ├── ErrorOrderBookMessageTest.java
                                ├── HeartBeatTest.java
                                ├── L2UpdateMessageTest.java
                                ├── MatchedOrderBookMessageTest.java
                                ├── OpenedOrderBookMessageTest.java
                                ├── ReceivedOrderBookMessageTest.java
                                ├── SnapshotMessageTest.java
                                ├── StatusMessageTest.java
                                └── TickerMessageTest.java
Download .txt
SYMBOL INDEX (886 symbols across 99 files)

FILE: api/src/main/java/com/coinbase/exchange/api/accounts/Account.java
  class Account (line 8) | public class Account {
    method Account (line 16) | public Account() {
    method Account (line 22) | public Account(String id,
    method getId (line 36) | public String getId() {
    method setId (line 40) | public void setId(String id) {
    method getBalance (line 44) | public BigDecimal getBalance() {
    method setBalance (line 48) | public void setBalance(BigDecimal balance) {
    method getHold (line 52) | public BigDecimal getHold() {
    method setHold (line 56) | public void setHold(BigDecimal hold) {
    method getAvailable (line 60) | public BigDecimal getAvailable() {
    method setAvailable (line 64) | public void setAvailable(BigDecimal available) {
    method getCurrency (line 68) | public String getCurrency() {
    method setCurrency (line 72) | public void setCurrency(String currency) {
    method getProfile_id (line 76) | public String getProfile_id() {
    method setProfile_id (line 80) | public void setProfile_id(String profile_id) {

FILE: api/src/main/java/com/coinbase/exchange/api/accounts/AccountHistory.java
  class AccountHistory (line 10) | public class AccountHistory {
    method AccountHistory (line 18) | public AccountHistory() {}
    method getId (line 20) | public Integer getId() {
    method setId (line 24) | public void setId(Integer id) {
    method getCreated_at (line 28) | public String getCreated_at() {
    method setCreated_at (line 32) | public void setCreated_at(String created_at) {
    method getAmount (line 36) | public BigDecimal getAmount() {
    method setAmount (line 40) | public void setAmount(BigDecimal amount) {
    method getBalance (line 44) | public BigDecimal getBalance() {
    method setBalance (line 48) | public void setBalance(BigDecimal balance) {
    method getType (line 52) | public String getType() {
    method setType (line 56) | public void setType(String type) {
    method getDetail (line 60) | public Detail getDetail() {
    method setDetail (line 64) | public void setDetail(Detail detail) {

FILE: api/src/main/java/com/coinbase/exchange/api/accounts/AccountService.java
  class AccountService (line 12) | public class AccountService {
    method AccountService (line 16) | public AccountService(final CoinbaseExchange exchange) {
    method getAccounts (line 22) | public List<Account> getAccounts(){
    method getAccount (line 26) | public Account getAccount(String id) {
    method getAccountHistory (line 30) | public List<AccountHistory> getAccountHistory(String accountId) {
    method getPagedAccountHistory (line 35) | public List<AccountHistory> getPagedAccountHistory(String accountId,
    method getHolds (line 48) | public List<Hold> getHolds(String accountId) {
    method getPagedHolds (line 53) | public List<Hold> getPagedHolds(String accountId,

FILE: api/src/main/java/com/coinbase/exchange/api/deposits/DepositService.java
  class DepositService (line 13) | public class DepositService {
    method DepositService (line 21) | public DepositService(final CoinbaseExchange exchange) {
    method depositViaPaymentMethod (line 31) | public PaymentResponse depositViaPaymentMethod(BigDecimal amount, Stri...
    method depositViaCoinbase (line 44) | public PaymentResponse depositViaCoinbase(BigDecimal amount, String cu...

FILE: api/src/main/java/com/coinbase/exchange/api/exchange/CoinbaseExchange.java
  type CoinbaseExchange (line 8) | public interface CoinbaseExchange {
    method getBaseUrl (line 10) | String getBaseUrl();
    method securityHeaders (line 11) | <R> HttpEntity<String> securityHeaders(String endpoint, String method,...
    method get (line 12) | <T> T get(String endpoint, ParameterizedTypeReference<T> type);
    method pagedGet (line 13) | <T> T pagedGet(String endpoint, ParameterizedTypeReference<T> response...
    method getAsList (line 14) | <T> List<T> getAsList(String endpoint, ParameterizedTypeReference<T[]>...
    method pagedGetAsList (line 15) | <T> List<T> pagedGetAsList(String endpoint, ParameterizedTypeReference...
    method post (line 16) | <T, R> T post(String endpoint, ParameterizedTypeReference<T> type, R j...
    method delete (line 17) | <T> T delete(String endpoint, ParameterizedTypeReference<T> type);

FILE: api/src/main/java/com/coinbase/exchange/api/exchange/CoinbaseExchangeImpl.java
  class CoinbaseExchangeImpl (line 26) | public class CoinbaseExchangeImpl implements CoinbaseExchange {
    method CoinbaseExchangeImpl (line 37) | public CoinbaseExchangeImpl(final String publicKey,
    method get (line 50) | @Override
    method getAsList (line 66) | @Override
    method pagedGet (line 73) | @Override
    method pagedGetAsList (line 83) | @Override
    method delete (line 93) | @Override
    method post (line 107) | @Override
    method getBaseUrl (line 123) | @Override
    method securityHeaders (line 128) | @Override
    method curlRequest (line 153) | private void curlRequest(String method, String jsonBody, HttpHeaders h...
    method toJson (line 165) | private String toJson(Object object) {

FILE: api/src/main/java/com/coinbase/exchange/api/marketdata/MarketData.java
  class MarketData (line 8) | public class MarketData {
    method MarketData (line 14) | public MarketData() { }
    method MarketData (line 16) | public MarketData(Long sequence, List<OrderItem> bids, List<OrderItem>...
    method getSequence (line 22) | public Long getSequence() {
    method setSequence (line 26) | public void setSequence(Long sequence) {
    method getBids (line 30) | public List<OrderItem> getBids() {
    method setBids (line 34) | public void setBids(List<OrderItem> bids) {
    method getAsks (line 38) | public List<OrderItem> getAsks() {
    method setAsks (line 42) | public void setAsks(List<OrderItem> asks) {

FILE: api/src/main/java/com/coinbase/exchange/api/marketdata/MarketDataService.java
  class MarketDataService (line 11) | public class MarketDataService {
    method MarketDataService (line 15) | public MarketDataService(final CoinbaseExchange exchange) {
    method getMarketDataOrderBook (line 21) | public MarketData getMarketDataOrderBook(String productId, int level) {
    method getTrades (line 28) | public List<Trade> getTrades(String productId) {

FILE: api/src/main/java/com/coinbase/exchange/api/marketdata/Message.java
  class Message (line 8) | public class Message {
    method getRemaining_size (line 21) | public BigDecimal getRemaining_size() {
    method setRemaining_size (line 25) | public void setRemaining_size(BigDecimal remaining_size) {
    method getSide (line 29) | public String getSide() {
    method setSide (line 33) | public void setSide(String side) {
    method getPrice (line 37) | public BigDecimal getPrice() {
    method setPrice (line 41) | public void setPrice(BigDecimal price) {
    method getSize (line 45) | public BigDecimal getSize() {
    method setSize (line 49) | public void setSize(BigDecimal size) {
    method getOrder_id (line 53) | public String getOrder_id() {
    method setOrder_id (line 57) | public void setOrder_id(String order_id) {
    method getSequence (line 61) | public Long getSequence() {
    method setSequence (line 65) | public void setSequence(Long sequence) {
    method getType (line 69) | public String getType() {
    method setType (line 73) | public void setType(String type) {
    method getReason (line 77) | public String getReason() {
    method setReason (line 81) | public void setReason(String reason) {
    method getMaker_order_id (line 85) | public String getMaker_order_id() {
    method setMaker_order_id (line 89) | public void setMaker_order_id(String maker_order_id) {
    method getTaker_order_id (line 93) | public String getTaker_order_id() {
    method setTaker_order_id (line 97) | public void setTaker_order_id(String taker_order_id) {
    method getTime (line 101) | public String getTime() {
    method setTime (line 105) | public void setTime(String time) {

FILE: api/src/main/java/com/coinbase/exchange/api/marketdata/MessageEX.java
  class MessageEX (line 6) | public class MessageEX {
    class MessageType (line 7) | public static class MessageType{
    class MessageSide (line 15) | public static class MessageSide{

FILE: api/src/main/java/com/coinbase/exchange/api/marketdata/OrderItem.java
  class OrderItem (line 12) | public class OrderItem implements Comparable {
    method OrderItem (line 19) | @JsonCreator
    method getPrice (line 35) | public BigDecimal getPrice() {
    method getSize (line 39) | public BigDecimal getSize() {
    method getOrderId (line 43) | public String getOrderId() {
    method getNum (line 47) | public BigDecimal getNum() {
    method compareTo (line 51) | @Override
    method isString (line 56) | public boolean isString(String value) {

FILE: api/src/main/java/com/coinbase/exchange/api/marketdata/Trade.java
  class Trade (line 9) | public class Trade {
    method Trade (line 16) | public Trade() {}
    method Trade (line 18) | public Trade(Instant time, Long trade_id, BigDecimal price, BigDecimal...
    method getTime (line 26) | public Instant getTime() {
    method setTime (line 30) | public void setTime(Instant time) {
    method getTrade_id (line 34) | public Long getTrade_id() {
    method setTrade_id (line 38) | public void setTrade_id(Long trade_id) {
    method getPrice (line 42) | public BigDecimal getPrice() {
    method setPrice (line 46) | public void setPrice(BigDecimal price) {
    method getSize (line 50) | public BigDecimal getSize() {
    method setSize (line 54) | public void setSize(BigDecimal size) {
    method getSide (line 58) | public String getSide() {
    method setSide (line 62) | public void setSide(String side) {
    method toString (line 66) | public String toString(){

FILE: api/src/main/java/com/coinbase/exchange/api/orders/Order.java
  class Order (line 6) | public class Order {
    method Order (line 22) | public Order() {}
    method Order (line 24) | public Order(String id, String price, String size, String product_id, ...
    method Order (line 46) | public Order(OrderBuilder builder) {
    method getId (line 59) | public String getId() {
    method setId (line 63) | public void setId(String id) {
    method getPrice (line 67) | public String getPrice() {
    method setPrice (line 71) | public void setPrice(String price) {
    method getSize (line 75) | public String getSize() {
    method setSize (line 79) | public void setSize(String size) {
    method getProduct_id (line 83) | public String getProduct_id() {
    method setProduct_id (line 87) | public void setProduct_id(String product_id) {
    method getSide (line 91) | public String getSide() {
    method setSide (line 95) | public void setSide(String side) {
    method getStp (line 99) | public String getStp() {
    method setStp (line 103) | public void setStp(String stp) {
    method getType (line 107) | public String getType() {
    method setType (line 111) | public void setType(String type) {
    method getTime_in_force (line 115) | public String getTime_in_force() {
    method setTime_in_force (line 119) | public void setTime_in_force(String time_in_force) {
    method getPost_only (line 123) | public String getPost_only() {
    method setPost_only (line 127) | public void setPost_only(String post_only) {
    method getCreated_at (line 131) | public String getCreated_at() {
    method setCreated_at (line 135) | public void setCreated_at(String created_at) {
    method getFill_fees (line 139) | public String getFill_fees() {
    method setFill_fees (line 143) | public void setFill_fees(String fill_fees) {
    method getFilled_size (line 147) | public String getFilled_size() {
    method setFilled_size (line 151) | public void setFilled_size(String filled_size) {
    method getExecuted_value (line 155) | public String getExecuted_value() {
    method setExecuted_value (line 159) | public void setExecuted_value(String executed_value) {
    method getStatus (line 163) | public String getStatus() {
    method setStatus (line 167) | public void setStatus(String status) {
    method getSettled (line 171) | public Boolean getSettled() {
    method setSettled (line 175) | public void setSettled(Boolean settled) {
    method toString (line 179) | public String toString() {

FILE: api/src/main/java/com/coinbase/exchange/api/orders/OrderBuilder.java
  class OrderBuilder (line 6) | public class OrderBuilder {
    method setId (line 19) | public OrderBuilder setId(String id) {
    method setSize (line 24) | public OrderBuilder setSize(String size) {
    method setPrice (line 29) | public OrderBuilder setPrice(String price) {
    method setProduct_id (line 34) | public OrderBuilder setProduct_id(String product_id) {
    method setStatus (line 39) | public OrderBuilder setStatus(String status) {
    method setFilled_size (line 44) | public OrderBuilder setFilled_size(String filled_size) {
    method setFill_fees (line 49) | public OrderBuilder setFill_fees(String fill_fees) {
    method setSettled (line 54) | public OrderBuilder setSettled(Boolean settled) {
    method setSide (line 59) | public OrderBuilder setSide(String side) {
    method setCreated_at (line 64) | public OrderBuilder setCreated_at(String created_at) {
    method getId (line 69) | public String getId() {
    method getSize (line 73) | public String getSize() {
    method getPrice (line 77) | public String getPrice() {
    method getProduct_id (line 81) | public String getProduct_id() {
    method getStatus (line 85) | public String getStatus() {
    method getFilled_size (line 89) | public String getFilled_size() {
    method getFill_fees (line 93) | public String getFill_fees() {
    method getSettled (line 97) | public Boolean getSettled() {
    method getSide (line 101) | public String getSide() {
    method getCreated_at (line 105) | public String getCreated_at() {
    method build (line 109) | public Order build() {

FILE: api/src/main/java/com/coinbase/exchange/api/orders/OrderService.java
  class OrderService (line 15) | public class OrderService {
    method OrderService (line 21) | public OrderService(final CoinbaseExchange exchange) {
    method getHolds (line 25) | public List<Hold> getHolds(String accountId) {
    method getOpenOrders (line 29) | public List<Order> getOpenOrders(String accountId) {
    method getOrder (line 33) | public Order getOrder(String orderId) {
    method createOrder (line 37) | public Order createOrder(NewOrderSingle order) {
    method cancelOrder (line 41) | public String cancelOrder(String orderId) {
    method getOpenOrders (line 46) | public List<Order> getOpenOrders() {
    method cancelAllOpenOrders (line 50) | public List<Order> cancelAllOpenOrders() {
    method getFillsByProductId (line 54) | public List<Fill> getFillsByProductId(String product_id, int resultLim...
    method getFillByOrderId (line 58) | public List<Fill> getFillByOrderId(String order_id, int resultLimit) {

FILE: api/src/main/java/com/coinbase/exchange/api/payments/AccountLimit.java
  class AccountLimit (line 6) | public class AccountLimit {
    method AccountLimit (line 12) | public AccountLimit() {}
    method AccountLimit (line 14) | public AccountLimit(Integer period_in_days, Amount total, Amount remai...
    method getPeriod_in_days (line 20) | public Integer getPeriod_in_days() {
    method setPeriod_in_days (line 24) | public void setPeriod_in_days(Integer period_in_days) {
    method getTotal (line 28) | public Amount getTotal() {
    method setTotal (line 32) | public void setTotal(Amount total) {
    method getRemaining (line 36) | public Amount getRemaining() {
    method setRemaining (line 40) | public void setRemaining(Amount remaining) {

FILE: api/src/main/java/com/coinbase/exchange/api/payments/Amount.java
  class Amount (line 8) | public class Amount {
    method Amount (line 13) | public Amount() {}
    method Amount (line 15) | public Amount(BigDecimal amount, String currency) {
    method getAmount (line 20) | public BigDecimal getAmount() {
    method setAmount (line 24) | public void setAmount(BigDecimal amount) {
    method getCurrency (line 28) | public String getCurrency() {
    method setCurrency (line 32) | public void setCurrency(String currency) {

FILE: api/src/main/java/com/coinbase/exchange/api/payments/BankCountry.java
  class BankCountry (line 6) | public class BankCountry {
    method BankCountry (line 11) | public BankCountry() {}
    method BankCountry (line 13) | public BankCountry(String code, String name) {
    method getCode (line 18) | public String getCode() {
    method setCode (line 22) | public void setCode(String code) {
    method getName (line 26) | public String getName() {
    method setName (line 30) | public void setName(String name) {

FILE: api/src/main/java/com/coinbase/exchange/api/payments/CoinbaseAccount.java
  class CoinbaseAccount (line 8) | public class CoinbaseAccount {
    method CoinbaseAccount (line 20) | public CoinbaseAccount() {}
    method CoinbaseAccount (line 22) | public CoinbaseAccount(String id,
    method getId (line 42) | public String getId() {
    method setId (line 46) | public void setId(String id) {
    method getName (line 50) | public String getName() {
    method setName (line 54) | public void setName(String name) {
    method getBalance (line 58) | public BigDecimal getBalance() {
    method setBalance (line 62) | public void setBalance(BigDecimal balance) {
    method getCurrency (line 66) | public String getCurrency() {
    method setCurrency (line 70) | public void setCurrency(String currency) {
    method getType (line 74) | public String getType() {
    method setType (line 78) | public void setType(String type) {
    method getPrimary (line 82) | public Boolean getPrimary() {
    method setPrimary (line 86) | public void setPrimary(Boolean primary) {
    method getActive (line 90) | public Boolean getActive() {
    method setActive (line 94) | public void setActive(Boolean active) {
    method getWire_deposit_information (line 98) | public DepositInformation getWire_deposit_information() {
    method setWire_deposit_information (line 102) | public void setWire_deposit_information(DepositInformation wire_deposi...
    method getSepa_deposit_information (line 106) | public SepaDepositInformation getSepa_deposit_information() {
    method setSepa_deposit_information (line 110) | public void setSepa_deposit_information(SepaDepositInformation sepa_de...

FILE: api/src/main/java/com/coinbase/exchange/api/payments/DepositInformation.java
  class DepositInformation (line 6) | public class DepositInformation {
    method DepositInformation (line 17) | public DepositInformation() {}
    method DepositInformation (line 19) | public DepositInformation(String account_number,
    method getAccount_number (line 37) | public String getAccount_number() {
    method setAccount_number (line 41) | public void setAccount_number(String account_number) {
    method getRouting_number (line 45) | public String getRouting_number() {
    method setRouting_number (line 49) | public void setRouting_number(String routing_number) {
    method getBank_name (line 53) | public String getBank_name() {
    method setBank_name (line 57) | public void setBank_name(String bank_name) {
    method getBank_address (line 61) | public String getBank_address() {
    method setBank_address (line 65) | public void setBank_address(String bank_address) {
    method getBank_country (line 69) | public BankCountry getBank_country() {
    method setBank_country (line 73) | public void setBank_country(BankCountry bank_country) {
    method getAccount_name (line 77) | public String getAccount_name() {
    method setAccount_name (line 81) | public void setAccount_name(String account_name) {
    method getAccount_address (line 85) | public String getAccount_address() {
    method setAccount_address (line 89) | public void setAccount_address(String account_address) {
    method getReference (line 93) | public String getReference() {
    method setReference (line 97) | public void setReference(String reference) {

FILE: api/src/main/java/com/coinbase/exchange/api/payments/Limit.java
  class Limit (line 6) | public class Limit {
    method Limit (line 13) | public Limit() {}
    method Limit (line 15) | public Limit(AccountLimit[] buy, AccountLimit[] instant_buy, AccountLi...
    method getBuy (line 22) | public AccountLimit[] getBuy() {
    method setBuy (line 26) | public void setBuy(AccountLimit[] buy) {
    method getInstant_buy (line 30) | public AccountLimit[] getInstant_buy() {
    method setInstant_buy (line 34) | public void setInstant_buy(AccountLimit[] instant_buy) {
    method getSell (line 38) | public AccountLimit[] getSell() {
    method setSell (line 42) | public void setSell(AccountLimit[] sell) {
    method getDeposit (line 46) | public AccountLimit[] getDeposit() {
    method setDeposit (line 50) | public void setDeposit(AccountLimit[] deposit) {

FILE: api/src/main/java/com/coinbase/exchange/api/payments/PaymentService.java
  class PaymentService (line 11) | public class PaymentService {
    method PaymentService (line 18) | public PaymentService(final CoinbaseExchange coinbaseExchange) {
    method getPaymentTypes (line 22) | public List<PaymentType> getPaymentTypes() {
    method getCoinbaseAccounts (line 26) | public List<CoinbaseAccount> getCoinbaseAccounts() {

FILE: api/src/main/java/com/coinbase/exchange/api/payments/PaymentType.java
  class PaymentType (line 6) | public class PaymentType {
    method PaymentType (line 19) | public PaymentType() {}
    method PaymentType (line 21) | public PaymentType(String id,
    method getId (line 45) | public String getId() {
    method setId (line 49) | public void setId(String id) {
    method getType (line 53) | public String getType() {
    method setType (line 57) | public void setType(String type) {
    method getName (line 61) | public String getName() {
    method setName (line 65) | public void setName(String name) {
    method getCurrency (line 69) | public String getCurrency() {
    method setCurrency (line 73) | public void setCurrency(String currency) {
    method getPrimary_buy (line 77) | public Boolean getPrimary_buy() {
    method setPrimary_buy (line 81) | public void setPrimary_buy(Boolean primary_buy) {
    method getPrimary_sell (line 85) | public Boolean getPrimary_sell() {
    method setPrimary_sell (line 89) | public void setPrimary_sell(Boolean primary_sell) {
    method getAllow_buy (line 93) | public Boolean getAllow_buy() {
    method setAllow_buy (line 97) | public void setAllow_buy(Boolean allow_buy) {
    method getAllow_sell (line 101) | public Boolean getAllow_sell() {
    method setAllow_sell (line 105) | public void setAllow_sell(Boolean allow_sell) {
    method getAllow_deposit (line 109) | public Boolean getAllow_deposit() {
    method setAllow_deposit (line 113) | public void setAllow_deposit(Boolean allow_deposit) {
    method getAllow_withdraw (line 117) | public Boolean getAllow_withdraw() {
    method setAllow_withdraw (line 121) | public void setAllow_withdraw(Boolean allow_withdraw) {
    method getLimits (line 125) | public Limit getLimits() {
    method setLimits (line 129) | public void setLimits(Limit limits) {

FILE: api/src/main/java/com/coinbase/exchange/api/payments/SepaDepositInformation.java
  class SepaDepositInformation (line 6) | public class SepaDepositInformation {
    method SepaDepositInformation (line 17) | public SepaDepositInformation() {}
    method SepaDepositInformation (line 19) | public SepaDepositInformation(String iban,
    method getIban (line 37) | public String getIban() {
    method setIban (line 41) | public void setIban(String iban) {
    method getSwift (line 45) | public String getSwift() {
    method setSwift (line 49) | public void setSwift(String swift) {
    method getBank_name (line 53) | public String getBank_name() {
    method setBank_name (line 57) | public void setBank_name(String bank_name) {
    method getBank_address (line 61) | public String getBank_address() {
    method setBank_address (line 65) | public void setBank_address(String bank_address) {
    method getBank_country_name (line 69) | public String getBank_country_name() {
    method setBank_country_name (line 73) | public void setBank_country_name(String bank_country_name) {
    method getAccount_name (line 77) | public String getAccount_name() {
    method setAccount_name (line 81) | public void setAccount_name(String account_name) {
    method getAccount_address (line 85) | public String getAccount_address() {
    method setAccount_address (line 89) | public void setAccount_address(String account_address) {
    method getReference (line 93) | public String getReference() {
    method setReference (line 97) | public void setReference(String reference) {

FILE: api/src/main/java/com/coinbase/exchange/api/products/ProductService.java
  class ProductService (line 21) | public class ProductService {
    method ProductService (line 27) | public ProductService(final CoinbaseExchange exchange) {
    method getProducts (line 32) | public List<Product> getProducts() {
    method getCandles (line 37) | public Candles getCandles(String productId) {
    method getCandles (line 42) | public Candles getCandles(String productId, Map<String, String> queryP...
    method getCandles (line 57) | public Candles getCandles(String productId, Instant startTime, Instant...
    method getCandles (line 77) | public Candles getCandles(String productId, Granularity granularity) {
    method getCandles (line 84) | public Candles getCandles(String productId, Instant start, Instant end) {

FILE: api/src/main/java/com/coinbase/exchange/api/reports/ReportRequest.java
  class ReportRequest (line 6) | public class ReportRequest {
    method ReportRequest (line 12) | public ReportRequest() {}
    method ReportRequest (line 14) | public ReportRequest(String type, String start_date, String end_date) {
    method getType (line 20) | public String getType() {
    method setType (line 24) | public void setType(String type) {
    method getStart_date (line 28) | public String getStart_date() {
    method setStart_date (line 32) | public void setStart_date(String start_date) {
    method getEnd_date (line 36) | public String getEnd_date() {
    method setEnd_date (line 40) | public void setEnd_date(String end_date) {

FILE: api/src/main/java/com/coinbase/exchange/api/reports/ReportResponse.java
  class ReportResponse (line 6) | public class ReportResponse {
    method ReportResponse (line 17) | public ReportResponse() {}
    method ReportResponse (line 19) | public ReportResponse(String id,
    method getId (line 37) | public String getId() {
    method setId (line 41) | public void setId(String id) {
    method getType (line 45) | public String getType() {
    method setType (line 49) | public void setType(String type) {
    method getStatus (line 53) | public String getStatus() {
    method setStatus (line 57) | public void setStatus(String status) {
    method getCreated_at (line 61) | public String getCreated_at() {
    method setCreated_at (line 65) | public void setCreated_at(String created_at) {
    method getCompleted_at (line 69) | public String getCompleted_at() {
    method setCompleted_at (line 73) | public void setCompleted_at(String completed_at) {
    method getExpires_at (line 77) | public String getExpires_at() {
    method setExpires_at (line 81) | public void setExpires_at(String expires_at) {
    method getFile_url (line 85) | public String getFile_url() {
    method setFile_url (line 89) | public void setFile_url(String file_url) {
    method getParams (line 93) | public TimePeriod getParams() {
    method setParams (line 97) | public void setParams(TimePeriod params) {

FILE: api/src/main/java/com/coinbase/exchange/api/reports/ReportService.java
  class ReportService (line 9) | public class ReportService {
    method ReportService (line 15) | public ReportService(final CoinbaseExchange coinbaseExchange) {
    method createReport (line 20) | public ReportResponse createReport(String type, String startDate, Stri...
    method getReportStatus (line 26) | public ReportResponse getReportStatus(String id) {

FILE: api/src/main/java/com/coinbase/exchange/api/reports/TimePeriod.java
  class TimePeriod (line 6) | public class TimePeriod {
    method TimePeriod (line 11) | public TimePeriod() {}
    method TimePeriod (line 13) | public TimePeriod(String start_date, String end_date) {
    method getStart_date (line 18) | public String getStart_date() {
    method setStart_date (line 22) | public void setStart_date(String start_date) {
    method getEnd_date (line 26) | public String getEnd_date() {
    method setEnd_date (line 30) | public void setEnd_date(String end_date) {

FILE: api/src/main/java/com/coinbase/exchange/api/transfers/Transfer.java
  class Transfer (line 8) | public class Transfer {
    method Transfer (line 14) | public Transfer() {}
    method Transfer (line 16) | public Transfer(String type, BigDecimal amount, String coinbase_accoun...
    method getType (line 22) | public String getType() {
    method setType (line 26) | public void setType(String type) {
    method getAmount (line 30) | public BigDecimal getAmount() {
    method setAmount (line 34) | public void setAmount(BigDecimal amount) {
    method getCoinbase_account_id (line 38) | public String getCoinbase_account_id() {
    method setCoinbase_account_id (line 42) | public void setCoinbase_account_id(String coinbase_account_id) {

FILE: api/src/main/java/com/coinbase/exchange/api/transfers/TransferService.java
  class TransferService (line 14) | public class TransferService {
    method TransferService (line 20) | public TransferService(final CoinbaseExchange coinbaseExchange) {
    method transfer (line 31) | public String transfer(String type, BigDecimal amount, String coinbase...

FILE: api/src/main/java/com/coinbase/exchange/api/useraccount/UserAccountData.java
  class UserAccountData (line 8) | public class UserAccountData {
    method UserAccountData (line 15) | public UserAccountData() {}
    method UserAccountData (line 17) | public UserAccountData(String product_id, BigDecimal exchange_volume, ...
    method getProduct_id (line 24) | public String getProduct_id() {
    method setProduct_id (line 28) | public void setProduct_id(String product_id) {
    method getExchange_volume (line 32) | public BigDecimal getExchange_volume() {
    method setExchange_volume (line 36) | public void setExchange_volume(BigDecimal exchange_volume) {
    method getVolume (line 40) | public BigDecimal getVolume() {
    method setVolume (line 44) | public void setVolume(BigDecimal volume) {
    method getRecorded_at (line 48) | public String getRecorded_at() {
    method setRecorded_at (line 52) | public void setRecorded_at(String recorded_at) {

FILE: api/src/main/java/com/coinbase/exchange/api/useraccount/UserAccountService.java
  class UserAccountService (line 11) | public class UserAccountService {
    method UserAccountService (line 17) | public UserAccountService(final CoinbaseExchange coinbaseExchange) {
    method getTrailingVolume (line 25) | public List<UserAccountData> getTrailingVolume(){

FILE: api/src/main/java/com/coinbase/exchange/api/withdrawals/WithdrawalsService.java
  class WithdrawalsService (line 17) | public class WithdrawalsService {
    method WithdrawalsService (line 26) | public WithdrawalsService(final CoinbaseExchange coinbaseExchange) {
    method makeWithdrawalToPaymentMethod (line 30) | public PaymentResponse makeWithdrawalToPaymentMethod(BigDecimal amount...
    method makeWithdrawalToCoinbase (line 36) | public PaymentResponse makeWithdrawalToCoinbase(BigDecimal amount, Str...
    method makeWithdrawalToCryptoAccount (line 42) | public PaymentResponse makeWithdrawalToCryptoAccount(BigDecimal amount...
    method makeWithdrawal (line 48) | private PaymentResponse makeWithdrawal(MonetaryRequest request, String...

FILE: api/src/test/java/com/coinbase/exchange/api/BaseIntegrationTest.java
  class BaseIntegrationTest (line 14) | @SpringBootTest(properties = {

FILE: api/src/test/java/com/coinbase/exchange/api/TestExchangeApplication.java
  class TestExchangeApplication (line 12) | @SpringBootApplication
    method main (line 15) | public static void main(String[] args) {

FILE: api/src/test/java/com/coinbase/exchange/api/accounts/AccountsIntegrationTest.java
  class AccountsIntegrationTest (line 22) | @ExtendWith(SpringExtension.class)
    method setUp (line 28) | @BeforeEach
    method canGetAccounts (line 33) | @Test
    method getAccount (line 39) | @Test
    method canGetAccountHistory (line 46) | @Test
    method canGetAccountHolds (line 53) | @Test
    method canGetPagedAccountHistory (line 68) | @Test
    method canGetPagedHolds (line 81) | @Test

FILE: api/src/test/java/com/coinbase/exchange/api/accounts/DepositIntegrationTest.java
  class DepositIntegrationTest (line 28) | @ExtendWith(SpringExtension.class)
    method setUp (line 38) | @BeforeEach
    method depositToGDAXExchangeFromCoinbase (line 45) | @Test
    method getAccount (line 69) | private Account getAccount(List<Account> gdaxAccountList) {
    method getCoinbaseAccount (line 81) | private CoinbaseAccount getCoinbaseAccount(List<CoinbaseAccount> coinb...

FILE: api/src/test/java/com/coinbase/exchange/api/accounts/UserAccountServiceIntegrationTest.java
  class UserAccountServiceIntegrationTest (line 20) | @ExtendWith(SpringExtension.class)
    method setUp (line 26) | @BeforeEach
    method getTrailingVolume (line 34) | @Test

FILE: api/src/test/java/com/coinbase/exchange/api/accounts/WithdrawalIntegrationTest.java
  class WithdrawalIntegrationTest (line 29) | @ExtendWith(SpringExtension.class)
    method setUp (line 40) | @BeforeEach
    method withdrawToCoinbaseAccount (line 47) | @Test
    method getUsdCoinbaseAccount (line 69) | private CoinbaseAccount getUsdCoinbaseAccount(List<CoinbaseAccount> co...
    method getUsdAccount (line 80) | private Account getUsdAccount(List<Account> gdaxAccounts) {
    method getUsdPaymentType (line 92) | private PaymentType getUsdPaymentType(List<PaymentType> paymentTypes) {

FILE: api/src/test/java/com/coinbase/exchange/api/authentication/AuthenticationIntegrationIntegrationTest.java
  class AuthenticationIntegrationIntegrationTest (line 24) | @ExtendWith(SpringExtension.class)
    method setUp (line 30) | @BeforeEach
    method simpleAuthenticationTest (line 36) | @Test

FILE: api/src/test/java/com/coinbase/exchange/api/config/IntegrationTestConfiguration.java
  class IntegrationTestConfiguration (line 12) | @SpringBootConfiguration
    method objectMapper (line 15) | @Bean
    method coinbaseExchange (line 20) | @Bean

FILE: api/src/test/java/com/coinbase/exchange/api/marketdata/MarketDataIntegrationTest.java
  class MarketDataIntegrationTest (line 23) | @ExtendWith(SpringExtension.class)
    method setUp (line 30) | @BeforeEach
    method canGetMarketDataForLevelOneBidAndAsk (line 36) | @Test
    method canGetMarketDataForLevelTwoBidAndAsk (line 43) | @Test
    method canGetMarketDataForLevelThreeBidAndAsk (line 54) | @Test
    method canGetLevel1DataForAllProducts (line 61) | @Test

FILE: api/src/test/java/com/coinbase/exchange/api/marketdata/OrderItemDeserializerTest.java
  class OrderItemDeserializerTest (line 13) | public class OrderItemDeserializerTest {
    method testDesirialization (line 21) | @Test

FILE: api/src/test/java/com/coinbase/exchange/api/orders/OrderIntegrationTest.java
  class OrderIntegrationTest (line 36) | @ExtendWith(SpringExtension.class)
    method setUp (line 52) | @BeforeEach
    method canMakeLimitOrderAndGetTheOrderAndCancelIt (line 65) | @Ignore
    method cancelAllOrders (line 103) | @Test
    method getAllOpenOrders (line 109) | @Test
    method getFillsByProductId (line 115) | @Test
    method shouldGetFilledByOrderIdWhenMakingMarketOrderBuy (line 121) | @Ignore
    method createMarketOrderBuy (line 131) | @Ignore
    method createMarketOrderSell (line 146) | @Ignore
    method createNewMarketOrder (line 160) | private NewMarketOrderSingle createNewMarketOrder(String product, Stri...
    method getMarketDataOrderBook (line 168) | private MarketData getMarketDataOrderBook(String product) {
    method getNewLimitOrderSingle (line 172) | private NewLimitOrderSingle getNewLimitOrderSingle(String productId, B...
    method getAskPrice (line 186) | private BigDecimal getAskPrice(MarketData marketData) {
    method getTradeableProductData (line 194) | private MarketData getTradeableProductData(List<Account> accountsAvail...

FILE: api/src/test/java/com/coinbase/exchange/api/payments/PaymentIntegrationTest.java
  class PaymentIntegrationTest (line 15) | @ExtendWith(SpringExtension.class)
    method setUp (line 21) | @BeforeEach
    method hasAvailablePayments (line 26) | @Test
    method hasCoinbaseAccounts (line 31) | @Test

FILE: api/src/test/java/com/coinbase/exchange/api/products/ProductsIntegrationTest.java
  class ProductsIntegrationTest (line 27) | @ExtendWith(SpringExtension.class)
    method setUp (line 41) | @BeforeEach
    method canGetProducts (line 46) | @Test
    method shouldGetCandles (line 53) | @Test
    method shouldGetCandlesForAGanularityOf_OneDay (line 60) | @Test
    method shouldGetCandlesForAGanularityOf_SixHours (line 68) | @Test
    method shouldGetCandlesForAGanularityOf_OneHour (line 76) | @Test
    method shouldGetCandlesForAGanularityOf_FifteenMins (line 84) | @Test
    method shouldGetCandlesForAGanularityOf_FiveMins (line 92) | @Test
    method shouldGetCandlesForAGanularityOf_OneMin (line 100) | @Test
    method shouldGetCandlesForWithAStartAndEndTime (line 108) | @Test
    method getDuration (line 120) | private Duration getDuration(Candles candles) {

FILE: api/src/test/java/com/coinbase/exchange/api/transfers/TransferServiceIntegrationTest.java
  class TransferServiceIntegrationTest (line 16) | @ExtendWith(SpringExtension.class)
    method setUp (line 22) | @BeforeEach
    method canTransferFromCoinbaseAccountToGdax (line 28) | @Ignore

FILE: model/src/main/java/com/coinbase/exchange/model/Candle.java
  class Candle (line 6) | public class Candle {
    method Candle (line 15) | public Candle(String[] entry) {
    method Candle (line 24) | public Candle(Instant time, BigDecimal low, BigDecimal high, BigDecima...
    method getTime (line 33) | public Instant getTime() {
    method getLow (line 37) | public BigDecimal getLow() {
    method getHigh (line 41) | public BigDecimal getHigh() {
    method getOpen (line 45) | public BigDecimal getOpen() {
    method getClose (line 49) | public BigDecimal getClose() {
    method getVolume (line 53) | public BigDecimal getVolume() {
    method setTime (line 57) | public void setTime(Instant time) {
    method setLow (line 61) | public void setLow(BigDecimal low) {
    method setHigh (line 65) | public void setHigh(BigDecimal high) {
    method setOpen (line 69) | public void setOpen(BigDecimal open) {
    method setClose (line 73) | public void setClose(BigDecimal close) {
    method setVolume (line 77) | public void setVolume(BigDecimal volume) {

FILE: model/src/main/java/com/coinbase/exchange/model/Candles.java
  class Candles (line 6) | public class Candles {
    method Candles (line 10) | public Candles(List<String[]> candles) {
    method getCandleList (line 14) | public List<Candle> getCandleList() {

FILE: model/src/main/java/com/coinbase/exchange/model/CoinbasePaymentRequest.java
  class CoinbasePaymentRequest (line 8) | public class CoinbasePaymentRequest extends MonetaryRequest {
    method CoinbasePaymentRequest (line 13) | public CoinbasePaymentRequest(BigDecimal amount, String currency, Stri...
    method getCoinbase_account_id (line 19) | public String getCoinbase_account_id() {
    method setCoinbase_account_id (line 22) | public void setCoinbase_account_id(String coinbase_account_id) {

FILE: model/src/main/java/com/coinbase/exchange/model/CryptoPaymentRequest.java
  class CryptoPaymentRequest (line 5) | public class CryptoPaymentRequest extends MonetaryRequest {
    method CryptoPaymentRequest (line 8) | public CryptoPaymentRequest(BigDecimal amount, String currency, String...
    method getCryptoAddress (line 12) | public String getCryptoAddress() {
    method setCryptoAddress (line 15) | public void setCryptoAddress(String cryptoAddress) {

FILE: model/src/main/java/com/coinbase/exchange/model/Currency.java
  class Currency (line 7) | @JsonIgnoreProperties(ignoreUnknown = true)
    method Currency (line 19) | public Currency() {
    method Currency (line 22) | public Currency(String id, String name, BigDecimal min_size, String st...
    method getId (line 35) | public String getId() {
    method setId (line 39) | public void setId(String id) {
    method getName (line 43) | public String getName() {
    method setName (line 47) | public void setName(String name) {
    method getMin_size (line 51) | public BigDecimal getMin_size() {
    method setMin_size (line 55) | public void setMin_size(BigDecimal min_size) {
    method getStatus (line 59) | public String getStatus() {
    method setStatus (line 63) | public void setStatus(String status) {
    method getStatus_message (line 67) | public String getStatus_message() {
    method setStatus_message (line 71) | public void setStatus_message(String status_message) {
    method getMax_precision (line 75) | public BigDecimal getMax_precision() {
    method setMax_precision (line 79) | public void setMax_precision(BigDecimal max_precision) {
    method getConvertible_to (line 83) | public String[] getConvertible_to() {
    method setConvertible_to (line 87) | public void setConvertible_to(String[] convertible_to) {
    method getFunding_account_id (line 91) | public String getFunding_account_id() {
    method setFunding_account_id (line 95) | public void setFunding_account_id(String funding_account_id) {
    method getDetails (line 99) | public Object getDetails() {
    method setDetails (line 103) | public void setDetails(Object details) {

FILE: model/src/main/java/com/coinbase/exchange/model/Detail.java
  class Detail (line 6) | public class Detail {
    method getOrder_id (line 11) | public String getOrder_id() {
    method setOrder_id (line 15) | public void setOrder_id(String order_id) {
    method getTrade_id (line 19) | public Integer getTrade_id() {
    method setTrade_id (line 23) | public void setTrade_id(Integer trade_id) {
    method getProduct_id (line 27) | public String getProduct_id() {
    method setProduct_id (line 31) | public void setProduct_id(String product_id) {

FILE: model/src/main/java/com/coinbase/exchange/model/Fill.java
  class Fill (line 8) | public class Fill {
    method getSide (line 19) | public String getSide() {
    method setSide (line 23) | public void setSide(String side) {
    method getSettled (line 27) | public Boolean getSettled() {
    method setSettled (line 31) | public void setSettled(Boolean settled) {
    method getFee (line 35) | public BigDecimal getFee() {
    method setFee (line 39) | public void setFee(BigDecimal fee) {
    method getCreated_at (line 43) | public String getCreated_at() {
    method setCreated_at (line 47) | public void setCreated_at(String created_at) {
    method getLiquidity (line 51) | public String getLiquidity() {
    method setLiquidity (line 55) | public void setLiquidity(String liquidity) {
    method getOrder_id (line 59) | public String getOrder_id() {
    method setOrder_id (line 63) | public void setOrder_id(String order_id) {
    method getSize (line 67) | public BigDecimal getSize() {
    method setSize (line 71) | public void setSize(BigDecimal size) {
    method getProduct_id (line 75) | public String getProduct_id() {
    method setProduct_id (line 79) | public void setProduct_id(String product_id) {
    method getTrade_id (line 83) | public Integer getTrade_id() {
    method setTrade_id (line 87) | public void setTrade_id(Integer trade_id) {

FILE: model/src/main/java/com/coinbase/exchange/model/Granularity.java
  type Granularity (line 3) | public enum Granularity {
    method Granularity (line 13) | Granularity(String granularity) {
    method get (line 21) | public String get(){

FILE: model/src/main/java/com/coinbase/exchange/model/Hold.java
  class Hold (line 9) | public class Hold {
    method Hold (line 18) | public Hold () {}
    method Hold (line 20) | public Hold(String id, String account_id, String created_at, String up...
    method getId (line 30) | public String getId() {
    method setId (line 34) | public void setId(String id) {
    method getAccount_id (line 38) | public String getAccount_id() {
    method setAccount_id (line 42) | public void setAccount_id(String account_id) {
    method getCreated_at (line 46) | public String getCreated_at() {
    method setCreated_at (line 50) | public void setCreated_at(String created_at) {
    method getUpdate_at (line 54) | public String getUpdate_at() {
    method setUpdate_at (line 58) | public void setUpdate_at(String update_at) {
    method getAmount (line 62) | public BigDecimal getAmount() {
    method setAmount (line 66) | public void setAmount(BigDecimal amount) {
    method getType (line 70) | public String getType() {
    method setType (line 74) | public void setType(String type) {
    method getRef (line 78) | public String getRef() {
    method setRef (line 82) | public void setRef(String ref) {

FILE: model/src/main/java/com/coinbase/exchange/model/MonetaryRequest.java
  class MonetaryRequest (line 5) | public abstract class MonetaryRequest {
    method MonetaryRequest (line 9) | public MonetaryRequest(BigDecimal amount, String currency){
    method getAmount (line 14) | public BigDecimal getAmount() {
    method setAmount (line 18) | public void setAmount(BigDecimal amount) {
    method getCurrency (line 22) | public String getCurrency() {
    method setCurrency (line 26) | public void setCurrency(String currency) {

FILE: model/src/main/java/com/coinbase/exchange/model/NewLimitOrderSingle.java
  class NewLimitOrderSingle (line 9) | public class NewLimitOrderSingle extends NewOrderSingle {
    method NewLimitOrderSingle (line 14) | public NewLimitOrderSingle() {}
    method NewLimitOrderSingle (line 16) | public NewLimitOrderSingle(BigDecimal size, BigDecimal price, Boolean ...
    method NewLimitOrderSingle (line 23) | public NewLimitOrderSingle(BigDecimal size, BigDecimal price, Boolean ...
    method getPost_only (line 41) | public Boolean getPost_only() {
    method setPost_only (line 45) | public void setPost_only(Boolean post_only) {
    method getPrice (line 49) | public BigDecimal getPrice() {
    method setPrice (line 53) | public void setPrice(BigDecimal price) {
    method getSize (line 57) | public BigDecimal getSize() {
    method setSize (line 61) | public void setSize(BigDecimal size) {

FILE: model/src/main/java/com/coinbase/exchange/model/NewMarketOrderSingle.java
  class NewMarketOrderSingle (line 8) | public class NewMarketOrderSingle extends NewOrderSingle {
    method NewMarketOrderSingle (line 12) | public NewMarketOrderSingle(BigDecimal size) {
    method NewMarketOrderSingle (line 16) | public NewMarketOrderSingle(){
    method getSize (line 20) | public BigDecimal getSize() {
    method setSize (line 24) | public void setSize(BigDecimal size) {

FILE: model/src/main/java/com/coinbase/exchange/model/NewOrderSingle.java
  class NewOrderSingle (line 25) | public abstract class NewOrderSingle {
    method NewOrderSingle (line 34) | public NewOrderSingle() {
    method getStp (line 37) | public String getStp() {
    method setStp (line 41) | public void setStp(String stp) {
    method getProduct_id (line 45) | public String getProduct_id() {
    method setProduct_id (line 49) | public void setProduct_id(String product_id) {
    method getSide (line 53) | public String getSide() {
    method setSide (line 57) | public void setSide(String side) {
    method getClient_oid (line 61) | public String getClient_oid() {
    method setClient_oid (line 65) | public void setClient_oid(String client_oid) {
    method getFunds (line 69) | public String getFunds() {
    method setFunds (line 73) | public void setFunds(String funds) {
    method getType (line 77) | public String getType() {
    method setType (line 81) | public void setType(String type) {

FILE: model/src/main/java/com/coinbase/exchange/model/PaymentRequest.java
  class PaymentRequest (line 8) | public class PaymentRequest extends MonetaryRequest {
    method PaymentRequest (line 12) | public PaymentRequest(BigDecimal amount, String currency, String payme...
    method getPayment_method_id (line 17) | public String getPayment_method_id() {
    method setPayment_method_id (line 20) | public void setPayment_method_id(String payment_method_id) {

FILE: model/src/main/java/com/coinbase/exchange/model/PaymentResponse.java
  class PaymentResponse (line 8) | public class PaymentResponse {
    method PaymentResponse (line 15) | public PaymentResponse() {}
    method PaymentResponse (line 17) | public PaymentResponse(String id, BigDecimal amount, String currency, ...
    method getId (line 24) | public String getId() {
    method setId (line 28) | public void setId(String id) {
    method getAmount (line 32) | public BigDecimal getAmount() {
    method setAmount (line 36) | public void setAmount(BigDecimal amount) {
    method getCurrency (line 40) | public String getCurrency() {
    method setCurrency (line 44) | public void setCurrency(String currency) {
    method getPayout_at (line 48) | public String getPayout_at() {
    method setPayout_at (line 52) | public void setPayout_at(String payout_at) {

FILE: model/src/main/java/com/coinbase/exchange/model/Product.java
  class Product (line 30) | @JsonIgnoreProperties(ignoreUnknown = true)
    method getQuote_increment (line 50) | public Double getQuote_increment() {
    method setQuote_increment (line 54) | public void setQuote_increment(Double quote_increment) {
    method getBase_max_size (line 58) | public Double getBase_max_size() {
    method setBase_max_size (line 62) | public void setBase_max_size(Double base_max_size) {
    method getBase_min_size (line 66) | public Double getBase_min_size() {
    method setBase_min_size (line 70) | public void setBase_min_size(Double base_min_size) {
    method getQuote_currency (line 74) | public String getQuote_currency() {
    method setQuote_currency (line 78) | public void setQuote_currency(String quote_currency) {
    method getBase_currency (line 82) | public String getBase_currency() {
    method setBase_currency (line 86) | public void setBase_currency(String base_currency) {
    method getId (line 90) | public String getId() {
    method setId (line 94) | public void setId(String id) {
    method setBase_increment (line 98) | public void setBase_increment(double base_increment) {
    method getBase_increment (line 102) | public double getBase_increment() {
    method setDisplay_name (line 106) | public void setDisplay_name(String display_name) {
    method getDisplay_name (line 110) | public String getDisplay_name() {
    method getStatus (line 114) | public String getStatus() {
    method setStatus (line 118) | public void setStatus(String status) {
    method getMargin_enabled (line 122) | public Boolean getMargin_enabled() {
    method setMargin_enabled (line 126) | public void setMargin_enabled(Boolean margin_enabled) {
    method getStatus_message (line 130) | public String getStatus_message() {
    method setStatus_message (line 134) | public void setStatus_message(String status_message) {
    method getMin_market_funds (line 138) | public BigDecimal getMin_market_funds() {
    method setMin_market_funds (line 142) | public void setMin_market_funds(BigDecimal min_market_funds) {
    method getMax_market_funds (line 146) | public Integer getMax_market_funds() {
    method setMax_market_funds (line 150) | public void setMax_market_funds(Integer max_market_funds) {
    method getPost_only (line 154) | public Boolean getPost_only() {
    method setPost_only (line 158) | public void setPost_only(Boolean post_only) {
    method getLimit_only (line 162) | public Boolean getLimit_only() {
    method setLimit_only (line 166) | public void setLimit_only(Boolean limit_only) {
    method getCancel_only (line 170) | public Boolean getCancel_only() {
    method setCancel_only (line 174) | public void setCancel_only(Boolean cancel_only) {
    method getType (line 178) | public String getType() {
    method setType (line 182) | public void setType(String type) {

FILE: model/src/main/java/com/coinbase/exchange/model/ProductOrderBook.java
  class ProductOrderBook (line 8) | public class ProductOrderBook {
    method getAsks (line 14) | public List<List<String>> getAsks() {
    method setAsks (line 18) | public void setAsks(List<List<String>> asks) {
    method getBids (line 22) | public List<List<String>> getBids() {
    method setBids (line 26) | public void setBids(List<List<String>> bids) {
    method getSequence (line 30) | public Integer getSequence() {
    method setSequence (line 34) | public void setSequence(Integer sequence) {

FILE: security/src/main/java/com/coinbase/exchange/security/Signature.java
  class Signature (line 14) | public class Signature {
    method Signature (line 18) | public Signature(final String secretKey) {
    method generate (line 34) | public String generate(String requestPath, String method, String body,...

FILE: security/src/main/java/com/coinbase/exchange/security/constants/ExchangeConstants.java
  class ExchangeConstants (line 9) | public class ExchangeConstants {

FILE: websocketfeed/src/main/java/com/coinbase/exchange/websocketfeed/ActivateOrderBookMessage.java
  class ActivateOrderBookMessage (line 29) | public class ActivateOrderBookMessage extends OrderBookMessage {
    method ActivateOrderBookMessage (line 34) | public ActivateOrderBookMessage() {
    method ActivateOrderBookMessage (line 38) | public ActivateOrderBookMessage(String stop_type, BigDecimal stop_pric...
    method getStop_type (line 49) | public String getStop_type() {
    method setStop_type (line 53) | public void setStop_type(String stop_type) {
    method getStop_price (line 57) | public BigDecimal getStop_price() {
    method setStop_price (line 61) | public void setStop_price(BigDecimal stop_price) {
    method getTimestamp (line 65) | public Instant getTimestamp() {
    method setTimestamp (line 69) | public void setTimestamp(Instant timestamp) {
    method isPrivateFlag (line 73) | public boolean isPrivateFlag() {
    method setPrivateFlag (line 77) | public void setPrivateFlag(boolean privateFlag) {

FILE: websocketfeed/src/main/java/com/coinbase/exchange/websocketfeed/ChangedOrderBookMessage.java
  class ChangedOrderBookMessage (line 46) | public class ChangedOrderBookMessage extends OrderBookMessage {
    method ChangedOrderBookMessage (line 48) | public ChangedOrderBookMessage() {

FILE: websocketfeed/src/main/java/com/coinbase/exchange/websocketfeed/Channel.java
  class Channel (line 14) | public class Channel {
    method Channel (line 29) | public Channel() {
    method Channel (line 32) | public Channel(ChannelName name, String[] product_ids) {
    method getName (line 37) | public ChannelName getName() {
    method setName (line 41) | public void setName(ChannelName name) {
    method getProduct_ids (line 45) | public String[] getProduct_ids() {
    method setProduct_ids (line 49) | public void setProduct_ids(String[] product_ids) {

FILE: websocketfeed/src/main/java/com/coinbase/exchange/websocketfeed/ChannelName.java
  type ChannelName (line 3) | public enum ChannelName {

FILE: websocketfeed/src/main/java/com/coinbase/exchange/websocketfeed/DoneOrderBookMessage.java
  class DoneOrderBookMessage (line 18) | public class DoneOrderBookMessage extends OrderBookMessage {
    method DoneOrderBookMessage (line 20) | public DoneOrderBookMessage() {

FILE: websocketfeed/src/main/java/com/coinbase/exchange/websocketfeed/ErrorOrderBookMessage.java
  class ErrorOrderBookMessage (line 14) | public class ErrorOrderBookMessage extends FeedMessage {
    method ErrorOrderBookMessage (line 18) | public ErrorOrderBookMessage() {
    method ErrorOrderBookMessage (line 22) | public ErrorOrderBookMessage(String message) {
    method getMessage (line 33) | public String getMessage() {
    method setMessage (line 37) | public void setMessage(String message) {

FILE: websocketfeed/src/main/java/com/coinbase/exchange/websocketfeed/FeedMessage.java
  class FeedMessage (line 9) | @JsonIgnoreProperties(ignoreUnknown = true)
    method getType (line 34) | public String getType() {
    method setType (line 38) | public void setType(String type) {
    method getSequence (line 42) | public Long getSequence() {
    method setSequence (line 46) | public void setSequence(Long sequence) {
    method getTime (line 50) | public Instant getTime() {
    method setTime (line 54) | public void setTime(Instant time) {
    method getProduct_id (line 58) | public String getProduct_id() {
    method setProduct_id (line 62) | public void setProduct_id(String product_id) {

FILE: websocketfeed/src/main/java/com/coinbase/exchange/websocketfeed/HeartBeat.java
  class HeartBeat (line 15) | public class HeartBeat extends FeedMessage {
    method HeartBeat (line 19) | public HeartBeat() {
    method HeartBeat (line 23) | public HeartBeat(Long last_trade_id) {
    method getLast_trade_id (line 28) | public Long getLast_trade_id() {
    method setLast_trade_id (line 32) | public void setLast_trade_id(Long last_trade_id) {

FILE: websocketfeed/src/main/java/com/coinbase/exchange/websocketfeed/L2UpdateMessage.java
  class L2UpdateMessage (line 23) | public class L2UpdateMessage extends FeedMessage {
    method L2UpdateMessage (line 27) | public L2UpdateMessage() {
    method L2UpdateMessage (line 31) | public L2UpdateMessage(String[][] changes) {
    method getChanges (line 36) | public String[][] getChanges() {
    method setChanges (line 40) | public void setChanges(String[][] changes) {

FILE: websocketfeed/src/main/java/com/coinbase/exchange/websocketfeed/MatchedOrderBookMessage.java
  class MatchedOrderBookMessage (line 33) | public class MatchedOrderBookMessage extends OrderBookMessage {
    method MatchedOrderBookMessage (line 35) | public MatchedOrderBookMessage() {

FILE: websocketfeed/src/main/java/com/coinbase/exchange/websocketfeed/OpenedOrderBookMessage.java
  class OpenedOrderBookMessage (line 17) | public class OpenedOrderBookMessage extends OrderBookMessage {
    method OpenedOrderBookMessage (line 19) | public OpenedOrderBookMessage() {

FILE: websocketfeed/src/main/java/com/coinbase/exchange/websocketfeed/OrderBookMessage.java
  class OrderBookMessage (line 12) | public class OrderBookMessage extends FeedMessage implements Comparable<...
    method OrderBookMessage (line 55) | public OrderBookMessage() {
    method OrderBookMessage (line 59) | public OrderBookMessage(String type, String time, String product_id,
    method getClient_oid (line 111) | public String getClient_oid() {
    method setClient_oid (line 115) | public void setClient_oid(String client_oid) {
    method getStp (line 119) | public String getStp() {
    method setStp (line 123) | public void setStp(String stp) {
    method getTrade_id (line 127) | public String getTrade_id() {
    method setTrade_id (line 131) | public void setTrade_id(String trade_id) {
    method getSide (line 135) | public String getSide() {
    method setSide (line 139) | public void setSide(String side) {
    method getOrder_id (line 143) | public String getOrder_id() {
    method setOrder_id (line 147) | public void setOrder_id(String order_id) {
    method getOrder_type (line 151) | public String getOrder_type() {
    method setOrder_type (line 155) | public void setOrder_type(String order_type) {
    method getFunds (line 159) | public BigDecimal getFunds() {
    method setFunds (line 163) | public void setFunds(BigDecimal funds) {
    method getSize (line 167) | public BigDecimal getSize() {
    method setSize (line 171) | public void setSize(BigDecimal size) {
    method getPrice (line 175) | public BigDecimal getPrice() {
    method setPrice (line 179) | public void setPrice(BigDecimal price) {
    method getNew_size (line 183) | public BigDecimal getNew_size() {
    method setNew_size (line 187) | public void setNew_size(BigDecimal new_size) {
    method getOld_size (line 191) | public BigDecimal getOld_size() {
    method setOld_size (line 195) | public void setOld_size(BigDecimal old_size) {
    method getNew_funds (line 199) | public BigDecimal getNew_funds() {
    method setNew_funds (line 203) | public void setNew_funds(BigDecimal new_funds) {
    method getOld_funds (line 207) | public BigDecimal getOld_funds() {
    method setOld_funds (line 211) | public void setOld_funds(BigDecimal old_funds) {
    method getReason (line 215) | public String getReason() {
    method setReason (line 219) | public void setReason(String reason) {
    method getRemaining_size (line 223) | public BigDecimal getRemaining_size() {
    method setRemaining_size (line 227) | public void setRemaining_size(BigDecimal remaining_size) {
    method getMaker_order_id (line 231) | public String getMaker_order_id() {
    method setMaker_order_id (line 235) | public void setMaker_order_id(String maker_order_id) {
    method getTaker_order_id (line 239) | public String getTaker_order_id() {
    method setTaker_order_id (line 243) | public void setTaker_order_id(String taker_order_id) {
    method getTaker_user_id (line 247) | public String getTaker_user_id() {
    method setTaker_user_id (line 251) | public void setTaker_user_id(String taker_user_id) {
    method getUser_id (line 255) | public String getUser_id() {
    method setUser_id (line 259) | public void setUser_id(String user_id) {
    method getTaker_profile_id (line 263) | public String getTaker_profile_id() {
    method setTaker_profile_id (line 267) | public void setTaker_profile_id(String taker_profile_id) {
    method getProfile_id (line 271) | public String getProfile_id() {
    method setProfile_id (line 275) | public void setProfile_id(String profile_id) {
    method getLast_trade_id (line 278) | public String getLast_trade_id() {
    method setLast_trade_id (line 282) | public void setLast_trade_id(String last_trade_id) {
    method getMessage (line 286) | public String getMessage() {
    method setMessage (line 290) | public void setMessage(String message) {
    method getOpen_24h (line 294) | public String getOpen_24h() {
    method setOpen_24h (line 298) | public void setOpen_24h(String open_24h) {
    method getVolume_24h (line 302) | public String getVolume_24h() {
    method setVolume_24h (line 306) | public void setVolume_24h(String volume_24h) {
    method getLow_24h (line 310) | public String getLow_24h() {
    method setLow_24h (line 314) | public void setLow_24h(String low_24h) {
    method getHigh_24h (line 318) | public String getHigh_24h() {
    method setHigh_24h (line 322) | public void setHigh_24h(String high_24h) {
    method getVolume_30d (line 326) | public String getVolume_30d() {
    method setVolume_30d (line 330) | public void setVolume_30d(String volume_30d) {
    method getBest_bid (line 334) | public String getBest_bid() {
    method setBest_bid (line 338) | public void setBest_bid(String best_bid) {
    method getBest_ask (line 342) | public String getBest_ask() {
    method setBest_ask (line 346) | public void setBest_ask(String best_ask) {
    method getLast_size (line 350) | public String getLast_size() {
    method setLast_size (line 354) | public void setLast_size(String last_size) {
    method getChannels (line 358) | public Channel[] getChannels() {
    method setChannels (line 362) | public void setChannels(Channel[] channels) {
    method compareTo (line 366) | @Override
    method toString (line 371) | @Override
    class OrderBookMessageBuilder (line 383) | public static class OrderBookMessageBuilder {
      method setType (line 386) | public OrderBookMessageBuilder setType(String type) {
      method setSide (line 390) | public OrderBookMessageBuilder setSide(String side) {
      method setPrice (line 395) | public OrderBookMessageBuilder setPrice(BigDecimal price) {
      method setSize (line 400) | public OrderBookMessageBuilder setSize(BigDecimal size) {
      method setRemainingSize (line 405) | public OrderBookMessageBuilder setRemainingSize(BigDecimal remaininS...
      method setSequence (line 410) | public OrderBookMessageBuilder setSequence(Long id) {
      method build (line 415) | public OrderBookMessage build() {

FILE: websocketfeed/src/main/java/com/coinbase/exchange/websocketfeed/ReceivedOrderBookMessage.java
  class ReceivedOrderBookMessage (line 47) | public class ReceivedOrderBookMessage extends OrderBookMessage {
    method ReceivedOrderBookMessage (line 49) | public ReceivedOrderBookMessage() {

FILE: websocketfeed/src/main/java/com/coinbase/exchange/websocketfeed/SnapshotMessage.java
  class SnapshotMessage (line 15) | public class SnapshotMessage extends FeedMessage {
    method SnapshotMessage (line 20) | public SnapshotMessage() {
    method SnapshotMessage (line 24) | public SnapshotMessage(String[][] bids, String[][] asks) {
    method getBids (line 30) | public String[][] getBids() {
    method setBids (line 34) | public void setBids(String[][] bids) {
    method getAsks (line 38) | public String[][] getAsks() {
    method setAsks (line 42) | public void setAsks(String[][] asks) {

FILE: websocketfeed/src/main/java/com/coinbase/exchange/websocketfeed/StatusMessage.java
  class StatusMessage (line 65) | public class StatusMessage extends FeedMessage {
    method StatusMessage (line 70) | public StatusMessage() {
    method StatusMessage (line 74) | public StatusMessage(Product[] products, Currency[] currencies) {
    method getProducts (line 80) | public Product[] getProducts() {
    method setProducts (line 84) | public void setProducts(Product[] products) {
    method getCurrencies (line 88) | public Currency[] getCurrencies() {
    method setCurrencies (line 92) | public void setCurrencies(Currency[] currencies) {

FILE: websocketfeed/src/main/java/com/coinbase/exchange/websocketfeed/Subscribe.java
  class Subscribe (line 34) | public class Subscribe {
    method Subscribe (line 48) | public Subscribe() { }
    method Subscribe (line 50) | public Subscribe(String[] product_ids) {
    method getType (line 55) | public String getType() {
    method setType (line 59) | public void setType(String type) {
    method getProduct_ids (line 63) | public String[] getProduct_ids() {
    method setProduct_ids (line 67) | public void setProduct_ids(String[] product_ids) {
    method setSignature (line 71) | public Subscribe setSignature(String signature) {
    method setPassphrase (line 76) | public Subscribe setPassphrase(String passphrase) {
    method setTimestamp (line 81) | public Subscribe setTimestamp(String timestamp) {
    method setKey (line 86) | public Subscribe setKey(String apiKey) {
    method setChannels (line 91) | public void setChannels(Channel[] channels) {
    method getChannels (line 95) | public Channel[] getChannels() {

FILE: websocketfeed/src/main/java/com/coinbase/exchange/websocketfeed/SubscriptionsMessage.java
  class SubscriptionsMessage (line 34) | public class SubscriptionsMessage extends FeedMessage {
    method getChannels (line 40) | public Channel[] getChannels() {
    method setChannels (line 44) | public void setChannels(Channel[] channels) {

FILE: websocketfeed/src/main/java/com/coinbase/exchange/websocketfeed/TickerMessage.java
  class TickerMessage (line 23) | public class TickerMessage extends FeedMessage {
    method TickerMessage (line 35) | public TickerMessage() {
    method TickerMessage (line 39) | public TickerMessage(Long trade_id,
    method getTrade_id (line 60) | public Long getTrade_id() {
    method setTrade_id (line 64) | public void setTrade_id(Long trade_id) {
    method getSequence (line 68) | @Override
    method setSequence (line 73) | @Override
    method getTime (line 78) | @Override
    method setTime (line 83) | @Override
    method getProduct_id (line 88) | @Override
    method setProduct_id (line 93) | @Override
    method getPrice (line 98) | public BigDecimal getPrice() {
    method setPrice (line 102) | public void setPrice(BigDecimal price) {
    method getSide (line 106) | public String getSide() {
    method setSide (line 110) | public void setSide(String side) {
    method getLast_size (line 114) | public BigDecimal getLast_size() {
    method setLast_size (line 118) | public void setLast_size(BigDecimal last_size) {
    method getBest_bid (line 122) | public BigDecimal getBest_bid() {
    method setBest_bid (line 126) | public void setBest_bid(BigDecimal best_bid) {
    method getBest_ask (line 130) | public BigDecimal getBest_ask() {
    method setBest_ask (line 134) | public void setBest_ask(BigDecimal best_ask) {

FILE: websocketfeed/src/main/java/com/coinbase/exchange/websocketfeed/WebsocketFeed.java
  class WebsocketFeed (line 28) | @ClientEndpoint
    method WebsocketFeed (line 43) | public WebsocketFeed(final String websocketUrl,
    method connect (line 57) | public void connect() {
    method onOpen (line 75) | @OnOpen
    method onClose (line 87) | @OnClose
    method onError (line 93) | @OnError
    method onMessage (line 104) | @OnMessage
    method addMessageHandler (line 116) | public void addMessageHandler(MessageHandler msgHandler) {
    method sendMessage (line 125) | public void sendMessage(String message) {
    method subscribe (line 131) | public void subscribe(Subscribe msg) {
    method signObject (line 139) | public String signObject(Subscribe jsonObj) {
    method toJson (line 151) | private String toJson(Object object) {
    method getOrdersAfter (line 162) | public List<OrderBookMessage> getOrdersAfter(Long sequenceId) {
    type MessageHandler (line 172) | public interface MessageHandler {
      method handleMessage (line 173) | public void handleMessage(String message);
      method getQueuedMessages (line 175) | List<OrderBookMessage> getQueuedMessages(Long sequenceId);

FILE: websocketfeed/src/main/java/com/coinbase/exchange/websocketfeed/WebsocketMessageHandler.java
  class WebsocketMessageHandler (line 14) | public class WebsocketMessageHandler implements WebsocketFeed.MessageHan...
    method WebsocketMessageHandler (line 22) | public WebsocketMessageHandler(final ObjectMapper objectMapper){
    method handleMessage (line 27) | @Override
    method getQueuedMessages (line 65) | @Override
    method handleError (line 70) | private void handleError(ErrorOrderBookMessage message, String json) {
    method handleChanged (line 77) | private void handleChanged(String json) {
    method handleMatched (line 82) | private void handleMatched(String json) {
    method handleDone (line 87) | private void handleDone(DoneOrderBookMessage message, String json) {
    method handleOpened (line 92) | private void handleOpened(OpenedOrderBookMessage message, String json) {
    method handleReceived (line 97) | private void handleReceived(String json) {
    method handleHeartbeat (line 104) | private void handleHeartbeat(HeartBeat message) {
    method getObject (line 110) | public <T> T getObject(String json, Class<T> type) {

FILE: websocketfeed/src/test/java/com/coinbase/exchange/websocketfeed/ActivateOrderBookMessageTest.java
  class ActivateOrderBookMessageTest (line 14) | class ActivateOrderBookMessageTest {
    method shouldDeserialiseActivateMessagesFromJsonSuccessfully (line 16) | @Test

FILE: websocketfeed/src/test/java/com/coinbase/exchange/websocketfeed/ChangedOrderBookMessageTest.java
  class ChangedOrderBookMessageTest (line 13) | class ChangedOrderBookMessageTest {
    method shouldDeserialiseChangedMessagesFromJsonSuccessfully (line 15) | @Test

FILE: websocketfeed/src/test/java/com/coinbase/exchange/websocketfeed/DoneOrderBookMessageTest.java
  class DoneOrderBookMessageTest (line 13) | class DoneOrderBookMessageTest {
    method shouldDeserialiseDoneMessagesFromJsonSuccessfully (line 15) | @Test

FILE: websocketfeed/src/test/java/com/coinbase/exchange/websocketfeed/ErrorOrderBookMessageTest.java
  class ErrorOrderBookMessageTest (line 9) | class ErrorOrderBookMessageTest {
    method shouldDeserialiseAllFieldsForErrorOrderBookMessage (line 13) | @Test

FILE: websocketfeed/src/test/java/com/coinbase/exchange/websocketfeed/HeartBeatTest.java
  class HeartBeatTest (line 11) | class HeartBeatTest {
    method shouldDeserialiseHeartbeatMessageSuccessfully (line 13) | @Test

FILE: websocketfeed/src/test/java/com/coinbase/exchange/websocketfeed/L2UpdateMessageTest.java
  class L2UpdateMessageTest (line 10) | class L2UpdateMessageTest {
    method shouldDeserialiseL2UpdateMessagesSuccessfully (line 12) | @Test

FILE: websocketfeed/src/test/java/com/coinbase/exchange/websocketfeed/MatchedOrderBookMessageTest.java
  class MatchedOrderBookMessageTest (line 13) | class MatchedOrderBookMessageTest {
    method shouldDeserialiseMatchedMessagesFromJsonSuccessfully (line 15) | @Test

FILE: websocketfeed/src/test/java/com/coinbase/exchange/websocketfeed/OpenedOrderBookMessageTest.java
  class OpenedOrderBookMessageTest (line 13) | class OpenedOrderBookMessageTest {
    method shouldDeserialiseOpenedMessagesFromJsonSuccessfully (line 15) | @Test

FILE: websocketfeed/src/test/java/com/coinbase/exchange/websocketfeed/ReceivedOrderBookMessageTest.java
  class ReceivedOrderBookMessageTest (line 13) | class ReceivedOrderBookMessageTest {
    method shouldDeserialiseReceivedMessagesFromJsonSuccessfully (line 15) | @Test

FILE: websocketfeed/src/test/java/com/coinbase/exchange/websocketfeed/SnapshotMessageTest.java
  class SnapshotMessageTest (line 10) | class SnapshotMessageTest {
    method shouldDeserialiseJsonSuccessfullyForValidJson (line 12) | @Test

FILE: websocketfeed/src/test/java/com/coinbase/exchange/websocketfeed/StatusMessageTest.java
  class StatusMessageTest (line 15) | class StatusMessageTest {
    method shouldDeserialiseSuccessfullyFromValidJson (line 17) | @Test

FILE: websocketfeed/src/test/java/com/coinbase/exchange/websocketfeed/TickerMessageTest.java
  class TickerMessageTest (line 13) | class TickerMessageTest {
    method shouldDeserialiseSuccessfullyFromValidJson (line 15) | @Test
Condensed preview — 115 files, each showing path, character count, and a content snippet. Download the .json file or copy for the full structured content (241K chars).
[
  {
    "path": ".github/workflows/build.yaml",
    "chars": 360,
    "preview": "name: build\non: [push]\n\njobs:\n  byz-build:\n    name: Coinbase Pro Build\n    runs-on: ubuntu-latest\n    steps:\n      - us"
  },
  {
    "path": ".gitignore",
    "chars": 78,
    "preview": "*.iml\n.idea/\n.gradle/\n*.log\n**/classes/\n**/build/\n**/out/\n**/application.*.yml"
  },
  {
    "path": "CONTRIBUTING.md",
    "chars": 5099,
    "preview": "# Contributing\n\nIf you'd like to contribute you'd be more than welcome. The code base is ever growing and in order to ma"
  },
  {
    "path": "LICENSE",
    "chars": 1081,
    "preview": "The MIT License (MIT)\n\nCopyright (c) 2015 Ishmael Rufus\n\nPermission is hereby granted, free of charge, to any person obt"
  },
  {
    "path": "README.md",
    "chars": 9376,
    "preview": "# Coinbase Pro\n\n[![Join the chat at https://gitter.im/irufus/gdax-java](https://badges.gitter.im/irufus/gdax-java.svg)]("
  },
  {
    "path": "api/build.gradle",
    "chars": 1086,
    "preview": "test {\n    useJUnitPlatform()\n}\n\ndependencies {\n    compile project(':model')\n    compile project(':security')\n    imple"
  },
  {
    "path": "api/src/main/java/com/coinbase/exchange/api/accounts/Account.java",
    "chars": 1785,
    "preview": "package com.coinbase.exchange.api.accounts;\n\nimport java.math.BigDecimal;\n\n/**\n * Created by irufus on 2/18/15.\n */\npubl"
  },
  {
    "path": "api/src/main/java/com/coinbase/exchange/api/accounts/AccountHistory.java",
    "chars": 1258,
    "preview": "package com.coinbase.exchange.api.accounts;\n\nimport com.coinbase.exchange.model.Detail;\n\nimport java.math.BigDecimal;\n\n/"
  },
  {
    "path": "api/src/main/java/com/coinbase/exchange/api/accounts/AccountService.java",
    "chars": 2444,
    "preview": "package com.coinbase.exchange.api.accounts;\n\nimport com.coinbase.exchange.model.Hold;\nimport com.coinbase.exchange.api.e"
  },
  {
    "path": "api/src/main/java/com/coinbase/exchange/api/deposits/DepositService.java",
    "chars": 1797,
    "preview": "package com.coinbase.exchange.api.deposits;\n\nimport com.coinbase.exchange.model.CoinbasePaymentRequest;\nimport com.coinb"
  },
  {
    "path": "api/src/main/java/com/coinbase/exchange/api/exchange/CoinbaseExchange.java",
    "chars": 924,
    "preview": "package com.coinbase.exchange.api.exchange;\n\nimport org.springframework.core.ParameterizedTypeReference;\nimport org.spri"
  },
  {
    "path": "api/src/main/java/com/coinbase/exchange/api/exchange/CoinbaseExchangeImpl.java",
    "chars": 6728,
    "preview": "package com.coinbase.exchange.api.exchange;\n\nimport com.coinbase.exchange.security.Signature;\nimport com.fasterxml.jacks"
  },
  {
    "path": "api/src/main/java/com/coinbase/exchange/api/marketdata/MarketData.java",
    "chars": 940,
    "preview": "package com.coinbase.exchange.api.marketdata;\n\nimport java.util.List;\n\n/**\n * Created by robevansuk on 09/02/2017.\n */\np"
  },
  {
    "path": "api/src/main/java/com/coinbase/exchange/api/marketdata/MarketDataService.java",
    "chars": 1055,
    "preview": "package com.coinbase.exchange.api.marketdata;\n\nimport com.coinbase.exchange.api.exchange.CoinbaseExchange;\nimport org.sp"
  },
  {
    "path": "api/src/main/java/com/coinbase/exchange/api/marketdata/Message.java",
    "chars": 2166,
    "preview": "package com.coinbase.exchange.api.marketdata;\n\nimport java.math.BigDecimal;\n\n/**\n * Created by irufus on 2/28/15.\n */\npu"
  },
  {
    "path": "api/src/main/java/com/coinbase/exchange/api/marketdata/MessageEX.java",
    "chars": 615,
    "preview": "package com.coinbase.exchange.api.marketdata;\n\n/**\n * Created by irufus on 3/2/15.\n */\npublic class MessageEX {\n    publ"
  },
  {
    "path": "api/src/main/java/com/coinbase/exchange/api/marketdata/OrderItem.java",
    "chars": 1850,
    "preview": "package com.coinbase.exchange.api.marketdata;\n\nimport com.fasterxml.jackson.annotation.JsonCreator;\nimport org.springfra"
  },
  {
    "path": "api/src/main/java/com/coinbase/exchange/api/marketdata/Trade.java",
    "chars": 1329,
    "preview": "package com.coinbase.exchange.api.marketdata;\n\nimport java.math.BigDecimal;\nimport java.time.Instant;\n\n/**\n * Created by"
  },
  {
    "path": "api/src/main/java/com/coinbase/exchange/api/orders/Order.java",
    "chars": 4233,
    "preview": "package com.coinbase.exchange.api.orders;\n\n/**\n * Created by robevansuk on 03/02/2017.\n */\npublic class Order {\n    Stri"
  },
  {
    "path": "api/src/main/java/com/coinbase/exchange/api/orders/OrderBuilder.java",
    "chars": 2220,
    "preview": "package com.coinbase.exchange.api.orders;\n\n/**\n * Created by irufus on 2/18/15.\n */\npublic class OrderBuilder {\n\n    pri"
  },
  {
    "path": "api/src/main/java/com/coinbase/exchange/api/orders/OrderService.java",
    "chars": 2359,
    "preview": "package com.coinbase.exchange.api.orders;\n\nimport com.coinbase.exchange.model.Fill;\nimport com.coinbase.exchange.model.H"
  },
  {
    "path": "api/src/main/java/com/coinbase/exchange/api/payments/AccountLimit.java",
    "chars": 909,
    "preview": "package com.coinbase.exchange.api.payments;\n\n/**\n * Created by robevansuk on 16/02/2017.\n */\npublic class AccountLimit {"
  },
  {
    "path": "api/src/main/java/com/coinbase/exchange/api/payments/Amount.java",
    "chars": 647,
    "preview": "package com.coinbase.exchange.api.payments;\n\nimport java.math.BigDecimal;\n\n/**\n * Created by robevansuk on 16/02/2017.\n "
  },
  {
    "path": "api/src/main/java/com/coinbase/exchange/api/payments/BankCountry.java",
    "chars": 556,
    "preview": "package com.coinbase.exchange.api.payments;\n\n/**\n * Created by robevansuk on 16/02/2017.\n */\npublic class BankCountry {\n"
  },
  {
    "path": "api/src/main/java/com/coinbase/exchange/api/payments/CoinbaseAccount.java",
    "chars": 2831,
    "preview": "package com.coinbase.exchange.api.payments;\n\nimport java.math.BigDecimal;\n\n/**\n * Created by robevansuk on 16/02/2017.\n "
  },
  {
    "path": "api/src/main/java/com/coinbase/exchange/api/payments/DepositInformation.java",
    "chars": 2573,
    "preview": "package com.coinbase.exchange.api.payments;\n\n/**\n * Created by robevansuk on 16/02/2017.\n */\npublic class DepositInforma"
  },
  {
    "path": "api/src/main/java/com/coinbase/exchange/api/payments/Limit.java",
    "chars": 1128,
    "preview": "package com.coinbase.exchange.api.payments;\n\n/**\n * Created by robevansuk on 16/02/2017.\n */\npublic class Limit {\n\n    A"
  },
  {
    "path": "api/src/main/java/com/coinbase/exchange/api/payments/PaymentService.java",
    "chars": 971,
    "preview": "package com.coinbase.exchange.api.payments;\n\nimport com.coinbase.exchange.api.exchange.CoinbaseExchange;\nimport org.spri"
  },
  {
    "path": "api/src/main/java/com/coinbase/exchange/api/payments/PaymentType.java",
    "chars": 3134,
    "preview": "package com.coinbase.exchange.api.payments;\n\n/**\n * Created by robevansuk on 16/02/2017.\n */\npublic class PaymentType {\n"
  },
  {
    "path": "api/src/main/java/com/coinbase/exchange/api/payments/SepaDepositInformation.java",
    "chars": 2453,
    "preview": "package com.coinbase.exchange.api.payments;\n\n/**\n * Created by robevansuk on 16/02/2017.\n */\npublic class SepaDepositInf"
  },
  {
    "path": "api/src/main/java/com/coinbase/exchange/api/products/ProductService.java",
    "chars": 3059,
    "preview": "package com.coinbase.exchange.api.products;\n\nimport com.coinbase.exchange.api.exchange.CoinbaseExchange;\nimport com.coin"
  },
  {
    "path": "api/src/main/java/com/coinbase/exchange/api/reports/ReportRequest.java",
    "chars": 847,
    "preview": "package com.coinbase.exchange.api.reports;\n\n/**\n * Created by robevansuk on 16/02/2017.\n */\npublic class ReportRequest {"
  },
  {
    "path": "api/src/main/java/com/coinbase/exchange/api/reports/ReportResponse.java",
    "chars": 2131,
    "preview": "package com.coinbase.exchange.api.reports;\n\n/**\n * Created by robevansuk on 16/02/2017.\n */\npublic class ReportResponse "
  },
  {
    "path": "api/src/main/java/com/coinbase/exchange/api/reports/ReportService.java",
    "chars": 1001,
    "preview": "package com.coinbase.exchange.api.reports;\n\nimport com.coinbase.exchange.api.exchange.CoinbaseExchange;\nimport org.sprin"
  },
  {
    "path": "api/src/main/java/com/coinbase/exchange/api/reports/TimePeriod.java",
    "chars": 652,
    "preview": "package com.coinbase.exchange.api.reports;\n\n/**\n * Created by robevansuk on 16/02/2017.\n */\npublic class TimePeriod {\n\n "
  },
  {
    "path": "api/src/main/java/com/coinbase/exchange/api/transfers/Transfer.java",
    "chars": 970,
    "preview": "package com.coinbase.exchange.api.transfers;\n\nimport java.math.BigDecimal;\n\n/**\n * Created by robevansuk on 15/02/2017.\n"
  },
  {
    "path": "api/src/main/java/com/coinbase/exchange/api/transfers/TransferService.java",
    "chars": 1113,
    "preview": "package com.coinbase.exchange.api.transfers;\n\nimport com.coinbase.exchange.api.exchange.CoinbaseExchange;\nimport org.spr"
  },
  {
    "path": "api/src/main/java/com/coinbase/exchange/api/useraccount/UserAccountData.java",
    "chars": 1265,
    "preview": "package com.coinbase.exchange.api.useraccount;\n\nimport java.math.BigDecimal;\n\n/**\n * Created by robevansuk on 17/02/2017"
  },
  {
    "path": "api/src/main/java/com/coinbase/exchange/api/useraccount/UserAccountService.java",
    "chars": 843,
    "preview": "package com.coinbase.exchange.api.useraccount;\n\nimport com.coinbase.exchange.api.exchange.CoinbaseExchange;\nimport org.s"
  },
  {
    "path": "api/src/main/java/com/coinbase/exchange/api/withdrawals/WithdrawalsService.java",
    "chars": 2315,
    "preview": "package com.coinbase.exchange.api.withdrawals;\n\nimport com.coinbase.exchange.api.exchange.CoinbaseExchange;\nimport com.c"
  },
  {
    "path": "api/src/test/java/com/coinbase/exchange/api/BaseIntegrationTest.java",
    "chars": 674,
    "preview": "package com.coinbase.exchange.api;\n\nimport com.coinbase.exchange.api.exchange.CoinbaseExchange;\nimport org.springframewo"
  },
  {
    "path": "api/src/test/java/com/coinbase/exchange/api/TestExchangeApplication.java",
    "chars": 619,
    "preview": "package com.coinbase.exchange.api;\n\nimport org.springframework.boot.SpringApplication;\nimport org.springframework.boot.a"
  },
  {
    "path": "api/src/test/java/com/coinbase/exchange/api/accounts/AccountsIntegrationTest.java",
    "chars": 3290,
    "preview": "package com.coinbase.exchange.api.accounts;\n\nimport com.coinbase.exchange.api.BaseIntegrationTest;\nimport com.coinbase.e"
  },
  {
    "path": "api/src/test/java/com/coinbase/exchange/api/accounts/DepositIntegrationTest.java",
    "chars": 3463,
    "preview": "package com.coinbase.exchange.api.accounts;\n\nimport com.coinbase.exchange.api.BaseIntegrationTest;\nimport com.coinbase.e"
  },
  {
    "path": "api/src/test/java/com/coinbase/exchange/api/accounts/UserAccountServiceIntegrationTest.java",
    "chars": 1271,
    "preview": "package com.coinbase.exchange.api.accounts;\n\nimport com.coinbase.exchange.api.BaseIntegrationTest;\nimport com.coinbase.e"
  },
  {
    "path": "api/src/test/java/com/coinbase/exchange/api/accounts/WithdrawalIntegrationTest.java",
    "chars": 4014,
    "preview": "package com.coinbase.exchange.api.accounts;\n\nimport com.coinbase.exchange.api.BaseIntegrationTest;\nimport com.coinbase.e"
  },
  {
    "path": "api/src/test/java/com/coinbase/exchange/api/authentication/AuthenticationIntegrationIntegrationTest.java",
    "chars": 1475,
    "preview": "package com.coinbase.exchange.api.authentication;\n\nimport com.coinbase.exchange.api.BaseIntegrationTest;\nimport com.coin"
  },
  {
    "path": "api/src/test/java/com/coinbase/exchange/api/config/IntegrationTestConfiguration.java",
    "chars": 1335,
    "preview": "package com.coinbase.exchange.api.config;\n\nimport com.coinbase.exchange.api.exchange.CoinbaseExchange;\nimport com.coinba"
  },
  {
    "path": "api/src/test/java/com/coinbase/exchange/api/marketdata/MarketDataIntegrationTest.java",
    "chars": 2827,
    "preview": "package com.coinbase.exchange.api.marketdata;\n\nimport com.coinbase.exchange.api.BaseIntegrationTest;\nimport com.coinbase"
  },
  {
    "path": "api/src/test/java/com/coinbase/exchange/api/marketdata/OrderItemDeserializerTest.java",
    "chars": 1347,
    "preview": "package com.coinbase.exchange.api.marketdata;\n\nimport com.fasterxml.jackson.databind.ObjectMapper;\nimport org.junit.jupi"
  },
  {
    "path": "api/src/test/java/com/coinbase/exchange/api/orders/OrderIntegrationTest.java",
    "chars": 8008,
    "preview": "package com.coinbase.exchange.api.orders;\n\nimport com.coinbase.exchange.api.BaseIntegrationTest;\nimport com.coinbase.exc"
  },
  {
    "path": "api/src/test/java/com/coinbase/exchange/api/payments/PaymentIntegrationTest.java",
    "chars": 1094,
    "preview": "package com.coinbase.exchange.api.payments;\n\nimport com.coinbase.exchange.api.BaseIntegrationTest;\nimport com.coinbase.e"
  },
  {
    "path": "api/src/test/java/com/coinbase/exchange/api/products/ProductsIntegrationTest.java",
    "chars": 4656,
    "preview": "package com.coinbase.exchange.api.products;\n\nimport com.coinbase.exchange.api.BaseIntegrationTest;\nimport com.coinbase.e"
  },
  {
    "path": "api/src/test/java/com/coinbase/exchange/api/transfers/TransferServiceIntegrationTest.java",
    "chars": 905,
    "preview": "package com.coinbase.exchange.api.transfers;\n\nimport com.coinbase.exchange.api.BaseIntegrationTest;\nimport com.coinbase."
  },
  {
    "path": "api/src/test/resources/application-test.yml",
    "chars": 208,
    "preview": "exchange:\n  api:\n    baseUrl: \"https://api-public.sandbox.pro.coinbase.com\"\n  key: \"\"\n  secret: \"\"\n  passphrase: \"\"\n\nweb"
  },
  {
    "path": "build.gradle",
    "chars": 2666,
    "preview": "buildscript {\n    repositories {\n        jcenter()\n    }\n    dependencies {\n        classpath 'com.github.jengelman.grad"
  },
  {
    "path": "gradle/wrapper/gradle-wrapper.properties",
    "chars": 232,
    "preview": "#Fri Jan 20 14:01:00 GMT 2017\ndistributionBase=GRADLE_USER_HOME\ndistributionPath=wrapper/dists\nzipStoreBase=GRADLE_USER_"
  },
  {
    "path": "gradlew",
    "chars": 5299,
    "preview": "#!/usr/bin/env sh\n\n##############################################################################\n##\n##  Gradle start up"
  },
  {
    "path": "gradlew.bat",
    "chars": 2260,
    "preview": "@if \"%DEBUG%\" == \"\" @echo off\r\n@rem ##########################################################################\r\n@rem\r\n@r"
  },
  {
    "path": "model/build.gradle",
    "chars": 285,
    "preview": "dependencies {\n    implementation 'com.fasterxml.jackson.core:jackson-core'\n    implementation 'com.fasterxml.jackson.co"
  },
  {
    "path": "model/src/main/java/com/coinbase/exchange/model/Candle.java",
    "chars": 1740,
    "preview": "package com.coinbase.exchange.model;\n\nimport java.math.BigDecimal;\nimport java.time.Instant;\n\npublic class Candle {\n\n   "
  },
  {
    "path": "model/src/main/java/com/coinbase/exchange/model/Candles.java",
    "chars": 371,
    "preview": "package com.coinbase.exchange.model;\n\nimport java.util.List;\nimport java.util.stream.Collectors;\n\npublic class Candles {"
  },
  {
    "path": "model/src/main/java/com/coinbase/exchange/model/CoinbasePaymentRequest.java",
    "chars": 879,
    "preview": "package com.coinbase.exchange.model;\n\nimport java.math.BigDecimal;\n\n/**\n * Created by robevansuk on 15/02/2017.\n */\npubl"
  },
  {
    "path": "model/src/main/java/com/coinbase/exchange/model/CryptoPaymentRequest.java",
    "chars": 526,
    "preview": "package com.coinbase.exchange.model;\n\nimport java.math.BigDecimal;\n\npublic class CryptoPaymentRequest extends MonetaryRe"
  },
  {
    "path": "model/src/main/java/com/coinbase/exchange/model/Currency.java",
    "chars": 2563,
    "preview": "package com.coinbase.exchange.model;\n\nimport com.fasterxml.jackson.annotation.JsonIgnoreProperties;\n\nimport java.math.Bi"
  },
  {
    "path": "model/src/main/java/com/coinbase/exchange/model/Detail.java",
    "chars": 669,
    "preview": "package com.coinbase.exchange.model;\n\n/**\n * Created by irufus on 2/25/15.\n */\npublic class Detail {\n    private String "
  },
  {
    "path": "model/src/main/java/com/coinbase/exchange/model/Fill.java",
    "chars": 1745,
    "preview": "package com.coinbase.exchange.model;\n\nimport java.math.BigDecimal;\n\n/**\n * Created by irufus on 2/18/15.\n */\npublic clas"
  },
  {
    "path": "model/src/main/java/com/coinbase/exchange/model/Granularity.java",
    "chars": 750,
    "preview": "package com.coinbase.exchange.model;\n\npublic enum Granularity {\n    ONE_DAY(\"1d\"),\n    SIX_HOURS(\"6h\"),\n    ONE_HOUR(\"1h"
  },
  {
    "path": "model/src/main/java/com/coinbase/exchange/model/Hold.java",
    "chars": 1693,
    "preview": "package com.coinbase.exchange.model;\n\nimport java.math.BigDecimal;\n\n/**\n * Created by irufus on 2/18/15.\n * Updated by r"
  },
  {
    "path": "model/src/main/java/com/coinbase/exchange/model/MonetaryRequest.java",
    "chars": 613,
    "preview": "package com.coinbase.exchange.model;\n\nimport java.math.BigDecimal;\n\npublic abstract class MonetaryRequest {\n    protecte"
  },
  {
    "path": "model/src/main/java/com/coinbase/exchange/model/NewLimitOrderSingle.java",
    "chars": 1704,
    "preview": "package com.coinbase.exchange.model;\n\nimport java.math.BigDecimal;\nimport java.math.RoundingMode;\n\n/**\n * Created by iru"
  },
  {
    "path": "model/src/main/java/com/coinbase/exchange/model/NewMarketOrderSingle.java",
    "chars": 532,
    "preview": "package com.coinbase.exchange.model;\n\nimport java.math.BigDecimal;\n\n/**\n * Created by irufus on 7/31/15.\n */\npublic clas"
  },
  {
    "path": "model/src/main/java/com/coinbase/exchange/model/NewOrderSingle.java",
    "chars": 1770,
    "preview": "package com.coinbase.exchange.model;\n\n/**\n *\n * <pre>\n * {\n *     \"id\": \"d0c5340b-6d6c-49d9-b567-48c4bfca13d2\",\n *     \""
  },
  {
    "path": "model/src/main/java/com/coinbase/exchange/model/PaymentRequest.java",
    "chars": 600,
    "preview": "package com.coinbase.exchange.model;\n\nimport java.math.BigDecimal;\n\n/**\n * Created by robevansuk on 15/02/2017.\n */\npubl"
  },
  {
    "path": "model/src/main/java/com/coinbase/exchange/model/PaymentResponse.java",
    "chars": 1069,
    "preview": "package com.coinbase.exchange.model;\n\nimport java.math.BigDecimal;\n\n/**\n * Created by robevansuk on 15/02/2017.\n */\npubl"
  },
  {
    "path": "model/src/main/java/com/coinbase/exchange/model/Product.java",
    "chars": 4359,
    "preview": "package com.coinbase.exchange.model;\n\nimport com.fasterxml.jackson.annotation.JsonIgnoreProperties;\n\nimport java.math.Bi"
  },
  {
    "path": "model/src/main/java/com/coinbase/exchange/model/ProductOrderBook.java",
    "chars": 705,
    "preview": "package com.coinbase.exchange.model;\n\nimport java.util.List;\n\n/**\n * Created by irufus on 8/3/15.\n */\npublic class Produ"
  },
  {
    "path": "security/build.gradle",
    "chars": 192,
    "preview": "plugins {\n    id 'java'\n}\n\ngroup 'com.coinbase.exchange'\nversion '0.11.0'\n\nrepositories {\n    mavenCentral()\n}\n\ndependen"
  },
  {
    "path": "security/src/main/java/com/coinbase/exchange/security/Signature.java",
    "chars": 1748,
    "preview": "package com.coinbase.exchange.security;\n\nimport com.coinbase.exchange.security.constants.ExchangeConstants;\n\nimport java"
  },
  {
    "path": "security/src/main/java/com/coinbase/exchange/security/constants/ExchangeConstants.java",
    "chars": 430,
    "preview": "package com.coinbase.exchange.security.constants;\n\nimport javax.crypto.Mac;\nimport java.security.NoSuchAlgorithmExceptio"
  },
  {
    "path": "settings.gradle",
    "chars": 133,
    "preview": "rootProject.name = 'coinbase-pro-java'\n\ninclude 'api'\ninclude 'security'\ninclude 'websocketfeed'\ninclude 'model'\ninclude"
  },
  {
    "path": "websocketfeed/build.gradle",
    "chars": 894,
    "preview": "dependencies {\n    compile project(':model')\n    compile project(':security')\n    implementation 'org.springframework.bo"
  },
  {
    "path": "websocketfeed/src/main/java/com/coinbase/exchange/websocketfeed/ActivateOrderBookMessage.java",
    "chars": 1989,
    "preview": "package com.coinbase.exchange.websocketfeed;\n\nimport com.fasterxml.jackson.annotation.JsonProperty;\n\nimport java.math.Bi"
  },
  {
    "path": "websocketfeed/src/main/java/com/coinbase/exchange/websocketfeed/ChangedOrderBookMessage.java",
    "chars": 1736,
    "preview": "package com.coinbase.exchange.websocketfeed;\n\n/**\n * An order has changed. This is the result of self-trade prevention\n "
  },
  {
    "path": "websocketfeed/src/main/java/com/coinbase/exchange/websocketfeed/Channel.java",
    "chars": 1828,
    "preview": "package com.coinbase.exchange.websocketfeed;\n\nimport com.fasterxml.jackson.annotation.JsonInclude;\nimport com.fasterxml."
  },
  {
    "path": "websocketfeed/src/main/java/com/coinbase/exchange/websocketfeed/ChannelName.java",
    "chars": 133,
    "preview": "package com.coinbase.exchange.websocketfeed;\n\npublic enum ChannelName {\n    heartbeat, status, ticker, level2, user, mat"
  },
  {
    "path": "websocketfeed/src/main/java/com/coinbase/exchange/websocketfeed/DoneOrderBookMessage.java",
    "chars": 508,
    "preview": "package com.coinbase.exchange.websocketfeed;\n\n/**\n * <pre>\n *  {\n *    \"type\": \"done\",\n *    \"time\": \"2014-11-07T08:19:2"
  },
  {
    "path": "websocketfeed/src/main/java/com/coinbase/exchange/websocketfeed/ErrorOrderBookMessage.java",
    "chars": 919,
    "preview": "package com.coinbase.exchange.websocketfeed;\n\n/**\n * If you send a message that is not recognized or an error\n * occurs,"
  },
  {
    "path": "websocketfeed/src/main/java/com/coinbase/exchange/websocketfeed/FeedMessage.java",
    "chars": 2297,
    "preview": "package com.coinbase.exchange.websocketfeed;\n\nimport com.fasterxml.jackson.annotation.JsonIgnoreProperties;\nimport com.f"
  },
  {
    "path": "websocketfeed/src/main/java/com/coinbase/exchange/websocketfeed/HeartBeat.java",
    "chars": 840,
    "preview": "package com.coinbase.exchange.websocketfeed;\n\n/**\n * A message sent once a second when heartbeat is turned on.\n * <pre>\n"
  },
  {
    "path": "websocketfeed/src/main/java/com/coinbase/exchange/websocketfeed/L2UpdateMessage.java",
    "chars": 1066,
    "preview": "package com.coinbase.exchange.websocketfeed;\n\n/**\n * Subsequent updates will have the type l2update.\n * The changes prop"
  },
  {
    "path": "websocketfeed/src/main/java/com/coinbase/exchange/websocketfeed/MatchedOrderBookMessage.java",
    "chars": 1259,
    "preview": "package com.coinbase.exchange.websocketfeed;\n\n/**\n * A trade occurred between two orders. The aggressor or taker order i"
  },
  {
    "path": "websocketfeed/src/main/java/com/coinbase/exchange/websocketfeed/OpenedOrderBookMessage.java",
    "chars": 475,
    "preview": "package com.coinbase.exchange.websocketfeed;\n\n/**\n * <pre>\n *  {\n *    \"type\": \"open\",\n *    \"time\": \"2014-11-07T08:19:2"
  },
  {
    "path": "websocketfeed/src/main/java/com/coinbase/exchange/websocketfeed/OrderBookMessage.java",
    "chars": 10289,
    "preview": "package com.coinbase.exchange.websocketfeed;\n\nimport java.math.BigDecimal;\nimport java.math.RoundingMode;\nimport java.ti"
  },
  {
    "path": "websocketfeed/src/main/java/com/coinbase/exchange/websocketfeed/ReceivedOrderBookMessage.java",
    "chars": 1826,
    "preview": "package com.coinbase.exchange.websocketfeed;\n\n\n/**\n * A valid order has been received and is now active. This message is"
  },
  {
    "path": "websocketfeed/src/main/java/com/coinbase/exchange/websocketfeed/SnapshotMessage.java",
    "chars": 868,
    "preview": "package com.coinbase.exchange.websocketfeed;\n\n/**\n * A snapshot of the order book\n * Example:\n * <pre>\n * {\n *     \"type"
  },
  {
    "path": "websocketfeed/src/main/java/com/coinbase/exchange/websocketfeed/StatusMessage.java",
    "chars": 2585,
    "preview": "package com.coinbase.exchange.websocketfeed;\n\nimport com.coinbase.exchange.model.Currency;\nimport com.coinbase.exchange."
  },
  {
    "path": "websocketfeed/src/main/java/com/coinbase/exchange/websocketfeed/Subscribe.java",
    "chars": 2285,
    "preview": "package com.coinbase.exchange.websocketfeed;\n\nimport static com.coinbase.exchange.websocketfeed.ChannelName.full;\n\n/**\n "
  },
  {
    "path": "websocketfeed/src/main/java/com/coinbase/exchange/websocketfeed/SubscriptionsMessage.java",
    "chars": 936,
    "preview": "package com.coinbase.exchange.websocketfeed;\n\n/**\n * <pre>\n * {\n *     \"type\": \"subscriptions\",\n *     \"channels\": [\n * "
  },
  {
    "path": "websocketfeed/src/main/java/com/coinbase/exchange/websocketfeed/TickerMessage.java",
    "chars": 3070,
    "preview": "package com.coinbase.exchange.websocketfeed;\n\nimport java.math.BigDecimal;\nimport java.time.Instant;\n\n/**\n * The ticker "
  },
  {
    "path": "websocketfeed/src/main/java/com/coinbase/exchange/websocketfeed/WebsocketFeed.java",
    "chars": 5235,
    "preview": "package com.coinbase.exchange.websocketfeed;\n\nimport com.coinbase.exchange.security.Signature;\nimport com.fasterxml.jack"
  },
  {
    "path": "websocketfeed/src/main/java/com/coinbase/exchange/websocketfeed/WebsocketMessageHandler.java",
    "chars": 4069,
    "preview": "package com.coinbase.exchange.websocketfeed;\n\nimport com.fasterxml.jackson.databind.ObjectMapper;\nimport org.slf4j.Logge"
  },
  {
    "path": "websocketfeed/src/test/java/com/coinbase/exchange/websocketfeed/ActivateOrderBookMessageTest.java",
    "chars": 2350,
    "preview": "package com.coinbase.exchange.websocketfeed;\n\nimport com.fasterxml.jackson.core.JsonProcessingException;\nimport com.fast"
  },
  {
    "path": "websocketfeed/src/test/java/com/coinbase/exchange/websocketfeed/ChangedOrderBookMessageTest.java",
    "chars": 1959,
    "preview": "package com.coinbase.exchange.websocketfeed;\n\nimport com.fasterxml.jackson.core.JsonProcessingException;\nimport com.fast"
  },
  {
    "path": "websocketfeed/src/test/java/com/coinbase/exchange/websocketfeed/DoneOrderBookMessageTest.java",
    "chars": 1878,
    "preview": "package com.coinbase.exchange.websocketfeed;\n\nimport com.fasterxml.jackson.core.JsonProcessingException;\nimport com.fast"
  },
  {
    "path": "websocketfeed/src/test/java/com/coinbase/exchange/websocketfeed/ErrorOrderBookMessageTest.java",
    "chars": 767,
    "preview": "package com.coinbase.exchange.websocketfeed;\n\nimport com.fasterxml.jackson.core.JsonProcessingException;\nimport com.fast"
  },
  {
    "path": "websocketfeed/src/test/java/com/coinbase/exchange/websocketfeed/HeartBeatTest.java",
    "chars": 1291,
    "preview": "package com.coinbase.exchange.websocketfeed;\n\n\nimport com.fasterxml.jackson.core.JsonProcessingException;\nimport com.fas"
  },
  {
    "path": "websocketfeed/src/test/java/com/coinbase/exchange/websocketfeed/L2UpdateMessageTest.java",
    "chars": 1442,
    "preview": "package com.coinbase.exchange.websocketfeed;\n\nimport com.fasterxml.jackson.core.JsonProcessingException;\nimport com.fast"
  },
  {
    "path": "websocketfeed/src/test/java/com/coinbase/exchange/websocketfeed/MatchedOrderBookMessageTest.java",
    "chars": 2049,
    "preview": "package com.coinbase.exchange.websocketfeed;\n\nimport com.fasterxml.jackson.core.JsonProcessingException;\nimport com.fast"
  },
  {
    "path": "websocketfeed/src/test/java/com/coinbase/exchange/websocketfeed/OpenedOrderBookMessageTest.java",
    "chars": 1778,
    "preview": "package com.coinbase.exchange.websocketfeed;\n\nimport com.fasterxml.jackson.core.JsonProcessingException;\nimport com.fast"
  },
  {
    "path": "websocketfeed/src/test/java/com/coinbase/exchange/websocketfeed/ReceivedOrderBookMessageTest.java",
    "chars": 1896,
    "preview": "package com.coinbase.exchange.websocketfeed;\n\nimport com.fasterxml.jackson.core.JsonProcessingException;\nimport com.fast"
  },
  {
    "path": "websocketfeed/src/test/java/com/coinbase/exchange/websocketfeed/SnapshotMessageTest.java",
    "chars": 1201,
    "preview": "package com.coinbase.exchange.websocketfeed;\n\nimport com.fasterxml.jackson.core.JsonProcessingException;\nimport com.fast"
  },
  {
    "path": "websocketfeed/src/test/java/com/coinbase/exchange/websocketfeed/StatusMessageTest.java",
    "chars": 6790,
    "preview": "package com.coinbase.exchange.websocketfeed;\n\nimport com.fasterxml.jackson.core.JsonProcessingException;\nimport com.fast"
  },
  {
    "path": "websocketfeed/src/test/java/com/coinbase/exchange/websocketfeed/TickerMessageTest.java",
    "chars": 1902,
    "preview": "package com.coinbase.exchange.websocketfeed;\n\nimport com.fasterxml.jackson.core.JsonProcessingException;\nimport com.fast"
  }
]

// ... and 1 more files (download for full content)

About this extraction

This page contains the full source code of the irufus/gdax-java GitHub repository, extracted and formatted as plain text for AI agents and large language models (LLMs). The extraction includes 115 files (214.2 KB), approximately 53.5k tokens, and a symbol index with 886 extracted functions, classes, methods, constants, and types. Use this with OpenClaw, Claude, ChatGPT, Cursor, Windsurf, or any other AI tool that accepts text input. You can copy the full output to your clipboard or download it as a .txt file.

Extracted by GitExtract — free GitHub repo to text converter for AI. Built by Nikandr Surkov.

Copied to clipboard!