Open-Transactions  0.93.0-ge03d287
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Pages
OTAPI.hpp
Go to the documentation of this file.
1 /************************************************************
2  *
3  * OTAPI.hpp
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 #ifndef OPENTXS_CLIENT_OTAPI_HPP
134 #define OPENTXS_CLIENT_OTAPI_HPP
135 
137 
138 namespace opentxs
139 {
140 
141 class OT_API;
142 class OTAPI_Exec;
143 
145 {
146 public:
147  EXPORT static OTAPI_Exec* SetExecutor(OTAPI_Exec* exec);
148 
149  EXPORT static OTAPI_Exec* Exec();
150  EXPORT static OTAPI_Exec* It();
151 
152  EXPORT static OT_API* OTAPI();
153 
154  EXPORT static int64_t StringToLong(const std::string& strNumber);
155  EXPORT static std::string LongToString(const int64_t& lNumber);
156 
157  EXPORT static uint64_t StringToUlong(const std::string& strNumber);
158  EXPORT static std::string UlongToString(const uint64_t& lNumber);
159 
165  EXPORT static bool AppInit(); // Call this ONLY ONCE, when your App first
166  // starts up.
167  EXPORT static bool AppCleanup(); // Call this ONLY ONCE, when your App is
168  // shutting down.
169 
170  // SetAppBinaryFolder
171  // OPTIONAL. Used in Android and Qt.
172  //
173  // Certain platforms use this to override the Prefix folder.
174  // Basically /usr/local is the prefix folder by default, meaning
175  // /usr/local/lib/opentxs will be the location of the scripts. But
176  // if you override AppBinary folder to, say, "res/raw"
177  // (Android does something like that) then even though the prefix remains
178  // as /usr/local, the scripts folder will be res/raw
179  //
180  EXPORT static void SetAppBinaryFolder(const std::string& strFolder);
181 
182  // SetHomeFolder
183  // OPTIONAL. Used in Android.
184  //
185  // The AppDataFolder, such as /Users/au/.ot, is constructed from the home
186  // folder, such as /Users/au.
187  //
188  // Normally the home folder is auto-detected, but certain platforms, such as
189  // Android, require us to explicitly set this folder from the Java code.
190  // Then
191  // the AppDataFolder is constructed from it. (It's the only way it can be
192  // done.)
193  //
194  // In Android, you would SetAppBinaryFolder to the path to
195  // "/data/app/packagename/res/raw",
196  // and you would SetHomeFolder to "/data/data/[app package]/files/"
197  //
198  EXPORT static void SetHomeFolder(const std::string& strFolder);
199 
200  // Then:
201 
226  EXPORT static bool SetWallet(const std::string& strWalletFilename);
227 
236  EXPORT static bool WalletExists();
237 
250  EXPORT static bool LoadWallet();
251 
260  EXPORT static bool SwitchWallet();
261 
266  EXPORT static void Output(const int32_t& nLogLevel,
267  const std::string& strOutput);
268 
278  EXPORT static time64_t GetTime();
279 
288  // const std::string& OT_CLI_ReadLine(); // Reads from cin until
289  // Newline.
290  // const std::string& OT_CLI_ReadUntilEOF(); // Reads from cin until
291  // EOF.
292 
293  // OTNumList is a class that encapsulates working with a comma-separated
294  // list
295  // of int64_t integers, stored in a std::set and easily serializable in/out
296  // of a string.
297  // (It's useful.)
298  //
299  EXPORT static std::string NumList_Add(const std::string& strNumList,
300  const std::string& strNumbers);
301  EXPORT static std::string NumList_Remove(const std::string& strNumList,
302  const std::string& strNumbers);
303  EXPORT static bool NumList_VerifyQuery(const std::string& strNumList,
304  const std::string& strNumbers);
305  EXPORT static bool NumList_VerifyAll(const std::string& strNumList,
306  const std::string& strNumbers);
307  EXPORT static int32_t NumList_Count(const std::string& strNumList);
308 
320  EXPORT static std::string Encode(const std::string& strPlaintext,
321  const bool& bLineBreaks);
322 
336  EXPORT static std::string Decode(const std::string& strEncoded,
337  const bool& bLineBreaks);
338 
358  EXPORT static std::string Encrypt(const std::string& RECIPIENT_NYM_ID,
359  const std::string& strPlaintext);
360 
386  EXPORT static std::string Decrypt(const std::string& RECIPIENT_NYM_ID,
387  const std::string& strCiphertext);
388 
389  // Generates a new symmetric key, based on a passphrase,
390  // and returns it (or nullptr.)
391  //
392  EXPORT static std::string CreateSymmetricKey();
393 
394  EXPORT static std::string SymmetricEncrypt(const std::string& SYMMETRIC_KEY,
395  const std::string& PLAINTEXT);
396  EXPORT static std::string SymmetricDecrypt(
397  const std::string& SYMMETRIC_KEY,
398  const std::string& CIPHERTEXT_ENVELOPE);
399 
418  EXPORT static std::string SignContract(const std::string& SIGNER_NYM_ID,
419  const std::string& THE_CONTRACT);
420 
421  // Instead of signing an existing contract, this is for just signing a flat
422  // message.
423  // Or, for example, for signing a new contract that has no signature yet.
424  // Let's say you
425  // have a ledger, for example, with no signatures yet. Pass "LEDGER" as the
426  // CONTRACT_TYPE
427  // and the resulting output will start like this: -----BEGIN OT SIGNED
428  // LEDGER----- ...
429  // Returns the signed output, or nullptr.
430  //
431  EXPORT static std::string FlatSign(const std::string& SIGNER_NYM_ID,
432  const std::string& THE_INPUT,
433  const std::string& CONTRACT_TYPE);
434 
453  EXPORT static std::string AddSignature(const std::string& SIGNER_NYM_ID,
454  const std::string& THE_CONTRACT);
455 
461  EXPORT static bool VerifySignature(const std::string& SIGNER_NYM_ID,
462  const std::string& THE_CONTRACT);
463 
473  EXPORT static std::string VerifyAndRetrieveXMLContents(
474  const std::string& THE_CONTRACT, const std::string& SIGNER_ID);
475 
478  EXPORT static int32_t GetMemlogSize();
479 
480  EXPORT static std::string GetMemlogAtIndex(const int32_t& nIndex);
481 
482  EXPORT static std::string PeekMemlogFront();
483  EXPORT static std::string PeekMemlogBack();
484 
485  EXPORT static bool PopMemlogFront();
486  EXPORT static bool PopMemlogBack();
487 
509  EXPORT static std::string CreateNym(
510  const int32_t& nKeySize, const std::string& NYM_ID_SOURCE,
511  const std::string& ALT_LOCATION); // source and location can be empty.
512  // (OT will generate a Nym with a
513  // public key as the source.)
514 
515  EXPORT static std::string GetNym_ActiveCronItemIDs(
516  const std::string& NYM_ID, const std::string& SERVER_ID);
517  EXPORT static std::string GetActiveCronItem(const std::string& SERVER_ID,
518  int64_t lTransNum);
519 
520  EXPORT static std::string GetNym_SourceForID(const std::string& NYM_ID);
521  EXPORT static std::string GetNym_AltSourceLocation(
522  const std::string& NYM_ID);
523 
524  EXPORT static int32_t GetNym_CredentialCount(const std::string& NYM_ID);
525  EXPORT static std::string GetNym_CredentialID(const std::string& NYM_ID,
526  const int32_t& nIndex);
527  EXPORT static std::string GetNym_CredentialContents(
528  const std::string& NYM_ID, const std::string& CREDENTIAL_ID);
529 
530  EXPORT static int32_t GetNym_RevokedCredCount(const std::string& NYM_ID);
531  EXPORT static std::string GetNym_RevokedCredID(const std::string& NYM_ID,
532  const int32_t& nIndex);
533  EXPORT static std::string GetNym_RevokedCredContents(
534  const std::string& NYM_ID, const std::string& CREDENTIAL_ID);
535 
536  EXPORT static int32_t GetNym_SubcredentialCount(
537  const std::string& NYM_ID, const std::string& MASTER_CRED_ID);
538  EXPORT static std::string GetNym_SubCredentialID(
539  const std::string& NYM_ID, const std::string& MASTER_CRED_ID,
540  const int32_t& nIndex);
541  EXPORT static std::string GetNym_SubCredentialContents(
542  const std::string& NYM_ID, const std::string& MASTER_CRED_ID,
543  const std::string& SUB_CRED_ID);
544 
545  EXPORT static std::string AddSubcredential(
546  const std::string& NYM_ID, const std::string& MASTER_CRED_ID,
547  const int32_t& nKeySize);
548  EXPORT static bool RevokeSubcredential(const std::string& NYM_ID,
549  const std::string& MASTER_CRED_ID,
550  const std::string& SUB_CRED_ID);
551 
558  EXPORT static std::string CreateServerContract(
559  const std::string& NYM_ID, const std::string& strXMLcontents);
560  EXPORT static std::string CreateAssetContract(
561  const std::string& NYM_ID, const std::string& strXMLcontents);
562 
563  EXPORT static std::string CalculateAssetContractID(
564  const std::string& str_Contract);
565  EXPORT static std::string CalculateServerContractID(
566  const std::string& str_Contract);
567 
568  // Use these below functions to get the new contract ITSELF, using its ID
569  // that was returned by the above two functions:
570  //
571  // EXPORT std::string GetServer_Contract(const std::string& SERVER_ID); //
572  // Return's Server's contract (based on server ID)
573  // EXPORT std::string GetAssetType_Contract(const std::string&
574  // ASSET_TYPE_ID); // Returns currency contract based on Asset Type ID
575 
576  /*
577  ---------------------------------
578 
579  ASSET CONTRACTS will want to make sure they put something like this at the
580  top:
581 
582  <?xml version="1.0"?>
583  <digitalAssetContract version="1.0">
584 
585  <entity shortname="Just testing"
586  longname="I need user feedback to help design the contract tags the server
587  must support..."
588  email="F3llowTraveler (at) gmail.com"/>
589 
590  <issue company="Chuck-E-Cheese, Inc"
591  email="[email protected]"
592  contractUrl="https://chuckecheese.com/games/contract/"
593  type="currency"/>
594 
595  <currency name="game tokens" tla="TOKEN" symbol="tks" type="decimal"
596  factor="1" decimal_power="0" fraction="mg"/>
597 
598  ---------------------------------
599 
600  SERVER CONTRACTS will want to make sure they put something like this at the
601  top:
602 
603  <?xml version="1.0"?>
604  <notaryProviderContract version="1.0">
605 
606  <entity shortname="Transactions.com"
607  longname="Transactions.com, LLC"
608  email="[email protected]"
609  serverURL="https://transactions.com/vers/1/"/>
610 
611  <notaryServer hostname="localhost"
612  port="7085"
613  URL="https://transactions.com/vers/1/" />
614 
615  ---------------------------------
616 
617 
618  NEITHER has to worry about THIS, which is added automatically:
619 
620 
621  <key name="contract">
622  - -----BEGIN CERTIFICATE-----
623  MIICZjCCAc+gAwIBAgIJAO14L19TJgzcMA0GCSqGSIb3DQEBBQUAMFcxCzAJBgNV
624  BAYTAlVTMREwDwYDVQQIEwhWaXJnaW5pYTEQMA4GA1UEBxMHRmFpcmZheDERMA8G
625  A1UEChMIWm9yay5vcmcxEDAOBgNVBAMTB1Jvb3QgQ0EwHhcNMTAwOTI5MDUyMzAx
626  WhcNMjAwOTI2MDUyMzAxWjBeMQswCQYDVQQGEwJVUzERMA8GA1UECBMIVmlyZ2lu
627  aWExEDAOBgNVBAcTB0ZhaXJmYXgxETAPBgNVBAoTCFpvcmsub3JnMRcwFQYDVQQD
628  Ew5zaGVsbC56b3JrLm9yZzCBnzANBgkqhkiG9w0BAQEFAAOBjQAwgYkCgYEA3vD9
629  fO4ov4854L8wXrgfv2tltDz0ieVrTNSLuy1xuQyb//+MwZ0EYwu8jMMQrqbUaYG6
630  y8zJu32yBKrBNPPwJ+fJE+tfgVg860dGVbwMd4KhpkKtppJXmZaGqLqvELaXa4Uw
631  9N3qg/faj0NMEDIBhv/tD/B5U65vH+U0JlRJ07kCAwEAAaMzMDEwCQYDVR0TBAIw
632  ADAkBgNVHREEHTAbgg5zaGVsbC56b3JrLm9yZ4IJbG9jYWxob3N0MA0GCSqGSIb3
633  DQEBBQUAA4GBALLXPa/naWsiXsw0JwlSiG7aOmvMF2romUkcr6uObhN7sghd38M0
634  l2kKTiptnA8txrri8RhqmQgOgiyKFCKBkxY7/XGot62cE8Y1+lqGXlhu2UHm6NjA
635  pRKvng75J2HTjmmsbCHy+nexn4t44wssfPYlGPD8sGwmO24u9tRfdzJE
636  - -----END CERTIFICATE-----
637  </key>
638 
639  */
640 
641  /*
642  EXPORT static std::string Contract_AddTag(const std::string& NYM_ID, const
643  std::string& THE_CONTRACT,
644  const std::string& TAG_NAME, const std::string& SUBTAG_NAME,
645  const std::string& SUBTAG_VALUE, const std::string& TAG_VALUE);
646  key == TAG_NAME
647  name == SUBTAG_NAME
648  "contract" == SUBTAG_VALUE
649  <the cert> == TAG_VALUE
650 
651  */
652 
659  EXPORT static int32_t AddServerContract(
660  const std::string& strContract); // returns OT_TRUE (1) or OT_FALSE(0)
661 
668  EXPORT static int32_t AddAssetContract(
669  const std::string& strContract); // returns OT_TRUE (1) or OT_FALSE(0)
670 
680  EXPORT static int32_t GetServerCount();
681  EXPORT static int32_t GetAssetTypeCount();
682  EXPORT static int32_t GetAccountCount();
683  EXPORT static int32_t GetNymCount();
684 
685  EXPORT static std::string GetServer_ID(const int32_t& nIndex); // based on
686  // Index
687  // (above 4
688  // functions)
689  // this
690  // returns
691  // the
692  // Server's
693  // ID
694  EXPORT static std::string GetServer_Name(
695  const std::string& SERVER_ID); // Return's Server's name (based on
696  // server ID)
697  EXPORT static std::string GetServer_Contract(
698  const std::string& SERVER_ID); // Return's Server's contract (based on
699  // server ID)
700 
708  EXPORT static std::string FormatAmount(const std::string& ASSET_TYPE_ID,
709  const int64_t& THE_AMOUNT);
710 
718  EXPORT static int64_t StringToAmount(const std::string& ASSET_TYPE_ID,
719  const std::string& str_input);
720 
721  EXPORT static std::string GetAssetType_ID(
722  const int32_t& nIndex); // returns Asset Type ID (based on index from
723  // GetAssetTypeCount)
724  EXPORT static std::string GetAssetType_Name(
725  const std::string& ASSET_TYPE_ID); // Returns asset type name based on
726  // Asset Type ID
727  EXPORT static std::string GetAssetType_TLA(
728  const std::string& ASSET_TYPE_ID); // Returns asset type TLA based on
729  // Asset Type ID
730  EXPORT static std::string GetAssetType_Contract(
731  const std::string& ASSET_TYPE_ID); // Returns currency contract based on
732  // Asset Type ID
733 
744  EXPORT static std::string GetAccountWallet_ID(
745  const int32_t& nIndex); // returns a string containing the account ID,
746  // based on index.
747  EXPORT static std::string GetAccountWallet_Name(
748  const std::string& ACCOUNT_ID); // returns the account name, based on
749  // account ID.
750  EXPORT static int64_t GetAccountWallet_Balance(
751  const std::string& ACCOUNT_ID); // returns the account balance, based on
752  // account ID.
753  EXPORT static std::string GetAccountWallet_Type(
754  const std::string& ACCOUNT_ID); // returns the account type (simple,
755  // issuer, etc)
756  EXPORT static std::string GetAccountWallet_AssetTypeID(
757  const std::string& ACCOUNT_ID); // returns asset type ID of the account
758  EXPORT static std::string GetAccountWallet_ServerID(
759  const std::string& ACCOUNT_ID); // returns Server ID of the account
760  EXPORT static std::string GetAccountWallet_NymID(
761  const std::string& ACCOUNT_ID); // returns Nym ID of the account
762 
763  EXPORT static std::string GetAccountWallet_InboxHash(
764  const std::string& ACCOUNT_ID); // returns latest InboxHash according to
765  // the account file. (Usually more
766  // recent than: GetNym_InboxHash)
767  EXPORT static std::string GetAccountWallet_OutboxHash(
768  const std::string& ACCOUNT_ID); // returns latest OutboxHash according
769  // to the account file. (Usually more
770  // recent than: GetNym_OutboxHash)
771 
777  EXPORT static bool VerifyAccountReceipt(const std::string& SERVER_ID,
778  const std::string& NYM_ID,
779  const std::string& ACCT_ID);
780 
792  EXPORT static int32_t GetNym_TransactionNumCount(
793  const std::string& SERVER_ID, const std::string& NYM_ID);
794 
795  EXPORT static std::string GetNym_ID(const int32_t& nIndex); // based on
796  // Index (above
797  // 4 functions)
798  // this returns
799  // the Nym's ID
800  EXPORT static std::string GetNym_Name(
801  const std::string& NYM_ID); // Returns Nym Name (based on NymID)
802  EXPORT static std::string GetNym_Stats(
803  const std::string& NYM_ID); // Returns Nym Statistics (based on NymID)
804  EXPORT static std::string GetNym_NymboxHash(
805  const std::string& SERVER_ID,
806  const std::string& NYM_ID); // NymboxHash for "most recently DOWNLOADED"
807  // Nymbox (by ServerID)
808  EXPORT static std::string GetNym_RecentHash(
809  const std::string& SERVER_ID,
810  const std::string& NYM_ID); // "Most recent NymboxHash according to the
811  // SERVER's records" (Which is often sent as
812  // an 'FYI' with various server replies to
813  // my messages.)
814 
815  EXPORT static std::string GetNym_InboxHash(
816  const std::string& ACCOUNT_ID,
817  const std::string& NYM_ID); // InboxHash for "most recently DOWNLOADED"
818  // Inbox (by AccountID). Often contains
819  // older value than
820  // GetAccountWallet_InboxHash.
821  EXPORT static std::string GetNym_OutboxHash(
822  const std::string& ACCOUNT_ID,
823  const std::string& NYM_ID); // OutboxHash for "most recently DOWNLOADED"
824  // Outbox (by AccountID) Often contains
825  // older value than
826  // GetAccountWallet_OutboxHash
827 
828  EXPORT static bool IsNym_RegisteredAtServer(const std::string& NYM_ID,
829  const std::string& SERVER_ID);
830 
855  EXPORT static int32_t GetNym_MailCount(const std::string& NYM_ID);
856 
857  EXPORT static std::string GetNym_MailContentsByIndex(
858  const std::string& NYM_ID,
859  const int32_t& nIndex); // returns the message itself (Subject:
860  // optionally as first line)
861 
862  EXPORT static std::string GetNym_MailSenderIDByIndex(
863  const std::string& NYM_ID,
864  const int32_t& nIndex); // returns the NymID of the sender.
865  EXPORT static std::string GetNym_MailServerIDByIndex(
866  const std::string& NYM_ID, const int32_t& nIndex); // returns the
867  // ServerID where the
868  // message came from.
869 
870  EXPORT static bool Nym_RemoveMailByIndex(const std::string& NYM_ID,
871  const int32_t& nIndex); // (1 or
872  // 0.)
873  EXPORT static bool Nym_VerifyMailByIndex(
874  const std::string& NYM_ID,
875  const int32_t& nIndex); // true if signature verifies. (Sender Nym MUST
876  // be in my wallet for this to work.)
877 
878  EXPORT static int32_t GetNym_OutmailCount(const std::string& NYM_ID);
879 
880  EXPORT static std::string GetNym_OutmailContentsByIndex(
881  const std::string& NYM_ID,
882  const int32_t& nIndex); // returns the message itself (Subject:
883  // optionally as first line)
884 
885  EXPORT static std::string GetNym_OutmailRecipientIDByIndex(
886  const std::string& NYM_ID,
887  const int32_t& nIndex); // returns the NymID of the recipient.
888  EXPORT static std::string GetNym_OutmailServerIDByIndex(
889  const std::string& NYM_ID, const int32_t& nIndex); // returns the
890  // ServerID where the
891  // message came from.
892 
893  EXPORT static bool Nym_RemoveOutmailByIndex(const std::string& NYM_ID,
894  const int32_t& nIndex); // (1 or
895  // 0.)
896  EXPORT static bool Nym_VerifyOutmailByIndex(
897  const std::string& NYM_ID,
898  const int32_t& nIndex); // true if signature verifies. (Sender Nym MUST
899  // be in my wallet for this to work.)
900 
901  EXPORT static int32_t GetNym_OutpaymentsCount(const std::string& NYM_ID);
902 
903  EXPORT static std::string GetNym_OutpaymentsContentsByIndex(
904  const std::string& NYM_ID,
905  const int32_t& nIndex); // returns the message itself
906 
907  EXPORT static std::string GetNym_OutpaymentsRecipientIDByIndex(
908  const std::string& NYM_ID,
909  const int32_t& nIndex); // returns the NymID of the recipient.
910  EXPORT static std::string GetNym_OutpaymentsServerIDByIndex(
911  const std::string& NYM_ID, const int32_t& nIndex); // returns the
912  // ServerID where the
913  // message came from.
914 
915  EXPORT static bool Nym_RemoveOutpaymentsByIndex(
916  const std::string& NYM_ID, const int32_t& nIndex); // (1 or 0.)
917  EXPORT static bool Nym_VerifyOutpaymentsByIndex(
918  const std::string& NYM_ID,
919  const int32_t& nIndex); // true if signature verifies. (Sender Nym MUST
920  // be in my wallet for this to work.)
921 
934  EXPORT static bool Wallet_CanRemoveServer(const std::string& SERVER_ID);
935 
943  EXPORT static bool Wallet_RemoveServer(const std::string& SERVER_ID);
944 
953  EXPORT static bool Wallet_CanRemoveAssetType(const std::string& ASSET_ID);
954 
962  EXPORT static bool Wallet_RemoveAssetType(const std::string& ASSET_ID);
963 
972  EXPORT static bool Wallet_CanRemoveNym(const std::string& NYM_ID);
973 
981  EXPORT static bool Wallet_RemoveNym(const std::string& NYM_ID);
982 
991  EXPORT static bool Wallet_CanRemoveAccount(const std::string& ACCOUNT_ID);
992 
993  // See deleteAssetAccount(), a server message, for deleting asset accounts.
994  // (You can't just delete them out of the wallet without first deleting them
995  // off of the server.)
996  //
997 
1026  EXPORT static bool Wallet_ChangePassphrase(); // (true for success and
1027  // false for error.)
1028 
1030  EXPORT static std::string Wallet_ExportNym(const std::string& NYM_ID);
1031 
1033  EXPORT static std::string Wallet_ImportNym(
1034  const std::string& FILE_CONTENTS);
1035 
1037  EXPORT static std::string Wallet_ImportCert(
1038  const std::string& DISPLAY_NAME, const std::string& FILE_CONTENTS);
1039 
1041  EXPORT static std::string Wallet_ExportCert(const std::string& NYM_ID);
1042 
1044  // ID.
1046  //
1047  EXPORT static std::string Wallet_GetNymIDFromPartial(
1048  const std::string& PARTIAL_ID);
1049  EXPORT static std::string Wallet_GetServerIDFromPartial(
1050  const std::string& PARTIAL_ID);
1051  EXPORT static std::string Wallet_GetAssetIDFromPartial(
1052  const std::string& PARTIAL_ID);
1053  EXPORT static std::string Wallet_GetAccountIDFromPartial(
1054  const std::string& PARTIAL_ID);
1055 
1076  EXPORT static bool SetNym_Name(const std::string& NYM_ID,
1077  const std::string& SIGNER_NYM_ID,
1078  const std::string& NYM_NEW_NAME);
1079 
1082  EXPORT static bool SetAccountWallet_Name(const std::string& ACCT_ID,
1083  const std::string& SIGNER_NYM_ID,
1084  const std::string& ACCT_NEW_NAME);
1085 
1086  EXPORT static bool SetAssetType_Name(const std::string& ASSET_ID,
1087  const std::string& STR_NEW_NAME);
1088 
1089  EXPORT static bool SetServer_Name(const std::string& SERVER_ID,
1090  const std::string& STR_NEW_NAME);
1091 
1147  EXPORT static std::string WriteCheque(
1148  const std::string& SERVER_ID, const int64_t& CHEQUE_AMOUNT,
1149  const time64_t& VALID_FROM, const time64_t& VALID_TO,
1150  const std::string& SENDER_ACCT_ID, const std::string& SENDER_USER_ID,
1151  const std::string& CHEQUE_MEMO, const std::string& RECIPIENT_USER_ID);
1152 
1181  EXPORT static bool DiscardCheque(const std::string& SERVER_ID,
1182  const std::string& USER_ID,
1183  const std::string& ACCT_ID,
1184  const std::string& THE_CHEQUE);
1185 
1249  EXPORT static std::string ProposePaymentPlan(
1250  const std::string& SERVER_ID,
1251  const time64_t& VALID_FROM, // Default (0 or nullptr) == current time
1252  // measured in seconds since Jan 1970.
1253  const time64_t& VALID_TO, // Default (0 or nullptr) == no expiry /
1254  // cancel
1255  // anytime. Otherwise this is ADDED to
1256  // VALID_FROM (it's a length.)
1257  const std::string& SENDER_ACCT_ID, // Mandatory parameters.
1258  const std::string& SENDER_USER_ID, // Both sender and recipient must
1259  // sign before submitting.
1260  const std::string& PLAN_CONSIDERATION, // Like a memo.
1261  const std::string& RECIPIENT_ACCT_ID, // NOT optional.
1262  const std::string& RECIPIENT_USER_ID, // Both sender and recipient must
1263  // sign before submitting.
1264  const int64_t& INITIAL_PAYMENT_AMOUNT, // zero or nullptr == no initial
1265  // payment.
1266  const time64_t& INITIAL_PAYMENT_DELAY, // seconds from creation date.
1267  // Default is zero or nullptr.
1268  const int64_t& PAYMENT_PLAN_AMOUNT, // Zero or nullptr == no regular
1269  // payments.
1270  const time64_t& PAYMENT_PLAN_DELAY, // No. of seconds from creation
1271  // date. Default is zero or nullptr.
1272  // (Causing 30 days.)
1273  const time64_t& PAYMENT_PLAN_PERIOD, // No. of seconds between payments.
1274  // Default is zero or nullptr.
1275  // (Causing 30 days.)
1276  const time64_t& PAYMENT_PLAN_LENGTH, // In seconds. Defaults to 0 or
1277  // nullptr (no maximum length.)
1278  const int32_t& PAYMENT_PLAN_MAX_PAYMENTS // integer. Defaults to 0 or
1279  // nullptr (no maximum payments.)
1280  );
1281 
1282  // The above version has too many arguments for boost::function apparently
1283  // (for Chaiscript.)
1284  // So this is a version of it that compresses those into a fewer number of
1285  // arguments.
1286  // (Then it expands them and calls the above version.)
1287  // See above function for more details on parameters.
1288  // Basically this version has ALL the same parameters, but it stuffs two or
1289  // three at a time into
1290  // a single parameter, as a comma-separated list in string form.
1291  //
1292  EXPORT static std::string EasyProposePlan(
1293  const std::string& SERVER_ID,
1294  const std::string& DATE_RANGE, // "from,to" Default 'from' (0 or "") ==
1295  // NOW, and default 'to' (0 or "") == no
1296  // expiry / cancel anytime
1297  const std::string& SENDER_ACCT_ID, // Mandatory parameters.
1298  const std::string& SENDER_USER_ID, // Both sender and recipient must
1299  // sign before submitting.
1300  const std::string& PLAN_CONSIDERATION, // Like a memo.
1301  const std::string& RECIPIENT_ACCT_ID, // NOT optional.
1302  const std::string& RECIPIENT_USER_ID, // Both sender and recipient must
1303  // sign before submitting.
1304  const std::string& INITIAL_PAYMENT, // "amount,delay" Default 'amount'
1305  // (0 or "") == no initial payment.
1306  // Default 'delay' (0 or nullptr) is
1307  // seconds from creation date.
1308  const std::string& PAYMENT_PLAN, // "amount,delay,period" 'amount' is a
1309  // recurring payment. 'delay' and
1310  // 'period' cause 30 days if you pass 0
1311  // or "".
1312  const std::string& PLAN_EXPIRY // "length,number" 'length' is maximum
1313  // lifetime in seconds. 'number' is
1314  // maximum number of payments in seconds.
1315  // 0 or "" is unlimited (for both.)
1316  );
1317 
1318  // Called by Customer. Pass in the plan obtained in the above call.
1319  //
1320  EXPORT static std::string ConfirmPaymentPlan(
1321  const std::string& SERVER_ID, const std::string& SENDER_USER_ID,
1322  const std::string& SENDER_ACCT_ID, const std::string& RECIPIENT_USER_ID,
1323  const std::string& PAYMENT_PLAN);
1324 
1325  // SMART CONTRACTS
1326 
1327  // RETURNS: the Smart Contract itself. (Or nullptr.)
1328  //
1329  EXPORT static std::string Create_SmartContract(
1330  const std::string& SIGNER_NYM_ID, // Use any Nym you wish here. (The
1331  // signing at this point is only to
1332  // cause a save.)
1333  const time64_t& VALID_FROM, // Default (0 or nullptr) == NOW
1334  const time64_t& VALID_TO // Default (0 or nullptr) == no expiry / cancel
1335  // anytime
1336  );
1337 
1338  //
1339  // todo: Someday add a parameter here BYLAW_LANGUAGE so that people can use
1340  // custom languages in their scripts. For now I have a default language, so
1341  // I'll just make that the default. (There's only one language right now
1342  // anyway.)
1343  //
1344  // returns: the updated smart contract (or nullptr)
1345  EXPORT static std::string SmartContract_AddBylaw(
1346  const std::string& THE_CONTRACT, // The contract, about to have the
1347  // bylaw added to it.
1348  const std::string& SIGNER_NYM_ID, // Use any Nym you wish here. (The
1349  // signing at this point is only to
1350  // cause a save.)
1351  const std::string& BYLAW_NAME // The Bylaw's NAME as referenced in the
1352  // smart contract. (And the scripts...)
1353  );
1354 
1355  // returns: the updated smart contract (or nullptr)
1356  EXPORT static std::string SmartContract_AddClause(
1357  const std::string& THE_CONTRACT, // The contract, about to have the
1358  // clause added to it.
1359  const std::string& SIGNER_NYM_ID, // Use any Nym you wish here. (The
1360  // signing at this point is only to
1361  // cause a save.)
1362  const std::string& BYLAW_NAME, // Should already be on the contract.
1363  // (This way we can find it.)
1364  const std::string& CLAUSE_NAME, // The Clause's name as referenced in
1365  // the smart contract. (And the
1366  // scripts...)
1367  const std::string& SOURCE_CODE // The actual source code for the clause.
1368  );
1369 
1370  // returns: the updated smart contract (or nullptr)
1371  EXPORT static std::string SmartContract_AddVariable(
1372  const std::string& THE_CONTRACT, // The contract, about to have the
1373  // variabnle added to it.
1374  const std::string& SIGNER_NYM_ID, // Use any Nym you wish here. (The
1375  // signing at this point is only to
1376  // cause a save.)
1377  const std::string& BYLAW_NAME, // Should already be on the contract.
1378  // (This way we can find it.)
1379  const std::string& VAR_NAME, // The Variable's name as referenced in the
1380  // smart contract. (And the scripts...)
1381  const std::string& VAR_ACCESS, // "constant", "persistent", or
1382  // "important".
1383  const std::string& VAR_TYPE, // "string", "int64_t", or "bool"
1384  const std::string& VAR_VALUE // Contains a string. If type is int64_t,
1385  // atol() will be used to convert value to
1386  // a int64_t. If type is bool, the strings
1387  // "true" or "false" are expected here in
1388  // order to convert to a bool.
1389  );
1390 
1391  // returns: the updated smart contract (or nullptr)
1392  EXPORT static std::string SmartContract_AddCallback(
1393  const std::string& THE_CONTRACT, // The contract, about to have the
1394  // callback added to it.
1395  const std::string& SIGNER_NYM_ID, // Use any Nym you wish here. (The
1396  // signing at this point is only to
1397  // cause a save.)
1398  const std::string& BYLAW_NAME, // Should already be on the contract.
1399  // (This way we can find it.)
1400  const std::string& CALLBACK_NAME, // The Callback's name as referenced
1401  // in the smart contract. (And the
1402  // scripts...)
1403  const std::string& CLAUSE_NAME // The actual clause that will be
1404  // triggered by the callback. (Must
1405  // exist.)
1406  );
1407 
1408  // returns: the updated smart contract (or nullptr)
1409  EXPORT static std::string SmartContract_AddHook(
1410  const std::string& THE_CONTRACT, // The contract, about to have the hook
1411  // added to it.
1412  const std::string& SIGNER_NYM_ID, // Use any Nym you wish here. (The
1413  // signing at this point is only to
1414  // cause a save.)
1415  const std::string& BYLAW_NAME, // Should already be on the contract.
1416  // (This way we can find it.)
1417  const std::string& HOOK_NAME, // The Hook's name as referenced in the
1418  // smart contract. (And the scripts...)
1419  const std::string& CLAUSE_NAME // The actual clause that will be
1420  // triggered by the hook. (You can call
1421  // this multiple times, and have multiple
1422  // clauses trigger on the same hook.)
1423  );
1424 
1425  // RETURNS: Updated version of THE_CONTRACT. (Or nullptr.)
1426  EXPORT static std::string SmartContract_AddParty(
1427  const std::string& THE_CONTRACT, // The contract, about to have the
1428  // party added to it.
1429  const std::string& SIGNER_NYM_ID, // Use any Nym you wish here. (The
1430  // signing at this point is only to
1431  // cause a save.)
1432  const std::string& PARTY_NAME, // The Party's NAME as referenced in the
1433  // smart contract. (And the scripts...)
1434  const std::string& AGENT_NAME // An AGENT will be added by default for
1435  // this party. Need Agent NAME.
1436  );
1437 
1438  // (FYI, that is basically the only option, until I code Entities and Roles.
1439  // Until then, a party can ONLY be
1440  // a Nym, with himself as the agent representing that same party. Nym ID is
1441  // supplied on ConfirmParty() below.)
1442 
1443  // Used when creating a theoretical smart contract (that could be used over
1444  // and over again with different parties.)
1445  //
1446  // returns: the updated smart contract (or nullptr)
1447  EXPORT static std::string SmartContract_AddAccount(
1448  const std::string& THE_CONTRACT, // The contract, about to have the
1449  // account added to it.
1450  const std::string& SIGNER_NYM_ID, // Use any Nym you wish here. (The
1451  // signing at this point is only to
1452  // cause a save.)
1453  const std::string& PARTY_NAME, // The Party's NAME as referenced in the
1454  // smart contract. (And the scripts...)
1455  const std::string& ACCT_NAME, // The Account's name as referenced in the
1456  // smart contract
1457  const std::string& ASSET_TYPE_ID // Asset Type ID for the Account.
1458  );
1459 
1468  EXPORT static int32_t SmartContract_CountNumsNeeded(
1469  const std::string& THE_CONTRACT, // The smart contract, about to be
1470  // queried by this function.
1471  const std::string& AGENT_NAME);
1472 
1479  EXPORT static std::string SmartContract_ConfirmAccount(
1480  const std::string& THE_CONTRACT, // The smart contract, about to be
1481  // changed by this function.
1482  const std::string& SIGNER_NYM_ID, // Use any Nym you wish here. (The
1483  // signing at this point is only to
1484  // cause a save.)
1485  const std::string& PARTY_NAME, // Should already be on the contract.
1486  // (This way we can find it.)
1487  const std::string& ACCT_NAME, // Should already be on the contract.
1488  // (This way we can find it.)
1489  const std::string& AGENT_NAME, // The agent name for this asset account.
1490  const std::string& ACCT_ID // AcctID for the asset account. (For
1491  // acct_name).
1492  );
1493 
1500  EXPORT static std::string SmartContract_ConfirmParty(
1501  const std::string& THE_CONTRACT, // The smart contract, about to be
1502  // changed by this function.
1503  const std::string& PARTY_NAME, // Should already be on the contract.
1504  // This way we can find it.
1505  const std::string& NYM_ID // Nym ID for the party, the actual owner,
1506  );
1507  // ===> AS WELL AS for the default AGENT of that party.
1508 
1509  /* ----------------------------------------
1510  Various informational functions for the Smart Contracts.
1511  */
1512 
1513  EXPORT static bool Smart_AreAllPartiesConfirmed(
1514  const std::string& THE_CONTRACT); // true or false?
1515  EXPORT static int32_t Smart_GetBylawCount(const std::string& THE_CONTRACT);
1516  EXPORT static std::string Smart_GetBylawByIndex(
1517  const std::string& THE_CONTRACT,
1518  const int32_t& nIndex); // returns the name of the bylaw.
1519  EXPORT static std::string Bylaw_GetLanguage(const std::string& THE_CONTRACT,
1520  const std::string& BYLAW_NAME);
1521  EXPORT static int32_t Bylaw_GetClauseCount(const std::string& THE_CONTRACT,
1522  const std::string& BYLAW_NAME);
1523  EXPORT static std::string Clause_GetNameByIndex(
1524  const std::string& THE_CONTRACT, const std::string& BYLAW_NAME,
1525  const int32_t& nIndex); // returns the name of the clause.
1526  EXPORT static std::string Clause_GetContents(
1527  const std::string& THE_CONTRACT, const std::string& BYLAW_NAME,
1528  const std::string& CLAUSE_NAME); // returns the contents of the clause.
1529  EXPORT static int32_t Bylaw_GetVariableCount(
1530  const std::string& THE_CONTRACT, const std::string& BYLAW_NAME);
1531  EXPORT static std::string Variable_GetNameByIndex(
1532  const std::string& THE_CONTRACT, const std::string& BYLAW_NAME,
1533  const int32_t& nIndex); // returns the name of the variable.
1534  EXPORT static std::string Variable_GetType(
1535  const std::string& THE_CONTRACT, const std::string& BYLAW_NAME,
1536  const std::string& VARIABLE_NAME); // returns the type of the variable.
1537  EXPORT static std::string Variable_GetAccess(
1538  const std::string& THE_CONTRACT, const std::string& BYLAW_NAME,
1539  const std::string& VARIABLE_NAME); // returns the access level of the
1540  // variable.
1541  EXPORT static std::string Variable_GetContents(
1542  const std::string& THE_CONTRACT, const std::string& BYLAW_NAME,
1543  const std::string& VARIABLE_NAME); // returns the contents of the
1544  // variable.
1545  EXPORT static int32_t Bylaw_GetHookCount(const std::string& THE_CONTRACT,
1546  const std::string& BYLAW_NAME);
1547  EXPORT static std::string Hook_GetNameByIndex(
1548  const std::string& THE_CONTRACT, const std::string& BYLAW_NAME,
1549  const int32_t& nIndex); // returns the name of the hook.
1550  EXPORT static int32_t Hook_GetClauseCount(
1551  const std::string& THE_CONTRACT, const std::string& BYLAW_NAME,
1552  const std::string& HOOK_NAME); // for iterating clauses on a hook.
1553  EXPORT static std::string Hook_GetClauseAtIndex(
1554  const std::string& THE_CONTRACT, const std::string& BYLAW_NAME,
1555  const std::string& HOOK_NAME, const int32_t& nIndex);
1556  EXPORT static int32_t Bylaw_GetCallbackCount(
1557  const std::string& THE_CONTRACT, const std::string& BYLAW_NAME);
1558  EXPORT static std::string Callback_GetNameByIndex(
1559  const std::string& THE_CONTRACT, const std::string& BYLAW_NAME,
1560  const int32_t& nIndex); // returns the name of the callback.
1561  EXPORT static std::string Callback_GetClause(
1562  const std::string& THE_CONTRACT, const std::string& BYLAW_NAME,
1563  const std::string& CALLBACK_NAME); // returns name of clause attached to
1564  // callback.
1565  EXPORT static int32_t Smart_GetPartyCount(const std::string& THE_CONTRACT);
1566  EXPORT static std::string Smart_GetPartyByIndex(
1567  const std::string& THE_CONTRACT,
1568  const int32_t& nIndex); // returns the name of the party.
1569  EXPORT static bool Smart_IsPartyConfirmed(
1570  const std::string& THE_CONTRACT,
1571  const std::string& PARTY_NAME); // true or false?
1572  EXPORT static std::string Party_GetID(
1573  const std::string& THE_CONTRACT,
1574  const std::string& PARTY_NAME); // returns either NymID or Entity ID.
1575  EXPORT static int32_t Party_GetAcctCount(const std::string& THE_CONTRACT,
1576  const std::string& PARTY_NAME);
1577  EXPORT static std::string Party_GetAcctNameByIndex(
1578  const std::string& THE_CONTRACT, const std::string& PARTY_NAME,
1579  const int32_t& nIndex); // returns the name of the clause.
1580  EXPORT static std::string Party_GetAcctID(
1581  const std::string& THE_CONTRACT, const std::string& PARTY_NAME,
1582  const std::string& ACCT_NAME); // returns account ID for a given acct
1583  // name.
1584  EXPORT static std::string Party_GetAcctAssetID(
1585  const std::string& THE_CONTRACT, const std::string& PARTY_NAME,
1586  const std::string& ACCT_NAME); // returns asset type ID for a given acct
1587  // name.
1588  EXPORT static std::string Party_GetAcctAgentName(
1589  const std::string& THE_CONTRACT, const std::string& PARTY_NAME,
1590  const std::string& ACCT_NAME); // returns agent name authorized to
1591  // administer a given named acct. (If
1592  // it's set...)
1593  EXPORT static int32_t Party_GetAgentCount(const std::string& THE_CONTRACT,
1594  const std::string& PARTY_NAME);
1595  EXPORT static std::string Party_GetAgentNameByIndex(
1596  const std::string& THE_CONTRACT, const std::string& PARTY_NAME,
1597  const int32_t& nIndex); // returns the name of the agent.
1598  EXPORT static std::string Party_GetAgentID(
1599  const std::string& THE_CONTRACT, const std::string& PARTY_NAME,
1600  const std::string& AGENT_NAME); // returns ID of the agent. (If there is
1601  // one...)
1602 
1611  EXPORT static int32_t activateSmartContract(
1612  const std::string& SERVER_ID, const std::string& USER_ID,
1613  const std::string& THE_SMART_CONTRACT);
1630  EXPORT static int32_t triggerClause(const std::string& SERVER_ID,
1631  const std::string& USER_ID,
1632  const int64_t& TRANSACTION_NUMBER,
1633  const std::string& CLAUSE_NAME,
1634  const std::string& STR_PARAM);
1635 
1636  /*
1637  Msg_HarvestTransactionNumbers
1638 
1639  This function will load up the cron item (which is either a market offer, a
1640  payment plan,
1641  or a SMART CONTRACT.) UPDATE: this function operates on messages, not cron
1642  items.
1643 
1644  Then it will try to harvest all of the closing transaction numbers for
1645  NYM_ID that are
1646  available to be harvested from THE_CRON_ITEM. (There might be zero #s
1647  available for that
1648  Nym, which is still a success and will return true. False means error.)
1649 
1650  YOU MIGHT ASK:
1651 
1652  WHY WOULD I WANT to harvest ONLY the closing numbers for the Nym, and not
1653  the OPENING
1654  numbers as well? The answer is because for this Nym, the opening number
1655  might already
1656  be burned. For example, if Nym just tried to activate a smart contract, and
1657  the activation
1658  FAILED, then maybe the opening number is already gone, even though his
1659  closing numbers, on the
1660  other hand, are still valid for retrieval. (I have to double check this.)
1661 
1662  HOWEVER, what if the MESSAGE failed, before it even TRIED the transaction?
1663  In which case,
1664  the opening number is still good also, and should be retrieved.
1665 
1666  Remember, I have to keep signing for my transaction numbers until they are
1667  finally closed out.
1668  They will appear on EVERY balance agreement and transaction statement from
1669  here until the end
1670  of time, whenever I finally close out those numbers. If some of them are
1671  still good on a failed
1672  transaction, then I want to retrieve them so I can use them, and eventually
1673  close them out.
1674 
1675  ==> Whereas, what if I am the PARTY to a smart contract, but I am not the
1676  actual ACTIVATOR / ORIGINATOR
1677  (who activated the smart contract on the server). Therefore I never sent any
1678  transaction to the
1679  server, and I never burned my opening number. It's probably still a good #.
1680  If my wallet is not a piece
1681  of shit, then I should have a stored copy of any contract that I signed. If
1682  it turns out in the future
1683  that that contract wasn't activated, then I can retrieve not only my closing
1684  numbers, but my OPENING
1685  number as well! IN THAT CASE, I would call HarvestAllNumbers() instead of
1686  HarvestClosingNumbers().
1687 
1688 
1689  UPDATE: The above logic is now handled automatically in
1690  HarvestTransactionNumbers.
1691  Therefore HarvestClosingNumbers and HarvestAllNumbers have been removed.
1692 
1693  */
1694 
1695  // Returns OT_BOOL
1696  EXPORT static bool Msg_HarvestTransactionNumbers(
1697  const std::string& THE_MESSAGE, const std::string& USER_ID,
1698  const bool& bHarvestingForRetry, const bool& bReplyWasSuccess,
1699  const bool& bReplyWasFailure, const bool& bTransactionWasSuccess,
1700  const bool& bTransactionWasFailure);
1701 
1702  // Returns OT_BOOL
1703  // int32_t HarvestClosingNumbers(const std::string& SERVER_ID,
1704  // const std::string& NYM_ID,
1705  // const std::string& THE_CRON_ITEM);
1706  //
1707  //
1708  //
1709  // Returns OT_BOOL
1710  // int32_t HarvestAllNumbers(const std::string& SERVER_ID,
1711  // const std::string& NYM_ID,
1712  // const std::string& THE_CRON_ITEM);
1713 
1721  EXPORT static std::string LoadUserPubkey_Encryption(
1722  const std::string& USER_ID); // returns nullptr, or a public key.
1723 
1724  EXPORT static std::string LoadUserPubkey_Signing(
1725  const std::string& USER_ID); // returns nullptr, or a public key.
1726 
1734  EXPORT static std::string LoadPubkey_Encryption(
1735  const std::string& USER_ID); // returns nullptr, or a public key.
1736 
1737  EXPORT static std::string LoadPubkey_Signing(
1738  const std::string& USER_ID); // returns nullptr, or a public key.
1739 
1747  EXPORT static bool VerifyUserPrivateKey(
1748  const std::string& USER_ID); // returns OT_BOOL
1749 
1758  EXPORT static std::string LoadPurse(const std::string& SERVER_ID,
1759  const std::string& ASSET_TYPE_ID,
1760  const std::string& USER_ID); // returns
1761  // nullptr, or
1762  // a purse.
1763 
1764  EXPORT static std::string LoadMint(
1765  const std::string& SERVER_ID,
1766  const std::string& ASSET_TYPE_ID); // returns nullptr, or a mint
1767 
1768  EXPORT static std::string LoadAssetContract(
1769  const std::string& ASSET_TYPE_ID); // returns nullptr, or an asset
1770  // contract.
1771 
1772  EXPORT static std::string LoadServerContract(
1773  const std::string& SERVER_ID); // returns nullptr, or a server contract.
1774 
1777  //
1778  EXPORT static bool Mint_IsStillGood(const std::string& SERVER_ID,
1779  const std::string& ASSET_TYPE_ID);
1780 
1787  EXPORT static bool IsBasketCurrency(
1788  const std::string& ASSET_TYPE_ID); // returns OT_BOOL (OT_TRUE or
1789  // OT_FALSE aka 1 or 0.)
1790 
1797  EXPORT static int32_t Basket_GetMemberCount(
1798  const std::string& BASKET_ASSET_TYPE_ID);
1799 
1805  EXPORT static std::string Basket_GetMemberType(
1806  const std::string& BASKET_ASSET_TYPE_ID, const int32_t& nIndex);
1807 
1819  EXPORT static int64_t Basket_GetMinimumTransferAmount(
1820  const std::string& BASKET_ASSET_TYPE_ID);
1821 
1835  EXPORT static int64_t Basket_GetMemberMinimumTransferAmount(
1836  const std::string& BASKET_ASSET_TYPE_ID, const int32_t& nIndex);
1837 
1845  EXPORT static std::string LoadAssetAccount(
1846  const std::string& SERVER_ID, const std::string& USER_ID,
1847  const std::string& ACCOUNT_ID); // Returns nullptr, or an account.
1848 
1849  EXPORT static std::string LoadInbox(
1850  const std::string& SERVER_ID, const std::string& USER_ID,
1851  const std::string& ACCOUNT_ID); // Returns nullptr, or an inbox.
1852 
1853  EXPORT static std::string LoadOutbox(
1854  const std::string& SERVER_ID, const std::string& USER_ID,
1855  const std::string& ACCOUNT_ID); // returns nullptr, or an outbox.
1856 
1858  //
1859  EXPORT static std::string LoadInboxNoVerify(
1860  const std::string& SERVER_ID, const std::string& USER_ID,
1861  const std::string& ACCOUNT_ID); // Returns nullptr, or an inbox.
1862 
1863  EXPORT static std::string LoadOutboxNoVerify(
1864  const std::string& SERVER_ID, const std::string& USER_ID,
1865  const std::string& ACCOUNT_ID); // returns nullptr, or an outbox.
1866 
1867  // from local storage.
1868  EXPORT static std::string LoadPaymentInbox(
1869  const std::string& SERVER_ID,
1870  const std::string& USER_ID); // Returns nullptr, or a payment inbox.
1871 
1872  EXPORT static std::string LoadPaymentInboxNoVerify(
1873  const std::string& SERVER_ID,
1874  const std::string& USER_ID); // Returns nullptr, or a payment inbox.
1875 
1877  // depending
1879  // from local storage.
1880  EXPORT static std::string LoadRecordBox(
1881  const std::string& SERVER_ID, const std::string& USER_ID,
1882  const std::string& ACCOUNT_ID); // Returns nullptr, or a RecordBox.
1883 
1884  EXPORT static std::string LoadRecordBoxNoVerify(
1885  const std::string& SERVER_ID, const std::string& USER_ID,
1886  const std::string& ACCOUNT_ID); // Returns nullptr, or a RecordBox.
1887 
1888  EXPORT static bool ClearRecord(
1889  const std::string& SERVER_ID, const std::string& USER_ID,
1890  const std::string& ACCOUNT_ID, // USER_ID can be passed here as well.
1891  const int32_t& nIndex,
1892  const bool& bClearAll // if true, nIndex is ignored.
1893  );
1894 
1895  // The expired box is only for incoming/outgoing payments that expired
1896  // before proecssing.
1897  //
1898  // (It doesn't apply to asset account inbox/outbox because those receipts
1899  // have already processed and thus cannot ever expire.)
1900  //
1901  // Whereas an incoming cheque can be left in the payments inbox and THEN
1902  // expire -- so this is where it will go when the user records the payment;
1903  // instead of putting it in the record box, we put it here. That way we
1904  // can tell which ones have actually expired, versus the ones that "expired"
1905  // AFTER they were put into the record box. (Meaning they never expired, but
1906  // they just seem that way because the "to" date passed sometime AFTER going
1907  // into the record box.) Whereas the expired box is for payments that
1908  // expired
1909  // BEFORE going into the record box. Basically, when you call RecordPayment,
1910  // if the instrument is expired BEFORE being recorded, it goes into the
1911  // expired
1912  // box -- whereas if it goes into the record box and THEN expires, then we
1913  // know
1914  // it wasn't expired at the time that it was recorded.)
1915  //
1916  EXPORT static std::string LoadExpiredBox(
1917  const std::string& SERVER_ID,
1918  const std::string& USER_ID); // Returns nullptr, or an ExpiredBox
1919 
1920  EXPORT static std::string LoadExpiredBoxNoVerify(
1921  const std::string& SERVER_ID,
1922  const std::string& USER_ID); // Returns nullptr, or a ExpiredBox.
1923 
1924  EXPORT static bool ClearExpired(
1925  const std::string& SERVER_ID, const std::string& USER_ID,
1926  const int32_t& nIndex,
1927  const bool& bClearAll // if true, nIndex is ignored.
1928  );
1929 
1931  EXPORT static int32_t Ledger_GetCount(
1932  const std::string& SERVER_ID, const std::string& USER_ID,
1933  const std::string& ACCOUNT_ID,
1934  const std::string& THE_LEDGER); // Returns number of transactions
1935  // within.
1936 
1938  // so you can
1940  // ledger
1942  // response.)
1943  //
1944  EXPORT static std::string Ledger_CreateResponse(
1945  const std::string& SERVER_ID, const std::string& USER_ID,
1946  const std::string& ACCOUNT_ID, const std::string& ORIGINAL_LEDGER);
1947 
1950  //
1951  EXPORT static std::string Ledger_GetTransactionByIndex(
1952  const std::string& SERVER_ID, const std::string& USER_ID,
1953  const std::string& ACCOUNT_ID, const std::string& THE_LEDGER,
1954  const int32_t& nIndex); // returns transaction by index.
1955 
1956  EXPORT static std::string Ledger_GetTransactionByID(
1957  const std::string& SERVER_ID, const std::string& USER_ID,
1958  const std::string& ACCOUNT_ID, const std::string& THE_LEDGER,
1959  const int64_t& TRANSACTION_NUMBER); // returns transaction by ID.
1960 
1961  EXPORT static int64_t Ledger_GetTransactionIDByIndex(
1962  const std::string& SERVER_ID, const std::string& USER_ID,
1963  const std::string& ACCOUNT_ID, const std::string& THE_LEDGER,
1964  const int32_t& nIndex); // returns transaction number by index.
1965 
1967  //
1968  EXPORT static std::string Ledger_AddTransaction(
1969  const std::string& SERVER_ID, const std::string& USER_ID,
1970  const std::string& ACCOUNT_ID, const std::string& THE_LEDGER,
1971  const std::string& THE_TRANSACTION);
1972 
1977  //
1978  EXPORT static std::string Transaction_CreateResponse(
1979  const std::string& SERVER_ID, const std::string& USER_ID,
1980  const std::string& ACCOUNT_ID,
1981  const std::string& RESPONSE_LEDGER, // To be sent to the server...
1982  const std::string& ORIGINAL_TRANSACTION, // Responding to...?
1983  const bool& BOOL_DO_I_ACCEPT);
1984 
2001  EXPORT static std::string Ledger_FinalizeResponse(
2002  const std::string& SERVER_ID, const std::string& USER_ID,
2003  const std::string& ACCOUNT_ID,
2004  const std::string& THE_LEDGER // 'Response' ledger be sent to the
2005  // server...
2006  );
2007 
2049  EXPORT static std::string Ledger_GetInstrument(
2050  const std::string& SERVER_ID, const std::string& USER_ID,
2051  const std::string& ACCOUNT_ID, const std::string& THE_LEDGER,
2052  const int32_t& nIndex); // returns financial instrument by index of the
2053  // transaction it's in.
2054 
2055  // NOTE: If an instrument is already expired when this function is called,
2056  // it will be moved
2057  // to the expired box instead of the record box.
2058  EXPORT static bool RecordPayment(
2059  const std::string& SERVER_ID, const std::string& USER_ID,
2060  const bool& bIsInbox, // true == payments inbox. false == payments
2061  // outbox.
2062  const int32_t& nIndex, // removes payment instrument (from payments in
2063  // or out box) and moves to record box.
2064  const bool& bSaveCopy); // If false, a copy will NOT be saved in the
2065  // record box.
2066 
2068  //
2069  EXPORT static std::string Transaction_GetType(
2070  const std::string& SERVER_ID, const std::string& USER_ID,
2071  const std::string& ACCOUNT_ID, const std::string& THE_TRANSACTION);
2072 
2074  // replyNotice
2076  // server
2078  // replyNotice,
2080  // notice.
2083  //
2084  EXPORT static int64_t ReplyNotice_GetRequestNum(
2085  const std::string& SERVER_ID, const std::string& USER_ID,
2086  const std::string& THE_TRANSACTION);
2087 
2118  EXPORT static std::string Transaction_GetVoucher(
2119  const std::string& SERVER_ID, const std::string& USER_ID,
2120  const std::string& ACCOUNT_ID, const std::string& THE_TRANSACTION);
2121 
2132  EXPORT static int32_t Transaction_GetSuccess(
2133  const std::string& SERVER_ID, const std::string& USER_ID,
2134  const std::string& ACCOUNT_ID, const std::string& THE_TRANSACTION);
2135 
2136  EXPORT static int32_t Transaction_IsCanceled(
2137  const std::string& SERVER_ID, const std::string& USER_ID,
2138  const std::string& ACCOUNT_ID, const std::string& THE_TRANSACTION);
2139 
2146  EXPORT static int32_t Transaction_GetBalanceAgreementSuccess(
2147  const std::string& SERVER_ID, const std::string& USER_ID,
2148  const std::string& ACCOUNT_ID, const std::string& THE_TRANSACTION);
2149 
2155  EXPORT static time64_t Transaction_GetDateSigned(
2156  const std::string& SERVER_ID, const std::string& USER_ID,
2157  const std::string& ACCOUNT_ID, const std::string& THE_TRANSACTION);
2158 
2159  EXPORT static int64_t Transaction_GetAmount(
2160  const std::string& SERVER_ID, const std::string& USER_ID,
2161  const std::string& ACCOUNT_ID, const std::string& THE_TRANSACTION);
2162 
2173  EXPORT static std::string Pending_GetNote(
2174  const std::string& SERVER_ID, const std::string& USER_ID,
2175  const std::string& ACCOUNT_ID, const std::string& THE_TRANSACTION);
2176 
2177  EXPORT static std::string Transaction_GetSenderUserID(
2178  const std::string& SERVER_ID, const std::string& USER_ID,
2179  const std::string& ACCOUNT_ID, const std::string& THE_TRANSACTION);
2180 
2181  EXPORT static std::string Transaction_GetSenderAcctID(
2182  const std::string& SERVER_ID, const std::string& USER_ID,
2183  const std::string& ACCOUNT_ID, const std::string& THE_TRANSACTION);
2184 
2185  EXPORT static std::string Transaction_GetRecipientUserID(
2186  const std::string& SERVER_ID, const std::string& USER_ID,
2187  const std::string& ACCOUNT_ID, const std::string& THE_TRANSACTION);
2188 
2189  EXPORT static std::string Transaction_GetRecipientAcctID(
2190  const std::string& SERVER_ID, const std::string& USER_ID,
2191  const std::string& ACCOUNT_ID, const std::string& THE_TRANSACTION);
2192 
2200  EXPORT static int64_t Transaction_GetDisplayReferenceToNum(
2201  const std::string& SERVER_ID, const std::string& USER_ID,
2202  const std::string& ACCOUNT_ID, const std::string& THE_TRANSACTION);
2203 
2246  EXPORT static bool SavePurse(const std::string& SERVER_ID,
2247  const std::string& ASSET_TYPE_ID,
2248  const std::string& USER_ID,
2249  const std::string& THE_PURSE);
2250 
2251  //
2252  EXPORT static std::string CreatePurse(
2253  const std::string& SERVER_ID, const std::string& ASSET_TYPE_ID,
2254  const std::string& OWNER_ID,
2255  const std::string& SIGNER_ID); // returns nullptr, or a purse.
2256 
2257  // Creates a password-protected purse, instead of nym-protected.
2258  //
2259  EXPORT static std::string CreatePurse_Passphrase(
2260  const std::string& SERVER_ID, const std::string& ASSET_TYPE_ID,
2261  const std::string& SIGNER_ID);
2262 
2264  //
2266  //
2267  EXPORT static int64_t Purse_GetTotalValue(const std::string& SERVER_ID,
2268  const std::string& ASSET_TYPE_ID,
2269  const std::string& THE_PURSE);
2270 
2272  //
2273  EXPORT static int32_t Purse_Count(const std::string& SERVER_ID,
2274  const std::string& ASSET_TYPE_ID,
2275  const std::string& THE_PURSE);
2276 
2280  //
2281  EXPORT static bool Purse_HasPassword(const std::string& SERVER_ID,
2282  const std::string& THE_PURSE);
2283 
2286  //
2287  // returns empty string if failure.
2288  //
2289  EXPORT static std::string Purse_Peek(const std::string& SERVER_ID,
2290  const std::string& ASSET_TYPE_ID,
2291  const std::string& OWNER_ID,
2292  const std::string& THE_PURSE);
2293 
2298  // returns nullptr if failure.
2299  EXPORT static std::string Purse_Pop(const std::string& SERVER_ID,
2300  const std::string& ASSET_TYPE_ID,
2301  const std::string& OWNER_OR_SIGNER_ID,
2302  const std::string& THE_PURSE);
2303 
2306  // Returns nullptr if failure.
2307  EXPORT static std::string Purse_Push(
2308  const std::string& SERVER_ID, const std::string& ASSET_TYPE_ID,
2309  const std::string& SIGNER_ID, // The purse, in order to be changed, must
2310  // be re-signed, which requires a private
2311  // Nym. Even if the purse is
2312  // password-protected, then there's no
2313  // owner, but you still need to pass a Nym
2314  // in here to sign it (doesn't really
2315  // matter which one, but must have private
2316  // key for signing.)
2317  const std::string& OWNER_ID, // If the purse is password-protected, then
2318  // there's no owner, and this owner
2319  // parameter should be nullptr. However, if
2320  // the purse DOES have a Nym owner, then
2321  // you MUST pass the owner's Nym ID here,
2322  // in order for this action to be
2323  // successful. Furthermore, the public key
2324  // for that Nym must be available, in order
2325  // to encrypt the token being pushed into
2326  // the purse. (Private key NOT necessary
2327  // for owner, in this case.)
2328  const std::string& THE_PURSE, const std::string& THE_TOKEN);
2329 
2379  EXPORT static std::string Purse_Empty(const std::string& SERVER_ID,
2380  const std::string& ASSET_TYPE_ID,
2381  const std::string& SIGNER_ID,
2382  const std::string& THE_PURSE);
2383 
2384  // Returns OT_BOOL
2386  EXPORT static bool Wallet_ImportPurse(
2387  const std::string& SERVER_ID, const std::string& ASSET_TYPE_ID,
2388  const std::string& USER_ID, // you pass in the purse you're trying to
2389  // import
2390  const std::string& THE_PURSE // It should either have your User ID on
2391  // it, or the key should be inside so you
2392  // can import.
2393  );
2394 
2413  EXPORT static int32_t exchangePurse(const std::string& SERVER_ID,
2414  const std::string& ASSET_TYPE_ID,
2415  const std::string& USER_ID,
2416  const std::string& THE_PURSE);
2417 
2422  EXPORT static std::string Token_ChangeOwner(
2423  const std::string& SERVER_ID, const std::string& ASSET_TYPE_ID,
2424  const std::string& THE_TOKEN, const std::string& SIGNER_NYM_ID,
2425  const std::string& OLD_OWNER, // Pass a NymID here as a string, or a
2426  // purse. (IF symmetrically encrypted, the
2427  // relevant key is in the purse.)
2428  const std::string& NEW_OWNER // Pass a NymID here as a string, or a
2429  // purse. (IF symmetrically encrypted, the
2430  // relevant key is in the purse.)
2431  );
2432 
2439  EXPORT static std::string Token_GetID(const std::string& SERVER_ID,
2440  const std::string& ASSET_TYPE_ID,
2441  const std::string& THE_TOKEN);
2442 
2444  //
2445  EXPORT static int64_t Token_GetDenomination(
2446  const std::string& SERVER_ID, const std::string& ASSET_TYPE_ID,
2447  const std::string& THE_TOKEN);
2448 
2449  EXPORT static int32_t Token_GetSeries(const std::string& SERVER_ID,
2450  const std::string& ASSET_TYPE_ID,
2451  const std::string& THE_TOKEN);
2452 
2454  //
2455  EXPORT static time64_t Token_GetValidFrom(const std::string& SERVER_ID,
2456  const std::string& ASSET_TYPE_ID,
2457  const std::string& THE_TOKEN);
2458 
2459  // the date is seconds since Jan 1970.
2460  //
2461  EXPORT static time64_t Token_GetValidTo(const std::string& SERVER_ID,
2462  const std::string& ASSET_TYPE_ID,
2463  const std::string& THE_TOKEN);
2464 
2465  EXPORT static std::string Token_GetAssetID(const std::string& THE_TOKEN);
2466  EXPORT static std::string Token_GetServerID(const std::string& THE_TOKEN);
2467 
2483  EXPORT static int64_t Instrmnt_GetAmount(const std::string& THE_INSTRUMENT);
2484  EXPORT static int64_t Instrmnt_GetTransNum(
2485  const std::string& THE_INSTRUMENT);
2486  EXPORT static time64_t Instrmnt_GetValidFrom(
2487  const std::string& THE_INSTRUMENT);
2488  EXPORT static time64_t Instrmnt_GetValidTo(
2489  const std::string& THE_INSTRUMENT);
2490  EXPORT static std::string Instrmnt_GetMemo(
2491  const std::string& THE_INSTRUMENT);
2492  EXPORT static std::string Instrmnt_GetType(
2493  const std::string& THE_INSTRUMENT);
2494  EXPORT static std::string Instrmnt_GetServerID(
2495  const std::string& THE_INSTRUMENT);
2496  EXPORT static std::string Instrmnt_GetAssetID(
2497  const std::string& THE_INSTRUMENT);
2498  EXPORT static std::string Instrmnt_GetSenderUserID(
2499  const std::string& THE_INSTRUMENT);
2500  EXPORT static std::string Instrmnt_GetSenderAcctID(
2501  const std::string& THE_INSTRUMENT);
2502  EXPORT static std::string Instrmnt_GetRemitterUserID(
2503  const std::string& THE_INSTRUMENT);
2504  EXPORT static std::string Instrmnt_GetRemitterAcctID(
2505  const std::string& THE_INSTRUMENT);
2506  EXPORT static std::string Instrmnt_GetRecipientUserID(
2507  const std::string& THE_INSTRUMENT);
2508  EXPORT static std::string Instrmnt_GetRecipientAcctID(
2509  const std::string& THE_INSTRUMENT);
2510 
2511  // *** MESSAGES BEING SENT TO THE SERVER -- BELOW!!! ***
2512 
2542  // Returns int32_t:
2543  // -1 means error; no message was sent.
2544  // -2 means the message was sent, but the request number must be passed as a
2545  // string, so call GetLargeRequestNum.
2546  // 0 means NO error, but also: no message was sent.
2547  // >0 means NO error, and the message was sent, and the request number fits
2548  // into an integer...
2549  // ...and in fact the requestNum IS the return value!
2550  // ===> In 99% of cases, this LAST option is what actually happens!!
2551  //
2552  EXPORT static int32_t checkServerID(const std::string& SERVER_ID,
2553  const std::string& USER_ID);
2554 
2591  // Returns int32_t:
2592  // -1 means error; no message was sent.
2593  // -2 means the message was sent, but the request number must be passed as a
2594  // string, so call GetLargeRequestNum.
2595  // 0 means NO error, but also: no message was sent.
2596  // >0 means NO error, and the message was sent, and the request number fits
2597  // into an integer...
2598  // ...and in fact the requestNum IS the return value!
2599  // ===> In 99% of cases, this LAST option is what actually happens!!
2600  //
2601  EXPORT static int32_t createUserAccount(const std::string& SERVER_ID,
2602  const std::string& USER_ID);
2603 
2620  EXPORT static int32_t deleteUserAccount(const std::string& SERVER_ID,
2621  const std::string& USER_ID);
2622 
2637  EXPORT static int32_t deleteAssetAccount(const std::string& SERVER_ID,
2638  const std::string& USER_ID,
2639  const std::string& ACCOUNT_ID);
2640 
2681  // Returns int32_t:
2682  // -1 means error; no message was sent.
2683  // -2 means the message was sent, but the request number must be passed as a
2684  // string, so call GetLargeRequestNum.
2685  // 0 means NO error, but also: no message was sent.
2686  // >0 means NO error, and the message was sent, and the request number fits
2687  // into an integer...
2688  // ...and in fact the requestNum IS the return value!
2689  // ===> In 99% of cases, this LAST option is what actually happens!!
2690  //
2691  EXPORT static int32_t usageCredits(const std::string& SERVER_ID,
2692  const std::string& USER_ID,
2693  const std::string& USER_ID_CHECK,
2694  const int64_t& ADJUSTMENT);
2695 
2703  EXPORT static int64_t Message_GetUsageCredits(
2704  const std::string& THE_MESSAGE);
2705 
2723  // Returns int32_t:
2724  // -1 means error; no message was sent.
2725  // -2 means the message was sent, but the request number must be passed as a
2726  // string, so call GetLargeRequestNum.
2727  // 0 means NO error, but also: no message was sent.
2728  // >0 means NO error, and the message was sent, and the request number fits
2729  // into an integer...
2730  // ...and in fact the requestNum IS the return value!
2731  // ===> In 99% of cases, this LAST option is what actually happens!!
2732  //
2733  EXPORT static int32_t checkUser(const std::string& SERVER_ID,
2734  const std::string& USER_ID,
2735  const std::string& USER_ID_CHECK);
2736 
2752  // Returns int32_t:
2753  // -1 means error; no message was sent.
2754  // -2 means the message was sent, but the request number must be passed as a
2755  // string, so call GetLargeRequestNum.
2756  // 0 means NO error, but also: no message was sent.
2757  // >0 means NO error, and the message was sent, and the request number fits
2758  // into an integer...
2759  // ...and in fact the requestNum IS the return value!
2760  // ===> In 99% of cases, this LAST option is what actually happens!!
2761  //
2762  EXPORT static int32_t sendUserMessage(const std::string& SERVER_ID,
2763  const std::string& USER_ID,
2764  const std::string& USER_ID_RECIPIENT,
2765  const std::string& RECIPIENT_PUBKEY,
2766  const std::string& THE_MESSAGE);
2800  // Returns int32_t:
2801  // -1 means error; no message was sent.
2802  // -2 means the message was sent, but the request number must be passed as a
2803  // string, so call GetLargeRequestNum.
2804  // 0 means NO error, but also: no message was sent.
2805  // >0 means NO error, and the message was sent, and the request number fits
2806  // into an integer...
2807  // ...and in fact the requestNum IS the return value!
2808  // ===> In 99% of cases, this LAST option is what actually happens!!
2809  //
2810  EXPORT static int32_t sendUserInstrument(
2811  const std::string& SERVER_ID, const std::string& USER_ID,
2812  const std::string& USER_ID_RECIPIENT,
2813  const std::string& RECIPIENT_PUBKEY, const std::string& THE_INSTRUMENT,
2814  const std::string& INSTRUMENT_FOR_SENDER // Can be empty. Optional. Only
2815  // used in the case of cash
2816  // purses.
2817  );
2818 
2840  // Returns int32_t:
2841  // -1 means error; no message was sent.
2842  // -2 means the message was sent, but the request number must be passed as a
2843  // string, so call GetLargeRequestNum.
2844  // 0 means NO error, but also: no message was sent.
2845  // >0 means NO error, and the message was sent, and the request number fits
2846  // into an integer...
2847  // ...and in fact the requestNum IS the return value!
2848  // ===> In 99% of cases, this LAST option is what actually happens!!
2849  //
2850  EXPORT static int32_t getRequest(const std::string& SERVER_ID,
2851  const std::string& USER_ID);
2852 
2869  // Returns int32_t:
2870  // -1 means error; no message was sent.
2871  // -2 means the message was sent, but the request number must be passed as a
2872  // string, so call GetLargeRequestNum.
2873  // 0 means NO error, but also: no message was sent.
2874  // >0 means NO error, and the message was sent, and the request number fits
2875  // into an integer...
2876  // ...and in fact the requestNum IS the return value!
2877  // ===> In 99% of cases, this LAST option is what actually happens!!
2878  //
2879  EXPORT static int32_t getTransactionNumber(const std::string& SERVER_ID,
2880  const std::string& USER_ID);
2881 
2899  EXPORT static int32_t issueAssetType(const std::string& SERVER_ID,
2900  const std::string& USER_ID,
2901  const std::string& THE_CONTRACT);
2902 
2917  EXPORT static int32_t getContract(const std::string& SERVER_ID,
2918  const std::string& USER_ID,
2919  const std::string& ASSET_ID);
2920 
2937  EXPORT static int32_t getMint(const std::string& SERVER_ID,
2938  const std::string& USER_ID,
2939  const std::string& ASSET_ID);
2940 
2956  EXPORT static int32_t createAssetAccount(const std::string& SERVER_ID,
2957  const std::string& USER_ID,
2958  const std::string& ASSET_ID);
2959 
2977  // NOTE: Deprecated. Replaced by getAccountFiles.
2978  EXPORT static int32_t getAccount(const std::string& SERVER_ID,
2979  const std::string& USER_ID,
2980  const std::string& ACCT_ID);
2981 
2982  EXPORT static int32_t getAccountFiles(const std::string& SERVER_ID,
2983  const std::string& USER_ID,
2984  const std::string& ACCT_ID);
2985 
2995  EXPORT static std::string GenerateBasketCreation(
2996  const std::string& USER_ID,
2997  const int64_t& MINIMUM_TRANSFER // If basket is X=2,3,4, then this is X.
2998  );
2999 
3010  EXPORT static std::string AddBasketCreationItem(
3011  const std::string& USER_ID, // for signature.
3012  const std::string& THE_BASKET, // created in above call.
3013  const std::string& ASSET_TYPE_ID, // Adding an asset type to the new
3014  // basket.
3015  const int64_t& MINIMUM_TRANSFER // If basket is 5=X,X,X then this is an
3016  // X.
3017  );
3018 
3048  EXPORT static int32_t issueBasket(const std::string& SERVER_ID,
3049  const std::string& USER_ID,
3050  const std::string& THE_BASKET);
3051 
3061  EXPORT static std::string GenerateBasketExchange(
3062  const std::string& SERVER_ID, const std::string& USER_ID,
3063  const std::string& BASKET_ASSET_TYPE_ID,
3064  const std::string& BASKET_ASSET_ACCT_ID,
3065  const int32_t& TRANSFER_MULTIPLE);
3066 
3069 
3080  EXPORT static std::string AddBasketExchangeItem(
3081  const std::string& SERVER_ID, const std::string& USER_ID,
3082  const std::string& THE_BASKET, const std::string& ASSET_TYPE_ID,
3083  const std::string& ASSET_ACCT_ID);
3084 
3121  EXPORT static int32_t exchangeBasket(
3122  const std::string& SERVER_ID, const std::string& USER_ID,
3123  const std::string& BASKET_ASSET_ID, const std::string& THE_BASKET,
3124  const bool& BOOL_EXCHANGE_IN_OR_OUT // exchanging in == OT_TRUE, out ==
3125  // OT_FALSE.
3126  );
3127 
3160  EXPORT static int32_t notarizeWithdrawal(const std::string& SERVER_ID,
3161  const std::string& USER_ID,
3162  const std::string& ACCT_ID,
3163  const int64_t& AMOUNT);
3164 
3183  EXPORT static int32_t notarizeDeposit(const std::string& SERVER_ID,
3184  const std::string& USER_ID,
3185  const std::string& ACCT_ID,
3186  const std::string& THE_PURSE);
3187 
3211  EXPORT static int32_t notarizeTransfer(const std::string& SERVER_ID,
3212  const std::string& USER_ID,
3213  const std::string& ACCT_FROM,
3214  const std::string& ACCT_TO,
3215  const int64_t& AMOUNT,
3216  const std::string& NOTE);
3217 
3285  // Returns int32_t:
3286  // -1 means error; no message was sent.
3287  // -2 means the message was sent, but the request number must be passed as a
3288  // string, so call GetLargeRequestNum.
3289  // 0 means NO error, but also: no message was sent.
3290  // >0 means NO error, and the message was sent, and the request number fits
3291  // into an integer...
3292  // ...and in fact the requestNum IS the return value!
3293  // ===> In 99% of cases, this LAST option is what actually happens!!
3294  //
3295  // NOTE: Deprecated. Replaced by getAccountFiles.
3296  EXPORT static int32_t getInbox(const std::string& SERVER_ID,
3297  const std::string& USER_ID,
3298  const std::string& ACCT_ID);
3299 
3300  // Returns int32_t:
3301  // -1 means error; no message was sent.
3302  // -2 means the message was sent, but the request number must be passed as a
3303  // string, so call GetLargeRequestNum.
3304  // 0 means NO error, but also: no message was sent.
3305  // >0 means NO error, and the message was sent, and the request number fits
3306  // into an integer...
3307  // ...and in fact the requestNum IS the return value!
3308  // ===> In 99% of cases, this LAST option is what actually happens!!
3309  //
3310  // NOTE: Deprecated. Replaced by getAccountFiles.
3311  EXPORT static int32_t getOutbox(const std::string& SERVER_ID,
3312  const std::string& USER_ID,
3313  const std::string& ACCT_ID);
3314 
3315  // from server (pop message buf for the response)
3316  // Returns int32_t:
3317  // -1 means error; no message was sent.
3318  // -2 means the message was sent, but the request number must be passed as a
3319  // string, so call GetLargeRequestNum.
3320  // 0 means NO error, but also: no message was sent.
3321  // >0 means NO error, and the message was sent, and the request number fits
3322  // into an integer...
3323  // ...and in fact the requestNum IS the return value!
3324  // ===> In 99% of cases, this LAST option is what actually happens!!
3325  //
3326  EXPORT static int32_t getNymbox(const std::string& SERVER_ID,
3327  const std::string& USER_ID);
3328 
3329  // from local storage.
3330  EXPORT static std::string LoadNymbox(const std::string& SERVER_ID,
3331  const std::string& USER_ID); // Returns
3332  // nullptr,
3333  // or a
3334  // Nymbox.
3335 
3336  EXPORT static std::string LoadNymboxNoVerify(
3337  const std::string& SERVER_ID,
3338  const std::string& USER_ID); // Returns nullptr, or a Nymbox.
3339 
3356  EXPORT static std::string Nymbox_GetReplyNotice(
3357  const std::string& SERVER_ID, const std::string& USER_ID,
3358  const int64_t& REQUEST_NUMBER); // returns replyNotice transaction by
3359  // requestNumber.
3360 
3394  EXPORT static bool HaveAlreadySeenReply(
3395  const std::string& SERVER_ID, const std::string& USER_ID,
3396  const int64_t& REQUEST_NUMBER); // returns OT_BOOL
3397 
3413  // Returns int32_t:
3414  // -1 means error; no message was sent.
3415  // -2 means the message was sent, but the request number must be passed as a
3416  // string, so call GetLargeRequestNum.
3417  // 0 means NO error, but also: no message was sent.
3418  // >0 means NO error, and the message was sent, and the request number fits
3419  // into an integer...
3420  // ...and in fact the requestNum IS the return value!
3421  // ===> In 99% of cases, this LAST option is what actually happens!!
3422  //
3423  EXPORT static int32_t getBoxReceipt(
3424  const std::string& SERVER_ID, const std::string& USER_ID,
3425  const std::string& ACCOUNT_ID, // If for Nymbox (vs inbox/outbox) then
3426  // pass USER_ID in this field also.
3427  const int32_t& nBoxType, // 0/nymbox, 1/inbox, 2/outbox
3428  const int64_t& TRANSACTION_NUMBER);
3429 
3430  //
3431  EXPORT static bool DoesBoxReceiptExist(
3432  const std::string& SERVER_ID,
3433  const std::string& USER_ID, // Unused here for now, but still
3434  // convention.
3435  const std::string& ACCOUNT_ID, // If for Nymbox (vs inbox/outbox) then
3436  // pass USER_ID in this field also.
3437  const int32_t& nBoxType, // 0/nymbox, 1/inbox, 2/outbox
3438  const int64_t& TRANSACTION_NUMBER);
3439 
3458  // Returns int32_t:
3459  // -1 means error; no message was sent.
3460  // -2 means the message was sent, but the request number must be passed as a
3461  // string, so call GetLargeRequestNum.
3462  // 0 means NO error, but also: no message was sent.
3463  // >0 means NO error, and the message was sent, and the request number fits
3464  // into an integer...
3465  // ...and in fact the requestNum IS the return value!
3466  // ===> In 99% of cases, this LAST option is what actually happens!!
3467  //
3468  EXPORT static int32_t processInbox(const std::string& SERVER_ID,
3469  const std::string& USER_ID,
3470  const std::string& ACCT_ID,
3471  const std::string& ACCT_LEDGER);
3472 
3487  EXPORT static int32_t processNymbox(const std::string& SERVER_ID,
3488  const std::string& USER_ID);
3489 
3511  EXPORT static int32_t withdrawVoucher(const std::string& SERVER_ID,
3512  const std::string& USER_ID,
3513  const std::string& ACCT_ID,
3514  const std::string& RECIPIENT_USER_ID,
3515  const std::string& CHEQUE_MEMO,
3516  const int64_t& AMOUNT);
3517 
3519  //
3520  EXPORT static int32_t payDividend(
3521  const std::string& SERVER_ID,
3522  const std::string& ISSUER_USER_ID, // must be issuer of
3523  // SHARES_ASSET_TYPE_ID
3524  const std::string& DIVIDEND_FROM_ACCT_ID, // if dollars paid for pepsi
3525  // shares, then this is the
3526  // issuer's dollars account.
3527  const std::string& SHARES_ASSET_TYPE_ID, // if dollars paid for pepsi
3528  // shares, then this is the
3529  // pepsi shares asset type id.
3530  const std::string& DIVIDEND_MEMO, // user-configurable note that's added
3531  // to the payout request message.
3532  const int64_t& AMOUNT_PER_SHARE // number of dollars to be paid out PER
3533  // SHARE (multiplied by total number of
3534  // shares issued.)
3535  );
3536 
3558  EXPORT static int32_t depositCheque(const std::string& SERVER_ID,
3559  const std::string& USER_ID,
3560  const std::string& ACCT_ID,
3561  const std::string& THE_CHEQUE);
3562 
3579  EXPORT static int32_t depositPaymentPlan(
3580  const std::string& SERVER_ID, const std::string& USER_ID,
3581  const std::string& THE_PAYMENT_PLAN);
3582 
3596  EXPORT static int32_t issueMarketOffer(
3597  const std::string& ASSET_ACCT_ID, // Perhaps this is the wheat market.
3598  const std::string& CURRENCY_ACCT_ID, // Perhaps I'm buying the wheat
3599  // with rubles.
3600  const int64_t& MARKET_SCALE, // Defaults to minimum of 1. Market
3601  // granularity.
3602  const int64_t& MINIMUM_INCREMENT, // This will be multiplied by the
3603  // Scale. Min 1.
3604  const int64_t& TOTAL_ASSETS_ON_OFFER, // Total assets available for sale
3605  // or purchase. Will be multiplied
3606  // by minimum increment.
3607  const int64_t& PRICE_LIMIT, // Per Minimum Increment...
3608  const bool& bBuyingOrSelling, // SELLING == true, BUYING == false.
3609  const time64_t& LIFESPAN_IN_SECONDS, // Pass 0 for the default behavior:
3610  // 86400 seconds aka 1 day.
3611  const std::string& STOP_SIGN, // Must be "" (for market/limit orders) or
3612  // "<" or ">" (for stop orders.)
3613  const int64_t& ACTIVATION_PRICE); // Must be provided if STOP_SIGN is
3614  // also set. Determines the price
3615  // threshold for stop orders.
3616 
3647  //
3649  // Returns int32_t:
3650  // -1 means error; no message was sent.
3651  // -2 means the message was sent, but the request number must be passed as a
3652  // string, so call GetLargeRequestNum.
3653  // 0 means NO error, but also: no message was sent.
3654  // >0 means NO error, and the message was sent, and the request number fits
3655  // into an integer...
3656  // ...and in fact the requestNum IS the return value!
3657  // ===> In 99% of cases, this LAST option is what actually happens!!
3658  //
3659  EXPORT static int32_t getMarketList(const std::string& SERVER_ID,
3660  const std::string& USER_ID);
3661 
3663  // maximum depth)
3664  // Returns int32_t:
3665  // -1 means error; no message was sent.
3666  // -2 means the message was sent, but the request number must be passed as a
3667  // string, so call GetLargeRequestNum.
3668  // 0 means NO error, but also: no message was sent.
3669  // >0 means NO error, and the message was sent, and the request number fits
3670  // into an integer...
3671  // ...and in fact the requestNum IS the return value!
3672  // ===> In 99% of cases, this LAST option is what actually happens!!
3673  //
3674  EXPORT static int32_t getMarketOffers(
3675  const std::string& SERVER_ID, const std::string& USER_ID,
3676  const std::string& MARKET_ID, const int64_t& MAX_DEPTH // Market Depth
3677  );
3678 
3680  // Returns int32_t:
3681  // -1 means error; no message was sent.
3682  // -2 means the message was sent, but the request number must be passed as a
3683  // string, so call GetLargeRequestNum.
3684  // 0 means NO error, but also: no message was sent.
3685  // >0 means NO error, and the message was sent, and the request number fits
3686  // into an integer...
3687  // ...and in fact the requestNum IS the return value!
3688  // ===> In 99% of cases, this LAST option is what actually happens!!
3689  //
3690  EXPORT static int32_t getMarketRecentTrades(const std::string& SERVER_ID,
3691  const std::string& USER_ID,
3692  const std::string& MARKET_ID);
3693 
3695  // Market_GetOffers() call, which seems similar otherwise.
3696  // Returns int32_t:
3697  // -1 means error; no message was sent.
3698  // -2 means the message was sent, but the request number must be passed as a
3699  // string, so call GetLargeRequestNum.
3700  // 0 means NO error, but also: no message was sent.
3701  // >0 means NO error, and the message was sent, and the request number fits
3702  // into an integer...
3703  // ...and in fact the requestNum IS the return value!
3704  // ===> In 99% of cases, this LAST option is what actually happens!!
3705  //
3706  EXPORT static int32_t getNym_MarketOffers(
3707  const std::string& SERVER_ID,
3708  const std::string& USER_ID); // Offers this Nym has out on market.
3709  // These may just be the Cron Receipts...
3710 
3711  // Returns int32_t:
3712  // -1 means error; no message was sent.
3713  // -2 means the message was sent, but the request number must be passed as a
3714  // string, so call GetLargeRequestNum.
3715  // 0 means NO error, but also: no message was sent.
3716  // >0 means NO error, and the message was sent, and the request number fits
3717  // into an integer...
3718  // ...and in fact the requestNum IS the return value!
3719  // ===> In 99% of cases, this LAST option is what actually happens!!
3720  //
3721  EXPORT static int32_t killMarketOffer(const std::string& SERVER_ID,
3722  const std::string& USER_ID,
3723  const std::string& ASSET_ACCT_ID,
3724  const int64_t& TRANSACTION_NUMBER);
3725 
3726  // Returns int32_t:
3727  // -1 means error; no message was sent.
3728  // -2 means the message was sent, but the request number must be passed as a
3729  // string, so call GetLargeRequestNum.
3730  // 0 means NO error, but also: no message was sent.
3731  // >0 means NO error, and the message was sent, and the request number fits
3732  // into an integer...
3733  // ...and in fact the requestNum IS the return value!
3734  // ===> In 99% of cases, this LAST option is what actually happens!!
3735  //
3736  EXPORT static int32_t killPaymentPlan(const std::string& SERVER_ID,
3737  const std::string& USER_ID,
3738  const std::string& FROM_ACCT_ID,
3739  const int64_t& TRANSACTION_NUMBER);
3740 
3768  EXPORT static std::string PopMessageBuffer(const int64_t& REQUEST_NUMBER,
3769  const std::string& SERVER_ID,
3770  const std::string& USER_ID);
3771 
3772  EXPORT static void FlushMessageBuffer();
3773 
3774  // Outgoing:
3775 
3776  EXPORT static std::string GetSentMessage(const int64_t& REQUEST_NUMBER,
3777  const std::string& SERVER_ID,
3778  const std::string& USER_ID);
3779 
3780  EXPORT static bool RemoveSentMessage(const int64_t& REQUEST_NUMBER,
3781  const std::string& SERVER_ID,
3782  const std::string& USER_ID);
3783 
3784  // Note: Might remove this from API. Basically, the sent messages queue must
3785  // store
3786  // messages (by request number) until we know for SURE whether we have a
3787  // success, a failure,
3788  // or a lost/rejected message. That is, until we DOWNLOAD the Nymbox, and
3789  // thus know for SURE
3790  // that a response to a given message is there...or not. Why do we care? For
3791  // making this
3792  // choice:
3793  //
3794  // Messages that DO have a reply are therefore already "in the system" and
3795  // will be handled
3796  // normally--they can be ignored and flushed from the "sent messages" queue.
3797  // Whereas messages
3798  // that do NOT have a reply in the Nymbox (yet are still in the "sent
3799  // messages" queue) can be
3800  // assumed safely to have been rejected at "message level" (before any
3801  // transaction could
3802  // have processed) and the reply must have been dropped on the network, OR
3803  // the server never
3804  // even received the message in the first place. EITHER WAY the trans #s can
3805  // be harvested
3806  // accordingly and then removed from the sent buffer. In a perfect world
3807  // (read: iteration 2)
3808  // these sent messages will be serialized somehow along with the Nym, and
3809  // not just stored in
3810  // RAM like this version does.
3811 
3841  EXPORT static void FlushSentMessages(
3842  const bool& bHarvestingForRetry, // bHarvestingForRetry is actually
3843  // OT_BOOL
3844  const std::string& SERVER_ID, const std::string& USER_ID,
3845  const std::string& THE_NYMBOX);
3846 
3853  EXPORT static void Sleep(const int64_t& MILLISECONDS);
3854 
3855  /* For emergency/testing use only. This call forces you to trust the server.
3856  You should never need to call this for any normal use, and hopefully
3857  you should never need to actually call it at all, ever. But if your Nym
3858  ever gets out of sync with the server, this will resync it based on
3859  the server's version of the data.
3860 
3861  Note: actually returns OT_BOOL.
3862  */
3863  // Make sure you download your Nymbox (getNymbox) before calling this,
3864  // so when it loads the Nymbox it will have the latest version of it.
3865  //
3866  // Also, call createUserAccount() and pass the server reply message in
3867  // here, so that it can read theMessageNym (to sync the transaction
3868  // numbers.)
3869  //
3870  EXPORT static bool ResyncNymWithServer(const std::string& SERVER_ID,
3871  const std::string& USER_ID,
3872  const std::string& THE_MESSAGE);
3881  EXPORT static std::string Message_GetCommand(
3882  const std::string& THE_MESSAGE);
3889  EXPORT static int32_t Message_GetSuccess(const std::string& THE_MESSAGE);
3906  EXPORT static int32_t queryAssetTypes(const std::string& SERVER_ID,
3907  const std::string& USER_ID,
3908  const std::string& ENCODED_MAP);
3917  EXPORT static std::string Message_GetPayload(
3918  const std::string& THE_MESSAGE);
3947  EXPORT static int32_t Message_GetDepth(const std::string& THE_MESSAGE);
3948 
3955  EXPORT static int32_t Message_GetTransactionSuccess(
3956  const std::string& SERVER_ID, const std::string& USER_ID,
3957  const std::string& ACCOUNT_ID, const std::string& THE_MESSAGE);
3958 
3959  EXPORT static int32_t Message_IsTransactionCanceled(
3960  const std::string& SERVER_ID, const std::string& USER_ID,
3961  const std::string& ACCOUNT_ID, const std::string& THE_MESSAGE);
3968  EXPORT static int32_t Message_GetBalanceAgreementSuccess(
3969  const std::string& SERVER_ID, const std::string& USER_ID,
3970  const std::string& ACCOUNT_ID, const std::string& THE_MESSAGE);
3978  EXPORT static std::string Message_GetLedger(const std::string& THE_MESSAGE);
3979 
3987  EXPORT static std::string Message_GetNewAssetTypeID(
3988  const std::string& THE_MESSAGE);
3989 
3997  EXPORT static std::string Message_GetNewIssuerAcctID(
3998  const std::string& THE_MESSAGE);
3999 
4009  EXPORT static std::string Message_GetNewAcctID(
4010  const std::string& THE_MESSAGE);
4011 
4020  EXPORT static std::string Message_GetNymboxHash(
4021  const std::string& THE_MESSAGE);
4022 
4023 private:
4024  OTAPI_Wrap();
4025  ~OTAPI_Wrap()
4026  {
4027  }
4028 };
4029 
4030 } // namespace opentxs
4031 
4032 #endif // OPENTXS_CLIENT_OTAPI_HPP
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 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
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
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
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
static EXPORT bool AppCleanup()
Definition: OTAPI.cpp:189
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
static EXPORT std::string ProposePaymentPlan(const std::string &SERVER_ID, 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 &PLAN_CONSIDERATION, const std::string &RECIPIENT_ACCT_ID, const std::string &RECIPIENT_USER_ID, const int64_t &INITIAL_PAYMENT_AMOUNT, const time64_t &INITIAL_PAYMENT_DELAY, const int64_t &PAYMENT_PLAN_AMOUNT, const time64_t &PAYMENT_PLAN_DELAY, const time64_t &PAYMENT_PLAN_PERIOD, const time64_t &PAYMENT_PLAN_LENGTH, const int32_t &PAYMENT_PLAN_MAX_PAYMENTS)
Definition: OTAPI.cpp:1076
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
static EXPORT std::string Wallet_GetAssetIDFromPartial(const std::string &PARTIAL_ID)
Definition: OTAPI.cpp:631
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
static EXPORT std::string GetNym_ID(const int32_t &nIndex)
Definition: OTAPI.cpp:643
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
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
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
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
static EXPORT std::string LoadPaymentInbox(const std::string &SERVER_ID, const std::string &USER_ID)
Definition: OTAPI.cpp:1553
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
static EXPORT std::string GetNym_OutmailContentsByIndex(const std::string &NYM_ID, const int32_t &nIndex)
Definition: OTAPI.cpp:728
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
static EXPORT int32_t GetServerCount()
Definition: OTAPI.cpp:516
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
static EXPORT bool LoadWallet()
Definition: OTAPI.cpp:289
static EXPORT std::string Wallet_GetAccountIDFromPartial(const std::string &PARTIAL_ID)
Definition: OTAPI.cpp:637
static EXPORT std::string Instrmnt_GetAssetID(const std::string &THE_INSTRUMENT)
Definition: OTAPI.cpp:828
static EXPORT uint64_t StringToUlong(const std::string &strNumber)
Definition: OTAPI.cpp:264
static EXPORT std::string Instrmnt_GetRecipientAcctID(const std::string &THE_INSTRUMENT)
Definition: OTAPI.cpp:863
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 UlongToString(const uint64_t &lNumber)
Definition: OTAPI.cpp:269
static EXPORT OTAPI_Exec * It()
Definition: OTAPI.cpp:174
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
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
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
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
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
static EXPORT std::string LoadExpiredBoxNoVerify(const std::string &SERVER_ID, const std::string &USER_ID)
Definition: OTAPI.cpp:1585
static EXPORT std::string PeekMemlogBack()
Definition: OTAPI.cpp:314
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
static EXPORT std::string CalculateAssetContractID(const std::string &str_Contract)
Definition: OTAPI.cpp:455
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 void SetHomeFolder(const std::string &strFolder)
Definition: OTAPI.cpp:234
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
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
int64_t time64_t
Definition: Common.hpp:209
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 Hook_GetClauseCount(const std::string &THE_CONTRACT, const std::string &BYLAW_NAME, const std::string &HOOK_NAME)
Definition: OTAPI.cpp:1326
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
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
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
static EXPORT bool Wallet_ChangePassphrase()
Definition: OTAPI.cpp:614
static EXPORT bool RemoveSentMessage(const int64_t &REQUEST_NUMBER, const std::string &SERVER_ID, const std::string &USER_ID)
Definition: OTAPI.cpp:2351
static EXPORT int64_t GetAccountWallet_Balance(const std::string &ACCOUNT_ID)
Definition: OTAPI.cpp:1032
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
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 std::string CalculateServerContractID(const std::string &str_Contract)
Definition: OTAPI.cpp:461
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
static EXPORT bool Nym_VerifyOutpaymentsByIndex(const std::string &NYM_ID, const int32_t &nIndex)
Definition: OTAPI.cpp:787
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
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
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
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
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
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 OTAPI_Exec * SetExecutor(OTAPI_Exec *exec)
Definition: OTAPI.cpp:151
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
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
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
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
static EXPORT std::string GetNym_CredentialContents(const std::string &NYM_ID, const std::string &CREDENTIAL_ID)
Definition: OTAPI.cpp:397
static EXPORT std::string Encrypt(const std::string &RECIPIENT_NYM_ID, const std::string &strPlaintext)
Definition: OTAPI.cpp:958
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
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
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
static EXPORT bool VerifySignature(const std::string &SIGNER_NYM_ID, const std::string &THE_CONTRACT)
Definition: OTAPI.cpp:1006
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 bool WalletExists()
Definition: OTAPI.cpp:284
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
static EXPORT int32_t AddAssetContract(const std::string &strContract)
Definition: OTAPI.cpp:506
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
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
static EXPORT std::string GetNym_MailServerIDByIndex(const std::string &NYM_ID, const int32_t &nIndex)
Definition: OTAPI.cpp:705
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
static EXPORT bool NumList_VerifyAll(const std::string &strNumList, const std::string &strNumbers)
Definition: OTAPI.cpp:347
static EXPORT std::string Message_GetLedger(const std::string &THE_MESSAGE)
Definition: OTAPI.cpp:2396
static EXPORT bool SetWallet(const std::string &strWalletFilename)
Definition: OTAPI.cpp:279
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
static EXPORT bool PopMemlogBack()
Definition: OTAPI.cpp:324
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 void SetAppBinaryFolder(const std::string &strFolder)
Definition: OTAPI.cpp:210
static EXPORT std::string LongToString(const int64_t &lNumber)
Definition: OTAPI.cpp:259
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
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 std::string GetAssetType_TLA(const std::string &ASSET_TYPE_ID)
Definition: OTAPI.cpp:914
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
static EXPORT int64_t Basket_GetMinimumTransferAmount(const std::string &BASKET_ASSET_TYPE_ID)
Definition: OTAPI.cpp:1996
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
static EXPORT std::string LoadInbox(const std::string &SERVER_ID, const std::string &USER_ID, const std::string &ACCOUNT_ID)
Definition: OTAPI.cpp:1525
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 bool AppInit()
Definition: OTAPI.cpp:179
static EXPORT int64_t StringToLong(const std::string &strNumber)
Definition: OTAPI.cpp:254
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
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
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 bool SwitchWallet()
Definition: OTAPI.cpp:294
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
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
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
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
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
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
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
static EXPORT bool PopMemlogFront()
Definition: OTAPI.cpp:319
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
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 std::string LoadPaymentInboxNoVerify(const std::string &SERVER_ID, const std::string &USER_ID)
Definition: OTAPI.cpp:1559
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
static EXPORT int32_t GetMemlogSize()
Definition: OTAPI.cpp:299
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
static EXPORT std::string GetNym_AltSourceLocation(const std::string &NYM_ID)
Definition: OTAPI.cpp:381
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
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
static EXPORT std::string GetNym_OutmailServerIDByIndex(const std::string &NYM_ID, const int32_t &nIndex)
Definition: OTAPI.cpp:740
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
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
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
static EXPORT std::string Token_GetServerID(const std::string &THE_TOKEN)
Definition: OTAPI.cpp:1975
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
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
static EXPORT OT_API * OTAPI()
Definition: OTAPI.cpp:244
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
static EXPORT OTAPI_Exec * Exec()
Definition: OTAPI.cpp:158
static EXPORT int32_t Party_GetAcctCount(const std::string &THE_CONTRACT, const std::string &PARTY_NAME)
Definition: OTAPI.cpp:1356
static EXPORT std::string GetMemlogAtIndex(const int32_t &nIndex)
Definition: OTAPI.cpp:304
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
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
static EXPORT std::string PeekMemlogFront()
Definition: OTAPI.cpp:309
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
static EXPORT bool IsNym_RegisteredAtServer(const std::string &NYM_ID, const std::string &SERVER_ID)
Definition: OTAPI.cpp:653
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
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
static EXPORT int32_t Party_GetAgentCount(const std::string &THE_CONTRACT, const std::string &PARTY_NAME)
Definition: OTAPI.cpp:1362
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 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
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
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
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
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
static EXPORT bool Purse_HasPassword(const std::string &SERVER_ID, const std::string &THE_PURSE)
Definition: OTAPI.cpp:1850