com.netki.WalletName Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of netki-partner-client Show documentation
Show all versions of netki-partner-client Show documentation
Library used to access Netki's Partner API
The newest version!
package com.netki;
import java.util.*;
import org.codehaus.jackson.JsonNode;
import org.codehaus.jackson.map.ObjectMapper;
/**
* Wallet Name data container
*/
public class WalletName extends BaseObject {
private String id;
private String domainName;
private String name;
private String externalId;
private Requestor requestor = new Requestor();
private Map wallets = new HashMap();
/**
* Instantiate an empty WalletName object
*/
public WalletName() {}
/**
* Instantiate an empty WalletName object using a specified {@link Requestor}. Used only in TEST.
*
* @param requestor Requestor to use for Netki API interaction
*/
public WalletName(Requestor requestor)
{
if(requestor != null)
{
this.requestor = requestor;
}
}
/**
* Get WalletName used currencies
*
* @return List of used currency shortcodes
*/
public List getUsedCurrencies() {
String[] currencyArray = this.wallets.keySet().toArray(new String[this.wallets.size()]);
return Arrays.asList(currencyArray);
}
/**
* Get WalletName wallet address for specified currency shortcode
*
* @param currency Currency shortcode (i.e, btc, ltc, nmc, etc)
* @return Wallet Address
*/
public String getWalletAddress(String currency) {
if (this.wallets.containsKey(currency)) {
return this.wallets.get(currency);
}
return null;
}
/**
* Set wallet address for specified currency shortcode
*
* @param currency Currency Shortcode
* @param walletAddress Wallet Address
*/
public void setCurrencyAddress(String currency, String walletAddress) {
this.wallets.put(currency, walletAddress);
}
/**
* Remove Wallet Address for specified currency shortcode
*
* @param currency Currency Shortcode
*/
public void removeCurrencyAddress(String currency) {
if(this.wallets.containsKey(currency)) {
this.wallets.remove(currency);
}
}
/**
* Save WalletName to Netki API
*
* @throws Exception Occurs on Bad HTTP Request / Response
*/
public void save() throws Exception {
Map fullRequest = new HashMap ();
Map
© 2015 - 2025 Weber Informatics LLC | Privacy Policy