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;
}
Aggregations