616 class __OTclient_RAII
623 OTAPI_Wrap::AppInit();
629 OTAPI_Wrap::AppCleanup();
638 __OTclient_RAII the_client_cleanup;
641 if (
nullptr == OTAPI_Wrap::OTAPI())
644 OTString strConfigPath(OTPaths::AppDataFolder());
645 bool bConfigPathFound =
646 strConfigPath.Exists() && 3 < strConfigPath.GetLength();
649 "RegisterAPIWithScript: Must set Config Path first!\n");
651 otWarn <<
"Using configuration path: " << strConfigPath <<
"\n";
662 AnyOption* opt =
new AnyOption();
664 std::unique_ptr<AnyOption> theOptionAngel(opt);
673 std::string str_ServerID;
675 std::string str_MyAcct;
676 std::string str_MyNym;
677 std::string str_MyPurse;
679 std::string str_HisAcct;
680 std::string str_HisNym;
681 std::string str_HisPurse;
684 str_MyPurse, str_HisAcct, str_HisNym,
689 std::string str_Args;
691 if (opt->getValue(
"args") !=
nullptr)
692 cerr <<
"User-defined arguments aka: --args "
693 << (str_Args = opt->getValue(
"args")) << endl;
697 if (opt->getFlag(
"help") || opt->getFlag(
'h') || opt->getFlag(
'?')) {
703 bool bIsCommandProvided =
false;
707 if (opt->hasOptions()) {
711 if (opt->getValue(
'w') !=
nullptr ||
712 opt->getValue(
"withdraw") !=
nullptr) {
713 bIsCommandProvided =
true;
714 cerr <<
"withdraw amount = " << opt->getValue(
'w') << endl;
716 else if (opt->getValue(
't') !=
nullptr ||
717 opt->getValue(
"transfer") !=
nullptr) {
718 bIsCommandProvided =
true;
719 cerr <<
"transfer amount = " << opt->getValue(
't') << endl;
721 else if (opt->getValue(
'c') !=
nullptr ||
722 opt->getValue(
"cheque") !=
nullptr) {
723 bIsCommandProvided =
true;
724 cerr <<
"cheque amount = " << opt->getValue(
'c') << endl;
726 else if (opt->getFlag(
"marketoffer") ==
true) {
727 bIsCommandProvided =
true;
728 cerr <<
"marketoffer flag set " << endl;
730 else if (opt->getValue(
'v') !=
nullptr ||
731 opt->getValue(
"voucher") !=
nullptr) {
732 bIsCommandProvided =
true;
733 cerr <<
"voucher amount = " << opt->getValue(
'v') << endl;
735 else if (opt->getFlag(
"depositcheque")) {
736 bIsCommandProvided =
true;
737 cerr <<
"deposit cheque flag set " << endl;
739 else if (opt->getFlag(
"depositpurse")) {
740 bIsCommandProvided =
true;
741 cerr <<
"deposit purse flag set " << endl;
743 else if (opt->getFlag(
"deposittokens")) {
744 bIsCommandProvided =
true;
745 cerr <<
"deposit tokens flag set " << endl;
747 else if (opt->getFlag(
"proposepaymentplan")) {
748 bIsCommandProvided =
true;
749 cerr <<
"proposepaymentplan flag set " << endl;
751 else if (opt->getFlag(
"confirmpaymentplan")) {
752 bIsCommandProvided =
true;
753 cerr <<
"confirm payment plan flag set " << endl;
755 else if (opt->getFlag(
"activatepaymentplan")) {
756 bIsCommandProvided =
true;
757 cerr <<
"activate payment plan flag set " << endl;
759 else if (opt->getFlag(
'b') || opt->getFlag(
"balance")) {
760 bIsCommandProvided =
true;
761 cerr <<
"balance flag set " << endl;
763 else if (opt->getFlag(
'i') || opt->getFlag(
"inbox")) {
764 bIsCommandProvided =
true;
765 cerr <<
"inbox flag set " << endl;
767 else if (opt->getFlag(
'p') || opt->getFlag(
"purse")) {
768 bIsCommandProvided =
true;
769 cerr <<
"purse flag set " << endl;
771 else if (opt->getFlag(
's') || opt->getFlag(
"sign")) {
772 bIsCommandProvided =
true;
773 cerr <<
"sign flag set " << endl;
775 else if (opt->getFlag(
"verify")) {
776 bIsCommandProvided =
true;
777 cerr <<
"verify flag set " << endl;
779 else if (opt->getFlag(
"stat")) {
780 bIsCommandProvided =
true;
781 cerr <<
"stat flag set " << endl;
783 else if (opt->getFlag(
"prompt")) {
784 bIsCommandProvided =
true;
785 cerr <<
"prompt flag set " << endl;
787 else if (opt->getValue(
"script") !=
nullptr) {
788 bIsCommandProvided =
true;
789 cerr <<
"script filename: " << opt->getValue(
"script") << endl;
791 else if (opt->getFlag(
'r') || opt->getFlag(
"refresh")) {
792 bIsCommandProvided =
true;
793 cerr <<
"refresh flag set " << endl;
795 else if (opt->getFlag(
"refreshnym")) {
796 bIsCommandProvided =
true;
797 cerr <<
"refreshnym flag set " << endl;
803 bIsCommandProvided =
false;
806 if (!(opt->getArgc() > 0) && (
false == bIsCommandProvided))
812 otOut <<
"\n\nYou probably don't want to do this... Use CTRL-C, "
813 "and try \"ot --help\" for instructions.\n\n "
814 "==> Expecting ot script from standard input. (Terminate "
818 std::cin >> std::noskipws;
821 std::istream_iterator<char> it(std::cin);
822 std::istream_iterator<char> end;
823 std::string results(it, end);
844 bool bMainPointersSetupSuccessful =
846 str_ServerID, str_MyNym, pMyNym, pWallet, pServerContract);
849 bMainPointersSetupSuccessful,
850 "main: SetupPointersForWalletMyNymAndServerContract failed "
864 if (
nullptr == pServerContract) {
865 otOut <<
"Unable to find a server contract to use. Please use "
866 "the option: --server SERVER_ID\n"
867 "(Where SERVER_ID is the Server's ID. Partial matches "
875 if (
nullptr != pServerContract) {
904 if (str_MyAcct.size() > 0) {
907 pMyAccount = pWallet->
GetAccount(MY_ACCOUNT_ID);
910 if (
nullptr == pMyAccount)
913 if (
nullptr != pMyAccount) {
915 pMyAccount->GetPurportedAccountID().GetString(strTemp);
917 str_MyAcct = strTemp.
Get();
918 otOut <<
"Using as myacct: " << str_MyAcct <<
"\n";
923 otOut <<
"Aborting: Unable to find specified myacct: "
924 << str_MyAcct <<
"\n";
935 if (str_HisAcct.size() > 0) {
938 pHisAccount = pWallet->
GetAccount(HIS_ACCOUNT_ID);
941 if (
nullptr == pHisAccount)
943 if (
nullptr != pHisAccount) {
945 pHisAccount->GetPurportedAccountID().GetString(strTemp);
947 str_HisAcct = strTemp.
Get();
948 otOut <<
"Using as hisacct: " << str_HisAcct <<
"\n";
983 otOut <<
"Unable to find My Nym. Please use the option: --mynym "
985 "(Where USER_ID is the Nym's ID. Partial matches and "
996 if (str_HisNym.size() > 0) {
1001 if (
nullptr == pHisNym)
1003 if (
nullptr != pHisNym) {
1005 pHisNym->GetIdentifier(strTemp);
1007 str_HisNym = strTemp.
Get();
1008 otOut <<
"Using as hisnym: " << str_HisNym <<
"\n";
1025 if (str_MyPurse.size() > 0) {
1026 const OTIdentifier MY_ASSET_TYPE_ID(str_MyPurse.c_str());
1030 if (
nullptr == pMyAssetContract)
1034 if (
nullptr != pMyAssetContract) {
1036 pMyAssetContract->GetIdentifier(strTemp);
1038 str_MyPurse = strTemp.
Get();
1039 otOut <<
"Using as mypurse: " << str_MyPurse <<
"\n";
1041 pMyAssetContract->GetIdentifier(thePurseAssetTypeID);
1050 else if (
nullptr != pMyAccount)
1051 thePurseAssetTypeID = pMyAccount->GetAssetTypeID();
1052 if (!thePurseAssetTypeID.
IsEmpty()) {
1053 OTString strTempAssetType(thePurseAssetTypeID);
1054 str_MyPurse = strTempAssetType.Get();
1064 if (str_HisPurse.size() > 0) {
1065 const OTIdentifier HIS_ASSET_TYPE_ID(str_HisPurse.c_str());
1070 if (
nullptr == pHisAssetContract)
1074 if (
nullptr != pHisAssetContract) {
1076 pHisAssetContract->GetIdentifier(strTemp);
1078 str_HisPurse = strTemp.
Get();
1079 otOut <<
"Using as hispurse: " << str_HisPurse <<
"\n";
1081 pHisAssetContract->GetIdentifier(hisPurseAssetTypeID);
1086 else if (
nullptr != pHisAccount)
1087 hisPurseAssetTypeID = pHisAccount->GetAssetTypeID();
1088 if (!hisPurseAssetTypeID.
IsEmpty()) {
1089 OTString strTempAssetType(hisPurseAssetTypeID);
1090 str_HisPurse = strTempAssetType.Get();
1108 bool bSendCommand =
false;
1128 if ((
nullptr != pServerContract) && (
nullptr != pMyNym))
1129 OTAPI_Wrap::OTAPI()->GetClient()->SetFocusToServerAndNym(
1130 *pServerContract, *pMyNym,
1131 OTAPI_Wrap::OTAPI()->GetTransportCallback());
1151 if ((opt->getValue(
"script") !=
nullptr) || (opt->getArgc() > 0)) {
1152 OTAPI_Wrap::OTAPI()->GetClient()->SetRunningAsScript();
1165 std::string strFilename;
1171 if (opt->getArgc() > 0) {
1172 strFilename = opt->getArgv(0);
1186 if (
nullptr != opt->getValue(
"script")) {
1187 strFilename = opt->getValue(
"script");
1190 std::ifstream t(strFilename.c_str(),
1191 std::ios::in | std::ios::binary);
1192 std::stringstream buffer;
1193 buffer << t.rdbuf();
1194 std::string results = buffer.str();
1197 std::unique_ptr<OTVariable> angelArgs;
1199 std::unique_ptr<OTVariable> angelMyNymVar;
1200 std::unique_ptr<OTVariable> angelHisNymVar;
1201 std::unique_ptr<OTVariable> angelServer;
1202 std::unique_ptr<OTVariable> angelMyAcct;
1203 std::unique_ptr<OTVariable> angelHisAcct;
1204 std::unique_ptr<OTVariable> angelMyPurse;
1205 std::unique_ptr<OTVariable> angelHisPurse;
1207 if ((str_Args.size() > 0) || (opt->getArgc() > 1)) {
1208 const std::string str_var_name(
"Args");
1209 std::string str_var_value, str_command;
1211 if (str_Args.size() > 0) str_var_value += str_Args;
1213 if (opt->getArgc() > 1) {
1214 if (str_Args.size() > 0) str_var_value +=
" ";
1216 str_command = opt->getArgv(1);
1217 str_var_value +=
"ot_cli_command ";
1218 str_var_value += str_command;
1221 otWarn <<
"Adding user-defined command line arguments as '"
1222 << str_var_name <<
"' "
1223 "containing value: " << str_var_value
1230 OTVariable::Var_Constant);
1233 angelArgs.reset(pVar);
1238 otInfo <<
"Args variable (optional user-defined "
1239 "arguments) isn't set...\n";
1242 if (str_ServerID.size() > 0) {
1243 const std::string str_var_name(
"Server");
1244 const std::string str_var_value(str_ServerID);
1246 otWarn <<
"Adding constant with name " << str_var_name
1247 <<
" and value: " << str_var_value <<
" ...\n";
1252 OTVariable::Var_Constant);
1254 angelServer.reset(pVar);
1259 otInfo <<
"Server variable isn't set...\n";
1262 if (
nullptr != pMyNym) {
1263 const std::string str_party_name(
"MyNym");
1265 otWarn <<
"Adding constant with name " << str_party_name
1266 <<
" and value: " << str_MyNym <<
" ...\n";
1271 OTVariable::Var_Constant);
1273 angelMyNymVar.reset(pVar);
1278 otInfo <<
"MyNym variable isn't set...\n";
1281 if ((
nullptr != pHisNym) || (str_HisNym.size() > 0))
1287 const std::string str_party_name(
"HisNym");
1289 otWarn <<
"Adding constant with name " << str_party_name
1290 <<
" and value: " << str_HisNym <<
" ...\n";
1295 OTVariable::Var_Constant);
1297 angelHisNymVar.reset(pVar);
1302 otInfo <<
"HisNym variable isn't set...\n";
1344 if (str_MyAcct.size() > 0) {
1345 const std::string str_var_name(
"MyAcct");
1346 const std::string str_var_value(str_MyAcct);
1348 otWarn <<
"Adding variable with name " << str_var_name
1349 <<
" and value: " << str_var_value <<
" ...\n";
1354 OTVariable::Var_Constant);
1356 angelMyAcct.reset(pVar);
1361 otInfo <<
"MyAcct variable isn't set...\n";
1364 if (str_MyPurse.size() > 0) {
1365 const std::string str_var_name(
"MyPurse");
1366 const std::string str_var_value(str_MyPurse);
1368 otWarn <<
"Adding variable with name " << str_var_name
1369 <<
" and value: " << str_var_value <<
" ...\n";
1374 OTVariable::Var_Constant);
1376 angelMyPurse.reset(pVar);
1381 otInfo <<
"MyPurse variable isn't set...\n";
1384 if (str_HisAcct.size() > 0) {
1385 const std::string str_var_name(
"HisAcct");
1386 const std::string str_var_value(str_HisAcct);
1388 otWarn <<
"Adding variable with name " << str_var_name
1389 <<
" and value: " << str_var_value <<
" ...\n";
1394 OTVariable::Var_Constant);
1396 angelHisAcct.reset(pVar);
1401 otInfo <<
"HisAcct variable isn't set...\n";
1404 if (str_HisPurse.size() > 0) {
1405 const std::string str_var_name(
"HisPurse");
1406 const std::string str_var_value(str_HisPurse);
1408 otWarn <<
"Adding variable with name " << str_var_name
1409 <<
" and value: " << str_var_value <<
" ...\n";
1414 OTVariable::Var_Constant);
1416 angelHisPurse.reset(pVar);
1421 otInfo <<
"MyPurse variable isn't set...\n";
1426 otWarn <<
"Script output:\n\n";
1432 if ((
nullptr == pServerContract) || (
nullptr == pMyNym)) {
1433 otErr <<
"Unexpected nullptr: "
1434 << ((
nullptr == pServerContract) ?
"pServerContract" :
"")
1435 <<
" " << ((
nullptr == pMyNym) ?
"pMyNym" :
"") <<
"\n";
1437 else if (opt->getValue(
'w') !=
nullptr ||
1438 opt->getValue(
"withdraw") !=
nullptr) {
1439 const int64_t lAmount = atol(opt->getValue(
'w'));
1441 otOut <<
"(User has instructed to withdraw cash...)\n";
1445 if (0 < OTAPI_Wrap::OTAPI()->GetClient()->ProcessUserCommand(
1446 OTClient::notarizeWithdrawal, theMessage, *pMyNym,
1447 *pServerContract, pMyAccount, lAmount)) {
1448 bSendCommand =
true;
1452 <<
"Error processing withdraw command in ProcessMessage.\n";
1454 else if (opt->getValue(
't') !=
nullptr ||
1455 opt->getValue(
"transfer") !=
nullptr) {
1456 const int64_t lAmount = atol(opt->getValue(
't'));
1459 (str_HisAcct.size() > 0) ? str_HisAcct.c_str() :
"aaaaaaaa");
1461 otOut <<
"User has instructed to send a Transfer command "
1462 "(Notarize Transactions)...\n";
1466 if (0 < OTAPI_Wrap::OTAPI()->GetClient()->ProcessUserCommand(
1467 OTClient::notarizeTransfer, theMessage, *pMyNym,
1468 *pServerContract, pMyAccount, lAmount,
1471 (str_HisAcct.size() > 0) ? &HIS_ACCT_ID
1474 bSendCommand =
true;
1477 otErr <<
"Error processing notarizeTransactions (transfer) "
1479 "in ProcessMessage.\n";
1481 else if (opt->getValue(
'c') !=
nullptr ||
1482 opt->getValue(
"cheque") !=
nullptr) {
1483 otOut <<
"(User has instructed to write a cheque...)\n";
1485 const int64_t lAmount = atol(opt->getValue(
'c'));
1488 ? str_HisNym.c_str()
1491 OTAPI_Wrap::OTAPI()->GetClient()->ProcessUserCommand(
1492 OTClient::writeCheque, theMessage, *pMyNym, *pServerContract,
1493 pMyAccount, lAmount,
nullptr,
1494 (str_HisNym.size() > 0) ? &HIS_NYM_ID :
nullptr);
1496 else if (opt->getValue(
'v') !=
nullptr ||
1497 opt->getValue(
"voucher") !=
nullptr) {
1498 otOut <<
"(User has instructed to withdraw a voucher...)\n";
1500 const int64_t lAmount = atol(opt->getValue(
'v'));
1502 OTIdentifier HIS_NYM_ID((str_HisNym.size() > 0) ? str_HisNym.c_str()
1505 if (0 < OTAPI_Wrap::OTAPI()->GetClient()->ProcessUserCommand(
1506 OTClient::withdrawVoucher, theMessage, *pMyNym,
1507 *pServerContract, pMyAccount, lAmount,
1509 (str_HisNym.size() > 0) ? &HIS_NYM_ID :
nullptr)) {
1510 bSendCommand =
true;
1513 otErr <<
"Error processing withdraw voucher command in "
1514 "ProcessMessage.\n";
1519 else if (opt->getValue(
"marketoffer") !=
nullptr) {
1520 otOut <<
"(User has instructed to send a marketOffer command to "
1525 if (0 < OTAPI_Wrap::OTAPI()->GetClient()->ProcessUserCommand(
1526 OTClient::marketOffer, theMessage, *pMyNym,
1531 bSendCommand =
true;
1534 otErr <<
"Error processing marketOffer command in "
1535 "ProcessMessage.\n";
1550 else if (opt->getFlag(
"proposepaymentplan")) {
1551 otOut <<
"(User has instructed to propose a payment plan...)\n";
1553 OTIdentifier HIS_NYM_ID((str_HisNym.size() > 0) ? str_HisNym.c_str()
1556 (str_HisAcct.size() > 0) ? str_HisAcct.c_str() :
"aaaaaaaa");
1558 OTAPI_Wrap::OTAPI()->GetClient()->ProcessUserCommand(
1559 OTClient::proposePaymentPlan, theMessage, *pMyNym,
1560 *pServerContract, pMyAccount, 0, pMyAssetContract,
1561 (str_HisNym.size() > 0) ? &HIS_NYM_ID :
nullptr,
1562 (str_HisAcct.size() > 0) ? &HIS_ACCT_ID :
nullptr);
1564 else if (opt->getFlag(
"confirmpaymentplan")) {
1565 otOut <<
"(User has instructed to confirm a payment plan...)\n";
1567 OTAPI_Wrap::OTAPI()->GetClient()->ProcessUserCommand(
1568 OTClient::confirmPaymentPlan, theMessage, *pMyNym,
1572 else if (opt->getFlag(
"activatepaymentplan")) {
1573 otOut <<
"(User has instructed to activate a payment plan...)\n";
1575 if (0 < OTAPI_Wrap::OTAPI()->GetClient()->ProcessUserCommand(
1576 OTClient::paymentPlan, theMessage, *pMyNym,
1577 *pServerContract, pMyAccount))
1581 bSendCommand =
true;
1584 otErr <<
"Error processing activate payment plan command in "
1585 "ProcessMessage.\n";
1587 else if (opt->getFlag(
"depositcheque")) {
1588 otOut <<
"(User has instructed to deposit a cheque...)\n";
1592 if (0 < OTAPI_Wrap::OTAPI()->GetClient()->ProcessUserCommand(
1593 OTClient::notarizeCheque, theMessage, *pMyNym,
1594 *pServerContract, pMyAccount)) {
1595 bSendCommand =
true;
1598 otErr <<
"Error processing deposit cheque command in "
1599 "ProcessMessage.\n";
1601 else if (opt->getFlag(
"depositpurse")) {
1602 otOut <<
"(User has instructed to deposit a cash purse...)\n";
1606 if (0 < OTAPI_Wrap::OTAPI()->GetClient()->ProcessUserCommand(
1607 OTClient::notarizePurse, theMessage, *pMyNym,
1608 *pServerContract, pMyAccount, 0,
1609 pMyAssetContract)) {
1610 bSendCommand =
true;
1613 otErr <<
"Error processing deposit purse command in "
1614 "ProcessMessage.\n";
1616 else if (opt->getFlag(
"deposittokens")) {
1617 otOut <<
"(User has instructed to deposit individual cash "
1622 if (0 < OTAPI_Wrap::OTAPI()->GetClient()->ProcessUserCommand(
1623 OTClient::notarizeDeposit, theMessage, *pMyNym,
1624 *pServerContract, pMyAccount)) {
1625 bSendCommand =
true;
1628 otErr <<
"Error processing deposit cash tokens command in "
1629 "ProcessMessage.\n";
1631 else if (opt->getFlag(
'i') || opt->getFlag(
"inbox")) {
1632 cerr <<
"DISPLAY INBOX CONTENTS HERE... (When I code this. What "
1634 "say? Use the GUI.)" << endl;
1636 else if (opt->getFlag(
's') || opt->getFlag(
"sign")) {
1637 otOut <<
"(User has instructed to sign a contract...)\n";
1639 OTAPI_Wrap::OTAPI()->GetClient()->ProcessUserCommand(
1640 OTClient::signContract, theMessage, *pMyNym, *pServerContract,
1643 else if (opt->getFlag(
'p') || opt->getFlag(
"purse")) {
1644 cerr <<
"User wants to display purse contents (not coded yet here.)"
1647 else if (opt->getFlag(
"verify")) {
1648 cerr <<
"User wants to verify a signature on a contract (not coded "
1652 else if (opt->getFlag(
"stat")) {
1653 otOut <<
"User has instructed to display wallet contents...\n";
1657 otOut << strStat <<
"\n";
1659 else if (opt->getFlag(
"prompt")) {
1660 otOut <<
"User has instructed to enter the OT prompt...\n";
1662 else if (opt->getFlag(
'b') || opt->getFlag(
"balance")) {
1663 otOut <<
"\n ACCT BALANCE (server-side): "
1664 << pMyAccount->GetBalance() <<
"\n\n";
1667 theServerID, thePurseAssetTypeID, MY_NYM_ID);
1668 std::unique_ptr<Purse> thePurseAngel(pPurse);
1669 if (
nullptr != pPurse)
1670 otOut <<
" CASH PURSE (client-side): "
1673 else if (opt->getFlag(
'r') || opt->getFlag(
"refresh")) {
1674 otOut <<
"(User has instructed to download intermediary files "
1675 "for an asset account...)\n";
1679 if (0 < OTAPI_Wrap::OTAPI()->GetClient()->ProcessUserCommand(
1680 OTClient::getAccount, theMessage, *pMyNym,
1681 *pServerContract, pMyAccount)) {
1682 bSendCommand =
true;
1685 otErr <<
"Error processing getAccount command in "
1686 "ProcessMessage.\n";
1688 else if (opt->getFlag(
"refreshnym")) {
1689 otOut <<
"(User has instructed to download intermediary files "
1694 if (0 < OTAPI_Wrap::OTAPI()->GetClient()->ProcessUserCommand(
1695 OTClient::getNymbox, theMessage, *pMyNym,
1696 *pServerContract,
nullptr)) {
1697 bSendCommand =
true;
1700 otErr <<
"Error processing getNymbox command in "
1701 "ProcessMessage.\n";
1707 if ((
nullptr == pServerNym) ||
1709 otOut <<
"The server Nym was nullptr or failed to verify on server "
1710 "contract: " << strServerID <<
"\n";
1716 OTString strEnvelopeContents(theMessage);
1719 theEnvelope.
Seal(*pServerNym, strEnvelopeContents);
1721 OTAPI_Wrap::OTAPI()->GetTransportCallback()->operator()(
1722 *pServerContract, theEnvelope);
1726 if (!opt->getFlag(
"prompt"))
1734 otOut <<
"\nLOOKING FOR INSTRUCTIONS for the OT COMMAND LINE?\n"
1736 "Followed by: ot -?\n"
1740 "(NOW ENTERING OT PROMPT) \n"
1741 "See docs/CLIENT-COMMANDS.txt\n\n";
1775 if ((str_ServerID.size() > 0) || (str_MyNym.size() > 0)) {
1778 str_ServerID, str_MyNym, pMyNym, pWallet, pServerContract)) {
1783 otOut <<
"\nYou may wish to 'load' then 'stat'.\n"
1784 "(FYI, --server SERVER_ID and --mynym NYM_ID were both "
1786 "Also, see: ~/.ot/command-line-ot.opt for defaults.\n";
1797 otLog4 <<
"Starting client loop.\n";
1808 otOut <<
"\nOT -- WARNING: This prompt is too low-level for you.\nType "
1809 "'quit', and then try 'opentxs help' and 'opentxs "
1813 fgets(buf, 190, stdin))
1817 otOut <<
".\n..\n...\n....\n.....\n......\n.......\n........\n........."
1818 "\n..........\n...........\n............\n.............\n";
1821 std::string strLine = buf;
1824 if (strLine.compare(0, 4,
"load") == 0) {
1825 otOut <<
"User has instructed to load wallet.xml...\n";
1828 str_ServerID, str_MyNym, pMyNym, pWallet,
1835 else if (
'\0' == buf[0]) {
1838 else if (strLine.compare(0, 4,
"test") == 0) {
1839 std::string strScript =
"print(\"Hello, world\")";
1875 else if (strLine.compare(0, 8,
"clearreq") ==
1878 if (
nullptr == pMyNym) {
1879 otOut <<
"No Nym yet available. Try 'load'.\n";
1886 otOut <<
"You are trying to mess around with your (clear your) "
1887 "request numbers.\n"
1888 "Enter the relevant server ID [" << strServerID <<
"]: ";
1892 const OTString strReqNumServerID((str_ServerID.size() > 0)
1893 ? str_ServerID.c_str()
1894 : strServerID.Get());
1900 otOut <<
"Successfully removed request number for server "
1901 << strReqNumServerID <<
". Saving nym...\n";
1904 else if (strLine.compare(0, 5,
"clear") == 0) {
1905 if (
nullptr == pMyNym) {
1906 otOut <<
"No Nym yet available. Try 'load'.\n";
1913 otOut <<
"You are trying to mess around with your (clear your) "
1914 "transaction numbers.\n"
1915 "Enter the relevant server ID [" << strServerID <<
"]: ";
1919 const OTString strTransNumServerID((str_ServerID.size() > 0)
1920 ? str_ServerID.c_str()
1921 : strServerID.Get());
1927 otOut <<
"Successfully removed all issued and transaction "
1928 "numbers for server " << strTransNumServerID
1929 <<
". Saving nym...\n";
1932 else if (strLine.compare(0, 7,
"decrypt") == 0) {
1933 if (
nullptr == pMyNym) {
1934 otOut <<
"No Nym yet available to decrypt with.\n";
1938 otOut <<
"Enter text to be decrypted:\n> ";
1941 char decode_buffer[200];
1944 decode_buffer[0] = 0;
1946 fgets(decode_buffer,
sizeof(decode_buffer) - 1, stdin)) {
1947 theArmoredText.
Concatenate(
"%s\n", decode_buffer);
1953 }
while (strlen(decode_buffer) > 1);
1958 theEnvelope.
Open(*pMyNym, strDecodedText);
1960 otOut <<
"\n\nDECRYPTED TEXT:\n\n" << strDecodedText <<
"\n\n";
1964 else if (strLine.compare(0, 6,
"decode") == 0) {
1965 otOut <<
"Enter text to be decoded:\n> ";
1968 char decode_buffer[200];
1971 decode_buffer[0] = 0;
1973 fgets(decode_buffer,
sizeof(decode_buffer) - 1, stdin)) {
1974 theArmoredText.
Concatenate(
"%s\n", decode_buffer);
1981 }
while (strlen(decode_buffer) > 1);
1983 OTString strDecodedText(theArmoredText);
1985 otOut <<
"\n\nDECODED TEXT:\n\n" << strDecodedText <<
"\n\n";
1989 else if (strLine.compare(0, 6,
"encode") == 0) {
1990 otOut <<
"Enter text to be ascii-encoded (terminate with ~ on a "
1994 char decode_buffer[200];
1997 decode_buffer[0] = 0;
2000 fgets(decode_buffer,
sizeof(decode_buffer) - 1, stdin)) &&
2001 (decode_buffer[0] !=
'~')) {
2009 }
while (decode_buffer[0] !=
'~');
2013 otOut <<
"\n\nENCODED TEXT:\n\n" << theArmoredText <<
"\n\n";
2017 else if (strLine.compare(0, 4,
"hash") == 0) {
2018 otOut <<
"Enter text to be hashed (terminate with ~ on a "
2022 char decode_buffer[200];
2025 decode_buffer[0] = 0;
2028 fgets(decode_buffer,
sizeof(decode_buffer) - 1, stdin)) &&
2029 (decode_buffer[0] !=
'~')) {
2030 strDecodedText.
Concatenate(
"%s\n", decode_buffer);
2037 }
while (decode_buffer[0] !=
'~');
2039 std::string str_Trim(strDecodedText.
Get());
2040 std::string str_Trim2 = OTString::trim(str_Trim);
2041 strDecodedText.
Set(str_Trim2.c_str());
2048 otOut <<
"\n\nMESSAGE DIGEST:\n\n" << strHash <<
"\n\n";
2052 else if (strLine.compare(0, 4,
"stat") == 0) {
2053 otOut <<
"User has instructed to display wallet contents...\n";
2058 otOut << strStat <<
"\n";
2061 otOut <<
"No wallet is loaded...\n";
2065 else if (strLine.compare(0, 4,
"help") == 0) {
2066 otOut <<
"User has instructed to display the help file...\nPlease "
2067 "see this file: docs/CLIENT_COMMANDS.txt\n";
2071 else if (strLine.compare(0, 4,
"quit") == 0) {
2072 otOut <<
"User has instructed to exit the wallet...\n";
2098 if (
nullptr == pServerContract) {
2099 otOut <<
"Unable to find a server contract. Please restart using "
2100 "the option: --server SERVER_ID\n"
2101 "(Where SERVER_ID is the server ID. Partial matches ARE "
2130 <<
"Unable to find My Nym. Please restart and use the option:\n"
2131 " --mynym USER_ID\n"
2132 "(Where USER_ID is the Nym's ID. Partial matches ARE "
2137 bool bSendCommand =
false;
2157 OTAPI_Wrap::OTAPI()->GetClient()->SetFocusToServerAndNym(
2158 *pServerContract, *pMyNym,
2159 OTAPI_Wrap::OTAPI()->GetTransportCallback());
2168 if (buf[0] ==
'c') {
2169 otOut <<
"(User has instructed to send a checkServerID command "
2170 "to the server...)\n";
2174 if (0 < OTAPI_Wrap::OTAPI()->GetClient()->ProcessUserCommand(
2175 OTClient::checkServerID, theMessage, *pMyNym,
2179 bSendCommand =
true;
2182 otErr <<
"Error processing checkServerID command in "
2183 "ProcessMessage: " << buf[0] <<
"\n";
2188 else if (buf[0] ==
'r') {
2189 otOut <<
"(User has instructed to send a createUserAccount "
2190 "command to the server...)\n";
2194 if (0 < OTAPI_Wrap::OTAPI()->GetClient()->ProcessUserCommand(
2195 OTClient::createUserAccount, theMessage, *pMyNym,
2199 bSendCommand =
true;
2202 otErr <<
"Error processing createUserAccount command in "
2203 "ProcessMessage: " << buf[0] <<
"\n";
2212 else if (buf[0] ==
'u') {
2213 otOut <<
"(User has instructed to send a checkUser command to "
2218 if (0 < OTAPI_Wrap::OTAPI()->GetClient()->ProcessUserCommand(
2219 OTClient::checkUser, theMessage, *pMyNym,
2223 bSendCommand =
true;
2226 otErr <<
"Error processing checkUser command in "
2227 "ProcessMessage: " << buf[0] <<
"\n";
2232 else if (buf[0] ==
'a') {
2233 otOut <<
"(User has instructed to send a createAccount command "
2234 "to the server...)\n";
2238 if (0 < OTAPI_Wrap::OTAPI()->GetClient()->ProcessUserCommand(
2239 OTClient::createAccount, theMessage, *pMyNym,
2243 bSendCommand =
true;
2246 otErr <<
"Error processing createAccount command in "
2247 "ProcessMessage: " << buf[0] <<
"\n";
2252 else if (!strcmp(buf,
"issue\n")) {
2253 otOut <<
"(User has instructed to send an issueAssetType command "
2254 "to the server...)\n";
2258 if (0 < OTAPI_Wrap::OTAPI()->GetClient()->ProcessUserCommand(
2259 OTClient::issueAssetType, theMessage, *pMyNym,
2263 bSendCommand =
true;
2266 otErr <<
"Error processing issueAssetType command in "
2267 "ProcessMessage: " << buf <<
"\n";
2272 else if (!strcmp(buf,
"basket\n")) {
2273 otOut <<
"(User has instructed to send an issueBasket command to "
2278 if (0 < OTAPI_Wrap::OTAPI()->GetClient()->ProcessUserCommand(
2279 OTClient::issueBasket, theMessage, *pMyNym,
2283 bSendCommand =
true;
2286 otErr <<
"Error processing issueBasket command in "
2287 "ProcessMessage: " << buf <<
"\n";
2292 else if (!strcmp(buf,
"exchange\n")) {
2293 otOut <<
"(User has instructed to send an exchangeBasket command "
2294 "to the server...)\n";
2298 if (0 < OTAPI_Wrap::OTAPI()->GetClient()->ProcessUserCommand(
2299 OTClient::exchangeBasket, theMessage, *pMyNym,
2303 bSendCommand =
true;
2306 otErr <<
"Error processing exchangeBasket command in "
2307 "ProcessMessage: " << buf <<
"\n";
2312 else if (!strcmp(buf,
"offer\n")) {
2313 otOut <<
"(User has instructed to send a marketOffer command to "
2318 if (0 < OTAPI_Wrap::OTAPI()->GetClient()->ProcessUserCommand(
2319 OTClient::marketOffer, theMessage, *pMyNym,
2323 bSendCommand =
true;
2326 otErr <<
"Error processing marketOffer command in "
2327 "ProcessMessage: " << buf <<
"\n";
2332 else if (!strcmp(buf,
"setservername\n")) {
2333 otOut <<
"(User wants to set a Server Contract's "
2334 "client-side name...)\n";
2338 if (0 < OTAPI_Wrap::OTAPI()->GetClient()->ProcessUserCommand(
2339 OTClient::setServerName, theMessage, *pMyNym,
2350 else if (!strcmp(buf,
"setassetname\n")) {
2351 otOut <<
"(User wants to set an Asset Contract's "
2352 "client-side name...)\n";
2356 if (0 < OTAPI_Wrap::OTAPI()->GetClient()->ProcessUserCommand(
2357 OTClient::setAssetName, theMessage, *pMyNym,
2368 else if (!strcmp(buf,
"setnymname\n")) {
2369 otOut <<
"(User wants to set a Nym's client-side name...)\n";
2373 if (0 < OTAPI_Wrap::OTAPI()->GetClient()->ProcessUserCommand(
2374 OTClient::setNymName, theMessage, *pMyNym,
2385 else if (!strcmp(buf,
"setaccountname\n")) {
2386 otOut <<
"(User wants to set an Asset Account's client-side "
2391 if (0 < OTAPI_Wrap::OTAPI()->GetClient()->ProcessUserCommand(
2392 OTClient::setAccountName, theMessage, *pMyNym,
2406 else if (!strcmp(buf,
"signcontract\n")) {
2407 otOut <<
"(User has instructed to sign a contract...)\n";
2409 OTAPI_Wrap::OTAPI()->GetClient()->ProcessUserCommand(
2410 OTClient::signContract, theMessage, *pMyNym, *pServerContract,
2416 else if (buf[0] ==
's') {
2417 otOut <<
"(User has instructed to send a sendUserMessage command "
2418 "to the server...)\n";
2422 if (0 < OTAPI_Wrap::OTAPI()->GetClient()->ProcessUserCommand(
2423 OTClient::sendUserMessage, theMessage, *pMyNym,
2427 bSendCommand =
true;
2430 otErr <<
"Error processing sendUserMessage command in "
2431 "ProcessMessage: " << buf[0] <<
"\n";
2436 else if (strLine.compare(0, 2,
"py") == 0) {
2437 otOut <<
"(User has instructed to send a processNymbox command "
2438 "to the server...)\n";
2442 if (0 < OTAPI_Wrap::OTAPI()->GetClient()->ProcessUserCommand(
2443 OTClient::processEntireNymbox, theMessage, *pMyNym,
2447 bSendCommand =
true;
2450 otErr <<
"Error in processNymbox command in ProcessMessage: "
2456 else if (buf[0] ==
'y') {
2457 otOut <<
"(User has instructed to send a getNymbox command to "
2462 if (0 < OTAPI_Wrap::OTAPI()->GetClient()->ProcessUserCommand(
2463 OTClient::getNymbox, theMessage, *pMyNym,
2467 bSendCommand =
true;
2470 otErr <<
"Error processing getNymbox command in "
2471 "ProcessMessage: " << buf[0] <<
"\n";
2478 else if (strLine.compare(0, 2,
"pi") == 0) {
2479 otOut <<
"(User has instructed to send a processInbox command to "
2484 if (0 < OTAPI_Wrap::OTAPI()->GetClient()->ProcessUserCommand(
2485 OTClient::processEntireInbox, theMessage, *pMyNym,
2486 *pServerContract,
nullptr))
2489 bSendCommand =
true;
2492 otErr <<
"Error in processInbox command in ProcessMessage: "
2498 else if (buf[0] ==
'i') {
2499 otOut <<
"(User has instructed to send a getInbox command to the "
2504 if (0 < OTAPI_Wrap::OTAPI()->GetClient()->ProcessUserCommand(
2505 OTClient::getInbox, theMessage, *pMyNym,
2506 *pServerContract,
nullptr)) {
2507 bSendCommand =
true;
2510 otErr <<
"Error processing getInbox command in ProcessMessage: "
2516 else if (buf[0] ==
'o') {
2517 otOut <<
"(User has instructed to send a getOutbox command to "
2522 if (0 < OTAPI_Wrap::OTAPI()->GetClient()->ProcessUserCommand(
2523 OTClient::getOutbox, theMessage, *pMyNym,
2524 *pServerContract,
nullptr)) {
2525 bSendCommand =
true;
2528 otErr <<
"Error processing getOutbox command in "
2529 "ProcessMessage: " << buf[0] <<
"\n";
2534 else if (buf[0] ==
'q') {
2535 otOut <<
"User has instructed to deposit a cheque...\n";
2539 if (0 < OTAPI_Wrap::OTAPI()->GetClient()->ProcessUserCommand(
2540 OTClient::notarizeCheque, theMessage, *pMyNym,
2541 *pServerContract,
nullptr)) {
2542 bSendCommand =
true;
2545 otErr <<
"Error processing deposit cheque command in "
2546 "ProcessMessage: " << buf[0] <<
"\n";
2551 else if (buf[0] ==
'p') {
2552 otOut <<
"(User has instructed to deposit a purse "
2553 "containing cash...)\n";
2557 if (0 < OTAPI_Wrap::OTAPI()->GetClient()->ProcessUserCommand(
2558 OTClient::notarizePurse, theMessage, *pMyNym,
2559 *pServerContract,
nullptr)) {
2560 bSendCommand =
true;
2563 otErr <<
"Error processing deposit command in ProcessMessage: "
2569 else if (buf[0] ==
'd') {
2570 otOut <<
"(User has instructed to deposit cash tokens...)\n";
2574 if (0 < OTAPI_Wrap::OTAPI()->GetClient()->ProcessUserCommand(
2575 OTClient::notarizeDeposit, theMessage, *pMyNym,
2576 *pServerContract,
nullptr)) {
2577 bSendCommand =
true;
2580 otErr <<
"Error processing deposit command in ProcessMessage: "
2586 else if (buf[0] ==
'v') {
2587 otOut <<
"User has instructed to withdraw a voucher (like a "
2588 "cashier's cheque)...\n";
2592 if (0 < OTAPI_Wrap::OTAPI()->GetClient()->ProcessUserCommand(
2593 OTClient::withdrawVoucher, theMessage, *pMyNym,
2597 bSendCommand =
true;
2600 otErr <<
"Error processing withdraw voucher command in "
2601 "ProcessMessage: " << buf[0] <<
"\n";
2606 else if (buf[0] ==
'w') {
2607 otOut <<
"(User has instructed to withdraw cash...)\n";
2611 if (0 < OTAPI_Wrap::OTAPI()->GetClient()->ProcessUserCommand(
2612 OTClient::notarizeWithdrawal, theMessage, *pMyNym,
2616 bSendCommand =
true;
2619 otErr <<
"Error processing withdraw command in ProcessMessage: "
2625 else if (!strcmp(buf,
"activate\n")) {
2626 otOut <<
"User has instructed to activate a payment plan...\n";
2630 if (0 < OTAPI_Wrap::OTAPI()->GetClient()->ProcessUserCommand(
2631 OTClient::paymentPlan, theMessage, *pMyNym,
2635 bSendCommand =
true;
2638 otErr <<
"Error processing payment plan command in "
2639 "ProcessMessage: " << buf[0] <<
"\n";
2644 else if (!strcmp(buf,
"get\n")) {
2645 otOut <<
"(User has instructed to send a getAccount command to "
2650 if (0 < OTAPI_Wrap::OTAPI()->GetClient()->ProcessUserCommand(
2651 OTClient::getAccount, theMessage, *pMyNym,
2655 bSendCommand =
true;
2658 otErr <<
"Error processing getAccount command in "
2659 "ProcessMessage: " << buf[0] <<
"\n";
2664 else if (!strcmp(buf,
"getcontract\n")) {
2665 otOut <<
"(User has instructed to send a getContract command to "
2670 if (0 < OTAPI_Wrap::OTAPI()->GetClient()->ProcessUserCommand(
2671 OTClient::getContract, theMessage, *pMyNym,
2675 bSendCommand =
true;
2678 otErr <<
"Error processing getContract command in "
2679 "ProcessMessage: " << buf[0] <<
"\n";
2682 else if (!strcmp(buf,
"propose\n")) {
2683 otOut <<
"(User has instructed to propose a payment plan...)\n";
2685 OTAPI_Wrap::OTAPI()->GetClient()->ProcessUserCommand(
2686 OTClient::proposePaymentPlan, theMessage, *pMyNym,
2691 else if (!strcmp(buf,
"confirm\n")) {
2692 otOut <<
"(User has instructed to confirm a payment plan...)\n";
2694 OTAPI_Wrap::OTAPI()->GetClient()->ProcessUserCommand(
2695 OTClient::confirmPaymentPlan, theMessage, *pMyNym,
2700 else if (!strcmp(buf,
"cheque\n")) {
2701 otOut <<
"(User has instructed to write a cheque...)\n";
2703 OTAPI_Wrap::OTAPI()->GetClient()->ProcessUserCommand(
2704 OTClient::writeCheque, theMessage, *pMyNym, *pServerContract,
2710 else if (!strcmp(buf,
"getmint\n")) {
2711 otOut <<
"(User has instructed to send a getMint command "
2712 "to the server...)\n";
2716 if (0 < OTAPI_Wrap::OTAPI()->GetClient()->ProcessUserCommand(
2717 OTClient::getMint, theMessage, *pMyNym,
2721 bSendCommand =
true;
2724 otErr <<
"Error processing getMint command in ProcessMessage: "
2730 else if (buf[0] ==
't') {
2731 otOut <<
"(User has instructed to send a Transfer command "
2732 "(Notarize Transactions) to the server...)\n";
2736 if (0 < OTAPI_Wrap::OTAPI()->GetClient()->ProcessUserCommand(
2737 OTClient::notarizeTransfer, theMessage, *pMyNym,
2741 bSendCommand =
true;
2744 otErr <<
"Error processing notarizeTransactions command in "
2745 "ProcessMessage: " << buf[0] <<
"\n";
2750 else if (buf[0] ==
'g') {
2751 otOut <<
"(User has instructed to send a getRequest command to "
2756 if (0 < OTAPI_Wrap::OTAPI()->GetClient()->ProcessUserCommand(
2757 OTClient::getRequest, theMessage, *pMyNym,
2761 bSendCommand =
true;
2764 otErr <<
"Error processing getRequest command in "
2765 "ProcessMessage: " << buf[0] <<
"\n";
2770 else if (buf[0] ==
'n') {
2791 int64_t lTransactionNumber =
2792 ((strlen(buf) > 2) ? atol(&(buf[2])) : 0);
2794 if (lTransactionNumber > 0) {
2798 otOut <<
"You are trying to mess around with your (add to "
2799 "your) transaction numbers.\n"
2800 "Enter the relevant server ID [" << strServerID
2805 const OTString strTransNumServerID((str_ServerID.size() > 0)
2806 ? str_ServerID.c_str()
2807 : strServerID.Get());
2813 otOut <<
"Transaction number " << lTransactionNumber
2814 <<
" added to both lists "
2815 "(on client side.)\n";
2818 otOut <<
"(User has instructed to send a getTransactionNum "
2819 "command to the server...)\n";
2823 if (0 < OTAPI_Wrap::OTAPI()->GetClient()->ProcessUserCommand(
2824 OTClient::getTransactionNum, theMessage, *pMyNym,
2828 bSendCommand =
true;
2831 otErr <<
"Error processing getTransactionNum command in "
2832 "ProcessMessage: " << buf[0] <<
"\n";
2849 if (bSendCommand && (
nullptr != pServerNym) &&
2851 OTString strEnvelopeContents(theMessage);
2853 theEnvelope.
Seal(*pServerNym, strEnvelopeContents);
2855 OTAPI_Wrap::OTAPI()->GetTransportCallback()->operator()(
2856 *pServerContract, theEnvelope);
2861 otOut <<
"Exiting OT prompt.\n";
OTLOG_IMPORT OTLogStream otLog4
EXPORT bool CalculateDigest(const OTData &dataInput)
EXPORT void ExecuteScript_ReturnVoid(const std::string &str_Code, std::string str_DisplayName="<BLANK>")
EXPORT void GetIdentifier(OTIdentifier &theIdentifier) const
EXPORT OTAccount * GetAccountPartialMatch(std::string PARTIAL_ID)
EXPORT static OT_OTAPI_OT void CopyVariables()
EXPORT OTAssetContract * GetAssetContract(const OTIdentifier &theContractID)
bool SetupPointersForWalletMyNymAndServerContract(std::string &str_ServerID, std::string &str_MyNym, OTPseudonym *&pMyNym, OTWallet *&pWallet, OTServerContract *&pServerContract)
EXPORT OTPseudonym * GetNymByIDPartialMatch(std::string PARTIAL_ID)
OTLOG_IMPORT OTLogStream otOut
EXPORT void DisplayStatistics(OTString &strOutput)
EXPORT bool GetAccount(int32_t iIndex, OTIdentifier &THE_ID, OTString &THE_NAME)
EXPORT bool Open(const OTPseudonym &theRecipient, OTString &theOutput, const OTPasswordData *pPWData=nullptr)
EXPORT void Concatenate(const char *arg,...)
EXPORT bool Seal(const OTPseudonym &theRecipient, const OTString &theInput)
EXPORT bool VerifyPseudonym() const
EXPORT const OTPseudonym * GetContractPublicNym() const
EXPORT void Set(const char *data, uint32_t enforcedMaxLength=0)
EXPORT bool AddTransactionNum(OTPseudonym &SIGNER_NYM, const OTString &strServerID, int64_t lTransNum, bool bSave)
EXPORT std::string OT_CLI_ReadLine()
EXPORT OTPseudonym * GetNymByID(const OTIdentifier &NYM_ID)
void HandleCommandLineArguments(int32_t argc, char *argv[], AnyOption *opt)
int64_t GetTotalValue() const
EXPORT OTAssetContract * GetAssetContractPartialMatch(std::string PARTIAL_ID)
#define OT_ASSERT_MSG(x, s)
OTLOG_IMPORT OTLogStream otInfo
virtual EXPORT void GetIdentifier(OTIdentifier &theIdentifier) const
OTLOG_IMPORT OTLogStream otWarn
EXPORT const char * Get() const
OTLOG_IMPORT OTLogStream otErr
EXPORT int32_t ExecuteScript_ReturnInt(const std::string &str_Code, std::string str_DisplayName="<BLANK>")
EXPORT void AddVariable(const std::string &str_var_name, OTVariable &theVar)
EXPORT void RemoveReqNumbers(const OTString *pstrServerID=nullptr)
EXPORT void GetString(OTString &theStr) const
EXPORT bool LoadPurse(const char *szServerID=nullptr, const char *szUserID=nullptr, const char *szAssetTypeID=nullptr)
EXPORT bool IsEmpty() const
EXPORT void RemoveAllNumbers(const OTString *pstrServerID=nullptr, bool bRemoveHighestNum=true)
void CollectDefaultedCLValues(AnyOption *opt, std::string &str_ServerID, std::string &str_MyAcct, std::string &str_MyNym, std::string &str_MyPurse, std::string &str_HisAcct, std::string &str_HisNym, std::string &str_HisPurse)
EXPORT bool SaveSignedNymfile(OTPseudonym &SIGNER_NYM)