private CoinbaseCache( @JsonProperty("notes_present") final boolean notesPresent, @JsonProperty("category") final CoinbaseAccountChangeCategory category, @JsonProperty("other_user") final CoinbaseUserInfo otherUser) { this.notesPresent = notesPresent; this.category = category; this.otherUser = new CoinbaseUser(otherUser); }
private static void demoUsers(CoinbaseAccountService accountService) throws IOException { CoinbaseUsers users = accountService.getCoinbaseUsers(); System.out.println("Current User: " + users); CoinbaseUser user = users.getUsers().get(0); user.updateTimeZone("Tijuana").updateNativeCurrency("MXN"); user = accountService.updateCoinbaseUser(user); System.out.println("Updated User: " + user); CoinbaseUser newUser = CoinbaseUser.createCoinbaseNewUserWithReferrerId( "demo@demo.com", "pass1234", "527d2a1ffedcb8b73b000028"); String oauthClientId = ""; // optional CoinbaseUser createdUser = accountService.createCoinbaseUser(newUser, oauthClientId); System.out.println("Newly created user: " + createdUser); }
public static AccountInfo adaptAccountInfo(CoinbaseUser user) { final String username = user.getEmail(); final CoinbaseMoney money = user.getBalance(); final Balance balance = new Balance(Currency.getInstance(money.getCurrency()), money.getAmount()); final AccountInfo accountInfoTemporaryName = new AccountInfo(username, new Wallet(balance)); return accountInfoTemporaryName; }
/** * Unauthenticated resource that creates a user with an email and password. * * @param user New Coinbase User information. * @param oAuthClientId Optional client id that corresponds to your OAuth2 application. * @return Information for the newly created user, including information to perform future OAuth * requests for the user. * @throws IOException * @see <a * href="https://coinbase.com/api/doc/1.0/users/create.html">coinbase.com/api/doc/1.0/users/create.html</a> * @see {@link CoinbaseUser#createNewCoinbaseUser} and {@link * CoinbaseUser#createCoinbaseNewUserWithReferrerId} */ public CoinbaseUser createCoinbaseUser(CoinbaseUser user, final String oAuthClientId) throws IOException { final CoinbaseUser createdUser = coinbase.createUser(user.withoAuthClientId(oAuthClientId)); return handleResponse(createdUser); }
/** * Authenticated resource that lets you update account settings for the current user. Use {@link * #getCoinbaseUsers()} to retrieve the current user first. * * @param user {@code CoinbaseUser} with new information to be updated. * @return The current {@code CoinbaseUser} with the requested updated account settings. * @throws IOException * @see <a * href="https://coinbase.com/api/doc/1.0/users/update.html">coinbase.com/api/doc/1.0/users/update.html</a> */ public CoinbaseUser updateCoinbaseUser(CoinbaseUser user) throws IOException { final CoinbaseUser updatedUser = coinbase.updateUser( user.getId(), user, exchange.getExchangeSpecification().getApiKey(), signatureCreator, exchange.getNonceFactory()); return handleResponse(updatedUser); }
/** * Unauthenticated resource that creates a user with an email and password. * * @param user New Coinbase User information. * @param oAuthClientId Optional client id that corresponds to your OAuth2 application. * @return Information for the newly created user, including information to perform future OAuth * requests for the user. * @throws IOException * @see <a * href="https://coinbase.com/api/doc/1.0/users/create.html">coinbase.com/api/doc/1.0/users/create.html</a> * @see {@link CoinbaseUser#createNewCoinbaseUser} and {@link * CoinbaseUser#createCoinbaseNewUserWithReferrerId} */ public CoinbaseUser createCoinbaseUser(CoinbaseUser user, final String oAuthClientId) throws IOException { final CoinbaseUser createdUser = coinbase.createUser(user.withoAuthClientId(oAuthClientId)); return handleResponse(createdUser); }
/** * Authenticated resource that lets you update account settings for the current user. Use {@link * #getCoinbaseUsers()} to retrieve the current user first. * * @param user {@code CoinbaseUser} with new information to be updated. * @return The current {@code CoinbaseUser} with the requested updated account settings. * @throws IOException * @see <a * href="https://coinbase.com/api/doc/1.0/users/update.html">coinbase.com/api/doc/1.0/users/update.html</a> */ public CoinbaseUser updateCoinbaseUser(CoinbaseUser user) throws IOException { final CoinbaseUser updatedUser = coinbase.updateUser( user.getId(), user, exchange.getExchangeSpecification().getApiKey(), signatureCreator, exchange.getNonceFactory()); return handleResponse(updatedUser); }
private CoinbaseAccountChanges( @JsonProperty("current_user") final CoinbaseUserInfo currentUser, @JsonProperty("balance") final CoinbaseMoney balance, @JsonProperty("account_changes") final List<CoinbaseAccountChange> accountChanges, @JsonProperty("total_count") final int totalCount, @JsonProperty("num_pages") final int numPages, @JsonProperty("current_page") final int currentPage) { super(totalCount, numPages, currentPage); this.currentUser = new CoinbaseUser(currentUser); this.balance = balance; this.accountChanges = accountChanges; }
public static AccountInfo adaptAccountInfo(CoinbaseUser user) { final String username = user.getEmail(); final CoinbaseMoney money = user.getBalance(); final Balance balance = new Balance(Currency.getInstance(money.getCurrency()), money.getAmount()); final AccountInfo accountInfoTemporaryName = new AccountInfo(username, new Wallet(balance)); return accountInfoTemporaryName; }
private CoinbaseTransactions( @JsonProperty("current_user") final CoinbaseUserInfo currentUser, @JsonProperty("balance") final CoinbaseMoney balance, @JsonProperty("transactions") final List<CoinbaseTransaction> transactions, @JsonProperty("total_count") final int totalCount, @JsonProperty("num_pages") final int numPages, @JsonProperty("current_page") final int currentPage) { super(totalCount, numPages, currentPage); this.currentUser = new CoinbaseUser(currentUser); this.balance = balance; this.transactions = transactions; }
private CoinbaseTransactionInfoResult( @JsonProperty("id") final String id, @JsonProperty("created_at") @JsonDeserialize(using = ISO8601DateDeserializer.class) final Date createdAt, @JsonProperty("amount") final CoinbaseMoney amount, @JsonProperty("request") final boolean request, @JsonProperty("status") final CoinbaseTransactionStatus status, @JsonProperty("sender") final CoinbaseUserInfo sender, @JsonProperty("recipient") final CoinbaseUserInfo recipient, @JsonProperty("recipient_address") final String recipientAddress, @JsonProperty("notes") final String notes, @JsonProperty("hsh") final String transactionHash, @JsonProperty("idem") final String idempotencyKey) { this.id = id; this.createdAt = createdAt; this.amount = amount; this.request = request; this.status = status; this.sender = new CoinbaseUser(sender); this.recipient = new CoinbaseUser(recipient); this.recipientAddress = recipientAddress; this.notes = notes; this.transactionHash = transactionHash; this.idempotencyKey = idempotencyKey; }
public static CoinbaseUser createCoinbaseNewUserWithReferrerId( String email, final String password, final String referrerId) { return new CoinbaseUser(new CoinbaseUserInfo(email, password, referrerId)); }
public static CoinbaseUser createNewCoinbaseUser(String email, final String password) { return new CoinbaseUser(new CoinbaseUserInfo(email, password, null)); }
private CoinbaseCache( @JsonProperty("notes_present") final boolean notesPresent, @JsonProperty("category") final CoinbaseAccountChangeCategory category, @JsonProperty("other_user") final CoinbaseUserInfo otherUser) { this.notesPresent = notesPresent; this.category = category; this.otherUser = new CoinbaseUser(otherUser); }
private CoinbaseTransactions( @JsonProperty("current_user") final CoinbaseUserInfo currentUser, @JsonProperty("balance") final CoinbaseMoney balance, @JsonProperty("transactions") final List<CoinbaseTransaction> transactions, @JsonProperty("total_count") final int totalCount, @JsonProperty("num_pages") final int numPages, @JsonProperty("current_page") final int currentPage) { super(totalCount, numPages, currentPage); this.currentUser = new CoinbaseUser(currentUser); this.balance = balance; this.transactions = transactions; }
private CoinbaseAccountChanges( @JsonProperty("current_user") final CoinbaseUserInfo currentUser, @JsonProperty("balance") final CoinbaseMoney balance, @JsonProperty("account_changes") final List<CoinbaseAccountChange> accountChanges, @JsonProperty("total_count") final int totalCount, @JsonProperty("num_pages") final int numPages, @JsonProperty("current_page") final int currentPage) { super(totalCount, numPages, currentPage); this.currentUser = new CoinbaseUser(currentUser); this.balance = balance; this.accountChanges = accountChanges; }
private CoinbaseTransactionInfoResult( @JsonProperty("id") final String id, @JsonProperty("created_at") @JsonDeserialize(using = ISO8601DateDeserializer.class) final Date createdAt, @JsonProperty("amount") final CoinbaseMoney amount, @JsonProperty("request") final boolean request, @JsonProperty("status") final CoinbaseTransactionStatus status, @JsonProperty("sender") final CoinbaseUserInfo sender, @JsonProperty("recipient") final CoinbaseUserInfo recipient, @JsonProperty("recipient_address") final String recipientAddress, @JsonProperty("notes") final String notes, @JsonProperty("hsh") final String transactionHash, @JsonProperty("idem") final String idempotencyKey) { this.id = id; this.createdAt = createdAt; this.amount = amount; this.request = request; this.status = status; this.sender = new CoinbaseUser(sender); this.recipient = new CoinbaseUser(recipient); this.recipientAddress = recipientAddress; this.notes = notes; this.transactionHash = transactionHash; this.idempotencyKey = idempotencyKey; }
public static CoinbaseUser createCoinbaseNewUserWithReferrerId( String email, final String password, final String referrerId) { return new CoinbaseUser(new CoinbaseUserInfo(email, password, referrerId)); }
public static CoinbaseUser createNewCoinbaseUser(String email, final String password) { return new CoinbaseUser(new CoinbaseUserInfo(email, password, null)); }