Open-Transactions  0.93.0-ge03d287
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Pages
OT_ME.cpp
Go to the documentation of this file.
1 /************************************************************
2 *
3 * OT_ME.cpp
4 *
5 */
6 
7 /************************************************************
8  -----BEGIN PGP SIGNED MESSAGE-----
9  Hash: SHA1
10 
11  * OPEN TRANSACTIONS
12  *
13  * Financial Cryptography and Digital Cash
14  * Library, Protocol, API, Server, CLI, GUI
15  *
16  * -- Anonymous Numbered Accounts.
17  * -- Untraceable Digital Cash.
18  * -- Triple-Signed Receipts.
19  * -- Cheques, Vouchers, Transfers, Inboxes.
20  * -- Basket Currencies, Markets, Payment Plans.
21  * -- Signed, XML, Ricardian-style Contracts.
22  * -- Scripted smart contracts.
23  *
24  * Copyright (C) 2010-2013 by "Fellow Traveler" (A pseudonym)
25  *
26  * EMAIL:
28  *
29  * BITCOIN: 1NtTPVVjDsUfDWybS4BwvHpG2pdS9RnYyQ
30  *
31  * KEY FINGERPRINT (PGP Key in license file):
32  * 9DD5 90EB 9292 4B48 0484 7910 0308 00ED F951 BB8E
33  *
34  * OFFICIAL PROJECT WIKI(s):
35  * https://github.com/FellowTraveler/Moneychanger
36  * https://github.com/FellowTraveler/Open-Transactions/wiki
37  *
38  * WEBSITE:
39  * http://www.OpenTransactions.org/
40  *
41  * Components and licensing:
42  * -- Moneychanger..A Java client GUI.....LICENSE:.....GPLv3
43  * -- otlib.........A class library.......LICENSE:...LAGPLv3
44  * -- otapi.........A client API..........LICENSE:...LAGPLv3
45  * -- opentxs/ot....Command-line client...LICENSE:...LAGPLv3
46  * -- otserver......Server Application....LICENSE:....AGPLv3
47  * Github.com/FellowTraveler/Open-Transactions/wiki/Components
48  *
49  * All of the above OT components were designed and written by
50  * Fellow Traveler, with the exception of Moneychanger, which
51  * was contracted out to Vicky C ([email protected]).
52  * The open-source community has since actively contributed.
53  *
54  * -----------------------------------------------------
55  *
56  * LICENSE:
57  * This program is free software: you can redistribute it
58  * and/or modify it under the terms of the GNU Affero
59  * General Public License as published by the Free Software
60  * Foundation, either version 3 of the License, or (at your
61  * option) any later version.
62  *
63  * ADDITIONAL PERMISSION under the GNU Affero GPL version 3
64  * section 7: (This paragraph applies only to the LAGPLv3
65  * components listed above.) If you modify this Program, or
66  * any covered work, by linking or combining it with other
67  * code, such other code is not for that reason alone subject
68  * to any of the requirements of the GNU Affero GPL version 3.
69  * (==> This means if you are only using the OT API, then you
70  * don't have to open-source your code--only your changes to
71  * Open-Transactions itself must be open source. Similar to
72  * LGPLv3, except it applies to software-as-a-service, not
73  * just to distributing binaries.)
74  *
75  * Extra WAIVER for OpenSSL, Lucre, and all other libraries
76  * used by Open Transactions: This program is released under
77  * the AGPL with the additional exemption that compiling,
78  * linking, and/or using OpenSSL is allowed. The same is true
79  * for any other open source libraries included in this
80  * project: complete waiver from the AGPL is hereby granted to
81  * compile, link, and/or use them with Open-Transactions,
82  * according to their own terms, as long as the rest of the
83  * Open-Transactions terms remain respected, with regard to
84  * the Open-Transactions code itself.
85  *
86  * Lucre License:
87  * This code is also "dual-license", meaning that Ben Lau-
88  * rie's license must also be included and respected, since
89  * the code for Lucre is also included with Open Transactions.
90  * See Open-Transactions/src/otlib/lucre/LUCRE_LICENSE.txt
91  * The Laurie requirements are light, but if there is any
92  * problem with his license, simply remove the Lucre code.
93  * Although there are no other blind token algorithms in Open
94  * Transactions (yet. credlib is coming), the other functions
95  * will continue to operate.
96  * See Lucre on Github: https://github.com/benlaurie/lucre
97  * -----------------------------------------------------
98  * You should have received a copy of the GNU Affero General
99  * Public License along with this program. If not, see:
100  * http://www.gnu.org/licenses/
101  *
102  * If you would like to use this software outside of the free
103  * software license, please contact FellowTraveler.
104  * (Unfortunately many will run anonymously and untraceably,
105  * so who could really stop them?)
106  *
107  * DISCLAIMER:
108  * This program is distributed in the hope that it will be
109  * useful, but WITHOUT ANY WARRANTY; without even the implied
110  * warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR
111  * PURPOSE. See the GNU Affero General Public License for
112  * more details.
113 
114  -----BEGIN PGP SIGNATURE-----
115  Version: GnuPG v1.4.9 (Darwin)
116 
117  iQIcBAEBAgAGBQJRSsfJAAoJEAMIAO35UbuOQT8P/RJbka8etf7wbxdHQNAY+2cC
118  vDf8J3X8VI+pwMqv6wgTVy17venMZJa4I4ikXD/MRyWV1XbTG0mBXk/7AZk7Rexk
119  KTvL/U1kWiez6+8XXLye+k2JNM6v7eej8xMrqEcO0ZArh/DsLoIn1y8p8qjBI7+m
120  aE7lhstDiD0z8mwRRLKFLN2IH5rAFaZZUvj5ERJaoYUKdn4c+RcQVei2YOl4T0FU
121  LWND3YLoH8naqJXkaOKEN4UfJINCwxhe5Ke9wyfLWLUO7NamRkWD2T7CJ0xocnD1
122  sjAzlVGNgaFDRflfIF4QhBx1Ddl6wwhJfw+d08bjqblSq8aXDkmFA7HeunSFKkdn
123  oIEOEgyj+veuOMRJC5pnBJ9vV+7qRdDKQWaCKotynt4sWJDGQ9kWGWm74SsNaduN
124  TPMyr9kNmGsfR69Q2Zq/FLcLX/j8ESxU+HYUB4vaARw2xEOu2xwDDv6jt0j3Vqsg
125  x7rWv4S/Eh18FDNDkVRChiNoOIilLYLL6c38uMf1pnItBuxP3uhgY6COm59kVaRh
126  nyGTYCDYD2TK+fI9o89F1297uDCwEJ62U0Q7iTDp5QuXCoxkPfv8/kX6lS6T3y9G
127  M9mqIoLbIQ1EDntFv7/t6fUTS2+46uCrdZWbQ5RjYXdrzjij02nDmJAm2BngnZvd
128  kamH0Y/n11lCvo1oQxM+
129  =uSzz
130  -----END PGP SIGNATURE-----
131  **************************************************************/
132 
133 #include "../core/stdafx.hpp"
134 
135 #include "OT_ME.hpp"
136 #include "OTAPI.hpp"
137 #include "OTMeCpp.hpp"
138 
139 #include "../core/util/OTDataFolder.hpp"
140 #include "../core/OTLog.hpp"
141 #include "../core/util/OTPaths.hpp"
142 #include "../core/OTStorage.hpp"
143 #include "../core/script/OTVariable.hpp"
144 
145 #ifdef OT_USE_SCRIPT_CHAI
146 #include "../core/script/OTScriptChai.hpp"
147 #include <chaiscript/chaiscript.hpp>
148 #ifdef OT_USE_CHAI_STDLIB
149 #include <chaiscript/chaiscript_stdlib.hpp>
150 #endif
151 #endif
152 
153 namespace opentxs
154 {
155 
156 OT_ME* OT_ME::s_pMe = nullptr;
157 
159  : r_pPrev(nullptr)
160 {
161  r_pPrev = s_pMe;
162  s_pMe = this;
163  m_pImplementation = new OTMeCpp;
164 }
165 
167 {
168  s_pMe = r_pPrev;
169 }
170 
171 typedef std::map<std::string, std::string> mapOfArguments;
172 
173 // int32_t OT_CLI_GetArgsCount (std::string str_Args);
174 // std::string OT_CLI_GetValueByKey (std::string str_Args,
175 // std::string str_key);
176 // std::string OT_CLI_GetValueByIndex (std::string str_Args,
177 // int32_t nIndex);
178 // std::string OT_CLI_GetKeyByIndex (std::string str_Args,
179 // int32_t nIndex);
180 
181 // If user-defined script arguments were passed,
182 // using: --Args "key value key value key value"
183 // then this function returns the count of key/value
184 // pairs available. (In that example, the return
185 // value would be 3.)
186 //
187 int32_t OT_CLI_GetArgsCount(const std::string& str_Args)
188 {
189  const OTString strArgs(str_Args);
190  int32_t nRetVal = 0;
191  mapOfArguments map_values;
192  const bool bTokenized = strArgs.TokenizeIntoKeyValuePairs(map_values);
193  if (bTokenized) nRetVal = static_cast<int32_t>(map_values.size());
194  return nRetVal;
195 }
196 
197 // If user-defined script arguments were passed,
198 // using: --Args "key value key value key value"
199 // then this function can retrieve any value (by key.)
200 //
201 std::string OT_CLI_GetValueByKey(const std::string& str_Args,
202  const std::string& str_key)
203 {
204  const OTString strArgs(str_Args);
205  std::string str_retval = "";
206  mapOfArguments map_values;
207  const bool bTokenized = strArgs.TokenizeIntoKeyValuePairs(map_values);
208  if (bTokenized && (!map_values.empty())) {
209  // Okay we now have key/value pairs -- let's look it up!
210  auto it = map_values.find(str_key);
211 
212  if (map_values.end() != it) // found it
213  str_retval = it->second;
214  }
215  return str_retval;
216 }
217 
218 // If user-defined script arguments were passed,
219 // using: --Args "key value key value key value"
220 // then this function can retrieve any value (by index.)
221 //
222 std::string OT_CLI_GetValueByIndex(const std::string& str_Args, int32_t nIndex)
223 {
224  const OTString strArgs(str_Args);
225  std::string str_retval = "";
226  mapOfArguments map_values;
227  const bool bTokenized = strArgs.TokenizeIntoKeyValuePairs(map_values);
228  if (bTokenized && (nIndex < static_cast<int32_t>(map_values.size()))) {
229  int32_t nMapIndex = (-1);
230  for (auto& it : map_values) {
231  ++nMapIndex;
232  // const std::string str_key = it->first;
233  // const std::string str_val = it->second;
234  // BY this point, nMapIndex contains the index we're at on
235  // map_values
236  // (compare to nIndex.) And str_key and str_val contain the
237  // key/value
238  // pair for THAT index.
239  //
240  if (nIndex == nMapIndex) {
241  str_retval = it.second; // Found it!
242  break;
243  }
244  }
245  }
246  return str_retval;
247 }
248 
249 // If user-defined script arguments were passed,
250 // using: --Args "key value key value key value"
251 // then this function can retrieve any key (by index.)
252 //
253 std::string OT_CLI_GetKeyByIndex(const std::string& str_Args, int32_t nIndex)
254 {
255  const OTString strArgs(str_Args);
256  std::string str_retval = "";
257  mapOfArguments map_values;
258  const bool bTokenized = strArgs.TokenizeIntoKeyValuePairs(map_values);
259  if (bTokenized && (nIndex < static_cast<int32_t>(map_values.size()))) {
260  int32_t nMapIndex = (-1);
261  for (auto& it : map_values) {
262  ++nMapIndex;
263  // const std::string str_key = it->first;
264  // const std::string str_val = it->second;
265  // BY this point, nMapIndex contains the index we're at on
266  // map_values
267  // (compare to nIndex.) And str_key and str_val contain the
268  // key/value
269  // pair for THAT index.
270  //
271  if (nIndex == nMapIndex) {
272  str_retval = it.first; // Found it!
273  break;
274  }
275  }
276  }
277  return str_retval;
278 }
279 
280 // Reads from cin until Newline.
281 //
282 std::string OT_CLI_ReadLine()
283 {
284  std::string line;
285  if (std::getline(std::cin, line)) {
286  return line;
287  }
288 
289  return "";
290 }
291 
292 // Reads from cin until EOF. (Or until the ~ character as the first character on
293 // a line.)
294 //
295 std::string OT_CLI_ReadUntilEOF()
296 {
297  // don't skip the whitespace while reading
298  // std::cin >> std::noskipws;
299 
300  // std::ostringstream oss;
301  //
302  // oss << std::cin; // Convert value into a string.
303  // s = outs.str();
304 
305  // use stream iterators to copy the stream to a string
306  // std::istream_iterator<std::string> it(std::cin);
307  // std::istream_iterator<std::string> end;
308  // std::istream_iterator<char> it(std::cin);
309  // std::istream_iterator<char> end;
310  // std::string results(it, end);
311 
312  // int32_t onechar;
313 
314  std::string result("");
315 
316  for (;;) {
317  std::string input_line("");
318 
319  // int32_t n;
321  // std::stringstream ssn;
322  //
323  // std::getline(std::cin, input_line);
324  // ssn << input_line;
325  // ssn >> n;
326 
327  // std::getline(std::cin, input_line, '\n');
328  if (std::getline(std::cin, input_line, '\n')) {
329  input_line += "\n";
330 
331  if (input_line[0] == '~') // This is our special "break" character
332  // for multi-line input.
333  break;
334 
335  result += input_line;
336  }
337  else {
338  otErr << "OT_CLI_ReadUntilEOF: getline() was unable to read a "
339  "string from std::cin\n";
340  break;
341  }
342  if (std::cin.eof()) {
343  // cout << "IT WAS EOF\n";
344  std::cin.clear();
345  break;
346  }
347  if (std::cin.fail()) {
348  // cout << "IT WAS FAIL\n";
349  std::cin.clear();
350  break;
351  }
352  if (std::cin.bad()) {
353  // cout << "IT WAS BAD\n";
354  std::cin.clear();
355  break;
356  }
357  // std::cin.clear();
358  // std::cin.ignore(std::numeric_limits<std::streamsize>::max(),
359  // '\n');
360 
361  } // while
362 
363  return result;
364 }
365 
366 // Note optimization:
367 // Until the actual C++ high-level API is written, we'll just use this
368 // as a C++ wrapper to the existing high-level API written in OT Script.
369 // Tha way, all the other languages can wrap this using swig.
370 //
371 // Notice (for those languages) that if you make an instance of OT_ME
372 // and keep it around (using it for all your server calls) notice that
373 // it will only have to instantiate and setup the OTScript object ONCE,
374 // instead of having to do it for every single call.
375 //
376 // Therefore, for optimization purposes, we recommend the programmatic
377 // user to keep an instance of OT_ME around as long as you need to use it,
378 // and NOT instantiate it for every time you need to use it, as it will
379 // probably run noticeably faster.
380 //
381 
382 bool OT_ME::make_sure_enough_trans_nums(int32_t nNumberNeeded,
383  const std::string& SERVER_ID,
384  const std::string& NYM_ID) const
385 {
386  return m_pImplementation->make_sure_enough_trans_nums(nNumberNeeded,
387  SERVER_ID, NYM_ID);
388 }
389 
390 // REGISTER NYM AT SERVER (or download nymfile, if nym already registered.)
391 //
392 std::string OT_ME::register_nym(const std::string& SERVER_ID,
393  const std::string& NYM_ID) const
394 {
395  return m_pImplementation->register_nym(SERVER_ID, NYM_ID);
396 }
397 
398 // CHECK USER (download a public key)
399 //
400 std::string OT_ME::check_user(const std::string& SERVER_ID,
401  const std::string& NYM_ID,
402  const std::string& TARGET_NYM_ID) const
403 {
404  return m_pImplementation->check_user(SERVER_ID, NYM_ID, TARGET_NYM_ID);
405 }
406 
407 // CREATE NYM
408 // returns new Nym ID
409 //
410 std::string OT_ME::create_nym(int32_t nKeybits,
411  const std::string& NYM_ID_SOURCE,
412  const std::string& ALT_LOCATION) const
413 {
414  return m_pImplementation->create_nym(nKeybits, NYM_ID_SOURCE, ALT_LOCATION);
415 }
416 
417 // ISSUE ASSET TYPE
418 //
419 std::string OT_ME::issue_asset_type(const std::string& SERVER_ID,
420  const std::string& NYM_ID,
421  const std::string& THE_CONTRACT) const
422 {
423  return m_pImplementation->issue_asset_type(SERVER_ID, NYM_ID, THE_CONTRACT);
424 }
425 
426 // ISSUE BASKET CURRENCY
427 //
428 std::string OT_ME::issue_basket_currency(const std::string& SERVER_ID,
429  const std::string& NYM_ID,
430  const std::string& THE_BASKET) const
431 {
432  return m_pImplementation->issue_basket_currency(SERVER_ID, NYM_ID,
433  THE_BASKET);
434 }
435 
436 // EXCHANGE BASKET CURRENCY
437 //
438 std::string OT_ME::exchange_basket_currency(const std::string& SERVER_ID,
439  const std::string& NYM_ID,
440  const std::string& ASSET_TYPE_ID,
441  const std::string& THE_BASKET,
442  const std::string& ACCOUNT_ID,
443  bool IN_OR_OUT) const
444 {
445  return m_pImplementation->exchange_basket_currency(
446  SERVER_ID, NYM_ID, ASSET_TYPE_ID, THE_BASKET, ACCOUNT_ID, IN_OR_OUT);
447 }
448 
449 // RETRIEVE CONTRACT
450 //
451 std::string OT_ME::retrieve_contract(const std::string& SERVER_ID,
452  const std::string& NYM_ID,
453  const std::string& CONTRACT_ID) const
454 {
455  return m_pImplementation->retrieve_contract(SERVER_ID, NYM_ID, CONTRACT_ID);
456 }
457 
458 // LOAD OR RETRIEVE CONTRACT
459 //
461  const std::string& SERVER_ID, const std::string& NYM_ID,
462  const std::string& CONTRACT_ID) const
463 {
464  return m_pImplementation->load_or_retrieve_contract(SERVER_ID, NYM_ID,
465  CONTRACT_ID);
466 }
467 
468 // CREATE ASSET ACCOUNT
469 //
470 std::string OT_ME::create_asset_acct(const std::string& SERVER_ID,
471  const std::string& NYM_ID,
472  const std::string& ASSET_TYPE_ID) const
473 {
474  return m_pImplementation->create_asset_acct(SERVER_ID, NYM_ID,
475  ASSET_TYPE_ID);
476 }
477 
478 std::string OT_ME::stat_asset_account(const std::string& ACCOUNT_ID) const
479 {
480  return m_pImplementation->stat_asset_account(ACCOUNT_ID);
481 }
482 
483 // DOWNLOAD ACCOUNT FILES (account balance, inbox, outbox, etc)
484 //
485 bool OT_ME::retrieve_account(const std::string& SERVER_ID,
486  const std::string& NYM_ID,
487  const std::string& ACCOUNT_ID,
488  bool bForceDownload) const
489 {
490  return m_pImplementation->retrieve_account(SERVER_ID, NYM_ID, ACCOUNT_ID,
491  bForceDownload);
492 }
493 
494 bool OT_ME::retrieve_nym(const std::string& SERVER_ID,
495  const std::string& NYM_ID, bool bForceDownload) const
496 {
497  return m_pImplementation->retrieve_nym(SERVER_ID, NYM_ID, bForceDownload);
498 }
499 
500 // SEND TRANSFER -- TRANSACTION
501 //
502 std::string OT_ME::send_transfer(const std::string& SERVER_ID,
503  const std::string& NYM_ID,
504  const std::string& ACCT_FROM,
505  const std::string& ACCT_TO, int64_t AMOUNT,
506  const std::string& NOTE) const
507 {
508  return m_pImplementation->send_transfer(SERVER_ID, NYM_ID, ACCT_FROM,
509  ACCT_TO, AMOUNT, NOTE);
510 }
511 
512 // PROCESS INBOX -- TRANSACTION
513 //
514 std::string OT_ME::process_inbox(const std::string& SERVER_ID,
515  const std::string& NYM_ID,
516  const std::string& ACCOUNT_ID,
517  const std::string& RESPONSE_LEDGER) const
518 {
519  return m_pImplementation->process_inbox(SERVER_ID, NYM_ID, ACCOUNT_ID,
520  RESPONSE_LEDGER);
521 }
522 
523 bool OT_ME::accept_inbox_items(const std::string& ACCOUNT_ID, int32_t nItemType,
524  const std::string& INDICES) const
525 {
526  return m_pImplementation->accept_inbox_items(ACCOUNT_ID, nItemType,
527  INDICES);
528 }
529 
530 bool OT_ME::discard_incoming_payments(const std::string& SERVER_ID,
531  const std::string& NYM_ID,
532  const std::string& INDICES) const
533 {
534  return m_pImplementation->discard_incoming_payments(SERVER_ID, NYM_ID,
535  INDICES);
536 }
537 
538 bool OT_ME::cancel_outgoing_payments(const std::string& NYM_ID,
539  const std::string& ACCOUNT_ID,
540  const std::string& INDICES) const
541 {
542  return m_pImplementation->cancel_outgoing_payments(NYM_ID, ACCOUNT_ID,
543  INDICES);
544 }
545 
546 bool OT_ME::accept_from_paymentbox(const std::string& ACCOUNT_ID,
547  const std::string& INDICES,
548  const std::string& PAYMENT_TYPE) const
549 {
550  return m_pImplementation->accept_from_paymentbox(ACCOUNT_ID, INDICES,
551  PAYMENT_TYPE);
552 }
553 
554 // load_public_key():
555 //
556 // Load a public key from local storage, and return it (or null).
557 //
558 std::string OT_ME::load_public_encryption_key(const std::string& NYM_ID) const
559 {
560  return m_pImplementation->load_public_encryption_key(NYM_ID);
561 }
562 
563 std::string OT_ME::load_public_signing_key(const std::string& NYM_ID) const
564 {
565  return m_pImplementation->load_public_signing_key(NYM_ID);
566 }
567 
568 //
569 // load_or_retrieve_pubkey()
570 //
571 // Load TARGET_NYM_ID from local storage.
572 // If not there, then retrieve TARGET_NYM_ID from server,
573 // using NYM_ID to send check_user request. Then re-load
574 // and return. (Might still return null.)
575 //
577  const std::string& SERVER_ID, const std::string& NYM_ID,
578  const std::string& TARGET_NYM_ID) const
579 {
580  return m_pImplementation->load_or_retrieve_encrypt_key(SERVER_ID, NYM_ID,
581  TARGET_NYM_ID);
582 }
583 
585  const std::string& SERVER_ID, const std::string& NYM_ID,
586  const std::string& TARGET_NYM_ID) const
587 {
588  return m_pImplementation->load_or_retrieve_signing_key(SERVER_ID, NYM_ID,
589  TARGET_NYM_ID);
590 }
591 
592 // SEND USER MESSAGE (requires recipient public key)
593 //
594 std::string OT_ME::send_user_msg_pubkey(const std::string& SERVER_ID,
595  const std::string& NYM_ID,
596  const std::string& RECIPIENT_NYM_ID,
597  const std::string& RECIPIENT_PUBKEY,
598  const std::string& THE_MESSAGE) const
599 {
600  return m_pImplementation->send_user_msg_pubkey(
601  SERVER_ID, NYM_ID, RECIPIENT_NYM_ID, RECIPIENT_PUBKEY, THE_MESSAGE);
602 }
603 
604 // SEND USER INSTRUMENT (requires recipient public key)
605 //
607  const std::string& SERVER_ID, const std::string& NYM_ID,
608  const std::string& RECIPIENT_NYM_ID, const std::string& RECIPIENT_PUBKEY,
609  const std::string& THE_INSTRUMENT) const
610 {
611  return m_pImplementation->send_user_pmnt_pubkey(
612  SERVER_ID, NYM_ID, RECIPIENT_NYM_ID, RECIPIENT_PUBKEY, THE_INSTRUMENT);
613 }
614 
615 // SEND USER CASH (requires recipient public key)
616 //
618  const std::string& SERVER_ID, const std::string& NYM_ID,
619  const std::string& RECIPIENT_NYM_ID, const std::string& RECIPIENT_PUBKEY,
620  const std::string& THE_INSTRUMENT,
621  const std::string& INSTRUMENT_FOR_SENDER) const
622 {
623  return m_pImplementation->send_user_cash_pubkey(
624  SERVER_ID, NYM_ID, RECIPIENT_NYM_ID, RECIPIENT_PUBKEY, THE_INSTRUMENT,
625  INSTRUMENT_FOR_SENDER);
626 }
627 
628 // SEND USER MESSAGE (only requires recipient's ID, and retrieves pubkey
629 // automatically)
630 //
631 std::string OT_ME::send_user_msg(const std::string& SERVER_ID,
632  const std::string& NYM_ID,
633  const std::string& RECIPIENT_NYM_ID,
634  const std::string& THE_MESSAGE) const
635 {
636  return m_pImplementation->send_user_msg(SERVER_ID, NYM_ID, RECIPIENT_NYM_ID,
637  THE_MESSAGE);
638 }
639 
640 // SEND USER PAYMENT (only requires recipient's ID, and retrieves pubkey
641 // automatically)
642 //
643 std::string OT_ME::send_user_payment(const std::string& SERVER_ID,
644  const std::string& NYM_ID,
645  const std::string& RECIPIENT_NYM_ID,
646  const std::string& THE_PAYMENT) const
647 {
648  return m_pImplementation->send_user_payment(SERVER_ID, NYM_ID,
649  RECIPIENT_NYM_ID, THE_PAYMENT);
650 }
651 
652 // SEND USER CASH (only requires recipient's ID, and retrieves pubkey
653 // automatically)
654 //
655 std::string OT_ME::send_user_cash(const std::string& SERVER_ID,
656  const std::string& NYM_ID,
657  const std::string& RECIPIENT_NYM_ID,
658  const std::string& THE_PAYMENT,
659  const std::string& SENDERS_COPY) const
660 {
661  return m_pImplementation->send_user_cash(
662  SERVER_ID, NYM_ID, RECIPIENT_NYM_ID, THE_PAYMENT, SENDERS_COPY);
663 }
664 
665 bool OT_ME::withdraw_and_send_cash(const std::string& ACCT_ID,
666  const std::string& RECIPIENT_NYM_ID,
667  const std::string& MEMO,
668  int64_t AMOUNT) const
669 {
670  return m_pImplementation->withdraw_and_send_cash(ACCT_ID, RECIPIENT_NYM_ID,
671  MEMO, AMOUNT);
672 }
673 
674 // GET PAYMENT INSTRUMENT (from payments inbox, by index.)
675 //
677  const std::string& SERVER_ID, const std::string& NYM_ID, int32_t nIndex,
678  const std::string& PRELOADED_INBOX) const
679 {
680  return m_pImplementation->get_payment_instrument(SERVER_ID, NYM_ID, nIndex,
681  PRELOADED_INBOX);
682 }
683 
684 // GET BOX RECEIPT
685 // Note: nBoxType is 0 for Nymbox, 1 for Inbox, and 2 for Outbox.
686 // Also, if nBoxType is 0 (nymbox) then you have to pass the NymID in the
687 // ACCT_ID
688 // argument, as well as the NYM_ID argument (you have to pass it twice...)
689 // Otherwise for inbox/outbox, pass the actual ACCT_ID there as normal.
690 //
691 std::string OT_ME::get_box_receipt(const std::string& SERVER_ID,
692  const std::string& NYM_ID,
693  const std::string& ACCT_ID, int32_t nBoxType,
694  int64_t TRANS_NUM) const
695 {
696  return m_pImplementation->get_box_receipt(SERVER_ID, NYM_ID, ACCT_ID,
697  nBoxType, TRANS_NUM);
698 }
699 
700 // DOWNLOAD PUBLIC MINT
701 //
702 std::string OT_ME::retrieve_mint(const std::string& SERVER_ID,
703  const std::string& NYM_ID,
704  const std::string& ASSET_ID) const
705 {
706  return m_pImplementation->retrieve_mint(SERVER_ID, NYM_ID, ASSET_ID);
707 }
708 
709 // LOAD MINT (from local storage)
710 //
711 // To load a mint withOUT retrieving it from server, call:
712 //
713 // var strMint = OT_API_LoadMint(SERVER_ID, ASSET_ID);
714 // It returns the mint, or null.
715 // LOAD MINT (from local storage).
716 // Also, if necessary, RETRIEVE it from the server first.
717 //
718 // Returns the mint, or null.
719 //
720 std::string OT_ME::load_or_retrieve_mint(const std::string& SERVER_ID,
721  const std::string& NYM_ID,
722  const std::string& ASSET_ID) const
723 {
724  return m_pImplementation->load_or_retrieve_mint(SERVER_ID, NYM_ID,
725  ASSET_ID);
726 }
727 
728 // QUERY ASSET TYPES
729 //
730 // See if some asset types are issued on the server.
731 //
732 std::string OT_ME::query_asset_types(const std::string& SERVER_ID,
733  const std::string& NYM_ID,
734  const std::string& ENCODED_MAP) const
735 {
736  return m_pImplementation->query_asset_types(SERVER_ID, NYM_ID, ENCODED_MAP);
737 }
738 
739 // CREATE MARKET OFFER -- TRANSACTION
740 //
742  const std::string& ASSET_ACCT_ID, const std::string& CURRENCY_ACCT_ID,
743  int64_t scale, int64_t minIncrement, int64_t quantity, int64_t price,
744  bool bSelling, int64_t lLifespanInSeconds, const std::string& STOP_SIGN,
745  int64_t ACTIVATION_PRICE) const
746 {
747  return m_pImplementation->create_market_offer(
748  ASSET_ACCT_ID, CURRENCY_ACCT_ID, scale, minIncrement, quantity, price,
749  bSelling, lLifespanInSeconds, STOP_SIGN, ACTIVATION_PRICE);
750 }
751 
752 // KILL MARKET OFFER -- TRANSACTION
753 //
754 std::string OT_ME::kill_market_offer(const std::string& SERVER_ID,
755  const std::string& NYM_ID,
756  const std::string& ASSET_ACCT_ID,
757  int64_t TRANS_NUM) const
758 {
759  return m_pImplementation->kill_market_offer(SERVER_ID, NYM_ID,
760  ASSET_ACCT_ID, TRANS_NUM);
761 }
762 
763 // KILL (ACTIVE) PAYMENT PLAN -- TRANSACTION
764 //
765 std::string OT_ME::kill_payment_plan(const std::string& SERVER_ID,
766  const std::string& NYM_ID,
767  const std::string& ACCT_ID,
768  int64_t TRANS_NUM) const
769 {
770  return m_pImplementation->kill_payment_plan(SERVER_ID, NYM_ID, ACCT_ID,
771  TRANS_NUM);
772 }
773 
774 // CANCEL (NOT-YET-RUNNING) PAYMENT PLAN -- TRANSACTION
775 //
777  const std::string& SERVER_ID, const std::string& NYM_ID,
778  const std::string& THE_PAYMENT_PLAN) const
779 {
780  return m_pImplementation->cancel_payment_plan(SERVER_ID, NYM_ID,
781  THE_PAYMENT_PLAN);
782 }
783 
784 // ACTIVATE SMART CONTRACT -- TRANSACTION
785 //
787  const std::string& SERVER_ID, const std::string& NYM_ID,
788  const std::string& ACCT_ID, const std::string& AGENT_NAME,
789  const std::string& THE_SMART_CONTRACT) const
790 {
791  return m_pImplementation->activate_smart_contract(
792  SERVER_ID, NYM_ID, ACCT_ID, AGENT_NAME, THE_SMART_CONTRACT);
793 }
794 
795 // TRIGGER CLAUSE (on running smart contract) -- TRANSACTION
796 //
797 std::string OT_ME::trigger_clause(const std::string& SERVER_ID,
798  const std::string& NYM_ID, int64_t TRANS_NUM,
799  const std::string& CLAUSE_NAME,
800  const std::string& STR_PARAM) const
801 {
802  return m_pImplementation->trigger_clause(SERVER_ID, NYM_ID, TRANS_NUM,
803  CLAUSE_NAME, STR_PARAM);
804 }
805 
806 // WITHDRAW CASH -- TRANSACTION
807 //
808 std::string OT_ME::withdraw_cash(const std::string& SERVER_ID,
809  const std::string& NYM_ID,
810  const std::string& ACCT_ID,
811  int64_t AMOUNT) const
812 {
813  return m_pImplementation->withdraw_cash(SERVER_ID, NYM_ID, ACCT_ID, AMOUNT);
814 }
815 
816 // Difference between this function and the one above?
817 // This one automatically retrieves the mint beforehand, if necessary,
818 // and the account files afterward, if appropriate.
819 //
820 bool OT_ME::easy_withdraw_cash(const std::string& ACCT_ID, int64_t AMOUNT) const
821 {
822  return m_pImplementation->easy_withdraw_cash(ACCT_ID, AMOUNT);
823 }
824 
825 // EXPORT CASH (FROM PURSE)
826 //
827 std::string OT_ME::export_cash(const std::string& SERVER_ID,
828  const std::string& FROM_NYM_ID,
829  const std::string& ASSET_TYPE_ID,
830  const std::string& TO_NYM_ID,
831  const std::string& STR_INDICES,
832  bool bPasswordProtected,
833  std::string& STR_RETAINED_COPY) const
834 {
835  return m_pImplementation->export_cash(
836  SERVER_ID, FROM_NYM_ID, ASSET_TYPE_ID, TO_NYM_ID, STR_INDICES,
837  bPasswordProtected, STR_RETAINED_COPY);
838 }
839 
840 // WITHDRAW VOUCHER -- TRANSACTION
841 //
842 std::string OT_ME::withdraw_voucher(const std::string& SERVER_ID,
843  const std::string& NYM_ID,
844  const std::string& ACCT_ID,
845  const std::string& RECIP_NYM_ID,
846  const std::string& STR_MEMO,
847  int64_t AMOUNT) const
848 {
849  return m_pImplementation->withdraw_voucher(SERVER_ID, NYM_ID, ACCT_ID,
850  RECIP_NYM_ID, STR_MEMO, AMOUNT);
851 }
852 
853 // PAY DIVIDEND -- TRANSACTION
854 //
855 std::string OT_ME::pay_dividend(const std::string& SERVER_ID,
856  const std::string& NYM_ID,
857  const std::string& SOURCE_ACCT_ID,
858  const std::string& SHARES_ASSET_ID,
859  const std::string& STR_MEMO,
860  int64_t AMOUNT_PER_SHARE) const
861 {
862  return m_pImplementation->pay_dividend(SERVER_ID, NYM_ID, SOURCE_ACCT_ID,
863  SHARES_ASSET_ID, STR_MEMO,
864  AMOUNT_PER_SHARE);
865 }
866 
867 std::string OT_ME::deposit_cheque(const std::string& SERVER_ID,
868  const std::string& NYM_ID,
869  const std::string& ACCT_ID,
870  const std::string& STR_CHEQUE) const
871 {
872 
873  return m_pImplementation->deposit_cheque(SERVER_ID, NYM_ID, ACCT_ID,
874  STR_CHEQUE);
875 }
876 
877 bool OT_ME::deposit_cash(const std::string& SERVER_ID,
878  const std::string& NYM_ID, const std::string& ACCT_ID,
879  const std::string& STR_PURSE) const
880 {
881  return m_pImplementation->deposit_cash(SERVER_ID, NYM_ID, ACCT_ID,
882  STR_PURSE);
883 }
884 
885 bool OT_ME::deposit_local_purse(const std::string& SERVER_ID,
886  const std::string& NYM_ID,
887  const std::string& ACCT_ID,
888  const std::string& STR_INDICES) const
889 {
890  return m_pImplementation->deposit_local_purse(SERVER_ID, NYM_ID, ACCT_ID,
891  STR_INDICES);
892 }
893 
894 std::string OT_ME::get_market_list(const std::string& SERVER_ID,
895  const std::string& NYM_ID) const
896 {
897  return m_pImplementation->get_market_list(SERVER_ID, NYM_ID);
898 }
899 
900 std::string OT_ME::get_market_offers(const std::string& SERVER_ID,
901  const std::string& NYM_ID,
902  const std::string& MARKET_ID,
903  int64_t MAX_DEPTH) const
904 {
905  return m_pImplementation->get_market_offers(SERVER_ID, NYM_ID, MARKET_ID,
906  MAX_DEPTH);
907 }
908 
909 std::string OT_ME::get_nym_market_offers(const std::string& SERVER_ID,
910  const std::string& NYM_ID) const
911 {
912  return m_pImplementation->get_nym_market_offers(SERVER_ID, NYM_ID);
913 }
914 
915 std::string OT_ME::get_market_recent_trades(const std::string& SERVER_ID,
916  const std::string& NYM_ID,
917  const std::string& MARKET_ID) const
918 {
919  return m_pImplementation->get_market_recent_trades(SERVER_ID, NYM_ID,
920  MARKET_ID);
921 }
922 
923 std::string OT_ME::adjust_usage_credits(const std::string& SERVER_ID,
924  const std::string& USER_NYM_ID,
925  const std::string& TARGET_NYM_ID,
926  const std::string& ADJUSTMENT) const
927 {
928  return m_pImplementation->adjust_usage_credits(SERVER_ID, USER_NYM_ID,
929  TARGET_NYM_ID, ADJUSTMENT);
930 }
931 
932 int32_t OT_ME::VerifyMessageSuccess(const std::string& str_Message) const
933 {
934  if (str_Message.size() < 10) {
935  otWarn << __FUNCTION__ << ": Error str_Message is: Too Short: \n"
936  << str_Message << "\n\n";
937  return -1;
938  }
939 
940  int32_t nStatus = OTAPI_Wrap::Message_GetSuccess(str_Message);
941 
942  switch (nStatus) {
943  case (-1):
944  otOut << __FUNCTION__
945  << ": Error calling OT_API_Message_GetSuccess, for message:\n"
946  << str_Message << "\n";
947  break;
948  case (0):
949  otWarn << __FUNCTION__
950  << ": Reply received: success == FALSE. Reply message:\n"
951  << str_Message << "\n";
952  break;
953  case (1):
954  otWarn << __FUNCTION__ << ": Reply received: success == TRUE.\n";
955  break;
956  default:
957  otOut << __FUNCTION__
958  << ": Error. (This should never happen!) nStatus: "
959  << static_cast<int32_t>(nStatus) << ", Input:\n" << str_Message
960  << "\n";
961  nStatus = (-1);
962  break;
963  }
964 
965  return nStatus;
966 }
967 
969  const std::string& SERVER_ID, const std::string& USER_ID,
970  const std::string& ACCOUNT_ID, const std::string& str_Message) const
971 {
972  if (str_Message.size() < 10) {
973  otWarn << __FUNCTION__ << ": Error str_Message is: Too Short: \n"
974  << str_Message << "\n\n";
975  return -1;
976  }
977 
979  SERVER_ID, USER_ID, ACCOUNT_ID, str_Message);
980 
981  switch (nStatus) {
982  case (-1):
983  otOut << __FUNCTION__
984  << ": Error calling Msg_GetBlnceAgrmntSuccess, for message:\n"
985  << str_Message << "\n";
986  break;
987  case (0):
988  otWarn << __FUNCTION__
989  << ": Reply received: success == FALSE. Reply message:\n"
990  << str_Message << "\n";
991  break;
992  case (1):
993  otWarn << __FUNCTION__ << ": Reply received: success == TRUE.\n";
994  break;
995  default:
996  otOut << __FUNCTION__
997  << ": Error. (This should never happen!) nStatus: "
998  << static_cast<int32_t>(nStatus) << ", Input:\n" << str_Message
999  << "\n";
1000  nStatus = (-1);
1001  break;
1002  }
1003 
1004  return nStatus;
1005 }
1006 
1007 int32_t OT_ME::VerifyMsgTrnxSuccess(const std::string& SERVER_ID,
1008  const std::string& USER_ID,
1009  const std::string& ACCOUNT_ID,
1010  const std::string& str_Message) const
1011 {
1012  if (str_Message.size() < 10) {
1013  otWarn << __FUNCTION__ << ": Error str_Message is: Too Short: \n"
1014  << str_Message << "\n\n";
1015  return -1;
1016  }
1017 
1019  SERVER_ID, USER_ID, ACCOUNT_ID, str_Message);
1020 
1021  switch (nStatus) {
1022  case (-1):
1023  otOut << __FUNCTION__
1024  << ": Error calling Msg_GetTransactionSuccess, for message:\n"
1025  << str_Message << "\n";
1026  break;
1027  case (0):
1028  otWarn << __FUNCTION__
1029  << ": Reply received: success == FALSE. Reply message:\n"
1030  << str_Message << "\n";
1031  break;
1032  case (1):
1033  otWarn << __FUNCTION__ << ": Reply received: success == TRUE.\n";
1034  break;
1035  default:
1036  otOut << __FUNCTION__
1037  << ": Error. (This should never happen!) nStatus: "
1038  << static_cast<int32_t>(nStatus) << ", Input:\n" << str_Message
1039  << "\n";
1040  nStatus = (-1);
1041  break;
1042  }
1043 
1044  return nStatus;
1045 }
1046 
1047 // This code was repeating a lot, so I just added a function for it.
1048 //
1049 // It uses the above functions.
1050 //
1052  const std::string& SERVER_ID, const std::string& USER_ID,
1053  const std::string& ACCOUNT_ID, const std::string& str_Attempt,
1054  const std::string& str_Response) const
1055 {
1056  int32_t nMessageSuccess = VerifyMessageSuccess(str_Response);
1057 
1058  if ((-1) == nMessageSuccess) {
1059  otOut << __FUNCTION__ << ": Message error: " << str_Attempt << "\n";
1060  return (-1);
1061  }
1062  else if (0 == nMessageSuccess) {
1063  otOut << __FUNCTION__ << ": Server reply (" << str_Attempt
1064  << "): Message failure.\n";
1065  return 0;
1066  }
1067  // (else 1.)
1068  int32_t nBalanceSuccess = VerifyMsgBalanceAgrmntSuccess(
1069  SERVER_ID, USER_ID, ACCOUNT_ID, str_Response);
1070 
1071  if ((-1) == nBalanceSuccess) {
1072  otOut << __FUNCTION__ << ": Balance agreement error: " << str_Attempt
1073  << "\n";
1074  return (-1);
1075  }
1076  else if (0 == nBalanceSuccess) {
1077  otOut << __FUNCTION__ << ": Server reply (" << str_Attempt
1078  << "): Balance agreement failure.\n";
1079  return 0;
1080  }
1081  // (else 1.)
1082  int32_t nTransSuccess =
1083  VerifyMsgTrnxSuccess(SERVER_ID, USER_ID, ACCOUNT_ID, str_Response);
1084 
1085  if ((-1) == nTransSuccess) {
1086  otOut << __FUNCTION__ << ": Transaction error: " << str_Attempt << "\n";
1087  return (-1);
1088  }
1089  else if (0 == nTransSuccess) {
1090  otOut << __FUNCTION__ << ": Server reply (" << str_Attempt
1091  << "): Transaction failure.\n";
1092  return 0;
1093  }
1094  // (else 1.)
1095  //
1096  // Success!
1097  //
1098  return 1;
1099 }
1100 
1101 bool OT_ME::HaveWorkingScript()
1102 {
1103  if (m_pScript) {
1104  // already initialized
1105  return true;
1106  }
1107 
1108  // note: if there's a choice of language, you must specify here. Perhaps add
1109  // as a parameter above, when the time comes to add another scripting
1110  // language.
1111  m_pScript = OTScriptFactory();
1112  if (!m_pScript) {
1113  otErr << __FUNCTION__ << ": Error instantiating script.\n";
1114  return false;
1115  }
1116 
1117 #ifdef OT_USE_SCRIPT_CHAI
1118  if (!SetupScriptObject()) {
1119  otErr << __FUNCTION__ << ": Error setting up script object.\n";
1120  m_pScript.reset(); // Erase the one we just created, since we failed
1121  // setting it up.
1122  return false;
1123  }
1124 #endif
1125 
1126  return true;
1127 }
1128 
1129 // used in otd/main.cpp
1130 //
1131 void OT_ME::AddVariable(const std::string&, OTVariable& theVar)
1132 {
1133  if (HaveWorkingScript()) {
1134  theVar.RegisterForExecution(*m_pScript); // This sets a pointer to the
1135  // script so the var can remove
1136  // itself on destruction.
1137  }
1138 }
1139 
1140 OTVariable* OT_ME::FindVariable(const std::string& str_var_name)
1141 {
1142  return HaveWorkingScript() ? m_pScript->FindVariable(str_var_name)
1143  : nullptr;
1144 }
1145 
1146 OTVariable* OT_ME::FindVariable2(const std::string& str_var_name)
1147 {
1148  return s_pMe->FindVariable(str_var_name);
1149 }
1150 
1151 std::string OT_ME::ExecuteScript_ReturnString(const std::string& str_Code,
1152  std::string str_DisplayName)
1153 {
1154  std::string str_Return = "";
1155  if (HaveWorkingScript()) {
1156  OTVariable the_return_value("ret_val", str_Return);
1157 
1158  m_pScript->SetScript(str_Code);
1159  m_pScript->SetDisplayFilename(str_DisplayName);
1160  m_pScript->ExecuteScript(&the_return_value); // <====== EXECUTE SCRIPT.
1161 
1162  if (OTVariable::Var_String == the_return_value.GetType())
1163  str_Return = the_return_value.CopyValueString();
1164  }
1165  return str_Return;
1166 }
1167 
1168 bool OT_ME::ExecuteScript_ReturnBool(const std::string& str_Code,
1169  std::string str_DisplayName)
1170 {
1171  bool bReturn = false;
1172  if (HaveWorkingScript()) {
1173  OTVariable the_return_value("ret_val", bReturn);
1174 
1175  m_pScript->SetScript(str_Code);
1176  m_pScript->SetDisplayFilename(str_DisplayName);
1177  m_pScript->ExecuteScript(&the_return_value); // <====== EXECUTE SCRIPT.
1178 
1179  if (OTVariable::Var_Bool == the_return_value.GetType())
1180  bReturn = the_return_value.CopyValueBool();
1181  }
1182  return bReturn;
1183 }
1184 
1185 int32_t OT_ME::ExecuteScript_ReturnInt(const std::string& str_Code,
1186  std::string str_DisplayName)
1187 {
1188  int32_t nReturn = -1;
1189  if (HaveWorkingScript()) {
1190  OTVariable the_return_value("ret_val", nReturn);
1191 
1192  m_pScript->SetScript(str_Code);
1193  m_pScript->SetDisplayFilename(str_DisplayName);
1194  m_pScript->ExecuteScript(&the_return_value); // <====== EXECUTE SCRIPT.
1195 
1196  if (OTVariable::Var_Integer == the_return_value.GetType())
1197  nReturn = the_return_value.CopyValueInteger();
1198  }
1199  return nReturn;
1200 }
1201 
1202 void OT_ME::ExecuteScript_ReturnVoid(const std::string& str_Code,
1203  std::string str_DisplayName)
1204 {
1205  if (HaveWorkingScript()) {
1206  m_pScript->SetScript(str_Code);
1207  m_pScript->SetDisplayFilename(str_DisplayName);
1208  m_pScript->ExecuteScript(); // <====== EXECUTE SCRIPT.
1209  }
1210 }
1211 
1212 #ifdef OT_USE_SCRIPT_CHAI
1213 bool OT_ME::SetupScriptObject()
1214 {
1215  OTString strDataPath;
1216  {
1217  bool bGetDataPathSuccess = OTDataFolder::Get(strDataPath);
1218  OT_ASSERT_MSG(bGetDataPathSuccess,
1219  "SetupScriptObject: Must set Data Path first!");
1220  }
1221  const bool bRegistered_OTDB = Register_OTDB_With_Script();
1222  const bool bRegistered_CLI = Register_CLI_With_Script();
1223  const bool bRegistered_API = Register_API_With_Script();
1224  const bool bRegistered_Headers = Register_Headers_With_Script();
1225  return bRegistered_OTDB && bRegistered_CLI && bRegistered_API &&
1226  bRegistered_Headers;
1227 }
1228 
1229 bool OT_ME::Register_OTDB_With_Script()
1230 {
1231  // See if it's ChaiScript.
1232  //
1233  OTScriptChai* pScript = dynamic_cast<OTScriptChai*>(m_pScript.get());
1234 
1235  if (nullptr != pScript) {
1236  return Register_OTDB_With_Script_Chai(*pScript);
1237  }
1238 
1239  otErr << __FUNCTION__
1240  << ": Failed dynamic casting OTScript to OTScriptChai \n";
1241  return false;
1242 }
1243 
1244 bool OT_ME::Register_CLI_With_Script()
1245 {
1246  // See if it's ChaiScript.
1247  //
1248  OTScriptChai* pScript = dynamic_cast<OTScriptChai*>(m_pScript.get());
1249 
1250  if (nullptr != pScript) {
1251  return Register_CLI_With_Script_Chai(*pScript);
1252  }
1253 
1254  otErr << __FUNCTION__
1255  << ": Failed dynamic casting OTScript to OTScriptChai \n";
1256  return false;
1257 }
1258 
1259 bool OT_ME::Register_API_With_Script()
1260 {
1261  // See if it's ChaiScript.
1262  //
1263  OTScriptChai* pScript = dynamic_cast<OTScriptChai*>(m_pScript.get());
1264 
1265  if (nullptr != pScript) {
1266  return Register_API_With_Script_Chai(*pScript);
1267  }
1268 
1269  otErr << __FUNCTION__
1270  << ": Failed dynamic casting OTScript to OTScriptChai \n";
1271  return false;
1272 }
1273 
1274 bool OT_ME::Register_Headers_With_Script()
1275 {
1276  // See if it's ChaiScript.
1277  //
1278  OTScriptChai* pScript = dynamic_cast<OTScriptChai*>(m_pScript.get());
1279 
1280  if (nullptr != pScript) {
1281  return Register_Headers_With_Script_Chai(*pScript);
1282  }
1283 
1284  otErr << __FUNCTION__
1285  << ": Failed dynamic casting OTScript to OTScriptChai \n";
1286  return false;
1287 }
1288 
1289 // bool OT_ME::Register_OTDB_With_Script_Lua(OTScriptLua& theScript)
1290 
1291 bool OT_ME::Register_OTDB_With_Script_Chai(const OTScriptChai& theScript) const
1292 {
1293  OT_ASSERT(nullptr != theScript.chai)
1294 
1295  using namespace chaiscript;
1296  {
1297  // ADD ENUMS
1298  theScript.chai->add(user_type<OTDB::StoredObjectType>(),
1299  "OTDB_StoredObjectType");
1300 
1301  theScript.chai->add_global_const(const_var(OTDB::STORED_OBJ_STRING),
1302  "STORED_OBJ_STRING");
1303  theScript.chai->add_global_const(const_var(OTDB::STORED_OBJ_BLOB),
1304  "STORED_OBJ_BLOB");
1305  theScript.chai->add_global_const(const_var(OTDB::STORED_OBJ_STRING_MAP),
1306  "STORED_OBJ_STRING_MAP");
1307  theScript.chai->add_global_const(
1308  const_var(OTDB::STORED_OBJ_WALLET_DATA), "STORED_OBJ_WALLET_DATA");
1309  theScript.chai->add_global_const(const_var(OTDB::STORED_OBJ_BID_DATA),
1310  "STORED_OBJ_BID_DATA");
1311  theScript.chai->add_global_const(const_var(OTDB::STORED_OBJ_ASK_DATA),
1312  "STORED_OBJ_ASK_DATA");
1313  theScript.chai->add_global_const(
1314  const_var(OTDB::STORED_OBJ_MARKET_DATA), "STORED_OBJ_MARKET_DATA");
1315  theScript.chai->add_global_const(
1316  const_var(OTDB::STORED_OBJ_MARKET_LIST), "STORED_OBJ_MARKET_LIST");
1317  theScript.chai->add_global_const(
1319  "STORED_OBJ_OFFER_LIST_MARKET");
1320  theScript.chai->add_global_const(
1322  "STORED_OBJ_TRADE_DATA_MARKET");
1323  theScript.chai->add_global_const(
1325  "STORED_OBJ_TRADE_LIST_MARKET");
1326  theScript.chai->add_global_const(
1328  "STORED_OBJ_OFFER_DATA_NYM");
1329  theScript.chai->add_global_const(
1331  "STORED_OBJ_OFFER_LIST_NYM");
1332  theScript.chai->add_global_const(
1334  "STORED_OBJ_TRADE_DATA_NYM");
1335  theScript.chai->add_global_const(
1337  "STORED_OBJ_TRADE_LIST_NYM");
1338 
1339  // ADD OBJECT TYPES
1340  theScript.chai->add(user_type<OTDB::Storage>(), "OTDB_Storage");
1341  theScript.chai->add(user_type<OTDB::Storable>(), "OTDB_Storable");
1342  theScript.chai->add(user_type<OTDB::OTDBString>(), "OTDB_String");
1343  theScript.chai->add(user_type<OTDB::Blob>(), "OTDB_Blob");
1344  theScript.chai->add(user_type<OTDB::StringMap>(), "OTDB_StringMap");
1345  theScript.chai->add(user_type<OTDB::Displayable>(), "OTDB_Displayable");
1346  theScript.chai->add(user_type<OTDB::MarketData>(), "OTDB_MarketData");
1347  theScript.chai->add(user_type<OTDB::MarketList>(), "OTDB_MarketList");
1348  theScript.chai->add(user_type<OTDB::OfferDataMarket>(),
1349  "OTDB_OfferDataMarket");
1350  theScript.chai->add(user_type<OTDB::BidData>(), "OTDB_BidData");
1351  theScript.chai->add(user_type<OTDB::AskData>(), "OTDB_AskData");
1352  theScript.chai->add(user_type<OTDB::OfferListMarket>(),
1353  "OTDB_OfferListMarket");
1354  theScript.chai->add(user_type<OTDB::TradeDataMarket>(),
1355  "OTDB_TradeDataMarket");
1356  theScript.chai->add(user_type<OTDB::TradeListMarket>(),
1357  "OTDB_TradeListMarket");
1358  theScript.chai->add(user_type<OTDB::OfferDataNym>(),
1359  "OTDB_OfferDataNym");
1360  theScript.chai->add(user_type<OTDB::OfferListNym>(),
1361  "OTDB_OfferListNym");
1362  theScript.chai->add(user_type<OTDB::TradeDataNym>(),
1363  "OTDB_TradeDataNym");
1364  theScript.chai->add(user_type<OTDB::TradeListNym>(),
1365  "OTDB_TradeListNym");
1366  // theScript.chai->add(user_type<OTDB::Acct>(), "OTDB_Acct");
1367  // theScript.chai->add(user_type<OTDB::BitcoinAcct>(),
1368  // "OTDB_BitcoinAcct");
1369  // theScript.chai->add(user_type<OTDB::ServerInfo>(),
1370  // "OTDB_ServerInfo");
1371  // theScript.chai->add(user_type<OTDB::Server>(), "OTDB_Server");
1372  // theScript.chai->add(user_type<OTDB::BitcoinServer>(),
1373  // "OTDB_BitcoinServer");
1374  // theScript.chai->add(user_type<OTDB::RippleServer>(),
1375  // "OTDB_RippleServer");
1376  // theScript.chai->add(user_type<OTDB::LoomServer>(),
1377  // "OTDB_LoomServer");
1378  // theScript.chai->add(user_type<OTDB::ContactNym>(),
1379  // "OTDB_ContactNym");
1380  // theScript.chai->add(user_type<OTDB::WalletData>(),
1381  // "OTDB_WalletData");
1382  // theScript.chai->add(user_type<OTDB::ContactAcct>(),
1383  // "OTDB_ContactAcct");
1384  // theScript.chai->add(user_type<OTDB::Contact>(), "OTDB_Contact");
1385  // theScript.chai->add(user_type<OTDB::AddressBook>(),
1386  // "OTDB_AddressBook");
1387 
1388  // SHOW INHERITANCE
1389  theScript.chai->add(
1390  chaiscript::base_class<OTDB::Storable, OTDB::OTDBString>());
1391  theScript.chai->add(
1392  chaiscript::base_class<OTDB::Storable, OTDB::Blob>());
1393  theScript.chai->add(
1394  chaiscript::base_class<OTDB::Storable, OTDB::StringMap>());
1395  theScript.chai->add(
1396  chaiscript::base_class<OTDB::Storable, OTDB::Displayable>());
1397  theScript.chai->add(
1398  chaiscript::base_class<OTDB::Displayable, OTDB::MarketData>());
1399  theScript.chai->add(
1400  chaiscript::base_class<OTDB::Storable, OTDB::MarketList>());
1401  theScript.chai->add(
1402  chaiscript::base_class<OTDB::Displayable, OTDB::OfferDataMarket>());
1403  theScript.chai->add(
1404  chaiscript::base_class<OTDB::OfferDataMarket, OTDB::BidData>());
1405  theScript.chai->add(
1406  chaiscript::base_class<OTDB::OfferDataMarket, OTDB::AskData>());
1407  theScript.chai->add(
1408  chaiscript::base_class<OTDB::Storable, OTDB::OfferListMarket>());
1409  theScript.chai->add(
1410  chaiscript::base_class<OTDB::Displayable, OTDB::TradeDataMarket>());
1411  theScript.chai->add(
1412  chaiscript::base_class<OTDB::Storable, OTDB::TradeListMarket>());
1413  theScript.chai->add(
1414  chaiscript::base_class<OTDB::Displayable, OTDB::OfferDataNym>());
1415  theScript.chai->add(
1416  chaiscript::base_class<OTDB::Storable, OTDB::OfferListNym>());
1417  theScript.chai->add(
1418  chaiscript::base_class<OTDB::Displayable, OTDB::TradeDataNym>());
1419  theScript.chai->add(
1420  chaiscript::base_class<OTDB::Storable, OTDB::TradeListNym>());
1421  // theScript.chai->add(chaiscript::base_class<OTDB::Displayable,
1422  // OTDB::Acct>());
1423  // theScript.chai->add(chaiscript::base_class<OTDB::Acct,
1424  // OTDB::BitcoinAcct>());
1425  // theScript.chai->add(chaiscript::base_class<OTDB::Displayable,
1426  // OTDB::ServerInfo>());
1427  // theScript.chai->add(chaiscript::base_class<OTDB::ServerInfo,
1428  // OTDB::Server>());
1429  // theScript.chai->add(chaiscript::base_class<OTDB::Server,
1430  // OTDB::BitcoinServer>());
1431  // theScript.chai->add(chaiscript::base_class<OTDB::Server,
1432  // OTDB::RippleServer>());
1433  // theScript.chai->add(chaiscript::base_class<OTDB::Server,
1434  // OTDB::LoomServer>());
1435  // theScript.chai->add(chaiscript::base_class<OTDB::Displayable,
1436  // OTDB::ContactNym>());
1437  // theScript.chai->add(chaiscript::base_class<OTDB::Storable,
1438  // OTDB::WalletData>());
1439  // theScript.chai->add(chaiscript::base_class<OTDB::Displayable,
1440  // OTDB::ContactAcct>());
1441  // theScript.chai->add(chaiscript::base_class<OTDB::Displayable,
1442  // OTDB::Contact>());
1443  // theScript.chai->add(chaiscript::base_class<OTDB::Storable,
1444  // OTDB::AddressBook>());
1445 
1446  // ADD STORAGE FUNCTIONS
1447  theScript.chai->add(fun(&OTDB::CreateObject), "OTDB_CreateObject");
1448 
1449  // theScript.chai->add(fun(&OTDB::Exists), "OTDB_Exists");
1450  theScript.chai->add(
1451  fun<bool(std::string, std::string, std::string, std::string)>(
1452  &OTDB::Exists),
1453  "OTDB_Exists");
1454  // theScript.chai->add(fun<bool (std::string, std::string,
1455  // std::string)>(&OTDB::Exists), "OTDB_Exists");
1456  // theScript.chai->add(fun<bool (std::string,
1457  // std::string)>(&OTDB::Exists), "OTDB_Exists");
1458  // theScript.chai->add(fun<bool (std::string)>(&OTDB::Exists),
1459  // "OTDB_Exists");
1460 
1461  // theScript.chai->add(fun(&OTDB::StoreString),
1462  // "OTDB_StoreString");
1463  theScript.chai->add(
1464  fun<bool(std::string, std::string, std::string, std::string,
1465  std::string)>(&OTDB::StoreString),
1466  "OTDB_StoreString");
1467  // theScript.chai->add(fun<bool (std::string, std::string,
1468  // std::string, std::string)>(&OTDB::StoreString), "OTDB_StoreString");
1469  // theScript.chai->add(fun<bool (std::string, std::string,
1470  // std::string)>(&OTDB::StoreString), "OTDB_StoreString");
1471  // theScript.chai->add(fun<bool (std::string,
1472  // std::string)>(&OTDB::StoreString), "OTDB_StoreString");
1473 
1474  // theScript.chai->add(fun(&OTDB::QueryString),
1475  // "OTDB_QueryString");
1476  theScript.chai->add(
1477  fun<std::string(std::string, std::string, std::string,
1478  std::string)>(&OTDB::QueryString),
1479  "OTDB_QueryString");
1480  // theScript.chai->add(fun<std::string (std::string, std::string,
1481  // std::string)>(&OTDB::QueryString), "OTDB_QueryString");
1482  // theScript.chai->add(fun<std::string (std::string,
1483  // std::string)>(&OTDB::QueryString), "OTDB_QueryString");
1484  // theScript.chai->add(fun<std::string
1485  // (std::string)>(&OTDB::QueryString), "OTDB_QueryString");
1486 
1487  // theScript.chai->add(fun(&OTDB::StorePlainString),
1488  // "OTDB_StorePlainString");
1489  theScript.chai->add(
1490  fun<bool(std::string, std::string, std::string, std::string,
1491  std::string)>(&OTDB::StorePlainString),
1492  "OTDB_StorePlainString");
1493  // theScript.chai->add(fun<bool (std::string, std::string,
1494  // std::string, std::string)>(&OTDB::StorePlainString),
1495  // "OTDB_StorePlainString");
1496  // theScript.chai->add(fun<bool (std::string, std::string,
1497  // std::string)>(&OTDB::StorePlainString), "OTDB_StorePlainString");
1498  // theScript.chai->add(fun<bool (std::string,
1499  // std::string)>(&OTDB::StorePlainString), "OTDB_StorePlainString");
1500 
1501  // theScript.chai->add(fun(&OTDB::QueryPlainString),
1502  // "OTDB_QueryPlainString");
1503  theScript.chai->add(
1504  fun<std::string(std::string, std::string, std::string,
1505  std::string)>(&OTDB::QueryPlainString),
1506  "OTDB_QueryPlainString");
1507  // theScript.chai->add(fun<std::string (std::string, std::string,
1508  // std::string)>(&OTDB::QueryPlainString), "OTDB_QueryPlainString");
1509  // theScript.chai->add(fun<std::string (std::string,
1510  // std::string)>(&OTDB::QueryPlainString), "OTDB_QueryPlainString");
1511  // theScript.chai->add(fun<std::string
1512  // (std::string)>(&OTDB::QueryPlainString), "OTDB_QueryPlainString");
1513 
1514  // theScript.chai->add(fun(&OTDB::StoreObject),
1515  // "OTDB_StoreObject");
1516  theScript.chai->add(
1517  fun<bool(OTDB::Storable&, std::string, std::string, std::string,
1518  std::string)>(&OTDB::StoreObject),
1519  "OTDB_StoreObject");
1520  // theScript.chai->add(fun<bool (OTDB::Storable &, std::string,
1521  // std::string, std::string)>(&OTDB::StoreObject), "OTDB_StoreObject");
1522  // theScript.chai->add(fun<bool (OTDB::Storable &, std::string,
1523  // std::string)>(&OTDB::StoreObject), "OTDB_StoreObject");
1524  // theScript.chai->add(fun<bool (OTDB::Storable &,
1525  // std::string)>(&OTDB::StoreObject), "OTDB_StoreObject");
1526 
1527  // theScript.chai->add(fun(&OTDB::QueryObject),
1528  // "OTDB_QueryObject");
1529  theScript.chai->add(
1530  fun<OTDB::Storable*(OTDB::StoredObjectType, std::string,
1531  std::string, std::string, std::string)>(
1533  "OTDB_QueryObject");
1534  // theScript.chai->add(fun<OTDB::Storable *
1535  // (OTDB::StoredObjectType, std::string, std::string,
1536  // std::string)>(&OTDB::QueryObject), "OTDB_QueryObject");
1537  // theScript.chai->add(fun<OTDB::Storable *
1538  // (OTDB::StoredObjectType, std::string,
1539  // std::string)>(&OTDB::QueryObject), "OTDB_QueryObject");
1540  // theScript.chai->add(fun<OTDB::Storable *
1541  // (OTDB::StoredObjectType, std::string)>(&OTDB::QueryObject),
1542  // "OTDB_QueryObject");
1543 
1544  theScript.chai->add(fun(&OTDB::EncodeObject), "OTDB_EncodeObject");
1545  theScript.chai->add(fun(&OTDB::DecodeObject), "OTDB_DecodeObject");
1546 
1547  // theScript.chai->add(fun(&OTDB::EraseValueByKey),
1548  // "OTDB_EraseValueByKey");
1549 
1550  // ADD DYNAMIC CASTING.
1551  //
1552  // theScript.chai->add(fun<OTDB::OTDBString * (OTDB::Storable
1553  // *)>(&OTDB::OTDBString::ot_dynamic_cast), "OTDB_CAST_STRING");
1554  theScript.chai->add(fun(&OTDB::OTDBString::ot_dynamic_cast),
1555  "OTDB_CAST_STRING");
1556  theScript.chai->add(fun(&OTDB::Blob::ot_dynamic_cast),
1557  "OTDB_CAST_BLOB");
1558  theScript.chai->add(fun(&OTDB::StringMap::ot_dynamic_cast),
1559  "OTDB_CAST_STRING_MAP");
1560  theScript.chai->add(fun(&OTDB::Displayable::ot_dynamic_cast),
1561  "OTDB_CAST_DISPLAYABLE");
1562  theScript.chai->add(fun(&OTDB::MarketData::ot_dynamic_cast),
1563  "OTDB_CAST_MARKET_DATA");
1564 
1565  // theScript.chai->add(fun<OTDB::MarketList * (OTDB::Storable
1566  // *)>(&OTDB::MarketList::ot_dynamic_cast), "OTDB_CAST_MARKET_LIST");
1567  theScript.chai->add(fun(&OTDB::MarketList::ot_dynamic_cast),
1568  "OTDB_CAST_MARKET_LIST");
1569  theScript.chai->add(fun(&OTDB::OfferDataMarket::ot_dynamic_cast),
1570  "OTDB_CAST_OFFER_DATA_MARKET");
1571  theScript.chai->add(fun(&OTDB::BidData::ot_dynamic_cast),
1572  "OTDB_CAST_BID_DATA");
1573  theScript.chai->add(fun(&OTDB::AskData::ot_dynamic_cast),
1574  "OTDB_CAST_ASK_DATA");
1575  theScript.chai->add(fun(&OTDB::OfferListMarket::ot_dynamic_cast),
1576  "OTDB_CAST_OFFER_LIST_MARKET");
1577  theScript.chai->add(fun(&OTDB::TradeDataMarket::ot_dynamic_cast),
1578  "OTDB_CAST_TRADE_DATA_MARKET");
1579  theScript.chai->add(fun(&OTDB::TradeListMarket::ot_dynamic_cast),
1580  "OTDB_CAST_TRADE_LIST_MARKET");
1581  theScript.chai->add(fun(&OTDB::OfferDataNym::ot_dynamic_cast),
1582  "OTDB_CAST_OFFER_DATA_NYM");
1583  theScript.chai->add(fun(&OTDB::OfferListNym::ot_dynamic_cast),
1584  "OTDB_CAST_OFFER_LIST_NYM");
1585  theScript.chai->add(fun(&OTDB::TradeDataNym::ot_dynamic_cast),
1586  "OTDB_CAST_TRADE_DATA_NYM");
1587  theScript.chai->add(fun(&OTDB::TradeListNym::ot_dynamic_cast),
1588  "OTDB_CAST_TRADE_LIST_NYM");
1589 
1590 // theScript.chai->add(fun(&OTDB::MarketList::GetMarketDataCount),
1591 // "GetMarketDataCount");
1592 // theScript.chai->add(fun(&OTDB::MarketList::GetMarketData),
1593 // "GetMarketData");
1594 // theScript.chai->add(fun(&OTDB::MarketList::RemoveMarketData),
1595 // "RemoveMarketData");
1596 // theScript.chai->add(fun(&OTDB::MarketList::AddMarketData),
1597 // "AddMarketData");
1598 //
1599 // theScript.chai->add(fun(&OTDB::MarketList::Get##name##Count), "Get"
1600 // #name "Count");
1601 // theScript.chai->add(fun(&OTDB::MarketList::Get##name), "Get" #name
1602 // );
1603 // theScript.chai->add(fun(&OTDB::MarketList::Remove##name), "Remove"
1604 // #name);
1605 // theScript.chai->add(fun(&OTDB::MarketList::Add##name), "Add"
1606 // #name);
1607 //
1608 // EXPORT size_t Get##name##Count();
1609 // EXPORT name * Get##name(size_t nIndex);
1610 // EXPORT bool Remove##name(size_t nIndex##name);
1611 // EXPORT bool Add##name(name& disownObject)
1612 
1613 #define OT_CHAI_CONTAINER(container, name) \
1614  theScript.chai->add(fun(&OTDB::container::Get##name##Count), \
1615  "Get" #name "Count"); \
1616  theScript.chai->add(fun(&OTDB::container::Get##name), "Get" #name); \
1617  theScript.chai->add(fun(&OTDB::container::Remove##name), "Remove" #name); \
1618  theScript.chai->add(fun(&OTDB::container::Add##name), "Add" #name)
1619 
1620  // ADD MEMBERS OF THE VARIOUS OBJECTS
1621 
1622  theScript.chai->add(fun(&OTDB::OTDBString::m_string), "m_string");
1623  theScript.chai->add(fun(&OTDB::Blob::m_memBuffer), "m_memBuffer");
1624  theScript.chai->add(fun(&OTDB::StringMap::the_map), "the_map");
1625  theScript.chai->add(fun(&OTDB::StringMap::SetValue), "SetValue");
1626  theScript.chai->add(fun(&OTDB::StringMap::GetValue), "GetValue");
1627  theScript.chai->add(fun(&OTDB::Displayable::gui_label), "gui_label");
1628  // theScript.chai->add(fun(&OTDB::MarketData::gui_label),
1629  // "gui_label");
1630  theScript.chai->add(fun(&OTDB::MarketData::server_id), "server_id");
1631  theScript.chai->add(fun(&OTDB::MarketData::market_id), "market_id");
1632  theScript.chai->add(fun(&OTDB::MarketData::asset_type_id),
1633  "asset_type_id");
1634  theScript.chai->add(fun(&OTDB::MarketData::currency_type_id),
1635  "currency_type_id");
1636  theScript.chai->add(fun(&OTDB::MarketData::scale), "scale");
1637  theScript.chai->add(fun(&OTDB::MarketData::total_assets),
1638  "total_assets");
1639  theScript.chai->add(fun(&OTDB::MarketData::number_bids), "number_bids");
1640  theScript.chai->add(fun(&OTDB::MarketData::number_asks), "number_asks");
1641  theScript.chai->add(fun(&OTDB::MarketData::last_sale_price),
1642  "last_sale_price");
1643  theScript.chai->add(fun(&OTDB::MarketData::last_sale_date),
1644  "last_sale_date");
1645  theScript.chai->add(fun(&OTDB::MarketData::current_bid), "current_bid");
1646  theScript.chai->add(fun(&OTDB::MarketData::current_ask), "current_ask");
1647 
1648  OT_CHAI_CONTAINER(MarketList, MarketData);
1649  // theScript.chai->add(fun(&OTDB::OfferDataMarket::gui_label),
1650  // "gui_label");
1651  theScript.chai->add(fun(&OTDB::OfferDataMarket::transaction_id),
1652  "transaction_id");
1653  theScript.chai->add(fun(&OTDB::OfferDataMarket::price_per_scale),
1654  "price_per_scale");
1655  theScript.chai->add(fun(&OTDB::OfferDataMarket::available_assets),
1656  "available_assets");
1657  theScript.chai->add(fun(&OTDB::OfferDataMarket::minimum_increment),
1658  "minimum_increment");
1659  theScript.chai->add(fun(&OTDB::OfferDataMarket::date), "date");
1660 
1661  // theScript.chai->add(fun(&OTDB::BidData::gui_label),
1662  // "gui_label");
1663  // theScript.chai->add(fun(&OTDB::BidData::transaction_id),
1664  // "transaction_id");
1665  // theScript.chai->add(fun(&OTDB::BidData::price_per_scale),
1666  // "price_per_scale");
1667  // theScript.chai->add(fun(&OTDB::BidData::available_assets),
1668  // "available_assets");
1669  // theScript.chai->add(fun(&OTDB::BidData::minimum_increment),
1670  // "minimum_increment");
1671 
1672  // theScript.chai->add(fun(&OTDB::AskData::gui_label),
1673  // "gui_label");
1674  // theScript.chai->add(fun(&OTDB::AskData::transaction_id),
1675  // "transaction_id");
1676  // theScript.chai->add(fun(&OTDB::AskData::price_per_scale),
1677  // "price_per_scale");
1678  // theScript.chai->add(fun(&OTDB::AskData::available_assets),
1679  // "available_assets");
1680  // theScript.chai->add(fun(&OTDB::AskData::minimum_increment),
1681  // "minimum_increment");
1682 
1683  OT_CHAI_CONTAINER(OfferListMarket, BidData);
1684  OT_CHAI_CONTAINER(OfferListMarket, AskData);
1685  // theScript.chai->add(fun(&OTDB::TradeDataMarket::gui_label),
1686  // "gui_label");
1687  theScript.chai->add(fun(&OTDB::TradeDataMarket::transaction_id),
1688  "transaction_id");
1689  theScript.chai->add(fun(&OTDB::TradeDataMarket::date), "date");
1690  theScript.chai->add(fun(&OTDB::TradeDataMarket::price), "price");
1691  theScript.chai->add(fun(&OTDB::TradeDataMarket::amount_sold),
1692  "amount_sold");
1693 
1694  OT_CHAI_CONTAINER(TradeListMarket, TradeDataMarket);
1695  // theScript.chai->add(fun(&OTDB::OfferDataNym::gui_label),
1696  // "gui_label");
1697  theScript.chai->add(fun(&OTDB::OfferDataNym::valid_from), "valid_from");
1698  theScript.chai->add(fun(&OTDB::OfferDataNym::valid_to), "valid_to");
1699  theScript.chai->add(fun(&OTDB::OfferDataNym::server_id), "server_id");
1700  theScript.chai->add(fun(&OTDB::OfferDataNym::asset_type_id),
1701  "asset_type_id");
1702  theScript.chai->add(fun(&OTDB::OfferDataNym::asset_acct_id),
1703  "asset_acct_id");
1704  theScript.chai->add(fun(&OTDB::OfferDataNym::currency_type_id),
1705  "currency_type_id");
1706  theScript.chai->add(fun(&OTDB::OfferDataNym::currency_acct_id),
1707  "currency_acct_id");
1708  theScript.chai->add(fun(&OTDB::OfferDataNym::selling), "selling");
1709  theScript.chai->add(fun(&OTDB::OfferDataNym::scale), "scale");
1710  theScript.chai->add(fun(&OTDB::OfferDataNym::price_per_scale),
1711  "price_per_scale");
1712  theScript.chai->add(fun(&OTDB::OfferDataNym::transaction_id),
1713  "transaction_id");
1714  theScript.chai->add(fun(&OTDB::OfferDataNym::total_assets),
1715  "total_assets");
1716  theScript.chai->add(fun(&OTDB::OfferDataNym::finished_so_far),
1717  "finished_so_far");
1718  theScript.chai->add(fun(&OTDB::OfferDataNym::minimum_increment),
1719  "minimum_increment");
1720  theScript.chai->add(fun(&OTDB::OfferDataNym::stop_sign), "stop_sign");
1721  theScript.chai->add(fun(&OTDB::OfferDataNym::stop_price), "stop_price");
1722  theScript.chai->add(fun(&OTDB::OfferDataNym::date), "date");
1723 
1724  OT_CHAI_CONTAINER(OfferListNym, OfferDataNym);
1725  // theScript.chai->add(fun(&OTDB::TradeDataNym::gui_label),
1726  // "gui_label");
1727  theScript.chai->add(fun(&OTDB::TradeDataNym::transaction_id),
1728  "transaction_id");
1729  theScript.chai->add(fun(&OTDB::TradeDataNym::completed_count),
1730  "completed_count");
1731  theScript.chai->add(fun(&OTDB::TradeDataNym::date), "date");
1732  theScript.chai->add(fun(&OTDB::TradeDataNym::price), "price");
1733  theScript.chai->add(fun(&OTDB::TradeDataNym::amount_sold),
1734  "amount_sold");
1735  theScript.chai->add(fun(&OTDB::TradeDataNym::updated_id), "updated_id");
1736  theScript.chai->add(fun(&OTDB::TradeDataNym::offer_price),
1737  "offer_price");
1738  theScript.chai->add(fun(&OTDB::TradeDataNym::finished_so_far),
1739  "finished_so_far");
1740  theScript.chai->add(fun(&OTDB::TradeDataNym::asset_id), "asset_id");
1741  theScript.chai->add(fun(&OTDB::TradeDataNym::currency_id),
1742  "currency_id");
1743  theScript.chai->add(fun(&OTDB::TradeDataNym::currency_paid),
1744  "currency_paid");
1745 
1746  OT_CHAI_CONTAINER(TradeListNym, TradeDataNym);
1747  return true; // Success (hopefully!)
1748  }
1749 }
1750 
1751 // bool OT_ME::Register_CLI_With_Script_Lua(OTScriptLua& theScript)
1752 
1753 bool OT_ME::Register_CLI_With_Script_Chai(const OTScriptChai& theScript) const
1754 {
1755  using namespace chaiscript;
1756  {
1757  // ADD THE OT CLI FUNCTIONS
1758  theScript.chai->add(fun(&OT_CLI_ReadLine),
1759  "OT_CLI_ReadLine"); // String OT_CLI_ReadLine() //
1760  // Reads from cin until Newline.
1761  theScript.chai->add(fun(&OT_CLI_ReadUntilEOF),
1762  "OT_CLI_ReadUntilEOF"); // String
1763  // OT_CLI_ReadUntilEOF() //
1764  // Reads from cin until EOF
1765  // or ~ on a line by itself.
1766  // For command-line option (for SCRIPTS): ot --script <filename>
1767  // [--args "key value key value ..."]
1768  theScript.chai->add(fun(&OT_CLI_GetArgsCount),
1769  "OT_CLI_GetArgsCount"); // Get a count of key/value
1770  // pairs from a string.
1771  // Returns int32_t.
1772  theScript.chai->add(fun(&OT_CLI_GetValueByKey),
1773  "OT_CLI_GetValueByKey"); // Returns a VALUE as
1774  // string, BY KEY, from a
1775  // map of key/value pairs
1776  // (stored in a string.)
1777  theScript.chai->add(fun(&OT_CLI_GetValueByIndex),
1778  "OT_CLI_GetValueByIndex"); // Returns a VALUE as
1779  // string, BY INDEX, from
1780  // a map of key/value
1781  // pairs (stored in a
1782  // string.)
1783  theScript.chai->add(fun(&OT_CLI_GetKeyByIndex),
1784  "OT_CLI_GetKeyByIndex"); // Returns a KEY as string,
1785  // BY INDEX, from a map of
1786  // key/value pairs (stored
1787  // in a string.)
1788  return true; // Success (hopefully!)
1789  }
1790 }
1791 
1792 // bool OT_ME::Register_API_With_Script_Lua(OTScriptLua& theScript)
1793 
1794 bool OT_ME::Register_API_With_Script_Chai(const OTScriptChai& theScript) const
1795 {
1796  using namespace chaiscript;
1797  {
1798  theScript.chai->add(fun(&OTAPI_Wrap::Output), "OT_API_Output");
1799  theScript.chai->add(fun(&OTAPI_Wrap::GetTime), "OT_API_GetTime");
1800 
1801  theScript.chai->add(fun(&OTAPI_Wrap::NumList_Add),
1802  "OT_API_NumList_Add");
1803  theScript.chai->add(fun(&OTAPI_Wrap::NumList_Remove),
1804  "OT_API_NumList_Remove");
1805  theScript.chai->add(fun(&OTAPI_Wrap::NumList_VerifyQuery),
1806  "OT_API_NumList_VerifyQuery");
1807  theScript.chai->add(fun(&OTAPI_Wrap::NumList_VerifyAll),
1808  "OT_API_NumList_VerifyAll");
1809  theScript.chai->add(fun(&OTAPI_Wrap::NumList_Count),
1810  "OT_API_NumList_Count");
1811 
1812  theScript.chai->add(fun(&OTAPI_Wrap::Encode), "OT_API_Encode");
1813  theScript.chai->add(fun(&OTAPI_Wrap::Decode), "OT_API_Decode");
1814  theScript.chai->add(fun(&OTAPI_Wrap::Encrypt), "OT_API_Encrypt");
1815  theScript.chai->add(fun(&OTAPI_Wrap::Decrypt), "OT_API_Decrypt");
1816 
1817  theScript.chai->add(fun(&OTAPI_Wrap::CreateSymmetricKey),
1818  "OT_API_CreateSymmetricKey");
1819  theScript.chai->add(fun(&OTAPI_Wrap::SymmetricEncrypt),
1820  "OT_API_SymmetricEncrypt");
1821  theScript.chai->add(fun(&OTAPI_Wrap::SymmetricDecrypt),
1822  "OT_API_SymmetricDecrypt");
1823  theScript.chai->add(fun(&OTAPI_Wrap::CreateServerContract),
1824  "OT_API_CreateServerContract");
1825  theScript.chai->add(fun(&OTAPI_Wrap::CreateAssetContract),
1826  "OT_API_CreateAssetContract");
1827  theScript.chai->add(fun(&OTAPI_Wrap::GetServer_Contract),
1828  "OT_API_GetServer_Contract");
1829  theScript.chai->add(fun(&OTAPI_Wrap::GetAssetType_Contract),
1830  "OT_API_GetAssetType_Contract");
1831 
1832  theScript.chai->add(fun(&OTAPI_Wrap::FormatAmount),
1833  "OT_API_FormatAmount");
1834  theScript.chai->add(fun(&OTAPI_Wrap::StringToAmount),
1835  "OT_API_StringToAmount");
1836 
1837  theScript.chai->add(fun(&OTAPI_Wrap::FlatSign), "OT_API_FlatSign");
1838  theScript.chai->add(fun(&OTAPI_Wrap::SignContract),
1839  "OT_API_SignContract");
1840  theScript.chai->add(fun(&OTAPI_Wrap::AddSignature),
1841  "OT_API_AddSignature");
1842  theScript.chai->add(fun(&OTAPI_Wrap::VerifySignature),
1843  "OT_API_VerifySignature");
1844 
1845  theScript.chai->add(fun(&OTAPI_Wrap::CreateNym), "OT_API_CreateNym");
1846 
1847  theScript.chai->add(fun(&OTAPI_Wrap::GetNym_ActiveCronItemIDs),
1848  "OT_API_GetNym_ActiveCronItemIDs");
1849  theScript.chai->add(fun(&OTAPI_Wrap::GetActiveCronItem),
1850  "OT_API_GetActiveCronItem");
1851 
1852  theScript.chai->add(fun(&OTAPI_Wrap::GetNym_SourceForID),
1853  "OT_API_GetNym_SourceForID");
1854  theScript.chai->add(fun(&OTAPI_Wrap::GetNym_AltSourceLocation),
1855  "OT_API_GetNym_AltSourceLocation");
1856  theScript.chai->add(fun(&OTAPI_Wrap::GetNym_CredentialCount),
1857  "OT_API_GetNym_CredentialCount");
1858  theScript.chai->add(fun(&OTAPI_Wrap::GetNym_CredentialID),
1859  "OT_API_GetNym_CredentialID");
1860  theScript.chai->add(fun(&OTAPI_Wrap::GetNym_CredentialContents),
1861  "OT_API_GetNym_CredentialContents");
1862  theScript.chai->add(fun(&OTAPI_Wrap::GetNym_RevokedCredCount),
1863  "OT_API_GetNym_RevokedCredCount");
1864  theScript.chai->add(fun(&OTAPI_Wrap::GetNym_RevokedCredID),
1865  "OT_API_GetNym_RevokedCredID");
1866  theScript.chai->add(fun(&OTAPI_Wrap::GetNym_RevokedCredContents),
1867  "OT_API_GetNym_RevokedCredContents");
1868  theScript.chai->add(fun(&OTAPI_Wrap::GetNym_SubcredentialCount),
1869  "OT_API_GetNym_SubcredentialCount");
1870  theScript.chai->add(fun(&OTAPI_Wrap::GetNym_SubCredentialID),
1871  "OT_API_GetNym_SubCredentialID");
1872  theScript.chai->add(fun(&OTAPI_Wrap::GetNym_SubCredentialContents),
1873  "OT_API_GetNym_SubCredentialContents");
1874 
1875  theScript.chai->add(fun(&OTAPI_Wrap::AddSubcredential),
1876  "OT_API_AddSubcredential");
1877  theScript.chai->add(fun(&OTAPI_Wrap::RevokeSubcredential),
1878  "OT_API_RevokeSubcredential");
1879 
1880  theScript.chai->add(fun(&OTAPI_Wrap::AddServerContract),
1881  "OT_API_AddServerContract");
1882  theScript.chai->add(fun(&OTAPI_Wrap::AddAssetContract),
1883  "OT_API_AddAssetContract");
1884  theScript.chai->add(fun(&OTAPI_Wrap::GetServerCount),
1885  "OT_API_GetServerCount");
1886  theScript.chai->add(fun(&OTAPI_Wrap::GetAssetTypeCount),
1887  "OT_API_GetAssetTypeCount");
1888  theScript.chai->add(fun(&OTAPI_Wrap::GetAccountCount),
1889  "OT_API_GetAccountCount");
1890  theScript.chai->add(fun(&OTAPI_Wrap::GetNymCount),
1891  "OT_API_GetNymCount");
1892  theScript.chai->add(fun(&OTAPI_Wrap::GetServer_ID),
1893  "OT_API_GetServer_ID");
1894  theScript.chai->add(fun(&OTAPI_Wrap::GetServer_Name),
1895  "OT_API_GetServer_Name");
1896  theScript.chai->add(fun(&OTAPI_Wrap::GetAssetType_ID),
1897  "OT_API_GetAssetType_ID");
1898  theScript.chai->add(fun(&OTAPI_Wrap::GetAssetType_Name),
1899  "OT_API_GetAssetType_Name");
1900 
1901  theScript.chai->add(fun(&OTAPI_Wrap::GetAccountWallet_ID),
1902  "OT_API_GetAccountWallet_ID");
1903  theScript.chai->add(fun(&OTAPI_Wrap::GetAccountWallet_Name),
1904  "OT_API_GetAccountWallet_Name");
1905  theScript.chai->add(fun(&OTAPI_Wrap::GetAccountWallet_Balance),
1906  "OT_API_GetAccountWallet_Balance");
1907  theScript.chai->add(fun(&OTAPI_Wrap::GetAccountWallet_Type),
1908  "OT_API_GetAccountWallet_Type");
1909  theScript.chai->add(fun(&OTAPI_Wrap::GetAccountWallet_AssetTypeID),
1910  "OT_API_GetAccountWallet_AssetTypeID");
1911  theScript.chai->add(fun(&OTAPI_Wrap::GetAccountWallet_ServerID),
1912  "OT_API_GetAccountWallet_ServerID");
1913  theScript.chai->add(fun(&OTAPI_Wrap::GetAccountWallet_NymID),
1914  "OT_API_GetAccountWallet_NymID");
1915 
1916  theScript.chai->add(fun(&OTAPI_Wrap::GetAccountWallet_InboxHash),
1917  "OT_API_GetAccountWallet_InboxHash");
1918  theScript.chai->add(fun(&OTAPI_Wrap::GetAccountWallet_OutboxHash),
1919  "OT_API_GetAccountWallet_OutboxHash");
1920 
1921  theScript.chai->add(fun(&OTAPI_Wrap::VerifyAccountReceipt),
1922  "OT_API_VerifyAccountReceipt");
1923  theScript.chai->add(fun(&OTAPI_Wrap::GetNym_TransactionNumCount),
1924  "OT_API_GetNym_TransactionNumCount");
1925 
1926  theScript.chai->add(fun(&OTAPI_Wrap::GetNym_ID), "OT_API_GetNym_ID");
1927  theScript.chai->add(fun(&OTAPI_Wrap::GetNym_Name),
1928  "OT_API_GetNym_Name");
1929  theScript.chai->add(fun(&OTAPI_Wrap::GetNym_Stats),
1930  "OT_API_GetNym_Stats");
1931  theScript.chai->add(fun(&OTAPI_Wrap::GetNym_NymboxHash),
1932  "OT_API_GetNym_NymboxHash");
1933  theScript.chai->add(fun(&OTAPI_Wrap::GetNym_RecentHash),
1934  "OT_API_GetNym_RecentHash");
1935  theScript.chai->add(fun(&OTAPI_Wrap::GetNym_InboxHash),
1936  "OT_API_GetNym_InboxHash");
1937  theScript.chai->add(fun(&OTAPI_Wrap::GetNym_OutboxHash),
1938  "OT_API_GetNym_OutboxHash");
1939 
1940  theScript.chai->add(fun(&OTAPI_Wrap::IsNym_RegisteredAtServer),
1941  "OT_API_IsNym_RegisteredAtServer");
1942 
1943  theScript.chai->add(fun(&OTAPI_Wrap::GetNym_MailCount),
1944  "OT_API_GetNym_MailCount");
1945  theScript.chai->add(fun(&OTAPI_Wrap::GetNym_MailContentsByIndex),
1946  "OT_API_GetNym_MailContentsByIndex");
1947  theScript.chai->add(fun(&OTAPI_Wrap::GetNym_MailSenderIDByIndex),
1948  "OT_API_GetNym_MailSenderIDByIndex");
1949  theScript.chai->add(fun(&OTAPI_Wrap::GetNym_MailServerIDByIndex),
1950  "OT_API_GetNym_MailServerIDByIndex");
1951  theScript.chai->add(fun(&OTAPI_Wrap::Nym_RemoveMailByIndex),
1952  "OT_API_Nym_RemoveMailByIndex");
1953  theScript.chai->add(fun(&OTAPI_Wrap::Nym_VerifyMailByIndex),
1954  "OT_API_Nym_VerifyMailByIndex");
1955  theScript.chai->add(fun(&OTAPI_Wrap::GetNym_OutmailCount),
1956  "OT_API_GetNym_OutmailCount");
1957  theScript.chai->add(fun(&OTAPI_Wrap::GetNym_OutmailContentsByIndex),
1958  "OT_API_GetNym_OutmailContentsByIndex");
1959  theScript.chai->add(fun(&OTAPI_Wrap::GetNym_OutmailRecipientIDByIndex),
1960  "OT_API_GetNym_OutmailRecipientIDByIndex");
1961  theScript.chai->add(fun(&OTAPI_Wrap::GetNym_OutmailServerIDByIndex),
1962  "OT_API_GetNym_OutmailServerIDByIndex");
1963  theScript.chai->add(fun(&OTAPI_Wrap::Nym_RemoveOutmailByIndex),
1964  "OT_API_Nym_RemoveOutmailByIndex");
1965  theScript.chai->add(fun(&OTAPI_Wrap::Nym_VerifyOutmailByIndex),
1966  "OT_API_Nym_VerifyOutmailByIndex");
1967  theScript.chai->add(fun(&OTAPI_Wrap::GetNym_OutpaymentsCount),
1968  "OT_API_GetNym_OutpaymentsCount");
1969  theScript.chai->add(fun(&OTAPI_Wrap::GetNym_OutpaymentsContentsByIndex),
1970  "OT_API_GetNym_OutpaymentsContentsByIndex");
1971  theScript.chai->add(
1973  "OT_API_GetNym_OutpaymentsRecipientIDByIndex");
1974  theScript.chai->add(fun(&OTAPI_Wrap::GetNym_OutpaymentsServerIDByIndex),
1975  "OT_API_GetNym_OutpaymentsServerIDByIndex");
1976  theScript.chai->add(fun(&OTAPI_Wrap::Nym_RemoveOutpaymentsByIndex),
1977  "OT_API_Nym_RemoveOutpaymentsByIndex");
1978  theScript.chai->add(fun(&OTAPI_Wrap::Nym_VerifyOutpaymentsByIndex),
1979  "OT_API_Nym_VerifyOutpaymentsByIndex");
1980 
1981  theScript.chai->add(fun(&OTAPI_Wrap::Wallet_CanRemoveServer),
1982  "OT_API_Wallet_CanRemoveServer");
1983  theScript.chai->add(fun(&OTAPI_Wrap::Wallet_RemoveServer),
1984  "OT_API_Wallet_RemoveServer");
1985  theScript.chai->add(fun(&OTAPI_Wrap::Wallet_CanRemoveAssetType),
1986  "OT_API_Wallet_CanRemoveAssetType");
1987  theScript.chai->add(fun(&OTAPI_Wrap::Wallet_RemoveAssetType),
1988  "OT_API_Wallet_RemoveAssetType");
1989  theScript.chai->add(fun(&OTAPI_Wrap::Wallet_CanRemoveNym),
1990  "OT_API_Wallet_CanRemoveNym");
1991  theScript.chai->add(fun(&OTAPI_Wrap::Wallet_RemoveNym),
1992  "OT_API_Wallet_RemoveNym");
1993  theScript.chai->add(fun(&OTAPI_Wrap::Wallet_CanRemoveAccount),
1994  "OT_API_Wallet_CanRemoveAccount");
1995 
1996  theScript.chai->add(fun(&OTAPI_Wrap::Wallet_ChangePassphrase),
1997  "OT_API_Wallet_ChangePassphrase");
1998 
1999  theScript.chai->add(fun(&OTAPI_Wrap::Wallet_ExportNym),
2000  "OT_API_Wallet_ExportNym");
2001  theScript.chai->add(fun(&OTAPI_Wrap::Wallet_ImportNym),
2002  "OT_API_Wallet_ImportNym");
2003  theScript.chai->add(fun(&OTAPI_Wrap::Wallet_ImportCert),
2004  "OT_API_Wallet_ImportCert");
2005  theScript.chai->add(fun(&OTAPI_Wrap::Wallet_ExportCert),
2006  "OT_API_Wallet_ExportCert");
2007 
2008  theScript.chai->add(fun(&OTAPI_Wrap::Wallet_GetNymIDFromPartial),
2009  "OT_API_Wallet_GetNymIDFromPartial");
2010  theScript.chai->add(fun(&OTAPI_Wrap::Wallet_GetServerIDFromPartial),
2011  "OT_API_Wallet_GetServerIDFromPartial");
2012  theScript.chai->add(fun(&OTAPI_Wrap::Wallet_GetAssetIDFromPartial),
2013  "OT_API_Wallet_GetAssetIDFromPartial");
2014  theScript.chai->add(fun(&OTAPI_Wrap::Wallet_GetAccountIDFromPartial),
2015  "OT_API_Wallet_GetAccountIDFromPartial");
2016 
2017  theScript.chai->add(fun(&OTAPI_Wrap::SetNym_Name),
2018  "OT_API_SetNym_Name");
2019  theScript.chai->add(fun(&OTAPI_Wrap::SetAccountWallet_Name),
2020  "OT_API_SetAccountWallet_Name");
2021  theScript.chai->add(fun(&OTAPI_Wrap::SetAssetType_Name),
2022  "OT_API_SetAssetType_Name");
2023  theScript.chai->add(fun(&OTAPI_Wrap::SetServer_Name),
2024  "OT_API_SetServer_Name");
2025 
2026  theScript.chai->add(fun(&OTAPI_Wrap::VerifyAndRetrieveXMLContents),
2027  "OT_API_VerifyAndRetrieveXMLContents");
2028  theScript.chai->add(fun(&OTAPI_Wrap::WriteCheque),
2029  "OT_API_WriteCheque");
2030  theScript.chai->add(fun(&OTAPI_Wrap::DiscardCheque),
2031  "OT_API_DiscardCheque");
2032  theScript.chai->add(fun(&OTAPI_Wrap::EasyProposePlan),
2033  "OT_API_EasyProposePlan");
2034  theScript.chai->add(fun(&OTAPI_Wrap::ConfirmPaymentPlan),
2035  "OT_API_ConfirmPaymentPlan");
2036 
2037  theScript.chai->add(fun(&OTAPI_Wrap::LoadUserPubkey_Encryption),
2038  "OT_API_LoadUserPubkey_Encryption");
2039  theScript.chai->add(fun(&OTAPI_Wrap::LoadPubkey_Encryption),
2040  "OT_API_LoadPubkey_Encryption");
2041  theScript.chai->add(fun(&OTAPI_Wrap::LoadUserPubkey_Signing),
2042  "OT_API_LoadUserPubkey_Signing");
2043  theScript.chai->add(fun(&OTAPI_Wrap::LoadPubkey_Signing),
2044  "OT_API_LoadPubkey_Signing");
2045  theScript.chai->add(fun(&OTAPI_Wrap::VerifyUserPrivateKey),
2046  "OT_API_VerifyUserPrivateKey");
2047  theScript.chai->add(fun(&OTAPI_Wrap::LoadPurse), "OT_API_LoadPurse");
2048  theScript.chai->add(fun(&OTAPI_Wrap::LoadMint), "OT_API_LoadMint");
2049  theScript.chai->add(fun(&OTAPI_Wrap::LoadAssetContract),
2050  "OT_API_LoadAssetContract");
2051  theScript.chai->add(fun(&OTAPI_Wrap::LoadServerContract),
2052  "OT_API_LoadServerContract");
2053  theScript.chai->add(fun(&OTAPI_Wrap::Mint_IsStillGood),
2054  "OT_API_Mint_IsStillGood");
2055 
2056  theScript.chai->add(fun(&OTAPI_Wrap::IsBasketCurrency),
2057  "OT_API_IsBasketCurrency");
2058  theScript.chai->add(fun(&OTAPI_Wrap::Basket_GetMemberCount),
2059  "OT_API_Basket_GetMemberCount");
2060  theScript.chai->add(fun(&OTAPI_Wrap::Basket_GetMemberType),
2061  "OT_API_Basket_GetMemberType");
2062  theScript.chai->add(fun(&OTAPI_Wrap::Basket_GetMinimumTransferAmount),
2063  "OT_API_Basket_GetMinimumTransferAmount");
2064  theScript.chai->add(
2066  "OT_API_Basket_GetMemberMinimumTransferAmount");
2067 
2068  theScript.chai->add(fun(&OTAPI_Wrap::LoadAssetAccount),
2069  "OT_API_LoadAssetAccount");
2070 
2071  theScript.chai->add(fun(&OTAPI_Wrap::LoadInbox), "OT_API_LoadInbox");
2072  theScript.chai->add(fun(&OTAPI_Wrap::LoadOutbox), "OT_API_LoadOutbox");
2073  theScript.chai->add(fun(&OTAPI_Wrap::LoadPaymentInbox),
2074  "OT_API_LoadPaymentInbox");
2075  theScript.chai->add(fun(&OTAPI_Wrap::LoadRecordBox),
2076  "OT_API_LoadRecordBox");
2077  theScript.chai->add(fun(&OTAPI_Wrap::LoadExpiredBox),
2078  "OT_API_LoadExpiredBox");
2079 
2080  theScript.chai->add(fun(&OTAPI_Wrap::LoadInboxNoVerify),
2081  "OT_API_LoadInboxNoVerify");
2082  theScript.chai->add(fun(&OTAPI_Wrap::LoadOutboxNoVerify),
2083  "OT_API_LoadOutboxNoVerify");
2084 
2085  theScript.chai->add(fun(&OTAPI_Wrap::LoadPaymentInboxNoVerify),
2086  "OT_API_LoadPaymentInboxNoVerify");
2087  theScript.chai->add(fun(&OTAPI_Wrap::LoadRecordBoxNoVerify),
2088  "OT_API_LoadRecordBoxNoVerify");
2089  theScript.chai->add(fun(&OTAPI_Wrap::LoadExpiredBoxNoVerify),
2090  "OT_API_LoadExpiredBoxNoVerify");
2091 
2092  theScript.chai->add(fun(&OTAPI_Wrap::Ledger_GetCount),
2093  "OT_API_Ledger_GetCount");
2094  theScript.chai->add(fun(&OTAPI_Wrap::Ledger_CreateResponse),
2095  "OT_API_Ledger_CreateResponse");
2096  theScript.chai->add(fun(&OTAPI_Wrap::Ledger_GetTransactionByIndex),
2097  "OT_API_Ledger_GetTransactionByIndex");
2098  theScript.chai->add(fun(&OTAPI_Wrap::Ledger_GetTransactionByID),
2099  "OT_API_Ledger_GetTransactionByID");
2100  theScript.chai->add(fun(&OTAPI_Wrap::Ledger_GetTransactionIDByIndex),
2101  "OT_API_Ledger_GetTransactionIDByIndex");
2102  theScript.chai->add(fun(&OTAPI_Wrap::Ledger_GetInstrument),
2103  "OT_API_Ledger_GetInstrument");
2104 
2105  theScript.chai->add(fun(&OTAPI_Wrap::Ledger_AddTransaction),
2106  "OT_API_Ledger_AddTransaction");
2107  theScript.chai->add(fun(&OTAPI_Wrap::Transaction_CreateResponse),
2108  "OT_API_Transaction_CreateResponse");
2109  theScript.chai->add(fun(&OTAPI_Wrap::Ledger_FinalizeResponse),
2110  "OT_API_Ledger_FinalizeResponse");
2111  theScript.chai->add(fun(&OTAPI_Wrap::Transaction_GetType),
2112  "OT_API_Transaction_GetType");
2113 
2114  theScript.chai->add(fun(&OTAPI_Wrap::RecordPayment),
2115  "OT_API_RecordPayment");
2116  theScript.chai->add(fun(&OTAPI_Wrap::ClearRecord),
2117  "OT_API_ClearRecord");
2118  theScript.chai->add(fun(&OTAPI_Wrap::ClearExpired),
2119  "OT_API_ExpiredRecord");
2120 
2121  theScript.chai->add(fun(&OTAPI_Wrap::ReplyNotice_GetRequestNum),
2122  "OT_API_ReplyNotice_GetRequestNum");
2123 
2124  theScript.chai->add(fun(&OTAPI_Wrap::Transaction_GetVoucher),
2125  "OT_API_Transaction_GetVoucher");
2126  theScript.chai->add(fun(&OTAPI_Wrap::Transaction_GetSuccess),
2127  "OT_API_Transaction_GetSuccess");
2128  theScript.chai->add(fun(&OTAPI_Wrap::Transaction_IsCanceled),
2129  "OT_API_Transaction_IsCanceled");
2130  theScript.chai->add(
2132  "OT_API_Transaction_GetBlnceAgrmntSuccess");
2133  theScript.chai->add(fun(&OTAPI_Wrap::Transaction_GetDateSigned),
2134  "OT_API_Transaction_GetDateSigned");
2135  theScript.chai->add(fun(&OTAPI_Wrap::Transaction_GetAmount),
2136  "OT_API_Transaction_GetAmount");
2137  theScript.chai->add(fun(&OTAPI_Wrap::Pending_GetNote),
2138  "OT_API_Pending_GetNote");
2139 
2140  theScript.chai->add(fun(&OTAPI_Wrap::Transaction_GetSenderUserID),
2141  "OT_API_Transaction_GetSenderUserID");
2142  theScript.chai->add(fun(&OTAPI_Wrap::Transaction_GetSenderAcctID),
2143  "OT_API_Transaction_GetSenderAcctID");
2144  theScript.chai->add(fun(&OTAPI_Wrap::Transaction_GetRecipientUserID),
2145  "OT_API_Transaction_GetRecipientUserID");
2146  theScript.chai->add(fun(&OTAPI_Wrap::Transaction_GetRecipientAcctID),
2147  "OT_API_Transaction_GetRecipientAcctID");
2148  theScript.chai->add(
2150  "OT_API_Transaction_GetDisplayReferenceToNum");
2151 
2152  theScript.chai->add(fun(&OTAPI_Wrap::Instrmnt_GetAmount),
2153  "OT_API_Instrmnt_GetAmount");
2154  theScript.chai->add(fun(&OTAPI_Wrap::Instrmnt_GetTransNum),
2155  "OT_API_Instrmnt_GetTransNum");
2156  theScript.chai->add(fun(&OTAPI_Wrap::Instrmnt_GetValidFrom),
2157  "OT_API_Instrmnt_GetValidFrom");
2158  theScript.chai->add(fun(&OTAPI_Wrap::Instrmnt_GetValidTo),
2159  "OT_API_Instrmnt_GetValidTo");
2160  theScript.chai->add(fun(&OTAPI_Wrap::Instrmnt_GetMemo),
2161  "OT_API_Instrmnt_GetMemo");
2162  theScript.chai->add(fun(&OTAPI_Wrap::Instrmnt_GetType),
2163  "OT_API_Instrmnt_GetType");
2164  theScript.chai->add(fun(&OTAPI_Wrap::Instrmnt_GetServerID),
2165  "OT_API_Instrmnt_GetServerID");
2166  theScript.chai->add(fun(&OTAPI_Wrap::Instrmnt_GetAssetID),
2167  "OT_API_Instrmnt_GetAssetID");
2168 
2169  theScript.chai->add(fun(&OTAPI_Wrap::Instrmnt_GetSenderUserID),
2170  "OT_API_Instrmnt_GetSenderUserID");
2171  theScript.chai->add(fun(&OTAPI_Wrap::Instrmnt_GetSenderAcctID),
2172  "OT_API_Instrmnt_GetSenderAcctID");
2173  theScript.chai->add(fun(&OTAPI_Wrap::Instrmnt_GetRemitterUserID),
2174  "OT_API_Instrmnt_GetRemitterUserID");
2175  theScript.chai->add(fun(&OTAPI_Wrap::Instrmnt_GetRemitterAcctID),
2176  "OT_API_Instrmnt_GetRemitterAcctID");
2177  theScript.chai->add(fun(&OTAPI_Wrap::Instrmnt_GetRecipientUserID),
2178  "OT_API_Instrmnt_GetRecipientUserID");
2179  theScript.chai->add(fun(&OTAPI_Wrap::Instrmnt_GetRecipientAcctID),
2180  "OT_API_Instrmnt_GetRecipientAcctID");
2181 
2182  theScript.chai->add(fun(&OTAPI_Wrap::CreatePurse),
2183  "OT_API_CreatePurse");
2184  theScript.chai->add(fun(&OTAPI_Wrap::CreatePurse_Passphrase),
2185  "OT_API_CreatePurse_Passphrase");
2186  theScript.chai->add(fun(&OTAPI_Wrap::SavePurse), "OT_API_SavePurse");
2187  theScript.chai->add(fun(&OTAPI_Wrap::Purse_GetTotalValue),
2188  "OT_API_Purse_GetTotalValue");
2189  theScript.chai->add(fun(&OTAPI_Wrap::Purse_HasPassword),
2190  "OT_API_Purse_HasPassword");
2191  theScript.chai->add(fun(&OTAPI_Wrap::Purse_Count),
2192  "OT_API_Purse_Count");
2193  theScript.chai->add(fun(&OTAPI_Wrap::Purse_Peek), "OT_API_Purse_Peek");
2194  theScript.chai->add(fun(&OTAPI_Wrap::Purse_Pop), "OT_API_Purse_Pop");
2195  theScript.chai->add(fun(&OTAPI_Wrap::Purse_Empty),
2196  "OT_API_Purse_Empty");
2197  theScript.chai->add(fun(&OTAPI_Wrap::Purse_Push), "OT_API_Purse_Push");
2198  theScript.chai->add(fun(&OTAPI_Wrap::Wallet_ImportPurse),
2199  "OT_API_Wallet_ImportPurse");
2200  theScript.chai->add(fun(&OTAPI_Wrap::exchangePurse),
2201  "OT_API_exchangePurse");
2202  theScript.chai->add(fun(&OTAPI_Wrap::Token_ChangeOwner),
2203  "OT_API_Token_ChangeOwner");
2204 
2205  theScript.chai->add(fun(&OTAPI_Wrap::Token_GetID),
2206  "OT_API_Token_GetID");
2207  theScript.chai->add(fun(&OTAPI_Wrap::Token_GetDenomination),
2208  "OT_API_Token_GetDenomination");
2209  theScript.chai->add(fun(&OTAPI_Wrap::Token_GetSeries),
2210  "OT_API_Token_GetSeries");
2211  theScript.chai->add(fun(&OTAPI_Wrap::Token_GetValidFrom),
2212  "OT_API_Token_GetValidFrom");
2213  theScript.chai->add(fun(&OTAPI_Wrap::Token_GetValidTo),
2214  "OT_API_Token_GetValidTo");
2215  theScript.chai->add(fun(&OTAPI_Wrap::Token_GetAssetID),
2216  "OT_API_Token_GetAssetID");
2217  theScript.chai->add(fun(&OTAPI_Wrap::Token_GetServerID),
2218  "OT_API_Token_GetServerID");
2219 
2220  theScript.chai->add(fun(&OTAPI_Wrap::checkServerID),
2221  "OT_API_checkServerID");
2222  theScript.chai->add(fun(&OTAPI_Wrap::createUserAccount),
2223  "OT_API_createUserAccount");
2224  theScript.chai->add(fun(&OTAPI_Wrap::deleteUserAccount),
2225  "OT_API_deleteUserAccount");
2226  theScript.chai->add(fun(&OTAPI_Wrap::deleteAssetAccount),
2227  "OT_API_deleteAssetAccount");
2228  theScript.chai->add(fun(&OTAPI_Wrap::checkUser), "OT_API_checkUser");
2229  theScript.chai->add(fun(&OTAPI_Wrap::usageCredits),
2230  "OT_API_usageCredits");
2231  theScript.chai->add(fun(&OTAPI_Wrap::sendUserMessage),
2232  "OT_API_sendUserMessage");
2233  theScript.chai->add(fun(&OTAPI_Wrap::sendUserInstrument),
2234  "OT_API_sendUserInstrument");
2235 
2236  theScript.chai->add(fun(&OTAPI_Wrap::getRequest), "OT_API_getRequest");
2237  theScript.chai->add(fun(&OTAPI_Wrap::getTransactionNumber),
2238  "OT_API_getTransactionNumber");
2239  theScript.chai->add(fun(&OTAPI_Wrap::issueAssetType),
2240  "OT_API_issueAssetType");
2241  theScript.chai->add(fun(&OTAPI_Wrap::getContract),
2242  "OT_API_getContract");
2243  theScript.chai->add(fun(&OTAPI_Wrap::getMint), "OT_API_getMint");
2244  theScript.chai->add(fun(&OTAPI_Wrap::createAssetAccount),
2245  "OT_API_createAssetAccount");
2246  theScript.chai->add(fun(&OTAPI_Wrap::getAccount),
2247  "OT_API_getAccount"); // Deprecated
2248  theScript.chai->add(fun(&OTAPI_Wrap::getAccountFiles),
2249  "OT_API_getAccountFiles"); // Replaces getAccount,
2250  // getInbox, getOutbox.
2251  theScript.chai->add(fun(&OTAPI_Wrap::GenerateBasketCreation),
2252  "OT_API_GenerateBasketCreation");
2253 
2254  theScript.chai->add(fun(&OTAPI_Wrap::AddBasketCreationItem),
2255  "OT_API_AddBasketCreationItem");
2256  theScript.chai->add(fun(&OTAPI_Wrap::issueBasket),
2257  "OT_API_issueBasket");
2258  theScript.chai->add(fun(&OTAPI_Wrap::GenerateBasketExchange),
2259  "OT_API_GenerateBasketExchange");
2260  theScript.chai->add(fun(&OTAPI_Wrap::AddBasketExchangeItem),
2261  "OT_API_AddBasketExchangeItem");
2262  theScript.chai->add(fun(&OTAPI_Wrap::exchangeBasket),
2263  "OT_API_exchangeBasket");
2264  theScript.chai->add(fun(&OTAPI_Wrap::notarizeWithdrawal),
2265  "OT_API_notarizeWithdrawal");
2266  theScript.chai->add(fun(&OTAPI_Wrap::notarizeDeposit),
2267  "OT_API_notarizeDeposit");
2268  theScript.chai->add(fun(&OTAPI_Wrap::notarizeTransfer),
2269  "OT_API_notarizeTransfer");
2270 
2271  theScript.chai->add(fun(&OTAPI_Wrap::getInbox),
2272  "OT_API_getInbox"); // Deprecated
2273  theScript.chai->add(fun(&OTAPI_Wrap::getOutbox),
2274  "OT_API_getOutbox"); // Deprecated
2275  theScript.chai->add(fun(&OTAPI_Wrap::getNymbox), "OT_API_getNymbox");
2276 
2277  theScript.chai->add(fun(&OTAPI_Wrap::Nymbox_GetReplyNotice),
2278  "OT_API_Nymbox_GetReplyNotice");
2279 
2280  theScript.chai->add(fun(&OTAPI_Wrap::getBoxReceipt),
2281  "OT_API_getBoxReceipt");
2282  theScript.chai->add(fun(&OTAPI_Wrap::DoesBoxReceiptExist),
2283  "OT_API_DoesBoxReceiptExist");
2284 
2285  theScript.chai->add(fun(&OTAPI_Wrap::LoadNymbox), "OT_API_LoadNymbox");
2286  theScript.chai->add(fun(&OTAPI_Wrap::LoadNymboxNoVerify),
2287  "OT_API_LoadNymboxNoVerify");
2288 
2289  theScript.chai->add(fun(&OTAPI_Wrap::processInbox),
2290  "OT_API_processInbox");
2291  theScript.chai->add(fun(&OTAPI_Wrap::processNymbox),
2292  "OT_API_processNymbox");
2293  theScript.chai->add(fun(&OTAPI_Wrap::withdrawVoucher),
2294  "OT_API_withdrawVoucher");
2295  theScript.chai->add(fun(&OTAPI_Wrap::payDividend),
2296  "OT_API_payDividend");
2297 
2298  theScript.chai->add(fun(&OTAPI_Wrap::depositCheque),
2299  "OT_API_depositCheque");
2300  theScript.chai->add(fun(&OTAPI_Wrap::depositPaymentPlan),
2301  "OT_API_depositPaymentPlan");
2302  theScript.chai->add(fun(&OTAPI_Wrap::issueMarketOffer),
2303  "OT_API_issueMarketOffer");
2304  theScript.chai->add(fun(&OTAPI_Wrap::getMarketList),
2305  "OT_API_getMarketList");
2306  theScript.chai->add(fun(&OTAPI_Wrap::getMarketOffers),
2307  "OT_API_getMarketOffers");
2308  theScript.chai->add(fun(&OTAPI_Wrap::getMarketRecentTrades),
2309  "OT_API_getMarketRecentTrades");
2310  theScript.chai->add(fun(&OTAPI_Wrap::getNym_MarketOffers),
2311  "OT_API_getNym_MarketOffers");
2312  theScript.chai->add(fun(&OTAPI_Wrap::killMarketOffer),
2313  "OT_API_killMarketOffer");
2314  theScript.chai->add(fun(&OTAPI_Wrap::killPaymentPlan),
2315  "OT_API_killPaymentPlan");
2316 
2317  theScript.chai->add(fun(&OTAPI_Wrap::PopMessageBuffer),
2318  "OT_API_PopMessageBuffer");
2319  theScript.chai->add(fun(&OTAPI_Wrap::FlushMessageBuffer),
2320  "OT_API_FlushMessageBuffer");
2321 
2322  theScript.chai->add(fun(&OTAPI_Wrap::GetSentMessage),
2323  "OT_API_GetSentMessage");
2324  theScript.chai->add(fun(&OTAPI_Wrap::RemoveSentMessage),
2325  "OT_API_RemoveSentMessage");
2326  theScript.chai->add(fun(&OTAPI_Wrap::FlushSentMessages),
2327  "OT_API_FlushSentMessages");
2328 
2329  theScript.chai->add(fun(&OTAPI_Wrap::HaveAlreadySeenReply),
2330  "OT_API_HaveAlreadySeenReply");
2331 
2332  theScript.chai->add(fun(&OTAPI_Wrap::Sleep), "OT_API_Sleep");
2333 
2334  theScript.chai->add(fun(&OTAPI_Wrap::ResyncNymWithServer),
2335  "OT_API_ResyncNymWithServer");
2336 
2337  theScript.chai->add(fun(&OTAPI_Wrap::queryAssetTypes),
2338  "OT_API_queryAssetTypes");
2339 
2340  theScript.chai->add(fun(&OTAPI_Wrap::Message_GetPayload),
2341  "OT_API_Message_GetPayload");
2342  theScript.chai->add(fun(&OTAPI_Wrap::Message_GetCommand),
2343  "OT_API_Message_GetCommand");
2344  theScript.chai->add(fun(&OTAPI_Wrap::Message_GetSuccess),
2345  "OT_API_Message_GetSuccess");
2346  theScript.chai->add(fun(&OTAPI_Wrap::Message_GetDepth),
2347  "OT_API_Message_GetDepth");
2348  theScript.chai->add(fun(&OTAPI_Wrap::Message_GetUsageCredits),
2349  "OT_API_Message_GetUsageCredits");
2350  theScript.chai->add(fun(&OTAPI_Wrap::Message_GetTransactionSuccess),
2351  "OT_API_Msg_GetTransactionSuccess");
2352  theScript.chai->add(fun(&OTAPI_Wrap::Message_IsTransactionCanceled),
2353  "OT_API_Msg_IsTransactionCanceled");
2354  theScript.chai->add(
2356  "OT_API_Msg_GetBlnceAgrmntSuccess");
2357  theScript.chai->add(fun(&OTAPI_Wrap::Message_GetLedger),
2358  "OT_API_Message_GetLedger");
2359  theScript.chai->add(fun(&OTAPI_Wrap::Message_GetNewAssetTypeID),
2360  "OT_API_Message_GetNewAssetTypeID");
2361  theScript.chai->add(fun(&OTAPI_Wrap::Message_GetNewIssuerAcctID),
2362  "OT_API_Message_GetNewIssuerAcctID");
2363  theScript.chai->add(fun(&OTAPI_Wrap::Message_GetNewAcctID),
2364  "OT_API_Message_GetNewAcctID");
2365  theScript.chai->add(fun(&OTAPI_Wrap::Message_GetNymboxHash),
2366  "OT_API_Message_GetNymboxHash");
2367 
2368  theScript.chai->add(fun(&OTAPI_Wrap::Create_SmartContract),
2369  "OT_API_Create_SmartContract");
2370 
2371  theScript.chai->add(fun(&OTAPI_Wrap::SmartContract_AddBylaw),
2372  "OT_API_SmartContract_AddBylaw");
2373  theScript.chai->add(fun(&OTAPI_Wrap::SmartContract_AddClause),
2374  "OT_API_SmartContract_AddClause");
2375  theScript.chai->add(fun(&OTAPI_Wrap::SmartContract_AddVariable),
2376  "OT_API_SmartContract_AddVariable");
2377  theScript.chai->add(fun(&OTAPI_Wrap::SmartContract_AddCallback),
2378  "OT_API_SmartContract_AddCallback");
2379  theScript.chai->add(fun(&OTAPI_Wrap::SmartContract_AddHook),
2380  "OT_API_SmartContract_AddHook");
2381 
2382  theScript.chai->add(fun(&OTAPI_Wrap::SmartContract_AddParty),
2383  "OT_API_SmartContract_AddParty");
2384  theScript.chai->add(fun(&OTAPI_Wrap::SmartContract_AddAccount),
2385  "OT_API_SmartContract_AddAccount");
2386 
2387  theScript.chai->add(fun(&OTAPI_Wrap::SmartContract_ConfirmAccount),
2388  "OT_API_SmartContract_ConfirmAccount");
2389  theScript.chai->add(fun(&OTAPI_Wrap::SmartContract_ConfirmParty),
2390  "OT_API_SmartContract_ConfirmParty");
2391 
2392  theScript.chai->add(fun(&OTAPI_Wrap::SmartContract_CountNumsNeeded),
2393  "OT_API_SmartContract_CountNumsNeeded");
2394 
2395  theScript.chai->add(fun(&OTAPI_Wrap::Msg_HarvestTransactionNumbers),
2396  "OT_API_Msg_HarvestTransactionNumbers");
2397 
2398  // theScript.chai->add(fun(&OTAPI_Wrap::HarvestClosingNumbers),
2399  // "OT_API_HarvestClosingNumbers");
2400  // theScript.chai->add(fun(&OTAPI_Wrap::HarvestAllNumbers),
2401  // "OT_API_HarvestAllNumbers");
2402 
2403  theScript.chai->add(fun(&OTAPI_Wrap::Smart_AreAllPartiesConfirmed),
2404  "OT_API_Smart_AreAllPartiesConfirmed");
2405  theScript.chai->add(fun(&OTAPI_Wrap::Smart_IsPartyConfirmed),
2406  "OT_API_Smart_IsPartyConfirmed");
2407  theScript.chai->add(fun(&OTAPI_Wrap::Smart_GetBylawCount),
2408  "OT_API_Smart_GetBylawCount");
2409  theScript.chai->add(fun(&OTAPI_Wrap::Smart_GetBylawByIndex),
2410  "OT_API_Smart_GetBylawByIndex");
2411  theScript.chai->add(fun(&OTAPI_Wrap::Bylaw_GetLanguage),
2412  "OT_API_Bylaw_GetLanguage");
2413  theScript.chai->add(fun(&OTAPI_Wrap::Bylaw_GetClauseCount),
2414  "OT_API_Bylaw_GetClauseCount");
2415  theScript.chai->add(fun(&OTAPI_Wrap::Clause_GetNameByIndex),
2416  "OT_API_Clause_GetNameByIndex");
2417  theScript.chai->add(fun(&OTAPI_Wrap::Clause_GetContents),
2418  "OT_API_Clause_GetContents");
2419  theScript.chai->add(fun(&OTAPI_Wrap::Bylaw_GetVariableCount),
2420  "OT_API_Bylaw_GetVariableCount");
2421  theScript.chai->add(fun(&OTAPI_Wrap::Variable_GetNameByIndex),
2422  "OT_API_Variable_GetNameByIndex");
2423  theScript.chai->add(fun(&OTAPI_Wrap::Variable_GetType),
2424  "OT_API_Variable_GetType");
2425  theScript.chai->add(fun(&OTAPI_Wrap::Variable_GetAccess),
2426  "OT_API_Variable_GetAccess");
2427  theScript.chai->add(fun(&OTAPI_Wrap::Variable_GetContents),
2428  "OT_API_Variable_GetContents");
2429  theScript.chai->add(fun(&OTAPI_Wrap::Bylaw_GetHookCount),
2430  "OT_API_Bylaw_GetHookCount");
2431  theScript.chai->add(fun(&OTAPI_Wrap::Hook_GetNameByIndex),
2432  "OT_API_Hook_GetNameByIndex");
2433  theScript.chai->add(fun(&OTAPI_Wrap::Hook_GetClauseCount),
2434  "OT_API_Hook_GetClauseCount");
2435  theScript.chai->add(fun(&OTAPI_Wrap::Hook_GetClauseAtIndex),
2436  "OT_API_Hook_GetClauseAtIndex");
2437  theScript.chai->add(fun(&OTAPI_Wrap::Bylaw_GetCallbackCount),
2438  "OT_API_Bylaw_GetCallbackCount");
2439  theScript.chai->add(fun(&OTAPI_Wrap::Callback_GetNameByIndex),
2440  "OT_API_Callback_GetNameByIndex");
2441  theScript.chai->add(fun(&OTAPI_Wrap::Callback_GetClause),
2442  "OT_API_Callback_GetClause");
2443  theScript.chai->add(fun(&OTAPI_Wrap::Smart_GetPartyCount),
2444  "OT_API_Smart_GetPartyCount");
2445  theScript.chai->add(fun(&OTAPI_Wrap::Smart_GetPartyByIndex),
2446  "OT_API_Smart_GetPartyByIndex");
2447  theScript.chai->add(fun(&OTAPI_Wrap::Party_GetID),
2448  "OT_API_Party_GetID");
2449  theScript.chai->add(fun(&OTAPI_Wrap::Party_GetAcctCount),
2450  "OT_API_Party_GetAcctCount");
2451  theScript.chai->add(fun(&OTAPI_Wrap::Party_GetAcctNameByIndex),
2452  "OT_API_Party_GetAcctNameByIndex");
2453  theScript.chai->add(fun(&OTAPI_Wrap::Party_GetAcctID),
2454  "OT_API_Party_GetAcctID");
2455  theScript.chai->add(fun(&OTAPI_Wrap::Party_GetAcctAssetID),
2456  "OT_API_Party_GetAcctAssetID");
2457  theScript.chai->add(fun(&OTAPI_Wrap::Party_GetAcctAgentName),
2458  "OT_API_Party_GetAcctAgentName");
2459  theScript.chai->add(fun(&OTAPI_Wrap::Party_GetAgentCount),
2460  "OT_API_Party_GetAgentCount");
2461  theScript.chai->add(fun(&OTAPI_Wrap::Party_GetAgentNameByIndex),
2462  "OT_API_Party_GetAgentNameByIndex");
2463  theScript.chai->add(fun(&OTAPI_Wrap::Party_GetAgentID),
2464  "OT_API_Party_GetAgentID");
2465 
2466  theScript.chai->add(fun(&OTAPI_Wrap::activateSmartContract),
2467  "OT_API_activateSmartContract");
2468  theScript.chai->add(fun(&OTAPI_Wrap::triggerClause),
2469  "OT_API_triggerClause");
2470 
2471  return true; // Success (hopefully!)
2472  }
2473 }
2474 
2475 #endif // OT_USE_SCRIPT_CHAI
2476 
2477 // Used in RegisterAPIWithScript.
2478 // (In D, this would be a nested function, but C++ doesn't support that
2479 // without using a nested class as a kludge.)
2480 //
2481 bool NewScriptExists(const OTString& strScriptFilename, bool bIsHeader,
2482  OTString& out_ScriptFilepath)
2483 {
2484  //
2485  // "so $(prefix)/lib/opentxs for the headers,
2486  // and others:
2487  // 1st priorty: $(data_dir)/scripts
2488  // 2nd priorty: $(prefix)/lib/opentxs/scripts
2489  //
2490  int64_t lFileLength(0);
2491 
2492  OT_ASSERT_MSG(strScriptFilename.Exists(),
2493  "NewScriptHeaderExists: Error! Filename not Supplied!");
2494  if (3 > strScriptFilename.GetLength()) {
2495  otErr << "NewScriptHeaderExists: Filename: " << strScriptFilename
2496  << " is too short!\n";
2497  OT_FAIL;
2498  }
2499 
2500  OTString strScriptsFolder(OTPaths::ScriptsFolder()); // /usr/local / lib
2501  // / opentxs OR
2502  // (android) res/raw
2503  {
2504  bool bGetFolderSuccess =
2505  strScriptsFolder.Exists() && 3 < strScriptsFolder.GetLength();
2506  OT_ASSERT_MSG(bGetFolderSuccess,
2507  "NewScriptHeaderExists: Unalbe to Get Scripts Path");
2508  }
2509 
2510  if (bIsHeader) {
2511 
2512  {
2513  bool bBuildFullPathSuccess = OTPaths::AppendFile(
2514  out_ScriptFilepath, strScriptsFolder, strScriptFilename);
2515  OT_ASSERT_MSG(
2516  bBuildFullPathSuccess,
2517  "NewScriptHeaderExists: Unalbe to Build Full Script Path");
2518  }
2519 
2520  return OTPaths::FileExists(out_ScriptFilepath, lFileLength);
2521  }
2522  else {
2523  OTString strDataFolder(OTDataFolder::Get()), strDataScriptsFolder;
2524 
2525  {
2526  bool bGetFolderSuccess =
2527  strDataFolder.Exists() && 3 < strDataFolder.GetLength();
2528  OT_ASSERT_MSG(bGetFolderSuccess,
2529  "NewScriptHeaderExists: Unalbe to Get Scripts Path");
2530  }
2531 
2532  {
2533  bool bBuildScriptPath = OTPaths::RelativeToCanonical(
2534  strDataScriptsFolder, strDataFolder, "scripts");
2535  OT_ASSERT_MSG(
2536  bBuildScriptPath,
2537  "NewScriptHeaderExists: Unalbe to Build Full Script Path");
2538  }
2539 
2540  {
2541  bool bBuildFullPathSuccess = OTPaths::RelativeToCanonical(
2542  out_ScriptFilepath, strDataScriptsFolder, strScriptFilename);
2543  OT_ASSERT_MSG(
2544  bBuildFullPathSuccess,
2545  "NewScriptHeaderExists: Unalbe to Build Full Script Path");
2546  }
2547 
2548  if (OTPaths::FileExists(out_ScriptFilepath, lFileLength))
2549  return true;
2550  else {
2551  OTString strGlobalScriptsFolder;
2552 
2553  {
2554  bool bBuildScriptPath = OTPaths::RelativeToCanonical(
2555  strGlobalScriptsFolder, strScriptsFolder, "scripts");
2556  OT_ASSERT_MSG(
2557  bBuildScriptPath,
2558  "NewScriptHeaderExists: Unalbe to Build Full Script Path");
2559  }
2560  {
2561  bool bBuildFullPathSuccess = OTPaths::RelativeToCanonical(
2562  out_ScriptFilepath, strGlobalScriptsFolder,
2563  strScriptFilename);
2564  OT_ASSERT_MSG(
2565  bBuildFullPathSuccess,
2566  "NewScriptHeaderExists: Unalbe to Build Full Script Path");
2567  }
2568 
2569  return OTPaths::FileExists(out_ScriptFilepath, lFileLength);
2570  }
2571  }
2572 }
2573 
2574 #ifdef OT_USE_SCRIPT_CHAI
2575 
2576 // bool OT_ME::Register_Headers_With_Script_Lua(OTScriptLua& theScript)
2577 
2578 // Note: Private method. Assumes theScript is m_pScript (but now as
2579 // a specific type, aka OTScriptChai, vs just being an OTScript.)
2580 //
2581 bool OT_ME::Register_Headers_With_Script_Chai(
2582  const OTScriptChai& theScript) const
2583 {
2584  using namespace chaiscript;
2585  {
2628  // There were many path problems with including these scripts inside the
2629  // user scripts,
2630  // so I am forcing the issue here, to keep things clean. This way, the
2631  // entire OT API,
2632  // both the C++ functions, as well as the below script functions, grows
2633  // together as one
2634  // and will be seen as one from inside the scripts, where script
2635  // programmers can
2636  // pick and choose which level of abstraction that they need.
2637  //
2638  //
2639  // SCRIPT HEADERS
2640  //
2641 
2642  otWarn << "\n" << __FUNCTION__ << ": Using Script Headers:\n";
2643 
2644  OTString strHeaderFilePath_01;
2645  if (NewScriptExists("ot_utility.ot", true, strHeaderFilePath_01)) {
2646  otWarn << " " << strHeaderFilePath_01 << "\n";
2647  }
2648  else {
2649  otErr << __FUNCTION__
2650  << ": Header script not found: " << strHeaderFilePath_01
2651  << "\n";
2652  return false;
2653  }
2654 
2655  OTString strHeaderFilePath_02;
2656  if (NewScriptExists("otapi.ot", true, strHeaderFilePath_02)) {
2657  otWarn << " " << strHeaderFilePath_02 << "\n";
2658  }
2659  else {
2660  otErr << __FUNCTION__
2661  << ": Header script not found: " << strHeaderFilePath_02
2662  << "\n";
2663  return false;
2664  }
2665 
2666  try {
2667  theScript.chai->use(strHeaderFilePath_01.Get());
2668  theScript.chai->use(strHeaderFilePath_02.Get());
2669  }
2670  catch (const chaiscript::exception::eval_error& ee) {
2671  // Error in script parsing / execution
2672  otErr << __FUNCTION__
2673  << ": Caught chaiscript::exception::eval_error : "
2674  << ee.reason << ". \n"
2675  " File: " << ee.filename
2676  << "\n"
2677  " Start position, line: " << ee.start_position.line
2678  << " column: " << ee.start_position.column
2679  << "\n"
2680  " End position, line: " << ee.end_position.line
2681  << " column: " << ee.end_position.column << "\n";
2682 
2683  std::cout << ee.what();
2684  if (ee.call_stack.size() > 0) {
2685  std::cout << "during evaluation at ("
2686  << ee.call_stack[0]->start.line << ", "
2687  << ee.call_stack[0]->start.column << ")";
2688  }
2689  std::cout << std::endl << std::endl;
2690 
2691  if (ee.call_stack.size() > 0) {
2692  for (size_t j = 1; j < ee.call_stack.size(); ++j) {
2693  if (ee.call_stack[j]->identifier !=
2694  chaiscript::AST_Node_Type::Block &&
2695  ee.call_stack[j]->identifier !=
2696  chaiscript::AST_Node_Type::File) {
2697  std::cout << std::endl;
2698  std::cout << " from " << *(ee.call_stack[j]->filename)
2699  << " (" << ee.call_stack[j]->start.line
2700  << ", " << ee.call_stack[j]->start.column
2701  << ") : ";
2702  std::cout << ee.call_stack[j]->text << std::endl;
2703  }
2704  }
2705  }
2706  std::cout << std::endl;
2707  return false;
2708  }
2709  catch (const chaiscript::exception::bad_boxed_cast& e) {
2710  // Error unboxing return value
2711  otErr << __FUNCTION__
2712  << ": Caught chaiscript::exception::bad_boxed_cast : "
2713  << ((e.what() != nullptr) ? e.what()
2714  : "e.what() returned null, sorry")
2715  << ".\n";
2716  return false;
2717  }
2718  catch (const std::exception& e) {
2719  // Error explicitly thrown from script
2720  otErr << __FUNCTION__ << ": Caught std::exception exception: "
2721  << ((e.what() != nullptr) ? e.what()
2722  : "e.what() returned null, sorry")
2723  << "\n";
2724  return false;
2725  }
2726  // catch (chaiscript::Boxed_Value bv) {}
2727  catch (...) {
2728  otErr << __FUNCTION__ << ": Caught exception.\n";
2729  return false;
2730  }
2731 
2732  return true; // Success (hopefully!)
2733  }
2734 }
2735 
2736 #endif // OT_USE_SCRIPT_CHAI
2737 
2738 } // namespace opentxs
static EXPORT std::string AddSubcredential(const std::string &NYM_ID, const std::string &MASTER_CRED_ID, const int32_t &nKeySize)
Definition: OTAPI.cpp:441
static EXPORT std::string SmartContract_AddParty(const std::string &THE_CONTRACT, const std::string &SIGNER_NYM_ID, const std::string &PARTY_NAME, const std::string &AGENT_NAME)
Definition: OTAPI.cpp:1172
static EXPORT std::string GetAccountWallet_Name(const std::string &ACCOUNT_ID)
Definition: OTAPI.cpp:924
static EXPORT int32_t Token_GetSeries(const std::string &SERVER_ID, const std::string &ASSET_TYPE_ID, const std::string &THE_TOKEN)
Definition: OTAPI.cpp:1949
static EXPORT bool FileExists(const OTString &strFilePath, int64_t &nFileLength)
Definition: OTPaths.cpp:842
EXPORT bool StorePlainString(std::string strContents, std::string strFolder, std::string oneStr="", std::string twoStr="", std::string threeStr="")
Definition: OTStorage.cpp:698
EXPORT std::string exchange_basket_currency(const std::string &SERVER_ID, const std::string &NYM_ID, const std::string &ASSET_TYPE_ID, const std::string &THE_BASKET, const std::string &ACCOUNT_ID, bool IN_OR_OUT) const
Definition: OT_ME.cpp:438
static EXPORT int32_t checkServerID(const std::string &SERVER_ID, const std::string &USER_ID)
Definition: OTAPI.cpp:2009
static EXPORT int32_t createUserAccount(const std::string &SERVER_ID, const std::string &USER_ID)
Definition: OTAPI.cpp:2015
static EXPORT std::string Party_GetAcctAssetID(const std::string &THE_CONTRACT, const std::string &PARTY_NAME, const std::string &ACCT_NAME)
Definition: OTAPI.cpp:1388
static EXPORT int32_t Transaction_IsCanceled(const std::string &SERVER_ID, const std::string &USER_ID, const std::string &ACCOUNT_ID, const std::string &THE_TRANSACTION)
Definition: OTAPI.cpp:1796
std::string issue_asset_type(const std::string &SERVER_ID, const std::string &NYM_ID, const std::string &THE_CONTRACT) const
Definition: OTMeCpp.cpp:178
static EXPORT std::string Ledger_AddTransaction(const std::string &SERVER_ID, const std::string &USER_ID, const std::string &ACCOUNT_ID, const std::string &THE_LEDGER, const std::string &THE_TRANSACTION)
Add a transaction to a ledger.
Definition: OTAPI.cpp:1668
static EXPORT std::string GetAccountWallet_NymID(const std::string &ACCOUNT_ID)
Definition: OTAPI.cpp:1052
static EXPORT std::string LoadOutboxNoVerify(const std::string &SERVER_ID, const std::string &USER_ID, const std::string &ACCOUNT_ID)
Definition: OTAPI.cpp:1546
static EXPORT std::string GetNym_InboxHash(const std::string &ACCOUNT_ID, const std::string &NYM_ID)
Definition: OTAPI.cpp:676
EXPORT Storable * CreateObject(StoredObjectType eType)
Definition: OTStorage.cpp:530
static EXPORT std::string GetSentMessage(const int64_t &REQUEST_NUMBER, const std::string &SERVER_ID, const std::string &USER_ID)
Definition: OTAPI.cpp:2344
static EXPORT int32_t getMarketOffers(const std::string &SERVER_ID, const std::string &USER_ID, const std::string &MARKET_ID, const int64_t &MAX_DEPTH)
Gets all offers for a specific market and their details (up until.
Definition: OTAPI.cpp:2311
static EXPORT int64_t Instrmnt_GetAmount(const std::string &THE_INSTRUMENT)
Definition: OTAPI.cpp:793
static EXPORT int64_t Instrmnt_GetTransNum(const std::string &THE_INSTRUMENT)
Definition: OTAPI.cpp:798
static EXPORT std::string Instrmnt_GetSenderAcctID(const std::string &THE_INSTRUMENT)
Definition: OTAPI.cpp:851
static EXPORT std::string LoadAssetContract(const std::string &ASSET_TYPE_ID)
Definition: OTAPI.cpp:1482
EXPORT std::string send_user_pmnt_pubkey(const std::string &SERVER_ID, const std::string &NYM_ID, const std::string &RECIPIENT_NYM_ID, const std::string &RECIPIENT_PUBKEY, const std::string &THE_INSTRUMENT) const
Definition: OT_ME.cpp:606
static EXPORT bool DoesBoxReceiptExist(const std::string &SERVER_ID, const std::string &USER_ID, const std::string &ACCOUNT_ID, const int32_t &nBoxType, const int64_t &TRANSACTION_NUMBER)
Definition: OTAPI.cpp:566
static EXPORT int32_t GetAccountCount()
Definition: OTAPI.cpp:526
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.
Definition: OTAPI.cpp:619
static EXPORT int32_t Basket_GetMemberCount(const std::string &BASKET_ASSET_TYPE_ID)
Definition: OTAPI.cpp:1985
static EXPORT bool SavePurse(const std::string &SERVER_ID, const std::string &ASSET_TYPE_ID, const std::string &USER_ID, const std::string &THE_PURSE)
Definition: OTAPI.cpp:1821
bool deposit_cash(const std::string &SERVER_ID, const std::string &NYM_ID, const std::string &ACCT_ID, const std::string &STR_PURSE) const
Definition: OTMeCpp.cpp:542
EXPORT std::string trigger_clause(const std::string &SERVER_ID, const std::string &NYM_ID, int64_t TRANS_NUM, const std::string &CLAUSE_NAME, const std::string &STR_PARAM) const
Definition: OT_ME.cpp:797
std::string CopyValueString() const
Definition: OTVariable.hpp:254
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)
Definition: OTAPI.cpp:1677
static EXPORT bool IsBasketCurrency(const std::string &ASSET_TYPE_ID)
Definition: OTAPI.cpp:1980
static EXPORT std::string Instrmnt_GetRemitterUserID(const std::string &THE_INSTRUMENT)
Definition: OTAPI.cpp:833
EXPORT std::string QueryString(std::string strFolder, std::string oneStr="", std::string twoStr="", std::string threeStr="")
Definition: OTStorage.cpp:671
std::string stat_asset_account(const std::string &ACCOUNT_ID) const
Definition: OTMeCpp.cpp:224
OTVariable_Type GetType() const
Definition: OTVariable.hpp:224
EXPORT void RegisterForExecution(OTScript &theScript)
Definition: OTVariable.cpp:424
EXPORT std::string get_market_list(const std::string &SERVER_ID, const std::string &NYM_ID) const
Definition: OT_ME.cpp:894
static EXPORT int32_t Message_GetSuccess(const std::string &THE_MESSAGE)
Definition: OTAPI.cpp:2423
static EXPORT std::string SmartContract_AddHook(const std::string &THE_CONTRACT, const std::string &SIGNER_NYM_ID, const std::string &BYLAW_NAME, const std::string &HOOK_NAME, const std::string &CLAUSE_NAME)
Definition: OTAPI.cpp:1162
static EXPORT int32_t processNymbox(const std::string &SERVER_ID, const std::string &USER_ID)
Definition: OTAPI.cpp:2230
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)
Definition: OTAPI.cpp:2123
static EXPORT std::string Instrmnt_GetRemitterAcctID(const std::string &THE_INSTRUMENT)
Definition: OTAPI.cpp:839
static EXPORT std::string Token_GetAssetID(const std::string &THE_TOKEN)
Definition: OTAPI.cpp:1970
static EXPORT void FlushMessageBuffer()
Definition: OTAPI.cpp:2339
std::string trigger_clause(const std::string &SERVER_ID, const std::string &NYM_ID, int64_t TRANS_NUM, const std::string &CLAUSE_NAME, const std::string &STR_PARAM) const
Definition: OTMeCpp.cpp:474
EXPORT std::string cancel_payment_plan(const std::string &SERVER_ID, const std::string &NYM_ID, const std::string &THE_PAYMENT_PLAN) const
Definition: OT_ME.cpp:776
EXPORT 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) const
Definition: OT_ME.cpp:655
EXPORT void ExecuteScript_ReturnVoid(const std::string &str_Code, std::string str_DisplayName="<BLANK>")
Definition: OT_ME.cpp:1202
EXPORT std::string ExecuteScript_ReturnString(const std::string &str_Code, std::string str_DisplayName="<BLANK>")
Definition: OT_ME.cpp:1151
static EXPORT std::string Wallet_GetAssetIDFromPartial(const std::string &PARTIAL_ID)
Definition: OTAPI.cpp:631
std::string kill_market_offer(const std::string &SERVER_ID, const std::string &NYM_ID, const std::string &ASSET_ACCT_ID, int64_t TRANS_NUM) const
Definition: OTMeCpp.cpp:440
EXPORT std::string OT_CLI_GetValueByIndex(const std::string &str_Args, int32_t nIndex)
Definition: OT_ME.cpp:222
static EXPORT std::string Party_GetAgentID(const std::string &THE_CONTRACT, const std::string &PARTY_NAME, const std::string &AGENT_NAME)
Definition: OTAPI.cpp:1409
static EXPORT bool Wallet_CanRemoveServer(const std::string &SERVER_ID)
Definition: OTAPI.cpp:531
std::string export_cash(const std::string &SERVER_ID, const std::string &FROM_NYM_ID, const std::string &ASSET_TYPE_ID, const std::string &TO_NYM_ID, const std::string &STR_INDICES, bool bPasswordProtected, std::string &STR_RETAINED_COPY) const
Definition: OTMeCpp.cpp:498
static EXPORT std::string GetNym_ID(const int32_t &nIndex)
Definition: OTAPI.cpp:643
std::string get_market_offers(const std::string &SERVER_ID, const std::string &NYM_ID, const std::string &MARKET_ID, int64_t MAX_DEPTH) const
Definition: OTMeCpp.cpp:566
EXPORT std::string OT_CLI_GetValueByKey(const std::string &str_Args, const std::string &str_key)
Definition: OT_ME.cpp:201
static EXPORT bool Wallet_RemoveNym(const std::string &NYM_ID)
Definition: OTAPI.cpp:556
static EXPORT int64_t ReplyNotice_GetRequestNum(const std::string &SERVER_ID, const std::string &USER_ID, const std::string &THE_TRANSACTION)
Transactions do not have request numbers. However, if you have a.
Definition: OTAPI.cpp:1771
EXPORT bool easy_withdraw_cash(const std::string &ACCT_ID, int64_t AMOUNT) const
Definition: OT_ME.cpp:820
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)
Definition: OTAPI.cpp:1108
std::string get_payment_instrument(const std::string &SERVER_ID, const std::string &NYM_ID, int32_t nIndex, const std::string &PRELOADED_INBOX) const
Definition: OTMeCpp.cpp:389
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) const
Definition: OTMeCpp.cpp:368
static EXPORT std::string Bylaw_GetLanguage(const std::string &THE_CONTRACT, const std::string &BYLAW_NAME)
Definition: OTAPI.cpp:1246
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)
Definition: OTAPI.cpp:1434
static EXPORT std::string GetNym_RecentHash(const std::string &SERVER_ID, const std::string &NYM_ID)
Definition: OTAPI.cpp:670
static EXPORT std::string LoadPurse(const std::string &SERVER_ID, const std::string &ASSET_TYPE_ID, const std::string &USER_ID)
Definition: OTAPI.cpp:1829
static EXPORT std::string Party_GetAgentNameByIndex(const std::string &THE_CONTRACT, const std::string &PARTY_NAME, const int32_t &nIndex)
Definition: OTAPI.cpp:1402
static EXPORT std::string Wallet_ExportNym(const std::string &NYM_ID)
Returns the exported Nym, if success. (Else nullptr.)
Definition: OTAPI.cpp:593
static EXPORT std::string CreatePurse(const std::string &SERVER_ID, const std::string &ASSET_TYPE_ID, const std::string &OWNER_ID, const std::string &SIGNER_ID)
Definition: OTAPI.cpp:1856
static EXPORT std::string LoadPubkey_Encryption(const std::string &USER_ID)
Definition: OTAPI.cpp:1445
std::string get_nym_market_offers(const std::string &SERVER_ID, const std::string &NYM_ID) const
Definition: OTMeCpp.cpp:574
static EXPORT std::string Purse_Empty(const std::string &SERVER_ID, const std::string &ASSET_TYPE_ID, const std::string &SIGNER_ID, const std::string &THE_PURSE)
Definition: OTAPI.cpp:1888
static EXPORT std::string GetNym_OutboxHash(const std::string &ACCOUNT_ID, const std::string &NYM_ID)
Definition: OTAPI.cpp:682
static EXPORT int32_t Smart_GetBylawCount(const std::string &THE_CONTRACT)
Definition: OTAPI.cpp:1229
std::vector< uint8_t > m_memBuffer
Definition: OTStorage.hpp:956
static EXPORT std::string LoadPaymentInbox(const std::string &SERVER_ID, const std::string &USER_ID)
Definition: OTAPI.cpp:1553
std::string load_or_retrieve_mint(const std::string &SERVER_ID, const std::string &NYM_ID, const std::string &ASSET_ID) const
Definition: OTMeCpp.cpp:413
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)
Definition: OTAPI.cpp:1720
EXPORT bool discard_incoming_payments(const std::string &SERVER_ID, const std::string &NYM_ID, const std::string &INDICES) const
Definition: OT_ME.cpp:530
static EXPORT std::string GetNym_OutmailContentsByIndex(const std::string &NYM_ID, const int32_t &nIndex)
Definition: OTAPI.cpp:728
std::string get_market_list(const std::string &SERVER_ID, const std::string &NYM_ID) const
Definition: OTMeCpp.cpp:560
static EXPORT std::string Token_ChangeOwner(const std::string &SERVER_ID, const std::string &ASSET_TYPE_ID, const std::string &THE_TOKEN, const std::string &SIGNER_NYM_ID, const std::string &OLD_OWNER, const std::string &NEW_OWNER)
Definition: OTAPI.cpp:1924
static EXPORT int32_t activateSmartContract(const std::string &SERVER_ID, const std::string &USER_ID, const std::string &THE_SMART_CONTRACT)
Definition: OTAPI.cpp:1416
std::string issue_basket_currency(const std::string &SERVER_ID, const std::string &NYM_ID, const std::string &THE_BASKET) const
Definition: OTMeCpp.cpp:185
EXPORT std::string load_public_encryption_key(const std::string &NYM_ID) const
Definition: OT_ME.cpp:558
EXPORT std::string get_market_recent_trades(const std::string &SERVER_ID, const std::string &NYM_ID, const std::string &MARKET_ID) const
Definition: OT_ME.cpp:915
static EXPORT int32_t GetServerCount()
Definition: OTAPI.cpp:516
EXPORT OT_ME()
Definition: OT_ME.cpp:158
std::string create_nym(int32_t nKeybits, const std::string &NYM_ID_SOURCE, const std::string &ALT_LOCATION) const
Definition: OTMeCpp.cpp:171
static EXPORT std::string Instrmnt_GetServerID(const std::string &THE_INSTRUMENT)
Definition: OTAPI.cpp:823
static EXPORT int32_t payDividend(const std::string &SERVER_ID, const std::string &ISSUER_USER_ID, const std::string &DIVIDEND_FROM_ACCT_ID, const std::string &SHARES_ASSET_TYPE_ID, const std::string &DIVIDEND_MEMO, const int64_t &AMOUNT_PER_SHARE)
PAY DIVIDEND – to shareholders.
Definition: OTAPI.cpp:2247
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)
Definition: OTAPI.cpp:1687
static EXPORT bool Nym_VerifyMailByIndex(const std::string &NYM_ID, const int32_t &nIndex)
Definition: OTAPI.cpp:717
static EXPORT std::string SymmetricEncrypt(const std::string &SYMMETRIC_KEY, const std::string &PLAINTEXT)
Definition: OTAPI.cpp:975
EXPORT 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) const
Definition: OT_ME.cpp:631
bool NewScriptExists(const OTString &strScriptFilename, bool bIsHeader, OTString &out_ScriptFilepath)
Definition: OT_ME.cpp:2481
static EXPORT std::string Wallet_GetAccountIDFromPartial(const std::string &PARTIAL_ID)
Definition: OTAPI.cpp:637
EXPORT OTVariable * FindVariable(const std::string &str_var_name)
Definition: OT_ME.cpp:1140
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) const
Definition: OTMeCpp.cpp:512
static EXPORT std::string Instrmnt_GetAssetID(const std::string &THE_INSTRUMENT)
Definition: OTAPI.cpp:828
std::string send_user_msg_pubkey(const std::string &SERVER_ID, const std::string &NYM_ID, const std::string &RECIPIENT_NYM_ID, const std::string &RECIPIENT_PUBKEY, const std::string &THE_MESSAGE) const
Definition: OTMeCpp.cpp:320
static EXPORT std::string Instrmnt_GetRecipientAcctID(const std::string &THE_INSTRUMENT)
Definition: OTAPI.cpp:863
EXPORT 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) const
Definition: OT_ME.cpp:786
static EXPORT std::string GetServer_Contract(const std::string &SERVER_ID)
Definition: OTAPI.cpp:479
static EXPORT std::string Message_GetNewAcctID(const std::string &THE_MESSAGE)
Definition: OTAPI.cpp:2413
static EXPORT bool Wallet_RemoveAssetType(const std::string &ASSET_ID)
Definition: OTAPI.cpp:546
static EXPORT std::string GetNym_ActiveCronItemIDs(const std::string &NYM_ID, const std::string &SERVER_ID)
Definition: OTAPI.cpp:365
static EXPORT int32_t getMint(const std::string &SERVER_ID, const std::string &USER_ID, const std::string &ASSET_ID)
Definition: OTAPI.cpp:2089
static EXPORT std::string LoadServerContract(const std::string &SERVER_ID)
Definition: OTAPI.cpp:1487
static EXPORT std::string Variable_GetType(const std::string &THE_CONTRACT, const std::string &BYLAW_NAME, const std::string &VARIABLE_NAME)
Definition: OTAPI.cpp:1297
static EXPORT std::string GetNym_SubCredentialID(const std::string &NYM_ID, const std::string &MASTER_CRED_ID, const int32_t &nIndex)
Definition: OTAPI.cpp:426
static EXPORT bool SetServer_Name(const std::string &SERVER_ID, const std::string &STR_NEW_NAME)
Definition: OTAPI.cpp:876
static EXPORT std::string Instrmnt_GetType(const std::string &THE_INSTRUMENT)
Definition: OTAPI.cpp:813
static EXPORT std::string Instrmnt_GetMemo(const std::string &THE_INSTRUMENT)
Definition: OTAPI.cpp:818
std::string load_or_retrieve_encrypt_key(const std::string &SERVER_ID, const std::string &NYM_ID, const std::string &TARGET_NYM_ID) const
Definition: OTMeCpp.cpp:304
static EXPORT time64_t GetTime()
Definition: OTAPI.cpp:941
static EXPORT bool Wallet_RemoveServer(const std::string &SERVER_ID)
Definition: OTAPI.cpp:536
static EXPORT int32_t getContract(const std::string &SERVER_ID, const std::string &USER_ID, const std::string &ASSET_ID)
Definition: OTAPI.cpp:2082
static EXPORT std::string Callback_GetNameByIndex(const std::string &THE_CONTRACT, const std::string &BYLAW_NAME, const int32_t &nIndex)
Definition: OTAPI.cpp:1342
static EXPORT std::string GetNym_Stats(const std::string &NYM_ID)
Definition: OTAPI.cpp:659
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)
Definition: OTAPI.cpp:1591
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 &quot;account ID&quot; field,.
Definition: OTAPI.cpp:1565
static EXPORT std::string CreateAssetContract(const std::string &NYM_ID, const std::string &strXMLcontents)
Definition: OTAPI.cpp:473
bool make_sure_enough_trans_nums(int32_t nNumberNeeded, const std::string &SERVER_ID, const std::string &NYM_ID) const
Definition: OTMeCpp.cpp:151
static EXPORT int32_t Bylaw_GetClauseCount(const std::string &THE_CONTRACT, const std::string &BYLAW_NAME)
Definition: OTAPI.cpp:1252
static EXPORT std::string GetNym_SubCredentialContents(const std::string &NYM_ID, const std::string &MASTER_CRED_ID, const std::string &SUB_CRED_ID)
Definition: OTAPI.cpp:433
EXPORT int32_t VerifyMsgTrnxSuccess(const std::string &SERVER_ID, const std::string &USER_ID, const std::string &ACCOUNT_ID, const std::string &str_Message) const
Definition: OT_ME.cpp:1007
static EXPORT std::string Party_GetAcctNameByIndex(const std::string &THE_CONTRACT, const std::string &PARTY_NAME, const int32_t &nIndex)
Definition: OTAPI.cpp:1374
static EXPORT int32_t Message_GetDepth(const std::string &THE_MESSAGE)
Definition: OTAPI.cpp:2428
static EXPORT bool Smart_IsPartyConfirmed(const std::string &THE_CONTRACT, const std::string &PARTY_NAME)
Definition: OTAPI.cpp:1218
static EXPORT time64_t Instrmnt_GetValidFrom(const std::string &THE_INSTRUMENT)
Definition: OTAPI.cpp:803
static EXPORT bool RevokeSubcredential(const std::string &NYM_ID, const std::string &MASTER_CRED_ID, const std::string &SUB_CRED_ID)
Definition: OTAPI.cpp:448
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)
Definition: OTAPI.cpp:1599
static EXPORT int32_t Transaction_GetSuccess(const std::string &SERVER_ID, const std::string &USER_ID, const std::string &ACCOUNT_ID, const std::string &THE_TRANSACTION)
Definition: OTAPI.cpp:1787
std::string load_or_retrieve_contract(const std::string &SERVER_ID, const std::string &NYM_ID, const std::string &CONTRACT_ID) const
Definition: OTMeCpp.cpp:210
static EXPORT std::string LoadExpiredBoxNoVerify(const std::string &SERVER_ID, const std::string &USER_ID)
Definition: OTAPI.cpp:1585
EXPORT std::string export_cash(const std::string &SERVER_ID, const std::string &FROM_NYM_ID, const std::string &ASSET_TYPE_ID, const std::string &TO_NYM_ID, const std::string &STR_INDICES, bool bPasswordProtected, std::string &STR_RETAINED_COPY) const
Definition: OT_ME.cpp:827
bool CopyValueBool() const
Definition: OTVariable.hpp:250
static EXPORT bool SetAccountWallet_Name(const std::string &ACCT_ID, const std::string &SIGNER_NYM_ID, const std::string &ACCT_NEW_NAME)
Definition: OTAPI.cpp:1025
std::string get_box_receipt(const std::string &SERVER_ID, const std::string &NYM_ID, const std::string &ACCT_ID, int32_t nBoxType, int64_t TRANS_NUM) const
Definition: OTMeCpp.cpp:397
EXPORT uint32_t GetLength() const
Definition: OTString.cpp:1040
EXPORT std::string send_user_cash_pubkey(const std::string &SERVER_ID, const std::string &NYM_ID, const std::string &RECIPIENT_NYM_ID, const std::string &RECIPIENT_PUBKEY, const std::string &THE_INSTRUMENT, const std::string &INSTRUMENT_FOR_SENDER) const
Definition: OT_ME.cpp:617
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) const
Definition: OTMeCpp.cpp:350
static EXPORT std::string Clause_GetNameByIndex(const std::string &THE_CONTRACT, const std::string &BYLAW_NAME, const int32_t &nIndex)
Definition: OTAPI.cpp:1276
static EXPORT bool SetAssetType_Name(const std::string &ASSET_ID, const std::string &STR_NEW_NAME)
Definition: OTAPI.cpp:882
static EXPORT std::string GetNym_MailContentsByIndex(const std::string &NYM_ID, const int32_t &nIndex)
Definition: OTAPI.cpp:693
static EXPORT std::string NumList_Remove(const std::string &strNumList, const std::string &strNumbers)
Definition: OTAPI.cpp:335
static EXPORT int32_t processInbox(const std::string &SERVER_ID, const std::string &USER_ID, const std::string &ACCT_ID, const std::string &ACCT_LEDGER)
Definition: OTAPI.cpp:2222
static EXPORT int32_t notarizeWithdrawal(const std::string &SERVER_ID, const std::string &USER_ID, const std::string &ACCT_ID, const int64_t &AMOUNT)
Definition: OTAPI.cpp:2175
static EXPORT std::string VerifyAndRetrieveXMLContents(const std::string &THE_CONTRACT, const std::string &SIGNER_ID)
Definition: OTAPI.cpp:1012
static EXPORT std::string Hook_GetNameByIndex(const std::string &THE_CONTRACT, const std::string &BYLAW_NAME, const int32_t &nIndex)
Definition: OTAPI.cpp:1319
static EXPORT std::string Basket_GetMemberType(const std::string &BASKET_ASSET_TYPE_ID, const int32_t &nIndex)
Definition: OTAPI.cpp:1990
static EXPORT std::string Instrmnt_GetSenderUserID(const std::string &THE_INSTRUMENT)
Definition: OTAPI.cpp:845
static EXPORT int32_t getAccountFiles(const std::string &SERVER_ID, const std::string &USER_ID, const std::string &ACCT_ID)
Definition: OTAPI.cpp:2110
EXPORT std::string register_nym(const std::string &SERVER_ID, const std::string &NYM_ID) const
Definition: OT_ME.cpp:392
EXPORT bool ExecuteScript_ReturnBool(const std::string &str_Code, std::string str_DisplayName="<BLANK>")
Definition: OT_ME.cpp:1168
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)
Definition: OTAPI.cpp:2149
static EXPORT int32_t GetNym_RevokedCredCount(const std::string &NYM_ID)
Definition: OTAPI.cpp:403
bool accept_inbox_items(const std::string &ACCOUNT_ID, int32_t nItemType, const std::string &INDICES) const
Definition: OTMeCpp.cpp:263
EXPORT 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) const
Definition: OT_ME.cpp:502
std::string create_asset_acct(const std::string &SERVER_ID, const std::string &NYM_ID, const std::string &ASSET_TYPE_ID) const
Definition: OTMeCpp.cpp:217
static EXPORT int32_t Hook_GetClauseCount(const std::string &THE_CONTRACT, const std::string &BYLAW_NAME, const std::string &HOOK_NAME)
Definition: OTAPI.cpp:1326
static EXPORT std::string Nymbox_GetReplyNotice(const std::string &SERVER_ID, const std::string &USER_ID, const int64_t &REQUEST_NUMBER)
Definition: OTAPI.cpp:1499
static EXPORT int32_t notarizeDeposit(const std::string &SERVER_ID, const std::string &USER_ID, const std::string &ACCT_ID, const std::string &THE_PURSE)
Definition: OTAPI.cpp:2183
EXPORT int32_t InterpretTransactionMsgReply(const std::string &SERVER_ID, const std::string &USER_ID, const std::string &ACCOUNT_ID, const std::string &str_Attempt, const std::string &str_Response) const
Definition: OT_ME.cpp:1051
static EXPORT bool Wallet_CanRemoveNym(const std::string &NYM_ID)
Definition: OTAPI.cpp:551
static EXPORT bool Smart_AreAllPartiesConfirmed(const std::string &THE_CONTRACT)
Definition: OTAPI.cpp:1213
static EXPORT std::string GetNym_OutmailRecipientIDByIndex(const std::string &NYM_ID, const int32_t &nIndex)
Definition: OTAPI.cpp:734
EXPORT std::string create_asset_acct(const std::string &SERVER_ID, const std::string &NYM_ID, const std::string &ASSET_TYPE_ID) const
Definition: OT_ME.cpp:470
static EXPORT std::string LoadNymbox(const std::string &SERVER_ID, const std::string &USER_ID)
Definition: OTAPI.cpp:1513
static EXPORT int32_t depositPaymentPlan(const std::string &SERVER_ID, const std::string &USER_ID, const std::string &THE_PAYMENT_PLAN)
Definition: OTAPI.cpp:2267
EXPORT std::string load_or_retrieve_mint(const std::string &SERVER_ID, const std::string &NYM_ID, const std::string &ASSET_ID) const
Definition: OT_ME.cpp:720
static EXPORT bool Wallet_ChangePassphrase()
Definition: OTAPI.cpp:614
EXPORT Storable * QueryObject(StoredObjectType theObjectType, std::string strFolder, std::string oneStr="", std::string twoStr="", std::string threeStr="")
Definition: OTStorage.cpp:788
EXPORT bool retrieve_nym(const std::string &SERVER_ID, const std::string &NYM_ID, bool bForceDownload=true) const
Definition: OT_ME.cpp:494
static EXPORT bool RemoveSentMessage(const int64_t &REQUEST_NUMBER, const std::string &SERVER_ID, const std::string &USER_ID)
Definition: OTAPI.cpp:2351
std::string load_public_signing_key(const std::string &NYM_ID) const
Definition: OTMeCpp.cpp:299
static EXPORT int64_t GetAccountWallet_Balance(const std::string &ACCOUNT_ID)
Definition: OTAPI.cpp:1032
static EXPORT bool RelativeToCanonical(OTString &out_strCanonicalPath, const OTString &strBasePath, const OTString &strRelativePath)
Definition: OTPaths.cpp:1280
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.
Definition: OTAPI.cpp:1956
EXPORT bool Exists() const
Definition: OTString.cpp:1035
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)
Definition: OTAPI.cpp:2139
static EXPORT int32_t sendUserInstrument(const std::string &SERVER_ID, const std::string &USER_ID, const std::string &USER_ID_RECIPIENT, const std::string &RECIPIENT_PUBKEY, const std::string &THE_INSTRUMENT, const std::string &INSTRUMENT_FOR_SENDER)
Definition: OTAPI.cpp:2057
static EXPORT std::string FormatAmount(const std::string &ASSET_TYPE_ID, const int64_t &THE_AMOUNT)
Definition: OTAPI.cpp:490
EXPORT std::string EncodeObject(Storable &theContents)
Definition: OTStorage.cpp:818
EXPORT std::string retrieve_contract(const std::string &SERVER_ID, const std::string &NYM_ID, const std::string &CONTRACT_ID) const
Definition: OT_ME.cpp:451
static EXPORT bool Nym_VerifyOutpaymentsByIndex(const std::string &NYM_ID, const int32_t &nIndex)
Definition: OTAPI.cpp:787
EXPORT std::string query_asset_types(const std::string &SERVER_ID, const std::string &NYM_ID, const std::string &ENCODED_MAP) const
Definition: OT_ME.cpp:732
EXPORT std::string create_market_offer(const std::string &ASSET_ACCT_ID, const std::string &CURRENCY_ACCT_ID, int64_t scale, int64_t minIncrement, int64_t quantity, int64_t price, bool bSelling, int64_t lLifespanInSeconds, const std::string &STOP_SIGN, int64_t ACTIVATION_PRICE) const
Definition: OT_ME.cpp:741
static EXPORT int32_t GetNym_CredentialCount(const std::string &NYM_ID)
Definition: OTAPI.cpp:386
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)
Definition: OTAPI.cpp:1649
EXPORT std::string get_nym_market_offers(const std::string &SERVER_ID, const std::string &NYM_ID) const
Definition: OT_ME.cpp:909
static EXPORT bool VerifyUserPrivateKey(const std::string &USER_ID)
Definition: OTAPI.cpp:1465
static EXPORT std::string GetServer_ID(const int32_t &nIndex)
Definition: OTAPI.cpp:894
static EXPORT int32_t getBoxReceipt(const std::string &SERVER_ID, const std::string &USER_ID, const std::string &ACCOUNT_ID, const int32_t &nBoxType, const int64_t &TRANSACTION_NUMBER)
Definition: OTAPI.cpp:576
EXPORT std::string get_market_offers(const std::string &SERVER_ID, const std::string &NYM_ID, const std::string &MARKET_ID, int64_t MAX_DEPTH) const
Definition: OT_ME.cpp:900
static EXPORT std::string GetServer_Name(const std::string &SERVER_ID)
Definition: OTAPI.cpp:899
static EXPORT std::string SmartContract_AddVariable(const std::string &THE_CONTRACT, const std::string &SIGNER_NYM_ID, const std::string &BYLAW_NAME, const std::string &VAR_NAME, const std::string &VAR_ACCESS, const std::string &VAR_TYPE, const std::string &VAR_VALUE)
Definition: OTAPI.cpp:1142
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)
Definition: OTAPI.cpp:1745
static EXPORT std::string Purse_Push(const std::string &SERVER_ID, const std::string &ASSET_TYPE_ID, const std::string &SIGNER_ID, const std::string &OWNER_ID, const std::string &THE_PURSE, const std::string &THE_TOKEN)
Definition: OTAPI.cpp:1896
EXPORT std::string kill_payment_plan(const std::string &SERVER_ID, const std::string &NYM_ID, const std::string &ACCT_ID, int64_t TRANS_NUM) const
Definition: OT_ME.cpp:765
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)
Definition: OTAPI.cpp:2433
static EXPORT int32_t GetNym_OutpaymentsCount(const std::string &NYM_ID)
Definition: OTAPI.cpp:758
EXPORT 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) const
Definition: OT_ME.cpp:643
static EXPORT int32_t getMarketList(const std::string &SERVER_ID, const std::string &USER_ID)
Retrieves details for each market.
Definition: OTAPI.cpp:2305
static EXPORT std::string GetNym_RevokedCredContents(const std::string &NYM_ID, const std::string &CREDENTIAL_ID)
Definition: OTAPI.cpp:414
static EXPORT std::string LoadExpiredBox(const std::string &SERVER_ID, const std::string &USER_ID)
Definition: OTAPI.cpp:1579
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) const
Definition: OTMeCpp.cpp:587
static EXPORT int32_t deleteAssetAccount(const std::string &SERVER_ID, const std::string &USER_ID, const std::string &ACCOUNT_ID)
Definition: OTAPI.cpp:586
static EXPORT std::string LoadNymboxNoVerify(const std::string &SERVER_ID, const std::string &USER_ID)
Definition: OTAPI.cpp:1519
static EXPORT std::string CreateNym(const int32_t &nKeySize, const std::string &NYM_ID_SOURCE, const std::string &ALT_LOCATION)
Definition: OTAPI.cpp:358
static EXPORT std::string LoadPubkey_Signing(const std::string &USER_ID)
Definition: OTAPI.cpp:1450
bool accept_from_paymentbox(const std::string &ACCOUNT_ID, const std::string &INDICES, const std::string &PAYMENT_TYPE) const
Definition: OTMeCpp.cpp:286
static EXPORT std::string Create_SmartContract(const std::string &SIGNER_NYM_ID, const time64_t &VALID_FROM, const time64_t &VALID_TO)
Definition: OTAPI.cpp:1118
EXPORT int32_t VerifyMsgBalanceAgrmntSuccess(const std::string &SERVER_ID, const std::string &USER_ID, const std::string &ACCOUNT_ID, const std::string &str_Message) const
Definition: OT_ME.cpp:968
static EXPORT int32_t issueMarketOffer(const std::string &ASSET_ACCT_ID, const std::string &CURRENCY_ACCT_ID, const int64_t &MARKET_SCALE, const int64_t &MINIMUM_INCREMENT, const int64_t &TOTAL_ASSETS_ON_OFFER, const int64_t &PRICE_LIMIT, const bool &bBuyingOrSelling, const time64_t &LIFESPAN_IN_SECONDS, const std::string &STOP_SIGN, const int64_t &ACTIVATION_PRICE)
Definition: OTAPI.cpp:2292
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.
Definition: OTAPI.cpp:1615
static EXPORT int32_t queryAssetTypes(const std::string &SERVER_ID, const std::string &USER_ID, const std::string &ENCODED_MAP)
Definition: OTAPI.cpp:2379
static EXPORT void Output(const int32_t &nLogLevel, const std::string &strOutput)
Definition: OTAPI.cpp:274
static EXPORT std::string Party_GetID(const std::string &THE_CONTRACT, const std::string &PARTY_NAME)
Definition: OTAPI.cpp:1368
static EXPORT std::string GetNym_CredentialID(const std::string &NYM_ID, const int32_t &nIndex)
Definition: OTAPI.cpp:391
std::string cancel_payment_plan(const std::string &SERVER_ID, const std::string &NYM_ID, const std::string &THE_PAYMENT_PLAN) const
Definition: OTMeCpp.cpp:458
static EXPORT void Sleep(const int64_t &MILLISECONDS)
Definition: OTAPI.cpp:2367
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)
Definition: OTAPI.cpp:1631
EXPORT std::string issue_asset_type(const std::string &SERVER_ID, const std::string &NYM_ID, const std::string &THE_CONTRACT) const
Definition: OT_ME.cpp:419
EXPORT bool deposit_local_purse(const std::string &SERVER_ID, const std::string &NYM_ID, const std::string &ACCT_ID, const std::string &STR_INDICES) const
Definition: OT_ME.cpp:885
static EXPORT std::string GetNym_CredentialContents(const std::string &NYM_ID, const std::string &CREDENTIAL_ID)
Definition: OTAPI.cpp:397
bool retrieve_account(const std::string &SERVER_ID, const std::string &NYM_ID, const std::string &ACCOUNT_ID, bool bForceDownload) const
Definition: OTMeCpp.cpp:229
static EXPORT std::string Encrypt(const std::string &RECIPIENT_NYM_ID, const std::string &strPlaintext)
Definition: OTAPI.cpp:958
bool easy_withdraw_cash(const std::string &ACCT_ID, int64_t AMOUNT) const
Definition: OTMeCpp.cpp:492
static EXPORT int32_t Message_GetTransactionSuccess(const std::string &SERVER_ID, const std::string &USER_ID, const std::string &ACCOUNT_ID, const std::string &THE_MESSAGE)
Definition: OTAPI.cpp:2441
std::map< std::string, std::string > mapOfArguments
Definition: OT_ME.cpp:171
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.
Definition: OTAPI.cpp:1843
static EXPORT std::string Message_GetPayload(const std::string &THE_MESSAGE)
Definition: OTAPI.cpp:2386
static EXPORT int32_t usageCredits(const std::string &SERVER_ID, const std::string &USER_ID, const std::string &USER_ID_CHECK, const int64_t &ADJUSTMENT)
Definition: OTAPI.cpp:2032
EXPORT int32_t OT_CLI_GetArgsCount(const std::string &str_Args)
Definition: OT_ME.cpp:187
static EXPORT int32_t notarizeTransfer(const std::string &SERVER_ID, const std::string &USER_ID, const std::string &ACCT_FROM, const std::string &ACCT_TO, const int64_t &AMOUNT, const std::string &NOTE)
Definition: OTAPI.cpp:2191
static EXPORT int32_t GetNymCount()
Definition: OTAPI.cpp:511
static EXPORT int32_t SmartContract_CountNumsNeeded(const std::string &THE_CONTRACT, const std::string &AGENT_NAME)
Definition: OTAPI.cpp:1190
bool withdraw_and_send_cash(const std::string &ACCT_ID, const std::string &RECIPIENT_NYM_ID, const std::string &MEMO, int64_t AMOUNT) const
Definition: OTMeCpp.cpp:378
static EXPORT bool VerifySignature(const std::string &SIGNER_NYM_ID, const std::string &THE_CONTRACT)
Definition: OTAPI.cpp:1006
EXPORT std::string load_or_retrieve_signing_key(const std::string &SERVER_ID, const std::string &NYM_ID, const std::string &TARGET_NYM_ID) const
Definition: OT_ME.cpp:584
static EXPORT std::string LoadRecordBoxNoVerify(const std::string &SERVER_ID, const std::string &USER_ID, const std::string &ACCOUNT_ID)
Definition: OTAPI.cpp:1572
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().)
Definition: OTAPI.cpp:1836
static EXPORT std::string Smart_GetBylawByIndex(const std::string &THE_CONTRACT, const int32_t &nIndex)
Definition: OTAPI.cpp:1240
static EXPORT std::string Variable_GetAccess(const std::string &THE_CONTRACT, const std::string &BYLAW_NAME, const std::string &VARIABLE_NAME)
Definition: OTAPI.cpp:1304
std::string retrieve_mint(const std::string &SERVER_ID, const std::string &NYM_ID, const std::string &ASSET_ID) const
Definition: OTMeCpp.cpp:406
static EXPORT int32_t AddAssetContract(const std::string &strContract)
Definition: OTAPI.cpp:506
std::string load_or_retrieve_signing_key(const std::string &SERVER_ID, const std::string &NYM_ID, const std::string &TARGET_NYM_ID) const
Definition: OTMeCpp.cpp:312
static EXPORT time64_t Token_GetValidTo(const std::string &SERVER_ID, const std::string &ASSET_TYPE_ID, const std::string &THE_TOKEN)
Definition: OTAPI.cpp:1963
EXPORT std::string issue_basket_currency(const std::string &SERVER_ID, const std::string &NYM_ID, const std::string &THE_BASKET) const
Definition: OT_ME.cpp:428
std::string register_nym(const std::string &SERVER_ID, const std::string &NYM_ID) const
Definition: OTMeCpp.cpp:158
static EXPORT std::string Wallet_ExportCert(const std::string &NYM_ID)
Returns the exported cert, if successful. Else nullptr.
Definition: OTAPI.cpp:598
static EXPORT std::string Variable_GetNameByIndex(const std::string &THE_CONTRACT, const std::string &BYLAW_NAME, const int32_t &nIndex)
Definition: OTAPI.cpp:1290
static EXPORT std::string SymmetricDecrypt(const std::string &SYMMETRIC_KEY, const std::string &CIPHERTEXT_ENVELOPE)
Definition: OTAPI.cpp:981
EXPORT std::string get_payment_instrument(const std::string &SERVER_ID, const std::string &NYM_ID, int32_t nIndex, const std::string &PRELOADED_INBOX="") const
Definition: OT_ME.cpp:676
static EXPORT std::string GetNym_MailServerIDByIndex(const std::string &NYM_ID, const int32_t &nIndex)
Definition: OTAPI.cpp:705
static EXPORT OTVariable * FindVariable2(const std::string &str_var_name)
Definition: OT_ME.cpp:1146
EXPORT std::string QueryPlainString(std::string strFolder, std::string oneStr="", std::string twoStr="", std::string threeStr="")
Definition: OTStorage.cpp:728
static EXPORT int32_t Bylaw_GetVariableCount(const std::string &THE_CONTRACT, const std::string &BYLAW_NAME)
Definition: OTAPI.cpp:1258
static EXPORT bool ResyncNymWithServer(const std::string &SERVER_ID, const std::string &USER_ID, const std::string &THE_MESSAGE)
Definition: OTAPI.cpp:2372
static EXPORT std::string SignContract(const std::string &SIGNER_NYM_ID, const std::string &THE_CONTRACT)
Definition: OTAPI.cpp:987
static EXPORT std::string GetNym_Name(const std::string &NYM_ID)
Definition: OTAPI.cpp:648
EXPORT std::string OT_CLI_ReadLine()
Definition: Helpers.hpp:144
static EXPORT bool NumList_VerifyAll(const std::string &strNumList, const std::string &strNumbers)
Definition: OTAPI.cpp:347
EXPORT bool TokenizeIntoKeyValuePairs(Map &map) const
Definition: OTString.cpp:550
static EXPORT std::string Message_GetLedger(const std::string &THE_MESSAGE)
Definition: OTAPI.cpp:2396
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)
Definition: OTAPI.cpp:1728
static EXPORT std::string Instrmnt_GetRecipientUserID(const std::string &THE_INSTRUMENT)
Definition: OTAPI.cpp:857
static EXPORT bool SetNym_Name(const std::string &NYM_ID, const std::string &SIGNER_NYM_ID, const std::string &NYM_NEW_NAME)
Definition: OTAPI.cpp:869
static EXPORT int32_t withdrawVoucher(const std::string &SERVER_ID, const std::string &USER_ID, const std::string &ACCT_ID, const std::string &RECIPIENT_USER_ID, const std::string &CHEQUE_MEMO, const int64_t &AMOUNT)
Definition: OTAPI.cpp:2236
static EXPORT std::string Ledger_GetTransactionByID(const std::string &SERVER_ID, const std::string &USER_ID, const std::string &ACCOUNT_ID, const std::string &THE_LEDGER, const int64_t &TRANSACTION_NUMBER)
Definition: OTAPI.cpp:1640
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)
Definition: OTAPI.cpp:1659
static EXPORT int32_t issueBasket(const std::string &SERVER_ID, const std::string &USER_ID, const std::string &THE_BASKET)
Definition: OTAPI.cpp:2132
static EXPORT int32_t exchangeBasket(const std::string &SERVER_ID, const std::string &USER_ID, const std::string &BASKET_ASSET_ID, const std::string &THE_BASKET, const bool &BOOL_EXCHANGE_IN_OR_OUT)
Definition: OTAPI.cpp:2159
static EXPORT int32_t GetAssetTypeCount()
Definition: OTAPI.cpp:521
static EXPORT std::string GetAccountWallet_ID(const int32_t &nIndex)
Definition: OTAPI.cpp:919
EXPORT bool make_sure_enough_trans_nums(int32_t nNumberNeeded, const std::string &SERVER_ID, const std::string &NYM_ID) const
Definition: OT_ME.cpp:382
static EXPORT int32_t exchangePurse(const std::string &SERVER_ID, const std::string &ASSET_TYPE_ID, const std::string &USER_ID, const std::string &THE_PURSE)
Definition: OTAPI.cpp:1916
static EXPORT std::string GetNym_NymboxHash(const std::string &SERVER_ID, const std::string &NYM_ID)
Definition: OTAPI.cpp:664
static EXPORT int32_t getNym_MarketOffers(const std::string &SERVER_ID, const std::string &USER_ID)
This &quot;Market Offer&quot; data is a lot more detailed than the.
Definition: OTAPI.cpp:2326
std::string GetValue(const std::string &strKey)
Definition: OTStorage.hpp:990
static EXPORT bool Nym_RemoveOutpaymentsByIndex(const std::string &NYM_ID, const int32_t &nIndex)
Definition: OTAPI.cpp:781
static EXPORT std::string Wallet_ImportCert(const std::string &DISPLAY_NAME, const std::string &FILE_CONTENTS)
Returns the imported cert&#39;s NymID, if successful. Else nullptr.
Definition: OTAPI.cpp:608
static EXPORT int32_t AddServerContract(const std::string &strContract)
Definition: OTAPI.cpp:501
static EXPORT std::string GetNym_OutpaymentsRecipientIDByIndex(const std::string &NYM_ID, const int32_t &nIndex)
Definition: OTAPI.cpp:769
EXPORT std::string load_public_signing_key(const std::string &NYM_ID) const
Definition: OT_ME.cpp:563
#define OT_ASSERT(x)
Definition: Assert.hpp:150
EXPORT 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) const
Definition: OT_ME.cpp:842
static EXPORT int64_t Basket_GetMinimumTransferAmount(const std::string &BASKET_ASSET_TYPE_ID)
Definition: OTAPI.cpp:1996
EXPORT bool withdraw_and_send_cash(const std::string &ACCT_ID, const std::string &RECIPIENT_NYM_ID, const std::string &MEMO, int64_t AMOUNT) const
Definition: OT_ME.cpp:665
EXPORT ~OT_ME()
Definition: OT_ME.cpp:166
static EXPORT bool Wallet_CanRemoveAccount(const std::string &ACCOUNT_ID)
Definition: OTAPI.cpp:561
static EXPORT std::string GenerateBasketCreation(const std::string &USER_ID, const int64_t &MINIMUM_TRANSFER)
Definition: OTAPI.cpp:2117
static EXPORT std::string Party_GetAcctID(const std::string &THE_CONTRACT, const std::string &PARTY_NAME, const std::string &ACCT_NAME)
Definition: OTAPI.cpp:1381
static EXPORT bool Wallet_CanRemoveAssetType(const std::string &ASSET_ID)
Definition: OTAPI.cpp:541
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.
Definition: OTAPI.cpp:1907
static EXPORT std::string GetNym_MailSenderIDByIndex(const std::string &NYM_ID, const int32_t &nIndex)
Definition: OTAPI.cpp:699
static EXPORT std::string Hook_GetClauseAtIndex(const std::string &THE_CONTRACT, const std::string &BYLAW_NAME, const std::string &HOOK_NAME, const int32_t &nIndex)
Definition: OTAPI.cpp:1333
#define OT_ASSERT_MSG(x, s)
Definition: Assert.hpp:155
std::string create_market_offer(const std::string &ASSET_ACCT_ID, const std::string &CURRENCY_ACCT_ID, int64_t scale, int64_t minIncrement, int64_t quantity, int64_t price, bool bSelling, int64_t lLifespanInSeconds, const std::string &STOP_SIGN, int64_t ACTIVATION_PRICE) const
Definition: OTMeCpp.cpp:427
static EXPORT std::string LoadInbox(const std::string &SERVER_ID, const std::string &USER_ID, const std::string &ACCOUNT_ID)
Definition: OTAPI.cpp:1525
std::string load_public_encryption_key(const std::string &NYM_ID) const
Definition: OTMeCpp.cpp:294
static EXPORT std::string Variable_GetContents(const std::string &THE_CONTRACT, const std::string &BYLAW_NAME, const std::string &VARIABLE_NAME)
Definition: OTAPI.cpp:1311
static EXPORT int32_t getAccount(const std::string &SERVER_ID, const std::string &USER_ID, const std::string &ACCT_ID)
Definition: OTAPI.cpp:2103
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)
Definition: OTAPI.cpp:1704
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)
Definition: OTAPI.cpp:1696
static EXPORT std::string Decode(const std::string &strEncoded, const bool &bLineBreaks)
Definition: OTAPI.cpp:952
EXPORT std::string OT_CLI_GetKeyByIndex(const std::string &str_Args, int32_t nIndex)
Definition: OT_ME.cpp:253
EXPORT bool StoreString(std::string strContents, std::string strFolder, std::string oneStr="", std::string twoStr="", std::string threeStr="")
Definition: OTStorage.cpp:644
static EXPORT bool ClearExpired(const std::string &SERVER_ID, const std::string &USER_ID, const int32_t &nIndex, const bool &bClearAll)
Definition: OTAPI.cpp:1608
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)
Definition: OTAPI.cpp:1095
static EXPORT bool Nym_RemoveOutmailByIndex(const std::string &NYM_ID, const int32_t &nIndex)
Definition: OTAPI.cpp:746
EXPORT std::string retrieve_mint(const std::string &SERVER_ID, const std::string &NYM_ID, const std::string &ASSET_ID) const
Definition: OT_ME.cpp:702
EXPORT std::string get_box_receipt(const std::string &SERVER_ID, const std::string &NYM_ID, const std::string &ACCT_ID, int32_t nBoxType, int64_t TRANS_NUM) const
Definition: OT_ME.cpp:691
#define OT_FAIL
Definition: Assert.hpp:139
static EXPORT std::string CreateServerContract(const std::string &NYM_ID, const std::string &strXMLcontents)
Definition: OTAPI.cpp:467
static EXPORT std::string GetAccountWallet_OutboxHash(const std::string &ACCOUNT_ID)
Definition: OTAPI.cpp:935
static EXPORT std::string Message_GetCommand(const std::string &THE_MESSAGE)
Definition: OTAPI.cpp:2391
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)
Definition: OTAPI.cpp:1879
static EXPORT int32_t getNymbox(const std::string &SERVER_ID, const std::string &USER_ID)
Definition: OTAPI.cpp:2209
static EXPORT std::string FlatSign(const std::string &SIGNER_NYM_ID, const std::string &THE_INPUT, const std::string &CONTRACT_TYPE)
Definition: OTAPI.cpp:993
static EXPORT int32_t getTransactionNumber(const std::string &SERVER_ID, const std::string &USER_ID)
Definition: OTAPI.cpp:2169
static EXPORT std::string GetAssetType_Contract(const std::string &ASSET_TYPE_ID)
Definition: OTAPI.cpp:496
static EXPORT std::string Clause_GetContents(const std::string &THE_CONTRACT, const std::string &BYLAW_NAME, const std::string &CLAUSE_NAME)
Definition: OTAPI.cpp:1283
static EXPORT bool Mint_IsStillGood(const std::string &SERVER_ID, const std::string &ASSET_TYPE_ID)
Definition: OTAPI.cpp:1470
bool cancel_outgoing_payments(const std::string &NYM_ID, const std::string &ACCOUNT_ID, const std::string &INDICES) const
Definition: OTMeCpp.cpp:278
static EXPORT int32_t getRequest(const std::string &SERVER_ID, const std::string &USER_ID)
Definition: OTAPI.cpp:2069
static EXPORT int32_t issueAssetType(const std::string &SERVER_ID, const std::string &USER_ID, const std::string &THE_CONTRACT)
Definition: OTAPI.cpp:2075
static EXPORT int32_t GetNym_OutmailCount(const std::string &NYM_ID)
Definition: OTAPI.cpp:723
static EXPORT std::string GetNym_OutpaymentsServerIDByIndex(const std::string &NYM_ID, const int32_t &nIndex)
Definition: OTAPI.cpp:775
std::string withdraw_cash(const std::string &SERVER_ID, const std::string &NYM_ID, const std::string &ACCT_ID, int64_t AMOUNT) const
Definition: OTMeCpp.cpp:484
static EXPORT std::string SmartContract_AddBylaw(const std::string &THE_CONTRACT, const std::string &SIGNER_NYM_ID, const std::string &BYLAW_NAME)
Definition: OTAPI.cpp:1125
OTLOG_IMPORT OTLogStream otWarn
static EXPORT std::string CreateSymmetricKey()
Definition: OTAPI.cpp:970
static EXPORT std::string AddSignature(const std::string &SIGNER_NYM_ID, const std::string &THE_CONTRACT)
Definition: OTAPI.cpp:1000
EXPORT std::string check_user(const std::string &SERVER_ID, const std::string &NYM_ID, const std::string &TARGET_NYM_ID) const
Definition: OT_ME.cpp:400
static EXPORT std::string LoadUserPubkey_Encryption(const std::string &USER_ID)
Definition: OTAPI.cpp:1455
static EXPORT void FlushSentMessages(const bool &bHarvestingForRetry, const std::string &SERVER_ID, const std::string &USER_ID, const std::string &THE_NYMBOX)
Definition: OTAPI.cpp:2358
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) const
Definition: OTMeCpp.cpp:465
static EXPORT std::string Callback_GetClause(const std::string &THE_CONTRACT, const std::string &BYLAW_NAME, const std::string &CALLBACK_NAME)
Definition: OTAPI.cpp:1349
static EXPORT std::string Message_GetNewIssuerAcctID(const std::string &THE_MESSAGE)
Definition: OTAPI.cpp:2407
static EXPORT std::string Party_GetAcctAgentName(const std::string &THE_CONTRACT, const std::string &PARTY_NAME, const std::string &ACCT_NAME)
Definition: OTAPI.cpp:1395
static EXPORT std::string SmartContract_ConfirmParty(const std::string &THE_CONTRACT, const std::string &PARTY_NAME, const std::string &NYM_ID)
Definition: OTAPI.cpp:1206
OTLOG_IMPORT OTLogStream otErr
EXPORT int32_t ExecuteScript_ReturnInt(const std::string &str_Code, std::string str_DisplayName="<BLANK>")
Definition: OT_ME.cpp:1185
static EXPORT std::string LoadOutbox(const std::string &SERVER_ID, const std::string &USER_ID, const std::string &ACCOUNT_ID)
Definition: OTAPI.cpp:1539
static EXPORT std::string NumList_Add(const std::string &strNumList, const std::string &strNumbers)
Definition: OTAPI.cpp:329
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)
Definition: OTAPI.cpp:1712
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 &#39;response&#39; ledger, set up with the right Server ID, etc,.
Definition: OTAPI.cpp:1623
bool discard_incoming_payments(const std::string &SERVER_ID, const std::string &NYM_ID, const std::string &INDICES) const
Definition: OTMeCpp.cpp:270
std::map< std::string, std::string > the_map
Definition: OTStorage.hpp:981
EXPORT std::string create_nym(int32_t nKeybits, const std::string &NYM_ID_SOURCE, const std::string &ALT_LOCATION) const
Definition: OT_ME.cpp:410
static EXPORT std::string SmartContract_AddClause(const std::string &THE_CONTRACT, const std::string &SIGNER_NYM_ID, const std::string &BYLAW_NAME, const std::string &CLAUSE_NAME, const std::string &SOURCE_CODE)
Definition: OTAPI.cpp:1133
static EXPORT int32_t deleteUserAccount(const std::string &SERVER_ID, const std::string &USER_ID)
Definition: OTAPI.cpp:2021
static EXPORT int64_t Message_GetUsageCredits(const std::string &THE_MESSAGE)
Definition: OTAPI.cpp:2027
bool deposit_local_purse(const std::string &SERVER_ID, const std::string &NYM_ID, const std::string &ACCT_ID, const std::string &STR_INDICES) const
Definition: OTMeCpp.cpp:551
static EXPORT bool VerifyAccountReceipt(const std::string &SERVER_ID, const std::string &NYM_ID, const std::string &ACCT_ID)
Definition: OTAPI.cpp:1018
static EXPORT const OTString & ScriptsFolder()
Definition: OTPaths.cpp:315
static EXPORT std::string LoadPaymentInboxNoVerify(const std::string &SERVER_ID, const std::string &USER_ID)
Definition: OTAPI.cpp:1559
std::string deposit_cheque(const std::string &SERVER_ID, const std::string &NYM_ID, const std::string &ACCT_ID, const std::string &STR_CHEQUE) const
Definition: OTMeCpp.cpp:534
EXPORT 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) const
Definition: OT_ME.cpp:923
static EXPORT std::string GetAssetType_ID(const int32_t &nIndex)
Definition: OTAPI.cpp:904
static EXPORT bool Nym_VerifyOutmailByIndex(const std::string &NYM_ID, const int32_t &nIndex)
Definition: OTAPI.cpp:752
static EXPORT int32_t createAssetAccount(const std::string &SERVER_ID, const std::string &USER_ID, const std::string &ASSET_ID)
Definition: OTAPI.cpp:2096
std::string kill_payment_plan(const std::string &SERVER_ID, const std::string &NYM_ID, const std::string &ACCT_ID, int64_t TRANS_NUM) const
Definition: OTMeCpp.cpp:449
EXPORT void AddVariable(const std::string &str_var_name, OTVariable &theVar)
Definition: OT_ME.cpp:1131
static EXPORT std::string Smart_GetPartyByIndex(const std::string &THE_CONTRACT, const int32_t &nIndex)
Definition: OTAPI.cpp:1234
static EXPORT std::string LoadMint(const std::string &SERVER_ID, const std::string &ASSET_TYPE_ID)
Definition: OTAPI.cpp:1476
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)
Definition: OTAPI.cpp:1754
EXPORT bool deposit_cash(const std::string &SERVER_ID, const std::string &NYM_ID, const std::string &ACCT_ID, const std::string &STR_PURSE) const
Definition: OT_ME.cpp:877
static EXPORT std::string GetNym_AltSourceLocation(const std::string &NYM_ID)
Definition: OTAPI.cpp:381
std::string process_inbox(const std::string &SERVER_ID, const std::string &NYM_ID, const std::string &ACCOUNT_ID, const std::string &RESPONSE_LEDGER) const
Definition: OTMeCpp.cpp:254
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)
Definition: OTAPI.cpp:1196
EXPORT std::string load_or_retrieve_contract(const std::string &SERVER_ID, const std::string &NYM_ID, const std::string &CONTRACT_ID) const
Definition: OT_ME.cpp:460
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.
Definition: OTAPI.cpp:1942
EXPORT bool retrieve_account(const std::string &SERVER_ID, const std::string &NYM_ID, const std::string &ACCOUNT_ID, bool bForceDownload=false) const
Definition: OT_ME.cpp:485
EXPORT std::string send_user_msg_pubkey(const std::string &SERVER_ID, const std::string &NYM_ID, const std::string &RECIPIENT_NYM_ID, const std::string &RECIPIENT_PUBKEY, const std::string &THE_MESSAGE) const
Definition: OT_ME.cpp:594
static EXPORT std::string GetNym_OutmailServerIDByIndex(const std::string &NYM_ID, const int32_t &nIndex)
Definition: OTAPI.cpp:740
std::string retrieve_contract(const std::string &SERVER_ID, const std::string &NYM_ID, const std::string &CONTRACT_ID) const
Definition: OTMeCpp.cpp:203
static EXPORT std::string Message_GetNymboxHash(const std::string &THE_MESSAGE)
Definition: OTAPI.cpp:2418
static EXPORT int32_t GetNym_TransactionNumCount(const std::string &SERVER_ID, const std::string &NYM_ID)
Definition: OTAPI.cpp:888
static EXPORT int64_t Basket_GetMemberMinimumTransferAmount(const std::string &BASKET_ASSET_TYPE_ID, const int32_t &nIndex)
Definition: OTAPI.cpp:2002
static EXPORT std::string Token_GetID(const std::string &SERVER_ID, const std::string &ASSET_TYPE_ID, const std::string &THE_TOKEN)
Definition: OTAPI.cpp:1935
EXPORT bool Exists(std::string strFolder, std::string oneStr="", std::string twoStr="", std::string threeStr="")
Definition: OTStorage.cpp:584
static EXPORT std::string Pending_GetNote(const std::string &SERVER_ID, const std::string &USER_ID, const std::string &ACCOUNT_ID, const std::string &THE_TRANSACTION)
Definition: OTAPI.cpp:1736
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) const
Definition: OTMeCpp.cpp:523
static EXPORT int64_t StringToAmount(const std::string &ASSET_TYPE_ID, const std::string &str_input)
Definition: OTAPI.cpp:484
static EXPORT std::string GetActiveCronItem(const std::string &SERVER_ID, int64_t lTransNum)
Definition: OTAPI.cpp:370
static EXPORT int32_t getOutbox(const std::string &SERVER_ID, const std::string &USER_ID, const std::string &ACCT_ID)
Definition: OTAPI.cpp:2215
std::string query_asset_types(const std::string &SERVER_ID, const std::string &NYM_ID, const std::string &ENCODED_MAP) const
Definition: OTMeCpp.cpp:420
static EXPORT std::string Token_GetServerID(const std::string &THE_TOKEN)
Definition: OTAPI.cpp:1975
EXPORT Storable * DecodeObject(StoredObjectType theObjectType, std::string strInput)
Definition: OTStorage.cpp:830
static EXPORT std::string Wallet_ImportNym(const std::string &FILE_CONTENTS)
returns NymID if success, else nullptr.
Definition: OTAPI.cpp:603
static EXPORT std::string PopMessageBuffer(const int64_t &REQUEST_NUMBER, const std::string &SERVER_ID, const std::string &USER_ID)
Definition: OTAPI.cpp:2332
EXPORT 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) const
Definition: OT_ME.cpp:855
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)
Definition: OTAPI.cpp:1871
static EXPORT std::string LoadUserPubkey_Signing(const std::string &USER_ID)
Definition: OTAPI.cpp:1460
static EXPORT int32_t killMarketOffer(const std::string &SERVER_ID, const std::string &USER_ID, const std::string &ASSET_ACCT_ID, const int64_t &TRANSACTION_NUMBER)
Definition: OTAPI.cpp:2274
std::string check_user(const std::string &SERVER_ID, const std::string &NYM_ID, const std::string &TARGET_NYM_ID) const
Definition: OTMeCpp.cpp:164
static EXPORT time64_t Transaction_GetDateSigned(const std::string &SERVER_ID, const std::string &USER_ID, const std::string &ACCOUNT_ID, const std::string &THE_TRANSACTION)
Definition: OTAPI.cpp:1779
static EXPORT int32_t Bylaw_GetHookCount(const std::string &THE_CONTRACT, const std::string &BYLAW_NAME)
Definition: OTAPI.cpp:1264
std::string exchange_basket_currency(const std::string &SERVER_ID, const std::string &NYM_ID, const std::string &ASSET_TYPE_ID, const std::string &THE_BASKET, const std::string &ACCOUNT_ID, bool IN_OR_OUT) const
Definition: OTMeCpp.cpp:192
bool retrieve_nym(const std::string &SERVER_ID, const std::string &NYM_ID, bool bForceDownload) const
Definition: OTMeCpp.cpp:238
static EXPORT int32_t Party_GetAcctCount(const std::string &THE_CONTRACT, const std::string &PARTY_NAME)
Definition: OTAPI.cpp:1356
static EXPORT int32_t GetNym_SubcredentialCount(const std::string &NYM_ID, const std::string &MASTER_CRED_ID)
Definition: OTAPI.cpp:420
static EXPORT std::string Encode(const std::string &strPlaintext, const bool &bLineBreaks)
Definition: OTAPI.cpp:946
static EXPORT std::string GetNym_OutpaymentsContentsByIndex(const std::string &NYM_ID, const int32_t &nIndex)
Definition: OTAPI.cpp:763
EXPORT std::string deposit_cheque(const std::string &SERVER_ID, const std::string &NYM_ID, const std::string &ACCT_ID, const std::string &STR_CHEQUE) const
Definition: OT_ME.cpp:867
std::string send_user_cash_pubkey(const std::string &SERVER_ID, const std::string &NYM_ID, const std::string &RECIPIENT_NYM_ID, const std::string &RECIPIENT_PUBKEY, const std::string &THE_INSTRUMENT, const std::string &INSTRUMENT_FOR_SENDER) const
Definition: OTMeCpp.cpp:339
EXPORT bool StoreObject(Storable &theContents, std::string strFolder, std::string oneStr="", std::string twoStr="", std::string threeStr="")
Definition: OTStorage.cpp:759
static EXPORT std::string SmartContract_AddCallback(const std::string &THE_CONTRACT, const std::string &SIGNER_NYM_ID, const std::string &BYLAW_NAME, const std::string &CALLBACK_NAME, const std::string &CLAUSE_NAME)
Definition: OTAPI.cpp:1153
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) const
Definition: OTMeCpp.cpp:244
static EXPORT std::string GetAccountWallet_InboxHash(const std::string &ACCOUNT_ID)
Definition: OTAPI.cpp:929
static EXPORT int32_t NumList_Count(const std::string &strNumList)
Definition: OTAPI.cpp:353
static EXPORT time64_t Instrmnt_GetValidTo(const std::string &THE_INSTRUMENT)
Definition: OTAPI.cpp:808
static EXPORT std::string GetAccountWallet_Type(const std::string &ACCOUNT_ID)
Definition: OTAPI.cpp:1037
static EXPORT std::string Decrypt(const std::string &RECIPIENT_NYM_ID, const std::string &strCiphertext)
Definition: OTAPI.cpp:964
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) const
Definition: OTMeCpp.cpp:359
static EXPORT bool IsNym_RegisteredAtServer(const std::string &NYM_ID, const std::string &SERVER_ID)
Definition: OTAPI.cpp:653
static EXPORT bool AppendFile(OTString &out_strPath, const OTString &strBasePath, const OTString &strFileName)
Definition: OTPaths.cpp:1245
EXPORT int32_t VerifyMessageSuccess(const std::string &str_Message) const
Definition: OT_ME.cpp:932
EXPORT std::string OT_CLI_ReadUntilEOF()
Definition: Helpers.hpp:156
static EXPORT int32_t depositCheque(const std::string &SERVER_ID, const std::string &USER_ID, const std::string &ACCT_ID, const std::string &THE_CHEQUE)
Definition: OTAPI.cpp:2259
static EXPORT int32_t Transaction_GetBalanceAgreementSuccess(const std::string &SERVER_ID, const std::string &USER_ID, const std::string &ACCOUNT_ID, const std::string &THE_TRANSACTION)
Definition: OTAPI.cpp:1805
static EXPORT bool DiscardCheque(const std::string &SERVER_ID, const std::string &USER_ID, const std::string &ACCT_ID, const std::string &THE_CHEQUE)
Definition: OTAPI.cpp:1068
static EXPORT int32_t GetNym_MailCount(const std::string &NYM_ID)
Definition: OTAPI.cpp:688
static EXPORT std::string Message_GetNewAssetTypeID(const std::string &THE_MESSAGE)
Definition: OTAPI.cpp:2401
static EXPORT int32_t triggerClause(const std::string &SERVER_ID, const std::string &USER_ID, const int64_t &TRANSACTION_NUMBER, const std::string &CLAUSE_NAME, const std::string &STR_PARAM)
Definition: OTAPI.cpp:1424
static EXPORT int32_t Bylaw_GetCallbackCount(const std::string &THE_CONTRACT, const std::string &BYLAW_NAME)
Definition: OTAPI.cpp:1270
static EXPORT std::string SmartContract_AddAccount(const std::string &THE_CONTRACT, const std::string &SIGNER_NYM_ID, const std::string &PARTY_NAME, const std::string &ACCT_NAME, const std::string &ASSET_TYPE_ID)
Definition: OTAPI.cpp:1181
std::string send_user_pmnt_pubkey(const std::string &SERVER_ID, const std::string &NYM_ID, const std::string &RECIPIENT_NYM_ID, const std::string &RECIPIENT_PUBKEY, const std::string &THE_INSTRUMENT) const
Definition: OTMeCpp.cpp:330
static EXPORT int32_t getInbox(const std::string &SERVER_ID, const std::string &USER_ID, const std::string &ACCT_ID)
Definition: OTAPI.cpp:2202
static EXPORT std::string GetNym_SourceForID(const std::string &NYM_ID)
Definition: OTAPI.cpp:376
void SetValue(const std::string &strKey, const std::string &strValue)
Definition: OTStorage.hpp:983
static EXPORT int32_t Party_GetAgentCount(const std::string &THE_CONTRACT, const std::string &PARTY_NAME)
Definition: OTAPI.cpp:1362
EXPORT bool accept_inbox_items(const std::string &ACCOUNT_ID, int32_t nItemType, const std::string &INDICES) const
Definition: OT_ME.cpp:523
EXPORT std::string kill_market_offer(const std::string &SERVER_ID, const std::string &NYM_ID, const std::string &ASSET_ACCT_ID, int64_t TRANS_NUM) const
Definition: OT_ME.cpp:754
static EXPORT std::string LoadInboxNoVerify(const std::string &SERVER_ID, const std::string &USER_ID, const std::string &ACCOUNT_ID)
These versions don&#39;t verify the ledger, they just load it up.
Definition: OTAPI.cpp:1532
static EXPORT OTString Get()
static EXPORT int32_t killPaymentPlan(const std::string &SERVER_ID, const std::string &USER_ID, const std::string &FROM_ACCT_ID, const int64_t &TRANSACTION_NUMBER)
Definition: OTAPI.cpp:2283
static EXPORT bool Nym_RemoveMailByIndex(const std::string &NYM_ID, const int32_t &nIndex)
Definition: OTAPI.cpp:711
EXPORT bool cancel_outgoing_payments(const std::string &NYM_ID, const std::string &ACCOUNT_ID, const std::string &INDICES) const
Definition: OT_ME.cpp:538
EXPORT bool accept_from_paymentbox(const std::string &ACCOUNT_ID, const std::string &INDICES, const std::string &PAYMENT_TYPE) const
Definition: OT_ME.cpp:546
EXPORT std::shared_ptr< OTScript > OTScriptFactory(const std::string &script_type="")
Definition: OTScript.cpp:203
EXPORT std::string stat_asset_account(const std::string &ACCOUNT_ID) const
Definition: OT_ME.cpp:478
static EXPORT std::string GetAssetType_Name(const std::string &ASSET_TYPE_ID)
Definition: OTAPI.cpp:909
static EXPORT int32_t getMarketRecentTrades(const std::string &SERVER_ID, const std::string &USER_ID, const std::string &MARKET_ID)
Gets all recent trades (up until maximum depth)
Definition: OTAPI.cpp:2319
std::string get_market_recent_trades(const std::string &SERVER_ID, const std::string &NYM_ID, const std::string &MARKET_ID) const
Definition: OTMeCpp.cpp:580
static EXPORT bool NumList_VerifyQuery(const std::string &strNumList, const std::string &strNumbers)
Definition: OTAPI.cpp:341
static EXPORT std::string CreatePurse_Passphrase(const std::string &SERVER_ID, const std::string &ASSET_TYPE_ID, const std::string &SIGNER_ID)
Definition: OTAPI.cpp:1864
EXPORT std::string load_or_retrieve_encrypt_key(const std::string &SERVER_ID, const std::string &NYM_ID, const std::string &TARGET_NYM_ID) const
Definition: OT_ME.cpp:576
int32_t CopyValueInteger() const
Definition: OTVariable.hpp:246
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)
Definition: OTAPI.cpp:1057
EXPORT std::string process_inbox(const std::string &SERVER_ID, const std::string &NYM_ID, const std::string &ACCOUNT_ID, const std::string &RESPONSE_LEDGER) const
Definition: OT_ME.cpp:514
static EXPORT std::string GetAccountWallet_AssetTypeID(const std::string &ACCOUNT_ID)
Definition: OTAPI.cpp:1042
static EXPORT std::string LoadAssetAccount(const std::string &SERVER_ID, const std::string &USER_ID, const std::string &ACCOUNT_ID)
Definition: OTAPI.cpp:1492
static EXPORT std::string GetNym_RevokedCredID(const std::string &NYM_ID, const int32_t &nIndex)
Definition: OTAPI.cpp:408
static EXPORT bool HaveAlreadySeenReply(const std::string &SERVER_ID, const std::string &USER_ID, const int64_t &REQUEST_NUMBER)
Definition: OTAPI.cpp:1506
static EXPORT int32_t sendUserMessage(const std::string &SERVER_ID, const std::string &USER_ID, const std::string &USER_ID_RECIPIENT, const std::string &RECIPIENT_PUBKEY, const std::string &THE_MESSAGE)
Definition: OTAPI.cpp:2047
static EXPORT std::string GetAccountWallet_ServerID(const std::string &ACCOUNT_ID)
Definition: OTAPI.cpp:1047
static EXPORT std::string Wallet_GetServerIDFromPartial(const std::string &PARTIAL_ID)
Definition: OTAPI.cpp:625
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().)
Definition: OTAPI.cpp:1762
static EXPORT int32_t checkUser(const std::string &SERVER_ID, const std::string &USER_ID, const std::string &USER_ID_CHECK)
Definition: OTAPI.cpp:2040
static EXPORT int32_t Smart_GetPartyCount(const std::string &THE_CONTRACT)
Definition: OTAPI.cpp:1224
static EXPORT int32_t Message_GetBalanceAgreementSuccess(const std::string &SERVER_ID, const std::string &USER_ID, const std::string &ACCOUNT_ID, const std::string &THE_MESSAGE)
Definition: OTAPI.cpp:1813
EXPORT std::string withdraw_cash(const std::string &SERVER_ID, const std::string &NYM_ID, const std::string &ACCT_ID, int64_t AMOUNT) const
Definition: OT_ME.cpp:808
static EXPORT bool Purse_HasPassword(const std::string &SERVER_ID, const std::string &THE_PURSE)
Definition: OTAPI.cpp:1850