Open-Transactions  0.93.0-ge03d287
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Pages
OTAgreement.hpp
Go to the documentation of this file.
1 /************************************************************
2  *
3  * OTAgreement.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 // OTAgreement is derived from OTCronItem. It handles re-occuring billing.
134 
135 #ifndef OPENTXS_CORE_OTAGREEMENT_HPP
136 #define OPENTXS_CORE_OTAGREEMENT_HPP
137 
139 
140 namespace opentxs
141 {
142 
143 class OTPseudonym;
144 
145 // An Agreement occurs between TWO PEOPLE, and is for a CONSIDERATION.
146 // Thus, we add the RECIPIENT (already have SENDER from OTTrackable.)
147 //
148 // While other instruments are derived from OTTrackable (like OTCheque) in order
149 // to gain a transaction number and sender user/acct, Agreements are derived
150 // from
151 // a further subclass of trackable: OTCronItem.
152 //
153 // OTCronItems are allowed to be posted on the OTCron object, which performs
154 // regular
155 // processing on a timely basis to the items that are posted there. In this way,
156 // payment authorizations can be posted (and expire properly), and trades can be
157 // posted with valid date ranges, and payment plans can be instituted, and so
158 // on.
159 //
160 // OTAgreement is derived from OTCronItem because it allows people to post
161 // Agreements
162 // on OTCron until a certain expiration period, so that third parties can query
163 // the
164 // server and verify the agreements, and so that copies of the agreement,
165 // stamped
166 // with the server's signature, can be made available to the parties and to 3rd
167 // parties.
168 //
169 class OTAgreement : public OTCronItem
170 {
171 private: // Private prevents erroneous use by other classes.
172  typedef OTCronItem ot_super;
173 
174 private:
175  OTIdentifier m_RECIPIENT_ACCT_ID;
176  OTIdentifier m_RECIPIENT_USER_ID;
177 
178 protected:
179  OTString m_strConsideration; // Presumably an agreement is in return for
180  // some consideration. Memo here.
181 
182  OTString m_strMerchantSignedCopy; // The merchant sends it over, then the
183  // payer confirms it, which adds
184  // his own transaction numbers and signs it. This, unfortunately,
185  // invalidates the merchant's version, so we store
186  // a copy of the merchant's signed agreement INSIDE our own. The server can
187  // do the hard work of comparing them, though
188  // such will probably occur through a comparison function I'll have to add
189  // right here in this class.
190 
191  virtual void onFinalReceipt(OTCronItem& theOrigCronItem,
192  const int64_t& lNewTransactionNumber,
193  OTPseudonym& theOriginator,
194  OTPseudonym* pRemover);
195  virtual void onRemovalFromCron();
196 
197  std::deque<int64_t> m_dequeRecipientClosingNumbers; // Numbers used for
198  // CLOSING a
199  // transaction.
200  // (finalReceipt.)
201 
202 public:
203  const OTString& GetConsideration() const
204  {
205  return m_strConsideration;
206  }
207  void SetMerchantSignedCopy(const OTString& strMerchantCopy)
208  {
209  m_strMerchantSignedCopy = strMerchantCopy;
210  }
212  {
214  }
215 
216  // SetAgreement replaced with the 2 functions below. See notes even lower.
217  //
218  // bool SetAgreement(const int64_t& lTransactionNum, const
219  // OTString& strConsideration,
220  // const time64_t& VALID_FROM=0, const time64_t&
221  // VALID_TO=0);
222 
223  EXPORT bool SetProposal(OTPseudonym& MERCHANT_NYM,
224  const OTString& strConsideration,
225  time64_t VALID_FROM = OT_TIME_ZERO,
226  time64_t VALID_TO = OT_TIME_ZERO);
227 
228  EXPORT bool Confirm(OTPseudonym& PAYER_NYM,
229  OTPseudonym* pMERCHANT_NYM = nullptr,
230  const OTIdentifier* p_id_MERCHANT_NYM =
231  nullptr); // Merchant Nym is passed here so we can
232  // verify the signature before confirming.
233 
234  // What should be the process here?
235 
236  /*
237  FIRST: (Construction)
238  OTAgreement(const OTIdentifier& SERVER_ID, const OTIdentifier&
239  ASSET_ID);
240  OR:
241  OTAgreement(const OTIdentifier& SERVER_ID, const OTIdentifier&
242  ASSET_ID, const OTIdentifier& SENDER_ACCT_ID, const OTIdentifier&
243  SENDER_USER_ID, const OTIdentifier& RECIPIENT_ACCT_ID, const
244  OTIdentifier&
245  RECIPIENT_USER_ID);
246  OR:
247  OTPaymentPlan * pPlan = new OTPaymentPlan(pAccount->GetRealServerID(),
248  pAccount->GetAssetTypeID(),
249  pAccount->GetRealAccountID(),
250  pAccount->GetUserID(),
251  RECIPIENT_ACCT_ID, RECIPIENT_USER_ID);
252  THEN: (Agreement)
253 
254  bool bSuccessSetAgreement = pPlan->SetAgreement(lTransactionNumber,
255  PLAN_CONSIDERATION, VALID_FROM, VALID_TO);
256  THEN, (OTPaymentPlan) adds TWO OPTIONS (additional and independent of each
257  other):
258 
259  bool SetInitialPayment(const int64_t& lAmount, time64_t
260  tTimeUntilInitialPayment=0); // default: now.
261  bool SetPaymentPlan(const int64_t& lPaymentAmount, time64_t
262  tTimeUntilPlanStart=OT_TIME_MONTH_IN_SECONDS,
263  time64_t
264  tBetweenPayments=OT_TIME_MONTH_IN_SECONDS, // Default: 30 days.
265  time64_t tPlanLength=0, int32_t nMaxPayments=0);
266 
267 
268  The new process is the same, but it adds some additional transaction
269  numbers...
270 
271  HERE IS THE WAY I ENVISION IT BEING CALLED:
272 
273  ---- The MERCHANT does these steps: -----
274 
275  Step one, though it says PaymentPlan, is basically the OTAgreement
276  constructor.
277  Its primary concern is with determining the server, payer, payee, accounts,
278  etc.
279 
280  1) OTPaymentPlan * pPlan =
281  new OTPaymentPlan(pAccount->GetRealServerID(),
282  pAccount->GetAssetTypeID(),
283  pAccount->GetRealAccountID(),
284  pAccount->GetUserID(),
285  RECIPIENT_ACCT_ID, RECIPIENT_USER_ID);
286 
287  STILL, this is the MERCHANT. Step two is concerned with the specific terms
288  of the offer.
289 
290  2) bool bOffer =
291  pPlan->SetProposal(MERCHANT_NYM,
292  PLAN_CONSIDERATION, VALID_FROM, VALID_TO);
293  (lMerchantTransactionNumber, lMerchantClosingNumber are set internally
294  using the MERCHANT_NYM.)
295 
296  ==> Optionally, the merchant also calls SetInitialPayment and/or
297  SetPaymentPlan at this time.
298  ==> Next, the merchant signs it, and sends to the recipient.
299 
300  THE RECIPIENT:
301 
302  3) bool bConfirmation = pPlan->Confirm(OTPseudonym& PAYER_NYM,
303  OTPseudonym *
304  pMERCHANT_NYM=nullptr,
305  OTIdentifier *
306  p_id_MERCHANT_NYM=nullptr);
307 
308  (Transaction number and closing number are retrieved from Nym at this
309  time.)
310 
311  NO NEED TO SIGN ANYTHING AFTER THIS POINT, and the Payment Plan should
312  store a copy of itself at this time.
313  (That is, STORE A COPY of the Merchant's signed version, since the above
314  call to Confirm will change the plan
315  and sign it again. The server is left with the chore of comparing the two
316  against each other, which I will
317  probably have to code right here in this class! TOdo.)
318 
319  */
320 
321  // This function verifies both Nyms and both signatures.
322  // Due to the peculiar nature of how OTAgreement/OTPaymentPlan works, there
323  // are two signed
324  // copies stored. The merchant signs first, adding his transaction numbers
325  // (2), and then he
326  // sends it to the customer, who also adds two numbers and signs. (Also
327  // resetting the creation date.)
328  // The problem is, adding the additional transaction numbers invalidates the
329  // first (merchant's)
330  // signature.
331  // The solution is, when the customer confirms the agreement, he stores an
332  // internal copy of the
333  // merchant's signed version. This way later, in VERIFY AGREEMENT, the
334  // internal copy can be loaded,
335  // and BOTH Nyms can be checked to verify that BOTH transaction numbers are
336  // valid for each.
337  // The two versions of the contract can also be compared to each other, to
338  // make sure that none of
339  // the vital terms, values, clauses, etc are different between the two.
340  //
341  virtual bool VerifyAgreement(OTPseudonym& RECIPIENT_NYM,
342  OTPseudonym& SENDER_NYM) const = 0;
343 
344  virtual bool CompareAgreement(const OTAgreement& rhs) const;
345 
346  inline const OTIdentifier& GetRecipientAcctID() const
347  {
348  return m_RECIPIENT_ACCT_ID;
349  }
350  inline const OTIdentifier& GetRecipientUserID() const
351  {
352  return m_RECIPIENT_USER_ID;
353  }
354  inline void SetRecipientAcctID(const OTIdentifier& ACCT_ID)
355  {
356  m_RECIPIENT_ACCT_ID = ACCT_ID;
357  }
358  inline void SetRecipientUserID(const OTIdentifier& USER_ID)
359  {
360  m_RECIPIENT_USER_ID = USER_ID;
361  }
362 
363  // The recipient must also provide an opening and closing transaction
364  // number(s).
365  //
366  EXPORT int64_t GetRecipientClosingTransactionNoAt(uint32_t nIndex) const;
367  EXPORT int32_t GetRecipientCountClosingNumbers() const;
368 
369  void AddRecipientClosingTransactionNo(const int64_t& lClosingTransactionNo);
370 
371  // This is a higher-level than the above functions. It calls them.
372  // Below is the abstraction, above is the implementation.
373 
374  EXPORT int64_t GetRecipientOpeningNum() const;
375  EXPORT int64_t GetRecipientClosingNum() const;
376 
377  // From OTCronItem (parent class of this)
378  /*
379  inline void SetCronPointer(OTCron& theCron) { m_pCron = &theCron; }
380 
381  inline void SetCreationDate(const time64_t& CREATION_DATE) {
382  m_CREATION_DATE = CREATION_DATE; }
383  inline const time64_t& GetCreationDate() const { return m_CREATION_DATE; }
384 
385  // These are for:
386  // std::deque<int64_t> m_dequeClosingNumbers;
387  //
388  // They are numbers used for CLOSING a transaction. (finalReceipt, someday
389  more.)
390 
391  int64_t GetClosingTransactionNoAt(int32_t nIndex) const;
392  int32_t GetCountClosingNumbers() const;
393 
394  void AddClosingTransactionNo(const int64_t& lClosingTransactionNo);
395  */
396  virtual bool CanRemoveItemFromCron(OTPseudonym& theNym);
397 
398  virtual void HarvestOpeningNumber(OTPseudonym& theNym);
399  EXPORT virtual void HarvestClosingNumbers(OTPseudonym& theNym);
400 
401  // Return True if should stay on OTCron's list for more processing.
402  // Return False if expired or otherwise should be removed.
403  virtual bool ProcessCron(); // OTCron calls this regularly, which is my
404  // chance to expire, etc.
405 
406  // From OTTrackable (parent class of OTCronItem, parent class of this)
407  /*
408  inline int64_t GetTransactionNum() const { return m_lTransactionNum; }
409  inline void SetTransactionNum(int64_t lTransactionNum) { m_lTransactionNum
410  = lTransactionNum; }
411 
412  inline const OTIdentifier& GetSenderAcctID() { return
413  m_SENDER_ACCT_ID; }
414  inline const OTIdentifier& GetSenderUserID() { return
415  m_SENDER_USER_ID; }
416  inline void SetSenderAcctID(const OTIdentifier& ACCT_ID)
417  { m_SENDER_ACCT_ID = ACCT_ID; }
418  inline void SetSenderUserID(const OTIdentifier& USER_ID)
419  { m_SENDER_USER_ID = USER_ID; }
420  */
421 
422  virtual bool HasTransactionNum(const int64_t& lInput) const;
423  virtual void GetAllTransactionNumbers(OTNumList& numlistOutput) const;
424 
425  // From OTInstrument (parent class of OTTrackable, parent class of
426  // OTCronItem, parent class of this)
427  /*
428  OTInstrument(const OTIdentifier& SERVER_ID, const OTIdentifier& ASSET_ID)
429  : OTContract()
430 
431  inline const OTIdentifier& GetAssetID() const { return m_AssetTypeID; }
432  inline const OTIdentifier& GetServerID() const { return m_ServerID; }
433 
434  inline void SetAssetID(const OTIdentifier& ASSET_ID) { m_AssetTypeID =
435  ASSET_ID; }
436  inline void SetServerID(const OTIdentifier& SERVER_ID) { m_ServerID =
437  SERVER_ID; }
438 
439  inline time64_t GetValidFrom() const { return m_VALID_FROM; }
440  inline time64_t GetValidTo() const { return m_VALID_TO; }
441 
442  inline void SetValidFrom(time64_t TIME_FROM) { m_VALID_FROM =
443  TIME_FROM; }
444  inline void SetValidTo(time64_t TIME_TO) { m_VALID_TO = TIME_TO;
445  }
446 
447  bool VerifyCurrentDate(); // Verify the current date against the VALID FROM
448  / TO dates.
449  */
450 
451  // From OTScriptable, we override this function. OTScriptable now does fancy
452  // stuff like checking to see
453  // if the Nym is an agent working on behalf of a party to the contract.
454  // That's how all OTScriptable-derived
455  // objects work by default. But OTAgreement (payment plan) and OTTrade do
456  // it the old way: they just check to
457  // see if theNym has signed *this.
458  //
459  virtual bool VerifyNymAsAgent(
460  OTPseudonym& theNym, OTPseudonym& theSignerNym,
461  mapOfNyms* pmap_ALREADY_LOADED = nullptr) const;
462 
463  virtual bool VerifyNymAsAgentForAccount(OTPseudonym& theNym,
464  OTAccount& theAccount) const;
465 
466  /*
467  From OTContract, I have:
468 
469  virtual bool SignContract (const OTPseudonym& theNym);
470 
471  */
472  EXPORT bool SendNoticeToAllParties(
473  bool bSuccessMsg, OTPseudonym& theServerNym,
474  const OTIdentifier& theServerID, const int64_t& lNewTransactionNumber,
475  // const int64_t& lInReferenceTo, //
476  // each party has its own opening trans #.
477  const OTString& strReference, OTString* pstrNote = nullptr,
478  OTString* pstrAttachment = nullptr,
479  OTPseudonym* pActualNym = nullptr) const;
480 
481  EXPORT static bool DropServerNoticeToNymbox(
482  bool bSuccessMsg, // Nym receives an OTItem::acknowledgment or
483  // OTItem::rejection.
484  OTPseudonym& theServerNym, const OTIdentifier& SERVER_ID,
485  const OTIdentifier& USER_ID, const int64_t& lNewTransactionNumber,
486  const int64_t& lInReferenceTo, const OTString& strReference,
487  OTString* pstrNote = nullptr, OTString* pstrAttachment = nullptr,
488  OTPseudonym* pActualNym = nullptr);
489  OTAgreement();
490  OTAgreement(const OTIdentifier& SERVER_ID, const OTIdentifier& ASSET_ID);
491  OTAgreement(const OTIdentifier& SERVER_ID, const OTIdentifier& ASSET_ID,
492  const OTIdentifier& SENDER_ACCT_ID,
493  const OTIdentifier& SENDER_USER_ID,
494  const OTIdentifier& RECIPIENT_ACCT_ID,
495  const OTIdentifier& RECIPIENT_USER_ID);
496  virtual ~OTAgreement();
497 
498  void InitAgreement();
499 
500  virtual void Release();
501  void Release_Agreement();
502  virtual bool IsValidOpeningNumber(const int64_t& lOpeningNum) const;
503  EXPORT virtual int64_t GetOpeningNumber(const OTIdentifier& theNymID) const;
504  virtual int64_t GetClosingNumber(const OTIdentifier& theAcctID) const;
505  // return -1 if error, 0 if nothing, and 1 if the node was processed.
506  virtual int32_t ProcessXMLNode(irr::io::IrrXMLReader*& xml);
507  virtual void UpdateContents(); // Before transmission or serialization, this
508  // is where the ledger saves its contents
509  virtual bool SaveContractWallet(std::ofstream& ofs) const;
510 };
511 
512 } // namespace opentxs
513 
514 #endif // OPENTXS_CORE_OTAGREEMENT_HPP
virtual int32_t ProcessXMLNode(irr::io::IrrXMLReader *&xml)
void SetRecipientUserID(const OTIdentifier &USER_ID)
EXPORT int32_t GetRecipientCountClosingNumbers() const
virtual void onRemovalFromCron()
EXPORT int64_t GetRecipientClosingTransactionNoAt(uint32_t nIndex) const
virtual void Release()
EXPORT bool SetProposal(OTPseudonym &MERCHANT_NYM, const OTString &strConsideration, time64_t VALID_FROM=OT_TIME_ZERO, time64_t VALID_TO=OT_TIME_ZERO)
void SetMerchantSignedCopy(const OTString &strMerchantCopy)
void AddRecipientClosingTransactionNo(const int64_t &lClosingTransactionNo)
std::map< std::string, OTPseudonym * > mapOfNyms
Definition: OTWallet.hpp:161
EXPORT bool SendNoticeToAllParties(bool bSuccessMsg, OTPseudonym &theServerNym, const OTIdentifier &theServerID, const int64_t &lNewTransactionNumber, const OTString &strReference, OTString *pstrNote=nullptr, OTString *pstrAttachment=nullptr, OTPseudonym *pActualNym=nullptr) const
const OTString & GetMerchantSignedCopy() const
OTString m_strMerchantSignedCopy
void SetRecipientAcctID(const OTIdentifier &ACCT_ID)
virtual bool CanRemoveItemFromCron(OTPseudonym &theNym)
virtual bool CompareAgreement(const OTAgreement &rhs) const
virtual int64_t GetClosingNumber(const OTIdentifier &theAcctID) const
int64_t time64_t
Definition: Common.hpp:209
EXPORT int64_t GetRecipientOpeningNum() const
virtual void HarvestOpeningNumber(OTPseudonym &theNym)
virtual bool SaveContractWallet(std::ofstream &ofs) const
EXPORT bool Confirm(OTPseudonym &PAYER_NYM, OTPseudonym *pMERCHANT_NYM=nullptr, const OTIdentifier *p_id_MERCHANT_NYM=nullptr)
virtual bool ProcessCron()
virtual bool HasTransactionNum(const int64_t &lInput) const
EXPORT int64_t GetRecipientClosingNum() const
const OTString & GetConsideration() const
virtual void UpdateContents()
virtual bool VerifyAgreement(OTPseudonym &RECIPIENT_NYM, OTPseudonym &SENDER_NYM) const =0
virtual bool VerifyNymAsAgent(OTPseudonym &theNym, OTPseudonym &theSignerNym, mapOfNyms *pmap_ALREADY_LOADED=nullptr) const
virtual EXPORT int64_t GetOpeningNumber(const OTIdentifier &theNymID) const
virtual void onFinalReceipt(OTCronItem &theOrigCronItem, const int64_t &lNewTransactionNumber, OTPseudonym &theOriginator, OTPseudonym *pRemover)
virtual EXPORT void HarvestClosingNumbers(OTPseudonym &theNym)
const OTIdentifier & GetRecipientUserID() const
virtual bool IsValidOpeningNumber(const int64_t &lOpeningNum) const
virtual void GetAllTransactionNumbers(OTNumList &numlistOutput) const
const OTIdentifier & GetRecipientAcctID() const
std::deque< int64_t > m_dequeRecipientClosingNumbers
static EXPORT bool DropServerNoticeToNymbox(bool bSuccessMsg, OTPseudonym &theServerNym, const OTIdentifier &SERVER_ID, const OTIdentifier &USER_ID, const int64_t &lNewTransactionNumber, const int64_t &lInReferenceTo, const OTString &strReference, OTString *pstrNote=nullptr, OTString *pstrAttachment=nullptr, OTPseudonym *pActualNym=nullptr)
#define OT_TIME_ZERO
Definition: Common.hpp:180
virtual bool VerifyNymAsAgentForAccount(OTPseudonym &theNym, OTAccount &theAccount) const