32 #include "../core/OTLog.hpp"
40 otOut <<
"\nThis command not coded yet. We need to use the "
41 "OT_API_RevokeSubcredential API call here.\n\n";
48 otOut <<
"\nThis command not coded yet. A Nym is created with credentials "
49 "already,\nbut to add MORE credentials to an existing Nym, I need "
50 "to use the OT_API_AddSubcredential API call.\n\n";
66 otOut <<
"Usage: showbasket\nOPTIONAL: --args \"index "
67 "BASKET_INDEX\"\n\nNOTE: If you leave off the index, then it "
68 "lists all the basket currencies.\nBut if an index is provided, "
69 "this command will zoom in and show the details\nfor that "
70 "specific basket currency.\n\n";
79 if (nAssetCount > 0) {
85 strIndex = strTempIndex;
91 int32_t nIndex = std::stol(strIndex);
93 if (nIndex < 0 || nIndex >= nAssetCount) {
94 otOut <<
"Error: index out of bounds.\n";
100 otOut <<
"ERROR: Failed getting asset type ID at index: "
104 string strAssetName =
112 <<
"Failure: not a basket currency: " << strAssetID
113 <<
" : " << strAssetName <<
"\n";
117 cout <<
"Name: " << strAssetName <<
"\n";
118 cout <<
"ID: " << strAssetID <<
"\n";
120 int32_t nMemberCount =
123 if (0 > nMemberCount) {
124 otOut <<
"ERROR: expected int32_t return value "
126 "OT_API_Basket_GetMemberCount(strAssetID)"
129 else if (nMemberCount <= 0) {
130 otOut <<
"Strange: this basket has " << nMemberCount
131 <<
" sub-currencies. (Expected 1 or more.)\n";
134 int64_t nBasketMinTransAmt =
138 if (0 > nBasketMinTransAmt) {
139 otOut <<
"Strange: expected minimum transfer "
140 "amount for basket, but got bad value "
144 cout <<
"Minimum transfer amount for basket: "
145 " " << nBasketMinTransAmt <<
"\n";
146 cout <<
"Number of sub-currencies in the "
147 "basket: " << nMemberCount <<
"\n";
149 bool bFirstMember =
true;
151 for (int32_t nMemberIndex = 0;
152 nMemberIndex < nMemberCount;
154 string strMemberType =
156 strAssetID, nMemberIndex);
157 string strMemberName =
165 strAssetID, nMemberIndex);
168 bFirstMember =
false;
170 otOut <<
" Index : Min Transfer "
171 "Amount : Member currency "
172 "\n---------------------------"
176 cout <<
" " << nMemberIndex <<
" : "
177 << nMinTransAmt <<
" : "
178 << strMemberType <<
" : "
179 << strMemberName <<
"\n";
180 otOut <<
"---------------------------------"
192 bool bOnFirstIteration =
true;
194 for (int32_t nAssetIndex = 0; nAssetIndex < nAssetCount;
199 if (bOnFirstIteration) {
200 bOnFirstIteration =
false;
201 otOut <<
"Index | Basket "
202 "currencies:\n------------------------------------"
209 cout << nAssetIndex <<
": " << strAssetID
210 <<
" : " + strAssetName <<
"\n";
213 cout << nAssetIndex <<
": " << strAssetID <<
"\n";
217 if (nAssetCount > 0) {
235 const string& strNym)
237 int32_t nBasketCount = 2;
238 otOut <<
"How many different asset types will compose this new basket "
244 nBasketCount = std::stol(strBasketCount);
246 if (nBasketCount < 2) {
247 otOut <<
"Sorry, but a basket currency must be composed of at "
248 "least 2 sub-currencies.\n";
253 int64_t lMinimumTransAmount = int64_t(100);
255 otOut <<
"\nIf your basket has a minimum transfer amount of 100, you might "
256 "have 2 or 3 sub-currencies,\nwith the first being a minimum of 2 "
257 "gold, the second being a minimum of 50 dollars, and the\nthird "
258 "being a minimum of 30 silver.\nIn this example, 100 units of the "
259 "basket currency is transferrable in or out of the\nbasket "
260 "currency, in return for 2 gold, 50 dollars, and 30 silver.\n\n";
261 otOut <<
"What is the minimum transfer amount for the basket currency "
267 lMinimumTransAmount = std::stoll(strMinAmount);
269 if (lMinimumTransAmount < 1) {
270 otOut <<
"Sorry, but this needs to be a non-zero value. Minimum is "
280 otOut <<
"Error while generating initial basket object.\n";
284 for (int32_t ibasket = 0; ibasket < nBasketCount; ++ibasket) {
287 otOut <<
"\nThis basket currency has " << nBasketCount
288 <<
" subcurrencies.\n";
289 otOut <<
"So far you have defined " << ibasket <<
" of them.\n";
290 otOut <<
"Please PASTE the asset type ID for a subcurrency of this "
299 string strSubcurrencyContract =
303 otOut <<
"Sorry, but " << strSubcurrencyID
304 <<
" is apparently not a currency contract in your wallet.\n";
309 otOut <<
"Enter minimum transfer amount for that asset type [100]: ";
311 lMinimumTransAmount = 100;
315 lMinimumTransAmount =
318 if (lMinimumTransAmount < 1) {
319 otOut <<
"Sorry, but this needs to be a non-zero value. "
327 strNym, strBasket, strSubcurrencyID, lMinimumTransAmount);
330 otOut <<
"Error: OT_API_AddBasketCreationItem returned nullptr. "
335 strBasket = strTempBasket;
339 otOut <<
"Here's the basket we're issuing:\n\n" << strBasket <<
"\n";
346 otOut <<
"\n\n SUCCESS in issue_basket_currency! Server response:\n\n";
347 cout << strResponse <<
"\n";
351 bool bRetrieved =
false;
352 string strEnding =
".";
355 string strRetrieved =
357 strEnding =
": " + strNewID;
363 otOut <<
"Server response: SUCCESS in issue_basket_currency!\n";
364 otOut << (bRetrieved ?
"Success" :
"Failed")
365 <<
" retrieving new basket contract" << strEnding <<
"\n";
369 otOut <<
"\n\n FAILURE in issue_basket_currency! Server response:\n\n";
370 cout << strResponse <<
"\n";
371 otOut <<
" FAILURE in issue_basket_currency!\n";
374 otOut <<
"\n\nError in issue_basket_currency! nStatus is: " << nStatus
378 otOut <<
"Server response:\n\n";
379 cout << strResponse <<
"\n";
380 otOut <<
"\nError in issue_basket_currency! nStatus is: " << nStatus
387 return (0 == nStatus) ? -1 : nStatus;
392 const string& strNym,
393 const string& strAcct,
394 const string& strBasketType)
403 if (nMemberCount < 2) {
404 otOut <<
"Strange, the chosen basket asset type apparently has no "
405 "sub-currencies. (Failure.)\n";
409 int64_t lMinimumTransAmount =
412 if (0 > lMinimumTransAmount) {
413 otOut <<
"Strange, the chosen basket asset type apparently has no "
414 "minimum transfer amount. (Failure.)\n";
418 bool bExchangingIn =
true;
420 otOut <<
"Are you exchanging IN or OUT of the basket? [IN]: ";
429 otOut <<
"Strange: unable to retrieve balance for basket account: "
434 if ((strInOrOut ==
"out") || (strInOrOut ==
"OUT")) {
435 otOut <<
"Exchanging OUT of the basket currency...\n\n";
436 bExchangingIn =
false;
438 if (lBalance < lMinimumTransAmount) {
439 otOut <<
"Sorry, but the minimum transfer amount for this basket "
440 "currency is " << lMinimumTransAmount
441 <<
"\nand the chosen account's balance is only " << lBalance
447 otOut <<
"Exchanging IN to the basket currency...\n\n";
450 int32_t nTransferMultiple = 1;
452 otOut <<
"This basket currency has a minimum transfer amount of "
453 << lMinimumTransAmount <<
".\n";
454 otOut <<
"Now you must choose the Transfer Multiple for the exchange. For "
457 for (int32_t i = 1; i < 5; ++i) {
458 int64_t lUnits = i * lMinimumTransAmount;
460 otOut <<
"A transfer multiple of " << i <<
" will exchange " << lUnits
461 <<
" units of the basket currency.\n";
465 if (!bExchangingIn) {
466 otOut <<
"Keep in mind, the balance in the basket account is: "
467 << lBalance <<
"\n\n";
470 otOut <<
"Please choose a transfer multiple [1]: ";
474 int32_t nTempMultiple = std::stol(strTransferMultiple);
476 if (nTempMultiple > 1) {
477 nTransferMultiple = nTempMultiple;
481 int64_t lAttemptedTransfer = (nTransferMultiple * lMinimumTransAmount);
483 if (!bExchangingIn && (lAttemptedTransfer > lBalance)) {
484 otOut <<
"A transfer multiple of " << nTransferMultiple
485 <<
" will exchange " << lAttemptedTransfer
486 <<
" units out of the basket currency.\nUnfortunately, you only "
487 "have a " << lBalance
488 <<
" balance in your basket account. (Failed.)\n";
497 strServer, strNym, strBasketType, strAcct, nTransferMultiple);
500 otOut <<
"Failed generating basket exchange request.\n";
518 for (int32_t nMember = 0; nMember < nMemberCount; ++nMember) {
519 string strMemberType =
523 otOut <<
"Error retrieving member type from index " << nMember
524 <<
" of basket currency: " << strBasketType <<
"\n";
526 strBasket, strNym,
false,
false,
false,
false,
false);
533 strMemberTypeName =
"";
536 int64_t lMemberAmount =
540 if (0 > lMemberAmount) {
541 otOut <<
"Error retrieving minimum transfer amount from index "
542 << nMember <<
" (" << strMemberType
543 <<
") on basket currency: " << strBasketType <<
"\n";
545 strBasket, strNym,
false,
false,
false,
false,
false);
549 lAttemptedTransfer = (nTransferMultiple * lMemberAmount);
556 otOut <<
"There are " << (nMemberCount - nMember)
557 <<
" accounts remaining to be selected.\n\n";
558 otOut <<
"Currently we need to select an account with the asset type:\n"
559 << strMemberType <<
" (" << strMemberTypeName <<
")\n";
560 otOut <<
"Above are all the accounts in the wallet, for the relevant "
561 "server and nym, of that asset type.\n";
564 otOut <<
"\nKeep in mind, with a transfer multiple of "
565 << nTransferMultiple <<
" and a minimum transfer amount of "
567 <<
"\n(for this sub-currency), you must therefore select an "
568 "account with a minimum\nbalance of: "
569 << lAttemptedTransfer <<
"\n";
572 otOut <<
"\nPlease PASTE an account ID from the above list: ";
577 strBasket, strNym,
false,
false,
false,
false,
false);
581 string strSubAssetID =
584 otOut <<
"Error retrieving asset type ID from pasted account: "
585 << strSubAccount <<
"\n";
587 strBasket, strNym,
false,
false,
false,
false,
false);
591 if (strMemberType != strSubAssetID) {
592 otOut <<
"Failure: The selected account has the wrong asset type: "
593 << strSubAssetID <<
"\n";
595 strBasket, strNym,
false,
false,
false,
false,
false);
601 otOut <<
"Strange, error while retrieving balance for sub-account: "
602 << strSubAccount <<
"\n";
604 strBasket, strNym,
false,
false,
false,
false,
false);
608 if (bExchangingIn && (lAttemptedTransfer > lBalance)) {
609 otOut <<
"\nWith a minimum transfer amount of " << lMemberAmount
610 <<
" for this sub-currency, a transfer multiple of "
611 << nTransferMultiple <<
" will exchange "
612 << lAttemptedTransfer
613 <<
" units out of the basket currency.\n\nUnfortunately, you "
614 "only have a " << lBalance
615 <<
" balance in your selected account. (Failure.)\n";
617 strBasket, strNym,
false,
false,
false,
false,
false);
622 strServer, strNym, strBasket, strSubAssetID, strSubAccount);
625 otOut <<
"Failed while adding this sub-account to the exchange "
628 strBasket, strNym,
false,
false,
false,
false,
false);
632 strBasket = strTempBasket;
638 strServer, strNym, strBasketType, strBasket, strAcct, bExchangingIn);
639 string strAttempt =
"exchange_basket";
642 strServer, strNym, strAcct, strAttempt, strResponse);
644 if (1 == nInterpretReply) {
648 otOut <<
"Server response (" << strAttempt
649 <<
"): SUCCESS exchanging basket!\n";
650 otOut << (bRetrieved ?
"Success" :
"Failed")
651 <<
" retrieving intermediary files for account.\n";
654 return nInterpretReply;
659 otOut <<
"Usage: exchange --myacct BASKET_ACCT_ID\n\nThis command "
660 "exchanges in or out of a basket currency.\nYou must already have "
661 "an asset account which has a basket currency as its asset "
662 "type.\nYou must also have accounts for all the subcurrencies in "
671 otOut <<
"Error while trying to retrieve asset type for account: "
675 otOut <<
"Error while trying to retrieve server ID for account: "
679 otOut <<
"Error while trying to retrieve Nym ID for account: "
683 otOut <<
"MyAcct has a different asset type than the one specified "
684 "at the command line.\nPlease re-try, and add: --mypurse "
685 << strAcctType <<
"\n";
688 otOut <<
"MyAcct has a different server ID than the one specified "
689 "at the command line.\nPlease re-try, and add: --server "
690 << strServer <<
"\n";
693 otOut <<
"MyAcct has a different owner Nym ID than the one "
694 "specified at the command line.\nPlease re-try, and add: "
695 "--mynym " << strNym <<
"\n";
698 otOut <<
"\nMyAcct is NOT a basket currency! Its asset type is: "
699 << strAcctType <<
"\nHere is a list of the basket currencies "
702 details_show_basket();
704 otOut <<
"\nHere is a list of the accounts whose asset type IS a "
705 "basket currency:\n";
707 stat_basket_accounts(
"",
"",
false,
"");
709 otOut <<
"\nMyAcct is not a basket currency!\nPlease use --myacct "
710 "to specify an account whose asset type IS a basket "
714 return details_exchange_basket(strServer, strNym,
MyAcct,
719 otOut <<
"You must provide an account ID, and that account must have a "
720 "basket\ncurrency for its asset type. Use --myacct and choose "
721 "from these basket accounts:\n";
723 stat_basket_accounts(
"",
"",
false,
"");
743 const string& strNym,
bool bFilter,
744 const string& strBasketType)
746 cout <<
"------------------------------------------------------------------"
748 cout <<
" ** ACCOUNTS :\n\n";
752 for (int32_t i = 0; i < nAccountCount; ++i) {
765 (strBasketType == strAssetID)) ||
767 (strBasketType != strAssetID))) {
768 if ((i > 0) && (i != (nAccountCount))) {
769 cout <<
"-------------------------------------\n";
775 cout << strStatAcct <<
"\n";
778 cout <<
"Error trying to stat an account: " << strID
787 cout <<
"------------------------------------------------------------------"
815 const string& strMyNym,
816 const string& strIndices)
822 int32_t nSuccess = 1;
827 otOut <<
"\n\n details_discard_incoming: OT_API_LoadPaymentInbox "
832 int32_t nInboxCount =
835 if (0 > nInboxCount) {
836 otOut <<
"details_discard_incoming: Unable to retrieve size of "
837 "payments inbox ledger. (Failure.)\n";
841 if (nInboxCount > 0) {
854 for (int32_t nInboxIndex = (nInboxCount - 1); nInboxIndex >= 0;
859 if (!(
"all" == strIndices) &&
860 ((nIndicesCount > 0) &&
870 strServer, strMyNym,
true, nInboxIndex,
false);
871 otOut <<
"\n" << (bRecorded ?
"Success" :
"Failure")
872 <<
" discarding instrument from payments inbox at index: "
874 <<
".\n\n NOTE: Now the sender has to leave it in his "
875 "outbox until it expires or he cancels it on his "
892 otOut <<
"Usage: discard --mynym NYM_ID --server SERVER_ID --args "
893 "\"index|indices INDICES_GO_HERE\"\n\nThis command discards an "
894 "incoming instrument from the payments inbox.\n(Usually used for "
895 "discarding an invoice, for when you don't want to pay it.)\nYou "
896 "can also use 'all' for the index, for it to process ALL "
900 string strIndex =
"";
901 string strIndices =
"";
902 string strFinalIndex =
"";
903 bool bUseStdin =
false;
910 strFinalIndex = strIndex;
913 strFinalIndex = strIndices;
926 otOut <<
"\nPlease enter the index (in your payments inbox)\nof "
927 "the instrument you are discarding: ";
931 strFinalIndex = strIndex;
938 return details_discard_incoming(
Server,
MyNym, strFinalIndex);
946 const string& strMyAcct,
947 const string& strIndices)
969 otOut <<
"Error: cannot retrieve outpayments for Nym: " << strMyNym
975 int32_t nSuccess = 1;
978 otOut <<
"\n(Outpayment box is empty)\n\n";
982 for (int32_t nIndex = (nCount - 1); nIndex >= 0; --nIndex) {
986 if (!(
"all" == strIndices) && nIndicesCount > 0 &&
997 otOut <<
"ERROR: Failed retrieving server ID from "
998 "outpayment at index: " << nIndex <<
"\n";
1001 string strPaymentContents =
1008 string strPaymentType =
1055 if (
"SMARTCONTRACT" == strPaymentType) {
1065 otOut <<
"You must provide an account owned by "
1066 "this Nym, which will be used for the "
1067 "cancellation. Try adding --myacct "
1068 "ACCT_ID\nNOTE: in the future we "
1069 "should just look up one of the "
1070 "accounts from the smart contract "
1071 "itself, since the current Nym has "
1072 "already confirmed the contract. But "
1073 "for now I'm just collecting the acct "
1074 "ID at the command line, since it's "
1078 string strResponse =
1080 strServer, strMyNym, strMyAcct,
1081 "acct_agent_name", strPaymentContents);
1083 otOut <<
"Okay I just tried to activate the "
1084 "smart contract. (As a way of "
1085 "cancelling it.)\nSo while we expect "
1086 "this 'activation' to fail, it should "
1087 "have the desired effect of "
1088 "cancelling the smart contract and "
1089 "sending failure notices to all the "
1093 otOut <<
"\n Here's the server reply: \n"
1094 << strResponse <<
"\n";
1096 int32_t nTransCancelled =
1098 strServer, strMyNym, strMyAcct,
1101 if (1 == nTransCancelled) {
1102 otOut <<
"\n Success canceling!\n";
1105 otOut <<
"\n Error canceling!\n";
1110 otOut <<
"Strange, tried to cancel, but "
1111 "received a nullptr server "
1116 else if (
"PAYMENT PLAN" == strPaymentType) {
1127 strServer, strMyNym, strPaymentContents);
1129 otOut <<
"Okay I just tried to activate the "
1130 "payment plan. (As a way of cancelling "
1131 "it.)\nSo while we expect this "
1132 "'activation' to fail, it should have the "
1133 "desired effect of cancelling the payment "
1134 "plan and sending failure notices to all "
1138 otOut <<
"\n Here's the server reply: \n"
1139 << strResponse <<
"\n";
1141 int32_t nTransCancelled =
1143 strServer, strMyNym, strMyAcct,
1146 if (1 == nTransCancelled) {
1147 otOut <<
"\n Success canceling!\n";
1150 otOut <<
"\n Error canceling!\n";
1155 otOut <<
"Strange, tried to cancel, but "
1156 "received a nullptr server reply.\n";
1159 else if (
"PURSE" == strPaymentType) {
1181 strServer, strMyNym,
false, nIndex,
false);
1186 otOut <<
"Discarded cash purse:\n\n"
1187 << strPaymentContents <<
"\n";
1189 otOut << (bRecorded ?
"Success" :
"Failure")
1190 <<
" discarding cash purse from "
1191 "outpayment box at index: " << nIndex
1196 int32_t nDepositCheque = -1;
1197 bool bIsVoucher = (
"VOUCHER" == strPaymentType);
1201 string strSenderAcctID =
1206 strPaymentContents));
1207 string strSenderUserID =
1212 strPaymentContents));
1215 otOut <<
"Failure trying to retrieve asset "
1216 "account ID from instrument.\n";
1219 otOut <<
"Failure trying to retrieve Sender "
1220 "Nym ID from instrument.\n";
1222 else if (!(strSenderUserID == strMyNym)) {
1223 otOut <<
"Failure, very strange: Sender Nym ID "
1224 "on the instrument doesn't match the "
1229 strServer, strSenderAcctID, strSenderUserID,
1230 strPaymentContents, strPaymentType);
1234 << (1 == nDepositCheque ?
"Success" :
"Failure")
1235 <<
" canceling cheque of type: "
1236 << strPaymentType <<
"\n";
1248 otOut <<
"Usage: cancel --mynym NYM_ID --args \"index "
1249 "INDEX_GOES_HERE\"\n\nThis command cancels an outgoing instrument "
1250 "from the outpayment box.\n(Usually used for cancelling a cheque, "
1251 "payment plan, or smart contract.)\nThis, of course, will fail on "
1252 "the server side, if the recipient has already deposited the "
1256 string strIndex =
"";
1257 string strIndices =
"";
1258 string strFinalIndex =
"";
1259 bool bUseStdin =
false;
1266 strFinalIndex = strIndex;
1269 strFinalIndex = strIndices;
1282 for (int32_t nPayments = 0; nPayments < nCount; ++nPayments) {
1283 show_outpayment(
MyNym, nPayments,
false);
1286 otOut <<
"\nPlease enter the index (in your outpayment box)\nof "
1287 "the instrument you are cancelling: ";
1291 strFinalIndex = strIndex;
1298 string strMyAcct =
"";
1303 return details_cancel_outgoing(
MyNym, strMyAcct, strFinalIndex);
1318 const string& strServerID,
const string& strMyNymID,
1319 const string& strTransNum,
const string& strClause,
const string& strParam)
1322 strServerID, strMyNymID, strTransNum, strClause, strParam);
1325 if (1 != nMessageSuccess) {
1326 otOut <<
"For whatever reason, our attempt to trigger the clause has "
1330 otOut <<
"Success!\n";
1333 return nMessageSuccess;
1338 otOut <<
"Usage: STRING GOES HERE";
1347 string strTransNum =
"";
1348 string strClause =
"";
1349 string strParam =
"";
1358 otOut <<
"Please enter the transaction ID for the running "
1363 strTransNum = strInputTransNum;
1367 strTransNum = strTempTransNum;
1372 otOut <<
"Please enter the name of the clause you wish to "
1377 strClause = strInputClause;
1381 strClause = strTempClause;
1386 otOut <<
"You can pass an optional parameter string (to pass "
1387 "to the clause itself)\nfollowed by a ~ by itself on "
1388 "a blank line. (Just use ~ to leave it blank.)\n\n";
1392 strParam = strInputParam;
1396 strParam = strTempParam;
1401 return details_trigger_clause(
Server,
MyNym, strTransNum, strClause,
1410 const string& strInputID)
1414 if (0 > nCredCount) {
1417 else if (nCredCount >= 1) {
1418 for (int32_t nCurrent = 0; nCurrent < nCredCount; ++nCurrent) {
1422 int32_t nSubCredCount =
1425 if (nSubCredCount >= 1) {
1426 for (int32_t nCurrentSubCred = 0;
1427 nCurrentSubCred < nSubCredCount; ++nCurrentSubCred) {
1429 strMyNymID, strCredID, nCurrentSubCred);
1431 if (strInputID == strSubCredID) {
1443 const string& strInputID)
1447 if (0 > nCredCount) {
1450 else if (nCredCount >= 1) {
1451 for (int32_t nCurrent = 0; nCurrent < nCredCount; ++nCurrent) {
1455 int32_t nSubCredCount =
1458 if (nSubCredCount >= 1) {
1459 for (int32_t nCurrentSubCred = 0;
1460 nCurrentSubCred < nSubCredCount; ++nCurrentSubCred) {
1462 strMyNymID, strCredID, nCurrentSubCred);
1464 if (strInputID == strSubCredID) {
1481 const string& strMyNymID,
const string& strCredID)
1483 string strCredContents =
1487 otOut <<
"Master Credential contents:\n";
1488 cout << strCredContents <<
"\n";
1496 otOut <<
"Revoked Credential contents:\n";
1497 cout << strCredContents <<
"\n";
1503 bool bIsRevoked =
false;
1504 string strMasterID = find_masterID_for_subcred(strMyNymID, strCredID);
1507 strMasterID = find_revokedID_for_subcred(strMyNymID, strCredID);
1512 otOut <<
"Sorry, unable to find any credentials associated with that "
1517 strMyNymID, strMasterID, strCredID);
1520 otOut <<
"Error retrieving sub-credential contents.\n";
1525 otOut <<
"Revoked Subcredential contents:\n";
1528 otOut <<
"Subcredential contents:\n";
1530 cout << strCredContents <<
"\n";
1539 otOut <<
"Usage: showcredential --mynym NYM_ID --args \"id "
1540 "CREDENTIAL_ID\"\n\nThis command displays the contents of a given "
1541 "credential (for a given Nym.)\n\n";
1544 string strCredID =
"";
1550 otOut <<
"Please enter the ID for the credential: ";
1554 strCredID = strInput;
1558 strCredID = strTempCredID;
1563 details_show_credential(
MyNym, strCredID)) {
1574 int32_t nReturnVal = -1;
1578 if (0 > nCredCount) {
1582 if (nCredCount >= 1) {
1585 otOut <<
"Idx Credential ID\n---------------------------\n";
1587 for (int32_t nCurrent = 0; nCurrent < nCredCount; ++nCurrent) {
1590 cout << nCurrent <<
": " << strCredID <<
"\n";
1592 int32_t nSubCredCount =
1595 if (nSubCredCount >= 1) {
1597 otOut <<
" ---------------------------\n Idx "
1598 "Subcredential ID\n "
1599 "---------------------------\n";
1601 for (int32_t nCurrentSubCred = 0;
1602 nCurrentSubCred < nSubCredCount; ++nCurrentSubCred) {
1604 strMyNymID, strCredID, nCurrentSubCred);
1605 cout <<
" " << nCurrentSubCred <<
": "
1606 << strSubCredID <<
"\n";
1621 if (0 > nCredCount) {
1625 if (nCredCount >= 1) {
1628 otOut <<
"Idx Revoked Credential ID\n---------------------------\n";
1630 for (int32_t nCurrent = 0; nCurrent < nCredCount; ++nCurrent) {
1633 cout << nCurrent <<
": " << strCredID <<
"\n";
1635 int32_t nSubCredCount =
1638 if (nSubCredCount >= 1) {
1640 otOut <<
" ---------------------------\n Idx "
1641 "Revoked Subcredential ID\n "
1642 "---------------------------\n";
1644 for (int32_t nCurrentSubCred = 0;
1645 nCurrentSubCred < nSubCredCount; ++nCurrentSubCred) {
1647 strMyNymID, strCredID, nCurrentSubCred);
1648 cout <<
" " << nCurrentSubCred <<
": "
1649 << strSubCredID <<
"\n";
1662 otOut <<
"Usage: credentials --mynym NYM_ID\n\nThis command displays the "
1663 "list of credentials for a given Nym.\n\n";
1666 return details_show_credentials(
MyNym);
1673 const string& strPartyName,
1674 const string& strAgentName,
1678 strSmartContract, strPartyName, strAgentName);
1681 cout <<
"--------------------\n " << nIndex <<
" : Agent '"
1682 << strAgentName <<
"' (party '" << strPartyName
1683 <<
"') has NymID: " << strAgentID <<
" ('"
1687 cout <<
" " << nIndex <<
" : Agent '" << strAgentName <<
"' (party '"
1688 << strPartyName <<
"') has no NymID assigned (yet.)\n";
1695 const string& strSmartContract,
const string& strPartyName,
1696 int32_t nCurrentAgent)
1699 strSmartContract, strPartyName, nCurrentAgent);
1702 otOut <<
"Error: Failed retrieving Agent Name from party '"
1703 << strPartyName <<
"' at agent index: " << nCurrentAgent <<
"\n";
1706 return stat_partyagent(strSmartContract, strPartyName, strAgentName,
1711 const string& strPartyName,
1714 int32_t nAgentCount =
1717 if (nAgentCount < 0) {
1718 otOut <<
"Error: Party '" << strPartyName
1719 <<
"' has bad value for number of authorized agents.\n";
1724 for (int32_t nCurrentAgent = 0; nCurrentAgent < nAgentCount;
1726 if (!stat_partyagent_index(strSmartContract, strPartyName,
1733 cout <<
"Party '" << strPartyName <<
"' has " << nAgentCount
1734 << (1 == nAgentCount ?
" agent." :
" agents.") <<
"\n";
1741 const string& strSmartContract,
const string& strPartyName,
1742 const string& strAcctName, int32_t nCurrentAccount)
1745 strSmartContract, strPartyName, strAcctName);
1747 strPartyName, strAcctName);
1749 strSmartContract, strPartyName, strAcctName);
1752 cout <<
"-------------------\nAccount '" << strAcctName <<
"' (index "
1753 << nCurrentAccount <<
" on Party '" << strPartyName
1754 <<
"') has asset type: " << strAcctAssetID <<
" ("
1759 cout <<
"Account '" << strAcctName <<
"' (party '" << strPartyName
1760 <<
"') is confirmed as Account ID: " << strAcctID <<
" ("
1765 cout <<
"Account '" << strAcctName <<
"' (party '" << strPartyName
1766 <<
"') is managed by agent: " << strAcctAgentName <<
"\n";
1773 const string& strSmartContract,
const string& strPartyName,
1774 int32_t nCurrentAccount)
1777 strSmartContract, strPartyName, nCurrentAccount);
1780 otOut <<
"Error: Failed retrieving Asset Account Name from party '"
1781 << strPartyName <<
"' at account index: " << nCurrentAccount
1785 return stat_partyaccount(strSmartContract, strPartyName, strAcctName,
1790 const string& strSmartContract,
const string& strPartyName, int32_t nDepth)
1792 int32_t nAccountCount =
1795 if (nAccountCount < 0) {
1796 otOut <<
"Error: Party '" << strPartyName
1797 <<
"' has bad value for number of asset accounts.\n";
1802 for (int32_t nCurrentAccount = 0; nCurrentAccount < nAccountCount;
1803 ++nCurrentAccount) {
1804 if (!stat_partyaccount_index(strSmartContract, strPartyName,
1811 cout <<
"Party '" << strPartyName <<
"' has " << nAccountCount
1812 << (1 == nAccountCount ?
" asset account." :
" asset accounts.")
1820 const string& strSmartContract, int32_t& nPartyCount)
1822 if (0 == nPartyCount) {
1824 if (nPartyCount < 0) {
1825 otOut <<
"Failure: There are apparently no PARTIES to this smart "
1833 otOut <<
"Looks like all the parties on this contract are already "
1834 "confirmed.\n(Perhaps you want to 'activate' it instead.)\n";
1838 int32_t nUnconfirmedPartyCount = 0;
1840 for (int32_t nCurrentParty = 0; nCurrentParty < nPartyCount;
1842 string strPartyName =
1846 otOut <<
"Error: Unable to retrieve smart contract party's name at "
1847 "index: " << nCurrentParty <<
"\n";
1851 bool bIsPartyConfirmed =
1853 if (!bIsPartyConfirmed) {
1855 otOut << strIndex <<
" : Unconfirmed party: " << strPartyName
1857 ++nUnconfirmedPartyCount;
1861 if (nUnconfirmedPartyCount <= 0) {
1862 otOut <<
"SHOULD NEVER HAPPEN: OT_API_Smart_AreAllPartiesConfirmed was "
1863 "already verified as false, above.\nSo then why am I at the "
1864 "bottom of this loop and I haven't found any unconfirmed "
1879 const string& strServerID,
const string& strMyNymID,
1880 const string& strMyAcctID,
const string& strHisNymID,
1881 const string& strHisAcctID,
const string& strDates,
1882 const string& strConsideration,
const string& strInitialPayment,
1883 const string& strPaymentPlan,
const string& strExpiry)
1886 otOut <<
"Sorry, but you must describe the consideration to create a "
1887 "recurring payment plan.\n";
1908 strServerID, strDates, strHisAcctID, strHisNymID, strConsideration,
1909 strMyAcctID, strMyNymID, strInitialPayment, strPaymentPlan, strExpiry);
1924 strServerID, strMyNymID, strHisNymID, strPlan);
1927 if (1 != nMessageSuccess) {
1928 otOut <<
"For whatever reason, our attempt to send the payment "
1929 "plan on to the next user has failed.\n";
1931 strPlan, strMyNymID,
false,
false,
false,
false,
false);
1932 otOut <<
"details_propose: OT_API_Msg_HarvestTransactionNumbers: "
1933 << nHarvested <<
"\n";
1936 return nMessageSuccess;
1945 otOut <<
"Usage: propose (For a merchant to propose a payment plan to "
1946 "a customer.)\nMandatory: --server SERVER_ID --mynym PAYEE_NYM_ID "
1947 "--hisnym PAYER_NYM_ID\nMandatory: --myacct PAYEE_ACCT_ID "
1948 "--hisacct PAYER_NYM_ID\nAdditional arguments:\n Date Range: "
1949 "--args \" date_range \\\"from,to\\\" \"\nFROM should be in "
1950 "seconds from Jan 1970, and TO is added to that number.\nDefault "
1951 "FROM is the current time, and default TO is 'no expiry.'\nAlso: "
1952 "--args \" consideration \\\"like a memo\\\" \" \nAlso: --args \" "
1953 "initial_payment \\\"amount,delay\\\" \" \nDefault 'amount' (0 or "
1954 "\"\") == no initial payment. Default 'delay' (0 or \"\") is "
1955 "seconds from creation date.\nAlso: --args \" payment_plan "
1956 "\\\"amount,delay,period\\\" \" \n'amount' is a recurring "
1957 "payment. 'delay' and 'period' cause 30 days if you pass 0 or "
1958 "\"\".\n'delay' and 'period' are both measured in seconds. Period "
1959 "is time between\neach payment. Delay is time until first "
1960 "payment.\nAlso: --args \" plan_expiry \\\"length,number\\\" \" "
1961 "\n'length' is maximum lifetime in seconds. 'number' is maximum "
1962 "number of payments. 0 or \"\" is unlimited (for both.)\n\n";
1967 string strDates =
"";
1968 string strConsideration =
"";
1969 string strInitialPayment =
"";
1970 string strPaymentPlan =
"";
1971 string strExpiry =
"";
1975 string strTempConsideration =
1977 string strTempInitialPayment =
1979 string strTempPaymentPlan =
1984 strDates = strTempDates;
1987 strConsideration = strTempConsideration;
1990 strInitialPayment = strTempInitialPayment;
1993 strPaymentPlan = strTempPaymentPlan;
1996 strExpiry = strTempExpiry;
2002 otOut <<
"\nDescribe the product or service being received in "
2003 "return for the\nrecurring payments, followed by a ~ by "
2004 "itself on a blank line:\n\n";
2013 otOut <<
"date_range (from,to): " << strDates <<
"\n";
2014 otOut <<
"consideration: " << strConsideration <<
"\n";
2015 otOut <<
"initial_payment (amount,delay): " << strInitialPayment
2017 otOut <<
"payment_plan (amount,delay,period): " << strPaymentPlan
2019 otOut <<
"plan_expiry (length,number): " << strExpiry <<
"\n";
2021 return details_propose_plan(
2023 strInitialPayment, strPaymentPlan, strExpiry);
2039 string strLocation =
"details_confirm_plan";
2044 string strRecipientUserID =
2062 strServerID, strSenderUserID, strSenderAcctID, strRecipientUserID,
2071 strServerID, strSenderUserID, strConfirmed);
2072 string strAttempt =
"deposit_payment_plan";
2078 if (-1 == nMessageSuccess) {
2083 otOut <<
"Message error: " << strAttempt <<
".\n";
2085 strConfirmed, strSenderUserID,
false,
false,
false,
false,
2087 otOut << strLocation
2088 <<
": OT_API_Msg_HarvestTransactionNumbers: "
2089 << nHarvested <<
"\n";
2092 else if (0 == nMessageSuccess) {
2093 otOut <<
"Server reply (" << strAttempt
2094 <<
"): Message failure.\n";
2096 strConfirmed, strSenderUserID,
false,
false,
false,
false,
2098 otOut << strLocation
2099 <<
": OT_API_Msg_HarvestTransactionNumbers: "
2100 << nHarvested <<
"\n";
2112 strServerID, strSenderUserID, strSenderAcctID, strAttempt,
2114 if (1 == nInterpretReply) {
2116 strServerID, strSenderUserID, strSenderAcctID,
true);
2118 otOut <<
"\nServer response (" << strAttempt
2119 <<
"): SUCCESS activating payment plan!\n";
2120 otOut << (bRetrieved ?
"Success" :
"Failed")
2121 <<
" retrieving intermediary files for account.\n";
2123 return nInterpretReply;
2157 string strLocation =
"details_confirm_smart_contract";
2161 if (nPartyCount <= 0) {
2162 otOut <<
"Failed trying to confirm a smart contract: there are "
2163 "apparently no PARTIES to this contract!\n";
2174 string strMyAcctID =
"";
2175 string strMyAcctAgentName =
"";
2177 string strServerID =
"";
2178 string strNymID =
"";
2180 map<string, string> map_ID;
2181 map<string, string> map_agent;
2187 if (show_unconfirmed_parties(strSmartContract, nPartyCount)) {
2192 otOut <<
"\n\nWhich party are you? Enter the number, from the list "
2198 int32_t nCurrentParty = std::stol(strPartyIndex);
2200 if (nCurrentParty >= 0 && nCurrentParty < nPartyCount) {
2202 strSmartContract, nCurrentParty);
2205 otOut <<
"Error: Unable to retrieve smart contract party's "
2206 "name at index: " << nCurrentParty <<
"\n";
2212 otOut <<
"Failure: the party at that index is _already_ "
2224 strSmartContract, strPartyName);
2226 if (nAccountCount < 0) {
2228 <<
"Error: Party '" << strPartyName
2229 <<
"' has a bad value for number of asset accounts.\n";
2234 if (nAccountCount > 0) {
2237 string strFoundServerID =
"";
2238 string strFoundMyNymID =
"";
2239 int32_t nCurrentAcctCount = nAccountCount;
2241 while (nCurrentAcctCount > 0) {
2243 stat_partyaccounts(strSmartContract, strPartyName, 2);
2245 otOut <<
"\n There are " << nCurrentAcctCount
2246 <<
" asset accounts remaining to be "
2247 "confirmed.\nEnter the index for an "
2248 "UNconfirmed account: ";
2256 int32_t nAcctIndex = std::stol(strAcctIndex);
2258 if (nAcctIndex < 0) {
2259 otOut <<
"Error: Bad Index: " << strAcctIndex
2264 string strAcctName =
2266 strSmartContract, strPartyName, nAcctIndex);
2269 otOut <<
"Error: Unable to retrieve account name "
2270 "at index " << strAcctIndex
2271 <<
" for Party: " << strPartyName <<
"\n";
2275 bool bAlreadyThere =
false;
2277 for (
auto x = map_ID.begin(); x != map_ID.end(); ++x) {
2278 if (x->first == strAcctName) {
2279 bAlreadyThere =
true;
2284 strSmartContract, strPartyName, strAcctName);
2287 otOut <<
"\nSorry, but the account at index "
2289 <<
" is already confirmed with account ID: "
2291 <<
" \nYou are just going to have to pick a "
2292 "different account.\n";
2297 string strServerOnContract =
2300 bool bServerOnContract =
2316 if (bServerOnContract &&
2317 (strServerID != strServerOnContract)) {
2318 string strServerName =
2320 strServerOnContract);
2324 otOut <<
"The server ID on the smart "
2325 "contract, " << strServerOnContract
2326 <<
" (" << strServerName
2327 <<
") doesn't match the server "
2328 "selected at the command line "
2329 "with the --server option.\n";
2335 if (bServerOnContract) {
2336 strServerID = strServerOnContract;
2342 strServerID = strFoundServerID;
2348 int32_t nServerCount =
2351 if (nServerCount < 1) {
2352 otOut <<
"Sorry, there aren't any "
2353 "server contracts in this "
2354 "wallet. Try 'opentxs "
2361 otOut <<
"Paste a server ID: ";
2369 strServerID = strServerIDInput;
2370 strFoundServerID = strServerIDInput;
2377 strNymID = strFoundMyNymID;
2383 if (nNymCount < 1) {
2384 otOut <<
"There are apparently no Nyms "
2385 "in this wallet. Try 'opentxs "
2390 cout <<
"------------------------------"
2391 "------------------------------"
2393 cout <<
" ** NYMS (filtered by "
2394 "serverID: " << strServerID
2397 bool bFoundANym =
false;
2399 for (int32_t i = 0; i < nNymCount;
2402 string strLoopNymID =
2406 IsNym_RegisteredAtServer(
2413 otOut << strIndex <<
": "
2415 <<
" --- " << strName
2422 <<
"Unfortunately, didn't find "
2423 "ANY Nyms registered at "
2424 "server: " << strServerID
2429 otOut <<
"\n Select a Nym by index: ";
2438 std::stol(strNymIndex);
2439 if (nNymIndex < 0) {
2441 <<
"Bad index: " << strNymIndex
2446 string strTempNymID =
2450 otOut <<
"Error retrieving NymID "
2451 "from wallet at index: "
2452 << strNymIndex <<
"\n";
2457 IsNym_RegisteredAtServer(
2460 strNymID = strTempNymID;
2461 strFoundMyNymID = strTempNymID;
2465 otOut <<
"Sorry, that Nym isn't "
2466 "registered at server: "
2468 <<
"\nPlease choose another "
2492 string strTemplateAssetID =
2494 strSmartContract, strPartyName,
2496 bool bFoundTemplateAssetID =
2499 bool bFoundAccounts =
false;
2500 int32_t nCountAcctsWallet =
2503 otOut <<
"\nAccounts by index (filtered by "
2504 "serverID and nymID):\n\n";
2506 for (int32_t i = 0; i < nCountAcctsWallet; ++i) {
2507 string strWalletAcctID =
2510 otOut <<
"Error reading account ID based "
2511 "on index: " << i <<
"\n";
2515 string strAcctServerID =
2518 string strAcctNymID =
2521 string strAcctAssetID =
2525 bool bAlreadyOnTheMap =
false;
2527 for (
auto x = map_ID.begin(); x != map_ID.end();
2529 if (x->second == strWalletAcctID) {
2530 bAlreadyOnTheMap =
true;
2534 if ((strServerID == strAcctServerID) &&
2535 (strNymID == strAcctNymID)) {
2540 if (!bFoundTemplateAssetID ||
2541 (bFoundTemplateAssetID &&
2542 (strTemplateAssetID ==
2548 if (!bAlreadyOnTheMap) {
2549 bFoundAccounts =
true;
2555 strAccountName =
"";
2558 << strWalletAcctID <<
" ("
2559 << strAccountName <<
")\n";
2565 if (!bFoundAccounts) {
2566 otOut <<
"Unfortunately, looks like there are "
2567 "no accounts matching the specified "
2568 "Nym (" << strNymID <<
") and Server ("
2570 <<
")\nTry: opentxs newaccount --mynym "
2571 << strNymID <<
" --server " << strServerID
2576 otOut <<
"\nChoose an account by index (for '"
2577 << strAcctName <<
"'): ";
2585 int32_t nSelectedAcctIndex =
2586 std::stol(strSelectedAcctIndex);
2588 if (nSelectedAcctIndex < 0 ||
2589 nSelectedAcctIndex >= nCountAcctsWallet) {
2590 otOut <<
"Bad index: " << strSelectedAcctIndex
2595 string strWalletAcctID =
2597 nSelectedAcctIndex);
2599 otOut <<
"Error reading account ID based on "
2600 "index: " << nSelectedAcctIndex
2605 string strAcctServerID =
2608 string strAcctNymID =
2611 string strAcctAssetID =
2615 if ((strServerID == strAcctServerID) &&
2616 (strNymID == strAcctNymID)) {
2621 if (!bFoundTemplateAssetID ||
2622 (bFoundTemplateAssetID &&
2623 (strTemplateAssetID == strAcctAssetID))) {
2625 bool bAlreadyOnIt =
false;
2627 for (
auto x = map_ID.begin();
2628 x != map_ID.end(); ++x) {
2629 if (x->second == strWalletAcctID) {
2630 bAlreadyOnIt =
true;
2635 otOut <<
"Sorry, you already selected "
2636 "this account. Choose "
2646 string strAgentName =
2648 strSmartContract, strPartyName,
2654 if (stat_partyagents(
2657 otOut <<
"\n (This choice is "
2658 "arbitrary, but you "
2661 "index for an agent, "
2662 "to have authority "
2663 "over that account: ";
2665 string strAgentIndex =
2673 int32_t nAgentIndex =
2674 std::stol(strAgentIndex);
2676 if (nAgentIndex < 0) {
2678 <<
"Error: Bad Index: "
2692 otOut <<
"Error: Unable to "
2705 <<
"Failed finding the "
2707 "party: " << strPartyName
2710 <<
" \n And then failed "
2711 "finding any agents on "
2712 "this smart contract at "
2718 map_ID[strAcctName] = strWalletAcctID;
2719 map_agent[strAcctName] = strAgentName;
2721 nCurrentAcctCount -= 1;
2728 for (
auto x = map_ID.begin(); x != map_ID.end(); ++x) {
2729 int32_t numCountNeeded =
2731 strSmartContract, map_agent[x->first]) +
2735 numCountNeeded, strServerID, strNymID)) {
2736 otOut <<
"\n** Sorry -- Nym (" << strNymID
2737 <<
") doesn't have enough transaction "
2738 "numbers to confirm this smart contract. "
2739 "Come back when you have more.\n";
2758 for (
auto x = map_ID.begin(); x != map_ID.end(); ++x) {
2769 strMyAcctAgentName = map_agent[x->first];
2774 string strTempSmart =
2776 strSmartContract, strNymID, strPartyName,
2777 x->first, map_agent[x->first], x->second);
2779 strSmartContract = strTempSmart;
2782 otOut <<
"Failure while calling "
2783 "OT_API_SmartContract_ConfirmAccount. "
2784 "Acct Name: " << x->first
2785 <<
" Agent Name: " << map_agent[x->first]
2786 <<
" Acct ID: " << x->second <<
" \n";
2787 int32_t nHarvested =
2789 strSmartContract, strNymID,
false,
false,
2790 false,
false,
false);
2791 otOut << strLocation
2792 <<
": OT_API_Msg_HarvestTransactionNumbers: "
2793 << nHarvested <<
"\n";
2851 strSmartContract, strPartyName, strNymID);
2854 strSmartContract = strTempSmart;
2857 otOut <<
"Failure while calling "
2858 "OT_API_SmartContract_ConfirmParty. Party Name: "
2859 << strPartyName <<
" NymID: " << strNymID <<
"\n";
2860 int32_t nHarvested =
2862 strSmartContract, strNymID,
false,
false,
false,
2864 otOut << strLocation
2865 <<
": OT_API_Msg_HarvestTransactionNumbers: "
2866 << nHarvested <<
"\n";
2885 strSmartContract)) {
2901 stat_partyaccounts(strSmartContract, strPartyName,
2904 otOut <<
"\n\n Enter the index for the account you'll "
2905 "use to ACTIVATE the smart contract: ";
2910 int32_t nHarvested =
2912 strSmartContract, strNymID,
false,
false,
2913 false,
false,
false);
2914 otOut << strLocation
2915 <<
": OT_API_Msg_HarvestTransactionNumbers: "
2916 << nHarvested <<
"\n";
2920 int32_t nAcctIndex = std::stol(strAcctIndex);
2922 if (nAcctIndex < 0 || nAcctIndex >= nAccountCount) {
2923 otOut <<
"Error: Bad Index: " << strAcctIndex
2924 <<
" (Acceptable values are 0 through "
2925 << (nAccountCount - 1) <<
")\n";
2926 int32_t nHarvested =
2928 strSmartContract, strNymID,
false,
false,
2929 false,
false,
false);
2930 otOut << strLocation
2931 <<
": OT_API_Msg_HarvestTransactionNumbers: "
2932 << nHarvested <<
"\n";
2936 string strAcctName =
2938 strSmartContract, strPartyName, nAcctIndex);
2941 otOut <<
"Error: Unable to retrieve account name "
2942 "at index " << strAcctIndex
2943 <<
" for Party: " << strPartyName <<
"\n";
2944 int32_t nHarvested =
2946 strSmartContract, strNymID,
false,
false,
2947 false,
false,
false);
2948 otOut << strLocation
2949 <<
": OT_API_Msg_HarvestTransactionNumbers: "
2950 << nHarvested <<
"\n";
2955 strSmartContract, strPartyName, strAcctName);
2958 otOut <<
"Strange: the account at index "
2960 <<
" is not yet confirmed with any account "
2962 int32_t nHarvested =
2964 strSmartContract, strNymID,
false,
false,
2965 false,
false,
false);
2966 otOut << strLocation
2967 <<
": OT_API_Msg_HarvestTransactionNumbers: "
2968 << nHarvested <<
"\n";
2971 strMyAcctID = strAcctID;
2973 string strAcctAgentName =
2975 strSmartContract, strPartyName, strAcctName);
2978 otOut <<
"Strange: the account named: '"
2980 <<
"' doesn't seem to have any agent "
2981 "confirmed to it. (Failure.)\n";
2982 int32_t nHarvested =
2984 strSmartContract, strNymID,
false,
false,
2985 false,
false,
false);
2986 otOut << strLocation
2987 <<
": OT_API_Msg_HarvestTransactionNumbers: "
2988 << nHarvested <<
"\n";
2991 strMyAcctAgentName = strAcctAgentName;
3003 strServerID, strNymID, strMyAcctID, strMyAcctAgentName,
3005 string strAttempt =
"activate_smart_contract";
3008 if (-1 == nMessageSuccess) {
3013 otOut <<
"Message error: " << strAttempt <<
".\n";
3014 int32_t nHarvested =
3016 strSmartContract, strNymID,
false,
false,
false,
3018 otOut << strLocation
3019 <<
": OT_API_Msg_HarvestTransactionNumbers: "
3020 << nHarvested <<
"\n";
3023 else if (0 == nMessageSuccess) {
3024 otOut <<
"Server reply (" << strAttempt
3025 <<
"): Message failure.\n";
3026 int32_t nHarvested =
3028 strSmartContract, strNymID,
false,
false,
false,
3030 otOut << strLocation
3031 <<
": OT_API_Msg_HarvestTransactionNumbers: "
3032 << nHarvested <<
"\n";
3045 strServerID, strNymID, strMyAcctID, strAttempt,
3048 if (1 == nInterpretReply) {
3050 strServerID, strNymID, strMyAcctID,
true);
3052 otOut <<
"\nServer response (" << strAttempt
3053 <<
"): SUCCESS activating smart contract!\n";
3055 << (bRetrieved ?
"Success" :
"Failed")
3056 <<
" retrieving intermediary files for account.\n";
3058 return nInterpretReply;
3070 string strHisNymID =
"";
3080 (strHisNymID == strNymID)) {
3083 otOut <<
"\nOnce you confirm this contract, then we "
3084 "need to send it on to the\nnext party so he "
3085 "can confirm it, too.\n\nPlease PASTE a "
3086 "recipient Nym ID (the next party): ";
3089 int32_t nHarvested =
3091 strSmartContract, strNymID,
false,
false,
3092 false,
false,
false);
3093 otOut << strLocation
3094 <<
": OT_API_Msg_HarvestTransactionNumbers: "
3095 << nHarvested <<
"\n";
3099 string strHisNymParam = strRecipientNymID;
3106 string strHisNymFromPartial =
3111 strHisNymParam = strHisNymFromPartial;
3114 strHisNymID = strHisNymParam;
3116 if (strHisNymID == strNymID) {
3117 otOut <<
"\nSorry, but YOU cannot simultaneously "
3118 "be the SENDER _and_ the RECIPIENT. "
3119 "Choose another nym for one or the "
3121 int32_t nHarvested =
3123 strSmartContract, strNymID,
false,
false,
3124 false,
false,
false);
3125 otOut << strLocation
3126 <<
": OT_API_Msg_HarvestTransactionNumbers: "
3127 << nHarvested <<
"\n";
3133 strServerID, strNymID, strHisNymID, strSmartContract);
3137 if (1 != nMessageSuccess) {
3138 otOut <<
"\nFor whatever reason, our attempt to send "
3139 "the instrument on to the next user has "
3141 int32_t nHarvested =
3143 strSmartContract, strNymID,
false,
false,
false,
3145 otOut << strLocation
3146 <<
": OT_API_Msg_HarvestTransactionNumbers: "
3147 << nHarvested <<
"\n";
3187 otOut <<
"Success sending the agreement on to the next "
3192 true, nIndex,
false);
3195 return nMessageSuccess;
3209 int32_t nIndex = -1;
3215 int32_t nTempIndex = std::stol(strIndex);
3217 if (nTempIndex >= 0) {
3218 nIndex = nTempIndex;
3223 string strInstrument =
"";
3229 otOut <<
"If this is in reference to a smart contract or payment "
3230 "plan in your payments\ninbox, please enter the index to "
3231 "confirm it (or just hit enter, to paste a contract): ";
3235 int32_t nTempIndex = std::stol(strIndex);
3237 if (nTempIndex >= 0) {
3238 nIndex = nTempIndex;
3244 otOut <<
"\n Unable to get instrument from payments "
3245 "inbox, based on index: " << nIndex <<
".\n";
3254 otOut <<
"\nPlease paste the smart contract or payment "
3255 "plan,\nfollowed by a ~ by itself on a blank "
3266 otOut <<
"\nPlease paste the smart contract or payment "
3267 "plan,\nfollowed by a ~ by itself on a blank line:\n\n";
3282 otOut <<
"\n Unable to get instrument from payments inbox, "
3283 "based on index: " << nIndex <<
".\n";
3288 otOut <<
"Since you specified an index, make sure to also specify "
3289 "--server and --mynym,\nso you use that index on the "
3290 "right payments inbox.\n";
3298 otOut <<
"\n\nFailure: Unable to determine instrument type. Expected "
3299 "SMART CONTRACT or PAYMENT PLAN.\n";
3309 if (tTime < tFrom) {
3311 otOut <<
"The instrument is not yet within its valid date range. "
3315 otOut <<
"The instrument at index " << nIndex
3316 <<
" is not yet within its valid date range. (Skipping.)\n";
3322 otOut <<
"The instrument is expired. (Harvesting the transaction "
3325 strInstrument,
MyNym,
false,
false,
false,
false,
false)) {
3330 otOut <<
"The instrument at index " << nIndex
3331 <<
" is expired. (Moving it to the record box.)\n";
3344 if (
"SMARTCONTRACT" == strInstrumentType) {
3353 return details_confirm_smart_contract(strInstrument, nIndex);
3356 else if (
"PAYMENT PLAN" == strInstrumentType) {
3358 return details_confirm_plan(strInstrument, nIndex);
3362 otOut <<
"\nFailure: Instrument is not a smart contract or payment "
3363 "plan, but rather a: " << strInstrumentType <<
"\n";
3372 otOut <<
"Please enter multiple lines of input to be encoded, followed by "
3373 "an EOF or a ~ by itself on a blank line:\n\n";
3376 otOut <<
"\n\n--------------------------------------\n You entered:\n"
3377 << strInput <<
"\n\n";
3381 otOut <<
"-------------------------------------- \n Encoded:\n\n";
3384 cout << strOutput <<
"\n";
3397 otOut <<
"Please enter multiple lines of OT-armored text to be decoded, "
3398 "followed by an EOF or a ~ by itself on a blank line:\n\n";
3401 otOut <<
"\n\n--------------------------------------\n You entered:\n"
3402 << strInput <<
"\n\n";
3406 otOut <<
"--------------------------------------\n Decoded:\n\n";
3409 cout << strOutput <<
"\n";
3424 otOut <<
"Please enter multiple lines of input to be "
3425 "encrypted,\nfollowed by an EOF or a ~ by itself on a blank "
3429 otOut <<
"\n\n--------------------------------------\n You entered:\n"
3430 << strInput <<
"\n\n";
3436 otOut <<
"-------------------------------------- \n Encrypted:\n\n";
3438 cout << strOutput <<
"\n";
3452 otOut <<
"Please enter multiple lines of input to be decrypted, "
3453 "followed by an EOF or a ~ by itself on a blank line:\n\n";
3456 otOut <<
"\n\n--------------------------------------\n You entered:\n"
3457 << strInput <<
"\n\n";
3463 otOut <<
"-------------------------------------- \n Decrypted:\n\n";
3465 cout << strOutput <<
"\n";
3477 otOut <<
"Please enter a symmetric key, followed by a ~ by itself on a "
3481 otOut <<
"Please enter the plaintext, followed by a ~ by itself on a blank "
3487 string strCiphertext =
3492 otOut <<
"-------------------------------------- \n "
3493 "strCiphertext:\n\n";
3495 cout << strCiphertext <<
"\n";
3507 otOut <<
"Please enter a symmetric key, followed by a ~ by itself on a "
3511 otOut <<
"Please enter the symmetrically-encrypted ciphertext, followed by "
3512 "a ~ by itself on a blank line:\n\n";
3517 string strPlaintext =
3522 otOut <<
"-------------------------------------- \n Plaintext:\n\n";
3524 cout << strPlaintext <<
"\n";
3535 const string& strNymImportFile,
string& strOutNymID)
3546 otOut <<
"Usage: importnym\n";
3548 otOut <<
"Paste your exported Nym here (for import), followed by a ~ by "
3549 "itself on a blank line: \n";
3558 bool bDone = details_import_nym(strNymFile, strOutNymID);
3561 otOut <<
"\n\n FAILED trying to import Nym.\n";
3565 otOut <<
"\n\n SUCCESS importing Nym: " << strOutNymID <<
"\n\n";
3576 return strExportedNym;
3581 otOut <<
"Usage: exportnym --mynym NYM_ID\n";
3584 string strExportedNym = details_export_nym(
MyNym);
3587 otOut <<
"\n\n FAILED trying to export Nym: " <<
MyNym <<
"\n";
3591 otOut <<
"\n\n SUCCESS exporting Nym: " <<
MyNym <<
"\n\n";
3592 cout << strExportedNym <<
"\n";
3612 const string& strHisAcctID,
3613 const string& strAmount,
3614 const string& strNote)
3618 otOut <<
"Failure: Unable to find NymID (for sender) based on myacct. "
3619 "Use: --myacct ACCT_ID\n";
3620 otOut <<
"The designated asset account must be yours. OT will find the "
3621 "Nym based on the account.\n\n";
3625 otOut <<
"\n\nFailure: MyNym was provided (" <<
MyNym
3626 <<
"), but didn't match the Nym who owns MyAcct. To override, "
3627 "use: --mynym " << strMyNymID <<
"\n\n";
3633 otOut <<
"Failure: Unable to find ServerID based on myacct. Use: "
3634 "--myacct ACCT_ID\n";
3635 otOut <<
"The designated asset account must be yours. OT will find the "
3636 "Server based on the account.\n\n";
3640 otOut <<
"\n\nFailure: Server was provided (" <<
Server
3641 <<
"), but didn't match the Server where MyAcct is based. To "
3642 "override, use: --server " << strMyServerID <<
"\n\n";
3652 otOut <<
"HisAcct is not in the wallet, so I'm assuming it's on the "
3653 "same server as MyAcct. (Proceeding.)\n";
3655 strHisServerID = strMyServerID;
3658 if (!(strMyServerID == strHisServerID)) {
3659 otOut <<
"\n\nFailure: HisAcct is not on the same server as MyAcct "
3660 "(he's on " << strHisServerID <<
" but MyAcct is on "
3662 <<
"). You must choose either a different sender account (using "
3663 "--myacct ACCT_ID) or a different recipient account (using "
3664 "--hisacct ACCT_ID)\n\n";
3668 string strAssetTypeID =
3673 strMyServerID, strMyNymID, strMyAcctID, strHisAcctID, lAmount, strNote);
3674 string strAttempt =
"send_transfer";
3677 strMyServerID, strMyNymID, strMyAcctID, strAttempt, strResponse);
3679 if (1 == nInterpretReply) {
3683 otOut <<
"Server response (" << strAttempt
3684 <<
"): SUCCESS sending transfer!\n";
3685 otOut << (bRetrieved ?
"Success" :
"Failed")
3686 <<
" retrieving intermediary files for account.\n";
3689 return nInterpretReply;
3697 otOut <<
"Usage: transfer --myacct YOUR_ASSET_ACCT --hisacct "
3698 "RECIPIENT_ASSET_ACCT\n\nAlso NECESSARY: --args \"amount "
3699 "PUT_AMOUNT_HERE\"\nAnd OPTIONALLY: --args \"memo \\\"Just a memo "
3700 "for the transfer.\\\"\"\n\n";
3703 string strAssetTypeID =
3706 otOut <<
"\n\nFailure: Unable to find asset ID based on myacct. "
3707 "Use: --myacct ACCT_ID\n";
3711 string strAmount =
"0";
3712 string strNote =
"";
3714 string strDefaultAmount =
"10";
3715 string strDefaultNote =
"(blank memo field)";
3726 strAmount = strNewAmount;
3729 strNote = strNewNote;
3737 otOut <<
"Enter the amount[" << strDefaultAmount <<
"]: ";
3741 otOut <<
"Optionally, enter a memo on a single line["
3742 << strDefaultNote <<
"]: ";
3748 strAmount = strDefaultAmount;
3751 strNote = strDefaultNote;
3754 return details_send_transfer(
MyAcct,
HisAcct, strAmount, strNote);
3762 otOut <<
"Usage: editnym --mynym YOUR_NYM_ID\nAlso optionally: "
3763 "--args \"label \\\"PUT LABEL HERE\\\"\"\n";
3766 string strLabel =
"";
3768 string strDefaultLabel =
"(blank label)";
3778 strLabel = strNewLabel;
3785 otOut <<
"Enter MyNym's new label [" << strDefaultLabel <<
"]: ";
3790 strLabel = strDefaultLabel;
3796 otOut <<
"\n\n FAILED trying to set MyNym's label to: " << strLabel
3802 otOut <<
"\n\n SUCCESS setting MyNym's label to: " << strLabel
3814 otOut <<
"Usage: editaccount --myacct YOUR_ACCT_ID\nAlso optionally: "
3815 " --args \"label \\\"PUT LABEL HERE\\\"\"\n";
3821 otOut <<
"\n\nFailure: Unable to find NymID based on myacct. Use: "
3822 "--myacct ACCT_ID\n";
3823 otOut <<
"The designated asset account must be yours. OT will find "
3824 "the Nym based on the account.\n\n";
3828 otOut <<
"\n\nFailure: MyNym was provided, but didn't match the "
3829 "Nym who owns MyAcct. To override, use: --mynym "
3830 << strMyNymID <<
"\n\n";
3833 string strLabel =
"";
3835 string strDefaultLabel =
"(blank label)";
3845 strLabel = strNewLabel;
3852 otOut <<
"Enter MyAcct's new label [" << strDefaultLabel <<
"]: ";
3857 strLabel = strDefaultLabel;
3864 otOut <<
"\n\n FAILED trying to set MyAcct's label to: " << strLabel
3867 otOut <<
" MyNym ID: " << strMyNymID <<
"\n\n";
3871 otOut <<
"\n\n SUCCESS setting MyAcct's label to: " << strLabel
3874 otOut <<
" MyNym ID: " << strMyNymID <<
"\n\n";
3884 otOut <<
"Usage: editasset --mypurse ASSET_TYPE_ID\nAlso optionally: "
3885 " --args \"label \\\"PUT LABEL HERE\\\"\"\n";
3888 string strLabel =
"";
3890 string strDefaultLabel =
"(blank label)";
3900 strLabel = strNewLabel;
3907 otOut <<
"Enter MyPurse's new label [" << strDefaultLabel <<
"]: ";
3912 strLabel = strDefaultLabel;
3918 otOut <<
"\n\n FAILED trying to set MyPurse's label to: "
3919 << strLabel <<
"\n";
3920 otOut <<
"MyPurse (AssetTypeID): " <<
MyPurse <<
"\n\n";
3924 otOut <<
"\n\n SUCCESS setting MyPurse's label to: " << strLabel
3926 otOut <<
"MyPurse (AssetTypeID): " <<
MyPurse <<
"\n\n";
3936 otOut <<
"Usage: editserver --server SERVER_ID\nAlso optionally: "
3937 " --args \"label \\\"PUT LABEL HERE\\\"\"\n";
3940 string strLabel =
"";
3942 string strDefaultLabel =
"(blank label)";
3952 strLabel = strNewLabel;
3959 otOut <<
"Enter Server's new label [" << strDefaultLabel <<
"]: ";
3964 strLabel = strDefaultLabel;
3970 otOut <<
"\n\n FAILED trying to set Server's label to: " << strLabel
3976 otOut <<
"\n\n SUCCESS setting Server's label to: " << strLabel
3988 otOut <<
"Usage: sendmessage --server <SERVER_ID> --mynym <YOUR_NYM_ID> "
3989 "--hisnym <RECIPIENT_NYM_ID>\n\n";
3996 otOut <<
"Error: unkknown server ID: " <<
Server <<
"\n";
4003 otOut <<
"\n Failed: Unknown MyNym ID: " <<
MyNym <<
"\n";
4010 otOut <<
"\n Failed: Unknown HisNym ID: " <<
HisNym <<
"\n";
4014 otOut <<
"Please enter your message on multiple lines, optionally "
4015 "beginning with a \"Subject: \" line.\n";
4016 otOut <<
"Use Ctrl-C to cancel, otherwise finish your message with an "
4017 "EOF or a ~ by itself on a blank line:\n\n";
4021 string strResponse =
4024 otOut <<
"send_user_msg: Failed.\n";
4027 otOut <<
"Success in send_user_msg! Server response:\n\n";
4028 cout << strResponse <<
"\n";
4029 otOut <<
"\nSuccess in send_user_msg.\n\n";
4046 otOut <<
"Failure: Unable to find NymID (for sender) based on "
4047 "myacct. Use: --myacct ACCT_ID\n";
4048 otOut <<
"The designated asset account must be yours. OT will find "
4049 "the Nym based on the account.\n\n";
4053 otOut <<
"\n\nFailure: MyNym was provided (" <<
MyNym
4054 <<
"), but didn't match the Nym who owns MyAcct. To "
4055 "override, use: --mynym " << strMyNymID <<
"\n\n";
4061 otOut <<
"Failure: Unable to find ServerID based on myacct. Use: "
4062 "--myacct ACCT_ID\n";
4063 otOut <<
"The designated asset account must be yours. OT will find "
4064 "the Server based on the account.\n\n";
4068 otOut <<
"\n\nFailure: Server was provided (" <<
Server
4069 <<
"), but didn't match the Server where MyAcct is based. To "
4070 "override, use: --server " << strMyServerID <<
"\n\n";
4106 string strRecipientPubkey =
"";
4107 string strHisNymID =
"";
4111 strMyServerID, strMyNymID,
HisNym);
4118 otOut <<
"\n\nFailure: Unable to load or download pubkey for "
4119 "HisNym based on given value (" <<
HisNym
4120 <<
"). To override, use: --hisnym HIS_NYM_ID\n\n";
4150 string strDefaultAmount =
"1";
4151 string strDefaultMemo =
"(memo field)";
4152 int64_t nDefaultLength =
4155 string strAmount =
"0";
4156 string strMemo =
"";
4159 string strAssetTypeID =
4168 strMemo = strNewMemo;
4174 strAmount = strNewAmount;
4178 (std::stol(strNewLength) > 0)) {
4179 nLength = std::stol(strNewLength);
4187 otOut <<
"Enter the amount[" << strDefaultAmount <<
"]: ";
4191 otOut <<
"Optionally, enter a note on a single line["
4192 << strDefaultMemo <<
"]: ";
4196 otOut <<
"Enter the 'valid for' time period, in seconds (default "
4197 "is 30 days.) [" << nDefaultLength <<
"]: ";
4201 nLength = std::stol(strTemp);
4207 strAmount = strDefaultAmount;
4211 strMemo = strDefaultMemo;
4215 nLength = nDefaultLength;
4224 int64_t tLength = std::stoll(strLength);
4228 int64_t lTempAmount =
4238 strMyNymID, strMemo, strHisNymID);
4255 otOut <<
"Usage: writecheque --myacct <MY_ACCT_ID> --hisnym "
4256 "<HIS_NYM_ID>\nOptionally: --args \"memo \\\"one-line memo "
4257 "allowed here.\\\" amount AMOUNT\"\nAdditionally: --args "
4258 "\"validfor IN_SECONDS\" \nThis command WRITES but DOES NOT SEND "
4259 "the cheque. (Use sendcheque for that.)\n\n";
4261 string strCheque =
"";
4262 int32_t nReturnVal = details_write_cheque(strCheque,
false);
4266 otOut <<
"\n-------------------------------------------\n the "
4269 cout << strCheque <<
"\n";
4279 otOut <<
"Usage: writeinvoice --myacct <MY_ACCT_ID> --hisnym "
4280 "<HIS_NYM_ID>\nOptionally: --args \"memo \\\"one-line memo "
4281 "allowed here.\\\" amount AMOUNT\"\nAdditionally: --args "
4282 "\"validfor IN_SECONDS\" \nThis command WRITES but DOES NOT SEND "
4283 "the invoice. (Use sendinvoice for that.)\n";
4285 string strCheque =
"";
4286 int32_t nReturnVal = details_write_cheque(strCheque,
true);
4290 otOut <<
"\n-------------------------------------------\n the "
4293 cout << strCheque <<
"\n";
4304 otOut <<
"Usage: sendcash --[myacct|mypurse] <ID> --hisnym "
4305 "<RECIPIENT_NYM_ID>\nFor mypurse, the server and nym are also "
4306 "required: --server <SERVER_ID> --mynym <NYM_ID> \nOptionally: "
4307 "--args \"passwd true\" (To send a password-protected "
4308 "purse.)\nOptionally: --args \"memo \\\"one-line memo allowed "
4309 "here.\\\" amount AMOUNT\"\nThis command sends cash to the "
4310 "recipient, from your purse if specified, and withdrawing first "
4311 "from your account, if necessary.\n\n";
4313 string strServerID =
"";
4314 string strMyAcctID =
"";
4315 string strMyNymID =
"";
4316 string strAssetTypeID =
"";
4323 if (!bMyPurseExists && !bMyAcctExists) {
4324 otOut <<
"\n You must provide EITHER --myacct <ACCT_ID> OR --mypurse "
4325 "<ASSET_TYPE_ID>\nFor mypurse, the server and nym are also "
4326 "required: --server <SERVER_ID> --mynym <NYM_ID> \n";
4330 if (bMyPurseExists) {
4333 if (bServerExists && bMyNymExists) {
4338 otOut <<
"\n MyPurse was specified, but you must also specify a "
4339 "server and nym: --server <SERVER_ID> --mynym "
4340 "<NYM_ID>\nMaybe we can find them using MyAcct...\n";
4350 if (bMyAcctExists) {
4351 string strAcctAssetID =
4355 <<
"\n Failed trying to retrieve AssetTypeID based on MyAcct: "
4362 otOut <<
"\n Failed trying to retrieve ServerID based on MyAcct: "
4369 otOut <<
"\n Failed trying to retrieve NymID based on MyAcct: "
4375 otOut <<
"\n Server ID provided on the command line doesn't match "
4376 "the Server ID for MyAcct. Expected: " << strAcctServerID
4377 <<
"\n Try adding: --server " << strAcctServerID <<
"\n";
4382 strAcctAssetID != strAssetTypeID) {
4383 otOut <<
"\n Asset Type ID provided on the command line doesn't "
4384 "match the Asset Type ID of MyAcct. Expected: "
4385 << strAcctAssetID <<
"\n Try adding: --mypurse "
4386 << strAcctAssetID <<
"\n";
4391 otOut <<
"\n Nym ID provided on the command line doesn't match the "
4392 "Nym ID for MyAcct. Expected: " << strAcctNymID
4393 <<
"\n Try adding: --mynym " << strAcctNymID <<
"\n";
4397 strServerID = strAcctServerID;
4398 strAssetTypeID = strAcctAssetID;
4399 strMyNymID = strAcctNymID;
4413 otOut <<
"\n Failed: Missing Server ID. Try adding: --server "
4419 otOut <<
"\n Failed: Missing MyNym ID. Try adding: --mynym <NYM_ID>\n";
4446 <<
"\n Failed: Missing HisNym ID. Try adding: --hisnym <NYM_ID>\n";
4455 otOut <<
"\n Failed: Unknown HisNym ID: " <<
HisNym <<
"\n";
4459 string strAmount =
"0";
4460 string strMemo =
"";
4462 string strDefaultAmount =
"1";
4463 string strDefaultMemo =
"(blank memo field)";
4465 string strIndices =
"";
4466 bool bPasswordProtected =
false;
4480 strAmount = strNewAmount;
4483 strMemo = strNewMemo;
4486 (
"true" == strPasswordProtected)) {
4487 bPasswordProtected =
true;
4496 otOut <<
"Enter the amount[" << strDefaultAmount <<
"]: ";
4502 strAmount = strDefaultAmount;
4506 otOut <<
"Optionally, enter a memo on a single line[" << strDefaultMemo
4511 string strResponse =
"";
4513 int32_t nReturnVal = details_send_cash(
4514 strResponse, strServerID, strAssetTypeID, strMyNymID, strMyAcctID,
4515 HisNym, strMemo, strAmount, strIndices, bPasswordProtected);
4517 if (1 != nReturnVal) {
4518 otOut <<
"mainSendCash: Failed in details_send_cash.\n";
4522 otOut <<
"Success in sendcash! Server response:\n\n";
4523 cout << strResponse <<
"\n";
4524 otOut <<
"(Success in sendcash)\n";
4531 otOut <<
"Usage: sendcheque --myacct <MY_ACCT_ID> --hisnym "
4532 "<RECIPIENT_NYM_ID>\nOptionally: --args \"memo \\\"one-line memo "
4533 "allowed here.\\\" amount AMOUNT\"\nAdditionally: --args "
4534 "\"validfor IN_SECONDS\" \nThis command WRITES AND SENDS the "
4535 "cheque.\n(Use 'writecheque', not 'sendcheque', if you don't want "
4536 "it to be immediately SENT.)\n";
4538 string strCheque =
"";
4539 int32_t nReturnVal = details_write_cheque(strCheque,
false);
4543 otOut <<
"\n-------------------------------------------\n the "
4546 cout << strCheque <<
"\n";
4555 string strRecipientNymID =
4559 otOut <<
"Unable to retrieve a Server ID from this cheque! Very "
4560 "strange. (Failure.)\n";
4564 otOut <<
"Unable to retrieve a Sender Nym ID from this cheque! "
4565 "Very strange. (Failure.)\n";
4569 otOut <<
"Unable to retrieve a Recipient Nym ID from this cheque! "
4570 "Very strange. (Failure.)\n(Although it's fine to WRITE a "
4571 "cheque with no recipient, still need the ID to SEND "
4577 strServerID, strSenderNymID, strRecipientNymID, strCheque);
4580 if (1 != nReturnVal) {
4581 otOut <<
"sendcheque: Failed.\n";
4585 strResponse, strSenderNymID,
false,
false,
false,
false,
4590 otOut <<
"Success in sendcheque! Server response:\n\n";
4591 cout << strResponse <<
"\n";
4592 otOut <<
"(Success in sendcheque)\n";
4602 otOut <<
"Usage: sendinvoice --myacct <MY_ACCT_ID> --hisnym "
4603 "<RECIPIENT_NYM_ID>\nOptionally: --args \"memo \\\"one-line memo "
4604 "allowed here.\\\" amount AMOUNT\"\nAdditionally: --args "
4605 "\"validfor IN_SECONDS\" \nThis command WRITES AND SENDS the "
4606 "invoice. (Use 'writeinvoice', not 'sendinvoice',\nif you don't "
4607 "want it to be immediately SENT.)\n";
4609 string strCheque =
"";
4610 int32_t nReturnVal = details_write_cheque(strCheque,
true);
4614 otOut <<
"\n-------------------------------------------\n the "
4617 cout << strCheque <<
"\n";
4626 string strRecipientNymID =
4630 otOut <<
"Unable to retrieve a Server ID from this invoice! Very "
4631 "strange. (Failure.)\n";
4635 otOut <<
"Unable to retrieve a Sender Nym ID from this invoice! "
4636 "Very strange. (Failure.)\n";
4640 otOut <<
"Unable to retrieve a Recipient Nym ID (Endorsee) from "
4641 "this invoice! Very strange. (Failure.)\n(Although it's "
4642 "fine to WRITE a invoice with no endorsee, still need the "
4643 "ID to SEND it.)\n";
4648 strServerID, strSenderNymID, strRecipientNymID, strCheque);
4651 if (1 != nReturnVal) {
4652 otOut <<
"sendinvoice: Failed.\n";
4655 otOut <<
"Success in sendinvoice! Server response:\n\n";
4656 cout << strResponse <<
"\n";
4657 otOut <<
"(Success in sendinvoice)\n";
4667 const string& strMinIncrement,
4668 const string& strQuantity,
4669 const string& strPrice,
bool bSelling,
4670 const string& strLifespan)
4683 string strLocation =
"details_create_offer";
4689 (strMyNymID != strMyNymID2)) {
4690 otOut <<
"You must supply myacct as your asset account, and hisacct as "
4691 "your currency account.\n";
4692 otOut <<
"Also, both accounts must be owned by the same Nym (you.)\n\n";
4700 (strMyServerID != strMyServerID2)) {
4701 otOut <<
"Both accounts must be on the same server.\n";
4753 if (!offerListPtr) {
4754 otOut << strLocation <<
": Unable to load up a (nym) offerList from "
4755 "local storage. Probably doesn't exist.\n";
4762 int32_t nCount = offerList.GetOfferDataNymCount();
4766 if (
nullptr == map_of_maps) {
4767 otOut << strLocation <<
": Unable to convert offer list to map "
4768 "of offers. Perhaps it's empty?\n";
4790 if (-1 == nIterated) {
4791 otOut << strLocation
4792 <<
": Error trying to iterate nym's offers.\n";
4803 otOut << strLocation
4804 <<
": FYI, about to cancel at least one market "
4805 "offer, before placing the new one, due to price "
4806 "inconsistencies between the two...\n";
4809 for (
size_t i = 0; i < extra_vals.
the_vector.size(); i++) {
4812 <<
": Canceling market offer with transaction number: "
4823 otOut << strLocation <<
": FYI, there don't seem to be any "
4824 "existing offers for this nym, so I won't "
4825 "be erasing any older ones.\n";
4833 MyAcct,
HisAcct, strScale, strMinIncrement, strQuantity, strPrice,
4834 bSelling, strLifespan,
"",
"0");
4835 string strAttempt =
"create_market_offer";
4837 strMyServerID, strMyNymID,
MyAcct, strAttempt, strResponse);
4839 if (1 == nInterpretReply) {
4840 otOut <<
"Server response (" << strAttempt
4841 <<
"): SUCCESS placing market offer!\n\n";
4844 return nInterpretReply;
4849 otOut <<
"Usage: newoffer --myacct <YOUR_ASSET_ACCT> --hisacct "
4850 "<YOUR_CURRENCY_ACCT>\n\n Optional: --args \"type <bid|ask> scale "
4851 "1 quantity 100 price 101\"\n Optional: --args \"lifespan 86400\" "
4852 " (in seconds: 86400 is 1 day--the default.)\n\nWARNING: a price "
4853 "of 0 is a market order, which means 'purchase/sell at ANY "
4857 string strScale =
"0";
4858 string strMinIncrement =
"0";
4859 string strQuantity =
"0";
4860 string strPrice =
"0";
4861 string strType =
"";
4862 string strLifespan =
"0";
4864 string strDefaultScale =
"1";
4865 string strDefaultMinIncrement =
"1";
4866 string strDefaultQuantity =
"100";
4867 string strDefaultPrice =
"101";
4868 string strDefaultType =
"bid";
4869 string strDefaultLifespan =
"86400";
4886 strScale = strNewScale;
4889 strMinIncrement = strNewMinInc;
4892 strQuantity = strNewQuantity;
4895 strPrice = strNewPrice;
4898 strType = strNewType;
4901 strLifespan = strNewLifespan;
4908 otOut <<
"Enter the market scale (1, 10, 100, etc)["
4909 << strDefaultScale <<
"]: ";
4913 (std::stol(strMinIncrement) < 1)) {
4914 otOut <<
"Enter the minimum increment[" << strDefaultMinIncrement
4919 otOut <<
"Enter the quantity being purchased/sold["
4920 << strDefaultQuantity <<
"]: ";
4924 otOut <<
"Enter the price per scale[" << strDefaultPrice <<
"]: ";
4928 ((strType !=
"bid") && (strType !=
"ask"))) {
4929 otOut <<
"Enter the order type (bid/ask) [" << strDefaultType
4934 otOut <<
"(1 hour == 3600, 1 day == 86400)\n Enter the lifespan of "
4935 "the offer, in seconds[" << strDefaultLifespan <<
"]: ";
4940 strScale = strDefaultScale;
4943 (std::stol(strMinIncrement) < 1)) {
4944 strMinIncrement = strDefaultMinIncrement;
4947 strQuantity = strDefaultQuantity;
4950 strPrice = strDefaultPrice;
4953 ((strType !=
"bid") && (strType !=
"ask"))) {
4954 strType = strDefaultType;
4957 strLifespan = strDefaultLifespan;
4960 return details_create_offer(strScale, strMinIncrement, strQuantity,
4961 strPrice, strType !=
"bid", strLifespan);
4970 otOut <<
"Please enter the XML contents for the contract, followed by "
4971 "an EOF or a ~ by itself on a blank line:\n\n";
4975 string strContractID =
4980 otOut <<
"-------------------------------------------\nNew "
4981 "server ID: " << strContractID <<
"\n\n";
4983 string strContract =
4988 otOut <<
"-------------------------------------------\nNew "
4989 "server contract:\n\n";
4991 cout << strContract <<
"\n";
5007 otOut <<
"Please enter the XML contents for the contract, followed by "
5008 "an EOF or a ~ by itself on a blank line:\n\n";
5012 string strContractID =
5017 otOut <<
"-------------------------------------------\nNew "
5018 "asset ID: " << strContractID <<
"\n\n";
5020 string strContract =
5025 otOut <<
"-------------------------------------------\nNew "
5026 "asset contract:\n\n";
5028 cout << strContract <<
"\n";
5054 string strResponse =
5057 otOut <<
"\n\ncreate_asset_acct: Failed.\n\n";
5061 otOut <<
"Success in create_asset_acct! Server response:\n\n";
5062 cout << strResponse <<
"\n";
5063 otOut <<
"\n (Success in create_asset_acct)\n\n";
5079 otOut <<
"Please enter an already-signed contract you wish to add your "
5080 "signature to, followed by an EOF or a ~ by itself on a blank "
5084 otOut <<
"\n\n You entered:\n" << strInput <<
"\n\n";
5088 otOut <<
"-------------------------------------------\nSigned:\n\n";
5090 cout << strOutput <<
"\n";
5106 otOut <<
"Usage: signcontract \n Optionally, you may specify a contract "
5107 "type: signcontract --args \"type LEDGER\"\nIn that example, the "
5108 "output would start with the bookend: -----BEGIN OT SIGNED "
5109 "LEDGER-----\n(You don't need to specify the type if the bookend "
5110 "is already present on the input string.)\n\n";
5113 otOut <<
"Please enter a contract to be signed, followed by an EOF or "
5114 "a ~ by itself on a blank line:\n\n";
5117 otOut <<
"\n\n You entered:\n" << strInput <<
"\n\n";
5124 string strContractType;
5131 otOut <<
"A properly-formed-and-signed contract was not "
5132 "provided, but a 'type' was... so we'll try "
5133 "flatsigning the input text...\n\n";
5138 otOut <<
"A properly-formed-and-signed contract was not "
5139 "provided, and neither was a 'type' in order to form "
5140 "one. (Failure.)\n";
5145 int32_t nReturnVal = -1;
5149 otOut <<
"-------------------------------------------\nSigned:\n\n";
5151 cout << strOutput <<
"\n";
5156 otOut <<
"\nSorry, but OT was unable to sign. Oh well.";
5168 const string& strNymID,
5169 const string& strAcctID,
5170 const string& strTransNum)
5179 strServerID, strNymID, strAcctID, strTransNum);
5181 otOut <<
"\n\n killoffer: Failed.\n";
5184 strAcctID, strResponse)) {
5185 otOut <<
"\n\n killoffer: Balance agreement failed.\n";
5189 otOut <<
"\n\n killoffer: Balance agreement succeeded, but "
5190 "transaction failed.\n";
5193 otOut <<
"\n\nSuccess in killoffer! Server response:\n\n";
5194 cout << strResponse <<
"\n";
5206 otOut <<
"\n\n FYI, used for killing an active market offer.\nUSAGE: "
5207 "killoffer --args \"transnum <transaction_number>\"\n\n";
5219 otOut <<
"\n\n\nYou need to provide a transaction number...\n\n";
5231 otOut <<
"\n\n FYI, used for stopping an active payment plan.\nUSAGE: "
5232 "killplan --args \"transnum <transaction_number>\"\n\n";
5244 otOut <<
"\n\n\nYou need to provide a transaction number...\n\n";
5250 otOut <<
"\n\nkill_payment_plan: Failed.\n";
5254 otOut <<
"\n\nkill_payment_plan: Balance agreement failed.\n";
5258 otOut <<
"\n\nkill_payment_plan: Balance agreement succeeded, "
5259 "but transaction failed.\n";
5263 <<
"\n\nSuccess in kill_payment_plan! Server response:\n\n";
5264 cout << strResponse <<
"\n";
5277 otOut <<
"Please enter a contract you wish to verify with HisNym, "
5278 "followed by an EOF or a ~ by itself on a blank line:\n\n";
5281 otOut <<
"\n\n--------------------------------------\n You entered:\n"
5282 << strInput <<
"\n\n";
5285 cout <<
"\n\n *** Verified! ***\n\n\n";
5289 cout <<
"Failed!\n\n\n";
5298 cout <<
"------------------------------------------------------------------"
5300 cout <<
" ** NYMS: \n\n";
5304 for (int32_t i = 0; i < nNymCount; ++i) {
5309 cout << strIndex <<
": " << strID <<
" --- " << strName <<
"\n";
5317 cout <<
"------------------------------------------------------------------"
5319 cout <<
" ** SERVERS: \n\n";
5322 for (int32_t i = 0; i < nServerCount; ++i) {
5327 cout << strIndex <<
": " << strID <<
" --- " << strName <<
"\n";
5335 cout <<
"------------------------------------------------------------------"
5337 cout <<
" ** ASSET TYPES: \n\n";
5340 for (int32_t i = 0; i < nAssetTypeCount; ++i) {
5344 cout << strID <<
" --- " << strName <<
"\n";
5352 cout <<
"------------------------------------------------------------------"
5354 cout <<
" ** ACCOUNTS: \n\n";
5358 for (int32_t i = 0; i < nAccountCount; ++i) {
5359 if ((i > 0) && (i != (nAccountCount))) {
5360 cout <<
"-------------------------------------\n";
5366 cout << strStatAcct <<
"\n";
5369 cout <<
"Error trying to stat an asset account: " << strID <<
"\n";
5374 cout <<
"------------------------------------------------------------------"
5395 otOut <<
"\n\n-------------------------------------------------------------"
5401 int32_t nSuccess = (bSuccess ? 1 : -1);
5404 cout << strStatAcct <<
"\n";
5407 cout <<
"Error trying to stat an asset account: " << strID <<
"\n\n";
5418 return details_stat_account(
MyAcct);
5427 otOut <<
"\ndetails_account_balance: Cannot find account wallet for: "
5434 otOut <<
"\ndetails_account_balance: Cannot cannot determine asset "
5435 "type for: " << strID <<
"\n";
5441 otOut <<
"\n Balance: ";
5443 otOut << strID <<
" (" << strName <<
")\n\n";
5451 return details_account_balance(
MyAcct);
5463 cout << strStats <<
"\n";
5470 return details_nym_stat(
MyNym);
5483 otOut <<
"\n\n load_or_retrieve_mint: Failed.\n\n";
5488 cout << strMint <<
"\n";
5505 const string& strSourceForNymID,
5506 const string& strAltLocation)
5512 otOut <<
"details_create_nym: Failed in "
5513 "OT_ME::create_nym(keybits == " << nKeybits <<
")\n";
5516 otOut <<
"Success creating! " << nKeybits <<
" keybits, new ID: ";
5517 cout << strNymID <<
"\n";
5522 otOut <<
"Failed in OT_API_SetNym_Name(name == " << strName <<
")\n";
5526 otOut <<
"Success setting name to: " << strName <<
"\n\n";
5532 otOut <<
"Usage: newnym --args \"keybits 1024 name \\\"Bob's New "
5533 "Nym\\\"\" \nOptional: newnym --args \"source "
5534 "\\\"http://test.com/credential_IDs\\\" \" \nFYI, a source can "
5535 "be a URL, a Bitcoin address, a Namecoin address, a public "
5536 "key,\nor the unique DN info from a traditionally-issued cert. "
5537 "Hashing the source should\n produce the NymID. Also, the source "
5538 "should always (somehow) validate the\ncredential IDs, if they "
5539 "are to be trusted for their purported Nym.\nAnother optional "
5540 "parameter is 'altlocation' which, in the case of DN info as a "
5541 "source, would be the \ndownload location where a Cert should be "
5542 "found with that DN info, or a PKI where the Cert can be "
5543 "found.\n\nNOTE: If you leave the source BLANK, then OT will just "
5544 "generate a public key to serve as the source. The\npublic key "
5545 "will be hashed to form the NymID, and all credentials for that "
5546 "Nym will need to be signed by\nthe corresponding private key. "
5547 "That's the only way they can be 'verified by their source.'\n\n";
5549 int32_t nKeybits = 1024;
5550 string strName =
"New Nym";
5551 string strSourceForNymID =
"";
5552 string strAltLocation =
"";
5561 nKeybits = std::stol(strKeybits);
5565 strName = strNewName;
5569 strSourceForNymID = strNewSource;
5573 strAltLocation = strNewLocation;
5577 return details_create_nym(nKeybits, strName, strSourceForNymID,
5641 const string& strIndices)
5648 <<
"Failure: Unable to find NymID based on the specified account ( "
5649 << strMyAcctID <<
" ).\n";
5653 otOut <<
"Try again: MyNym is specified, but it's not the owner of the "
5654 "specified account ( " << strMyAcctID <<
" ).\n";
5655 otOut <<
"To override with the nym for this account, add: --mynym "
5656 << strMyNymID <<
" \n\n";
5662 otOut <<
"Failure: Unable to find Server ID based on the specified "
5663 "account ( " << strMyAcctID <<
" ).\n";
5667 otOut <<
"Try again: Server is specified, but it's not the server for "
5668 "the specified account ( " << strMyAcctID <<
" ).\n";
5669 otOut <<
"To override with the server for this account, add: --server "
5670 << strServerID <<
" \n\n";
5684 otOut <<
"Unable to download necessary intermediary files for this "
5685 "inbox/account. (Failure.)\n";
5712 otOut <<
"\n\n OT_API_LoadInbox: Failed.\n\n";
5719 strMyAcctID, strInbox);
5729 string strResponseLEDGER =
"";
5735 for (int32_t nIndex = 0; nIndex < nCount; ++nIndex) {
5737 strServerID, strMyNymID, strMyAcctID, strInbox, nIndex);
5746 strServerID, strMyNymID, strMyAcctID, strTrans);
5749 if (
"pending" == strTransType && 1 != nItemType) {
5755 if (
"pending" != strTransType && 2 != nItemType) {
5766 if ((nIndicesCount > 0) &&
5781 strServerID, strMyNymID, strMyAcctID, strInbox);
5784 otOut <<
"\n\nFailure: "
5785 "OT_API_Ledger_CreateResponse "
5786 "returned nullptr.\n";
5795 string strNEW_ResponseLEDGER =
5797 strServerID, strMyNymID, strMyAcctID, strResponseLEDGER,
5801 otOut <<
"\n\nFailure: "
5802 "OT_API_Transaction_CreateResponse "
5803 "returned nullptr.\n";
5806 strResponseLEDGER = strNEW_ResponseLEDGER;
5825 strServerID, strMyNymID, strMyAcctID, strResponseLEDGER);
5828 otOut <<
"\n\nFailure: OT_API_Ledger_FinalizeResponse returned "
5834 strServerID, strMyNymID, strMyAcctID, strFinalizedResponse);
5835 string strAttempt =
"process_inbox";
5838 strServerID, strMyNymID, strMyAcctID, strAttempt, strResponse);
5840 if (1 == nInterpretReply) {
5842 strServerID, strMyNymID, strMyAcctID,
true);
5844 otOut <<
"\n\nServer response (" << strAttempt
5845 <<
"): SUCCESS processing/accepting inbox.\n";
5846 otOut << (bRetrieved ?
"Success" :
"Failed")
5847 <<
" retrieving intermediary files for account.\n";
5851 return nInterpretReply;
5854 otOut <<
"The asset account inbox is empty.\n\n";
5862 otOut <<
"Usage: acceptreceipts --myacct FOR_ACCT --args \"indices "
5863 "3,6,8\" \n (Sample indices are shown.)\nIf indices are not "
5864 "specified for myacct's inbox, then OT will\naccept ALL receipts "
5865 "(but no pending transfers) in that box.\n\n";
5868 string strIndices =
"";
5874 return accept_inbox_items(
MyAcct, 2, strIndices);
5882 otOut <<
"Usage: acceptinbox --myacct FOR_ACCT --args \"indices 3,6,8\" "
5883 "\n (Sample indices are shown.)\nIf indices are not specified for "
5884 "myacct's inbox, then OT will\naccept ALL transfers and receipts "
5888 string strIndices =
"";
5894 return accept_inbox_items(
MyAcct, 0, strIndices);
5902 otOut <<
"Usage: accepttransfers --myacct FOR_ACCT --args \"indices "
5903 "3,6,8\" \n (Sample indices are shown.)\nIf indices are not "
5904 "specified for myacct's inbox, then OT will\naccept ALL transfers "
5905 "(but no receipts) in that box.\n\n";
5908 string strIndices =
"";
5914 return accept_inbox_items(
MyAcct, 1, strIndices);
5924 otOut <<
"Usage: acceptmoney --myacct INTO_ACCT\n";
5927 string strIndices =
"";
5929 int32_t nAcceptedTransfers = accept_inbox_items(
MyAcct, 1, strIndices);
5931 int32_t nAcceptedPurses =
5932 accept_from_paymentbox(
MyAcct, strIndices,
"PURSE");
5934 int32_t nAcceptedCheques =
5935 accept_from_paymentbox(
MyAcct, strIndices,
"CHEQUE");
5938 if (nAcceptedTransfers >= 0 || nAcceptedPurses >= 0 ||
5939 nAcceptedCheques >= 0) {
5951 otOut <<
"Usage: acceptall --myacct INTO_ACCT\n";
5954 string strIndices =
"";
5957 int32_t nAcceptedInbox = accept_inbox_items(
MyAcct, 0, strIndices);
5961 int32_t nAcceptedPurses =
5962 accept_from_paymentbox(
MyAcct, strIndices,
"PURSE");
5964 int32_t nAcceptedCheques =
5965 accept_from_paymentbox(
MyAcct, strIndices,
"CHEQUE");
5969 int32_t nAcceptedInvoices =
5970 accept_from_paymentbox(
MyAcct, strIndices,
"INVOICE");
5972 if (nAcceptedInbox >= 0 && nAcceptedPurses >= 0 &&
5973 nAcceptedCheques >= 0 && nAcceptedInvoices >= 0) {
5985 const string& strMyNymID,
5986 const string& strHisNymID)
5991 string strServerParam = strServerID;
5992 string strMyNymParam = strMyNymID;
5993 string strHisNymParam = strHisNymID;
6010 string strServerFromPartial =
6014 strServerParam = strServerFromPartial;
6017 string strHisNymFromPartial =
6021 strHisNymParam = strHisNymFromPartial;
6024 string strMyNymFromPartial =
6028 strMyNymParam = strMyNymFromPartial;
6035 otOut <<
"\n details_check_user: Bad input... strServerID, strMyNymID, "
6036 "or strHisNymID \n";
6044 otOut <<
"Usage: checknym --mynym MY_NYM_ID --hisnym HIS_NYM_ID \n "
6045 "Downloads the public key for HisNym.\n\n";
6055 otOut <<
"\n\nSuccess in checknym! Server response:\n\n";
6056 cout << strResponse <<
"\n";
6061 otOut <<
"\n\n checknym: Failed.\n\n";
6072 otOut <<
"Failure: Unable to find NymID based on myacct. Use: --myacct "
6074 otOut <<
"The designated asset account must be yours. OT will find the "
6075 "Nym based on the account.\n\n";
6082 otOut <<
"\n\n" << (bRetrieved ?
"Success" :
"Failed")
6083 <<
" retrieving intermediary files for account: " <<
MyAcct <<
"\n\n";
6085 return bRetrieved ? 1 : -1;
6090 otOut <<
"Usage: refreshaccount --server SERVER_ID --myacct "
6094 return download_acct_files();
6102 otOut <<
"Usage: refresh --server SERVER_ID --mynym YOUR_NYM_ID --myacct "
6109 if (-1 == nSuccess) {
6121 const string& strNymID,
6122 const string& strContractID)
6124 string strRetrieved =
6128 string strSuccess =
"Error";
6130 if (1 == nRetrieved) {
6131 strSuccess =
"Success";
6133 else if (0 == nRetrieved) {
6134 strSuccess =
"Failed";
6137 otOut <<
"\n\n " << strSuccess <<
" retrieving contract: " << strContractID
6140 return (1 == nRetrieved) ? 1 : -1;
6145 otOut <<
"Usage: getcontract --server SERVER_ID --mynym YOUR_NYM_ID \n "
6146 " --args \"contract_id CONTRACT_ID_HERE\"\n\n";
6148 string strContractID =
"";
6160 strContractID = strNewContractID;
6163 otOut <<
"\n\nMissing --args \"contract_id "
6164 "CONTRACT_ID_HERE\"\n\n";
6168 return details_download_contract(
Server,
MyNym, strContractID);
6186 otOut <<
"Failure: Unable to find NymID based on myacct. Use: "
6187 "--myacct ACCT_ID\n";
6188 otOut <<
"The designated asset account must be yours. OT will find "
6189 "the Nym based on the account.\n\n";
6196 otOut <<
"\n\n OT_API_VerifyAccountReceipt: Failed. Try using "
6197 "refreshaccount and then try verifying again.\n\n";
6201 otOut <<
"\n\nVerify receipt: success!\n\n";
6211 otOut <<
"Usage: registernym --server SERVER_ID --mynym NYM_ID\n\n(If "
6212 "you don't have a NymID, then use create_nym.ot first.)\n\n";
6219 otOut <<
"\n\n Server response:\n\n";
6220 cout << strResponse <<
"\n";
6221 otOut <<
"\n\n SUCCESS in register_nym!\n(Also, success "
6222 "syncronizing the request number.)\n\n";
6225 otOut <<
"\n\n FAILURE in register_nym! Server response:\n\n";
6226 cout << strResponse <<
"\n";
6229 otOut <<
"\n\nError in register_nym!\n";
6232 otOut <<
"Server response:\n\n";
6233 cout << strResponse <<
"\n";
6246 const string& strMyNymID,
6247 bool bForceDownload)
6249 bool bWasMsgSent =
false;
6251 strServerID, strMyNymID, bWasMsgSent, bForceDownload);
6252 bool bReturnVal =
false;
6254 switch (nGetAndProcessNymbox) {
6256 otOut <<
"\n\n SUCCESS in refresh nym!\n";
6261 otOut <<
"\n\n FAILURE in refresh nym!\n";
6264 otOut <<
"\n\n Success in refresh nym! (Skipped processing Nymbox, "
6265 "since it's empty.)\n";
6270 otOut <<
"\n\nError in refresh nym! nGetAndProcessNymbox: "
6271 << nGetAndProcessNymbox <<
"\n";
6280 otOut <<
"Usage: refreshnym --server SERVER_ID --mynym NYM_ID\n\n(If you "
6281 "don't have a NymID, then use the newnym command first.)\n\n";
6284 bool bReturnVal = details_refresh_nym(
Server,
MyNym,
true);
6301 string strMyNymID =
MyNym;
6304 if (0 == nBoxType) {
6309 otOut <<
"Failure: Unable to find MyAcct. Use: --myacct ACCT_ID\n";
6310 otOut <<
"The designated asset account must be yours. OT will find "
6311 "the Nym based on the account.\n\n";
6324 otOut <<
"Failure: Unable to find NymID based on myacct. Use: "
6325 "--myacct ACCT_ID\n";
6326 otOut <<
"The designated asset account must be yours. OT will "
6327 "find the Nym based on the account.\n\n";
6331 if (strMyNymID !=
MyNym) {
6332 otOut <<
"Failure: Found a NymID based on myacct, but MyNym is "
6333 "not the same ID.\n";
6334 otOut <<
"To avoid any confusion, please be explicit with Nym "
6335 "ID: --mynym NYM_ID \n\n";
6342 strAcctID, nBoxType, strID);
6345 if (1 != nInterpretReply) {
6346 otOut <<
"get_box_receipt: Failed. nInterpretReply is: "
6347 << nInterpretReply <<
"\n";
6348 otOut <<
"get_box_receipt: Perhaps that receipt is no longer in the "
6352 otOut <<
"Success in get_box_receipt! Server response:\n\n";
6353 cout << strResponse <<
"\n";
6357 return nInterpretReply;
6362 otOut <<
"Usage: getreceipt --server SERVER_ID --mynym NYM_ID\n\nAlso: "
6363 " --args \"box_type BOX_TYPE_ID_HERE id "
6364 "TRANSACTION_ID_HERE\"\nBox types are 0 (Nymbox), 1 (Inbox), 2 "
6383 otOut <<
"\n\nMissing --args \"id TRANSACTION_ID_HERE\"\n\n";
6386 int32_t nBoxType = 1;
6388 nBoxType = std::stol(strNewType);
6391 if (nBoxType < 0 || nBoxType > 2) {
6392 otOut <<
"\n\n box_type cannot be <0 or >2. Try: --args "
6393 "\"box_type 1\"\nBox types are 0 (Nymbox), 1 (Inbox), "
6399 if ((nBoxType != 0) && !
VerifyExists(
"MyAcct",
false)) {
6400 otOut <<
"\n\n For inbox (1) or outbox (2) box types, need an "
6401 "account ID.\nMissing: --myacct ACCT_ID_HERE \n\n";
6405 return details_download_box_receipt(strID, nBoxType);
6423 otOut <<
"Failure: Unable to find NymID based on myacct. Use: --myacct "
6425 otOut <<
"The designated asset account must be yours. OT will find the "
6426 "Nym based on the account.\n\n";
6430 string strAssetTypeID =
6433 otOut <<
"Failure: Unable to find Asset Type ID based on myacct. Use: "
6434 "--myacct ACCT_ID\n";
6435 otOut <<
"The designated asset account must be yours. OT will find the "
6436 "asset type based on the account.\n\n";
6442 otOut <<
"Unable to find the server ID based on the account. Strange! "
6443 "Perhaps specify a different account? Use: --myacct ACCT_ID "
6449 otOut <<
"This account is on server ( " << strServerID
6450 <<
" -- the server is deduced based on the account), but the "
6451 "default server is ( " <<
Server
6452 <<
" ). To override it, use: --server " << strServerID <<
" \n";
6459 strServerID, strMyNymID, strAssetTypeID);
6462 otOut <<
"details_withdraw_cash: Unable to retrieve contract for "
6464 otOut <<
" Server ID: " << strServerID <<
"\n";
6465 otOut <<
" Asset ID: " << strAssetTypeID <<
"\n";
6471 otOut <<
"Failure: Unable to load Asset contract even after "
6482 otOut <<
"Failure: Unable to load or retrieve necessary mint file for "
6490 string strResponse =
6492 string strAttempt =
"withdraw_cash";
6495 strServerID, strMyNymID, strMyAcctID, strAttempt, strResponse);
6497 if (1 == nInterpretReply) {
6499 strMyAcctID,
false);
6501 otOut <<
"\n\nServer response (" << strAttempt
6502 <<
"): SUCCESS withdrawing cash! (From account on server to "
6504 otOut << (bRetrieved ?
"Success" :
"Failed")
6505 <<
" retrieving intermediary files for account.\n";
6508 return nInterpretReply;
6516 otOut <<
"Usage: withdraw --myacct YOUR_ASSET_ACCT \nYou can provide an "
6517 "amount: --args \"amount PUT_AMOUNT_HERE\"\n\n";
6521 string strAssetTypeID =
6527 string strAmount =
"0";
6529 string strDefaultAmount =
"1";
6539 strAmount = strNewAmount;
6547 otOut <<
"Enter the amount[" << strDefaultAmount <<
"]: ";
6553 strAmount = strDefaultAmount;
6558 return details_withdraw_cash(
MyAcct, lAmount);
6579 otOut <<
"\n\nFailure: Unable to find NymID based on myacct. Use: "
6580 "--myacct ACCT_ID\nThe designated asset account must be "
6581 "yours. OT will find the Nym based on the account.\n\n";
6587 otOut <<
"\n\nFailure: Unable to find the server ID based on myacct. "
6588 "Use: --myacct ACCT_ID\nThe designated asset account must be "
6589 "yours. OT will find the server ID based on the account.\n\n";
6593 string strRecipientPubkey =
6596 otOut <<
"\n\nFailure: Unable to load or download pubkey for HisNym "
6597 "based on given value (" <<
HisNym
6598 <<
"). To override, use: --hisnym HIS_NYM_ID\n\n";
6602 string strAmount =
"0";
6603 string strMemo =
"";
6605 string strDefaultAmount =
"1";
6606 string strDefaultMemo =
"(blank memo field)";
6619 strAmount = strNewAmount;
6622 strMemo = strNewMemo;
6630 otOut <<
"Enter the amount[" << strDefaultAmount <<
"]: ";
6634 otOut <<
"Optionally, enter a memo on a single line[" << strDefaultMemo
6641 strAmount = strDefaultAmount;
6644 strMemo = strDefaultMemo;
6649 strServerID, strMyNymID,
MyAcct,
HisNym, strMemo, lAmount);
6650 string strAttempt =
"withdraw_voucher";
6653 strServerID, strMyNymID,
MyAcct, strAttempt, strResponse);
6655 if (1 == nInterpretReply) {
6660 otOut <<
"\n\n details_withdraw_voucher: Error: strLedger is null, "
6661 "returned by OT_API_Message_GetLedger.\n";
6666 strServerID, strMyNymID,
MyAcct, strLedger, 0);
6669 otOut <<
"details_withdraw_voucher: Error: strTransReply is "
6670 "unexpectedly null, returned by "
6671 "OT_API_Ledger_GetTransactionByIndex, argument passed, "
6672 "index 0 and ledger:\n\n" << strLedger <<
"\n\n";
6680 otOut <<
"details_withdraw_voucher: Error: Voucher is unexpectedly "
6681 "null, returned by OT_API_Transaction_GetVoucher with "
6682 "strTransReply set to:\n\n" << strTransReply <<
"\n\n";
6702 otOut << (bRetrieved ?
"Success" :
"Failed")
6703 <<
" retrieving intermediary files for account.\n";
6705 otOut <<
"details_withdraw_voucher: Voucher returned by "
6706 "OT_API_Transaction_GetVoucher:\n\n";
6707 cout << strOutput <<
"\n";
6710 otOut <<
"\n\nServer response (" << strAttempt
6711 <<
"): SUCCESS withdrawing voucher (cashier's cheque)!\n";
6716 return nInterpretReply;
6724 otOut <<
"Usage: withdrawvoucher --myacct YOUR_ASSET_ACCT --hisnym "
6725 "RECIPIENT_NYM_ID\n\nAlso NECESSARY: --args \"amount "
6726 "PUT_AMOUNT_HERE\"\nAnd OPTIONALLY: --args \"memo \\\"Just a memo "
6727 "for the voucher cheque.\\\"\"\n\n";
6730 string strVoucher =
"";
6731 return details_withdraw_voucher(strVoucher);
6739 otOut <<
"Usage: sendvoucher --myacct MY_ASSET_ACCT --hisnym "
6740 "RECIPIENT_NYM_ID\nOptionally: --args \"memo \\\"one-line memo "
6741 "allowed here.\\\" amount AMOUNT\"\nServer is deduced from "
6742 "MyAcct. This command withdraws AND SENDS the\nvoucher. (Use "
6743 "'withdrawvoucher', not 'sendvoucher', if you don't want it to be "
6744 "immediately SENT.)\n";
6747 string strCheque =
"";
6748 int32_t nReturnVal = details_withdraw_voucher(strCheque);
6752 otOut <<
"\n-------------------------------------------\n the "
6755 cout << strCheque <<
"\n";
6764 otOut <<
"Unable to retrieve a Server ID from this voucher! "
6765 "Very strange. (Failure.)\n";
6771 otOut <<
"Unable to retrieve a Sender Nym ID from this "
6772 "voucher! Very strange. (Failure.)\n";
6776 string strRecipientNymID =
6779 otOut <<
"Unable to retrieve a Recipient Nym ID from this "
6780 "voucher! Very strange. (Failure.)\n(Although it's "
6781 "fine to WITHDRAW a voucher with no recipient, still "
6782 "need the recipient ID to SEND one.)\n";
6787 strServerID, strSenderNymID, strRecipientNymID, strCheque);
6789 if (1 == nReturnVal) {
6790 otOut <<
"Success in sendvoucher! Server response:\n\n";
6791 cout << strResponse <<
"\n";
6792 otOut <<
"(Success in sendvoucher)\n";
6796 otOut <<
"sendvoucher: Failed.\n";
6806 const string& serverID)
6808 if (!
OTDB::Exists(
"markets", serverID,
"market_data.bin",
"")) {
6809 otOut <<
"The market list file doesn't exist.\n";
6813 otWarn <<
"Markets file exists...Querying list of markets...\n";
6817 "market_data.bin",
"");
6818 if (
nullptr == storable) {
6819 otOut <<
"Failed to verify storable object. Probably doesn't exist.\n";
6823 otWarn <<
"QueryObject worked. Now dynamic casting from storable to "
6827 if (
nullptr == marketList) {
6828 otOut <<
"Unable to dynamic cast a storable to a marketlist.\n";
6843 if (!marketListPtr) {
6844 otOut <<
"Unable to load up marketlist from local storage.\n";
6851 int32_t nCount = marketList.GetMarketDataCount();
6853 otOut <<
"Loaded the market list, but GetMarketDataCount returns "
6854 "an invalid result. (Failure.)\n";
6856 else if (nCount <= 0) {
6857 otOut <<
"Loaded the market list, but GetMarketDataCount says "
6858 "there aren't any markets in the list. (Returning.)\n";
6861 otOut <<
"\nIndex\tScale\tMarket\t\t\t\t\t\tAsset\t\t\t\t\t\tCurren"
6864 for (int32_t nIndex = 0; nIndex < nCount; ++nIndex) {
6866 marketList.GetMarketData(nIndex);
6867 if (!marketDataPtr) {
6868 otOut <<
"Unable to reference marketData on marketList, at "
6869 "index: " << nIndex <<
"\n";
6875 cout << nIndex <<
"\t" << marketData.
scale <<
"\tM "
6891 <<
"Usage: getmarketlist --server SERVER_ID --mynym YOUR_NYM_ID\n\n";
6896 string strAttempt =
"get_market_list";
6898 if (1 == nInterpretReply) {
6899 otOut <<
"Server response (" << strAttempt
6900 <<
"): SUCCESS getting market list.\n\n";
6905 return nInterpretReply;
6912 const string& serverID,
const string& marketID)
6916 if (
OTDB::Exists(
"markets", serverID,
"offers", marketID +
".bin")) {
6917 otWarn <<
"Offers file exists... Querying file for market offers...\n";
6920 serverID,
"offers", marketID +
".bin");
6922 if (
nullptr == storable) {
6923 otOut <<
"Unable to verify storable object. Probably doesn't "
6928 otWarn <<
"QueryObject worked. Now dynamic casting from storable to a "
6929 "(market) offerList...\n";
6932 if (
nullptr == offerList) {
6933 otOut <<
"Unable to dynamic cast a storable to a (market) "
6944 const string& strMarketID)
6947 loadMarketOffers(strServerID, strMarketID);
6949 if (!offerListPtr) {
6950 otOut <<
"Unable to load up a (market) offerList from local storage.\n";
6956 int32_t nBidCount = offerList.GetBidDataCount();
6957 int32_t nTemp = nBidCount;
6959 if (nBidCount > 0) {
6960 otOut <<
"\n** BIDS **\n\nIndex\tTrans#\tPrice\tAvailable\n";
6962 for (int32_t nIndex = 0; nIndex < nBidCount; ++nIndex) {
6964 if (!offerDataPtr) {
6965 otOut <<
"Unable to reference bidData on offerList, at index: "
6979 int32_t nAskCount = offerList.GetAskDataCount();
6981 if (nAskCount > 0) {
6982 otOut <<
"\n** ASKS **\n\nIndex\tTrans#\tPrice\tAvailable\n";
6984 for (int32_t nIndex = 0; nIndex < nAskCount; ++nIndex) {
6988 if (!offerDataPtr) {
6989 otOut <<
"Unable to reference askData on offerList, at index: "
7007 otOut <<
"Usage: showoffers --server SERVER_ID --mynym "
7008 "YOUR_NYM_ID\nAlso: --args \"market MARKET_ID\"\n";
7020 strMarket = strNewMarket;
7029 otOut <<
"\nEnter the market ID: ";
7037 return details_show_market_offers(
Server, strMarket);
7047 return impl_show_market_offers(strMarket);
7052 otOut <<
"Usage: getoffers --server SERVER_ID --mynym YOUR_NYM_ID\nAlso: "
7053 "--args \"market MARKET_ID depth MAX_DEPTH\"\n";
7056 string strMarket =
"";
7057 string strDepth =
"";
7059 string strDefaultDepth =
"50";
7070 strMarket = strNewMarket;
7073 strDepth = strNewDepth;
7082 otOut <<
"\nEnter the market ID: ";
7086 otOut <<
"Optionally, enter a max depth on a single line["
7087 << strDepth <<
"]: ";
7095 strDepth = strDefaultDepth;
7098 int64_t lDepth = std::stoll(strDepth);
7099 string strResponse =
7101 string strAttempt =
"get_market_offers";
7104 if (1 == nInterpretReply) {
7105 otOut <<
"Server response (" << strAttempt
7106 <<
"): SUCCESS getting market offers.\n\n";
7108 impl_show_market_offers(strMarket);
7111 return nInterpretReply;
7120 otOut <<
"\n\n Options: --server SERVER_ID --mynym NYM_ID\n "
7121 "--hisnym SUBJECT_NYM_ID\n\nTo adjust (change) a Nym's usage "
7122 "credits: --args \"adjust POSITIVE_OR_NEGATIVE_VALUE\" \n (Used "
7123 "for giving or taking away usage credits.)\nFor example, --args "
7124 "\"adjust 10000\" or: --args \"adjust -100\" \n\nFYI, this "
7125 "command also retrieves the current usage credits,\nand any Nym "
7126 "can use it on himself, read-only.\n\n";
7130 string strAdjustment =
"0";
7136 strAdjustment = strNewAdjust;
7145 otOut <<
"\n\n Server response:\n\n";
7146 cout << strResponse <<
"\n";
7158 int64_t lNewUsageBalance =
7160 string strNewUsageBalance =
7164 strNewUsageBalance =
"(Error while calling API to retrieve "
7165 "usage credits from server reply.)";
7167 else if (int64_t(-2) == lNewUsageBalance) {
7168 strNewUsageBalance =
"Error code -2, while attempting to "
7169 "retrieve usage credits from this server "
7172 else if (int64_t(-1) == lNewUsageBalance) {
7173 strNewUsageBalance =
"Either Nym has unlimited usage credits, "
7174 "or server has its usage credit "
7175 "enforcement turned off.\n(Either way, "
7176 "Nym is good to go, since -1 was returned "
7177 "as his 'credits balance'.)";
7179 else if (int64_t(0) == lNewUsageBalance) {
7180 strNewUsageBalance =
"Nym appears to have exhausted his supply "
7181 "of usage credits.\n(0 was returned as "
7182 "his 'credits balance'.)";
7185 strNewUsageBalance =
"Nym currently has " +
7190 otOut <<
"\n\n adjust_usage_credits -- reply: " +
7191 strNewUsageBalance +
7192 "\n\n(FYI, this server message is the only and proper "
7193 "way to query for your own current usage credits "
7194 "balance, or also to set someone else's.)\n\n";
7199 otOut <<
"\n\nServer response:\n\n";
7200 cout << strResponse <<
"\n";
7201 otOut <<
"\n\n FAILURE in adjust_usage_credits!\n\n";
7205 otOut <<
"Server response:\n\n";
7206 cout << strResponse <<
"\n";
7208 otOut <<
"\n\nError in adjust_usage_credits! nStatus is: "
7215 return (0 == nStatus) ? -1 : nStatus;
7223 const string& strNymID)
7225 string strLocation =
"details_show_nym_offers";
7229 if (!offerListPtr) {
7230 otOut << strLocation <<
": Unable to load up a (nym) offerList from "
7231 "local storage. Probably doesn't exist.\n";
7240 int32_t nCount = offerList.GetOfferDataNymCount();
7244 if (!map_of_mapsPtr) {
7245 otOut << strLocation <<
": Unable to convert offer list to map of "
7246 "offers. Perhaps it's empty?\n";
7249 MapOfMaps& map_of_maps = *map_of_mapsPtr;
7262 if (-1 == nIterated) {
7263 otOut << strLocation <<
": Error trying to iterate nym's offers.\n";
7273 otOut <<
"Usage: showmyoffers --server SERVER_ID --mynym YOUR_NYM_ID\n\n";
7284 const string& strNymID)
7298 otOut <<
"Usage: getmyoffers --server SERVER_ID --mynym YOUR_NYM_ID\n";
7302 string strResponse = details_get_nym_market_offers(
Server,
MyNym);
7303 string strAttempt =
"get_nym_market_offers";
7305 if (1 == nInterpretReply) {
7306 otOut <<
"Server response (" << strAttempt
7307 <<
"): SUCCESS getting nym's market offers.\n\n";
7312 return nInterpretReply;
7329 const string& strMemo)
7333 otOut <<
"\n\nFailure: Unable to find Payer NymID based on myacct. "
7334 "Use: --myacct DIVIDEND_SOURCE_ACCT_ID\n";
7335 otOut <<
"The designated asset account (that the dividends will be "
7336 "paid out of) must be yours. OT will find the Nym based on "
7337 "that account.\n\n";
7348 otOut <<
"Enter the SHARES asset type ID (Nym must also be the "
7349 "issuer for these shares): ";
7354 strHisPartialPurseID);
7357 otOut <<
"\n\nFailure: Unable to find SHARES_ASSET_TYPE_ID "
7358 "in your wallet. Use: --hispurse "
7359 "SHARES_ASSET_TYPE_ID\n";
7371 strHisPurse, strMemo, lAmount);
7372 string strAttempt =
"pay_dividend";
7377 if (1 == nInterpretReply) {
7380 otOut << (bRetrieved ?
"Success" :
"Failed")
7381 <<
" retrieving intermediary files for account.\n";
7383 otOut <<
"\n\nServer response (" << strAttempt
7384 <<
"): SUCCESS paying out dividends.\n";
7387 return nInterpretReply;
7395 otOut <<
"Usage: paydividend --server SERVER_ID --mynym "
7396 "SHARES_ISSUER_NYM_ID\n --myacct "
7397 "DIVIDEND_SOURCE_ACCT_ID --hispurse SHARES_ASSET_TYPE_ID\n\nAlso "
7398 "necessary: --args \"amount PAYOUT_AMOUNT_PER_SHARE\"\nAnd "
7399 "OPTIONALLY: --args \"memo \\\"Just a memo for the dividend "
7400 "payment.\\\"\"\n\n";
7403 string strAmount =
"0";
7404 string strNote =
"";
7406 string strDefaultAmount =
"1";
7407 string strDefaultNote =
"(blank memo field)";
7418 strAmount = strNewAmount;
7421 strNote = strNewNote;
7425 string strAssetTypeID =
7432 otOut <<
"Enter the 'Payout Amount Per-Share'[" << strDefaultAmount
7437 otOut <<
"Optionally, enter a memo on a single line["
7438 << strDefaultNote <<
"]: ";
7444 strAmount = strDefaultAmount;
7447 strNote = strDefaultNote;
7450 return details_pay_dividend(strAmount, strNote);
7458 otOut <<
"Usage: showpurse --mypurse ASSET_TYPE_ID --mynym YOUR_NYM_ID "
7459 "--server SERVER_ID \n\n";
7467 otOut <<
"\n OT_Command::mainShowPurse: Unable to load purse. Does "
7474 cout <<
"\n\nTOTAL VALUE: "
7480 otOut <<
"\n OT_Command::mainShowPurse: Error: Unexpected bad "
7481 "value returned from OT_API_Purse_Count.\n\n";
7486 cout <<
"Token count: " << nCount <<
"\n\n";
7487 cout <<
"Index\tValue\tSeries\tValidFrom\tValidTo\t\tStatus\n";
7489 int32_t nIndex = -1;
7491 while (nCount > 0) {
7499 otOut <<
"mainShowPurse: Error: OT_API_Purse_Peek "
7500 "unexpectedly returned nullptr instead of "
7505 string strNewPurse =
7509 otOut <<
"mainShowPurse: Error: OT_API_Purse_Pop "
7510 "unexpectedly returned nullptr instead of "
7515 strPurse = strNewPurse;
7527 if (0 > lDenomination) {
7528 otOut <<
"Error while showing purse: bad "
7533 otOut <<
"Error while showing purse: bad strTime.\n";
7537 string strStatus = (lTime > tValidTo) ?
"expired" :
"valid";
7539 cout << nIndex <<
"\t" << lDenomination <<
"\t" << nSeries
7540 <<
"\t" << tValidFrom <<
"\t" << tValidTo <<
"\t"
7541 << strStatus <<
"\n";
7565 const string& strServerID,
const string& strMyAcct,
7566 const string& strMyNymID,
const string& strInstrument,
const string&)
7571 otOut <<
"\n\nFailure: Unable to find Asset Type ID on the "
7576 string strAssetTypeAcct =
7578 if (strAssetTypeID != strAssetTypeAcct) {
7579 otOut <<
"\n\nFailure: Asset Type ID on the instrument ( "
7580 << strAssetTypeID <<
" ) doesn't match the one on the MyAcct ( "
7581 << strAssetTypeAcct <<
" )\n\n";
7586 strMyAcct, strInstrument);
7587 string strAttempt =
"deposit_cheque";
7590 strServerID, strMyNymID, strMyAcct, strAttempt, strResponse);
7592 if (1 == nInterpretReply) {
7596 otOut <<
"Server response (" << strAttempt <<
"): SUCCESS!\n";
7597 otOut << (bRetrieved ?
"Success" :
"Failed")
7598 <<
" retrieving intermediary files for account.\n";
7601 return nInterpretReply;
7606 const string& strMyAcct,
7607 const string& strFromNymID,
7608 const string& strInstrument,
7609 const string& strIndices)
7611 string strLocation =
"details_deposit_purse";
7613 string strTHE_Instrument =
"";
7616 strTHE_Instrument = strInstrument;
7621 otOut <<
"\n\nFailure: Unable to find Asset Type ID based on myacct. "
7622 "Use: --myacct ACCT_ID\n";
7623 otOut <<
"The designated asset account must be yours. OT will find the "
7624 "asset type based on the account.\n\n";
7629 otOut <<
"Warning: Depositing to MyAcct, which is NOT the same asset "
7630 "type as the MyPurse asset type specified.\n";
7633 bool bLoadedPurse =
false;
7642 otOut <<
"\n " << strLocation <<
": Unable to load purse from "
7643 "local storage. Does it even "
7648 bLoadedPurse =
true;
7660 vector<string> vecSelectedTokenIDs;
7673 otOut <<
"\n " << strLocation <<
": Error: Unexpected bad value "
7675 "OT_API_Purse_Count.\n\n";
7680 otOut <<
"\n " << strLocation
7681 <<
": The purse is empty, so you can't deposit it.\n\n";
7689 string strPurse = strTHE_Instrument;
7692 int32_t nIndex = -1;
7694 while (nCount > 0) {
7705 strServerID, strAssetTypeID, strFromNymID, strPurse);
7708 otOut << strLocation <<
": Error: OT_API_Purse_Peek "
7709 "unexpectedly returned nullptr "
7710 "instead of token.\n";
7715 strServerID, strAssetTypeID, strFromNymID, strPurse);
7718 otOut << strLocation <<
": Error: OT_API_Purse_Pop "
7719 "unexpectedly returned nullptr "
7720 "instead of updated purse.\n";
7724 strPurse = strNewPurse;
7727 strServerID, strAssetTypeID, strToken);
7730 otOut << strLocation <<
": Error while depositing "
7731 "purse: bad strTokenID.\n";
7735 if (!(
"all" == strIndices) &&
7738 vecSelectedTokenIDs.push_back(strTokenID);
7746 strServerID, strAssetTypeID, strFromNymID, strTHE_Instrument,
7747 vecSelectedTokenIDs, strMyAcct, bLoadedPurse);
7753 const string& strMyAcctID)
7755 string strInstrument =
"";
7760 <<
"\n\nFailure: Unable to find depositor NymID based on account ( "
7761 << strMyAcctID <<
" ).\nUse: --myacct ACCT_ID\n";
7762 otOut <<
"The designated asset account must be yours. OT will find the "
7763 "Nym based on the account.\n\n";
7767 string strIndices =
"";
7785 string strFromNymID =
"";
7788 strFromNymID =
MyNym;
7791 strFromNymID = strToNymID;
7799 return details_deposit_purse(strServerID, strMyAcctID, strFromNymID,
7800 strInstrument, strIndices);
7803 otOut <<
"You can deposit a PURSE (containing cash tokens) or a CHEQUE "
7805 otOut <<
"Paste your financial instrument here, followed by a ~ by "
7806 "itself on a blank line: \n";
7817 otOut <<
"\n\nFailure: Unable to determine instrument type. "
7818 "Expected CHEQUE, VOUCHER, INVOICE, or (cash) PURSE.\n";
7822 if (
"CHEQUE" == strType) {
7823 return details_deposit_cheque(strServerID, strMyAcctID, strToNymID,
7824 strInstrument, strType);
7826 else if (
"VOUCHER" == strType) {
7827 return details_deposit_cheque(strServerID, strMyAcctID, strToNymID,
7828 strInstrument, strType);
7830 else if (
"INVOICE" == strType) {
7831 return details_deposit_cheque(strServerID, strMyAcctID, strToNymID,
7832 strInstrument, strType);
7834 else if (
"PURSE" == strType) {
7835 return details_deposit_purse(strServerID, strMyAcctID, strToNymID,
7839 otOut <<
"\n\nFailure: Unable to determine instrument type. "
7840 "Expected CHEQUE, VOUCHER, INVOICE, or (cash) PURSE.\n";
7850 otOut <<
"Usage: deposit --myacct YOUR_ACCT_ID \n(OT will ask you to "
7851 "paste the instrument.)\nOptionally: --mynym YOUR_NYM_ID "
7852 "\nOptionally: --args \"indices 4,6,9\"\nOptionally: --args "
7853 "\"indices all\" (To deposit ALL cash tokens in your "
7854 "purse.)\nServer and NymID are usually determined based on "
7855 "MyAcct.\n If you supply optional indices, they must correspond "
7856 "to tokens in your cash purse.\n\n";
7886 otOut <<
"Failure: Unable to find Server ID based on myacct. Use: "
7887 "--myacct ACCT_ID\n";
7888 otOut <<
"The designated asset account must be yours. OT will find "
7889 "the Server based on the account.\n\n";
7894 otOut <<
"This account is on server ( " << strServerID
7895 <<
" -- the server is deduced based on the account), but the "
7896 "default server is ( " <<
Server
7897 <<
" ). To override it, use: --server " << strServerID
7902 return details_deposit(strServerID,
MyAcct);
7911 const string& strPurseOwner)
7920 otOut <<
"\n\nFailure: Unable to determine server ID from purse.\n";
7927 otOut <<
"\n\nFailure: Unable to determine asset type ID from purse.\n";
7931 bool bActuallyHasPassword =
7934 if (bHasPassword != bActuallyHasPassword) {
7935 otOut <<
"The actual purse's opinion of whether or not it has a "
7936 "password, doesn't match the caller's opinion.\n";
7941 strServerID, strAssetID, strPurseOwner, strInstrument);
7944 otOut <<
"\n\n Success importing purse!\nServer: " << strServerID
7945 <<
"\nAsset Type: " << strAssetID <<
"\nNym: " << strPurseOwner
7963 otOut <<
"\n\nFailure: Unable to determine instrument type. Expected "
7971 otOut <<
"\n\nFailure: Unable to determine server ID from purse.\n";
7975 if (
"PURSE" == strType) {
8005 otOut <<
"\n\nFailure: Unable to determine instrument type. Expected "
8021 string strPurseOwner =
"";
8023 if (!bHasPassword) {
8047 otOut <<
"\n\n The NymID isn't evident from the purse itself... "
8048 "(listing it is optional.)\nThe purse may have no Nym at "
8049 "all--it may instead be password-protected.) Either way, a "
8050 "signer nym is still necessary, even for password-protected "
8051 "purses.\n\n Trying MyNym...\n";
8057 strPurseOwner =
MyNym;
8060 return details_import_purse(strInstrument, bHasPassword, strPurseOwner);
8065 otOut <<
"Usage: importcash (OT will ask you to paste the "
8066 "instrument.)\nOptionally: importcash --mynym "
8067 "YOUR_NYM_ID\n\nAsset (Purse) ID and ServerID are both deduced "
8068 "from the cash purse that you're importing.\nNymID is also "
8069 "deduced, if necessary. (Otherwise, specify using --mynym.)\n\n";
8071 otOut <<
"You can import a PURSE (containing cash tokens.)\n";
8072 otOut <<
"Paste your financial instrument here, followed by a ~ by itself "
8073 "on a blank line: \n";
8081 return details_import_cash(strInstrument);
8115 const string& strServerID,
const string& strFromNymID,
8116 const string& strAssetTypeID,
string& strHisNymID,
const string& strIndices,
8117 bool bPasswordProtected,
string& strRetainedCopy)
8120 string strLocation =
"\n details_export_cash";
8141 strServerID, strFromNymID, strAssetTypeID);
8144 otOut << strLocation
8145 <<
": Unable to load asset contract: " << strAssetTypeID <<
"\n";
8149 bool bLoadedPurse =
false;
8151 string strInstrument =
8155 otOut << strLocation <<
": Unable to load purse from local storage. "
8156 "Does it even exist?\n";
8160 bLoadedPurse =
true;
8170 vector<string> vecSelectedTokenIDs;
8182 otOut << strLocation <<
": Error: Unexpected bad value returned "
8183 "from OT_API_Purse_Count.\n\n";
8188 otOut << strLocation
8189 <<
": The purse is empty, so you can't export it.\n\n";
8197 string strPurse = strInstrument;
8200 int32_t nIndex = -1;
8202 while (nCount > 0) {
8207 strServerID, strAssetTypeID, strFromNymID, strPurse);
8210 otOut << strLocation <<
": Error: OT_API_Purse_Peek "
8211 "unexpectedly returned nullptr "
8212 "instead of token.\n";
8217 strServerID, strAssetTypeID, strFromNymID, strPurse);
8220 otOut << strLocation <<
": Error: OT_API_Purse_Pop "
8221 "unexpectedly returned nullptr "
8222 "instead of updated purse.\n";
8226 strPurse = strNewPurse;
8229 strServerID, strAssetTypeID, strToken);
8232 otOut << strLocation <<
": Error while exporting "
8233 "purse: bad strTokenID.\n";
8244 if (!(
"all" == strIndices) &&
8247 vecSelectedTokenIDs.push_back(strTokenID);
8253 strServerID, strAssetTypeID, strFromNymID, strInstrument,
8254 vecSelectedTokenIDs, strHisNymID, bPasswordProtected,
8257 return strExportedCashPurse;
8266 otOut <<
"Usage: exportcash --mypurse ASSET_TYPE_ID --mynym YOUR_NYM_ID "
8267 "--hisnym RECIPIENT_NYM_ID --server SERVER_ID\nOptionally: "
8268 "--args \"indices 4,6,9\"\nOptionally: --args \"passwd true\" "
8269 "(To create a password-protected purse.)\n\n(If you create a "
8270 "password-protected purse, then HisNym will be ignored and can be "
8271 "left out.)\nIf you supply optional indices, they must correspond "
8272 "to tokens in your cash purse.\n\n";
8276 string strIndices =
"";
8277 bool bPasswordProtected =
false;
8285 (
"true" == strPasswordProtected)) {
8286 bPasswordProtected =
true;
8290 string strHisNym =
MyNym;
8292 if (!bPasswordProtected &&
VerifyExists(
"HisNym",
false)) {
8293 otOut <<
"HisNym was provided at the command line.\nDo you wish to "
8294 "export this cash to HisNym instead of MyNym?\n\n";
8296 <<
"\n\n Type yes to use HisNym, or no to use MyNym.[no]: ";
8301 ((
"y" == strAnswer) || (
"yes" == strAnswer))) {
8306 string strServerID =
Server;
8307 string strMyNymID =
MyNym;
8309 string strRetainedCopy =
"";
8311 string strExportedPurse = details_export_cash(
8312 strServerID, strMyNymID, strMyPurse, strHisNym, strIndices,
8313 bPasswordProtected, strRetainedCopy);
8316 cout <<
"\n" << strExportedPurse <<
"\n\n";
8317 otOut <<
"Success exporting cash purse!\n\n";
8336 const string& strServerID,
const string& strAssetTypeID,
8337 const string& strMyNymID, int64_t& lAmount,
string& strIndices)
8340 string strLocation =
"\n purse_get_indices_or_amount";
8342 string strLoopIndices =
"";
8343 int64_t lAmountRemaining = lAmount;
8344 int64_t lLoopAmount = 0;
8358 bool bFindIndicesFromAmount =
false;
8359 bool bFindAmountFromIndices =
false;
8362 bFindAmountFromIndices =
true;
8365 bFindIndicesFromAmount =
true;
8368 otOut << strLocation <<
": Can only pass indices, OR amount to this "
8369 "function, but not both (the other becomes "
8374 otOut <<
"strServerID: " << strServerID <<
"\n";
8375 otOut <<
"strAssetTypeID: " << strAssetTypeID <<
"\n";
8376 otOut <<
"strMyNymID: " << strMyNymID <<
"\n";
8378 string strLocalPurse =
8382 if (!bLoadedPurse) {
8383 otOut << strLocation
8384 <<
": Unable to load local purse. Does it even exist?\n";
8393 otOut << strLocation <<
": Error: Unexpected bad value returned "
8394 "from OT_API_Purse_Count.\n\n";
8399 otOut << strLocation <<
": The purse is empty.\n\n";
8407 string strPurse = strLocalPurse;
8409 int32_t nIndex = -1;
8411 while (nCount > 0) {
8422 strServerID, strAssetTypeID, strMyNymID, strPurse);
8425 otOut << strLocation <<
": Error: OT_API_Purse_Peek "
8426 "unexpectedly returned nullptr "
8427 "instead of token.\n";
8432 strServerID, strAssetTypeID, strMyNymID, strPurse);
8435 otOut << strLocation <<
": Error: OT_API_Purse_Pop "
8436 "unexpectedly returned nullptr "
8437 "instead of updated purse.\n";
8441 strPurse = strNewPurse;
8444 strServerID, strAssetTypeID, strToken);
8446 otOut << strLocation <<
": Error: bad strTokenID.\n";
8450 strServerID, strAssetTypeID, strToken);
8451 if (0 > lDenomination) {
8452 otOut <<
"Error while showing purse: bad lDenomination.\n";
8456 strServerID, strAssetTypeID, strToken);
8458 otOut <<
"Error while showing purse: bad nSeries.\n";
8462 strServerID, strAssetTypeID, strToken);
8464 otOut <<
"Error while showing purse: bad tValidFrom.\n";
8468 strServerID, strAssetTypeID, strToken);
8470 otOut <<
"Error while showing purse: bad tValidTo.\n";
8475 otOut <<
"Error while showing purse: bad lTime.\n";
8478 string strStatus = (lTime > tValidTo) ?
"expired" :
"valid";
8503 if (lTime > tValidTo) {
8504 otOut << strLocation <<
": Skipping: Token is " << strStatus
8507 else if (bFindAmountFromIndices) {
8509 ((
"all" == strIndices) ||
8514 strLoopIndices = strTempIndices;
8515 lLoopAmount += lDenomination;
8518 else if (bFindIndicesFromAmount) {
8519 if (lAmountRemaining > 0 &&
8520 lDenomination <= lAmountRemaining) {
8523 strLoopIndices = strTempIndices;
8524 lLoopAmount += lDenomination;
8525 lAmountRemaining -= lDenomination;
8527 if (0 == lAmountRemaining) {
8536 if (bFindAmountFromIndices) {
8537 lAmount = lLoopAmount;
8540 else if (bFindIndicesFromAmount) {
8541 strIndices = strLoopIndices;
8542 lAmount = lAmountRemaining;
8544 if (0 == lAmountRemaining) {
8555 const string& strMyAcctID,
string& strHisNymID,
const string& strMemo,
8556 const string& strAmount)
8558 string strLocation =
"withdraw_and_send_cash";
8562 otOut << strLocation <<
": Failure: Missing one of: strMyAcctID ("
8563 << strMyAcctID <<
"), strHisNymID (" << strHisNymID
8564 <<
"), or strAmount (" << strAmount <<
")\n";
8570 otOut << strLocation
8571 <<
": Failure: Unable to find NymID based on strMyAcctID ("
8572 << strMyAcctID <<
").\n";
8578 otOut << strLocation
8579 <<
": Failure: Unable to find Server ID based on strMyAcctID ("
8580 << strMyAcctID <<
").\n";
8584 string strAssetTypeID =
8589 <<
": Failure: Unable to find Asset Type ID based on strMyAcctID ("
8590 << strMyAcctID <<
").\n";
8594 int64_t lAmount = int64_t(0);
8597 lAmount = std::stoll(strAmount);
8601 otOut << strLocation <<
": Invalid value: strAmount (" << strAmount
8606 string strTempMemo =
"";
8607 string strResponse =
"";
8608 string strIndices =
"";
8609 bool bPasswordProtected =
false;
8612 strTempMemo = strMemo;
8616 strResponse, strServerID, strAssetTypeID, strMyNymID,
8617 strMyAcctID, strHisNymID, strTempMemo, strAmount, strIndices,
8618 bPasswordProtected)) {
8626 string& strResponse,
const string& strServerID,
8627 const string& strAssetTypeID,
const string& strMyNymID,
8628 const string& strMyAcctID,
string& strHisNymID,
const string&,
8629 const string& strAmount,
string& strIndices,
bool bPasswordProtected)
8632 string strLocation =
"\n details_send_cash";
8634 int64_t lStartAmount = int64_t(0);
8637 lStartAmount = std::stoll(strAmount);
8640 int64_t lAmount = lStartAmount;
8653 bool bGotData = purse_get_indices_or_amount(
8654 strServerID, strAssetTypeID, strMyNymID, lAmount, strIndices);
8659 if (bAmountFromIndices) {
8663 otOut << strLocation
8664 <<
": Sorry, those indices weren't found: " << strIndices
8665 <<
"\nPerhaps try: 'opentxs showpurse'\n";
8675 int32_t nWithdraw = details_withdraw_cash(strMyAcctID, lAmount);
8677 if (1 != nWithdraw) {
8678 otOut << strLocation <<
": Tried to withdraw cash, but failed.\n";
8685 lAmount = lStartAmount;
8687 bGotData = purse_get_indices_or_amount(strServerID, strAssetTypeID,
8688 strMyNymID, lAmount, strIndices);
8691 otOut << strLocation
8692 <<
": Unable to get enough cash into the local purse to "
8693 "send, EVEN after performing a cash withdrawal. "
8694 "(Failure.)\n strIndices: " << strIndices <<
" lAmount: "
8707 string strRetainedCopy =
"";
8708 string strExportedCashPurse = details_export_cash(
8709 strServerID, strMyNymID, strAssetTypeID, strHisNymID, strIndices,
8710 bPasswordProtected, strRetainedCopy);
8711 int32_t nReturnVal = -1;
8716 strExportedCashPurse, strRetainedCopy);
8720 if (1 != nReturnVal) {
8724 strServerID, strAssetTypeID, strMyNymID, strRetainedCopy);
8727 otOut <<
"\n\nFailed sending cash, but at least: success "
8728 "re-importing purse.\nServer: " << strServerID
8729 <<
"\nAsset Type: " << strAssetTypeID
8730 <<
"\nNym: " << strMyNymID <<
"\n\n";
8733 otOut <<
"\n\n Failed sending cash AND failed re-importing "
8734 "purse.\nServer: " << strServerID
8735 <<
"\nAsset Type: " << strAssetTypeID
8736 <<
"\nNym: " << strMyNymID
8737 <<
"\n\nPurse (SAVE THIS SOMEWHERE!):\n\n"
8738 << strRetainedCopy <<
"\n";
8754 cout << strKey <<
"\n";
8777 const string& strPaymentType,
8778 const string& strInbox)
8781 otOut <<
"Failure: strMyAcctID not a valid string.\n";
8787 otOut <<
"Failure: Unable to find NymID based on myacct. Use: --myacct "
8789 otOut <<
"The designated asset account must be yours. OT will find the "
8790 "Nym based on the account.\n\n";
8796 otOut <<
"Failure: Unable to find Server ID based on myacct. Use: "
8797 "--myacct ACCT_ID\n";
8798 otOut <<
"The designated asset account must be yours. OT will find the "
8799 "Server based on the account.\n\n";
8802 string strInstrument =
"";
8805 otOut <<
"Please paste the instrument, followed by an EOF or a ~ by "
8806 "itself on a blank line:\n\n";
8810 otOut <<
"\n\n Sorry, You must paste the instrument, in order to "
8811 "process it. Or, specify an index in the\npayments inbox "
8812 "using the option: --args \"index "
8813 "INDEX_OF_INVOICE\".\n\n";
8819 strServerID, strMyNymID, nIndex, strInbox);
8822 otOut <<
"\n\n Unable to get payment instrument based on index: "
8823 << nIndex <<
".\n\n";
8834 otOut <<
"\n\nFailure: Unable to determine strInstrument's type. "
8835 "Expected CHEQUE, VOUCHER, INVOICE, or (cash) PURSE.\n";
8839 string strIndexErrorMsg =
"";
8849 (strPaymentType != strType)) {
8850 if (((
"CHEQUE" == strPaymentType) && (
"VOUCHER" == strType)) ||
8851 ((
"VOUCHER" == strPaymentType) && (
"CHEQUE" == strType))) {
8855 otOut <<
"The instrument " << strIndexErrorMsg <<
"is not a "
8856 << strPaymentType <<
". (It's a " << strType
8857 <<
". Skipping.)\n";
8876 string strRecipientUserID =
8883 (strRecipientUserID != strMyNymID)) {
8884 otOut <<
"The instrument " << strIndexErrorMsg
8885 <<
"is endorsed to a specific recipient (" << strRecipientUserID
8886 <<
") and that doesn't match the account's owner Nym ("
8887 << strMyNymID <<
"). (Skipping.)\nTry specifying a different "
8888 "account, using --myacct ACCT_ID \n";
8899 string strInstrumentAssetType =
8901 string strAccountAssetID =
8905 (strAccountAssetID != strInstrumentAssetType)) {
8906 otOut <<
"The instrument at index " << nIndex
8907 <<
" has a different asset type than the selected account. "
8908 "(Skipping.)\nTry specifying a different account, using "
8909 "--myacct ACCT_ID \n";
8917 if (tTime < tFrom) {
8918 otOut <<
"The instrument at index " << nIndex
8919 <<
" is not yet within its valid date range. (Skipping.)\n";
8923 otOut <<
"The instrument at index " << nIndex
8924 <<
" is expired. (Moving it to the record box.)\n";
8931 true, nIndex,
true)) {
8951 if (
"CHEQUE" == strType ||
"VOUCHER" == strType ||
"INVOICE" == strType) {
8952 return details_deposit_cheque(strServerID, strMyAcctID, strMyNymID,
8953 strInstrument, strType);
8956 if (
"PURSE" == strType) {
8957 int32_t nDepositPurse = details_deposit_purse(
8958 strServerID, strMyAcctID, strMyNymID, strInstrument,
"");
8963 if ((nIndex != -1) && (1 == nDepositPurse)) {
8968 return nDepositPurse;
8971 otOut <<
"\nSkipping this instrument: Expected CHEQUE, VOUCHER, INVOICE, "
8972 "or (cash) PURSE.\n";
8981 const string& strIndices,
8982 const string& strPaymentType)
8985 otOut <<
"Failure: strMyAcctID not a valid string.\n";
8991 otOut <<
"Failure: Unable to find NymID based on myacct. Use: --myacct "
8993 otOut <<
"The designated asset account must be yours. OT will find the "
8994 "Nym based on the account.\n\n";
9000 otOut <<
"Failure: Unable to find Server ID based on myacct. Use: "
9001 "--myacct ACCT_ID\n";
9002 otOut <<
"The designated asset account must be yours. OT will find the "
9003 "Server based on the account.\n\n";
9009 otOut <<
"\n\n accept_from_paymentbox: OT_API_LoadPaymentInbox "
9015 strMyNymID, strInbox);
9018 <<
"Unable to retrieve size of payments inbox ledger. (Failure.)\n";
9022 int32_t nIndicesCount =
9030 for (int32_t nIndex = (nCount - 1); nIndex >= 0; --nIndex) {
9031 bool bContinue =
false;
9038 if ((nIndicesCount > 0) &&
9043 else if (!bContinue) {
9044 handle_payment_index(strMyAcctID, nIndex, strPaymentType, strInbox);
9053 const string& strIndices)
9055 return accept_from_paymentbox(strMyAcctID, strIndices,
"INVOICE");
9060 otOut <<
"Usage: acceptinvoices --myacct FROM_ACCT --args \"indices "
9061 "3,6,8\" \n (Sample indices are shown.)\nThe invoice and myacct "
9062 "must both have same asset type. If indices\nare not specified "
9063 "for the payments inbox, then OT will pay ALL invoices in "
9064 "it\nthat have the same asset type as MyAcct.\n\n";
9067 string strIndices =
"";
9073 return details_accept_invoices(
MyAcct, strIndices);
9081 const string& strIndices)
9083 int32_t nAcceptedPurses =
9084 accept_from_paymentbox(strMyAcctID, strIndices,
"PURSE");
9085 int32_t nAcceptedCheques =
9086 accept_from_paymentbox(strMyAcctID, strIndices,
"CHEQUE");
9091 if (nAcceptedPurses >= 0 || nAcceptedCheques >= 0) {
9100 otOut <<
"Usage: acceptpayments --myacct INTO_ACCT --args \"indices "
9101 "3,6,8\" \n (Sample indices are shown.)\nThe payment instrument "
9102 "and myacct must both have same asset type. If indices\nare not "
9103 "specified for the payments inbox, then OT will accept ALL "
9104 "payment\ninstruments in it that have the same asset type as "
9108 string strIndices =
"";
9114 return details_accept_payments(
MyAcct, strIndices);
9122 otOut <<
"Usage: payinvoice --myacct FROM_ACCT --args \"index "
9123 "INVOICE_INDEX\" \nThe invoice and myacct must both have same "
9124 "asset type. If an index is not\nspecified for the payments "
9125 "inbox, then OT will ask you to paste an invoice.\n\n";
9130 int32_t nIndex = -1;
9136 int32_t nTempIndex = std::stol(strIndex);
9138 if (nTempIndex >= 0) {
9139 nIndex = nTempIndex;
9144 int32_t nPaidInvoice = handle_payment_index(
MyAcct, nIndex,
"INVOICE",
"");
9146 if (1 == nPaidInvoice)
9272 cout <<
"\n Success paying invoice!\n\n\n";
9280 vector<string>
tokenize(
const string& str,
const string& delimiters,
9283 int32_t lastPos = 0;
9284 vector<string> tokens;
9287 int32_t pos = str.find_first_of(delimiters, lastPos);
9292 if (pos != lastPos || !trimEmpty) {
9293 tokens.push_back(str.substr(lastPos, pos - lastPos));
9298 if (pos != lastPos || !trimEmpty) {
9299 tokens.push_back(str.substr(lastPos, pos - lastPos));
9312 otOut <<
"Usage: showactive --server SERVER_ID --mynym NYM_ID (To "
9313 "display a list of IDs.)\nOR: showactive --server SERVER_ID "
9314 "--args \"id TRANSACTION_ID\"\n\nLists the transaction numbers of "
9315 "currently active payment plans\nand smart contracts. Also useful "
9316 "for displaying contents by ID.\n\n";
9318 string strError =
"\nPlease provide either: --mynym NYM_ID (to view a "
9319 "list of active transactions)\nor, to view details for a "
9320 "specific transaction, use --args \"id TRANSACTION_ID\" "
9324 int64_t lTransNum = 0;
9325 bool bDetailMode =
false;
9330 lTransNum = std::stoll(strTransNum);
9332 if (lTransNum > 0) {
9336 otOut <<
"Missing argument (1): " << strError;
9342 otOut <<
"Missing argument (2): " << strError;
9354 string strCronItem =
9361 strType =
"UNKNOWN";
9364 otOut <<
"Found an active transaction!\n";
9365 otOut <<
"ID: " << lTransNum <<
" Type: " << strType
9366 <<
"\n\nContents:\n\n";
9368 cout << strCronItem <<
"\n";
9378 vector<string> vecIDs =
tokenize(strIDs,
",",
true);
9380 for (
size_t nIndex = 0; nIndex < vecIDs.size(); ++nIndex) {
9381 string strTransNum = vecIDs[nIndex];
9383 lTransNum = std::stoll(strTransNum);
9385 if (lTransNum > 0) {
9395 strType =
"UNKNOWN";
9398 otOut <<
"\n Found " << vecIDs.size()
9399 <<
" active transactions:\n\n";
9401 cout <<
"ID: " << strTransNum
9402 <<
" Type: " << strType <<
"\n\n";
9410 otOut <<
"\nFound no active transactions. Perhaps try 'opentxs "
9411 "refresh' first?\n";
9423 otOut <<
"Usage: showpayment --args \"index PAYMENT_INDEX showmemo "
9424 "true|false\"\n Default index is 0. Default showmemo is false.\n";
9436 bool bShowLargeMemo =
false;
9439 if (
VerifyStringVal(strShowLargeMemo) && (
"true" == strShowLargeMemo)) {
9440 bShowLargeMemo =
true;
9444 int32_t nTempIndex = std::stol(strIndex);
9446 if (nTempIndex >= 0) {
9447 nIndex = nTempIndex;
9454 otOut <<
"\n\n OT_API_LoadPaymentInbox: Failed.\n\n";
9463 if (nIndex > (nCount - 1)) {
9464 otOut <<
"Index out of bounds. (There are " << nCount
9465 <<
" indices, starting at 0.\n";
9469 otOut <<
"Ind Amt Type Txn# Memo\n";
9470 otOut <<
"---------------------------------\n";
9476 otOut <<
"Failed trying to get payment instrument from "
9483 int64_t lTransNumber =
9495 string strSenderUserID =
9497 string strSenderAcctID =
9499 string strRemitterUserID =
9501 string strRemitterAcctID =
9503 string strRecipientUserID =
9505 string strRecipientAcctID =
9522 if (bMemoExists && (strMemo.find(
"\n") != string::npos) &&
9524 strMemo =
"<too large to display here>";
9526 else if (bMemoExists) {
9527 string strTempMemo =
"\"" + strMemo +
"\"";
9528 strMemo = strTempMemo;
9531 string strNewlineSeparator =
"";
9533 if (bUserIDExists || bAcctIDExists) {
9534 strNewlineSeparator =
"\n";
9537 string strSeparator =
9538 (!bUserIDExists && !bAcctIDExists && !bAssetIDExists)
9540 : strNewlineSeparator;
9544 string strUserDenoter = (bUserIDExists ?
"U:" :
"");
9545 string strUserDenoter2 = (bUserIDExists ?
" - " :
"");
9546 string strAcctDenoter = (bAcctIDExists ?
"A:" :
"");
9547 string strAcctDenoter2 = (bAcctIDExists ?
" - " :
"");
9548 string strAssetDenoter = (bAssetIDExists ?
"T:" :
"");
9549 string strAssetDenoter2 = (bAssetIDExists ?
" - " :
"");
9553 string strUserName =
9557 string strAcctName =
9562 string strAssetName =
9574 strUserDenoter2 =
"";
9578 strAcctDenoter2 =
"";
9582 strAssetDenoter2 =
"";
9585 if (
"\"\"" == strUserName) {
9587 strUserDenoter2 =
"";
9589 if (
"\"\"" == strAcctName) {
9591 strAcctDenoter2 =
"";
9593 if (
"\"\"" == strAssetName) {
9595 strAssetDenoter2 =
"";
9598 cout << nIndex <<
" ";
9600 if (bAssetIDExists && bHasAmount) {
9604 << (strAmount.size() < 3 ?
" " :
" ");
9610 cout << strType << (strType.size() > 10 ?
" " :
" ");
9611 cout << lTransNumber
9614 cout << (bMemoExists ? strMemo :
"") <<
"\n";
9615 cout << strUserDenoter << strUserID << strUserDenoter2
9616 << strUserName << strSeparator;
9617 cout << strAcctDenoter << strAcctID << strAcctDenoter2
9618 << strAcctName << strSeparator;
9619 cout << strAssetDenoter << strAssetType << strAssetDenoter2
9620 << strAssetName <<
"\n";
9621 cout <<
"Instrument:\n" << strInstrument <<
"\n";
9631 int32_t nShowPayments = -1;
9632 int32_t nShowInbox = -1;
9638 otOut <<
"Try adding --myacct ASSET_ACCT_ID (to see the asset "
9639 "account's inbox.)\n";
9646 otOut <<
"Try adding --mynym NYM_ID and --server SERVER_ID\n(to see "
9647 "the payments inbox for that Server and Nym.)\n";
9650 if ((nShowInbox > -1) || (nShowPayments > -1)) {
9659 int32_t nShowPayments = -1;
9660 int32_t nShowOutbox = -1;
9666 otOut <<
"Try adding --myacct ASSET_ACCT_ID (to see the asset "
9667 "account's outbox.)\n";
9674 otOut <<
"Try adding --mynym NYM_ID (to see the outpayment box for "
9678 if ((nShowOutbox > -1) || (nShowPayments > -1)) {
9697 otOut <<
"\n Unable to load the payments inbox (probably doesn't "
9698 "exist yet.)\n(Nym/Server: " <<
MyNym <<
" / " <<
Server
9712 otOut <<
"Show payments inbox (Nym/Server)\n( " <<
MyNym
9713 <<
" / " <<
Server <<
" )\n";
9714 otOut <<
"Idx Amt Type Txn# Asset_Type\n";
9715 otOut <<
"---------------------------------------\n";
9717 for (int32_t nIndex = 0; nIndex < nCount; ++nIndex) {
9722 otOut <<
"Failed trying to get payment instrument from "
9729 int64_t lTransNumber =
9733 string strTransID = 0 <= lTransNumber
9735 :
"UNKNOWN_TRANS_NUM";
9745 string strSenderUserID =
9747 string strSenderAcctID =
9749 string strRecipientUserID =
9751 string strRecipientAcctID =
9756 : strRecipientUserID;
9759 : strRecipientAcctID;
9765 (bHasAmount && bHasAsset)
9773 string strAssetDenoter = (bAssetIDExists ?
" - " :
"");
9775 string strAssetName =
9782 strAssetDenoter =
"";
9785 cout << nIndex <<
" ";
9787 << (strAmount.size() < 3 ?
" " :
" ");
9788 cout << strType << (strType.size() > 10 ?
" " :
" ");
9790 << (strTransID.size() < 2 ?
" " :
" ");
9791 cout << strAssetType << strAssetDenoter << strAssetName
9795 otOut <<
"\n For the above, try: acceptpayments, "
9796 "acceptinvoices, acceptmoney, or acceptall.\n EXCEPT "
9797 "for smart contracts and payment plans -- for those, "
9798 "use: opentxs confirm\n\n";
9801 otOut <<
"\n Payments inbox is empty (Nym/Server: " <<
MyNym
9802 <<
" / " <<
Server <<
" )\n";
9813 const string& strMyNymID,
9814 const string& strMyAcctID, int32_t nIndex,
9815 const string& strRecordBox)
9818 otOut <<
"\n\n details_show_record: strRecordBox is empty.\n(Need to "
9819 "load it first before calling this function.)\n\n";
9824 strServerID, strMyNymID, strMyAcctID, strRecordBox, nIndex);
9826 strServerID, strMyNymID, strMyAcctID, strRecordBox, nIndex);
9828 strServerID, strMyNymID, strMyAcctID, strTrans);
9830 strMyAcctID, strTrans);
9832 strMyAcctID, strTrans);
9834 strServerID, strMyNymID, strMyAcctID, strTrans);
9836 strServerID, strMyNymID, strMyAcctID, strTrans);
9838 strServerID, strMyNymID, strMyAcctID, strTrans);
9840 strServerID, strMyNymID, strMyAcctID, strTrans);
9843 VerifyStringVal(strSenderUserID) ? strSenderUserID : strRecipientUserID;
9845 VerifyStringVal(strSenderAcctID) ? strSenderAcctID : strRecipientAcctID;
9850 string strNewlineSeparator =
"";
9852 if (bUserIDExists || bAcctIDExists) {
9853 strNewlineSeparator =
"\n |";
9856 string strSeparator =
9857 (!bUserIDExists && !bAcctIDExists) ?
"" : strNewlineSeparator;
9859 string strUserDenoter = (bUserIDExists ?
"U:" :
"");
9860 string strAcctDenoter = (bAcctIDExists ?
"A:" :
"");
9862 string strAssetTypeID =
9875 otOut << nIndex <<
" ";
9876 otOut << strAmount << (strAmount.size() < 3 ?
" " :
" ");
9877 otOut << strType << (strType.size() > 10 ?
" " :
" ");
9881 otOut << strUserDenoter << strUserID << strSeparator << strAcctDenoter
9882 << strAcctID <<
"\n";
9889 const string& strMyNymID,
9890 const string& strMyAcctID)
9892 string strRecordBox =
9896 otOut <<
"\n\n details_show_records: OT_API_LoadRecordBox: Failed.\n\n";
9903 strMyAcctID, strRecordBox);
9908 otOut <<
"SHOW RECORDS: \n\n";
9909 otOut <<
"Idx Amt Type Txn# InRef#|User / Acct\n";
9910 otOut <<
"---------------------------------|(from or to)\n";
9912 for (int32_t nIndex = 0; nIndex < nCount; ++nIndex) {
9913 if (!details_show_record(strServerID, strMyNymID, strMyAcctID, nIndex,
9916 <<
"details_show_records: Error calling details_show_record.\n";
9926 string strLocation =
"mainShowRecords";
9934 bool bBothExist = (bNymExists && bAcctExists);
9935 bool bShowNymOnly = (bNymExists && !bAcctExists);
9937 string strMyNymID =
"";
9942 else if (bAcctExists) {
9946 otOut << strLocation <<
": This should never happen. (1)\n";
9962 otOut << strLocation <<
": Unable to find NymID based on myacct. Try a "
9963 "different account or nym, using --myacct "
9964 "ACCT_ID or --mynym NYM_ID\n";
9967 if (bBothExist && !(strMyNymID ==
MyNym)) {
9969 <<
") is not the same nym who owns MyAcct.\nTo override using "
9970 "MyAcct's owner nym, add: --mynym (" << strMyNymID <<
")\n";
9974 string strServerID =
"";
9982 otOut << strLocation <<
": Server was not specified, and either MyAcct "
9983 "wasn't specified either, or if it was, I was "
9984 "unable to find any ServerID associated with "
9985 "MyAcct.\nTry a different account or different "
9986 "server, using --myacct ACCT_ID or --server "
9992 otOut << strLocation <<
": Unable to find Server ID.\nTry: --server "
9993 "SERVER_ID\nYou might also try: --myacct "
9994 "ACCT_ID (It will find the server ID based on "
10011 otOut <<
"\n\nNote: OT is completely done with these records. A proper GUI "
10012 "will sweep them out\nperiodically and archive them somewhere, or "
10013 "just erase them. All you can do at the\ncommand line (using this "
10014 "tool) is view them, or erase them using: opentxs clearrecords "
10016 otOut <<
"\nArchived Nym-related records (" << strMyNymID <<
"): \n";
10017 int32_t nNymRecords =
10018 details_show_records(strServerID, strMyNymID, strMyNymID);
10019 otOut <<
"--------------------------------------------------------------\n";
10021 int32_t nAcctRecords = 1;
10024 otOut <<
"\nArchived Account-related records (" <<
MyAcct <<
"): \n";
10025 nAcctRecords = details_show_records(strServerID, strMyNymID, MyAcct);
10028 if (2 == (nNymRecords + nAcctRecords)) {
10037 const string& strMyNymID,
10038 const string& strMyAcctID)
10044 return bCleared ? 1 : -1;
10049 string strLocation =
"mainClearRecords";
10051 otOut <<
" Usage: clearrecords\n\n";
10059 bool bBothExist = (bNymExists && bAcctExists);
10060 bool bShowNymOnly = (bNymExists && !bAcctExists);
10062 string strMyNymID =
"";
10064 if (bShowNymOnly) {
10065 strMyNymID =
MyNym;
10067 else if (bAcctExists) {
10071 otOut << strLocation <<
": This should never happen. (1)\n";
10087 otOut << strLocation <<
": Unable to find NymID based on myacct. Try a "
10088 "different account or nym, using --myacct "
10089 "ACCT_ID or --mynym NYM_ID\n";
10092 if (bBothExist && !(strMyNymID ==
MyNym)) {
10093 otOut << strLocation <<
": MyNym (" <<
MyNym
10094 <<
") is not the same nym who owns MyAcct.\nTo override using "
10095 "MyAcct's owner nym, add: --mynym (" << strMyNymID <<
")\n";
10099 string strServerID =
"";
10107 otOut << strLocation <<
": Server was not specified, and either MyAcct "
10108 "wasn't specified either, or if it was, I was "
10109 "unable to find any ServerID associated with "
10110 "MyAcct.\nTry a different account or different "
10111 "server, using --myacct ACCT_ID or --server "
10117 otOut << strLocation <<
": Unable to find Server ID.\nTry: --server "
10118 "SERVER_ID\nYou might also try: --myacct "
10119 "ACCT_ID (It will find the server ID based on "
10129 otOut <<
"\n Clearing archived Nym-related records (" << strMyNymID
10131 int32_t nNymRecords =
10132 details_clear_records(strServerID, strMyNymID, strMyNymID);
10133 otOut <<
"--------------------------------------------------------------\n";
10134 otOut <<
"\nClearing archived Account-related records (" <<
MyAcct
10136 int32_t nAcctRecords =
10137 details_clear_records(strServerID, strMyNymID, MyAcct);
10139 if (2 == (nNymRecords + nAcctRecords)) {
10148 const string& strMyNymID)
10153 return bCleared ? 1 : -1;
10158 otOut <<
" Usage: clearexpired\n\n";
10162 string strMyNymID =
MyNym;
10163 string strServerID =
Server;
10166 otOut <<
"\n Clearing archived Nym-related expired records ("
10167 << strMyNymID <<
")... \n";
10169 return details_clear_expired(strServerID, strMyNymID);
10189 const string& strMyNymID, int32_t nIndex,
10190 const string& strExpiredBox)
10193 otOut <<
"\n\n details_show_expired: strExpiredBox is empty.\n(Need to "
10194 "load it first before calling this function.)\n\n";
10199 strServerID, strMyNymID, strMyNymID, strExpiredBox, nIndex);
10201 strServerID, strMyNymID, strMyNymID, strExpiredBox, nIndex);
10203 strServerID, strMyNymID, strMyNymID, strTrans);
10205 strMyNymID, strTrans);
10207 strMyNymID, strTrans);
10209 strServerID, strMyNymID, strMyNymID, strTrans);
10211 strServerID, strMyNymID, strMyNymID, strTrans);
10213 strServerID, strMyNymID, strMyNymID, strTrans);
10215 strServerID, strMyNymID, strMyNymID, strTrans);
10218 VerifyStringVal(strSenderUserID) ? strSenderUserID : strRecipientUserID;
10220 VerifyStringVal(strSenderAcctID) ? strSenderAcctID : strRecipientAcctID;
10225 string strNewlineSeparator =
"";
10227 if (bUserIDExists || bAcctIDExists) {
10228 strNewlineSeparator =
"\n |";
10231 string strSeparator =
10232 (!bUserIDExists && !bAcctIDExists) ?
"" : strNewlineSeparator;
10234 string strUserDenoter = (bUserIDExists ?
"U:" :
"");
10235 string strAcctDenoter = (bAcctIDExists ?
"A:" :
"");
10237 string strAssetTypeID =
10246 :
"UNKNOWN_AMOUNT";
10248 otOut << nIndex <<
" ";
10249 otOut << strAmount << (strAmount.size() < 3 ?
" " :
" ");
10250 otOut << strType << (strType.size() > 10 ?
" " :
" ");
10254 otOut << strUserDenoter << strUserID << strSeparator << strAcctDenoter
10255 << strAcctID <<
"\n";
10262 const string& strMyNymID)
10267 otOut <<
"\n\n details_show_expired_records: OT_API_LoadExpiredBox: "
10275 strMyNymID, strExpiredBox);
10280 otOut <<
"SHOW EXPIRED RECORDS: \n\n";
10281 otOut <<
"Idx Amt Type Txn# InRef#|User / Acct\n";
10282 otOut <<
"---------------------------------|(from or to)\n";
10284 for (int32_t nIndex = 0; nIndex < nCount; ++nIndex) {
10285 if (!details_show_expired(strServerID, strMyNymID, nIndex,
10287 otOut <<
"details_show_expired_records: Error calling "
10288 "details_show_expired.\n";
10298 string strLocation =
"mainShowExpired";
10302 string strMyNymID =
MyNym;
10303 string strServerID =
Server;
10307 otOut <<
"\n\nNote: OT is completely done with these expired records. "
10308 "A proper GUI will sweep them out\nperiodically and archive "
10309 "them somewhere, or just erase them. All you can do at "
10310 "the\ncommand line (using this tool) is view them, or erase "
10311 "them using: opentxs clearexpired \n\n";
10312 otOut <<
"\nArchived Nym-related expired records (" << strMyNymID
10315 return details_show_expired_records(strServerID, strMyNymID);
10333 otOut <<
"Failure: Unable to find NymID based on myacct. Use: "
10334 "--myacct ACCT_ID\n";
10335 otOut <<
"The designated asset account must be yours. OT will find "
10336 "the Nym based on the account.\n\n";
10342 otOut <<
"Failure: Unable to find Server ID based on myacct. Use: "
10343 "--myacct ACCT_ID\n";
10344 otOut <<
"The designated asset account must be yours. OT will find "
10345 "the Server based on the account.\n\n";
10352 otOut <<
"\n Unable to load asset account inbox. ( " <<
MyAcct
10353 <<
" )\n Perhaps it doesn't exist yet?\n\n";
10360 strServerID, strMyNymID,
MyAcct, strInbox);
10366 otOut <<
"Show inbox for an asset account (" <<
MyAcct
10368 otOut <<
"Idx Amt Type Txn# InRef#|User / Acct\n";
10369 otOut <<
"---------------------------------|(from or to)\n";
10371 for (int32_t nIndex = 0; nIndex < nCount; ++nIndex) {
10373 strServerID, strMyNymID, MyAcct, strInbox, nIndex);
10376 strServerID, strMyNymID, MyAcct, strInbox, nIndex);
10379 strServerID, strMyNymID, MyAcct, strTrans);
10381 strServerID, strMyNymID, MyAcct, strTrans);
10383 strServerID, strMyNymID, MyAcct, strTrans);
10384 string strSenderUserID =
10386 strServerID, strMyNymID, MyAcct, strTrans);
10387 string strSenderAcctID =
10389 strServerID, strMyNymID, MyAcct, strTrans);
10390 string strRecipientUserID =
10392 strServerID, strMyNymID, MyAcct, strTrans);
10393 string strRecipientAcctID =
10395 strServerID, strMyNymID, MyAcct, strTrans);
10399 : strRecipientUserID;
10402 : strRecipientAcctID;
10407 string strNewlineSeparator =
"";
10409 if (bUserIDExists || bAcctIDExists) {
10410 strNewlineSeparator =
10414 string strSeparator = (!bUserIDExists && !bAcctIDExists)
10416 : strNewlineSeparator;
10418 string strUserDenoter = (bUserIDExists ?
"U:" :
"");
10419 string strAcctDenoter = (bAcctIDExists ?
"A:" :
"");
10421 string strAssetTypeID =
10430 strAssetTypeID, lAmount)
10432 :
"UNKNOWN_AMOUNT";
10434 otOut << nIndex <<
" ";
10436 << (strAmount.size() < 3 ?
" " :
" ");
10438 otOut << (strType.size() > 10 ?
" " :
" ");
10445 otOut << strUserDenoter << strUserID << strSeparator
10446 << strAcctDenoter << strAcctID <<
"\n";
10449 otOut <<
"\n For the above, try: accepttransfers, "
10450 "acceptreceipts, acceptinbox, acceptmoney, or "
10455 <<
" ) is empty.\n";
10471 otOut <<
"-----------------------------------------------\nUSAGE: outbox "
10472 "--myacct MY_ACCT_ID\n";
10478 otOut <<
"Failure: Unable to find NymID based on myacct. Use: "
10479 "--myacct ACCT_ID\n";
10480 otOut <<
"The designated asset account must be yours. OT will find "
10481 "the Nym based on the account.\n\n";
10487 otOut <<
"Failure: Unable to find Server ID based on myacct. Use: "
10488 "--myacct ACCT_ID\n";
10489 otOut <<
"The designated asset account must be yours. OT will find "
10490 "the Server based on the account.\n\n";
10497 otOut <<
"\n\n OT_API_LoadOutbox: Failed.\n\n";
10504 strServerID, strMyNymID,
MyAcct, strOutbox);
10509 otOut <<
"===> SHOW OUTBOX: \n";
10512 otOut <<
"\nAsset account outbox is empty for account: "
10514 <<
"\n\n--------------------------------------------\n";
10517 otOut <<
"\nIdx Amt Type Txn# InRef#|User / Acct\n";
10518 otOut <<
"---------------------------------|(from or to)\n";
10520 for (int32_t nIndex = 0; nIndex < nCount; ++nIndex) {
10522 strServerID, strMyNymID,
MyAcct, strOutbox, nIndex);
10525 strServerID, strMyNymID,
MyAcct, strOutbox, nIndex);
10528 strServerID, strMyNymID,
MyAcct, strTrans);
10530 strServerID, strMyNymID,
MyAcct, strTrans);
10532 strServerID, strMyNymID,
MyAcct, strTrans);
10533 string strSenderUserID =
10535 strServerID, strMyNymID,
MyAcct, strTrans);
10536 string strSenderAcctID =
10538 strServerID, strMyNymID,
MyAcct, strTrans);
10539 string strRecipientUserID =
10541 strServerID, strMyNymID,
MyAcct, strTrans);
10542 string strRecipientAcctID =
10544 strServerID, strMyNymID,
MyAcct, strTrans);
10546 string strUserID = strRecipientUserID;
10547 string strAcctID = strRecipientAcctID;
10552 string strNewlineSeparator =
"";
10554 if (bUserIDExists || bAcctIDExists) {
10555 strNewlineSeparator =
10559 string strSeparator = (!bUserIDExists && !bAcctIDExists)
10561 : strNewlineSeparator;
10563 string strUserDenoter = (bUserIDExists ?
"U:" :
"");
10564 string strAcctDenoter = (bAcctIDExists ?
"A:" :
"");
10566 string strAssetTypeID =
10575 strAssetTypeID, lAmount)
10577 :
"UNKNOWN_AMOUNT";
10579 otOut << nIndex <<
" ";
10581 << (strAmount.size() < 3 ?
" " :
" ");
10582 otOut << strType << (strType.size() > 10 ?
" " :
" ");
10589 otOut << strUserDenoter << strUserID << strSeparator
10590 << strAcctDenoter << strAcctID <<
"\n";
10602 bool bShowContents)
10606 if (!bMailVerified) {
10607 cout <<
"UNVERIFIED mail! At index: " << nIndex <<
"\n\n";
10611 cout <<
"------------------------------\nVerified mail at index: "
10615 string strMailServerID =
10617 string strMailSenderID =
10619 string strMailContents =
10627 cout <<
"Mail from: " << strMailSenderID <<
" \"" << strName <<
"\" \n";
10634 cout <<
"Server ID: " << strMailServerID <<
" \"" << strName <<
"\" \n";
10637 cout <<
"Contents:\n" << strMailContents <<
"\n\n";
10644 const string& strIndices)
10649 otOut <<
"Error: cannot retrieve mail for Nym: " << strMyNymID <<
"\n";
10654 otOut <<
"\n(Mail box is empty)\n\n";
10659 bool bDeleteAll =
false;
10661 if (bIndices && (
"all" == strIndices)) {
10665 int32_t nIndicesCount =
10671 if (!bDeleteAll && (nIndicesCount < 1)) {
10672 otOut <<
"Problem: You're apparently not deleting \"all\" indices, but "
10673 "neither have you selected SPECIFIC indices.\n Try adding: "
10674 "--args \"indices 4,6,7\" (for deleting the messages at "
10675 "indices 4, 6, and 7, for example.)\n\n";
10679 int32_t nReturnVal = 1;
10681 for (int32_t nIndex = (nCount - 1); nIndex >= 0; --nIndex) {
10695 otOut <<
"Deleted mail at index " << nIndex
10696 <<
" for nym: " << strMyNymID <<
" \n";
10699 otOut <<
"Error while trying to delete mail at index " << nIndex
10700 <<
" for nym: " << strMyNymID <<
" \n";
10710 otOut <<
"Usage: deleteinmail --mynym MY_NYM_ID --args \"index 5\" (To "
10711 "delete message 5.)\n Also, try: --args \"indices all\" (for all "
10712 "messages)\n As well as: --args \"indices 3,5,6\" (for messages "
10713 "3, 5, and 6)\n\n";
10716 string strIndices =
"";
10722 strIndices = strIndex;
10728 strIndices = strTempIndices;
10732 int32_t nDetails = details_del_mail(
MyNym, strIndices);
10741 otOut <<
"Usage: mail --mynym MY_NYM_ID (To list all the mail messages "
10742 "for mynym.)\n Also: mail --args \"index 5\" (To examine a "
10743 "specific message.)\n\n";
10751 otOut <<
"Error: cannot retrieve mail for Nym: " <<
MyNym <<
"\n";
10756 otOut <<
"\n(Mail box is empty)\n\n";
10760 int32_t nIndex = -1;
10764 nIndex = std::stol(strIndex);
10765 if (nIndex >= nCount) {
10766 otOut <<
"Error: invalid message index: " << strIndex <<
"\n";
10773 if (!show_mail_message(
MyNym, nIndex,
true)) {
10774 otOut <<
"Error: cannot retrieve mail message.\n";
10780 otOut <<
"\n Mail contents:\n\n";
10782 int32_t nReturnVal = 1;
10783 for (nIndex = 0; nIndex < nCount; ++nIndex) {
10784 if (!show_mail_message(
MyNym, nIndex,
false)) {
10785 otOut <<
"Error: cannot retrieve mail message.\n";
10795 bool bShowContents)
10797 bool bMailVerified =
10800 if (!bMailVerified) {
10801 cout <<
"UNVERIFIED outmail! At index: " << nIndex <<
"\n\n";
10805 cout <<
"--------------------------------------------------------"
10806 "\nVerified outmail at index: " << nIndex <<
"\n";
10809 string strMailServerID =
10811 string strMailRecipientID =
10813 string strMailContents =
10817 cout <<
"Mail was sent to: " << strMailRecipientID <<
"\n";
10820 cout <<
"At server ID: " << strMailServerID <<
"\n";
10823 cout <<
"Contents:\n" << strMailContents <<
"\n\n";
10830 otOut <<
"Usage: outmail --mynym MY_NYM_ID (To list all the sent mail "
10831 "messages for mynym.)\n Also: outmail --args \"index 5\" (To "
10832 "examine a specific message.)\n\n";
10840 otOut <<
"Error: cannot retrieve outmail for Nym: " <<
MyNym <<
"\n";
10845 otOut <<
"\n(Outmail box is empty)\n\n";
10849 int32_t nIndex = -1;
10853 nIndex = std::stol(strIndex);
10854 if (nIndex >= nCount) {
10855 otOut <<
"Error: invalid message index: " << strIndex <<
"\n";
10862 if (!show_outmail_message(
MyNym, nIndex,
true)) {
10863 otOut <<
"Error: cannot retrieve outmail message.\n";
10869 otOut <<
"\n Outmail contents:\n\n";
10871 int32_t nReturnVal = 1;
10872 for (nIndex = 0; nIndex < nCount; ++nIndex) {
10873 if (!show_outmail_message(
MyNym, nIndex,
false)) {
10874 otOut <<
"Error: cannot retrieve outmail message.\n";
10883 const string& strIndices)
10887 otOut <<
"Error: cannot retrieve outmail for Nym: " << strMyNymID
10893 otOut <<
"\n(Outmail box is empty)\n\n";
10898 bool bDeleteAll =
false;
10900 if (bIndices && (
"all" == strIndices)) {
10904 int32_t nIndicesCount =
10910 if (!bDeleteAll && (nIndicesCount < 1)) {
10911 otOut <<
"Problem: You're apparently not deleting \"all\" indices, but "
10912 "neither have you selected SPECIFIC indices.\n Try adding: "
10913 "--args \"indices 4,6,7\" (for deleting the outgoing messages "
10914 "at indices 4, 6, and 7, for example.)\n\n";
10918 int32_t nReturnVal = 1;
10920 for (int32_t nIndex = (nCount - 1); nIndex >= 0; --nIndex) {
10934 otOut <<
"Deleted outgoing mail at index " << nIndex
10935 <<
" for nym: " << strMyNymID <<
" \n";
10938 otOut <<
"Error while trying to delete outgoing mail at index "
10939 << nIndex <<
" for nym: " << strMyNymID <<
" \n";
10949 otOut <<
"Usage: deleteoutmail --mynym MY_NYM_ID --args \"index 5\" (To "
10950 "delete outmail message 5.)\n Also, try: --args \"indices all\" "
10951 "(for all outgoing messages)\n As well as: --args \"indices "
10952 "3,5,6\" (for outgoing messages 3, 5, and 6)\n\n";
10955 string strIndices =
"";
10961 strIndices = strIndex;
10967 strIndices = strTempIndices;
10971 int32_t nDetails = details_del_outmail(
MyNym, strIndices);
10982 bool bMailVerified =
10985 if (!bMailVerified) {
10986 cout <<
"UNVERIFIED sent (outgoing) payment! At index: " << nIndex
10991 cout <<
"\n----------------------------------------------\n(index "
10992 << nIndex <<
")\n";
10995 string strMailServerID =
10997 string strMailRecipientID =
10999 string strMailContents =
11003 int64_t lPaymentAmount =
11007 :
"UNKNOWN_PAYMENT_AMOUNT";
11009 string strPaymentAssetID =
11013 string strFormatted =
"";
11014 string strAssetTypeName =
"";
11016 string strRecipientString =
"";
11017 string strServerString =
"";
11024 strRecipientString =
"Payment sent to: " + strMailRecipientID +
11025 " \"" + strName +
"\" ";
11033 " At server ID: " + strMailServerID +
" \"" + strName +
"\" ";
11039 strAssetTypeName =
"";
11043 strPaymentAssetID =
"UNKNOWN_ASSET_ID";
11048 strPaymentType =
"UNKNOWN_PAYMENT_TYPE";
11050 string strTempFormat;
11051 if (lPaymentAmount >= 0) {
11056 strTempFormat = strPaymentAmount;
11059 strFormatted =
"( " + strPaymentType +
": " + strTempFormat +
" )";
11062 cout <<
" Amount: " << strPaymentAmount <<
" " << strFormatted
11064 cout << strRecipientString <<
"\n";
11065 cout <<
" Of asset type: " << strPaymentAssetID <<
" \""
11066 << strAssetTypeName <<
"\"\n";
11067 cout << strServerString <<
"\n";
11070 cout <<
" Instrument: \n" << strMailContents <<
"\n\n";
11074 otOut <<
"Error: bad result from "
11075 "OT_API_GetNym_OutpaymentsContentsByIndex at Index: " << nIndex
11085 otOut <<
"Usage: outpayment --mynym MY_NYM_ID --args \"index 5\" (for "
11086 "example)\nIf no index is specified, all outgoing payments are "
11095 otOut <<
"Error: cannot retrieve outpayments for Nym: " <<
MyNym
11101 otOut <<
"\n(Outpayment box is empty)\n\n";
11105 int32_t nIndex = -1;
11110 nIndex = std::stol(strIndex);
11111 if (nIndex >= nCount) {
11112 otOut <<
"Error: invalid message index: " << strIndex <<
"\n";
11119 if (!show_outpayment(
MyNym, nIndex,
true)) {
11120 otOut <<
"Error: cannot retrieve outpayment.\n";
11125 otOut <<
"\n\n===> SHOW OUTGOING PAYMENTS:\n";
11127 int32_t nReturnVal = 1;
11128 for (nIndex = 0; nIndex < nCount; ++nIndex) {
11129 if (!show_outpayment(
MyNym, nIndex,
false)) {
11130 otOut <<
"Error: cannot retrieve outpayment.\n";
11139 otOut <<
"Please paste a server contract, followed by an EOF or a ~ by "
11140 "itself on a blank line:\n\n";
11144 otOut <<
"\n\n Sorry, You must input a server contract, in order to "
11145 "add it to your wallet.\n\n";
11152 otOut <<
"\n\n Sorry, failed. Are you sure that was a server "
11157 otOut <<
"\n\n Success adding server contract to your wallet.\n\n";
11163 otOut <<
"Please paste a currency contract, followed by an EOF or a ~ by "
11164 "itself on a blank line:\n\n";
11168 otOut <<
"\n\n Sorry, You must input a currency contract, in order to "
11169 "add it to your wallet.\n\n";
11176 otOut <<
"\n\n Sorry, failed. Are you sure that was an asset "
11181 otOut <<
"\n\n Success adding asset contract to your wallet.\n\n";
11187 otOut <<
"Usage: issueasset --server SERVER_ID --mynym NYM_ID\n\n "
11188 "(NYM_ID must already be the 'contract' key on the new "
11189 "contract.)\n See 'opentxs newasset' before running this "
11193 otOut <<
"Please paste a currency contract, followed by an EOF or a ~ "
11194 "by itself on a blank line:\n\n";
11198 otOut <<
"\n\n Sorry, You must input a currency contract, in order "
11199 "to issue it on an OT server.\n\n";
11209 string strResponse =
11214 otOut <<
"\n\n SUCCESS in issue_asset! Server response:\n\n";
11215 cout << strResponse <<
"\n";
11218 otOut <<
"\n\n FAILURE in issue_asset! Server response:\n\n";
11219 cout << strResponse <<
"\n";
11222 otOut <<
"\n\nError in issue_asset! nStatus is: " << nStatus
11226 otOut <<
"Server response:\n\n";
11227 cout << strResponse <<
"\n";
11233 return (0 == nStatus) ? -1 : nStatus;
static EXPORT std::string GetAccountWallet_Name(const std::string &ACCOUNT_ID)
static EXPORT int32_t Token_GetSeries(const std::string &SERVER_ID, const std::string &ASSET_TYPE_ID, const std::string &THE_TOKEN)
EXPORT static OT_MADE_EASY_OT std::string create_market_offer(const std::string &ASSET_ACCT_ID, const std::string &CURRENCY_ACCT_ID, const std::string &scale, const std::string &minIncrement, const std::string &quantity, const std::string &price, bool bSelling, const std::string &strLifespanInSeconds, const std::string &strStopSign, const std::string &strActivationPrice)
EXPORT static OT_COMMANDS_OT bool purse_get_indices_or_amount(const std::string &strServerID, const std::string &strAssetTypeID, const std::string &strMyNymID, int64_t &lAmount, std::string &strIndices)
EXPORT static OT_COMMANDS_OT int32_t mainEditAccount()
EXPORT static OT_COMMANDS_OT int32_t mainOutbox()
static EXPORT std::string Party_GetAcctAssetID(const std::string &THE_CONTRACT, const std::string &PARTY_NAME, const std::string &ACCT_NAME)
static EXPORT std::string GetAccountWallet_NymID(const std::string &ACCOUNT_ID)
EXPORT static OT_COMMANDS_OT int32_t mainKillOffer()
EXPORT OT_OTAPI_OT MapOfMaps * convert_offerlist_to_maps(opentxs::OTDB::OfferListNym &offerList)
EXPORT OT_OTAPI_OT int32_t output_nymoffer_data(const opentxs::OTDB::OfferDataNym &offer_data, int32_t nIndex, const MapOfMaps &map_of_maps, const SubMap &sub_map, the_lambda_struct &extra_vals)
static EXPORT int64_t Instrmnt_GetAmount(const std::string &THE_INSTRUMENT)
static EXPORT std::string Instrmnt_GetSenderAcctID(const std::string &THE_INSTRUMENT)
static EXPORT std::string LoadAssetContract(const std::string &ASSET_TYPE_ID)
EXPORT static OT_COMMANDS_OT int32_t mainImportNym()
static EXPORT int32_t GetAccountCount()
static EXPORT std::string Wallet_GetNymIDFromPartial(const std::string &PARTIAL_ID)
Attempts to find a full ID in the wallet, based on a partial of the same.
static EXPORT int32_t Basket_GetMemberCount(const std::string &BASKET_ASSET_TYPE_ID)
EXPORT static OT_COMMANDS_OT int32_t mainNewKey()
EXPORT static OT_COMMANDS_OT int32_t mainVerifyReceipt()
EXPORT static OT_COMMANDS_OT int32_t mainShowMarkets()
std::string currency_type_id
EXPORT static OT_COMMANDS_OT bool show_mail_message(const std::string &strMyNymID, int32_t nIndex, bool bShowContents)
EXPORT static OT_COMMANDS_OT int32_t mainInbox()
EXPORT static OT_COMMANDS_OT int32_t mainPayDividend()
static EXPORT std::string Transaction_CreateResponse(const std::string &SERVER_ID, const std::string &USER_ID, const std::string &ACCOUNT_ID, const std::string &RESPONSE_LEDGER, const std::string &ORIGINAL_TRANSACTION, const bool &BOOL_DO_I_ACCEPT)
EXPORT static OT_COMMANDS_OT int32_t details_confirm_plan(const std::string &strPlan, int32_t nIndex)
static EXPORT bool IsBasketCurrency(const std::string &ASSET_TYPE_ID)
static EXPORT std::string Instrmnt_GetRemitterUserID(const std::string &THE_INSTRUMENT)
EXPORT static OT_COMMANDS_OT int32_t mainPayInvoice()
EXPORT static OT_COMMANDS_OT int32_t mainNewCredential()
EXPORT static OT_MADE_EASY_OT std::string get_payment_instrument(const std::string &SERVER_ID, const std::string &NYM_ID, int32_t nIndex, const std::string &PRELOADED_INBOX)
EXPORT static OT_COMMANDS_OT int32_t details_import_cash(const std::string &strInstrument)
EXPORT static OT_COMMANDS_OT int32_t mainShowAccounts()
static EXPORT std::string AddBasketCreationItem(const std::string &USER_ID, const std::string &THE_BASKET, const std::string &ASSET_TYPE_ID, const int64_t &MINIMUM_TRANSFER)
EXPORT static OT_COMMANDS_OT int32_t mainKillPlan()
static EXPORT std::string Instrmnt_GetRemitterAcctID(const std::string &THE_INSTRUMENT)
EXPORT static OT_COMMANDS_OT int32_t mainImportCash()
static EXPORT std::string Wallet_GetAssetIDFromPartial(const std::string &PARTIAL_ID)
EXPORT static OT_COMMANDS_OT int32_t mainWithdrawVoucher()
static EXPORT std::string Party_GetAgentID(const std::string &THE_CONTRACT, const std::string &PARTY_NAME, const std::string &AGENT_NAME)
EXPORT static OT_COMMANDS_OT int32_t mainVerifySignature()
EXPORT static OT_COMMANDS_OT int32_t mainShowNyms()
static EXPORT std::string GetNym_ID(const int32_t &nIndex)
EXPORT static OT_COMMANDS_OT std::string find_masterID_for_subcred(const std::string &strMyNymID, const std::string &strInputID)
EXPORT static OT_COMMANDS_OT int32_t details_create_offer(const std::string &strScale, const std::string &strMinIncrement, const std::string &strQuantity, const std::string &strPrice, bool bSelling, const std::string &strLifespan)
EXPORT static OT_COMMANDS_OT int32_t mainSendCheque()
EXPORT std::string OT_CLI_GetValueByKey(const std::string &str_Args, const std::string &str_key)
std::string to_string(const T &t)
static EXPORT std::string ConfirmPaymentPlan(const std::string &SERVER_ID, const std::string &SENDER_USER_ID, const std::string &SENDER_ACCT_ID, const std::string &RECIPIENT_USER_ID, const std::string &PAYMENT_PLAN)
EXPORT static OT_COMMANDS_OT int32_t accept_inbox_items(const std::string &strMyAcctID, int32_t nItemType, const std::string &strIndices)
EXPORT static OT_COMMANDS_OT int32_t details_deposit_purse(const std::string &strServerID, const std::string &strMyAcct, const std::string &strFromNymID, const std::string &strInstrument, const std::string &strIndices)
EXPORT static OT_COMMANDS_OT int32_t mainWithdrawCash()
EXPORT static OT_MADE_EASY_OT std::string register_nym(const std::string &SERVER_ID, const std::string &NYM_ID)
EXPORT static OT_MADE_EASY_OT int32_t depositCashPurse(const std::string &serverID, const std::string &assetID, const std::string &nymID, const std::string &oldPurse, const std::vector< std::string > &selectedTokens, const std::string &accountID, bool bReimportIfFailure)
EXPORT static OT_COMMANDS_OT int32_t mainDeleteInmail()
static EXPORT bool Msg_HarvestTransactionNumbers(const std::string &THE_MESSAGE, const std::string &USER_ID, const bool &bHarvestingForRetry, const bool &bReplyWasSuccess, const bool &bReplyWasFailure, const bool &bTransactionWasSuccess, const bool &bTransactionWasFailure)
EXPORT static OT_COMMANDS_OT int32_t mainExchangeBasket()
static EXPORT std::string LoadPurse(const std::string &SERVER_ID, const std::string &ASSET_TYPE_ID, const std::string &USER_ID)
EXPORT static OT_COMMANDS_OT int32_t mainWriteCheque()
static EXPORT std::string Wallet_ExportNym(const std::string &NYM_ID)
Returns the exported Nym, if success. (Else nullptr.)
static EXPORT std::string Party_GetAgentNameByIndex(const std::string &THE_CONTRACT, const std::string &PARTY_NAME, const int32_t &nIndex)
EXPORT static OT_MADE_EASY_OT std::string stat_asset_account(const std::string &ACCOUNT_ID)
EXPORT static OT_COMMANDS_OT int32_t details_stat_account(const std::string &strID)
EXPORT static OT_COMMANDS_OT int32_t details_clear_expired(const std::string &strServerID, const std::string &strMyNymID)
static EXPORT std::string LoadPaymentInbox(const std::string &SERVER_ID, const std::string &USER_ID)
EXPORT static OT_COMMANDS_OT int32_t details_confirm_smart_contract(std::string &strSmartContract, int32_t nIndex)
static EXPORT std::string Transaction_GetSenderAcctID(const std::string &SERVER_ID, const std::string &USER_ID, const std::string &ACCOUNT_ID, const std::string &THE_TRANSACTION)
static EXPORT std::string GetNym_OutmailContentsByIndex(const std::string &NYM_ID, const int32_t &nIndex)
EXPORT static OT_COMMANDS_OT int32_t mainEncrypt()
time64_t OTTimeAddTimeInterval(time64_t lhs, int64_t rhs)
EXPORT static OT_COMMANDS_OT int32_t mainShowAccount()
EXPORT static OT_MADE_EASY_OT std::string exportCashPurse(const std::string &serverID, const std::string &assetID, const std::string &nymID, const std::string &oldPurse, const std::vector< std::string > &selectedTokens, std::string &recipientNymID, bool bPasswordProtected, std::string &strRetainedCopy)
static EXPORT int32_t GetServerCount()
EXPORT static OT_COMMANDS_OT int32_t mainSignContract()
static EXPORT std::string Instrmnt_GetServerID(const std::string &THE_INSTRUMENT)
static EXPORT std::string Ledger_FinalizeResponse(const std::string &SERVER_ID, const std::string &USER_ID, const std::string &ACCOUNT_ID, const std::string &THE_LEDGER)
EXPORT static OT_COMMANDS_OT int32_t details_discard_incoming(const std::string &strServer, const std::string &strMyNym, const std::string &strIndices)
static EXPORT bool Nym_VerifyMailByIndex(const std::string &NYM_ID, const int32_t &nIndex)
static EXPORT std::string SymmetricEncrypt(const std::string &SYMMETRIC_KEY, const std::string &PLAINTEXT)
static EXPORT std::string Instrmnt_GetAssetID(const std::string &THE_INSTRUMENT)
EXPORT static OT_COMMANDS_OT int32_t mainDecode()
EXPORT static OT_COMMANDS_OT int32_t details_show_market_offers(const std::string &strServerID, const std::string &strMarketID)
static EXPORT std::string Instrmnt_GetRecipientAcctID(const std::string &THE_INSTRUMENT)
static EXPORT std::string GetServer_Contract(const std::string &SERVER_ID)
static EXPORT std::string GetNym_ActiveCronItemIDs(const std::string &NYM_ID, const std::string &SERVER_ID)
EXPORT static OT_COMMANDS_OT int32_t details_trigger_clause(const std::string &strServerID, const std::string &strMyNymID, const std::string &strTransNum, const std::string &strClause, const std::string &strParam)
static EXPORT std::string GetNym_SubCredentialID(const std::string &NYM_ID, const std::string &MASTER_CRED_ID, const int32_t &nIndex)
static EXPORT bool SetServer_Name(const std::string &SERVER_ID, const std::string &STR_NEW_NAME)
EXPORT static OT_COMMANDS_OT int32_t details_deposit_cheque(const std::string &strServerID, const std::string &strMyAcct, const std::string &strMyNymID, const std::string &strInstrument, const std::string &strType)
static EXPORT std::string Instrmnt_GetType(const std::string &THE_INSTRUMENT)
static EXPORT std::string Instrmnt_GetMemo(const std::string &THE_INSTRUMENT)
EXPORT static OT_COMMANDS_OT int32_t mainAddSignature()
EXPORT static OT_COMMANDS_OT int32_t download_acct_files()
static EXPORT time64_t GetTime()
EXPORT static OT_COMMANDS_OT int32_t mainRefresh()
EXPORT static OT_COMMANDS_OT OTDB::MarketList * loadMarketList(const std::string &strerverID)
static EXPORT std::string GetNym_Stats(const std::string &NYM_ID)
OTLOG_IMPORT OTLogStream otOut
static EXPORT bool RecordPayment(const std::string &SERVER_ID, const std::string &USER_ID, const bool &bIsInbox, const int32_t &nIndex, const bool &bSaveCopy)
static EXPORT std::string LoadRecordBox(const std::string &SERVER_ID, const std::string &USER_ID, const std::string &ACCOUNT_ID)
NOTE: Sometimes the user ID is also passed in the "account ID" field,.
EXPORT static OT_COMMANDS_OT int32_t mainGetContract()
EXPORT static OT_MADE_EASY_OT std::string issue_asset_type(const std::string &SERVER_ID, const std::string &NYM_ID, const std::string &THE_CONTRACT)
static EXPORT std::string CreateAssetContract(const std::string &NYM_ID, const std::string &strXMLcontents)
EXPORT static OT_COMMANDS_OT bool stat_partyagent_index(const std::string &strSmartContract, const std::string &strPartyName, int32_t nCurrentAgent)
static EXPORT std::string GetNym_SubCredentialContents(const std::string &NYM_ID, const std::string &MASTER_CRED_ID, const std::string &SUB_CRED_ID)
EXPORT static OT_COMMANDS_OT int32_t handle_payment_index(const std::string &strMyAcctID, int32_t nIndex, const std::string &strPaymentType, const std::string &strInbox)
static EXPORT std::string Party_GetAcctNameByIndex(const std::string &THE_CONTRACT, const std::string &PARTY_NAME, const int32_t &nIndex)
#define OT_TIME_MONTH_IN_SECONDS
EXPORT static OT_COMMANDS_OT int32_t details_show_expired(const std::string &strServerID, const std::string &strMyNymID, int32_t nIndex, const std::string &strExpiredBox)
EXPORT static OT_COMMANDS_OT bool details_show_credential(const std::string &strMyNymID, const std::string &strCredID)
static EXPORT bool Smart_IsPartyConfirmed(const std::string &THE_CONTRACT, const std::string &PARTY_NAME)
static EXPORT time64_t Instrmnt_GetValidFrom(const std::string &THE_INSTRUMENT)
EXPORT static OT_COMMANDS_OT int32_t mainClearExpired()
static EXPORT bool ClearRecord(const std::string &SERVER_ID, const std::string &USER_ID, const std::string &ACCOUNT_ID, const int32_t &nIndex, const bool &bClearAll)
EXPORT static OT_MADE_EASY_OT std::string issue_basket_currency(const std::string &SERVER_ID, const std::string &NYM_ID, const std::string &THE_BASKET)
EXPORT static OT_MADE_EASY_OT std::string withdraw_voucher(const std::string &SERVER_ID, const std::string &NYM_ID, const std::string &ACCT_ID, const std::string &RECIP_NYM_ID, const std::string &STR_MEMO, int64_t AMOUNT)
static EXPORT bool SetAccountWallet_Name(const std::string &ACCT_ID, const std::string &SIGNER_NYM_ID, const std::string &ACCT_NEW_NAME)
EXPORT static OT_MADE_EASY_OT std::string withdraw_cash(const std::string &SERVER_ID, const std::string &NYM_ID, const std::string &ACCT_ID, int64_t AMOUNT)
EXPORT static OT_COMMANDS_OT int32_t details_download_box_receipt(const std::string &strID, int32_t nBoxType)
EXPORT static OT_MADE_EASY_OT std::string retrieve_contract(const std::string &SERVER_ID, const std::string &NYM_ID, const std::string &CONTRACT_ID)
static EXPORT std::string GetNym_MailContentsByIndex(const std::string &NYM_ID, const int32_t &nIndex)
static EXPORT bool SetAssetType_Name(const std::string &ASSET_ID, const std::string &STR_NEW_NAME)
EXPORT static OT_COMMANDS_OT int32_t mainSendCash()
EXPORT static OT_COMMANDS_OT int32_t mainAddAsset()
static EXPORT std::string Basket_GetMemberType(const std::string &BASKET_ASSET_TYPE_ID, const int32_t &nIndex)
EXPORT static OT_MADE_EASY_OT std::string send_user_msg(const std::string &SERVER_ID, const std::string &NYM_ID, const std::string &RECIPIENT_NYM_ID, const std::string &THE_MESSAGE)
EXPORT static OT_COMMANDS_OT int32_t mainShowBasket()
static EXPORT std::string Instrmnt_GetSenderUserID(const std::string &THE_INSTRUMENT)
EXPORT static OT_MADE_EASY_OT std::string get_box_receipt(const std::string &SERVER_ID, const std::string &NYM_ID, const std::string &ACCT_ID, int32_t nBoxType, const std::string &STR_TRANS_NUM)
static EXPORT std::string AddBasketExchangeItem(const std::string &SERVER_ID, const std::string &USER_ID, const std::string &THE_BASKET, const std::string &ASSET_TYPE_ID, const std::string &ASSET_ACCT_ID)
EXPORT static OT_MADE_EASY_OT int32_t retrieve_nym(const std::string &strServerID, const std::string &strMyNymID, bool &bWasMsgSent, bool bForceDownload)
EXPORT static OT_COMMANDS_OT int32_t details_show_record(const std::string &strServerID, const std::string &strMyNymID, const std::string &strMyAcctID, int32_t nIndex, const std::string &strRecordBox)
static EXPORT int32_t GetNym_RevokedCredCount(const std::string &NYM_ID)
EXPORT static OT_COMMANDS_OT int32_t mainSendMessage()
EXPORT static OT_COMMANDS_OT int32_t mainShowMyOffers()
EXPORT static OT_COMMANDS_OT int32_t mainChangePw()
EXPORT static OT_COMMANDS_OT int32_t mainShowIncoming()
EXPORT OT_OTAPI_OT opentxs::OTDB::OfferListNym * loadNymOffers(const std::string &serverID, const std::string &nymID)
static EXPORT bool Smart_AreAllPartiesConfirmed(const std::string &THE_CONTRACT)
static EXPORT std::string GetNym_OutmailRecipientIDByIndex(const std::string &NYM_ID, const int32_t &nIndex)
OT_UTILITY_OT int32_t VerifyMsgBalanceAgrmntSuccess(const string &SERVER_ID, const string &USER_ID, const string &ACCOUNT_ID, const string &strMessage)
EXPORT static OT_COMMANDS_OT int32_t details_download_contract(const std::string &strServerID, const std::string &strNymID, const std::string &strContractID)
EXPORT static OT_COMMANDS_OT bool withdraw_and_send_cash(const std::string &strMyAcctID, std::string &strHisNymID, const std::string &strMemo, const std::string &strAmount)
static EXPORT bool Wallet_ChangePassphrase()
EXPORT Storable * QueryObject(StoredObjectType theObjectType, std::string strFolder, std::string oneStr="", std::string twoStr="", std::string threeStr="")
OT_UTILITY_OT int32_t VerifyMessageSuccess(const string &strMessage)
static EXPORT int64_t GetAccountWallet_Balance(const std::string &ACCOUNT_ID)
EXPORT static OT_MADE_EASY_OT std::string load_or_retrieve_contract(const std::string &SERVER_ID, const std::string &NYM_ID, const std::string &CONTRACT_ID)
static EXPORT time64_t Token_GetValidFrom(const std::string &SERVER_ID, const std::string &ASSET_TYPE_ID, const std::string &THE_TOKEN)
the date is seconds since Jan 1970.
static EXPORT std::string GenerateBasketExchange(const std::string &SERVER_ID, const std::string &USER_ID, const std::string &BASKET_ASSET_TYPE_ID, const std::string &BASKET_ASSET_ACCT_ID, const int32_t &TRANSFER_MULTIPLE)
EXPORT static OT_COMMANDS_OT int32_t mainConfirm()
EXPORT static OT_COMMANDS_OT int32_t mainDiscard()
static EXPORT std::string FormatAmount(const std::string &ASSET_TYPE_ID, const int64_t &THE_AMOUNT)
EXPORT static OT_COMMANDS_OT int32_t details_propose_plan(const std::string &strServerID, const std::string &strMyNymID, const std::string &strMyAcctID, const std::string &strHisNymID, const std::string &strHisAcctID, const std::string &strDates, const std::string &strConsideration, const std::string &strInitialPayment, const std::string &strPaymentPlan, const std::string &strExpiry)
EXPORT static OT_COMMANDS_OT int32_t details_accept_payments(const std::string &strMyAcctID, const std::string &strIndices)
static EXPORT bool Nym_VerifyOutpaymentsByIndex(const std::string &NYM_ID, const int32_t &nIndex)
EXPORT static OT_COMMANDS_OT int32_t mainNewServer()
static EXPORT int32_t GetNym_CredentialCount(const std::string &NYM_ID)
static EXPORT std::string Ledger_GetInstrument(const std::string &SERVER_ID, const std::string &USER_ID, const std::string &ACCOUNT_ID, const std::string &THE_LEDGER, const int32_t &nIndex)
static EXPORT std::string GetServer_ID(const int32_t &nIndex)
OT_UTILITY_OT int32_t InterpretTransactionMsgReply(const string &SERVER_ID, const string &USER_ID, const string &ACCOUNT_ID, const string &strAttempt, const string &strResponse)
static EXPORT std::string GetServer_Name(const std::string &SERVER_ID)
static EXPORT int64_t Transaction_GetAmount(const std::string &SERVER_ID, const std::string &USER_ID, const std::string &ACCOUNT_ID, const std::string &THE_TRANSACTION)
static EXPORT int32_t Message_IsTransactionCanceled(const std::string &SERVER_ID, const std::string &USER_ID, const std::string &ACCOUNT_ID, const std::string &THE_MESSAGE)
EXPORT static OT_COMMANDS_OT int32_t mainShowExpired()
EXPORT static OT_COMMANDS_OT int32_t mainAcceptTransfers()
static EXPORT int32_t GetNym_OutpaymentsCount(const std::string &NYM_ID)
EXPORT static OT_MADE_EASY_OT std::string kill_market_offer(const std::string &SERVER_ID, const std::string &NYM_ID, const std::string &ASSET_ACCT_ID, const std::string &STR_TRANS_NUM)
static EXPORT std::string GetNym_RevokedCredContents(const std::string &NYM_ID, const std::string &CREDENTIAL_ID)
static EXPORT std::string LoadExpiredBox(const std::string &SERVER_ID, const std::string &USER_ID)
EXPORT static OT_COMMANDS_OT int32_t mainAcceptPayments()
EXPORT static OT_MADE_EASY_OT std::string load_or_retrieve_encrypt_key(const std::string &SERVER_ID, const std::string &NYM_ID, const std::string &TARGET_NYM_ID)
EXPORT static OT_MADE_EASY_OT std::string trigger_clause(const std::string &SERVER_ID, const std::string &NYM_ID, const std::string &STR_TRANS_NUM, const std::string &CLAUSE_NAME, const std::string &STR_PARAM)
EXPORT static OT_COMMANDS_OT int32_t mainShowWallet()
static EXPORT int32_t Ledger_GetCount(const std::string &SERVER_ID, const std::string &USER_ID, const std::string &ACCOUNT_ID, const std::string &THE_LEDGER)
Find out how many pending transactions (and receipts) are in this inbox.
static EXPORT std::string GetNym_CredentialID(const std::string &NYM_ID, const int32_t &nIndex)
OT_UTILITY_OT bool VerifyExists(const string &theObjectNameAsStr)
EXPORT static OT_COMMANDS_OT int32_t stat_basket_accounts(const std::string &strServer, const std::string &strNym, bool bFilter, const std::string &strBasketType)
EXPORT static OT_COMMANDS_OT int32_t details_show_records(const std::string &strServerID, const std::string &strMyNymID, const std::string &strMyAcctID)
static EXPORT std::string Ledger_GetTransactionByIndex(const std::string &SERVER_ID, const std::string &USER_ID, const std::string &ACCOUNT_ID, const std::string &THE_LEDGER, const int32_t &nIndex)
EXPORT static OT_COMMANDS_OT int32_t details_show_expired_records(const std::string &strServerID, const std::string &strMyNymID)
static EXPORT std::string GetNym_CredentialContents(const std::string &NYM_ID, const std::string &CREDENTIAL_ID)
EXPORT static OT_COMMANDS_OT int32_t impl_show_market_offers(std::string &strMarket)
static EXPORT std::string Encrypt(const std::string &RECIPIENT_NYM_ID, const std::string &strPlaintext)
EXPORT static OT_COMMANDS_OT int32_t mainRefreshAccount()
static EXPORT int32_t Purse_Count(const std::string &SERVER_ID, const std::string &ASSET_TYPE_ID, const std::string &THE_PURSE)
returns a count of the number of cash tokens inside this purse.
EXPORT static OT_COMMANDS_OT bool stat_partyaccount_index(const std::string &strSmartContract, const std::string &strPartyName, int32_t nCurrentAccount)
EXPORT static OT_COMMANDS_OT int32_t mainNewOffer()
EXPORT static OT_COMMANDS_OT bool stat_partyaccounts(const std::string &strSmartContract, const std::string &strPartyName, int32_t nDepth)
static EXPORT int32_t GetNymCount()
static EXPORT int32_t SmartContract_CountNumsNeeded(const std::string &THE_CONTRACT, const std::string &AGENT_NAME)
EXPORT static OT_MADE_EASY_OT std::string create_nym(int32_t nKeybits, const std::string &strNymIDSource, const std::string &strAltLocation)
EXPORT static OT_COMMANDS_OT int32_t mainDeposit()
EXPORT static OT_COMMANDS_OT int32_t details_show_credentials(const std::string &strMyNymID)
static EXPORT bool VerifySignature(const std::string &SIGNER_NYM_ID, const std::string &THE_CONTRACT)
std::string available_assets
EXPORT static OT_COMMANDS_OT int32_t mainOutpayment()
EXPORT static OT_COMMANDS_OT int32_t details_del_outmail(const std::string &strMyNymID, const std::string &strIndices)
EXPORT static OT_COMMANDS_OT int32_t mainIssueAsset()
EXPORT static OT_COMMANDS_OT int32_t mainRefreshNym()
EXPORT static OT_COMMANDS_OT bool details_refresh_nym(const std::string &strServerID, const std::string &strMyNymID, bool bForceDownload)
EXPORT static OT_COMMANDS_OT int32_t details_cancel_outgoing(const std::string &strMyNym, const std::string &strMyAcct, const std::string &strIndices)
static EXPORT int64_t Purse_GetTotalValue(const std::string &SERVER_ID, const std::string &ASSET_TYPE_ID, const std::string &THE_PURSE)
Get Purse Total Value (internally uses GetTotalValue().)
static EXPORT int32_t AddAssetContract(const std::string &strContract)
EXPORT static OT_COMMANDS_OT int32_t mainGetOffers()
EXPORT static OT_COMMANDS_OT int32_t details_send_transfer(const std::string &strMyAcctID, const std::string &strHisAcctID, const std::string &strAmount, const std::string &strNote)
static EXPORT time64_t Token_GetValidTo(const std::string &SERVER_ID, const std::string &ASSET_TYPE_ID, const std::string &THE_TOKEN)
static EXPORT std::string SymmetricDecrypt(const std::string &SYMMETRIC_KEY, const std::string &CIPHERTEXT_ENVELOPE)
EXPORT static OT_COMMANDS_OT int32_t mainExportCash()
static EXPORT std::string GetNym_MailServerIDByIndex(const std::string &NYM_ID, const int32_t &nIndex)
std::string the_asset_acct
EXPORT static OT_COMMANDS_OT int32_t details_account_balance(const std::string &strID)
static EXPORT std::string SignContract(const std::string &SIGNER_NYM_ID, const std::string &THE_CONTRACT)
static EXPORT std::string GetNym_Name(const std::string &NYM_ID)
EXPORT static OT_COMMANDS_OT int32_t mainShowMint()
EXPORT std::string OT_CLI_ReadLine()
EXPORT static OT_COMMANDS_OT int32_t mainAddServer()
static EXPORT std::string Message_GetLedger(const std::string &THE_MESSAGE)
static EXPORT std::string Transaction_GetRecipientAcctID(const std::string &SERVER_ID, const std::string &USER_ID, const std::string &ACCOUNT_ID, const std::string &THE_TRANSACTION)
EXPORT static OT_COMMANDS_OT int32_t mainAdjustUsageCredits()
static EXPORT std::string Instrmnt_GetRecipientUserID(const std::string &THE_INSTRUMENT)
static EXPORT bool SetNym_Name(const std::string &NYM_ID, const std::string &SIGNER_NYM_ID, const std::string &NYM_NEW_NAME)
EXPORT static OT_COMMANDS_OT int32_t mainAcceptMoney()
static EXPORT int64_t Ledger_GetTransactionIDByIndex(const std::string &SERVER_ID, const std::string &USER_ID, const std::string &ACCOUNT_ID, const std::string &THE_LEDGER, const int32_t &nIndex)
EXPORT static OT_COMMANDS_OT int32_t mainAcceptAll()
EXPORT static OT_COMMANDS_OT int32_t details_pay_dividend(const std::string &strAmount, const std::string &strMemo)
EXPORT static OT_MADE_EASY_OT std::string create_asset_acct(const std::string &SERVER_ID, const std::string &NYM_ID, const std::string &ASSET_TYPE_ID)
static EXPORT int32_t GetAssetTypeCount()
EXPORT static OT_COMMANDS_OT int32_t mainShowOutgoing()
EXPORT static OT_COMMANDS_OT int32_t mainShowNym()
static EXPORT std::string GetAccountWallet_ID(const int32_t &nIndex)
EXPORT static OT_COMMANDS_OT std::string find_revokedID_for_subcred(const std::string &strMyNymID, const std::string &strInputID)
EXPORT static OT_MADE_EASY_OT std::string exchange_basket_currency(const std::string &SERVER_ID, const std::string &NYM_ID, const std::string &ASSET_TYPE, const std::string &THE_BASKET, const std::string &ACCT_ID, bool IN_OR_OUT)
static EXPORT int32_t AddServerContract(const std::string &strContract)
static EXPORT std::string GetNym_OutpaymentsRecipientIDByIndex(const std::string &NYM_ID, const int32_t &nIndex)
EXPORT static OT_COMMANDS_OT bool stat_partyaccount(const std::string &strSmartContract, const std::string &strPartyName, const std::string &strAcctName, int32_t nCurrentAccount)
static EXPORT int64_t Basket_GetMinimumTransferAmount(const std::string &BASKET_ASSET_TYPE_ID)
EXPORT static OT_COMMANDS_OT int32_t mainGetReceipt()
static EXPORT std::string GenerateBasketCreation(const std::string &USER_ID, const int64_t &MINIMUM_TRANSFER)
EXPORT static OT_COMMANDS_OT int32_t mainEditServer()
static EXPORT std::string Party_GetAcctID(const std::string &THE_CONTRACT, const std::string &PARTY_NAME, const std::string &ACCT_NAME)
static EXPORT bool Wallet_ImportPurse(const std::string &SERVER_ID, const std::string &ASSET_TYPE_ID, const std::string &USER_ID, const std::string &THE_PURSE)
Should handle duplicates. Should load, merge, and save.
static EXPORT std::string GetNym_MailSenderIDByIndex(const std::string &NYM_ID, const int32_t &nIndex)
static EXPORT std::string LoadInbox(const std::string &SERVER_ID, const std::string &USER_ID, const std::string &ACCOUNT_ID)
EXPORT static OT_COMMANDS_OT int32_t accept_from_paymentbox(const std::string &strMyAcctID, const std::string &strIndices, const std::string &strPaymentType)
EXPORT static OT_COMMANDS_OT int32_t mainEditAsset()
EXPORT static OT_COMMANDS_OT int32_t mainShowAssets()
vector< string > tokenize(const string &str, const string &delimiters, bool trimEmpty)
EXPORT static OT_MADE_EASY_OT std::string check_user(const std::string &SERVER_ID, const std::string &NYM_ID, const std::string &TARGET_NYM_ID)
static EXPORT std::string Transaction_GetSenderUserID(const std::string &SERVER_ID, const std::string &USER_ID, const std::string &ACCOUNT_ID, const std::string &THE_TRANSACTION)
EXPORT static OT_COMMANDS_OT std::string details_get_nym_market_offers(const std::string &strServerID, const std::string &strNymID)
EXPORT static OT_COMMANDS_OT bool stat_partyagents(const std::string &strSmartContract, const std::string &strPartyName, int32_t nDepth)
static EXPORT std::string Transaction_GetVoucher(const std::string &SERVER_ID, const std::string &USER_ID, const std::string &ACCOUNT_ID, const std::string &THE_TRANSACTION)
static EXPORT std::string Decode(const std::string &strEncoded, const bool &bLineBreaks)
EXPORT static OT_COMMANDS_OT int32_t mainCancel()
EXPORT static OT_COMMANDS_OT int32_t mainDecrypt()
EXPORT static OT_MADE_EASY_OT std::string send_user_payment(const std::string &SERVER_ID, const std::string &NYM_ID, const std::string &RECIPIENT_NYM_ID, const std::string &THE_PAYMENT)
OT_UTILITY_OT bool VerifyStringVal(const std::string &nValue)
static EXPORT bool ClearExpired(const std::string &SERVER_ID, const std::string &USER_ID, const int32_t &nIndex, const bool &bClearAll)
static EXPORT std::string EasyProposePlan(const std::string &SERVER_ID, const std::string &DATE_RANGE, const std::string &SENDER_ACCT_ID, const std::string &SENDER_USER_ID, const std::string &PLAN_CONSIDERATION, const std::string &RECIPIENT_ACCT_ID, const std::string &RECIPIENT_USER_ID, const std::string &INITIAL_PAYMENT, const std::string &PAYMENT_PLAN, const std::string &PLAN_EXPIRY)
static EXPORT bool Nym_RemoveOutmailByIndex(const std::string &NYM_ID, const int32_t &nIndex)
EXPORT static OT_COMMANDS_OT int32_t mainAcceptReceipts()
EXPORT static OT_COMMANDS_OT int32_t details_clear_records(const std::string &strServerID, const std::string &strMyNymID, const std::string &strMyAcctID)
EXPORT static OT_COMMANDS_OT bool show_outmail_message(const std::string &strMyNymID, int32_t nIndex, bool bShowContents)
static EXPORT std::string CreateServerContract(const std::string &NYM_ID, const std::string &strXMLcontents)
static EXPORT std::string Purse_Pop(const std::string &SERVER_ID, const std::string &ASSET_TYPE_ID, const std::string &OWNER_OR_SIGNER_ID, const std::string &THE_PURSE)
EXPORT static OT_COMMANDS_OT int32_t details_show_basket()
static EXPORT std::string FlatSign(const std::string &SIGNER_NYM_ID, const std::string &THE_INPUT, const std::string &CONTRACT_TYPE)
EXPORT static OT_COMMANDS_OT int32_t mainShowCredentials()
static EXPORT std::string GetAssetType_Contract(const std::string &ASSET_TYPE_ID)
EXPORT static OT_COMMANDS_OT bool stat_partyagent(const std::string &strSmartContract, const std::string &strPartyName, const std::string &strAgentName, int32_t nIndex)
EXPORT static OT_COMMANDS_OT int32_t details_accept_invoices(const std::string &strMyAcctID, const std::string &strIndices)
EXPORT static OT_COMMANDS_OT int32_t mainRegisterNym()
EXPORT static OT_COMMANDS_OT int32_t mainNewAccount()
std::vector< std::string > the_vector
EXPORT static OT_COMMANDS_OT int32_t mainRevokeCredential()
EXPORT static OT_MADE_EASY_OT bool retrieve_account(const std::string &SERVER_ID, const std::string &NYM_ID, const std::string &ACCOUNT_ID, bool bForceDownload)
static EXPORT int32_t GetNym_OutmailCount(const std::string &NYM_ID)
EXPORT static OT_COMMANDS_OT int32_t mainTriggerClause()
EXPORT static OT_COMMANDS_OT int32_t details_show_nym_offers(const std::string &strServerID, const std::string &strNymID)
static EXPORT std::string GetNym_OutpaymentsServerIDByIndex(const std::string &NYM_ID, const int32_t &nIndex)
std::string the_currency_acct
EXPORT static OT_COMMANDS_OT int32_t mainExportNym()
OTLOG_IMPORT OTLogStream otWarn
static EXPORT std::string CreateSymmetricKey()
static EXPORT std::string AddSignature(const std::string &SIGNER_NYM_ID, const std::string &THE_CONTRACT)
OT_UTILITY_OT int32_t VerifyMsgTrnxSuccess(const string &SERVER_ID, const string &USER_ID, const string &ACCOUNT_ID, const string &strMessage)
EXPORT static OT_COMMANDS_OT int32_t details_write_cheque(std::string &strCheque, bool bIsInvoice)
static EXPORT std::string Party_GetAcctAgentName(const std::string &THE_CONTRACT, const std::string &PARTY_NAME, const std::string &ACCT_NAME)
static EXPORT std::string SmartContract_ConfirmParty(const std::string &THE_CONTRACT, const std::string &PARTY_NAME, const std::string &NYM_ID)
static EXPORT std::string LoadOutbox(const std::string &SERVER_ID, const std::string &USER_ID, const std::string &ACCOUNT_ID)
EXPORT static OT_MADE_EASY_OT std::string pay_dividend(const std::string &SERVER_ID, const std::string &NYM_ID, const std::string &SOURCE_ACCT_ID, const std::string &SHARES_ASSET_ID, const std::string &STR_MEMO, int64_t AMOUNT_PER_SHARE)
EXPORT static OT_COMMANDS_OT int32_t mainNewNym()
EXPORT static OT_COMMANDS_OT int32_t details_create_nym(int32_t nKeybits, const std::string &strName, const std::string &strSourceForNymID, const std::string &strAltLocation)
static EXPORT std::string NumList_Add(const std::string &strNumList, const std::string &strNumbers)
static EXPORT std::string Transaction_GetRecipientUserID(const std::string &SERVER_ID, const std::string &USER_ID, const std::string &ACCOUNT_ID, const std::string &THE_TRANSACTION)
static EXPORT std::string Ledger_CreateResponse(const std::string &SERVER_ID, const std::string &USER_ID, const std::string &ACCOUNT_ID, const std::string &ORIGINAL_LEDGER)
Creates a new 'response' ledger, set up with the right Server ID, etc,.
EXPORT static OT_COMMANDS_OT int32_t details_kill_offer(const std::string &strServerID, const std::string &strNymID, const std::string &strAcctID, const std::string &strTransNum)
EXPORT static OT_MADE_EASY_OT std::string send_user_cash(const std::string &SERVER_ID, const std::string &NYM_ID, const std::string &RECIPIENT_NYM_ID, const std::string &THE_PAYMENT, const std::string &SENDERS_COPY)
EXPORT static OT_COMMANDS_OT int32_t mainShowOffers()
static EXPORT int64_t Message_GetUsageCredits(const std::string &THE_MESSAGE)
EXPORT static OT_COMMANDS_OT int32_t mainShowPurse()
static EXPORT bool VerifyAccountReceipt(const std::string &SERVER_ID, const std::string &NYM_ID, const std::string &ACCT_ID)
EXPORT static OT_COMMANDS_OT int32_t mainShowBalance()
EXPORT static OT_COMMANDS_OT int32_t mainDeleteOutmail()
EXPORT static OT_MADE_EASY_OT std::string load_or_retrieve_mint(const std::string &SERVER_ID, const std::string &NYM_ID, const std::string &ASSET_ID)
static EXPORT std::string GetAssetType_ID(const int32_t &nIndex)
static EXPORT bool Nym_VerifyOutmailByIndex(const std::string &NYM_ID, const int32_t &nIndex)
static EXPORT std::string Smart_GetPartyByIndex(const std::string &THE_CONTRACT, const int32_t &nIndex)
EXPORT OT_OTAPI_OT int32_t find_strange_offers(const opentxs::OTDB::OfferDataNym &offer_data, int32_t nIndex, const MapOfMaps &map_of_maps, const SubMap &sub_map, the_lambda_struct &extra_vals)
EXPORT static OT_COMMANDS_OT int32_t mainEditNym()
EXPORT static OT_COMMANDS_OT int32_t mainPasswordDecrypt()
static EXPORT int64_t Transaction_GetDisplayReferenceToNum(const std::string &SERVER_ID, const std::string &USER_ID, const std::string &ACCOUNT_ID, const std::string &THE_TRANSACTION)
EXPORT static OT_MADE_EASY_OT std::string get_market_offers(const std::string &SERVER_ID, const std::string &NYM_ID, const std::string &MARKET_ID, int64_t MAX_DEPTH)
static EXPORT std::string SmartContract_ConfirmAccount(const std::string &THE_CONTRACT, const std::string &SIGNER_NYM_ID, const std::string &PARTY_NAME, const std::string &ACCT_NAME, const std::string &AGENT_NAME, const std::string &ACCT_ID)
static EXPORT int64_t Token_GetDenomination(const std::string &SERVER_ID, const std::string &ASSET_TYPE_ID, const std::string &THE_TOKEN)
The actual cash value of the token. Returns a int64_t.
static EXPORT std::string GetNym_OutmailServerIDByIndex(const std::string &NYM_ID, const int32_t &nIndex)
EXPORT static OT_COMMANDS_OT int32_t mainAcceptInvoices()
static EXPORT int64_t Basket_GetMemberMinimumTransferAmount(const std::string &BASKET_ASSET_TYPE_ID, const int32_t &nIndex)
static EXPORT std::string Token_GetID(const std::string &SERVER_ID, const std::string &ASSET_TYPE_ID, const std::string &THE_TOKEN)
EXPORT bool Exists(std::string strFolder, std::string oneStr="", std::string twoStr="", std::string threeStr="")
EXPORT static OT_COMMANDS_OT int32_t mainSendInvoice()
EXPORT static OT_COMMANDS_OT int32_t mainGetMarkets()
EXPORT static OT_COMMANDS_OT int32_t mainSendVoucher()
EXPORT static OT_COMMANDS_OT bool show_unconfirmed_parties(const std::string &strSmartContract, int32_t &nPartyCount)
EXPORT static OT_MADE_EASY_OT std::string deposit_payment_plan(const std::string &SERVER_ID, const std::string &NYM_ID, const std::string &THE_PAYMENT_PLAN)
EXPORT static OT_COMMANDS_OT std::string details_export_cash(const std::string &strServerID, const std::string &strFromNymID, const std::string &strAssetTypeID, std::string &strHisNymID, const std::string &strIndices, bool bPasswordProtected, std::string &strRetainedCopy)
EXPORT static OT_COMMANDS_OT int32_t mainShowActive()
static EXPORT int64_t StringToAmount(const std::string &ASSET_TYPE_ID, const std::string &str_input)
static EXPORT std::string GetActiveCronItem(const std::string &SERVER_ID, int64_t lTransNum)
EXPORT static OT_COMMANDS_OT int32_t details_exchange_basket(const std::string &strServer, const std::string &strNym, const std::string &strAcct, const std::string &strBasketType)
static EXPORT std::string Wallet_ImportNym(const std::string &FILE_CONTENTS)
returns NymID if success, else nullptr.
EXPORT static OT_MADE_EASY_OT std::string cancel_payment_plan(const std::string &SERVER_ID, const std::string &NYM_ID, const std::string &THE_PAYMENT_PLAN)
EXPORT static OT_COMMANDS_OT int32_t mainCheckNym()
static EXPORT std::string Purse_Peek(const std::string &SERVER_ID, const std::string &ASSET_TYPE_ID, const std::string &OWNER_ID, const std::string &THE_PURSE)
std::string asset_type_id
EXPORT static OT_COMMANDS_OT std::string details_check_user(const std::string &strServerID, const std::string &strMyNymID, const std::string &strHisNymID)
EXPORT OT_UTILITY_OT bool getIntermediaryFiles(const std::string &serverID, const std::string &nymID, const std::string &accountID)
EXPORT static OT_MADE_EASY_OT std::string get_nym_market_offers(const std::string &SERVER_ID, const std::string &NYM_ID)
static EXPORT int32_t Party_GetAcctCount(const std::string &THE_CONTRACT, const std::string &PARTY_NAME)
int64_t OTTimeGetSecondsFromTime(time64_t time)
static EXPORT int32_t GetNym_SubcredentialCount(const std::string &NYM_ID, const std::string &MASTER_CRED_ID)
static EXPORT std::string Encode(const std::string &strPlaintext, const bool &bLineBreaks)
EXPORT static OT_COMMANDS_OT int32_t mainShowCredential()
static EXPORT std::string GetNym_OutpaymentsContentsByIndex(const std::string &NYM_ID, const int32_t &nIndex)
EXPORT static OT_MADE_EASY_OT std::string deposit_cheque(const std::string &SERVER_ID, const std::string &NYM_ID, const std::string &ACCT_ID, const std::string &STR_CHEQUE)
EXPORT static OT_COMMANDS_OT int32_t details_del_mail(const std::string &strMyNymID, const std::string &strIndices)
EXPORT static OT_MADE_EASY_OT std::string adjust_usage_credits(const std::string &SERVER_ID, const std::string &USER_NYM_ID, const std::string &TARGET_NYM_ID, const std::string &ADJUSTMENT)
EXPORT static OT_MADE_EASY_OT std::string send_transfer(const std::string &SERVER_ID, const std::string &NYM_ID, const std::string &ACCT_FROM, const std::string &ACCT_TO, int64_t AMOUNT, const std::string &NOTE)
EXPORT static OT_COMMANDS_OT int32_t mainClearRecords()
static EXPORT int32_t NumList_Count(const std::string &strNumList)
EXPORT static OT_MADE_EASY_OT std::string activate_smart_contract(const std::string &SERVER_ID, const std::string &NYM_ID, const std::string &ACCT_ID, const std::string &AGENT_NAME, const std::string &THE_SMART_CONTRACT)
static EXPORT time64_t Instrmnt_GetValidTo(const std::string &THE_INSTRUMENT)
static EXPORT std::string Decrypt(const std::string &RECIPIENT_NYM_ID, const std::string &strCiphertext)
static EXPORT bool IsNym_RegisteredAtServer(const std::string &NYM_ID, const std::string &SERVER_ID)
EXPORT static OT_MADE_EASY_OT std::string process_inbox(const std::string &SERVER_ID, const std::string &NYM_ID, const std::string &ACCOUNT_ID, const std::string &RESPONSE_LEDGER)
EXPORT static OT_COMMANDS_OT bool details_import_nym(const std::string &strNymImportFile, std::string &strOutNymID)
EXPORT static OT_COMMANDS_OT int32_t mainInpayments()
EXPORT static OT_MADE_EASY_OT std::string get_market_list(const std::string &SERVER_ID, const std::string &NYM_ID)
EXPORT static OT_COMMANDS_OT int32_t details_nym_stat(const std::string &strID)
EXPORT std::string OT_CLI_ReadUntilEOF()
EXPORT static OT_COMMANDS_OT std::string details_export_nym(const std::string &strNymID)
static EXPORT int32_t GetNym_MailCount(const std::string &NYM_ID)
static EXPORT std::string Message_GetNewAssetTypeID(const std::string &THE_MESSAGE)
EXPORT static OT_COMMANDS_OT int32_t mainShowServers()
EXPORT static OT_COMMANDS_OT int32_t details_deposit(const std::string &strServerID, const std::string &strMyAcctID)
EXPORT static OT_MADE_EASY_OT bool insure_enough_nums(int32_t nNumberNeeded, const std::string &strMyServerID, const std::string &strMyNymID)
EXPORT static OT_COMMANDS_OT int32_t details_import_purse(const std::string &strInstrument, bool bHasPassword, const std::string &strPurseOwner)
static EXPORT int32_t Party_GetAgentCount(const std::string &THE_CONTRACT, const std::string &PARTY_NAME)
EXPORT static OT_COMMANDS_OT int32_t mainProposePlan()
EXPORT static OT_COMMANDS_OT int32_t mainShowRecords()
std::map< std::string, SubMap * > MapOfMaps
static EXPORT bool Nym_RemoveMailByIndex(const std::string &NYM_ID, const int32_t &nIndex)
std::string transaction_id
EXPORT static OT_MADE_EASY_OT std::string kill_payment_plan(const std::string &SERVER_ID, const std::string &NYM_ID, const std::string &ACCT_ID, const std::string &STR_TRANS_NUM)
static EXPORT std::string GetAssetType_Name(const std::string &ASSET_TYPE_ID)
EXPORT static OT_COMMANDS_OT int32_t mainNewBasket()
EXPORT static OT_COMMANDS_OT int32_t mainInmail()
EXPORT OT_OTAPI_OT int32_t iterate_nymoffers_maps(MapOfMaps &map_of_maps, LambdaFunc the_lambda)
static EXPORT bool NumList_VerifyQuery(const std::string &strNumList, const std::string &strNumbers)
EXPORT static OT_COMMANDS_OT int32_t mainOutmail()
EXPORT static OT_COMMANDS_OT int32_t mainGetMyOffers()
EXPORT static OT_COMMANDS_OT int32_t mainWriteInvoice()
EXPORT static OT_COMMANDS_OT int32_t mainShowPayment()
static EXPORT std::string WriteCheque(const std::string &SERVER_ID, const int64_t &CHEQUE_AMOUNT, const time64_t &VALID_FROM, const time64_t &VALID_TO, const std::string &SENDER_ACCT_ID, const std::string &SENDER_USER_ID, const std::string &CHEQUE_MEMO, const std::string &RECIPIENT_USER_ID)
EXPORT static OT_COMMANDS_OT OTDB::OfferListMarket * loadMarketOffers(const std::string &strerverID, const std::string &strMarketID)
static EXPORT std::string GetAccountWallet_AssetTypeID(const std::string &ACCOUNT_ID)
EXPORT static OT_COMMANDS_OT int32_t mainNewAsset()
static EXPORT std::string GetNym_RevokedCredID(const std::string &NYM_ID, const int32_t &nIndex)
EXPORT static OT_COMMANDS_OT int32_t details_send_cash(std::string &strResponse, const std::string &strServerID, const std::string &strAssetTypeID, const std::string &strMyNymID, const std::string &strMyAcctID, std::string &strHisNymID, const std::string &strMemo, const std::string &strAmount, std::string &strIndices, bool bPasswordProtected)
static EXPORT std::string GetAccountWallet_ServerID(const std::string &ACCOUNT_ID)
EXPORT static OT_COMMANDS_OT int32_t mainAcceptInbox()
EXPORT static OT_COMMANDS_OT int32_t details_new_basket(const std::string &strServer, const std::string &strNym)
static EXPORT std::string Wallet_GetServerIDFromPartial(const std::string &PARTIAL_ID)
std::string price_per_scale
EXPORT static OT_COMMANDS_OT int32_t mainTransfer()
static EXPORT std::string Transaction_GetType(const std::string &SERVER_ID, const std::string &USER_ID, const std::string &ACCOUNT_ID, const std::string &THE_TRANSACTION)
Get Transaction Type (internally uses GetTransactionTypeString().)
EXPORT static OT_COMMANDS_OT int32_t details_withdraw_cash(const std::string &strMyAcctID, int64_t lAmount)
EXPORT static OT_COMMANDS_OT bool show_outpayment(const std::string &strMyNym, int32_t nIndex, bool bShowInFull)
EXPORT static OT_COMMANDS_OT int32_t details_withdraw_voucher(std::string &strOutput)
EXPORT static OT_COMMANDS_OT int32_t mainPasswordEncrypt()
static EXPORT int32_t Smart_GetPartyCount(const std::string &THE_CONTRACT)
EXPORT static OT_COMMANDS_OT int32_t mainEncode()
static EXPORT bool Purse_HasPassword(const std::string &SERVER_ID, const std::string &THE_PURSE)