Search in sources :

Example 6 with CashPurseDetails

use of com.moneychanger.core.dataobjects.CashPurseDetails in project otapij by FellowTraveler.

the class CashPurseAccount method getCashPurseDetails.

public CashPurseDetails getCashPurseDetails(String cashPurseID) {
    Map gridData = new HashMap();
    String[] key = cashPurseID.split(":");
    String serverID = key[0];
    String assetID = key[1];
    String nymID = key[2];
    String cashPurse = otapiJNI.OTAPI_Basic_LoadPurse(serverID, assetID, nymID);
    if (!Utility.VerifyStringVal(cashPurse)) {
        System.out.println("Purse is null");
        return null;
    }
    gridData = getGridData(serverID, assetID, nymID, cashPurse);
    CashPurseDetails cashDetails = new CashPurseDetails();
    cashDetails.setPurseGrid(gridData);
    cashDetails.setBalance(otapiJNI.OTAPI_Basic_Purse_GetTotalValue(serverID, assetID, cashPurse));
    cashDetails.setServerID(serverID);
    cashDetails.setAssetID(assetID);
    cashDetails.setNymID(nymID);
    cashDetails.setPurse(cashPurse);
    cashDetails.setServeName(otapiJNI.OTAPI_Basic_GetServer_Name(serverID));
    cashDetails.setAssetType(otapiJNI.OTAPI_Basic_GetAssetType_Name(assetID));
    if (!Utility.VerifyStringVal(nymID)) {
        cashDetails.setNymName("");
    } else {
        cashDetails.setNymName(otapiJNI.OTAPI_Basic_GetNym_Name(nymID));
    }
    return cashDetails;
}
Also used : HashMap(java.util.HashMap) CashPurseDetails(com.moneychanger.core.dataobjects.CashPurseDetails) Map(java.util.Map) HashMap(java.util.HashMap)

Aggregations

CashPurseDetails (com.moneychanger.core.dataobjects.CashPurseDetails)6 CashPurseAccount (com.moneychanger.core.CashPurseAccount)4 Account (com.moneychanger.core.Account)1 Contract (com.moneychanger.core.Contract)1 NYM (com.moneychanger.core.NYM)1 OpenTransactionAccount (com.moneychanger.core.OpenTransactionAccount)1 RippleAccount (com.moneychanger.core.RippleAccount)1 OTDetails (com.moneychanger.core.dataobjects.OTDetails)1 ComboObject (com.moneychanger.core.util.ComboObject)1 CashPurseExportDetails (com.moneychanger.ui.dialogs.CashPurseExportDetails)1 AWTException (java.awt.AWTException)1 CardLayout (java.awt.CardLayout)1 Point (java.awt.Point)1 ArrayList (java.util.ArrayList)1 HashMap (java.util.HashMap)1 Map (java.util.Map)1 JPanel (javax.swing.JPanel)1 ListSelectionEvent (javax.swing.event.ListSelectionEvent)1 ListSelectionListener (javax.swing.event.ListSelectionListener)1