private void doExchangeBasket() throws InterruptedException {

        int memberCount = otapiJNI.OTAPI_Basic_Basket_GetMemberCount(assetID);
        boolean bSure = true;
         if (otapiJNI.OTAPI_Basic_GetNym_TransactionNumCount(serverID, nymID) < (2+memberCount)) {
            bSure = Helpers.getTransactionNumbers(serverID, nymID);
        }

        if (!bSure || otapiJNI.OTAPI_Basic_GetNym_TransactionNumCount(serverID, nymID) < (2+memberCount)) {
            System.out.println("IN doExchangeBasket , failed to get transaction numbers, OT_API_GetNym_TransactionNumCount:" + otapiJNI.OTAPI_Basic_GetNym_TransactionNumCount(serverID, nymID));
            return;
        }

        OpenTransactionAccount otAccount = new OpenTransactionAccount();
        String exchangeRequest = otAccount.getExchangeBasketRequest(serverID, nymID, assetID, accountID, Integer.parseInt(jTextField1.getText()));

        
        for (int i = 0; i < memberCount; i++) {
            String memberAssetID = otapiJNI.OTAPI_Basic_Basket_GetMemberType(assetID, i);

            System.out.println("In doExchangeBasket,memberAssetID:" + memberAssetID + " assetID:" + assetID + " nymID:" + nymID + " serverID:" + serverID);

            new ExchangeBasketAcctDialog(null, true, memberAssetID, serverID, nymID).setVisible(true);
            if (Helpers.isBasketXCancelled()) {
                Helpers.setBasketXCancelled(false);
                JOptionPane.showMessageDialog(null, "The basket exchange has been cancelled", "Basket Exchange Canellation", JOptionPane.INFORMATION_MESSAGE);
                return;
            }
            String memberAccountID = Helpers.getBasketXAcct();
            exchangeRequest = otapiJNI.OTAPI_Basic_AddBasketExchangeItem(serverID, nymID, exchangeRequest, memberAssetID, memberAccountID);

        }
        String xchangeType = inXchange == true ? "IN" : "OUT";
        if (!otAccount.exchangeBasket(assetID, serverID, nymID, exchangeRequest, inXchange, memberCount, accountID)) {
            JOptionPane.showMessageDialog(null, "Exchange basket failed", "Server Error", JOptionPane.ERROR_MESSAGE);
        } else {
            JOptionPane.showMessageDialog(null, xchangeType + " Exchange of basket currency done successfully", "Basket Exchange Success", JOptionPane.INFORMATION_MESSAGE);
        }

    }