<commit_before>package com.msgilligan.bitcoin.rpc;

import java.io.IOException;
import java.math.BigDecimal;
import java.net.URL;
import java.util.Arrays;
import java.util.List;
import java.util.Map;

/**
 * User: sean
 * Date: 6/16/14
 * Time: 5:34 PM
 */
public class MastercoinClient extends BitcoinClient {

    public MastercoinClient(URL server, String rpcuser, String rpcpassword) throws IOException {
        super(server, rpcuser, rpcpassword);
    }

    public String send_MP(String fromAddress, String toAddress, Long currencyId, BigDecimal amount) throws IOException {
        List<Object> params = Arrays.asList((Object) fromAddress, toAddress, currencyId, amount);
        Map<String, Object> response = send("send_MP", params);
        String txid = (String) response.get("result");
        return txid;
    }

    public BigDecimal getbalance_MP(String address, Long currencyId) throws IOException {
        List<Object> params = Arrays.asList((Object) address, currencyId);
        Map<String, Object> response = send("getbalance_MP", params);
        Double balanceBTCd = (Double) response.get("result");
        // Beware of the new BigDecimal(double d) constructor, it results in unexpected/undesired values.
        BigDecimal balanceBTC = BigDecimal.valueOf(balanceBTCd);
        return balanceBTC;
    }
}<commit_msg>Add getallbalancesforid_MP method<commit_after>package com.msgilligan.bitcoin.rpc;

import java.io.IOException;
import java.math.BigDecimal;
import java.net.URL;
import java.util.Arrays;
import java.util.List;
import java.util.Map;

/**
 * User: sean
 * Date: 6/16/14
 * Time: 5:34 PM
 */
public class MastercoinClient extends BitcoinClient {

    public MastercoinClient(URL server, String rpcuser, String rpcpassword) throws IOException {
        super(server, rpcuser, rpcpassword);
    }

    public String send_MP(String fromAddress, String toAddress, Long currencyId, BigDecimal amount) throws IOException {
        List<Object> params = Arrays.asList((Object) fromAddress, toAddress, currencyId, amount);
        Map<String, Object> response = send("send_MP", params);
        String txid = (String) response.get("result");
        return txid;
    }

    public BigDecimal getbalance_MP(String address, Long currencyId) throws IOException {
        List<Object> params = Arrays.asList((Object) address, currencyId);
        Map<String, Object> response = send("getbalance_MP", params);
        Double balanceBTCd = (Double) response.get("result");
        // Beware of the new BigDecimal(double d) constructor, it results in unexpected/undesired values.
        BigDecimal balanceBTC = BigDecimal.valueOf(balanceBTCd);
        return balanceBTC;
    }

    public List<Object> getallbalancesforid_MP(Long currencyId) throws IOException {
        // TODO: currencyID should probably not be passed as a string
        List<Object> params = Arrays.asList((Object) currencyId.toString());
        Map<String, Object> response = send("getallbalancesforid_MP", params);
        List<Object> balances = (List<Object>) response.get("result");
        return balances;
    }
}
{'fraction_non_alphanumeric': 0.10301668806161746, 'fraction_numerical': 0.005134788189987163, 'mean_word_length': 3.825077399380805, 'pattern_counts': {'":': 0, '<': 16, '<?xml version=': 0, '>': 16, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '5830629', 'n_tokens_mistral': 892, 'n_tokens_neox': 875, 'n_words': 247}