Open-Transactions
0.93.0-ge03d287
|
#include <OTAPI_Exec.hpp>
Public Member Functions | |
EXPORT | OTAPI_Exec () |
EXPORT | ~OTAPI_Exec () |
EXPORT OT_API * | OTAPI () const |
EXPORT int64_t | StringToLong (const std::string &strNumber) const |
EXPORT std::string | LongToString (const int64_t &lNumber) const |
EXPORT uint64_t | StringToUlong (const std::string &strNumber) const |
EXPORT std::string | UlongToString (const uint64_t &lNumber) const |
EXPORT bool | AppInit () |
EXPORT bool | AppCleanup () |
EXPORT void | SetAppBinaryFolder (const std::string &strFolder) const |
EXPORT void | SetHomeFolder (const std::string &strFolder) const |
EXPORT bool | SetWallet (const std::string &strWalletFilename) const |
EXPORT bool | WalletExists () const |
EXPORT bool | LoadWallet () const |
EXPORT bool | SwitchWallet () const |
EXPORT void | Output (const int32_t &nLogLevel, const std::string &strOutput) const |
EXPORT time64_t | GetTime () const |
EXPORT std::string | NumList_Add (const std::string &strNumList, const std::string &strNumbers) const |
EXPORT std::string | NumList_Remove (const std::string &strNumList, const std::string &strNumbers) const |
EXPORT bool | NumList_VerifyQuery (const std::string &strNumList, const std::string &strNumbers) const |
EXPORT bool | NumList_VerifyAll (const std::string &strNumList, const std::string &strNumbers) const |
EXPORT int32_t | NumList_Count (const std::string &strNumList) const |
EXPORT std::string | Encode (const std::string &strPlaintext, const bool &bLineBreaks) const |
EXPORT std::string | Decode (const std::string &strEncoded, const bool &bLineBreaks) const |
EXPORT std::string | Encrypt (const std::string &RECIPIENT_NYM_ID, const std::string &strPlaintext) const |
EXPORT std::string | Decrypt (const std::string &RECIPIENT_NYM_ID, const std::string &strCiphertext) const |
EXPORT std::string | CreateSymmetricKey () const |
EXPORT std::string | SymmetricEncrypt (const std::string &SYMMETRIC_KEY, const std::string &PLAINTEXT) const |
EXPORT std::string | SymmetricDecrypt (const std::string &SYMMETRIC_KEY, const std::string &CIPHERTEXT_ENVELOPE) const |
EXPORT std::string | SignContract (const std::string &SIGNER_NYM_ID, const std::string &THE_CONTRACT) const |
EXPORT std::string | FlatSign (const std::string &SIGNER_NYM_ID, const std::string &THE_INPUT, const std::string &CONTRACT_TYPE) const |
EXPORT std::string | AddSignature (const std::string &SIGNER_NYM_ID, const std::string &THE_CONTRACT) const |
EXPORT bool | VerifySignature (const std::string &SIGNER_NYM_ID, const std::string &THE_CONTRACT) const |
EXPORT std::string | VerifyAndRetrieveXMLContents (const std::string &THE_CONTRACT, const std::string &SIGNER_ID) const |
EXPORT int32_t | GetMemlogSize () const |
EXPORT std::string | GetMemlogAtIndex (const int32_t &nIndex) const |
EXPORT std::string | PeekMemlogFront () const |
EXPORT std::string | PeekMemlogBack () const |
EXPORT bool | PopMemlogFront () const |
EXPORT bool | PopMemlogBack () const |
EXPORT std::string | CreateNym (const int32_t &nKeySize, const std::string &NYM_ID_SOURCE, const std::string &ALT_LOCATION) const |
EXPORT std::string | GetNym_ActiveCronItemIDs (const std::string &NYM_ID, const std::string &SERVER_ID) const |
EXPORT std::string | GetActiveCronItem (const std::string &SERVER_ID, int64_t lTransNum) const |
EXPORT std::string | GetNym_SourceForID (const std::string &NYM_ID) const |
EXPORT std::string | GetNym_AltSourceLocation (const std::string &NYM_ID) const |
EXPORT int32_t | GetNym_CredentialCount (const std::string &NYM_ID) const |
EXPORT std::string | GetNym_CredentialID (const std::string &NYM_ID, const int32_t &nIndex) const |
EXPORT std::string | GetNym_CredentialContents (const std::string &NYM_ID, const std::string &CREDENTIAL_ID) const |
EXPORT int32_t | GetNym_RevokedCredCount (const std::string &NYM_ID) const |
EXPORT std::string | GetNym_RevokedCredID (const std::string &NYM_ID, const int32_t &nIndex) const |
EXPORT std::string | GetNym_RevokedCredContents (const std::string &NYM_ID, const std::string &CREDENTIAL_ID) const |
EXPORT int32_t | GetNym_SubcredentialCount (const std::string &NYM_ID, const std::string &MASTER_CRED_ID) const |
EXPORT std::string | GetNym_SubCredentialID (const std::string &NYM_ID, const std::string &MASTER_CRED_ID, const int32_t &nIndex) const |
EXPORT std::string | GetNym_SubCredentialContents (const std::string &NYM_ID, const std::string &MASTER_CRED_ID, const std::string &SUB_CRED_ID) const |
EXPORT std::string | AddSubcredential (const std::string &NYM_ID, const std::string &MASTER_CRED_ID, const int32_t &nKeySize) const |
EXPORT bool | RevokeSubcredential (const std::string &NYM_ID, const std::string &MASTER_CRED_ID, const std::string &SUB_CRED_ID) const |
EXPORT std::string | CreateServerContract (const std::string &NYM_ID, const std::string &strXMLcontents) const |
EXPORT std::string | CreateAssetContract (const std::string &NYM_ID, const std::string &strXMLcontents) const |
EXPORT std::string | CalculateAssetContractID (const std::string &str_Contract) const |
EXPORT std::string | CalculateServerContractID (const std::string &str_Contract) const |
EXPORT int32_t | AddServerContract (const std::string &strContract) const |
EXPORT int32_t | AddAssetContract (const std::string &strContract) const |
EXPORT int32_t | GetServerCount () const |
EXPORT int32_t | GetAssetTypeCount () const |
EXPORT int32_t | GetAccountCount () const |
EXPORT int32_t | GetNymCount () const |
EXPORT std::string | GetServer_ID (const int32_t &nIndex) const |
EXPORT std::string | GetServer_Name (const std::string &SERVER_ID) const |
EXPORT std::string | GetServer_Contract (const std::string &SERVER_ID) const |
EXPORT std::string | FormatAmount (const std::string &ASSET_TYPE_ID, const int64_t &THE_AMOUNT) const |
EXPORT int64_t | StringToAmount (const std::string &ASSET_TYPE_ID, const std::string &str_input) const |
EXPORT std::string | GetAssetType_ID (const int32_t &nIndex) const |
EXPORT std::string | GetAssetType_Name (const std::string &ASSET_TYPE_ID) const |
EXPORT std::string | GetAssetType_TLA (const std::string &THE_ID) const |
EXPORT std::string | GetAssetType_Contract (const std::string &ASSET_TYPE_ID) const |
EXPORT std::string | GetAccountWallet_ID (const int32_t &nIndex) const |
EXPORT std::string | GetAccountWallet_Name (const std::string &ACCOUNT_ID) const |
EXPORT int64_t | GetAccountWallet_Balance (const std::string &ACCOUNT_ID) const |
EXPORT std::string | GetAccountWallet_Type (const std::string &ACCOUNT_ID) const |
EXPORT std::string | GetAccountWallet_AssetTypeID (const std::string &ACCOUNT_ID) const |
EXPORT std::string | GetAccountWallet_ServerID (const std::string &ACCOUNT_ID) const |
EXPORT std::string | GetAccountWallet_NymID (const std::string &ACCOUNT_ID) const |
EXPORT std::string | GetAccountWallet_InboxHash (const std::string &ACCOUNT_ID) const |
EXPORT std::string | GetAccountWallet_OutboxHash (const std::string &ACCOUNT_ID) const |
EXPORT bool | VerifyAccountReceipt (const std::string &SERVER_ID, const std::string &NYM_ID, const std::string &ACCT_ID) const |
EXPORT int32_t | GetNym_TransactionNumCount (const std::string &SERVER_ID, const std::string &NYM_ID) const |
EXPORT std::string | GetNym_ID (const int32_t &nIndex) const |
based on Index this returns the Nym's ID More... | |
EXPORT std::string | GetNym_Name (const std::string &NYM_ID) const |
Returns Nym Name (based on NymID) More... | |
EXPORT std::string | GetNym_Stats (const std::string &NYM_ID) const |
EXPORT std::string | GetNym_NymboxHash (const std::string &SERVER_ID, const std::string &NYM_ID) const |
EXPORT std::string | GetNym_RecentHash (const std::string &SERVER_ID, const std::string &NYM_ID) const |
EXPORT std::string | GetNym_InboxHash (const std::string &ACCOUNT_ID, const std::string &NYM_ID) const |
EXPORT std::string | GetNym_OutboxHash (const std::string &ACCOUNT_ID, const std::string &NYM_ID) const |
EXPORT bool | IsNym_RegisteredAtServer (const std::string &NYM_ID, const std::string &SERVER_ID) const |
EXPORT int32_t | GetNym_MailCount (const std::string &NYM_ID) const |
EXPORT std::string | GetNym_MailContentsByIndex (const std::string &NYM_ID, const int32_t &nIndex) const |
EXPORT std::string | GetNym_MailSenderIDByIndex (const std::string &NYM_ID, const int32_t &nIndex) const |
EXPORT std::string | GetNym_MailServerIDByIndex (const std::string &NYM_ID, const int32_t &nIndex) const |
EXPORT bool | Nym_RemoveMailByIndex (const std::string &NYM_ID, const int32_t &nIndex) const |
EXPORT bool | Nym_VerifyMailByIndex (const std::string &NYM_ID, const int32_t &nIndex) const |
EXPORT int32_t | GetNym_OutmailCount (const std::string &NYM_ID) const |
EXPORT std::string | GetNym_OutmailContentsByIndex (const std::string &NYM_ID, const int32_t &nIndex) const |
EXPORT std::string | GetNym_OutmailRecipientIDByIndex (const std::string &NYM_ID, const int32_t &nIndex) const |
EXPORT std::string | GetNym_OutmailServerIDByIndex (const std::string &NYM_ID, const int32_t &nIndex) const |
EXPORT bool | Nym_RemoveOutmailByIndex (const std::string &NYM_ID, const int32_t &nIndex) const |
EXPORT bool | Nym_VerifyOutmailByIndex (const std::string &NYM_ID, const int32_t &nIndex) const |
EXPORT int32_t | GetNym_OutpaymentsCount (const std::string &NYM_ID) const |
EXPORT std::string | GetNym_OutpaymentsContentsByIndex (const std::string &NYM_ID, const int32_t &nIndex) const |
EXPORT std::string | GetNym_OutpaymentsRecipientIDByIndex (const std::string &NYM_ID, const int32_t &nIndex) const |
EXPORT std::string | GetNym_OutpaymentsServerIDByIndex (const std::string &NYM_ID, const int32_t &nIndex) const |
EXPORT bool | Nym_RemoveOutpaymentsByIndex (const std::string &NYM_ID, const int32_t &nIndex) const |
EXPORT bool | Nym_VerifyOutpaymentsByIndex (const std::string &NYM_ID, const int32_t &nIndex) const |
EXPORT bool | Wallet_CanRemoveServer (const std::string &SERVER_ID) const |
EXPORT bool | Wallet_RemoveServer (const std::string &SERVER_ID) const |
EXPORT bool | Wallet_CanRemoveAssetType (const std::string &ASSET_ID) const |
EXPORT bool | Wallet_RemoveAssetType (const std::string &ASSET_ID) const |
EXPORT bool | Wallet_CanRemoveNym (const std::string &NYM_ID) const |
EXPORT bool | Wallet_RemoveNym (const std::string &NYM_ID) const |
EXPORT bool | Wallet_CanRemoveAccount (const std::string &ACCOUNT_ID) const |
EXPORT bool | Wallet_ChangePassphrase () const |
EXPORT std::string | Wallet_ExportNym (const std::string &NYM_ID) const |
Returns the exported Nym, if success. (Else nullptr.) More... | |
EXPORT std::string | Wallet_ImportNym (const std::string &FILE_CONTENTS) const |
returns NymID if success, else nullptr. More... | |
EXPORT std::string | Wallet_ImportCert (const std::string &DISPLAY_NAME, const std::string &FILE_CONTENTS) const |
Returns the imported cert's NymID, if successful. Else nullptr. More... | |
EXPORT std::string | Wallet_ExportCert (const std::string &NYM_ID) const |
Returns the exported cert, if successful. Else nullptr. More... | |
EXPORT std::string | Wallet_GetNymIDFromPartial (const std::string &PARTIAL_ID) const |
Attempts to find a full ID in the wallet, based on a partial of the same. More... | |
EXPORT std::string | Wallet_GetServerIDFromPartial (const std::string &PARTIAL_ID) const |
EXPORT std::string | Wallet_GetAssetIDFromPartial (const std::string &PARTIAL_ID) const |
EXPORT std::string | Wallet_GetAccountIDFromPartial (const std::string &PARTIAL_ID) const |
EXPORT bool | SetNym_Name (const std::string &NYM_ID, const std::string &SIGNER_NYM_ID, const std::string &NYM_NEW_NAME) const |
EXPORT bool | SetAccountWallet_Name (const std::string &ACCT_ID, const std::string &SIGNER_NYM_ID, const std::string &ACCT_NEW_NAME) const |
EXPORT bool | SetAssetType_Name (const std::string &ASSET_ID, const std::string &STR_NEW_NAME) const |
EXPORT bool | SetServer_Name (const std::string &SERVER_ID, const std::string &STR_NEW_NAME) const |
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) const |
EXPORT bool | DiscardCheque (const std::string &SERVER_ID, const std::string &USER_ID, const std::string &ACCT_ID, const std::string &THE_CHEQUE) const |
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) const |
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) const |
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) const |
EXPORT std::string | Create_SmartContract (const std::string &SIGNER_NYM_ID, const time64_t &VALID_FROM, const time64_t &VALID_TO) const |
EXPORT std::string | SmartContract_AddBylaw (const std::string &THE_CONTRACT, const std::string &SIGNER_NYM_ID, const std::string &BYLAW_NAME) const |
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) const |
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) const |
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) const |
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) const |
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) const |
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) const |
EXPORT int32_t | SmartContract_CountNumsNeeded (const std::string &THE_CONTRACT, const std::string &AGENT_NAME) const |
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) const |
EXPORT std::string | SmartContract_ConfirmParty (const std::string &THE_CONTRACT, const std::string &PARTY_NAME, const std::string &NYM_ID) const |
EXPORT bool | Smart_AreAllPartiesConfirmed (const std::string &THE_CONTRACT) const |
EXPORT int32_t | Smart_GetBylawCount (const std::string &THE_CONTRACT) const |
EXPORT std::string | Smart_GetBylawByIndex (const std::string &THE_CONTRACT, const int32_t &nIndex) const |
returns the name of the bylaw. More... | |
EXPORT std::string | Bylaw_GetLanguage (const std::string &THE_CONTRACT, const std::string &BYLAW_NAME) const |
EXPORT int32_t | Bylaw_GetClauseCount (const std::string &THE_CONTRACT, const std::string &BYLAW_NAME) const |
EXPORT std::string | Clause_GetNameByIndex (const std::string &THE_CONTRACT, const std::string &BYLAW_NAME, const int32_t &nIndex) const |
EXPORT std::string | Clause_GetContents (const std::string &THE_CONTRACT, const std::string &BYLAW_NAME, const std::string &CLAUSE_NAME) const |
EXPORT int32_t | Bylaw_GetVariableCount (const std::string &THE_CONTRACT, const std::string &BYLAW_NAME) const |
EXPORT std::string | Variable_GetNameByIndex (const std::string &THE_CONTRACT, const std::string &BYLAW_NAME, const int32_t &nIndex) const |
EXPORT std::string | Variable_GetType (const std::string &THE_CONTRACT, const std::string &BYLAW_NAME, const std::string &VARIABLE_NAME) const |
EXPORT std::string | Variable_GetAccess (const std::string &THE_CONTRACT, const std::string &BYLAW_NAME, const std::string &VARIABLE_NAME) const |
EXPORT std::string | Variable_GetContents (const std::string &THE_CONTRACT, const std::string &BYLAW_NAME, const std::string &VARIABLE_NAME) const |
EXPORT int32_t | Bylaw_GetHookCount (const std::string &THE_CONTRACT, const std::string &BYLAW_NAME) const |
EXPORT std::string | Hook_GetNameByIndex (const std::string &THE_CONTRACT, const std::string &BYLAW_NAME, const int32_t &nIndex) const |
EXPORT int32_t | Hook_GetClauseCount (const std::string &THE_CONTRACT, const std::string &BYLAW_NAME, const std::string &HOOK_NAME) const |
Returns the number of clauses attached to a specific hook. More... | |
EXPORT std::string | Hook_GetClauseAtIndex (const std::string &THE_CONTRACT, const std::string &BYLAW_NAME, const std::string &HOOK_NAME, const int32_t &nIndex) const |
EXPORT int32_t | Bylaw_GetCallbackCount (const std::string &THE_CONTRACT, const std::string &BYLAW_NAME) const |
EXPORT std::string | Callback_GetNameByIndex (const std::string &THE_CONTRACT, const std::string &BYLAW_NAME, const int32_t &nIndex) const |
EXPORT std::string | Callback_GetClause (const std::string &THE_CONTRACT, const std::string &BYLAW_NAME, const std::string &CALLBACK_NAME) const |
EXPORT int32_t | Smart_GetPartyCount (const std::string &THE_CONTRACT) const |
EXPORT std::string | Smart_GetPartyByIndex (const std::string &THE_CONTRACT, const int32_t &nIndex) const |
returns the name of the party. More... | |
EXPORT bool | Smart_IsPartyConfirmed (const std::string &THE_CONTRACT, const std::string &PARTY_NAME) const |
EXPORT std::string | Party_GetID (const std::string &THE_CONTRACT, const std::string &PARTY_NAME) const |
EXPORT int32_t | Party_GetAcctCount (const std::string &THE_CONTRACT, const std::string &PARTY_NAME) const |
EXPORT std::string | Party_GetAcctNameByIndex (const std::string &THE_CONTRACT, const std::string &PARTY_NAME, const int32_t &nIndex) const |
EXPORT std::string | Party_GetAcctID (const std::string &THE_CONTRACT, const std::string &PARTY_NAME, const std::string &ACCT_NAME) const |
EXPORT std::string | Party_GetAcctAssetID (const std::string &THE_CONTRACT, const std::string &PARTY_NAME, const std::string &ACCT_NAME) const |
EXPORT std::string | Party_GetAcctAgentName (const std::string &THE_CONTRACT, const std::string &PARTY_NAME, const std::string &ACCT_NAME) const |
EXPORT int32_t | Party_GetAgentCount (const std::string &THE_CONTRACT, const std::string &PARTY_NAME) const |
EXPORT std::string | Party_GetAgentNameByIndex (const std::string &THE_CONTRACT, const std::string &PARTY_NAME, const int32_t &nIndex) const |
EXPORT std::string | Party_GetAgentID (const std::string &THE_CONTRACT, const std::string &PARTY_NAME, const std::string &AGENT_NAME) const |
EXPORT int32_t | activateSmartContract (const std::string &SERVER_ID, const std::string &USER_ID, const std::string &THE_SMART_CONTRACT) const |
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) const |
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) const |
EXPORT std::string | LoadUserPubkey_Encryption (const std::string &USER_ID) const |
EXPORT std::string | LoadUserPubkey_Signing (const std::string &USER_ID) const |
EXPORT std::string | LoadPubkey_Encryption (const std::string &USER_ID) const |
EXPORT std::string | LoadPubkey_Signing (const std::string &USER_ID) const |
EXPORT bool | VerifyUserPrivateKey (const std::string &USER_ID) const |
EXPORT std::string | LoadPurse (const std::string &SERVER_ID, const std::string &ASSET_TYPE_ID, const std::string &USER_ID) const |
EXPORT std::string | LoadMint (const std::string &SERVER_ID, const std::string &ASSET_TYPE_ID) const |
EXPORT std::string | LoadAssetContract (const std::string &ASSET_TYPE_ID) const |
EXPORT std::string | LoadServerContract (const std::string &SERVER_ID) const |
EXPORT bool | Mint_IsStillGood (const std::string &SERVER_ID, const std::string &ASSET_TYPE_ID) const |
EXPORT bool | IsBasketCurrency (const std::string &ASSET_TYPE_ID) const |
EXPORT int32_t | Basket_GetMemberCount (const std::string &BASKET_ASSET_TYPE_ID) const |
EXPORT std::string | Basket_GetMemberType (const std::string &BASKET_ASSET_TYPE_ID, const int32_t &nIndex) const |
EXPORT int64_t | Basket_GetMinimumTransferAmount (const std::string &BASKET_ASSET_TYPE_ID) const |
EXPORT int64_t | Basket_GetMemberMinimumTransferAmount (const std::string &BASKET_ASSET_TYPE_ID, const int32_t &nIndex) const |
EXPORT std::string | LoadAssetAccount (const std::string &SERVER_ID, const std::string &USER_ID, const std::string &ACCOUNT_ID) const |
EXPORT std::string | LoadInbox (const std::string &SERVER_ID, const std::string &USER_ID, const std::string &ACCOUNT_ID) const |
EXPORT std::string | LoadOutbox (const std::string &SERVER_ID, const std::string &USER_ID, const std::string &ACCOUNT_ID) const |
EXPORT std::string | LoadInboxNoVerify (const std::string &SERVER_ID, const std::string &USER_ID, const std::string &ACCOUNT_ID) const |
These versions don't verify the ledger, they just load it up. More... | |
EXPORT std::string | LoadOutboxNoVerify (const std::string &SERVER_ID, const std::string &USER_ID, const std::string &ACCOUNT_ID) const |
EXPORT std::string | LoadPaymentInbox (const std::string &SERVER_ID, const std::string &USER_ID) const |
EXPORT std::string | LoadPaymentInboxNoVerify (const std::string &SERVER_ID, const std::string &USER_ID) const |
EXPORT std::string | LoadRecordBox (const std::string &SERVER_ID, const std::string &USER_ID, const std::string &ACCOUNT_ID) const |
NOTE: Sometimes the user ID is also passed in the "account ID" field,. More... | |
EXPORT std::string | LoadRecordBoxNoVerify (const std::string &SERVER_ID, const std::string &USER_ID, const std::string &ACCOUNT_ID) const |
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) const |
EXPORT std::string | LoadExpiredBox (const std::string &SERVER_ID, const std::string &USER_ID) const |
EXPORT std::string | LoadExpiredBoxNoVerify (const std::string &SERVER_ID, const std::string &USER_ID) const |
EXPORT bool | ClearExpired (const std::string &SERVER_ID, const std::string &USER_ID, const int32_t &nIndex, const bool &bClearAll) const |
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) const |
Find out how many pending transactions (and receipts) are in this inbox. More... | |
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) const |
Creates a new 'response' ledger, set up with the right Server ID, etc,. More... | |
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) const |
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) const |
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) const |
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) const |
Add a transaction to a ledger. More... | |
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) const |
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) const |
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) const |
EXPORT bool | RecordPayment (const std::string &SERVER_ID, const std::string &USER_ID, const bool &bIsInbox, const int32_t &nIndex, const bool &bSaveCopy) const |
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) const |
Get Transaction Type (internally uses GetTransactionTypeString().) More... | |
EXPORT int64_t | ReplyNotice_GetRequestNum (const std::string &SERVER_ID, const std::string &USER_ID, const std::string &THE_TRANSACTION) const |
Transactions do not have request numbers. However, if you have a. More... | |
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) const |
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) const |
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) const |
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) const |
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) const |
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) const |
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) const |
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) const |
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) const |
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) const |
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) const |
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) const |
EXPORT bool | SavePurse (const std::string &SERVER_ID, const std::string &ASSET_TYPE_ID, const std::string &USER_ID, const std::string &THE_PURSE) const |
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) const |
EXPORT std::string | CreatePurse_Passphrase (const std::string &SERVER_ID, const std::string &ASSET_TYPE_ID, const std::string &SIGNER_ID) const |
EXPORT int64_t | Purse_GetTotalValue (const std::string &SERVER_ID, const std::string &ASSET_TYPE_ID, const std::string &THE_PURSE) const |
Get Purse Total Value (internally uses GetTotalValue().) More... | |
EXPORT int32_t | Purse_Count (const std::string &SERVER_ID, const std::string &ASSET_TYPE_ID, const std::string &THE_PURSE) const |
returns a count of the number of cash tokens inside this purse. More... | |
EXPORT bool | Purse_HasPassword (const std::string &SERVER_ID, const std::string &THE_PURSE) const |
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) const |
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) const |
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) const |
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) const |
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) const |
Should handle duplicates. Should load, merge, and save. More... | |
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) const |
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) const |
EXPORT std::string | Token_GetID (const std::string &SERVER_ID, const std::string &ASSET_TYPE_ID, const std::string &THE_TOKEN) const |
EXPORT int64_t | Token_GetDenomination (const std::string &SERVER_ID, const std::string &ASSET_TYPE_ID, const std::string &THE_TOKEN) const |
The actual cash value of the token. Returns a int64_t. More... | |
EXPORT int32_t | Token_GetSeries (const std::string &SERVER_ID, const std::string &ASSET_TYPE_ID, const std::string &THE_TOKEN) const |
EXPORT time64_t | Token_GetValidFrom (const std::string &SERVER_ID, const std::string &ASSET_TYPE_ID, const std::string &THE_TOKEN) const |
the date is seconds since Jan 1970. More... | |
EXPORT time64_t | Token_GetValidTo (const std::string &SERVER_ID, const std::string &ASSET_TYPE_ID, const std::string &THE_TOKEN) const |
EXPORT std::string | Token_GetAssetID (const std::string &THE_TOKEN) const |
EXPORT std::string | Token_GetServerID (const std::string &THE_TOKEN) const |
EXPORT int64_t | Instrmnt_GetAmount (const std::string &THE_INSTRUMENT) const |
EXPORT int64_t | Instrmnt_GetTransNum (const std::string &THE_INSTRUMENT) const |
EXPORT time64_t | Instrmnt_GetValidFrom (const std::string &THE_INSTRUMENT) const |
EXPORT time64_t | Instrmnt_GetValidTo (const std::string &THE_INSTRUMENT) const |
EXPORT std::string | Instrmnt_GetMemo (const std::string &THE_INSTRUMENT) const |
EXPORT std::string | Instrmnt_GetType (const std::string &THE_INSTRUMENT) const |
EXPORT std::string | Instrmnt_GetServerID (const std::string &THE_INSTRUMENT) const |
EXPORT std::string | Instrmnt_GetAssetID (const std::string &THE_INSTRUMENT) const |
EXPORT std::string | Instrmnt_GetSenderUserID (const std::string &THE_INSTRUMENT) const |
EXPORT std::string | Instrmnt_GetSenderAcctID (const std::string &THE_INSTRUMENT) const |
EXPORT std::string | Instrmnt_GetRemitterUserID (const std::string &THE_INSTRUMENT) const |
EXPORT std::string | Instrmnt_GetRemitterAcctID (const std::string &THE_INSTRUMENT) const |
EXPORT std::string | Instrmnt_GetRecipientUserID (const std::string &THE_INSTRUMENT) const |
EXPORT std::string | Instrmnt_GetRecipientAcctID (const std::string &THE_INSTRUMENT) const |
EXPORT int32_t | checkServerID (const std::string &SERVER_ID, const std::string &USER_ID) const |
EXPORT int32_t | createUserAccount (const std::string &SERVER_ID, const std::string &USER_ID) const |
EXPORT int32_t | deleteUserAccount (const std::string &SERVER_ID, const std::string &USER_ID) const |
EXPORT int32_t | deleteAssetAccount (const std::string &SERVER_ID, const std::string &USER_ID, const std::string &ACCOUNT_ID) const |
EXPORT int32_t | usageCredits (const std::string &SERVER_ID, const std::string &USER_ID, const std::string &USER_ID_CHECK, const int64_t &ADJUSTMENT) const |
EXPORT int64_t | Message_GetUsageCredits (const std::string &THE_MESSAGE) const |
EXPORT int32_t | checkUser (const std::string &SERVER_ID, const std::string &USER_ID, const std::string &USER_ID_CHECK) const |
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) const |
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) const |
EXPORT int32_t | getRequest (const std::string &SERVER_ID, const std::string &USER_ID) const |
EXPORT int32_t | getTransactionNumber (const std::string &SERVER_ID, const std::string &USER_ID) const |
EXPORT int32_t | issueAssetType (const std::string &SERVER_ID, const std::string &USER_ID, const std::string &THE_CONTRACT) const |
EXPORT int32_t | getContract (const std::string &SERVER_ID, const std::string &USER_ID, const std::string &ASSET_ID) const |
EXPORT int32_t | getMint (const std::string &SERVER_ID, const std::string &USER_ID, const std::string &ASSET_ID) const |
EXPORT int32_t | createAssetAccount (const std::string &SERVER_ID, const std::string &USER_ID, const std::string &ASSET_ID) const |
EXPORT int32_t | getAccount (const std::string &SERVER_ID, const std::string &USER_ID, const std::string &ACCT_ID) const |
EXPORT int32_t | getAccountFiles (const std::string &SERVER_ID, const std::string &USER_ID, const std::string &ACCT_ID) const |
EXPORT std::string | GenerateBasketCreation (const std::string &USER_ID, const int64_t &MINIMUM_TRANSFER) const |
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) const |
EXPORT int32_t | issueBasket (const std::string &SERVER_ID, const std::string &USER_ID, const std::string &THE_BASKET) const |
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) const |
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) const |
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) const |
EXPORT int32_t | notarizeWithdrawal (const std::string &SERVER_ID, const std::string &USER_ID, const std::string &ACCT_ID, const int64_t &AMOUNT) const |
EXPORT int32_t | notarizeDeposit (const std::string &SERVER_ID, const std::string &USER_ID, const std::string &ACCT_ID, const std::string &THE_PURSE) const |
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) const |
EXPORT int32_t | getInbox (const std::string &SERVER_ID, const std::string &USER_ID, const std::string &ACCT_ID) const |
EXPORT int32_t | getOutbox (const std::string &SERVER_ID, const std::string &USER_ID, const std::string &ACCT_ID) const |
EXPORT int32_t | getNymbox (const std::string &SERVER_ID, const std::string &USER_ID) const |
EXPORT std::string | LoadNymbox (const std::string &SERVER_ID, const std::string &USER_ID) const |
EXPORT std::string | LoadNymboxNoVerify (const std::string &SERVER_ID, const std::string &USER_ID) const |
EXPORT std::string | Nymbox_GetReplyNotice (const std::string &SERVER_ID, const std::string &USER_ID, const int64_t &REQUEST_NUMBER) const |
EXPORT bool | HaveAlreadySeenReply (const std::string &SERVER_ID, const std::string &USER_ID, const int64_t &REQUEST_NUMBER) const |
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) const |
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) const |
EXPORT int32_t | processInbox (const std::string &SERVER_ID, const std::string &USER_ID, const std::string &ACCT_ID, const std::string &ACCT_LEDGER) const |
EXPORT int32_t | processNymbox (const std::string &SERVER_ID, const std::string &USER_ID) const |
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) const |
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) const |
PAY DIVIDEND – to shareholders. More... | |
EXPORT int32_t | depositCheque (const std::string &SERVER_ID, const std::string &USER_ID, const std::string &ACCT_ID, const std::string &THE_CHEQUE) const |
EXPORT int32_t | depositPaymentPlan (const std::string &SERVER_ID, const std::string &USER_ID, const std::string &THE_PAYMENT_PLAN) const |
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) const |
EXPORT int32_t | getMarketList (const std::string &SERVER_ID, const std::string &USER_ID) const |
Retrieves details for each market. More... | |
EXPORT int32_t | getMarketOffers (const std::string &SERVER_ID, const std::string &USER_ID, const std::string &MARKET_ID, const int64_t &MAX_DEPTH) const |
Gets all offers for a specific market and their details (up until. More... | |
EXPORT int32_t | getMarketRecentTrades (const std::string &SERVER_ID, const std::string &USER_ID, const std::string &MARKET_ID) const |
Gets all recent trades (up until maximum depth) More... | |
EXPORT int32_t | getNym_MarketOffers (const std::string &SERVER_ID, const std::string &USER_ID) const |
This "Market Offer" data is a lot more detailed than the. More... | |
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) const |
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) const |
EXPORT std::string | PopMessageBuffer (const int64_t &REQUEST_NUMBER, const std::string &SERVER_ID, const std::string &USER_ID) const |
EXPORT void | FlushMessageBuffer () const |
EXPORT std::string | GetSentMessage (const int64_t &REQUEST_NUMBER, const std::string &SERVER_ID, const std::string &USER_ID) const |
EXPORT bool | RemoveSentMessage (const int64_t &REQUEST_NUMBER, const std::string &SERVER_ID, const std::string &USER_ID) const |
EXPORT void | FlushSentMessages (const bool &bHarvestingForRetry, const std::string &SERVER_ID, const std::string &USER_ID, const std::string &THE_NYMBOX) const |
EXPORT void | Sleep (const int64_t &MILLISECONDS) const |
EXPORT bool | ResyncNymWithServer (const std::string &SERVER_ID, const std::string &USER_ID, const std::string &THE_MESSAGE) const |
EXPORT std::string | Message_GetCommand (const std::string &THE_MESSAGE) const |
EXPORT int32_t | Message_GetSuccess (const std::string &THE_MESSAGE) const |
EXPORT int32_t | queryAssetTypes (const std::string &SERVER_ID, const std::string &USER_ID, const std::string &ENCODED_MAP) const |
EXPORT std::string | Message_GetPayload (const std::string &THE_MESSAGE) const |
EXPORT int32_t | Message_GetDepth (const std::string &THE_MESSAGE) const |
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) const |
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) const |
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) const |
EXPORT std::string | Message_GetLedger (const std::string &THE_MESSAGE) const |
EXPORT std::string | Message_GetNewAssetTypeID (const std::string &THE_MESSAGE) const |
EXPORT std::string | Message_GetNewIssuerAcctID (const std::string &THE_MESSAGE) const |
EXPORT std::string | Message_GetNewAcctID (const std::string &THE_MESSAGE) const |
EXPORT std::string | Message_GetNymboxHash (const std::string &THE_MESSAGE) const |
Protected Attributes | |
OT_API * | p_OTAPI |
Static Protected Attributes | |
static bool | bInitOTApp = false |
static bool | bCleanupOTApp = false |
Definition at line 143 of file OTAPI_Exec.hpp.
opentxs::OTAPI_Exec::OTAPI_Exec | ( | ) |
Definition at line 194 of file OTAPI_Exec.cpp.
opentxs::OTAPI_Exec::~OTAPI_Exec | ( | ) |
Definition at line 199 of file OTAPI_Exec.cpp.
int32_t opentxs::OTAPI_Exec::activateSmartContract | ( | const std::string & | SERVER_ID, |
const std::string & | USER_ID, | ||
const std::string & | THE_SMART_CONTRACT | ||
) | const |
--------------------------------------------------
ACTIVATE SMART CONTRACT Take an existing smart contract, which has already been set up, confirmed, etc, and then activate it on the server so it can start processing.
See Create_SmartContract (etc.)
Definition at line 7420 of file OTAPI_Exec.cpp.
int32_t opentxs::OTAPI_Exec::AddAssetContract | ( | const std::string & | strContract | ) | const |
--------------------------------------------------
ADD ASSET CONTRACT (to wallet)
If you have an asset contract that you'd like to add to your wallet, call this function.
Definition at line 1462 of file OTAPI_Exec.cpp.
std::string opentxs::OTAPI_Exec::AddBasketCreationItem | ( | const std::string & | USER_ID, |
const std::string & | THE_BASKET, | ||
const std::string & | ASSET_TYPE_ID, | ||
const int64_t & | MINIMUM_TRANSFER | ||
) | const |
----------------------------------------------------
ADD BASKET CREATION ITEM
(returns the updated basket in string form.)
Call GenerateBasketCreation first (above), then call this function multiple times to add the various currencies to the basket, and then call issueBasket to send the request to the server.
Definition at line 13922 of file OTAPI_Exec.cpp.
std::string opentxs::OTAPI_Exec::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 | ||
) | const |
1 2 3 5=2,3,4 OR 10=4,6,8 OR 15=6,9,12 Etc. (The MULTIPLE.) -------------------------------------------------— ADD BASKET EXCHANGE ITEM
Returns the updated basket exchange request in string form. (Or nullptr.)
Call the above function first. Then call this one multiple times, and then finally call exchangeBasket to send the request to the server.
Definition at line 14084 of file OTAPI_Exec.cpp.
int32_t opentxs::OTAPI_Exec::AddServerContract | ( | const std::string & | strContract | ) | const |
--------------------------------------------------
ADD SERVER CONTRACT (to wallet)
If you have a server contract that you'd like to add to your wallet, call this function.
Definition at line 1416 of file OTAPI_Exec.cpp.
std::string opentxs::OTAPI_Exec::AddSignature | ( | const std::string & | SIGNER_NYM_ID, |
const std::string & | THE_CONTRACT | ||
) | const |
OT-Sign a CONTRACT. (Add a signature)
EXPORT std::string AddSignature(const std::string& SIGNER_NYM_ID, const std::string& THE_CONTRACT);
Tries to instantiate the contract object, based on the string passed in. Signs the contract, without releasing any signatures that are already there. Returns the signed contract, or nullptr if failure.
NOTE: The actual OT functionality (Use Cases) NEVER requires you to sign via this function. Why not? because, anytime a signature is needed on something, the relevant OT API call will require you to pass in the Nym, and the API already signs internally wherever it deems appropriate. Thus, this function is only for advanced uses, for OT-Scripts, server operators, etc.
OT-Sign a CONTRACT. (Add a signature)
std::string OTAPI_Exec::AddSignature(const std::string& SIGNER_NYM_ID, const std::string& THE_CONTRACT);
Tries to instantiate the contract object, based on the string passed in. Signs the contract, without releasing any signatures that are already there. Returns the signed contract, or "" if failure.
NOTE: The actual OT functionality (Use Cases) NEVER requires you to sign via this function. Why not? because, anytime a signature is needed on something, the relevant OT API call will require you to pass in the Nym, and the API already signs internally wherever it deems appropriate. Thus, this function is only for advanced uses, for OT-Scripts, server operators, etc.
Internally the C++ code is:
Definition at line 4639 of file OTAPI_Exec.cpp.
std::string opentxs::OTAPI_Exec::AddSubcredential | ( | const std::string & | NYM_ID, |
const std::string & | MASTER_CRED_ID, | ||
const int32_t & | nKeySize | ||
) | const |
Definition at line 917 of file OTAPI_Exec.cpp.
bool opentxs::OTAPI_Exec::AppCleanup | ( | ) |
Definition at line 228 of file OTAPI_Exec.cpp.
bool opentxs::OTAPI_Exec::AppInit | ( | ) |
INITIALIZE the OTAPI library
Call this once per run of the application.
Definition at line 203 of file OTAPI_Exec.cpp.
int32_t opentxs::OTAPI_Exec::Basket_GetMemberCount | ( | const std::string & | BASKET_ASSET_TYPE_ID | ) | const |
--------------------------------------------------------------------
Get Basket Count (of backing asset types.)
Returns the number of asset types that make up this basket. (Or zero.)
Definition at line 13153 of file OTAPI_Exec.cpp.
int64_t opentxs::OTAPI_Exec::Basket_GetMemberMinimumTransferAmount | ( | const std::string & | BASKET_ASSET_TYPE_ID, |
const int32_t & | nIndex | ||
) | const |
----------------------------------------------------
GET BASKET MEMBER's MINIMUM TRANSFER AMOUNT
Returns a int64_t containing the minimum transfer amount for one of the member currencies in the basket.
FOR EXAMPLE: If the basket is defined as 10 Rands == 2 Silver, 5 Gold, 8 Euro, then the minimum transfer amount for the member currency at index 0 is 2, the minimum transfer amount for the member currency at index 1 is 5, and the minimum transfer amount for the member currency at index 2 is 8.
Definition at line 13244 of file OTAPI_Exec.cpp.
std::string opentxs::OTAPI_Exec::Basket_GetMemberType | ( | const std::string & | BASKET_ASSET_TYPE_ID, |
const int32_t & | nIndex | ||
) | const |
--------------------------------------------------------------------
Get Asset Type of a basket's member currency, by index.
(Returns a string containing Asset Type ID, or nullptr).
Definition at line 13170 of file OTAPI_Exec.cpp.
int64_t opentxs::OTAPI_Exec::Basket_GetMinimumTransferAmount | ( | const std::string & | BASKET_ASSET_TYPE_ID | ) | const |
----------------------------------------------------
GET BASKET MINIMUM TRANSFER AMOUNT
Returns a int64_t containing the minimum transfer amount for the entire basket.
FOR EXAMPLE: If the basket is defined as 10 Rands == 2 Silver, 5 Gold, 8 Euro, then the minimum transfer amount for the basket is 10. This function would return a string containing "10", in that example.
Definition at line 13209 of file OTAPI_Exec.cpp.
int32_t opentxs::OTAPI_Exec::Bylaw_GetCallbackCount | ( | const std::string & | THE_CONTRACT, |
const std::string & | BYLAW_NAME | ||
) | const |
Definition at line 6361 of file OTAPI_Exec.cpp.
int32_t opentxs::OTAPI_Exec::Bylaw_GetClauseCount | ( | const std::string & | THE_CONTRACT, |
const std::string & | BYLAW_NAME | ||
) | const |
Definition at line 6253 of file OTAPI_Exec.cpp.
int32_t opentxs::OTAPI_Exec::Bylaw_GetHookCount | ( | const std::string & | THE_CONTRACT, |
const std::string & | BYLAW_NAME | ||
) | const |
Definition at line 6325 of file OTAPI_Exec.cpp.
std::string opentxs::OTAPI_Exec::Bylaw_GetLanguage | ( | const std::string & | THE_CONTRACT, |
const std::string & | BYLAW_NAME | ||
) | const |
Definition at line 6216 of file OTAPI_Exec.cpp.
int32_t opentxs::OTAPI_Exec::Bylaw_GetVariableCount | ( | const std::string & | THE_CONTRACT, |
const std::string & | BYLAW_NAME | ||
) | const |
Definition at line 6289 of file OTAPI_Exec.cpp.
std::string opentxs::OTAPI_Exec::CalculateAssetContractID | ( | const std::string & | str_Contract | ) | const |
Definition at line 1022 of file OTAPI_Exec.cpp.
std::string opentxs::OTAPI_Exec::CalculateServerContractID | ( | const std::string & | str_Contract | ) | const |
Definition at line 1056 of file OTAPI_Exec.cpp.
std::string opentxs::OTAPI_Exec::Callback_GetClause | ( | const std::string & | THE_CONTRACT, |
const std::string & | BYLAW_NAME, | ||
const std::string & | CALLBACK_NAME | ||
) | const |
Definition at line 6921 of file OTAPI_Exec.cpp.
std::string opentxs::OTAPI_Exec::Callback_GetNameByIndex | ( | const std::string & | THE_CONTRACT, |
const std::string & | BYLAW_NAME, | ||
const int32_t & | nIndex | ||
) | const |
Definition at line 6883 of file OTAPI_Exec.cpp.
int32_t opentxs::OTAPI_Exec::checkServerID | ( | const std::string & | SERVER_ID, |
const std::string & | USER_ID | ||
) | const |
CHECK SERVER ID – (This is used for "pinging" the server...)
Notice, if you ever want to send a message, you have to include the Server ID and the User ID.
The OTAPI will use the Server ID to look-up the server contract. (FYI, the Server ID is a hash of the server contract itself, so it is impos- sible to change the contract, without also changing the ID.)
Then it will connect to the server based on the connection information in that contract, send the message, get the reply, and disconnect. (That's in HTTP mode – in TCP mode it maintains the connection.)
It will also encrypt the message to the public key found inside that contract, so only the person who signed the contract will be able to read the message.
Open Transactions will also use the User ID to lookup the public key for that user. (The UserID, aka NymID, is a hash of the public key itself.)
This message is basically just a ping – it verifies that the server is really there, and that it can really open the messages that are encrypted to the key in the server contract. It's the first thing your wallet software should do. Think of it like a way to PING the server.
Definition at line 13285 of file OTAPI_Exec.cpp.
int32_t opentxs::OTAPI_Exec::checkUser | ( | const std::string & | SERVER_ID, |
const std::string & | USER_ID, | ||
const std::string & | USER_ID_CHECK | ||
) | const |
CHECK USER — (Grab his public key based on his User ID.)
ServerID – Must be included with every message. USER_ID – You must include your own userID so the server can reply. USER_CHECK_ID – This is a SECOND user's ID.
In this message, you are requesting the server to send you the public key for another user, denoted by his ID in USER_ID_CHECK.
The server's response will contain the public key of the other user, so you can encrypt messages or cash to him. Your wallet can verify that the key is the right one, by hashing it and comparing the result to the other user's ID. Since the User ID is a hash of the key, they should always match.
Definition at line 13476 of file OTAPI_Exec.cpp.
std::string opentxs::OTAPI_Exec::Clause_GetContents | ( | const std::string & | THE_CONTRACT, |
const std::string & | BYLAW_NAME, | ||
const std::string & | CLAUSE_NAME | ||
) | const |
Definition at line 6447 of file OTAPI_Exec.cpp.
std::string opentxs::OTAPI_Exec::Clause_GetNameByIndex | ( | const std::string & | THE_CONTRACT, |
const std::string & | BYLAW_NAME, | ||
const int32_t & | nIndex | ||
) | const |
Definition at line 6397 of file OTAPI_Exec.cpp.
bool opentxs::OTAPI_Exec::ClearExpired | ( | const std::string & | SERVER_ID, |
const std::string & | USER_ID, | ||
const int32_t & | nIndex, | ||
const bool & | bClearAll | ||
) | const |
Definition at line 8774 of file OTAPI_Exec.cpp.
bool opentxs::OTAPI_Exec::ClearRecord | ( | const std::string & | SERVER_ID, |
const std::string & | USER_ID, | ||
const std::string & | ACCOUNT_ID, | ||
const int32_t & | nIndex, | ||
const bool & | bClearAll | ||
) | const |
Definition at line 8746 of file OTAPI_Exec.cpp.
std::string opentxs::OTAPI_Exec::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 | ||
) | const |
Definition at line 5316 of file OTAPI_Exec.cpp.
std::string opentxs::OTAPI_Exec::Create_SmartContract | ( | const std::string & | SIGNER_NYM_ID, |
const time64_t & | VALID_FROM, | ||
const time64_t & | VALID_TO | ||
) | const |
Definition at line 5374 of file OTAPI_Exec.cpp.
int32_t opentxs::OTAPI_Exec::createAssetAccount | ( | const std::string & | SERVER_ID, |
const std::string & | USER_ID, | ||
const std::string & | ASSET_ID | ||
) | const |
---------------------------------------------------------------------------
CREATE ASSET ACCOUNT – of any asset type, (just pass in the Asset Type ID.)
Returns int32_t: -1 means error; no message was sent. -2 means the message was sent, but the request number must be passed as a string, so call GetLargeRequestNum. 0 means NO error, but also: no message was sent. >0 means NO error, and the message was sent, and the request number fits into an integer... ...and in fact the requestNum IS the return value! ===> In 99% of cases, this LAST option is what actually happens!!
Definition at line 13781 of file OTAPI_Exec.cpp.
std::string opentxs::OTAPI_Exec::CreateAssetContract | ( | const std::string & | NYM_ID, |
const std::string & | strXMLcontents | ||
) | const |
Definition at line 1198 of file OTAPI_Exec.cpp.
std::string opentxs::OTAPI_Exec::CreateNym | ( | const int32_t & | nKeySize, |
const std::string & | NYM_ID_SOURCE, | ||
const std::string & | ALT_LOCATION | ||
) | const |
CREATE NYM -- Create new User
Creates a new Nym and adds it to the wallet. (Including PUBLIC and PRIVATE KEYS.)
Returns a new User ID (with files already created) or nullptr upon failure.
Once it exists, use createUserAccount() to register your new Nym at any given Server. (Nearly all server requests require this...)
nKeySize must be 1024, 2048, 4096, or 8192. NYM_ID_SOURCE can be empty (it will just generate a keypair and use the public key as the source.) Otherwise you can pass another source string in here, such as a URL, but the Nym will not verify against its own source unless the credential IDs for that Nym can be found posted at that same URL. Whereas if the source is just a public key, then the only verification requirement is that master credentials be signed by the corresponding private key.
Definition at line 583 of file OTAPI_Exec.cpp.
std::string opentxs::OTAPI_Exec::CreatePurse | ( | const std::string & | SERVER_ID, |
const std::string & | ASSET_TYPE_ID, | ||
const std::string & | OWNER_ID, | ||
const std::string & | SIGNER_ID | ||
) | const |
Definition at line 12247 of file OTAPI_Exec.cpp.
std::string opentxs::OTAPI_Exec::CreatePurse_Passphrase | ( | const std::string & | SERVER_ID, |
const std::string & | ASSET_TYPE_ID, | ||
const std::string & | SIGNER_ID | ||
) | const |
Definition at line 12307 of file OTAPI_Exec.cpp.
std::string opentxs::OTAPI_Exec::CreateServerContract | ( | const std::string & | NYM_ID, |
const std::string & | strXMLcontents | ||
) | const |
Creates a contract based on the contents passed in,
then sets the contract key based on the NymID, and signs it with that Nym. This function will also ADD the contract to the wallet. Returns: the new contract ID, or nullptr if failure.
Definition at line 1096 of file OTAPI_Exec.cpp.
std::string opentxs::OTAPI_Exec::CreateSymmetricKey | ( | ) | const |
Definition at line 4441 of file OTAPI_Exec.cpp.
int32_t opentxs::OTAPI_Exec::createUserAccount | ( | const std::string & | SERVER_ID, |
const std::string & | USER_ID | ||
) | const |
CREATE USER's ACCOUNT (On a specific server.)
Note: There are USER accounts and ASSET accounts...
A User account is simply a public key. Whenever you send a message to the server, you would normally have to send a public key with the message, so that the server can encrypt the reply back to you.
Due to this, the server will cache the public key so you only have to send the ID (which is a hash of the key.) The server uses this ID to look up the public key and encrypt the response back to you.
– Any user can create as many public keys as they wish. So User accounts are pseudonymous.
– Cash token exchanges are possible without a User account (using an HTTPS proxy operated by the server operator) so users are NOT forced to create accounts, if they prefer to deal only in cash. However, it's worth noting that even if they do, the cash itself IS STILL UNTRACEABLE, due to the Chaumian blinding.
– A user may use the same public key at multiple servers, and he creates his own keys inside the wallet. So this function is less about "creating" the user account, and more about simply register- ing a public key on a specific server.
– (Wallet software is capable, in OT, of distributing assets across multiple servers seamlessly, which means it's a requirement that the user generate his own keys and register them on whichever servers that he sees fit to trust.
Since the server contract and public key are both presumed to have been created by this point, you simply pass in their IDs and the library will do the rest of the work.
Definition at line 13312 of file OTAPI_Exec.cpp.
std::string opentxs::OTAPI_Exec::Decode | ( | const std::string & | strEncoded, |
const bool & | bLineBreaks | ||
) | const |
Decode an OT-encoded string (back to plainext.)
EXPORT std::string Decode(const std::string& strEncoded);
This will base64-decode, uncompress, and unpack an OT-encoded string. Returns the plainext string, or nullptr.
internally: OTASCIIArmor ascEncoded(strEncoded); OTString strPlain(ascEncoded); // strPlain now contains the decoded plainext string. return strPlain.Get(); // We return it.
Decode an OT-encoded string (back to plaintext.) (NOT DECRYPT)
std::string OTAPI_Exec::Decode(const std::string& strEncoded);
This will base64-decode, uncompress, and unpack an OT-encoded string. Returns the plaintext string, or "".
Internally: OTASCIIArmor ascEncoded(strEncoded); OTString strPlain(ascEncoded); // strPlain now contains the decoded plaintext string. return strPlain.Get(); // We return it.
Definition at line 4324 of file OTAPI_Exec.cpp.
std::string opentxs::OTAPI_Exec::Decrypt | ( | const std::string & | RECIPIENT_NYM_ID, |
const std::string & | strCiphertext | ||
) | const |
OT-DECRYPT an OT-encrypted string back to plainext. (ASYMMETRIC)
EXPORT std::string Decrypt(const std::string& RECIPIENT_NYM_ID, const std::string& strCiphertext);
Decrypts the base64-encoded ciphertext back into a normal string plainext. Returns the plainext string, or nullptr.
internally the C++ code is: OTEnvelope theEnvelope; // Here is the envelope object. (The ciphertext IS the data for an OTEnvelope.) OTASCIIArmor ascCiphertext(strCiphertext); // The base64-encoded ciphertext passed in. Next we'll try to attach it to envelope object... if (theEnvelope.SetAsciiArmoredData(ascCiphertext)) { // ...so that we can open it using the appropriate Nym, into a plain string object: OTString strServerReply; // This will contain the output when we're done. const bool bOpened = // Now we try to decrypt: theEnvelope.Open(RECIPIENT_NYM, strServerReply); if (bOpened) { return strServerReply.Get(); } }
OT-DECRYPT an OT-encrypted string back to plaintext. ASYMMETRIC
std::string OTAPI_Exec::Decrypt(const std::string& RECIPIENT_NYM_ID, const std::string& strCiphertext);
Decrypts the base64-encoded ciphertext back into a normal string plaintext. Returns the plaintext string, or "".
Internally the C++ code is: OTEnvelope theEnvelope; // Here is the envelope object. (The ciphertext IS the data for an OTEnvelope.) OTASCIIArmor ascCiphertext(strCiphertext); // The base64-encoded ciphertext passed in. Next we'll try to attach it to envelope object... if (theEnvelope.SetAsciiArmoredData(ascCiphertext)) { // ...so that we can open it using the appropriate Nym, into a plain string object: OTString strServerReply; // This will contain the output when we're done. const bool bOpened = // Now we try to decrypt: theEnvelope.Open(RECIPIENT_NYM, strServerReply); if (bOpened) { return strServerReply.Get(); } }
Definition at line 4411 of file OTAPI_Exec.cpp.
int32_t opentxs::OTAPI_Exec::deleteAssetAccount | ( | const std::string & | SERVER_ID, |
const std::string & | USER_ID, | ||
const std::string & | ACCOUNT_ID | ||
) | const |
This allows you to delete an asset account from a server,
provided that the balance is 0 and the inbox and outbox are both empty.
Returns int32_t: -1 means error; no message was sent. -2 means the message was sent, but the request number must be passed as a string, so call GetLargeRequestNum. 0 means NO error, but also: no message was sent. >0 means NO error, and the message was sent, and the request number fits into an integer... ...and in fact the requestNum IS the return value! ===> In 99% of cases, this LAST option is what actually happens!!
Definition at line 2069 of file OTAPI_Exec.cpp.
int32_t opentxs::OTAPI_Exec::deleteUserAccount | ( | const std::string & | SERVER_ID, |
const std::string & | USER_ID | ||
) | const |
This allows you to delete a Nym from any server it is
registered at. NOTE: This will FAIL if the Nym has any transactions open at the server ("used but not closed"), as well as if there are any accounts or cron items still open at that server, or any receipts in the Nymbox.
Returns int32_t: -1 means error; no message was sent. -2 means the message was sent, but the request number must be passed as a string, so call GetLargeRequestNum. 0 means NO error, but also: no message was sent. >0 means NO error, and the message was sent, and the request number fits into an integer... ...and in fact the requestNum IS the return value! ===> In 99% of cases, this LAST option is what actually happens!!
Definition at line 13339 of file OTAPI_Exec.cpp.
int32_t opentxs::OTAPI_Exec::depositCheque | ( | const std::string & | SERVER_ID, |
const std::string & | USER_ID, | ||
const std::string & | ACCT_ID, | ||
const std::string & | THE_CHEQUE | ||
) | const |
--------------------------------------------------------------------------
DEPOSIT A CHEQUE (or VOUCHER) INTO AN ASSET ACCOUNT.
If someone gives you a cheque, you can use this function to message the server asking it to deposit the cheque into one of your asset accounts. (Of course the account and the cheque must be the same asset type.)
Since a voucher is simply a cheque drawn on an int32_t server account, you can deposit a voucher the same as any other cheque.
Returns int32_t: -1 means error; no message was sent. -2 means the message was sent, but the request number must be passed as a string, so call GetLargeRequestNum. 0 means NO error, but also: no message was sent. >0 means NO error, and the message was sent, and the request number fits into an integer... ...and in fact the requestNum IS the return value! ===> In 99% of cases, this LAST option is what actually happens!!
Definition at line 14635 of file OTAPI_Exec.cpp.
int32_t opentxs::OTAPI_Exec::depositPaymentPlan | ( | const std::string & | SERVER_ID, |
const std::string & | USER_ID, | ||
const std::string & | THE_PAYMENT_PLAN | ||
) | const |
--------------------------------------------------
DEPOSIT (ACTIVATE) PAYMENT PLAN
See ProposePaymentPlan / ConfirmPaymentPlan as well.
Returns int32_t: -1 means error; no message was sent. -2 means the message was sent, but the request number must be passed as a string, so call GetLargeRequestNum. 0 means NO error, but also: no message was sent. >0 means NO error, and the message was sent, and the request number fits into an integer... ...and in fact the requestNum IS the return value! ===> In 99% of cases, this LAST option is what actually happens!!
Definition at line 14678 of file OTAPI_Exec.cpp.
bool opentxs::OTAPI_Exec::DiscardCheque | ( | const std::string & | SERVER_ID, |
const std::string & | USER_ID, | ||
const std::string & | ACCT_ID, | ||
const std::string & | THE_CHEQUE | ||
) | const |
DISCARD A CHEQUE -- returns OT_TRUE or OT_FALSE When you write a cheque, your wallet software must use one of your transaction numbers on the cheque. Even when you give the cheque to someone, a good wallet should still store a copy of the cheque, until it is cashed. This way, if you decide to "tear it up" (perhaps the recipient left the country!) then you will still have a copy of the cheque, and you can get your transaction number back before discarding it. Why does it matter to get the transaction number back? Because once you sign that number out, you will have to CONTINUE signing it out on EVERY RECEIPT until that transaction is finally closed out. You are still responsible for that transaction number, until then. So most likely, if the cheque is going nowhere, then you will want to RETRIEVE the transaction number back from the cheque so you can use it on another transaction instead. *THIS* IS THE FUNCTION YOU SHOULD USE TO DO THAT!!!!
Returns OT_BOOL
Definition at line 4986 of file OTAPI_Exec.cpp.
bool opentxs::OTAPI_Exec::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 | ||
) | const |
Definition at line 1946 of file OTAPI_Exec.cpp.
std::string opentxs::OTAPI_Exec::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 | ||
) | const |
Definition at line 5165 of file OTAPI_Exec.cpp.
std::string opentxs::OTAPI_Exec::Encode | ( | const std::string & | strPlaintext, |
const bool & | bLineBreaks | ||
) | const |
OT-encode a plainext string.
This will pack, compress, and base64-encode a plain string. Returns the base64-encoded string, or nullptr.
internally: OTString strPlain(strPlaintext); OTASCIIArmor ascEncoded(thePlaintext); // ascEncoded now contains the OT-encoded string. return ascEncoded.Get(); // We return it.
OT-encode a plaintext string. (NOT ENCRYPT)
std::string OTAPI_Exec::Encode(const std::string& strPlaintext);
This will pack, compress, and base64-encode a plain string. Returns the base64-encoded string, or "".
Internally: OTString strPlain(strPlaintext); OTASCIIArmor ascEncoded(thePlaintext); // ascEncoded now contains the OT-encoded string. return ascEncoded.Get(); // We return it.
Definition at line 4287 of file OTAPI_Exec.cpp.
std::string opentxs::OTAPI_Exec::Encrypt | ( | const std::string & | RECIPIENT_NYM_ID, |
const std::string & | strPlaintext | ||
) | const |
OT-ENCRYPT a plainext string. (ASYMMETRIC)
EXPORT std::string Encrypt(const std::string& RECIPIENT_NYM_ID, const std::string& strPlaintext);
This will encode, ENCRYPT, and encode a plain string. Returns the base64-encoded ciphertext, or nullptr.
internally the C++ code is: OTString strPlain(strPlaintext); OTEnvelope theEnvelope; if (theEnvelope.Seal(RECIPIENT_NYM, strPlain)) { // Now it's encrypted (in binary form, inside the envelope), to the recipient's nym. OTASCIIArmor ascCiphertext(theEnvelope); // ascCiphertext now contains the base64-encoded ciphertext (as a string.) return ascCiphertext.Get(); }
OT-ENCRYPT a plaintext string. ASYMMETRIC
std::string OTAPI_Exec::Encrypt(const std::string& RECIPIENT_NYM_ID, const std::string& strPlaintext);
This will encode, ENCRYPT, and encode a plain string. Returns the base64-encoded ciphertext, or "".
Internally the C++ code is: OTString strPlain(strPlaintext); OTEnvelope theEnvelope; if (theEnvelope.Seal(RECIPIENT_NYM, strPlain)) { // Now it's encrypted (in binary form, inside the envelope), to the recipient's nym. OTASCIIArmor ascCiphertext(theEnvelope); // ascCiphertext now contains the base64-encoded ciphertext (as a string.) return ascCiphertext.Get(); }
Definition at line 4362 of file OTAPI_Exec.cpp.
int32_t opentxs::OTAPI_Exec::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 | ||
) | const |
--------------------------------------------------------------------------
EXCHANGE BASKET
Send a request to the server asking to exchange in or out of a basket currency.
For example, maybe you have 3 gold, 2 silver, and 5 dollars, and those are the ingredients of the "Rand" basket currency. This message allows you to ask the server to convert from your gold, silver, and dollar accounts into your Rand account. (Or convert from your Rand account back into your gold, silver, and dollar accounts.)
Other than this conversion process, (with the reserves stored internally by the server) basket accounts are identical to normal asset accounts – they are merely another asset type ID, and you can use them the same as you would use any other asset type (open accounts, write cheques, withdraw cash, trade on markets, etc.)
Returns int32_t: -1 means error; no message was sent. -2 means the message was sent, but the request number must be passed as a string, so call GetLargeRequestNum. 0 means NO error, but also: no message was sent. >0 means NO error, and the message was sent, and the request number fits into an integer... ...and in fact the requestNum IS the return value! ===> In 99% of cases, this LAST option is what actually happens!!
Definition at line 14162 of file OTAPI_Exec.cpp.
int32_t opentxs::OTAPI_Exec::exchangePurse | ( | const std::string & | SERVER_ID, |
const std::string & | ASSET_TYPE_ID, | ||
const std::string & | USER_ID, | ||
const std::string & | THE_PURSE | ||
) | const |
Messages the server. If failure, make sure you didn't lose that purse!!
If success, the new tokens will be returned shortly and saved into the appropriate purse. Note that an asset account isn't necessary to do this... just a nym operating cash-only. The same as exchanging a 20-dollar bill at the teller window for a replacement bill.
Returns int32_t: -1 means error; no message was sent. -2 means the message was sent, but the request number must be passed as a string, so call GetLargeRequestNum. 0 means NO error, but also: no message was sent. >0 means NO error, and the message was sent, and the request number fits into an integer... ...and in fact the requestNum IS the return value! ===> In 99% of cases, this LAST option is what actually happens!!
Definition at line 12778 of file OTAPI_Exec.cpp.
std::string opentxs::OTAPI_Exec::FlatSign | ( | const std::string & | SIGNER_NYM_ID, |
const std::string & | THE_INPUT, | ||
const std::string & | CONTRACT_TYPE | ||
) | const |
Definition at line 4582 of file OTAPI_Exec.cpp.
void opentxs::OTAPI_Exec::FlushMessageBuffer | ( | void | ) | const |
Definition at line 15102 of file OTAPI_Exec.cpp.
void opentxs::OTAPI_Exec::FlushSentMessages | ( | const bool & | bHarvestingForRetry, |
const std::string & | SERVER_ID, | ||
const std::string & | USER_ID, | ||
const std::string & | THE_NYMBOX | ||
) | const |
-----------------------------------------------------------
FlushSentMessages
Make sure to call this directly after a successful . (And ONLY at that time.)
This empties the buffer of sent messages. (Harvesting any transaction numbers that are still there.)
NOTE: You normally ONLY call this immediately after receiving a successful . It's only then that you can see which messages a server actually received or not – which transactions it processed (success or fail) vs which transactions did NOT process (and thus did NOT leave any success/fail receipt in the nymbox.)
I COULD have just flushed myself IN the code (where the reply is processed.) But then the developer using the OT API would never have the opportunity to see whether a message was replied to, and harvest it for himself (say, just before attempting a re-try, which I plan to do in the high-level Java API, which is why I'm coding it this way.)
This way, he can do that if he wishes, THEN call this function, and harvesting will still occur properly, and he will also thus have his chance to check for his own replies to harvest before then. This all depends on the developer using the API being smart enough to call this function after a successful !
Definition at line 15224 of file OTAPI_Exec.cpp.
std::string opentxs::OTAPI_Exec::FormatAmount | ( | const std::string & | ASSET_TYPE_ID, |
const int64_t & | THE_AMOUNT | ||
) | const |
FormatAmount:
Input: currency contract, amount. (And locale, internally.) Output: 545 becomes (for example) "$5.45"
Returns formatted string for output, for a given amount, based on currency contract and locale.
Definition at line 1349 of file OTAPI_Exec.cpp.
std::string opentxs::OTAPI_Exec::GenerateBasketCreation | ( | const std::string & | USER_ID, |
const int64_t & | MINIMUM_TRANSFER | ||
) | const |
----------------------------------------------------
GENERATE BASKET CREATION REQUEST
(returns the basket in string form.)
Call AddBasketCreationItem multiple times to add the various currencies to the basket, and then call issueBasket to send the request to the server.
Definition at line 13879 of file OTAPI_Exec.cpp.
std::string opentxs::OTAPI_Exec::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 | ||
) | const |
----------------------------------------------------
GENERATE BASKET EXCHANGE REQUEST
(Returns the new basket exchange request in string form.)
Call this function first. Then call AddBasketExchangeItem multiple times, and then finally call exchangeBasket to send the request to the server.
Definition at line 14029 of file OTAPI_Exec.cpp.
int32_t opentxs::OTAPI_Exec::getAccount | ( | const std::string & | SERVER_ID, |
const std::string & | USER_ID, | ||
const std::string & | ACCT_ID | ||
) | const |
--------------------------------------------------------------------------
GET ACCOUNT – Send a message to the server asking it to send you the latest copy of any of your asset accounts (incl. the current balance.)
Returns int32_t: -1 means error; no message was sent. -2 means the message was sent, but the request number must be passed as a string, so call GetLargeRequestNum. 0 means NO error, but also: no message was sent. >0 means NO error, and the message was sent, and the request number fits into an integer... ...and in fact the requestNum IS the return value! ===> In 99% of cases, this LAST option is what actually happens!!
Definition at line 13816 of file OTAPI_Exec.cpp.
int32_t opentxs::OTAPI_Exec::GetAccountCount | ( | void | ) | const |
Definition at line 1521 of file OTAPI_Exec.cpp.
int32_t opentxs::OTAPI_Exec::getAccountFiles | ( | const std::string & | SERVER_ID, |
const std::string & | USER_ID, | ||
const std::string & | ACCT_ID | ||
) | const |
Definition at line 13849 of file OTAPI_Exec.cpp.
std::string opentxs::OTAPI_Exec::GetAccountWallet_AssetTypeID | ( | const std::string & | ACCOUNT_ID | ) | const |
Definition at line 4823 of file OTAPI_Exec.cpp.
int64_t opentxs::OTAPI_Exec::GetAccountWallet_Balance | ( | const std::string & | ACCOUNT_ID | ) | const |
Definition at line 4793 of file OTAPI_Exec.cpp.
std::string opentxs::OTAPI_Exec::GetAccountWallet_ID | ( | const int32_t & | nIndex | ) | const |
You already have accounts in your wallet (without any server communications)
and these functions allow you to query the data members of those accounts. Thus, "AccountWallet" denotes that you are examining copies of your accounts that are sitting in your wallet. Originally the purpose was to eliminate confusion with a different set of similarly-named functions.
Definition at line 4161 of file OTAPI_Exec.cpp.
std::string opentxs::OTAPI_Exec::GetAccountWallet_InboxHash | ( | const std::string & | ACCOUNT_ID | ) | const |
Definition at line 4204 of file OTAPI_Exec.cpp.
std::string opentxs::OTAPI_Exec::GetAccountWallet_Name | ( | const std::string & | ACCOUNT_ID | ) | const |
Definition at line 4185 of file OTAPI_Exec.cpp.
std::string opentxs::OTAPI_Exec::GetAccountWallet_NymID | ( | const std::string & | ACCOUNT_ID | ) | const |
Definition at line 4869 of file OTAPI_Exec.cpp.
std::string opentxs::OTAPI_Exec::GetAccountWallet_OutboxHash | ( | const std::string & | ACCOUNT_ID | ) | const |
Definition at line 4232 of file OTAPI_Exec.cpp.
std::string opentxs::OTAPI_Exec::GetAccountWallet_ServerID | ( | const std::string & | ACCOUNT_ID | ) | const |
Definition at line 4848 of file OTAPI_Exec.cpp.
std::string opentxs::OTAPI_Exec::GetAccountWallet_Type | ( | const std::string & | ACCOUNT_ID | ) | const |
Definition at line 4806 of file OTAPI_Exec.cpp.
std::string opentxs::OTAPI_Exec::GetActiveCronItem | ( | const std::string & | SERVER_ID, |
int64_t | lTransNum | ||
) | const |
Definition at line 631 of file OTAPI_Exec.cpp.
std::string opentxs::OTAPI_Exec::GetAssetType_Contract | ( | const std::string & | ASSET_TYPE_ID | ) | const |
Definition at line 1387 of file OTAPI_Exec.cpp.
std::string opentxs::OTAPI_Exec::GetAssetType_ID | ( | const int32_t & | nIndex | ) | const |
Definition at line 4102 of file OTAPI_Exec.cpp.
std::string opentxs::OTAPI_Exec::GetAssetType_Name | ( | const std::string & | ASSET_TYPE_ID | ) | const |
Definition at line 4125 of file OTAPI_Exec.cpp.
std::string opentxs::OTAPI_Exec::GetAssetType_TLA | ( | const std::string & | THE_ID | ) | const |
Definition at line 4143 of file OTAPI_Exec.cpp.
int32_t opentxs::OTAPI_Exec::GetAssetTypeCount | ( | void | ) | const |
Definition at line 1516 of file OTAPI_Exec.cpp.
int32_t opentxs::OTAPI_Exec::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 | ||
) | const |
The Nymbox/Inbox/Outbox only contain abbreviated receipts, with a hash for zero-knowledge
proof of the entire receipt. (Messages were getting too big, it couldn't be helped. Sorry.) Once you download your nym/in/out/XYZbox and load it into memory from storage, you iterate through it and download all the box receipts (preferably only once.) Once you load those up, it's as if the various pieces were never sundered into multiple files to begin with. Then you can verify the box and do all the normal operations. How to use? Call getInbox (say), and if successful, loadInbox().
Definition at line 2008 of file OTAPI_Exec.cpp.
int32_t opentxs::OTAPI_Exec::getContract | ( | const std::string & | SERVER_ID, |
const std::string & | USER_ID, | ||
const std::string & | ASSET_ID | ||
) | const |
--------------------------------------------------------------------
GET CONTRACT – Get server's copy of any asset contract, by asset type ID.
Returns int32_t: -1 means error; no message was sent. -2 means the message was sent, but the request number must be passed as a string, so call GetLargeRequestNum. 0 means NO error, but also: no message was sent. >0 means NO error, and the message was sent, and the request number fits into an integer... ...and in fact the requestNum IS the return value! ===> In 99% of cases, this LAST option is what actually happens!!
Definition at line 13715 of file OTAPI_Exec.cpp.
int32_t opentxs::OTAPI_Exec::getInbox | ( | const std::string & | SERVER_ID, |
const std::string & | USER_ID, | ||
const std::string & | ACCT_ID | ||
) | const |
--------------------------------------------------------------------------
GET A COPY OF MY INBOX
Each asset account has its own inbox/outbox. If a pending transfer is in my inbox, or a new receipt, I might want to see that. This message asks the server to send me the latest copy of the inbox for any given account (and will save it to my local storage, so I can then load it using LoadInbox, which I haven't written yet.
NOTE: the test client, upon receiving a @getInbox response from the server, will automatically process that into a processInbox command back to the server, automatically accepting all of the transactions, resulting in a final @processInbox reply from the server. Obviously a real GUI client would merely display the inbox to the user, where the user could choose to accept the items individually.
SO HOW WOULD YOU USE THIS? To process your inbox...
– First you call getInbox to grab the latest inbox from the server. (You will also want to call getOutbox as well as getAccount, since you need to have the latest versions of those files, or your balance agreement will be calculated wrong, causing your transaction to fail.)
– Then you call LoadInbox to load it from local storage.
During this time, your user has the opportunity to peruse the inbox, and to decide which transactions therein he wishes to accept or reject. If you want to display the inbox items on the screen, use these functions to loop through them: Ledger_GetCount Ledger_GetTransactionByIndex Ledger_GetTransactionIDByIndex
You will probably ask me for more introspection on the transactions themselves. (Just ask – No problem.) Here's what you have right now: Transaction_GetType
– Then call Ledger_CreateResponse in order to create a 'response' ledger for that inbox, which will be sent to the server.
– Then call Ledger_GetCount (pass it the inbox) to find out how many transactions are inside of it. Use that count to LOOP through them...
– Use Ledger_GetTransactionByIndex to grab each transaction as you iterate through the inbox.
– Call Transaction_CreateResponse to create a response for each transaction, accepting or rejecting it, and adding it to the response ledger.
– Penultimately, call Ledger_FinalizeResponse() which will create a Balance Agreement for the ledger.
– Finally, call processInbox to send that response ledger to the server and process the various items.
Definition at line 14363 of file OTAPI_Exec.cpp.
int32_t opentxs::OTAPI_Exec::getMarketList | ( | const std::string & | SERVER_ID, |
const std::string & | USER_ID | ||
) | const |
Retrieves details for each market.
What objects are actually stored in local storage after a successful server call?
A "MarketList", which contains a list of Market Datas. Load this up and you can get pointers to the elements as needed. THERE IS ONLY ONE OF THESE.
An "OfferList" which contains "all" offers for a specific Market ID. There may be many markets, so this should be saved by Server / Asset / User the same as Purses. If you load this object, you can loop through its offers. I don't think a sub-object is necessary here since the data is so simple.
A "TradeList" which contains "all" trades for a specific Market ID. There many be many markets, so this should be saved Server/Asset/User the same as purses. If you load this object you can loop through the trades, which again, no sub-object needed since the data here is so simple. But we shall see!
A "NymOfferList" which contains all offers for a specific nym. Unlike the above offers, these offers are full-featured and should contain a LOT more details.
Definition at line 14921 of file OTAPI_Exec.cpp.
int32_t opentxs::OTAPI_Exec::getMarketOffers | ( | const std::string & | SERVER_ID, |
const std::string & | USER_ID, | ||
const std::string & | MARKET_ID, | ||
const int64_t & | MAX_DEPTH | ||
) | const |
Gets all offers for a specific market and their details (up until.
Definition at line 14948 of file OTAPI_Exec.cpp.
int32_t opentxs::OTAPI_Exec::getMarketRecentTrades | ( | const std::string & | SERVER_ID, |
const std::string & | USER_ID, | ||
const std::string & | MARKET_ID | ||
) | const |
Gets all recent trades (up until maximum depth)
Definition at line 14990 of file OTAPI_Exec.cpp.
std::string opentxs::OTAPI_Exec::GetMemlogAtIndex | ( | const int32_t & | nIndex | ) | const |
Definition at line 378 of file OTAPI_Exec.cpp.
int32_t opentxs::OTAPI_Exec::GetMemlogSize | ( | ) | const |
The below functions are for retrieving log data programatically.
Definition at line 373 of file OTAPI_Exec.cpp.
int32_t opentxs::OTAPI_Exec::getMint | ( | const std::string & | SERVER_ID, |
const std::string & | USER_ID, | ||
const std::string & | ASSET_ID | ||
) | const |
--------------------------------------------------------------------------
Get server's copy of public Mint file (which contains the public minting keys for each asset type. Withdrawal requests will not work for any given asset type until you have downloaded the mint for that asset type.)
Returns int32_t: -1 means error; no message was sent. -2 means the message was sent, but the request number must be passed as a string, so call GetLargeRequestNum. 0 means NO error, but also: no message was sent. >0 means NO error, and the message was sent, and the request number fits into an integer... ...and in fact the requestNum IS the return value! ===> In 99% of cases, this LAST option is what actually happens!!
Definition at line 13748 of file OTAPI_Exec.cpp.
std::string opentxs::OTAPI_Exec::GetNym_ActiveCronItemIDs | ( | const std::string & | NYM_ID, |
const std::string & | SERVER_ID | ||
) | const |
Definition at line 607 of file OTAPI_Exec.cpp.
std::string opentxs::OTAPI_Exec::GetNym_AltSourceLocation | ( | const std::string & | NYM_ID | ) | const |
Definition at line 673 of file OTAPI_Exec.cpp.
std::string opentxs::OTAPI_Exec::GetNym_CredentialContents | ( | const std::string & | NYM_ID, |
const std::string & | CREDENTIAL_ID | ||
) | const |
Definition at line 732 of file OTAPI_Exec.cpp.
int32_t opentxs::OTAPI_Exec::GetNym_CredentialCount | ( | const std::string & | NYM_ID | ) | const |
Definition at line 691 of file OTAPI_Exec.cpp.
std::string opentxs::OTAPI_Exec::GetNym_CredentialID | ( | const std::string & | NYM_ID, |
const int32_t & | nIndex | ||
) | const |
Definition at line 709 of file OTAPI_Exec.cpp.
std::string opentxs::OTAPI_Exec::GetNym_ID | ( | const int32_t & | nIndex | ) | const |
based on Index this returns the Nym's ID
Definition at line 2528 of file OTAPI_Exec.cpp.
std::string opentxs::OTAPI_Exec::GetNym_InboxHash | ( | const std::string & | ACCOUNT_ID, |
const std::string & | NYM_ID | ||
) | const |
Definition at line 2717 of file OTAPI_Exec.cpp.
std::string opentxs::OTAPI_Exec::GetNym_MailContentsByIndex | ( | const std::string & | NYM_ID, |
const int32_t & | nIndex | ||
) | const |
Definition at line 2830 of file OTAPI_Exec.cpp.
int32_t opentxs::OTAPI_Exec::GetNym_MailCount | ( | const std::string & | NYM_ID | ) | const |
Each Nym has mail messages, they can come from different servers.
This allows you to peruse the mail for a given Nym, and erase messages.
So how would you actually USE this to browse a Nym's mail? -- Call GetNym_MailCount() to find out how many mail items there are. -- Then LOOP through them, and use GetNym_MailSenderIDByIndex and GetNym_MailServerIDByIndex to populate the list. -- If you want to add a subject display, you'll have to call GetNym_MailContentsByIndex() and check for a first line beginning in Subject: (there may not be one.) -- GetNym_MailContentsByIndex returns the body of the mail regardless. -- Use Nym_VerifyMailByIndex() to verify the signature on the mail, -- and use Nym_RemoveMailByIndex() to erase mail (when you want to.)
Definition at line 2817 of file OTAPI_Exec.cpp.
std::string opentxs::OTAPI_Exec::GetNym_MailSenderIDByIndex | ( | const std::string & | NYM_ID, |
const int32_t & | nIndex | ||
) | const |
Definition at line 2867 of file OTAPI_Exec.cpp.
std::string opentxs::OTAPI_Exec::GetNym_MailServerIDByIndex | ( | const std::string & | NYM_ID, |
const int32_t & | nIndex | ||
) | const |
Definition at line 2898 of file OTAPI_Exec.cpp.
int32_t opentxs::OTAPI_Exec::getNym_MarketOffers | ( | const std::string & | SERVER_ID, |
const std::string & | USER_ID | ||
) | const |
This "Market Offer" data is a lot more detailed than the.
Definition at line 15023 of file OTAPI_Exec.cpp.
std::string opentxs::OTAPI_Exec::GetNym_Name | ( | const std::string & | NYM_ID | ) | const |
Returns Nym Name (based on NymID)
Definition at line 2553 of file OTAPI_Exec.cpp.
std::string opentxs::OTAPI_Exec::GetNym_NymboxHash | ( | const std::string & | SERVER_ID, |
const std::string & | NYM_ID | ||
) | const |
Definition at line 2617 of file OTAPI_Exec.cpp.
std::string opentxs::OTAPI_Exec::GetNym_OutboxHash | ( | const std::string & | ACCOUNT_ID, |
const std::string & | NYM_ID | ||
) | const |
Definition at line 2767 of file OTAPI_Exec.cpp.
std::string opentxs::OTAPI_Exec::GetNym_OutmailContentsByIndex | ( | const std::string & | NYM_ID, |
const int32_t & | nIndex | ||
) | const |
Definition at line 3026 of file OTAPI_Exec.cpp.
int32_t opentxs::OTAPI_Exec::GetNym_OutmailCount | ( | const std::string & | NYM_ID | ) | const |
Definition at line 3013 of file OTAPI_Exec.cpp.
std::string opentxs::OTAPI_Exec::GetNym_OutmailRecipientIDByIndex | ( | const std::string & | NYM_ID, |
const int32_t & | nIndex | ||
) | const |
Definition at line 3059 of file OTAPI_Exec.cpp.
std::string opentxs::OTAPI_Exec::GetNym_OutmailServerIDByIndex | ( | const std::string & | NYM_ID, |
const int32_t & | nIndex | ||
) | const |
Definition at line 3089 of file OTAPI_Exec.cpp.
std::string opentxs::OTAPI_Exec::GetNym_OutpaymentsContentsByIndex | ( | const std::string & | NYM_ID, |
const int32_t & | nIndex | ||
) | const |
Definition at line 3222 of file OTAPI_Exec.cpp.
int32_t opentxs::OTAPI_Exec::GetNym_OutpaymentsCount | ( | const std::string & | NYM_ID | ) | const |
Definition at line 3208 of file OTAPI_Exec.cpp.
std::string opentxs::OTAPI_Exec::GetNym_OutpaymentsRecipientIDByIndex | ( | const std::string & | NYM_ID, |
const int32_t & | nIndex | ||
) | const |
Definition at line 3262 of file OTAPI_Exec.cpp.
std::string opentxs::OTAPI_Exec::GetNym_OutpaymentsServerIDByIndex | ( | const std::string & | NYM_ID, |
const int32_t & | nIndex | ||
) | const |
Definition at line 3292 of file OTAPI_Exec.cpp.
std::string opentxs::OTAPI_Exec::GetNym_RecentHash | ( | const std::string & | SERVER_ID, |
const std::string & | NYM_ID | ||
) | const |
Definition at line 2668 of file OTAPI_Exec.cpp.
std::string opentxs::OTAPI_Exec::GetNym_RevokedCredContents | ( | const std::string & | NYM_ID, |
const std::string & | CREDENTIAL_ID | ||
) | const |
Definition at line 797 of file OTAPI_Exec.cpp.
int32_t opentxs::OTAPI_Exec::GetNym_RevokedCredCount | ( | const std::string & | NYM_ID | ) | const |
Definition at line 755 of file OTAPI_Exec.cpp.
std::string opentxs::OTAPI_Exec::GetNym_RevokedCredID | ( | const std::string & | NYM_ID, |
const int32_t & | nIndex | ||
) | const |
Definition at line 773 of file OTAPI_Exec.cpp.
std::string opentxs::OTAPI_Exec::GetNym_SourceForID | ( | const std::string & | NYM_ID | ) | const |
Definition at line 656 of file OTAPI_Exec.cpp.
std::string opentxs::OTAPI_Exec::GetNym_Stats | ( | const std::string & | NYM_ID | ) | const |
Definition at line 2592 of file OTAPI_Exec.cpp.
std::string opentxs::OTAPI_Exec::GetNym_SubCredentialContents | ( | const std::string & | NYM_ID, |
const std::string & | MASTER_CRED_ID, | ||
const std::string & | SUB_CRED_ID | ||
) | const |
Definition at line 881 of file OTAPI_Exec.cpp.
int32_t opentxs::OTAPI_Exec::GetNym_SubcredentialCount | ( | const std::string & | NYM_ID, |
const std::string & | MASTER_CRED_ID | ||
) | const |
Definition at line 820 of file OTAPI_Exec.cpp.
std::string opentxs::OTAPI_Exec::GetNym_SubCredentialID | ( | const std::string & | NYM_ID, |
const std::string & | MASTER_CRED_ID, | ||
const int32_t & | nIndex | ||
) | const |
Definition at line 852 of file OTAPI_Exec.cpp.
int32_t opentxs::OTAPI_Exec::GetNym_TransactionNumCount | ( | const std::string & | SERVER_ID, |
const std::string & | NYM_ID | ||
) | const |
----------------------------------------------------------
GET NYM TRANSACTION NUM COUNT How many transaction numbers does the Nym have (for a given server?)
This function returns the count of numbers available. If 0, then no transactions will work until you call getTransactionNumber() to replenish your Nym's supply for that ServerID...
Returns a count (0 through N numbers available), or -1 for error (no nym found.)
Definition at line 4034 of file OTAPI_Exec.cpp.
int32_t opentxs::OTAPI_Exec::getNymbox | ( | const std::string & | SERVER_ID, |
const std::string & | USER_ID | ||
) | const |
Definition at line 14395 of file OTAPI_Exec.cpp.
int32_t opentxs::OTAPI_Exec::GetNymCount | ( | void | ) | const |
Definition at line 1506 of file OTAPI_Exec.cpp.
int32_t opentxs::OTAPI_Exec::getOutbox | ( | const std::string & | SERVER_ID, |
const std::string & | USER_ID, | ||
const std::string & | ACCT_ID | ||
) | const |
Definition at line 14422 of file OTAPI_Exec.cpp.
int32_t opentxs::OTAPI_Exec::getRequest | ( | const std::string & | SERVER_ID, |
const std::string & | USER_ID | ||
) | const |
GET REQUEST NUMBER
Nearly every message to the server needs to have the current "Request Number" attached to it. This is a number that, for each user, starts at 0, and increments with each command. Usually, the number simply increments on both sides, and there is no need to communicate it.
BUT SOMETIMES the request number GOES OUT OF SYNC... When this happen, none of your commands will work anymore!
To fix it, just call this function.
After you call it, it will automatically synchronize your wallet with the request number on the server side, and your commands will start working again.
Without understanding this simple concept, NONE of your messages will go through! This mechanism prevents an attack from intercepting a message and sending it multiple times.
Definition at line 13654 of file OTAPI_Exec.cpp.
std::string opentxs::OTAPI_Exec::GetSentMessage | ( | const int64_t & | REQUEST_NUMBER, |
const std::string & | SERVER_ID, | ||
const std::string & | USER_ID | ||
) | const |
Definition at line 15129 of file OTAPI_Exec.cpp.
std::string opentxs::OTAPI_Exec::GetServer_Contract | ( | const std::string & | SERVER_ID | ) | const |
Definition at line 1295 of file OTAPI_Exec.cpp.
std::string opentxs::OTAPI_Exec::GetServer_ID | ( | const int32_t & | nIndex | ) | const |
Definition at line 4061 of file OTAPI_Exec.cpp.
std::string opentxs::OTAPI_Exec::GetServer_Name | ( | const std::string & | SERVER_ID | ) | const |
Definition at line 4084 of file OTAPI_Exec.cpp.
int32_t opentxs::OTAPI_Exec::GetServerCount | ( | void | ) | const |
--------------------------------------------------
NOTE: THE BELOW FUNCTIONS DO NOT SEND ANY MESSAGE TO THE SERVER, BUT RATHER, THEY ONLY QUERY FOR DATA FROM LOCAL STORAGE.
Often a server response will cause a change to the data in local storage. These functions allow you to re-load that data so your GUI can reflect the updates to those files.
Definition at line 1511 of file OTAPI_Exec.cpp.
time64_t opentxs::OTAPI_Exec::GetTime | ( | void | ) | const |
TIME (in seconds)
This will return the current time in seconds, as a string. Returns nullptr if failure.
Todo: consider making this available on the server side as well, so the smart contracts can see what time it is.
TIME (in seconds, as string)
This will return the current time in seconds, as a string. Returns "" if failure.
Todo: consider making this available on the server side as well, so the smart contracts can see what time it is.
Definition at line 4269 of file OTAPI_Exec.cpp.
int32_t opentxs::OTAPI_Exec::getTransactionNumber | ( | const std::string & | SERVER_ID, |
const std::string & | USER_ID | ||
) | const |
GET TRANSACTION NUMBER
Every TRANSACTION must be accompanied by a TRANSACTION NUMBER and you can only use a transaction number that was given to you previously by the server. If you run out of transaction numbers, then just call the below API function to get a new one (call it a few times so your wallet has a few in reserve.)
The server usually sends you new transaction numbers whenever you successfully do commands, but if you run out, you just call that function.
Without understanding this, none of your transactions would ever go through! This mechanism is what makes it possible to prove balances and transactions, without having to store any account history!
Definition at line 14209 of file OTAPI_Exec.cpp.
bool opentxs::OTAPI_Exec::HaveAlreadySeenReply | ( | const std::string & | SERVER_ID, |
const std::string & | USER_ID, | ||
const int64_t & | REQUEST_NUMBER | ||
) | const |
If the client-side has ALREADY seen the server's reply to a specific
request number, he stores that number in a list which can be queried using this function. A copy of that list is sent with nearly every request message sent to the server. This way the server can see which replies you have already received. The server will mirror every number it sees (it sends its own list in all its replies.) Whenever you see a number mirrored in the server's reply, that means the server now knows you got its original reply (the one referenced by the number) and the server removed any replyNotice of that from your Nymbox (so you don't have to download it.) Basically that means you can go ahead and remove it from your list, and once you do, the server will remove its matching copy as well. When you are downloading your box receipts, you can skip any receipts where you have ALREADY seen the reply. So you can use this function to see if you already saw it, and if you did, then you can skip downloading that box receipt. Warning: this function isn't "perfect", in the sense that it cannot tell you definitively whether you have actually seen a server reply, but it CAN tell you if you have seen one until it finishes the above-described protocol (it will work in that way, which is how it was intended.) But after that, it will no longer know if you got the reply since it has removed it from its list. returns OT_BOOL.
Definition at line 8236 of file OTAPI_Exec.cpp.
std::string opentxs::OTAPI_Exec::Hook_GetClauseAtIndex | ( | const std::string & | THE_CONTRACT, |
const std::string & | BYLAW_NAME, | ||
const std::string & | HOOK_NAME, | ||
const int32_t & | nIndex | ||
) | const |
Multiple clauses can trigger from the same hook. Hook_GetClauseCount and Hook_GetClauseAtIndex allow you to iterate through them. This function returns the name for the clause at the specified index.
Definition at line 6821 of file OTAPI_Exec.cpp.
int32_t opentxs::OTAPI_Exec::Hook_GetClauseCount | ( | const std::string & | THE_CONTRACT, |
const std::string & | BYLAW_NAME, | ||
const std::string & | HOOK_NAME | ||
) | const |
Returns the number of clauses attached to a specific hook.
Definition at line 6770 of file OTAPI_Exec.cpp.
std::string opentxs::OTAPI_Exec::Hook_GetNameByIndex | ( | const std::string & | THE_CONTRACT, |
const std::string & | BYLAW_NAME, | ||
const int32_t & | nIndex | ||
) | const |
Definition at line 6732 of file OTAPI_Exec.cpp.
int64_t opentxs::OTAPI_Exec::Instrmnt_GetAmount | ( | const std::string & | THE_INSTRUMENT | ) | const |
THESE FUNCTIONS were added for the PAYMENTS screen. (They are fairly new.)
Basically there was a need to have DIFFERENT instruments, but to be able to treat them as though they are a single type.
In keeping with that, the below functions will work with disparate types. You can pass [ CHEQUES / VOUCHERS / INVOICES ] and PAYMENT PLANS, and SMART CONTRACTS, and PURSEs into these functions, and they should be able to handle any of those types.
Definition at line 3422 of file OTAPI_Exec.cpp.
std::string opentxs::OTAPI_Exec::Instrmnt_GetAssetID | ( | const std::string & | THE_INSTRUMENT | ) | const |
Definition at line 3665 of file OTAPI_Exec.cpp.
std::string opentxs::OTAPI_Exec::Instrmnt_GetMemo | ( | const std::string & | THE_INSTRUMENT | ) | const |
Definition at line 3588 of file OTAPI_Exec.cpp.
std::string opentxs::OTAPI_Exec::Instrmnt_GetRecipientAcctID | ( | const std::string & | THE_INSTRUMENT | ) | const |
Definition at line 3900 of file OTAPI_Exec.cpp.
std::string opentxs::OTAPI_Exec::Instrmnt_GetRecipientUserID | ( | const std::string & | THE_INSTRUMENT | ) | const |
Definition at line 3860 of file OTAPI_Exec.cpp.
std::string opentxs::OTAPI_Exec::Instrmnt_GetRemitterAcctID | ( | const std::string & | THE_INSTRUMENT | ) | const |
Definition at line 3743 of file OTAPI_Exec.cpp.
std::string opentxs::OTAPI_Exec::Instrmnt_GetRemitterUserID | ( | const std::string & | THE_INSTRUMENT | ) | const |
Definition at line 3704 of file OTAPI_Exec.cpp.
std::string opentxs::OTAPI_Exec::Instrmnt_GetSenderAcctID | ( | const std::string & | THE_INSTRUMENT | ) | const |
Definition at line 3821 of file OTAPI_Exec.cpp.
std::string opentxs::OTAPI_Exec::Instrmnt_GetSenderUserID | ( | const std::string & | THE_INSTRUMENT | ) | const |
Definition at line 3782 of file OTAPI_Exec.cpp.
std::string opentxs::OTAPI_Exec::Instrmnt_GetServerID | ( | const std::string & | THE_INSTRUMENT | ) | const |
Definition at line 3626 of file OTAPI_Exec.cpp.
int64_t opentxs::OTAPI_Exec::Instrmnt_GetTransNum | ( | const std::string & | THE_INSTRUMENT | ) | const |
Definition at line 3451 of file OTAPI_Exec.cpp.
std::string opentxs::OTAPI_Exec::Instrmnt_GetType | ( | const std::string & | THE_INSTRUMENT | ) | const |
Definition at line 3551 of file OTAPI_Exec.cpp.
time64_t opentxs::OTAPI_Exec::Instrmnt_GetValidFrom | ( | const std::string & | THE_INSTRUMENT | ) | const |
Definition at line 3483 of file OTAPI_Exec.cpp.
time64_t opentxs::OTAPI_Exec::Instrmnt_GetValidTo | ( | const std::string & | THE_INSTRUMENT | ) | const |
Definition at line 3517 of file OTAPI_Exec.cpp.
bool opentxs::OTAPI_Exec::IsBasketCurrency | ( | const std::string & | ASSET_TYPE_ID | ) | const |
--------------------------------------------------------------
IS BASKET CURRENCY ?
Tells you whether or not a given asset type is actually a basket currency.
Definition at line 13133 of file OTAPI_Exec.cpp.
bool opentxs::OTAPI_Exec::IsNym_RegisteredAtServer | ( | const std::string & | NYM_ID, |
const std::string & | SERVER_ID | ||
) | const |
Definition at line 2571 of file OTAPI_Exec.cpp.
int32_t opentxs::OTAPI_Exec::issueAssetType | ( | const std::string & | SERVER_ID, |
const std::string & | USER_ID, | ||
const std::string & | THE_CONTRACT | ||
) | const |
--------------------------------------------------------------------
ISSUE ASSET TYPE – Ask the server to issue a new asset type.
THE_CONTRACT is actually a string containing the asset contract itself. (And the server will not issue the new asset type unless the key in the contract matches YOUR UserID. Only the contract signer may issue it.)
Returns int32_t: -1 means error; no message was sent. -2 means the message was sent, but the request number must be passed as a string, so call GetLargeRequestNum. 0 means NO error, but also: no message was sent. >0 means NO error, and the message was sent, and the request number fits into an integer... ...and in fact the requestNum IS the return value! ===> In 99% of cases, this LAST option is what actually happens!!
Definition at line 13681 of file OTAPI_Exec.cpp.
int32_t opentxs::OTAPI_Exec::issueBasket | ( | const std::string & | SERVER_ID, |
const std::string & | USER_ID, | ||
const std::string & | THE_BASKET | ||
) | const |
--------------------------------------------------------------------------
ISSUE BASKET CURRENCY
Issue a new asset type based on a BASKET of other asset types! You cannot call this function until you first set up the BASKET_INFO object. I will provide functions for setting up that object, so that you can then call this function to actually message the server with your request.
ANYONE can issue a new basket type, but they will have no control over the issuer account. Normally when issuing a currency, you therefore control the issuer account. But with baskets, that is managed internally by the server. This means anyone can define a basket, and all may use it – but no one controls it except the server.
Returns int32_t: -1 means error; no message was sent. -2 means the message was sent, but the request number must be passed as a string, so call GetLargeRequestNum. 0 means NO error, but also: no message was sent. >0 means NO error, and the message was sent, and the request number fits into an integer... ...and in fact the requestNum IS the return value! ===> In 99% of cases, this LAST option is what actually happens!!
Definition at line 13997 of file OTAPI_Exec.cpp.
int32_t opentxs::OTAPI_Exec::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 | ||
) | const |
--------------------------------------------------
ISSUE MARKET OFFER
Returns int32_t: -1 means error; no message was sent. -2 means the message was sent, but the request number must be passed as a string, so call GetLargeRequestNum. 0 means NO error, but also: no message was sent. >0 means NO error, and the message was sent, and the request number fits into an integer... ...and in fact the requestNum IS the return value! ===> In 99% of cases, this LAST option is what actually happens!!
Definition at line 14802 of file OTAPI_Exec.cpp.
int32_t opentxs::OTAPI_Exec::killMarketOffer | ( | const std::string & | SERVER_ID, |
const std::string & | USER_ID, | ||
const std::string & | ASSET_ACCT_ID, | ||
const int64_t & | TRANSACTION_NUMBER | ||
) | const |
Definition at line 14715 of file OTAPI_Exec.cpp.
int32_t opentxs::OTAPI_Exec::killPaymentPlan | ( | const std::string & | SERVER_ID, |
const std::string & | USER_ID, | ||
const std::string & | FROM_ACCT_ID, | ||
const int64_t & | TRANSACTION_NUMBER | ||
) | const |
Definition at line 14759 of file OTAPI_Exec.cpp.
std::string opentxs::OTAPI_Exec::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 | ||
) | const |
Add a transaction to a ledger.
Definition at line 9448 of file OTAPI_Exec.cpp.
std::string opentxs::OTAPI_Exec::Ledger_CreateResponse | ( | const std::string & | SERVER_ID, |
const std::string & | USER_ID, | ||
const std::string & | ACCOUNT_ID, | ||
const std::string & | ORIGINAL_LEDGER | ||
) | const |
Creates a new 'response' ledger, set up with the right Server ID, etc,.
add the 'response' transactions to it, one by one. (Pass in the original that you are responding to, as it uses the data from it to set up the
Definition at line 8887 of file OTAPI_Exec.cpp.
std::string opentxs::OTAPI_Exec::Ledger_FinalizeResponse | ( | const std::string & | SERVER_ID, |
const std::string & | USER_ID, | ||
const std::string & | ACCOUNT_ID, | ||
const std::string & | THE_LEDGER | ||
) | const |
-------------------------------------------------------------------------
(Response Ledger) LEDGER FINALIZE RESPONSE
AFTER you have set up all the transaction responses, call THIS function to finalize them by adding a BALANCE AGREEMENT.
MAKE SURE you have the latest copy of the account file, inbox file, and outbox file, since we will need those in here to create the balance statement properly.
(Client software may wish to check those things, when downloaded, against the local copies and the local signed receipts. In this way, clients can protect themselves against malicious servers.)
Definition at line 9954 of file OTAPI_Exec.cpp.
int32_t opentxs::OTAPI_Exec::Ledger_GetCount | ( | const std::string & | SERVER_ID, |
const std::string & | USER_ID, | ||
const std::string & | ACCOUNT_ID, | ||
const std::string & | THE_LEDGER | ||
) | const |
Find out how many pending transactions (and receipts) are in this inbox.
SO HOW WOULD YOU USE THIS? To process your inbox...
– First you call OTAPI_Exec::getInbox to grab the latest inbox from the server. (You will also want to call OTAPI_Exec::getOutbox as well as OTAPI_Exec::getAccount, since you need to have the latest versions of those files, or your balance agreement will be calculated wrong, causing your transaction to fail.)
– Then you call OTAPI_Exec::LoadInbox to load it from local storage.
During this time, your user has the opportunity to peruse the inbox, and to decide which transactions therein he wishes to accept or reject. If you want to display the inbox items on the screen, use these functions to loop through them: OTAPI_Exec::Ledger_GetCount OTAPI_Exec::Ledger_GetTransactionByIndex OTAPI_Exec::Ledger_GetTransactionIDByIndex
You will probably ask me for more introspection on the transactions themselves. (Just ask – No problem.) Here's what you have right now: OTAPI_Exec::Transaction_GetType
– Then call OTAPI_Exec::Ledger_CreateResponse in order to create a 'response' ledger for that inbox, which will be sent to the server.
– Then call OTAPI_Exec::Ledger_GetCount (pass it the inbox) to find out how many transactions are inside of it. Use that count to LOOP through them...
– Use OTAPI_Exec::Ledger_GetTransactionByIndex to grab each transaction as you iterate through the inbox.
– Call OTAPI_Exec::Transaction_CreateResponse to create a response for each transaction, accepting or rejecting it, and adding it to the response ledger.
– Penultimately, call OTAPI_Exec::Ledger_FinalizeResponse() which will create a Balance Agreement for the ledger.
– Finally, call OTAPI_Exec::processInbox to send that response ledger to the server and process the various items.
Definition at line 8840 of file OTAPI_Exec.cpp.
std::string opentxs::OTAPI_Exec::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 | ||
) | const |
-------------------------------------------------------------------------
Ledger_GetInstrument (by index)
Lookup a financial instrument (from within a transaction that is inside a ledger) based on index or transaction number.
sendUserInstrument does this: -- Puts an OTPayment (a form of contract) as an encrypted Payload on an OTMessage(1). -- Also puts instrument (same contract) as CLEAR payload on an OTMessage(2). -- (1) is sent to server, and (2) is added to Outpayments messages. -- (1) gets added to recipient's Nymbox as "in ref to" string on a "instrumentNotice" transaction. -- When recipient processes Nymbox, the "instrumentNotice" transaction (containing (1) in its "in ref to" field) is copied and added to the recipient's paymentInbox. -- When recipient iterates through paymentInbox transactions, they are ALL "instrumentNotice"s. Each transaction contains an OTMessage in its "in ref to" field, and that OTMessage object contains an encrypted payload of the instrument itself (an OTPayment object containing a cheque or payment plan or invoice etc.) -- When sender gets Outpayments contents, the original instrument (inside an OTPayment) is stored IN THE CLEAR as payload on an OTMessage. THEREFORE: TO EXTRACT INSTRUMENT FROM PAYMENTS INBOX: -- Iterate through the transactions in the payments inbox. -- (They should all be "instrumentNotice" transactions.) -- Each transaction contains (1) OTMessage in "in ref to" field, which in turn contains an encrypted OTPayment in the payload field, which then contains the instrument itself. -- *** Therefore, this function, based purely on ledger index (as we iterate) extracts the OTMessage from the Transaction "in ref to" field (for the transaction at that index), then decrypts the payload on that message and returns the decrypted cleartext.
Definition at line 9257 of file OTAPI_Exec.cpp.
std::string opentxs::OTAPI_Exec::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 | ||
) | const |
Definition at line 9084 of file OTAPI_Exec.cpp.
std::string opentxs::OTAPI_Exec::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 | ||
) | const |
Lookup a transaction or its ID (from within a ledger) based on index or transaction number.
Definition at line 8966 of file OTAPI_Exec.cpp.
int64_t opentxs::OTAPI_Exec::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 | ||
) | const |
Definition at line 9370 of file OTAPI_Exec.cpp.
std::string opentxs::OTAPI_Exec::LoadAssetAccount | ( | const std::string & | SERVER_ID, |
const std::string & | USER_ID, | ||
const std::string & | ACCOUNT_ID | ||
) | const |
--------------------------------------------------------------
LOAD ACCOUNT / INBOX / OUTBOX – (from local storage)
Loads an acct, or inbox or outbox, based on account ID, (from local storage) and returns it as string (or returns nullptr if it couldn't load it.)
Definition at line 8035 of file OTAPI_Exec.cpp.
std::string opentxs::OTAPI_Exec::LoadAssetContract | ( | const std::string & | ASSET_TYPE_ID | ) | const |
Definition at line 7972 of file OTAPI_Exec.cpp.
std::string opentxs::OTAPI_Exec::LoadExpiredBox | ( | const std::string & | SERVER_ID, |
const std::string & | USER_ID | ||
) | const |
Definition at line 8655 of file OTAPI_Exec.cpp.
std::string opentxs::OTAPI_Exec::LoadExpiredBoxNoVerify | ( | const std::string & | SERVER_ID, |
const std::string & | USER_ID | ||
) | const |
Definition at line 8687 of file OTAPI_Exec.cpp.
std::string opentxs::OTAPI_Exec::LoadInbox | ( | const std::string & | SERVER_ID, |
const std::string & | USER_ID, | ||
const std::string & | ACCOUNT_ID | ||
) | const |
Definition at line 8338 of file OTAPI_Exec.cpp.
std::string opentxs::OTAPI_Exec::LoadInboxNoVerify | ( | const std::string & | SERVER_ID, |
const std::string & | USER_ID, | ||
const std::string & | ACCOUNT_ID | ||
) | const |
These versions don't verify the ledger, they just load it up.
Definition at line 8380 of file OTAPI_Exec.cpp.
std::string opentxs::OTAPI_Exec::LoadMint | ( | const std::string & | SERVER_ID, |
const std::string & | ASSET_TYPE_ID | ||
) | const |
Definition at line 7937 of file OTAPI_Exec.cpp.
std::string opentxs::OTAPI_Exec::LoadNymbox | ( | const std::string & | SERVER_ID, |
const std::string & | USER_ID | ||
) | const |
Definition at line 8268 of file OTAPI_Exec.cpp.
std::string opentxs::OTAPI_Exec::LoadNymboxNoVerify | ( | const std::string & | SERVER_ID, |
const std::string & | USER_ID | ||
) | const |
Definition at line 8303 of file OTAPI_Exec.cpp.
std::string opentxs::OTAPI_Exec::LoadOutbox | ( | const std::string & | SERVER_ID, |
const std::string & | USER_ID, | ||
const std::string & | ACCOUNT_ID | ||
) | const |
Definition at line 8421 of file OTAPI_Exec.cpp.
std::string opentxs::OTAPI_Exec::LoadOutboxNoVerify | ( | const std::string & | SERVER_ID, |
const std::string & | USER_ID, | ||
const std::string & | ACCOUNT_ID | ||
) | const |
Definition at line 8462 of file OTAPI_Exec.cpp.
std::string opentxs::OTAPI_Exec::LoadPaymentInbox | ( | const std::string & | SERVER_ID, |
const std::string & | USER_ID | ||
) | const |
Definition at line 8503 of file OTAPI_Exec.cpp.
std::string opentxs::OTAPI_Exec::LoadPaymentInboxNoVerify | ( | const std::string & | SERVER_ID, |
const std::string & | USER_ID | ||
) | const |
Definition at line 8541 of file OTAPI_Exec.cpp.
std::string opentxs::OTAPI_Exec::LoadPubkey_Encryption | ( | const std::string & | USER_ID | ) | const |
-----------------------------------------------------------------
LOAD PUBLIC KEY – from local storage
(returns as STRING)
MEANT TO BE USED in cases where a private key is NOT available.
Definition at line 7760 of file OTAPI_Exec.cpp.
std::string opentxs::OTAPI_Exec::LoadPubkey_Signing | ( | const std::string & | USER_ID | ) | const |
Definition at line 7793 of file OTAPI_Exec.cpp.
std::string opentxs::OTAPI_Exec::LoadPurse | ( | const std::string & | SERVER_ID, |
const std::string & | ASSET_TYPE_ID, | ||
const std::string & | USER_ID | ||
) | const |
--------------------------------------------------------------
LOAD PURSE or Mint or ASSET CONTRACT or SERVER CONTRACT – (from local storage)
Based on Asset Type ID: load a purse, a public mint, or an asset/server contract and return it as a string – or return nullptr if it wasn't found.
Definition at line 12106 of file OTAPI_Exec.cpp.
std::string opentxs::OTAPI_Exec::LoadRecordBox | ( | const std::string & | SERVER_ID, |
const std::string & | USER_ID, | ||
const std::string & | ACCOUNT_ID | ||
) | const |
NOTE: Sometimes the user ID is also passed in the "account ID" field,.
on what kind of record box it is.
Definition at line 8578 of file OTAPI_Exec.cpp.
std::string opentxs::OTAPI_Exec::LoadRecordBoxNoVerify | ( | const std::string & | SERVER_ID, |
const std::string & | USER_ID, | ||
const std::string & | ACCOUNT_ID | ||
) | const |
Definition at line 8616 of file OTAPI_Exec.cpp.
std::string opentxs::OTAPI_Exec::LoadServerContract | ( | const std::string & | SERVER_ID | ) | const |
Definition at line 8001 of file OTAPI_Exec.cpp.
std::string opentxs::OTAPI_Exec::LoadUserPubkey_Encryption | ( | const std::string & | USER_ID | ) | const |
-----------------------------------------------------------------
LOAD USER PUBLIC KEY – from local storage
(returns as STRING)
MEANT TO BE USED in cases where a private key is also available.
Definition at line 7830 of file OTAPI_Exec.cpp.
std::string opentxs::OTAPI_Exec::LoadUserPubkey_Signing | ( | const std::string & | USER_ID | ) | const |
Definition at line 7856 of file OTAPI_Exec.cpp.
bool opentxs::OTAPI_Exec::LoadWallet | ( | ) | const |
LOAD WALLET
Next you'll want to load your wallet up. It needs to be in the data_folder. The filename is set in the configuration. Use "SET WALLET FILENAME" to change it.
The Default Filename is "wallet.xml"
Definition at line 363 of file OTAPI_Exec.cpp.
std::string opentxs::OTAPI_Exec::LongToString | ( | const int64_t & | lNumber | ) | const |
Definition at line 291 of file OTAPI_Exec.cpp.
int32_t opentxs::OTAPI_Exec::Message_GetBalanceAgreementSuccess | ( | const std::string & | SERVER_ID, |
const std::string & | USER_ID, | ||
const std::string & | ACCOUNT_ID, | ||
const std::string & | THE_MESSAGE | ||
) | const |
-----------------------------------------------------------
GET BALANCE AGREEMENT SUCCESS (From a MESSAGE.)
Returns OT_TRUE (1) for Success and OT_FALSE (0) for Failure. Returns OT_ERROR for error. (-1)
Definition at line 11891 of file OTAPI_Exec.cpp.
std::string opentxs::OTAPI_Exec::Message_GetCommand | ( | const std::string & | THE_MESSAGE | ) | const |
-----------------------------------------------------------
GET MESSAGE COMMAND TYPE
This way you can discover what kind of command it was. All server replies are pre-pended with the @ sign. For example, if you send a "getAccount" message, the server reply is "@getAccount", and if you send "getMint" the reply is "@getMint", and so on.
Definition at line 15456 of file OTAPI_Exec.cpp.
int32_t opentxs::OTAPI_Exec::Message_GetDepth | ( | const std::string & | THE_MESSAGE | ) | const |
-----------------------------------------------------------
GET MESSAGE "DEPTH" (USED FOR MARKET-SPECIFIC MESSAGES.)
Returns the count of relevant items, so you know whether to bother reading the payload. Returns -1 if error.
The "depth" variable stores the count of items being returned. For example, if I call getMarketList, and 10 markets are returned, then depth will be set to 10. OR, if I call getNym_MarketOffers, and the Nym has 16 offers on the various markets, then the depth will be 16.
This value is important when processing server replies to market inquiries. If the depth is 0, then you are done. End. BUT! if it contains a number, such as 10, then that means you will want to next READ those 10 markets (or offers, or trades, etc) out of the server reply's payload.
Whereas if success is TRUE, but depth is 0, that means while the message processed successfully, the list was simply empty (and thus it would be a waste of time trying to unpack the non-existent, empty list of data items from the payload of your successful reply.)
Definition at line 15793 of file OTAPI_Exec.cpp.
std::string opentxs::OTAPI_Exec::Message_GetLedger | ( | const std::string & | THE_MESSAGE | ) | const |
-----------------------------------------------------------
GET MESSAGE LEDGER
If you just received a server response to a transaction, and you want to actually iterate through the response ledger for that transaction, this function will retrieve it for you.
Definition at line 15484 of file OTAPI_Exec.cpp.
std::string opentxs::OTAPI_Exec::Message_GetNewAcctID | ( | const std::string & | THE_MESSAGE | ) | const |
-----------------------------------------------------------
GET NEW ACCOUNT ID
If you just opened a new asset account, you'll want to read the server reply and get the new acct ID out of it. Otherwise how will you know which account you just created? This function allows you to get the new account ID out of the server reply message.
Definition at line 15627 of file OTAPI_Exec.cpp.
std::string opentxs::OTAPI_Exec::Message_GetNewAssetTypeID | ( | const std::string & | THE_MESSAGE | ) | const |
-----------------------------------------------------------
GET NEW ASSET TYPE ID
If you just issued a new asset type, you'll want to read the server reply and get the new asset type ID out of it. Otherwise how will you ever open accounts in that new type?
Definition at line 15531 of file OTAPI_Exec.cpp.
std::string opentxs::OTAPI_Exec::Message_GetNewIssuerAcctID | ( | const std::string & | THE_MESSAGE | ) | const |
-----------------------------------------------------------
GET NEW ISSUER ACCOUNT ID
If you just issued a new asset type, you'll want to read the server reply and get the new issuer acct ID out of it. Otherwise how will you ever issue anything with it?
Definition at line 15578 of file OTAPI_Exec.cpp.
std::string opentxs::OTAPI_Exec::Message_GetNymboxHash | ( | const std::string & | THE_MESSAGE | ) | const |
-----------------------------------------------------------
GET NYMBOX HASH
Some messages include a copy of the Nymbox Hash. This helps the server to quickly ascertain whether some messages will fail, and also allows the client to query the server for this information for syncronicity purposes.
Definition at line 15674 of file OTAPI_Exec.cpp.
std::string opentxs::OTAPI_Exec::Message_GetPayload | ( | const std::string & | THE_MESSAGE | ) | const |
-----------------------------------------------------------
GET MESSAGE PAYLOAD
This way you can retrieve the payload from any message. Useful, for example, for getting the encoded StringMap object from the queryAssetTypes and messages, which both use the m_ascPayload field to transport it.
Definition at line 15431 of file OTAPI_Exec.cpp.
int32_t opentxs::OTAPI_Exec::Message_GetSuccess | ( | const std::string & | THE_MESSAGE | ) | const |
-----------------------------------------------------------
GET MESSAGE SUCCESS (True or False)
Returns OT_TRUE (1) for Success and OT_FALSE (0) for Failure. Returns -1 for Error condition.
Definition at line 15726 of file OTAPI_Exec.cpp.
int32_t opentxs::OTAPI_Exec::Message_GetTransactionSuccess | ( | const std::string & | SERVER_ID, |
const std::string & | USER_ID, | ||
const std::string & | ACCOUNT_ID, | ||
const std::string & | THE_MESSAGE | ||
) | const |
-----------------------------------------------------------
GET MESSAGE TRANSACTION SUCCESS (True or False)
Returns OT_TRUE (1) for Success and OT_FALSE (0) for Failure. Returns OT_ERROR for error. (-1)
Definition at line 15911 of file OTAPI_Exec.cpp.
int64_t opentxs::OTAPI_Exec::Message_GetUsageCredits | ( | const std::string & | THE_MESSAGE | ) | const |
IF THE_MESSAGE is of command type @usageCredits, and IF it was a SUCCESS,
then this function returns the usage credits BALANCE (it's a int64_t, but passed as a string). If you adjusted the balance using the usageCredits command (THE_MESSAGE being the server's reply to that) then you will see the balance AFTER the adjustment. (The current "Usage Credits" balance.)
Definition at line 13377 of file OTAPI_Exec.cpp.
int32_t opentxs::OTAPI_Exec::Message_IsTransactionCanceled | ( | const std::string & | SERVER_ID, |
const std::string & | USER_ID, | ||
const std::string & | ACCOUNT_ID, | ||
const std::string & | THE_MESSAGE | ||
) | const |
Definition at line 15815 of file OTAPI_Exec.cpp.
bool opentxs::OTAPI_Exec::Mint_IsStillGood | ( | const std::string & | SERVER_ID, |
const std::string & | ASSET_TYPE_ID | ||
) | const |
Returns OT_TRUE if the mint is still usable. Returns OT_FALSE if expired or other error.
Definition at line 7907 of file OTAPI_Exec.cpp.
bool opentxs::OTAPI_Exec::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 | ||
) | const |
Definition at line 7552 of file OTAPI_Exec.cpp.
int32_t opentxs::OTAPI_Exec::notarizeDeposit | ( | const std::string & | SERVER_ID, |
const std::string & | USER_ID, | ||
const std::string & | ACCT_ID, | ||
const std::string & | THE_PURSE | ||
) | const |
--------------------------------------------------------------------------
DEPOSIT CASH
Use LoadPurse to load a purse from storage, and then use this function to actually deposit that cash into a server account. (The cash must, of course, be the same asset type as the account.)
Returns int32_t: -1 means error; no message was sent. -2 means the message was sent, but the request number must be passed as a string, so call GetLargeRequestNum. 0 means NO error, but also: no message was sent. >0 means NO error, and the message was sent, and the request number fits into an integer... ...and in fact the requestNum IS the return value! ===> In 99% of cases, this LAST option is what actually happens!!
Definition at line 14274 of file OTAPI_Exec.cpp.
int32_t opentxs::OTAPI_Exec::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 | ||
) | const |
--------------------------------------------------------------------------
TRANSFER FROM ONE ASSET ACCOUNT TO ANOTHER
Send a request to the server to initiate a transfer from my account to another account's inbox. (With "transfer pending" notice in my outbox). Until the recipient accepts the transfer, I have the option to cancel it while it is still sitting in my outbox. But once he accepts it, it cannot be reversed. The server has signatures from BOTH parties requesting the transfer, and each party has the signature on the other party's request. Receipts are dropped into their respective inboxes.
Returns int32_t: -1 means error; no message was sent. -2 means the message was sent, but the request number must be passed as a string, so call GetLargeRequestNum. 0 means NO error, but also: no message was sent. >0 means NO error, and the message was sent, and the request number fits into an integer... ...and in fact the requestNum IS the return value! ===> In 99% of cases, this LAST option is what actually happens!!
Definition at line 14313 of file OTAPI_Exec.cpp.
int32_t opentxs::OTAPI_Exec::notarizeWithdrawal | ( | const std::string & | SERVER_ID, |
const std::string & | USER_ID, | ||
const std::string & | ACCT_ID, | ||
const int64_t & | AMOUNT | ||
) | const |
--------------------------------------------------------------------------
WITHDRAW CASH
User is requesting the server to withdraw AMOUNT from ACCT_ID and return a purse containing cash tokens.
Cash tokens come in specific denominations, such as 10, 25, 100, etc. Thus, if you want to withdraw a specific amount, such as 1291, then you are not withdrawing a single token, but a purse full of them. (An "OTPurse" is the object that contains a list of tokens.)
Therefore, any transactions involving cash withdrawals or deposits, you are actually using an OTPurse, rather than manipulating the individual tokens.
If Open Transactions receives a purse in reply from the server, it will automatically save the tokens in that purse into your purse file for that asset type. You can then reload the purse using LoadPurse, if you want to see the updated contents.
Returns int32_t: -1 means error; no message was sent. -2 means the message was sent, but the request number must be passed as a string, so call GetLargeRequestNum. 0 means NO error, but also: no message was sent. >0 means NO error, and the message was sent, and the request number fits into an integer... ...and in fact the requestNum IS the return value! ===> In 99% of cases, this LAST option is what actually happens!!
Definition at line 14236 of file OTAPI_Exec.cpp.
std::string opentxs::OTAPI_Exec::NumList_Add | ( | const std::string & | strNumList, |
const std::string & | strNumbers | ||
) | const |
These 2 functions aren't in the OT_API proper, but are only available inside the OTScripts on the client side. (They're not available in server-side scripts, and they're not available in, for example, the OTAPI Java programmable interface. You would use Java functions at that point.) Shown here only for reference.
Definition at line 429 of file OTAPI_Exec.cpp.
int32_t opentxs::OTAPI_Exec::NumList_Count | ( | const std::string & | strNumList | ) | const |
Definition at line 554 of file OTAPI_Exec.cpp.
std::string opentxs::OTAPI_Exec::NumList_Remove | ( | const std::string & | strNumList, |
const std::string & | strNumbers | ||
) | const |
Definition at line 466 of file OTAPI_Exec.cpp.
bool opentxs::OTAPI_Exec::NumList_VerifyAll | ( | const std::string & | strNumList, |
const std::string & | strNumbers | ||
) | const |
Definition at line 530 of file OTAPI_Exec.cpp.
bool opentxs::OTAPI_Exec::NumList_VerifyQuery | ( | const std::string & | strNumList, |
const std::string & | strNumbers | ||
) | const |
Definition at line 501 of file OTAPI_Exec.cpp.
bool opentxs::OTAPI_Exec::Nym_RemoveMailByIndex | ( | const std::string & | NYM_ID, |
const int32_t & | nIndex | ||
) | const |
Definition at line 2929 of file OTAPI_Exec.cpp.
bool opentxs::OTAPI_Exec::Nym_RemoveOutmailByIndex | ( | const std::string & | NYM_ID, |
const int32_t & | nIndex | ||
) | const |
Definition at line 3118 of file OTAPI_Exec.cpp.
bool opentxs::OTAPI_Exec::Nym_RemoveOutpaymentsByIndex | ( | const std::string & | NYM_ID, |
const int32_t & | nIndex | ||
) | const |
Definition at line 3327 of file OTAPI_Exec.cpp.
bool opentxs::OTAPI_Exec::Nym_VerifyMailByIndex | ( | const std::string & | NYM_ID, |
const int32_t & | nIndex | ||
) | const |
Definition at line 2976 of file OTAPI_Exec.cpp.
bool opentxs::OTAPI_Exec::Nym_VerifyOutmailByIndex | ( | const std::string & | NYM_ID, |
const int32_t & | nIndex | ||
) | const |
Definition at line 3165 of file OTAPI_Exec.cpp.
bool opentxs::OTAPI_Exec::Nym_VerifyOutpaymentsByIndex | ( | const std::string & | NYM_ID, |
const int32_t & | nIndex | ||
) | const |
Definition at line 3375 of file OTAPI_Exec.cpp.
std::string opentxs::OTAPI_Exec::Nymbox_GetReplyNotice | ( | const std::string & | SERVER_ID, |
const std::string & | USER_ID, | ||
const int64_t & | REQUEST_NUMBER | ||
) | const |
Some server replies (to your messages) are so important that a notice is dropped
into your Nymbox with a copy of the server's reply. It's called a replyNotice. Since the server is usually replying to a message, I've added this function for quickly looking up the message reply, if it's there, based on the requestNumber. This is the only example in the entire OT API where a Transaction is looked-up from a ledger, based on a REQUEST NUMBER. (Normally transactions use transaction numbers, and messages use request numbers. But in this case, it's a transaction that carries a copy of a message.)
Definition at line 8099 of file OTAPI_Exec.cpp.
OT_API * opentxs::OTAPI_Exec::OTAPI | ( | ) | const |
Definition at line 281 of file OTAPI_Exec.cpp.
void opentxs::OTAPI_Exec::Output | ( | const int32_t & | nLogLevel, |
const std::string & | strOutput | ||
) | const |
Output to the screen (stderr.)
(This is so stdout can be left clean for the ACTUAL output.) Log level is 0 (least verbose) to 5 (most verbose.)
Definition at line 322 of file OTAPI_Exec.cpp.
std::string opentxs::OTAPI_Exec::Party_GetAcctAgentName | ( | const std::string & | THE_CONTRACT, |
const std::string & | PARTY_NAME, | ||
const std::string & | ACCT_NAME | ||
) | const |
Definition at line 7243 of file OTAPI_Exec.cpp.
std::string opentxs::OTAPI_Exec::Party_GetAcctAssetID | ( | const std::string & | THE_CONTRACT, |
const std::string & | PARTY_NAME, | ||
const std::string & | ACCT_NAME | ||
) | const |
Definition at line 7189 of file OTAPI_Exec.cpp.
int32_t opentxs::OTAPI_Exec::Party_GetAcctCount | ( | const std::string & | THE_CONTRACT, |
const std::string & | PARTY_NAME | ||
) | const |
Definition at line 6974 of file OTAPI_Exec.cpp.
std::string opentxs::OTAPI_Exec::Party_GetAcctID | ( | const std::string & | THE_CONTRACT, |
const std::string & | PARTY_NAME, | ||
const std::string & | ACCT_NAME | ||
) | const |
Definition at line 7135 of file OTAPI_Exec.cpp.
std::string opentxs::OTAPI_Exec::Party_GetAcctNameByIndex | ( | const std::string & | THE_CONTRACT, |
const std::string & | PARTY_NAME, | ||
const int32_t & | nIndex | ||
) | const |
Definition at line 7087 of file OTAPI_Exec.cpp.
int32_t opentxs::OTAPI_Exec::Party_GetAgentCount | ( | const std::string & | THE_CONTRACT, |
const std::string & | PARTY_NAME | ||
) | const |
Definition at line 7010 of file OTAPI_Exec.cpp.
std::string opentxs::OTAPI_Exec::Party_GetAgentID | ( | const std::string & | THE_CONTRACT, |
const std::string & | PARTY_NAME, | ||
const std::string & | AGENT_NAME | ||
) | const |
Definition at line 7345 of file OTAPI_Exec.cpp.
std::string opentxs::OTAPI_Exec::Party_GetAgentNameByIndex | ( | const std::string & | THE_CONTRACT, |
const std::string & | PARTY_NAME, | ||
const int32_t & | nIndex | ||
) | const |
Definition at line 7297 of file OTAPI_Exec.cpp.
std::string opentxs::OTAPI_Exec::Party_GetID | ( | const std::string & | THE_CONTRACT, |
const std::string & | PARTY_NAME | ||
) | const |
Definition at line 7046 of file OTAPI_Exec.cpp.
int32_t opentxs::OTAPI_Exec::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 | ||
) | const |
PAY DIVIDEND – to shareholders.
Definition at line 14573 of file OTAPI_Exec.cpp.
std::string opentxs::OTAPI_Exec::PeekMemlogBack | ( | ) | const |
Definition at line 388 of file OTAPI_Exec.cpp.
std::string opentxs::OTAPI_Exec::PeekMemlogFront | ( | ) | const |
Definition at line 383 of file OTAPI_Exec.cpp.
std::string opentxs::OTAPI_Exec::Pending_GetNote | ( | const std::string & | SERVER_ID, |
const std::string & | USER_ID, | ||
const std::string & | ACCOUNT_ID, | ||
const std::string & | THE_TRANSACTION | ||
) | const |
--------------------------------------------------
PENDING TRANSFER (various functions)
When someone has sent you a PENDING TRANSFER (a form of transaction that will be sitting in your inbox waiting for you to accept/reject it) then, as you are reading the inbox, you can use these functions in order to get data from each pending transfer. That way your user can then decide whether to accept or reject it (see the ledger functions.)
Definition at line 11175 of file OTAPI_Exec.cpp.
bool opentxs::OTAPI_Exec::PopMemlogBack | ( | ) | const |
Definition at line 398 of file OTAPI_Exec.cpp.
bool opentxs::OTAPI_Exec::PopMemlogFront | ( | ) | const |
Definition at line 393 of file OTAPI_Exec.cpp.
std::string opentxs::OTAPI_Exec::PopMessageBuffer | ( | const int64_t & | REQUEST_NUMBER, |
const std::string & | SERVER_ID, | ||
const std::string & | USER_ID | ||
) | const |
-----------------------------------------------------------
POP MESSAGE BUFFER
If there are any replies from the server, they are stored in the message buffer. This function will return those messages (and remove them from the list) one-by-one, newest first.
Returns the message as a string.
Update: added arguments for: ServerID AND NymID AND request number NOTE: Any messages, when popping, which have the CORRECT serverID and the CORRECT NymID, but the wrong Request number, will be discarded.
(Why? Because the client using the OT API will have already treated that message as "dropped" by now, if it's already on to the next one, and the protocol is designed to move forward properly based specifically on this function returning the one EXPECTED... outgoing messages flush the incoming buffer anyway, so the client will have assumed the wrong reply was flushed by now anyway.)
However, if the Server ID and the User ID are wrong, this just means that some other code is still expecting that reply, and hasn't even popped yet! Therefore, we do NOT want to discard THOSE replies, but put them back if necessary – only discarding the ones where the IDs match.
Definition at line 15065 of file OTAPI_Exec.cpp.
int32_t opentxs::OTAPI_Exec::processInbox | ( | const std::string & | SERVER_ID, |
const std::string & | USER_ID, | ||
const std::string & | ACCT_ID, | ||
const std::string & | ACCT_LEDGER | ||
) | const |
PROCESS INBOX
Assuming I have gone through the various transactions in my inbox, and chosen some that I wish to accept or reject, this message asks the server to accept or reject those transactions.
You must include a copy of the ledger, which contains your accept or reject requests for the various inbox items. In other words, you will need to use some other function call first to set up that ledger with the various requests (accept transfer, accept receipt, etc) before you can then use THIS function call to actually send those requests to the server. (See all the Ledger functions.)
(Try the 'i' command in the test client, if you want to empty out the inbox and automatically accept all of the transactions within.)
Definition at line 14454 of file OTAPI_Exec.cpp.
int32_t opentxs::OTAPI_Exec::processNymbox | ( | const std::string & | SERVER_ID, |
const std::string & | USER_ID | ||
) | const |
I use this automatically to save the API developers the hassle (for now)
added here for completeness. UPDATE: It was a mistake for me to automatically call this, which can mess up the client's expectation of which messages are being sent/received. It was causing network problems. Now clients NEED to call this themselves, after getting the Nymbox. I can't call it for them anymore.
Returns: -1 if error. 0 if Nymbox is empty. 1 or more: Count of items in Nymbox before processing.
Definition at line 14502 of file OTAPI_Exec.cpp.
std::string opentxs::OTAPI_Exec::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 | ||
) | const |
PROPOSE PAYMENT PLAN — Returns the payment plan in string form.
(Called by Merchant.)
PARAMETER NOTES: – Payment Plan Delay, and Payment Plan Period, both default to 30 days (if you pass 0.)
– Payment Plan Length, and Payment Plan Max Payments, both default to 0, which means no maximum length and no maximum number of payments.
FYI, the payment plan creation process (finally) is:
1) Payment plan is written, and signed, by the recipient. (This function: ProposePaymentPlan) 2) He sends it to the sender, who signs it and submits it. (ConfirmPaymentPlan and depositPaymentPlan) 3) The server loads the recipient nym to verify the transaction number. The sender also had to burn a transaction number (to submit it) so now, both have verified trns::s in this way.
FYI, here are all the OT library calls that are performed by this single API call:
OTPaymentPlan * pPlan = new OTPaymentPlan(pAccount->GetRealServerID(), pAccount->GetAssetTypeID(), pAccount->GetRealAccountID(), pAccount->GetUserID(), RECIPIENT_ACCT_ID, RECIPIENT_USER_ID);
From OTAgreement: (This must be called first, before the other two methods below can be called.)
bool OTAgreement::SetProposal(const OTPseudonym& MERCHANT_NYM, const OTString& strConsideration, const time64_t& VALID_FROM=0, const time64_t& VALID_TO=0);
(Optional initial payment): bool OTPaymentPlan::SetInitialPayment(const int64_t& lAmount, time64_t
These two (above and below) can be called independent of each other. You can have an initial payment, AND/OR a payment plan.
(Optional regular payments): bool OTPaymentPlan::SetPaymentPlan(const int64_t& lPaymentAmount, time64_t tTimeUntilPlanStart =OT_TIME_MONTH_IN_SECONDS, // Default: 1st payment in 30 days time64_t tBetweenPayments =OT_TIME_MONTH_IN_SECONDS, // Default: 30 days.
Definition at line 5039 of file OTAPI_Exec.cpp.
int32_t opentxs::OTAPI_Exec::Purse_Count | ( | const std::string & | SERVER_ID, |
const std::string & | ASSET_TYPE_ID, | ||
const std::string & | THE_PURSE | ||
) | const |
returns a count of the number of cash tokens inside this purse.
Definition at line 12187 of file OTAPI_Exec.cpp.
std::string opentxs::OTAPI_Exec::Purse_Empty | ( | const std::string & | SERVER_ID, |
const std::string & | ASSET_TYPE_ID, | ||
const std::string & | SIGNER_ID, | ||
const std::string & | THE_PURSE | ||
) | const |
Makes an exact copy of a purse, except with no tokens inside. (Value of zero.)
Useful when you need to create a temporary purse for moving tokens around, and you don't want some new symmetric/master key being generated for that purse as though it were really some new "other purse." For example, if you have a password-protected purse, you might want to pop all of the tokens off of it, and as you iterate, re-assign half of them to new ownership, push those onto a new purse owned by that new owner. But you only want to do this with half of the tokens... the other half of the tokens, you just want to push onto a temp purse (for the loop) that's owned by the original owner, so you can then save it back over the original in storage (since it contains "all the tokens that WEREN'T deposited" or "all the tokens that WEREN'T exported" etc.
The point? If the "original owner" is a password-protected purse with a symmetric key, then you can't just generate some new "temp purse" without also generating a whole new KEY, which you DO NOT want to do. You also don't want to have to deal with re-assigning ownership back and forth between the two purses – you just want to shove some tokens into one temporarily so you can finish your loop. You could take the original purse and make a copy of it, and then just pop all the tokens off of it one-by-one, but that is very cumbersome and expensive. But that'd be the only way to get a copy of the original purse with the SAME symmetric key, except empty, so you can use it as a temp purse. Therefore, to make that easier and solve that whole dilemma, I present: Purse_Empty. Purse_Empty takes a purse and returns an empty version of it (except if there's a symmetric/master key inside, those are preserved, so you can use it as a temp purse.)
This function is effectively the same thing as calling Pop until the purse is empty. Returns: the empty purse, or nullptr if failure.
Definition at line 12545 of file OTAPI_Exec.cpp.
int64_t opentxs::OTAPI_Exec::Purse_GetTotalValue | ( | const std::string & | SERVER_ID, |
const std::string & | ASSET_TYPE_ID, | ||
const std::string & | THE_PURSE | ||
) | const |
Get Purse Total Value (internally uses GetTotalValue().)
Returns the purported sum of all the tokens within.
Definition at line 12152 of file OTAPI_Exec.cpp.
bool opentxs::OTAPI_Exec::Purse_HasPassword | ( | const std::string & | SERVER_ID, |
const std::string & | THE_PURSE | ||
) | const |
Some purses are encrypted to a specific Nym. Whereas other purses are encrypted to a passphrase. This function returns bool and lets you know, either way.
Definition at line 12221 of file OTAPI_Exec.cpp.
std::string opentxs::OTAPI_Exec::Purse_Peek | ( | const std::string & | SERVER_ID, |
const std::string & | ASSET_TYPE_ID, | ||
const std::string & | OWNER_ID, | ||
const std::string & | THE_PURSE | ||
) | const |
Returns the TOKEN on top of the stock (LEAVING it on top of the stack, but giving you a string copy of it.)
Definition at line 12355 of file OTAPI_Exec.cpp.
std::string opentxs::OTAPI_Exec::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 | ||
) | const |
Removes the token from the top of the stock and DESTROYS IT, and RETURNS THE UPDATED PURSE (with the token now missing from it.) WARNING: Do not call this function unless you have PEEK()d FIRST!! Otherwise you will lose the token and get left "holding the bag".
Definition at line 12427 of file OTAPI_Exec.cpp.
std::string opentxs::OTAPI_Exec::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 | ||
) | const |
Pushes a token onto the stack (of the purse.) Returns the updated purse (now including the token.)
Definition at line 12604 of file OTAPI_Exec.cpp.
int32_t opentxs::OTAPI_Exec::queryAssetTypes | ( | const std::string & | SERVER_ID, |
const std::string & | USER_ID, | ||
const std::string & | ENCODED_MAP | ||
) | const |
-----------------------------------------------------------
QUERY ASSET TYPES (server message)
This way you can ask the server to confirm whether various asset types are issued there.
Returns int32_t: -1 means error; no message was sent. -2 means the message was sent, but the request number must be passed as a string, so call GetLargeRequestNum. 0 means NO error, but also: no message was sent. >0 means NO error, and the message was sent, and the request number fits into an integer... ...and in fact the requestNum IS the return value! ===> In 99% of cases, this LAST option is what actually happens!!
Definition at line 15401 of file OTAPI_Exec.cpp.
bool opentxs::OTAPI_Exec::RecordPayment | ( | const std::string & | SERVER_ID, |
const std::string & | USER_ID, | ||
const bool & | bIsInbox, | ||
const int32_t & | nIndex, | ||
const bool & | bSaveCopy | ||
) | const |
Definition at line 8721 of file OTAPI_Exec.cpp.
bool opentxs::OTAPI_Exec::RemoveSentMessage | ( | const int64_t & | REQUEST_NUMBER, |
const std::string & | SERVER_ID, | ||
const std::string & | USER_ID | ||
) | const |
Definition at line 15172 of file OTAPI_Exec.cpp.
int64_t opentxs::OTAPI_Exec::ReplyNotice_GetRequestNum | ( | const std::string & | SERVER_ID, |
const std::string & | USER_ID, | ||
const std::string & | THE_TRANSACTION | ||
) | const |
Transactions do not have request numbers. However, if you have a.
in your Nymbox, which is an OTTransaction object, it will CONTAIN a reply to some previous message. This function will only work on a and it returns the actual request number of the server reply inside that Used for calling HaveAlreadySeenReply() in order to see if we've already processed the reply for that message.
Definition at line 11486 of file OTAPI_Exec.cpp.
bool opentxs::OTAPI_Exec::ResyncNymWithServer | ( | const std::string & | SERVER_ID, |
const std::string & | USER_ID, | ||
const std::string & | THE_MESSAGE | ||
) | const |
Definition at line 15287 of file OTAPI_Exec.cpp.
bool opentxs::OTAPI_Exec::RevokeSubcredential | ( | const std::string & | NYM_ID, |
const std::string & | MASTER_CRED_ID, | ||
const std::string & | SUB_CRED_ID | ||
) | const |
Definition at line 967 of file OTAPI_Exec.cpp.
bool opentxs::OTAPI_Exec::SavePurse | ( | const std::string & | SERVER_ID, |
const std::string & | ASSET_TYPE_ID, | ||
const std::string & | USER_ID, | ||
const std::string & | THE_PURSE | ||
) | const |
PURSES (containing cash tokens.)
UNDERSTAND: If you write someone a cheque, it can be in the amount of $27.63 But you cannot do this with a cash token, since it can only represent a standard denomination. (1, 5, 10, 25, 100, 500, 1000, 2000, 5000, 10000, etc.) Therefore if you wanted to give CASH to someone in the amount of $27.63, you would have to give them a PURSE, not a single token. And the purse would contain a 2000 cent token, a 500 cent token, two 100-cent tokens, two 25-cent tokens, a 10-cent token, and three 1-cent tokens. The purse would thus contain 2763 cents worth of digital cash tokens, all neatly wrapped up in the same purse, all encrypted to the same owner or key. (The fact that 2763 displays as $27.63 should be purely the result of a mask applied by the currency contract.) (above a bit.) EXPORT std::string LoadPurse(const std::string& SERVER_ID, const std::string& ASSET_TYPE_ID, const std::string& USER_ID); // returns nullptr, or a purse.
Warning! This will overwrite whatever purse is there. The proper way to use this function is, LOAD the purse, then Merge whatever other purse you want into it, then SAVE it again. (Which is all handled for you automatically if you use Wallet_ImportPurse.) Tokens may have to be decrypted from one owner and re-encrypted to the new owner. Do you want to have to deal with that? If you still insist on using SavePurse directly, just remember to load first, then pop/push any tokens you need to, keeping in mind that at this low level you are responsible to make sure the purse and token have the same owner, then save again to overwrite whatever purse was there before. (Presumably if any tokens were removed, it's because they are no longer any good, or because they were given to someone else and then a copy was recorded in your payment outbox, or whatever.)
Definition at line 12044 of file OTAPI_Exec.cpp.
int32_t opentxs::OTAPI_Exec::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 | ||
) | const |
sendUserMessage does this: – Puts user message as encrypted Payload on an OTMessage (1)... – Also puts user message as a CLEAR payload on an OTMessage (2)... – (1) is sent to server, and (2) is added to Outmail messages. – (1) gets added to recipient's Nymbox as "in ref to" string on a "message" transaction. – When recipient processes Nymbox, OTMessage (1) is extracted and added to recipient's nym Mail. – When recipient gets mail contents, decryption occurs from (1) payload, before returning contents as original user message string. – When sender gets outmail contents, original user message string is returned from (2) payload, with no decryption necessary. SEND USER INSTRUMENT — (Send a financial instrument to another user, encrypted to his pubkey.)
ServerID – Must be included with every message. USER_ID – You must include your own userID so the server can reply. USER_ID_RECIPIENT – This is a recipient user ID. RECIPIENT_PUBKEY – Recipient's public key in base64-encoded form. THE_INSTRUMENT – plainext string of instrument (cheque, payment plan, purse, invoice, voucher...)
In this message, you are requesting the server to send a financial instrument to another user, encrypted to his public key and dropped in his paymentInbox (by way of his nymbox.)
Definition at line 13555 of file OTAPI_Exec.cpp.
int32_t opentxs::OTAPI_Exec::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 | ||
) | const |
SEND USER MESSAGE — (Send a message to another user, encrypted to his pubkey.)
ServerID – Must be included with every message. USER_ID – You must include your own userID so the server can reply. USER_ID_RECIPIENT – This is a recipient user ID. RECIPIENT_PUBKEY – Recipient's public key in base64-encoded form. THE_MESSAGE – plainext message you want to send. A cheque? Some cash? A note? Etc.
In this message, you are requesting the server to send a message to another user, encrypted to his public key and dropped in his nymbox.
Definition at line 13509 of file OTAPI_Exec.cpp.
bool opentxs::OTAPI_Exec::SetAccountWallet_Name | ( | const std::string & | ACCT_ID, |
const std::string & | SIGNER_NYM_ID, | ||
const std::string & | ACCT_NEW_NAME | ||
) | const |
Returns OT_TRUE (1) or OT_FALSE (0) The asset account's name is merely a client-side label.
Definition at line 4766 of file OTAPI_Exec.cpp.
void opentxs::OTAPI_Exec::SetAppBinaryFolder | ( | const std::string & | strFolder | ) | const |
Definition at line 257 of file OTAPI_Exec.cpp.
bool opentxs::OTAPI_Exec::SetAssetType_Name | ( | const std::string & | ASSET_ID, |
const std::string & | STR_NEW_NAME | ||
) | const |
Definition at line 4004 of file OTAPI_Exec.cpp.
void opentxs::OTAPI_Exec::SetHomeFolder | ( | const std::string & | strFolder | ) | const |
Definition at line 276 of file OTAPI_Exec.cpp.
bool opentxs::OTAPI_Exec::SetNym_Name | ( | const std::string & | NYM_ID, |
const std::string & | SIGNER_NYM_ID, | ||
const std::string & | NYM_NEW_NAME | ||
) | const |
-----------------------------------
SET NYM NAME
You might have 40 of your friends' public nyms in your wallet. You might have labels on each of them. But whenever you change a label (and thus re-sign the file for that Nym when you save it), you only SIGN using one of your OWN nyms, for which you have a private key available for signing.
Signer Nym? When testing, there is only one nym, so you just pass it twice. But in real production, a user will have a default signing nym, the same way that he might have a default signing key in PGP, and that must be passed in whenever he changes the name on any of the other nyms in his wallet. (In order to properly sign and save the change.)
Returns OT_TRUE (1) or OT_FALSE (0)
Definition at line 3957 of file OTAPI_Exec.cpp.
bool opentxs::OTAPI_Exec::SetServer_Name | ( | const std::string & | SERVER_ID, |
const std::string & | STR_NEW_NAME | ||
) | const |
Definition at line 3983 of file OTAPI_Exec.cpp.
bool opentxs::OTAPI_Exec::SetWallet | ( | const std::string & | strWalletFilename | ) | const |
INITIALIZE an OTAPI context.
Call this once per context.
If the configuration value doesn't exist, it will be created.
Something like this: bool bInit = Init();
If this function fails, you can call it multiple times until it succeeds.
EXPORT bool Cleanup(); // Call this before you delete OTAPI SET WALLET (optional)
This command will set the wallet filename in the configuration. Use this command to change what wallet will be loaded with the "LOAD WALLET" command.
e.g. SetWallet("wallet2.xml");
Definition at line 330 of file OTAPI_Exec.cpp.
std::string opentxs::OTAPI_Exec::SignContract | ( | const std::string & | SIGNER_NYM_ID, |
const std::string & | THE_CONTRACT | ||
) | const |
OT-Sign a CONTRACT. (First signature)
EXPORT std::string SignContract(const std::string& SIGNER_NYM_ID, const std::string& THE_CONTRACT);
Tries to instantiate the contract object, based on the string passed in. Releases all signatures, and then signs the contract. Returns the signed contract, or nullptr if failure.
NOTE: The actual OT functionality (Use Cases) NEVER requires you to sign via this function. Why not? because, anytime a signature is needed on something, the relevant OT API call will require you to pass in the Nym, and the API already signs internally wherever it deems appropriate. Thus, this function is only for advanced uses, for OT-Scripts, server operators, etc.
OT-Sign a CONTRACT. (First signature)
std::string OTAPI_Exec::SignContract(const std::string& SIGNER_NYM_ID, const std::string& THE_CONTRACT);
Tries to instantiate the contract object, based on the string passed in. Releases all signatures, and then signs the contract. Returns the signed contract, or "" if failure.
NOTE: The actual OT functionality (Use Cases) NEVER requires you to sign via this function. Why not? because, anytime a signature is needed on something, the relevant OT API call will require you to pass in the Nym, and the API already signs internally wherever it deems appropriate. Thus, this function is only for advanced uses, for OT-Scripts, server operators, etc.
Definition at line 4539 of file OTAPI_Exec.cpp.
void opentxs::OTAPI_Exec::Sleep | ( | const int64_t & | MILLISECONDS | ) | const |
SLEEP
If you want to go to sleep for one second, then pass "1000" to this function.
Definition at line 15259 of file OTAPI_Exec.cpp.
bool opentxs::OTAPI_Exec::Smart_AreAllPartiesConfirmed | ( | const std::string & | THE_CONTRACT | ) | const |
Definition at line 5963 of file OTAPI_Exec.cpp.
std::string opentxs::OTAPI_Exec::Smart_GetBylawByIndex | ( | const std::string & | THE_CONTRACT, |
const int32_t & | nIndex | ||
) | const |
returns the name of the bylaw.
Definition at line 6183 of file OTAPI_Exec.cpp.
int32_t opentxs::OTAPI_Exec::Smart_GetBylawCount | ( | const std::string & | THE_CONTRACT | ) | const |
Definition at line 6127 of file OTAPI_Exec.cpp.
std::string opentxs::OTAPI_Exec::Smart_GetPartyByIndex | ( | const std::string & | THE_CONTRACT, |
const int32_t & | nIndex | ||
) | const |
returns the name of the party.
Definition at line 6150 of file OTAPI_Exec.cpp.
int32_t opentxs::OTAPI_Exec::Smart_GetPartyCount | ( | const std::string & | THE_CONTRACT | ) | const |
Definition at line 6105 of file OTAPI_Exec.cpp.
bool opentxs::OTAPI_Exec::Smart_IsPartyConfirmed | ( | const std::string & | THE_CONTRACT, |
const std::string & | PARTY_NAME | ||
) | const |
Definition at line 6017 of file OTAPI_Exec.cpp.
std::string opentxs::OTAPI_Exec::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 | ||
) | const |
Definition at line 5773 of file OTAPI_Exec.cpp.
std::string opentxs::OTAPI_Exec::SmartContract_AddBylaw | ( | const std::string & | THE_CONTRACT, |
const std::string & | SIGNER_NYM_ID, | ||
const std::string & | BYLAW_NAME | ||
) | const |
Definition at line 5417 of file OTAPI_Exec.cpp.
std::string opentxs::OTAPI_Exec::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 | ||
) | const |
Definition at line 5592 of file OTAPI_Exec.cpp.
std::string opentxs::OTAPI_Exec::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 | ||
) | const |
Definition at line 5459 of file OTAPI_Exec.cpp.
std::string opentxs::OTAPI_Exec::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 | ||
) | const |
Definition at line 5653 of file OTAPI_Exec.cpp.
std::string opentxs::OTAPI_Exec::SmartContract_AddParty | ( | const std::string & | THE_CONTRACT, |
const std::string & | SIGNER_NYM_ID, | ||
const std::string & | PARTY_NAME, | ||
const std::string & | AGENT_NAME | ||
) | const |
Definition at line 5716 of file OTAPI_Exec.cpp.
std::string opentxs::OTAPI_Exec::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 | ||
) | const |
Definition at line 5517 of file OTAPI_Exec.cpp.
std::string opentxs::OTAPI_Exec::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 | ||
) | const |
----------------------------------------
Used when taking a theoretical smart contract, and setting it up to use specific Nyms and accounts. This function sets the ACCT ID for the acct specified by party name and acct name. Returns the updated smart contract (or nullptr.)
Definition at line 5870 of file OTAPI_Exec.cpp.
std::string opentxs::OTAPI_Exec::SmartContract_ConfirmParty | ( | const std::string & | THE_CONTRACT, |
const std::string & | PARTY_NAME, | ||
const std::string & | NYM_ID | ||
) | const |
----------------------------------------
Called by each Party. Pass in the smart contract obtained in the above call. Call SmartContract_ConfirmAccount() first, as much as you need to. Returns the updated smart contract (or nullptr.)
Definition at line 5924 of file OTAPI_Exec.cpp.
int32_t opentxs::OTAPI_Exec::SmartContract_CountNumsNeeded | ( | const std::string & | THE_CONTRACT, |
const std::string & | AGENT_NAME | ||
) | const |
This function returns the count of how many trans#s a Nym needs in order to confirm as
a specific agent for a contract. (An opening number is needed for every party of which agent is the authorizing agent, plus a closing number for every acct of which agent is the authorized agent.)
Definition at line 5843 of file OTAPI_Exec.cpp.
int64_t opentxs::OTAPI_Exec::StringToAmount | ( | const std::string & | ASSET_TYPE_ID, |
const std::string & | str_input | ||
) | const |
StringToAmount:
Input: currency contract, formatted string. (And locale, internally.) Output: "$5.45" becomes 545 (for example.)
Returns amount from formatted string, based on currency contract and locale.
Definition at line 1323 of file OTAPI_Exec.cpp.
int64_t opentxs::OTAPI_Exec::StringToLong | ( | const std::string & | strNumber | ) | const |
Definition at line 286 of file OTAPI_Exec.cpp.
uint64_t opentxs::OTAPI_Exec::StringToUlong | ( | const std::string & | strNumber | ) | const |
Definition at line 302 of file OTAPI_Exec.cpp.
bool opentxs::OTAPI_Exec::SwitchWallet | ( | ) | const |
SWITCH WALLET (experimental)
Experimental. Set the new wallet with the "SET WALLET FILENAME" function. Then call this function to switch to the new wallet.
Definition at line 368 of file OTAPI_Exec.cpp.
std::string opentxs::OTAPI_Exec::SymmetricDecrypt | ( | const std::string & | SYMMETRIC_KEY, |
const std::string & | CIPHERTEXT_ENVELOPE | ||
) | const |
Definition at line 4494 of file OTAPI_Exec.cpp.
std::string opentxs::OTAPI_Exec::SymmetricEncrypt | ( | const std::string & | SYMMETRIC_KEY, |
const std::string & | PLAINTEXT | ||
) | const |
Definition at line 4465 of file OTAPI_Exec.cpp.
std::string opentxs::OTAPI_Exec::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 | ||
) | const |
Tokens are stored in an encrypted state for security reasons.
This function is used for exporting those tokens to another Nym, such as a Dummy nym, or another user's Nym.
Definition at line 12837 of file OTAPI_Exec.cpp.
std::string opentxs::OTAPI_Exec::Token_GetAssetID | ( | const std::string & | THE_TOKEN | ) | const |
Definition at line 13081 of file OTAPI_Exec.cpp.
int64_t opentxs::OTAPI_Exec::Token_GetDenomination | ( | const std::string & | SERVER_ID, |
const std::string & | ASSET_TYPE_ID, | ||
const std::string & | THE_TOKEN | ||
) | const |
The actual cash value of the token. Returns a int64_t.
Definition at line 12945 of file OTAPI_Exec.cpp.
std::string opentxs::OTAPI_Exec::Token_GetID | ( | const std::string & | SERVER_ID, |
const std::string & | ASSET_TYPE_ID, | ||
const std::string & | THE_TOKEN | ||
) | const |
Returns an encrypted form of the actual blinded token ID.
(There's no need to decrypt the ID until redeeming the token, when you re-encrypt it to the server's public key, or until spending it, when you re-encrypt it to the recipient's public key, or exporting it, when you create a dummy recipient and attach it to the purse.)
Definition at line 12904 of file OTAPI_Exec.cpp.
int32_t opentxs::OTAPI_Exec::Token_GetSeries | ( | const std::string & | SERVER_ID, |
const std::string & | ASSET_TYPE_ID, | ||
const std::string & | THE_TOKEN | ||
) | const |
Definition at line 12982 of file OTAPI_Exec.cpp.
std::string opentxs::OTAPI_Exec::Token_GetServerID | ( | const std::string & | THE_TOKEN | ) | const |
Definition at line 13104 of file OTAPI_Exec.cpp.
time64_t opentxs::OTAPI_Exec::Token_GetValidFrom | ( | const std::string & | SERVER_ID, |
const std::string & | ASSET_TYPE_ID, | ||
const std::string & | THE_TOKEN | ||
) | const |
the date is seconds since Jan 1970.
Definition at line 13015 of file OTAPI_Exec.cpp.
time64_t opentxs::OTAPI_Exec::Token_GetValidTo | ( | const std::string & | SERVER_ID, |
const std::string & | ASSET_TYPE_ID, | ||
const std::string & | THE_TOKEN | ||
) | const |
Definition at line 13049 of file OTAPI_Exec.cpp.
std::string opentxs::OTAPI_Exec::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 | ||
) | const |
Create a 'response' transaction, that will be used to indicate my acceptance or rejection of another transaction. Usually an entire ledger full of these is sent to the server as I process the various transactions in my inbox.
Definition at line 9563 of file OTAPI_Exec.cpp.
int64_t opentxs::OTAPI_Exec::Transaction_GetAmount | ( | const std::string & | SERVER_ID, |
const std::string & | USER_ID, | ||
const std::string & | ACCOUNT_ID, | ||
const std::string & | THE_TRANSACTION | ||
) | const |
Definition at line 11290 of file OTAPI_Exec.cpp.
int32_t opentxs::OTAPI_Exec::Transaction_GetBalanceAgreementSuccess | ( | const std::string & | SERVER_ID, |
const std::string & | USER_ID, | ||
const std::string & | ACCOUNT_ID, | ||
const std::string & | THE_TRANSACTION | ||
) | const |
Gets the balance agreement success (from a transaction.)
returns OT_BOOL. OT_TRUE (1) == acknowledgment OT_FALSE (0) == rejection OT_ERROR(-1) == error_state (such as dropped message.)
Definition at line 11790 of file OTAPI_Exec.cpp.
time64_t opentxs::OTAPI_Exec::Transaction_GetDateSigned | ( | const std::string & | SERVER_ID, |
const std::string & | USER_ID, | ||
const std::string & | ACCOUNT_ID, | ||
const std::string & | THE_TRANSACTION | ||
) | const |
--------------------------------------------------
Get Transaction Date Signed (internally uses OTTransaction::GetDateSigned().)
Definition at line 11541 of file OTAPI_Exec.cpp.
int64_t opentxs::OTAPI_Exec::Transaction_GetDisplayReferenceToNum | ( | const std::string & | SERVER_ID, |
const std::string & | USER_ID, | ||
const std::string & | ACCOUNT_ID, | ||
const std::string & | THE_TRANSACTION | ||
) | const |
The pending notice in the inbox has a transaction number that
was issued to the server (so it could put the notice in your inbox.) But it's IN REFERENCE TO a transfer that was initiated by another user. THIS function will retrieve THAT transaction number, because this function queries a pending transaction to see what transaction it is "in reference to."
Definition at line 11380 of file OTAPI_Exec.cpp.
std::string opentxs::OTAPI_Exec::Transaction_GetRecipientAcctID | ( | const std::string & | SERVER_ID, |
const std::string & | USER_ID, | ||
const std::string & | ACCOUNT_ID, | ||
const std::string & | THE_TRANSACTION | ||
) | const |
Definition at line 11071 of file OTAPI_Exec.cpp.
std::string opentxs::OTAPI_Exec::Transaction_GetRecipientUserID | ( | const std::string & | SERVER_ID, |
const std::string & | USER_ID, | ||
const std::string & | ACCOUNT_ID, | ||
const std::string & | THE_TRANSACTION | ||
) | const |
Definition at line 10863 of file OTAPI_Exec.cpp.
std::string opentxs::OTAPI_Exec::Transaction_GetSenderAcctID | ( | const std::string & | SERVER_ID, |
const std::string & | USER_ID, | ||
const std::string & | ACCOUNT_ID, | ||
const std::string & | THE_TRANSACTION | ||
) | const |
Definition at line 10976 of file OTAPI_Exec.cpp.
std::string opentxs::OTAPI_Exec::Transaction_GetSenderUserID | ( | const std::string & | SERVER_ID, |
const std::string & | USER_ID, | ||
const std::string & | ACCOUNT_ID, | ||
const std::string & | THE_TRANSACTION | ||
) | const |
Definition at line 10769 of file OTAPI_Exec.cpp.
int32_t opentxs::OTAPI_Exec::Transaction_GetSuccess | ( | const std::string & | SERVER_ID, |
const std::string & | USER_ID, | ||
const std::string & | ACCOUNT_ID, | ||
const std::string & | THE_TRANSACTION | ||
) | const |
--------------------------------------------------
Get TransactionSuccess
OT_TRUE (1) == acknowledgment OT_FALSE (0) == rejection OT_ERROR(-1) == error_state (such as dropped message.)
Returns OT_BOOL.
Definition at line 11596 of file OTAPI_Exec.cpp.
std::string opentxs::OTAPI_Exec::Transaction_GetType | ( | const std::string & | SERVER_ID, |
const std::string & | USER_ID, | ||
const std::string & | ACCOUNT_ID, | ||
const std::string & | THE_TRANSACTION | ||
) | const |
Get Transaction Type (internally uses GetTransactionTypeString().)
Definition at line 11430 of file OTAPI_Exec.cpp.
std::string opentxs::OTAPI_Exec::Transaction_GetVoucher | ( | const std::string & | SERVER_ID, |
const std::string & | USER_ID, | ||
const std::string & | ACCOUNT_ID, | ||
const std::string & | THE_TRANSACTION | ||
) | const |
--------------------------------------------------------------------
Retrieve Voucher from Transaction
If you withdrew into a voucher instead of cash, this function allows you to retrieve the actual voucher cheque from the reply transaction. (A voucher is a cheque drawn on an int32_t server account instead of a user's asset account, so the voucher cannot ever bounce due to insufficient funds. We are accustomed to this functionality already in our daily lives, via "money orders" and "cashier's cheques".)
How would you use this in full?
First, call withdrawVoucher() in order to send the request to the server. (You may optionally call FlushMessageBuffer() before doing this.)
Then, call PopMessageBuffer() to retrieve any server reply.
If there is a message from the server in reply, then call Message_GetCommand to verify that it's a reply to the message that you sent, and call Message_GetSuccess to verify whether the message was a success.
If it was a success, next call Message_GetLedger to retrieve the actual "reply ledger" from the server.
Penultimately, call Ledger_GetTransactionByID() and then, finally, call Transaction_GetVoucher() (below) in order to retrieve the voucher cheque itself from the transaction.
Definition at line 10675 of file OTAPI_Exec.cpp.
int32_t opentxs::OTAPI_Exec::Transaction_IsCanceled | ( | const std::string & | SERVER_ID, |
const std::string & | USER_ID, | ||
const std::string & | ACCOUNT_ID, | ||
const std::string & | THE_TRANSACTION | ||
) | const |
Definition at line 11686 of file OTAPI_Exec.cpp.
int32_t opentxs::OTAPI_Exec::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 | ||
) | const |
If a smart contract is already running on the server, this allows a party to trigger clauses on that smart contract, by name. This is NOT a transaction, but it DOES message the server.
Returns int32_t: -1 means error; no message was sent. -2 means the message was sent, but the request number must be passed as a string, so call GetLargeRequestNum. 0 means NO error, but also: no message was sent. >0 means NO error, and the message was sent, and the request number fits into an integer... ...and in fact the requestNum IS the return value! ===> In 99% of cases, this LAST option is what actually happens!!
Definition at line 7458 of file OTAPI_Exec.cpp.
std::string opentxs::OTAPI_Exec::UlongToString | ( | const uint64_t & | lNumber | ) | const |
Definition at line 307 of file OTAPI_Exec.cpp.
int32_t opentxs::OTAPI_Exec::usageCredits | ( | const std::string & | SERVER_ID, |
const std::string & | USER_ID, | ||
const std::string & | USER_ID_CHECK, | ||
const int64_t & | ADJUSTMENT | ||
) | const |
USAGE CREDITS — (Based on a UserID, retrieve or adjust the Usage Credits for that Nym.)
ServerID – Must be included with every message. USER_ID – You must include your own userID so the server can reply. USER_CHECK_ID – This is a SECOND user's ID. (Whose usage credits we are checking) ADJUSTMENT – This can be nullptr (resolves as "0"). Otherwise, positive or negative, and passed as a string. This gives the option to adjust the usage credits balance, up or down.
In this message, you are requesting the server to send you the current balance of the usage credits for the second user_id. You may also adjust this balance up or down (+ or - any int64_t value in string format). If you do, the server reply will contain the updated usage credits, AFTER the adjustment.
You might ask: Doesn't this mean that ANY user can get/set the usage credits for any other?? ANSWER: Most OT server operators will set cmd_usage_credits=false in the ~/.ot/server.cfg file. (BECAUSE ONLY AN ADMINISTRATOR SHOULD BE ABLE TO ADJUST ANYONE'S USAGE CREDITS.) In this case, users will still be able to use this message to VIEW their own personal usage credits, but they will be unable to see others' balances, and they will be unable to do any adjustments to any balances, including their own.
If you wish to give full rights to this function to a specific admin Nym, use the override_nym_id found in ~/.ot/server.cfg After you call usageCredits(), you will receive a server reply. Pass that into the next function: Message_GetUsageCredits()
Definition at line 13430 of file OTAPI_Exec.cpp.
std::string opentxs::OTAPI_Exec::Variable_GetAccess | ( | const std::string & | THE_CONTRACT, |
const std::string & | BYLAW_NAME, | ||
const std::string & | VARIABLE_NAME | ||
) | const |
Definition at line 6604 of file OTAPI_Exec.cpp.
std::string opentxs::OTAPI_Exec::Variable_GetContents | ( | const std::string & | THE_CONTRACT, |
const std::string & | BYLAW_NAME, | ||
const std::string & | VARIABLE_NAME | ||
) | const |
Definition at line 6663 of file OTAPI_Exec.cpp.
std::string opentxs::OTAPI_Exec::Variable_GetNameByIndex | ( | const std::string & | THE_CONTRACT, |
const std::string & | BYLAW_NAME, | ||
const int32_t & | nIndex | ||
) | const |
Definition at line 6498 of file OTAPI_Exec.cpp.
std::string opentxs::OTAPI_Exec::Variable_GetType | ( | const std::string & | THE_CONTRACT, |
const std::string & | BYLAW_NAME, | ||
const std::string & | VARIABLE_NAME | ||
) | const |
Definition at line 6547 of file OTAPI_Exec.cpp.
bool opentxs::OTAPI_Exec::VerifyAccountReceipt | ( | const std::string & | SERVER_ID, |
const std::string & | NYM_ID, | ||
const std::string & | ACCT_ID | ||
) | const |
Returns OT_BOOL. Verifies any asset account (intermediary files) against its own last signed receipt.
Obviously this will fail for any new account that hasn't done any transactions yet, and thus has no receipts.
Definition at line 4738 of file OTAPI_Exec.cpp.
std::string opentxs::OTAPI_Exec::VerifyAndRetrieveXMLContents | ( | const std::string & | THE_CONTRACT, |
const std::string & | SIGNER_ID | ||
) | const |
Verify and Retrieve XML Contents.
Pass in a contract and a user ID, and this function will: – Load the contract up and verify it. (Most classes in OT are derived in some way from OTContract.) – Verify the user's signature on it. – Remove the PGP-style bookends (the signatures, etc) and return the XML contents of the contract in string form. <==
Definition at line 4703 of file OTAPI_Exec.cpp.
bool opentxs::OTAPI_Exec::VerifySignature | ( | const std::string & | SIGNER_NYM_ID, |
const std::string & | THE_CONTRACT | ||
) | const |
OT-Verify the signature on a CONTRACT.
Returns OT_BOOL – OT_TRUE (1) or OT_FALSE (0)
OT-Verify the signature on a CONTRACT stored in a string.
Returns bool – true (1) or false (0)
Definition at line 4676 of file OTAPI_Exec.cpp.
bool opentxs::OTAPI_Exec::VerifyUserPrivateKey | ( | const std::string & | USER_ID | ) | const |
------------------------------------------------------------------------
Verify that USER_ID (including its Private Key) is an available and verified user in local storage.
Loads the user's private key, verifies, then returns OT_TRUE or OT_FALSE.
Definition at line 7888 of file OTAPI_Exec.cpp.
bool opentxs::OTAPI_Exec::Wallet_CanRemoveAccount | ( | const std::string & | ACCOUNT_ID | ) | const |
Can I remove this Account from my wallet?
You cannot remove the Account from your wallet if there are transactions still open. This function tells you whether you can remove the Account or not. (Whether there are transactions...) returns OT_BOOL
Definition at line 1884 of file OTAPI_Exec.cpp.
bool opentxs::OTAPI_Exec::Wallet_CanRemoveAssetType | ( | const std::string & | ASSET_ID | ) | const |
Can I remove this asset contract from my wallet?
You cannot remove the asset contract from your wallet if there are accounts in there using it. This function tells you whether you can remove the asset contract or not. (Whether there are accounts...) returns OT_BOOL
Definition at line 1653 of file OTAPI_Exec.cpp.
bool opentxs::OTAPI_Exec::Wallet_CanRemoveNym | ( | const std::string & | NYM_ID | ) | const |
Can I remove this Nym from my wallet?
You cannot remove the Nym from your wallet if there are accounts in there using it. This function tells you whether you can remove the Nym or not. (Whether there are accounts...) returns OT_BOOL
Definition at line 1743 of file OTAPI_Exec.cpp.
bool opentxs::OTAPI_Exec::Wallet_CanRemoveServer | ( | const std::string & | SERVER_ID | ) | const |
--------------------------------------------------------- FUNCTIONS FOR REMOVING VARIOUS CONTRACTS AND NYMS FROM THE WALLET ***
Can I remove this server contract from my wallet?
You cannot remove the server contract from your wallet if there are accounts in there using it. This function tells you whether you can remove the server contract or not. (Whether there are accounts...) returns OT_BOOL
Definition at line 1537 of file OTAPI_Exec.cpp.
bool opentxs::OTAPI_Exec::Wallet_ChangePassphrase | ( | ) | const |
CHANGE MASTER KEY and PASSWORD.
Normally your passphrase is used to derive a key, which is used to unlock a random number (a symmetric key), which is used as the passphrase to open the master key, which is used as the passphrase to any given Nym.
Since all the Nyms are encrypted to the master key, and since we can change the passphrase on the master key without changing the master key itself, then we don't have to do anything to update all the Nyms, since that part hasn't changed.
But we might want a separate "Change Master Key" function that replaces that key itself, in which case we'd HAVE to load up all the Nyms and re-save them.
UPDATE: Seems the easiest thing to do is to just change both the key and passphase at the same time here, by loading up all the private nyms, destroying the master key, and then saving all the private Nyms. (With master key never actually being "paused.") This will automatically cause it to generate a new master key during the saving process. (Make sure to save the wallet also.)
Definition at line 2301 of file OTAPI_Exec.cpp.
std::string opentxs::OTAPI_Exec::Wallet_ExportCert | ( | const std::string & | NYM_ID | ) | const |
Returns the exported cert, if successful. Else nullptr.
Definition at line 2141 of file OTAPI_Exec.cpp.
std::string opentxs::OTAPI_Exec::Wallet_ExportNym | ( | const std::string & | NYM_ID | ) | const |
Returns the exported Nym, if success. (Else nullptr.)
Definition at line 2099 of file OTAPI_Exec.cpp.
std::string opentxs::OTAPI_Exec::Wallet_GetAccountIDFromPartial | ( | const std::string & | PARTIAL_ID | ) | const |
Definition at line 2474 of file OTAPI_Exec.cpp.
std::string opentxs::OTAPI_Exec::Wallet_GetAssetIDFromPartial | ( | const std::string & | PARTIAL_ID | ) | const |
Definition at line 2421 of file OTAPI_Exec.cpp.
std::string opentxs::OTAPI_Exec::Wallet_GetNymIDFromPartial | ( | const std::string & | PARTIAL_ID | ) | const |
Attempts to find a full ID in the wallet, based on a partial of the same.
Returns nullptr on failure, otherwise returns the full ID.
Definition at line 2315 of file OTAPI_Exec.cpp.
std::string opentxs::OTAPI_Exec::Wallet_GetServerIDFromPartial | ( | const std::string & | PARTIAL_ID | ) | const |
Definition at line 2367 of file OTAPI_Exec.cpp.
std::string opentxs::OTAPI_Exec::Wallet_ImportCert | ( | const std::string & | DISPLAY_NAME, |
const std::string & | FILE_CONTENTS | ||
) | const |
Returns the imported cert's NymID, if successful. Else nullptr.
Definition at line 2240 of file OTAPI_Exec.cpp.
std::string opentxs::OTAPI_Exec::Wallet_ImportNym | ( | const std::string & | FILE_CONTENTS | ) | const |
returns NymID if success, else nullptr.
Definition at line 2176 of file OTAPI_Exec.cpp.
bool opentxs::OTAPI_Exec::Wallet_ImportPurse | ( | const std::string & | SERVER_ID, |
const std::string & | ASSET_TYPE_ID, | ||
const std::string & | USER_ID, | ||
const std::string & | THE_PURSE | ||
) | const |
Should handle duplicates. Should load, merge, and save.
Definition at line 12710 of file OTAPI_Exec.cpp.
bool opentxs::OTAPI_Exec::Wallet_RemoveAssetType | ( | const std::string & | ASSET_ID | ) | const |
Remove this asset contract from my wallet!
Try to remove the asset contract from the wallet. This will not work if there are any accounts in the wallet for the same asset type ID. returns OT_BOOL
Definition at line 1697 of file OTAPI_Exec.cpp.
bool opentxs::OTAPI_Exec::Wallet_RemoveNym | ( | const std::string & | NYM_ID | ) | const |
Remove this Nym from my wallet!
Try to remove the Nym from the wallet. This will not work if there are any nyms in the wallet for the same server ID. returns OT_BOOL
Definition at line 1822 of file OTAPI_Exec.cpp.
bool opentxs::OTAPI_Exec::Wallet_RemoveServer | ( | const std::string & | SERVER_ID | ) | const |
Remove this server contract from my wallet!
Try to remove the server contract from the wallet. This will not work if there are any accounts in the wallet for the same server ID. returns OT_BOOL
Definition at line 1596 of file OTAPI_Exec.cpp.
bool opentxs::OTAPI_Exec::WalletExists | ( | ) | const |
WALLET EXISTS
Just Checks if the m_pWallet pointer is not null.
Definition at line 358 of file OTAPI_Exec.cpp.
int32_t opentxs::OTAPI_Exec::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 | ||
) | const |
--------------------------------------------------------------------------
WITHDRAW VOUCHER – aka CASHIER'S CHEQUE.
This is VERY similar to withdrawing cash, except the server gives you a voucher instead of cash. It's the same thing as a CASHIER'S CHEQUE...
Basically the funds are moved into an int32_t server account, and then the server gives you a cheque drawn on its own account. This way you can use it like a cheque, but it will never bounce.
Returns int32_t: -1 means error; no message was sent. -2 means the message was sent, but the request number must be passed as a string, so call GetLargeRequestNum. 0 means NO error, but also: no message was sent. >0 means NO error, and the message was sent, and the request number fits into an integer... ...and in fact the requestNum IS the return value! ===> In 99% of cases, this LAST option is what actually happens!!
Definition at line 14529 of file OTAPI_Exec.cpp.
std::string opentxs::OTAPI_Exec::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 | ||
) | const |
(Above) IMPORTANT: USE the above functions for setting the CLIENT-SIDE
display labels that you use in your UI for the Nyms/Servers/AssetTypes/Accounts. These labels are stored SEPARATELY from their own files, in the wallet file.
If you just added the contract, it will SET the label for you based on the contract type. like if it's an asset contract, it uses the currency name field from the asset contract. If it's a server contract it uses the entity short name. After that, it's configurable for the user, and stays on client side, and persists via wallet.
EVEN WHEN OT has to re-download one of those files, it will make sure to save the display label properly in the wallet.
THIS MEANS you, as a client developer: 1) CAN DEPEND on these labels to have the right value. 2) Can expect them to start out with good default values. 3) Can configure them from there. 4) SHOULD DISPLAY THEM as appropriate in your application. 5) Of course, use the ID behind the scenes for making all your OT calls... just use the name for display purposes.
WRITE A CHEQUE --- (Returns the cheque in string form.) ==> WriteCheque() internally constructs an OTCheque and issues it, like so: OTCheque theCheque( SERVER_ID, ASSET_TYPE_ID ); theCheque.IssueCheque( AMOUNT // The amount of the cheque, in string form, which OTAPI
will convert to a int64_t integer. Negative amounts allowed, since that is how OT implements invoices. (An invoice is just a cheque with a negative amount.)
lTransactionNumber, // The API will supply this automatically, as long as
there are some transaction numbers in the wallet. (Call getTransactionNumber() if your wallet needs more.)
VALID_FROM, VALID_TO, // Valid date range (in seconds since Jan 1970...) ACCOUNT_ID, USER_ID, // User ID and Acct ID for SENDER. CHEQUE_MEMO, // The memo for the cheque. (Can be empty or be nullptr.) RECIPIENT_USER_ID); // Recipient User ID is optional. (You can use an
empty string here, to write a blank cheque, or pass nullptr.)
Definition at line 4916 of file OTAPI_Exec.cpp.
|
staticprotected |
Definition at line 4096 of file OTAPI_Exec.hpp.
|
staticprotected |
Definition at line 4095 of file OTAPI_Exec.hpp.
|
protected |
Definition at line 4098 of file OTAPI_Exec.hpp.