Open-Transactions
0.93.0-ge03d287
|
#include <OTAPI.hpp>
Static Public Member Functions | |
static EXPORT OTAPI_Exec * | SetExecutor (OTAPI_Exec *exec) |
static EXPORT OTAPI_Exec * | Exec () |
static EXPORT OTAPI_Exec * | It () |
static EXPORT OT_API * | OTAPI () |
static EXPORT int64_t | StringToLong (const std::string &strNumber) |
static EXPORT std::string | LongToString (const int64_t &lNumber) |
static EXPORT uint64_t | StringToUlong (const std::string &strNumber) |
static EXPORT std::string | UlongToString (const uint64_t &lNumber) |
static EXPORT bool | AppInit () |
static EXPORT bool | AppCleanup () |
static EXPORT void | SetAppBinaryFolder (const std::string &strFolder) |
static EXPORT void | SetHomeFolder (const std::string &strFolder) |
static EXPORT bool | SetWallet (const std::string &strWalletFilename) |
static EXPORT bool | WalletExists () |
static EXPORT bool | LoadWallet () |
static EXPORT bool | SwitchWallet () |
static EXPORT void | Output (const int32_t &nLogLevel, const std::string &strOutput) |
static EXPORT time64_t | GetTime () |
static EXPORT std::string | NumList_Add (const std::string &strNumList, const std::string &strNumbers) |
static EXPORT std::string | NumList_Remove (const std::string &strNumList, const std::string &strNumbers) |
static EXPORT bool | NumList_VerifyQuery (const std::string &strNumList, const std::string &strNumbers) |
static EXPORT bool | NumList_VerifyAll (const std::string &strNumList, const std::string &strNumbers) |
static EXPORT int32_t | NumList_Count (const std::string &strNumList) |
static EXPORT std::string | Encode (const std::string &strPlaintext, const bool &bLineBreaks) |
static EXPORT std::string | Decode (const std::string &strEncoded, const bool &bLineBreaks) |
static EXPORT std::string | Encrypt (const std::string &RECIPIENT_NYM_ID, const std::string &strPlaintext) |
static EXPORT std::string | Decrypt (const std::string &RECIPIENT_NYM_ID, const std::string &strCiphertext) |
static EXPORT std::string | CreateSymmetricKey () |
static EXPORT std::string | SymmetricEncrypt (const std::string &SYMMETRIC_KEY, const std::string &PLAINTEXT) |
static EXPORT std::string | SymmetricDecrypt (const std::string &SYMMETRIC_KEY, const std::string &CIPHERTEXT_ENVELOPE) |
static EXPORT std::string | SignContract (const std::string &SIGNER_NYM_ID, const std::string &THE_CONTRACT) |
static EXPORT std::string | FlatSign (const std::string &SIGNER_NYM_ID, const std::string &THE_INPUT, const std::string &CONTRACT_TYPE) |
static EXPORT std::string | AddSignature (const std::string &SIGNER_NYM_ID, const std::string &THE_CONTRACT) |
static EXPORT bool | VerifySignature (const std::string &SIGNER_NYM_ID, const std::string &THE_CONTRACT) |
static EXPORT std::string | VerifyAndRetrieveXMLContents (const std::string &THE_CONTRACT, const std::string &SIGNER_ID) |
static EXPORT int32_t | GetMemlogSize () |
static EXPORT std::string | GetMemlogAtIndex (const int32_t &nIndex) |
static EXPORT std::string | PeekMemlogFront () |
static EXPORT std::string | PeekMemlogBack () |
static EXPORT bool | PopMemlogFront () |
static EXPORT bool | PopMemlogBack () |
static EXPORT std::string | CreateNym (const int32_t &nKeySize, const std::string &NYM_ID_SOURCE, const std::string &ALT_LOCATION) |
static EXPORT std::string | GetNym_ActiveCronItemIDs (const std::string &NYM_ID, const std::string &SERVER_ID) |
static EXPORT std::string | GetActiveCronItem (const std::string &SERVER_ID, int64_t lTransNum) |
static EXPORT std::string | GetNym_SourceForID (const std::string &NYM_ID) |
static EXPORT std::string | GetNym_AltSourceLocation (const std::string &NYM_ID) |
static EXPORT int32_t | GetNym_CredentialCount (const std::string &NYM_ID) |
static EXPORT std::string | GetNym_CredentialID (const std::string &NYM_ID, const int32_t &nIndex) |
static EXPORT std::string | GetNym_CredentialContents (const std::string &NYM_ID, const std::string &CREDENTIAL_ID) |
static EXPORT int32_t | GetNym_RevokedCredCount (const std::string &NYM_ID) |
static EXPORT std::string | GetNym_RevokedCredID (const std::string &NYM_ID, const int32_t &nIndex) |
static EXPORT std::string | GetNym_RevokedCredContents (const std::string &NYM_ID, const std::string &CREDENTIAL_ID) |
static EXPORT int32_t | GetNym_SubcredentialCount (const std::string &NYM_ID, const std::string &MASTER_CRED_ID) |
static EXPORT std::string | GetNym_SubCredentialID (const std::string &NYM_ID, const std::string &MASTER_CRED_ID, const int32_t &nIndex) |
static EXPORT std::string | GetNym_SubCredentialContents (const std::string &NYM_ID, const std::string &MASTER_CRED_ID, const std::string &SUB_CRED_ID) |
static EXPORT std::string | AddSubcredential (const std::string &NYM_ID, const std::string &MASTER_CRED_ID, const int32_t &nKeySize) |
static EXPORT bool | RevokeSubcredential (const std::string &NYM_ID, const std::string &MASTER_CRED_ID, const std::string &SUB_CRED_ID) |
static EXPORT std::string | CreateServerContract (const std::string &NYM_ID, const std::string &strXMLcontents) |
static EXPORT std::string | CreateAssetContract (const std::string &NYM_ID, const std::string &strXMLcontents) |
static EXPORT std::string | CalculateAssetContractID (const std::string &str_Contract) |
static EXPORT std::string | CalculateServerContractID (const std::string &str_Contract) |
static EXPORT int32_t | AddServerContract (const std::string &strContract) |
static EXPORT int32_t | AddAssetContract (const std::string &strContract) |
static EXPORT int32_t | GetServerCount () |
static EXPORT int32_t | GetAssetTypeCount () |
static EXPORT int32_t | GetAccountCount () |
static EXPORT int32_t | GetNymCount () |
static EXPORT std::string | GetServer_ID (const int32_t &nIndex) |
static EXPORT std::string | GetServer_Name (const std::string &SERVER_ID) |
static EXPORT std::string | GetServer_Contract (const std::string &SERVER_ID) |
static EXPORT std::string | FormatAmount (const std::string &ASSET_TYPE_ID, const int64_t &THE_AMOUNT) |
static EXPORT int64_t | StringToAmount (const std::string &ASSET_TYPE_ID, const std::string &str_input) |
static EXPORT std::string | GetAssetType_ID (const int32_t &nIndex) |
static EXPORT std::string | GetAssetType_Name (const std::string &ASSET_TYPE_ID) |
static EXPORT std::string | GetAssetType_TLA (const std::string &ASSET_TYPE_ID) |
static EXPORT std::string | GetAssetType_Contract (const std::string &ASSET_TYPE_ID) |
static EXPORT std::string | GetAccountWallet_ID (const int32_t &nIndex) |
static EXPORT std::string | GetAccountWallet_Name (const std::string &ACCOUNT_ID) |
static EXPORT int64_t | GetAccountWallet_Balance (const std::string &ACCOUNT_ID) |
static EXPORT std::string | GetAccountWallet_Type (const std::string &ACCOUNT_ID) |
static EXPORT std::string | GetAccountWallet_AssetTypeID (const std::string &ACCOUNT_ID) |
static EXPORT std::string | GetAccountWallet_ServerID (const std::string &ACCOUNT_ID) |
static EXPORT std::string | GetAccountWallet_NymID (const std::string &ACCOUNT_ID) |
static EXPORT std::string | GetAccountWallet_InboxHash (const std::string &ACCOUNT_ID) |
static EXPORT std::string | GetAccountWallet_OutboxHash (const std::string &ACCOUNT_ID) |
static EXPORT bool | VerifyAccountReceipt (const std::string &SERVER_ID, const std::string &NYM_ID, const std::string &ACCT_ID) |
static EXPORT int32_t | GetNym_TransactionNumCount (const std::string &SERVER_ID, const std::string &NYM_ID) |
static EXPORT std::string | GetNym_ID (const int32_t &nIndex) |
static EXPORT std::string | GetNym_Name (const std::string &NYM_ID) |
static EXPORT std::string | GetNym_Stats (const std::string &NYM_ID) |
static EXPORT std::string | GetNym_NymboxHash (const std::string &SERVER_ID, const std::string &NYM_ID) |
static EXPORT std::string | GetNym_RecentHash (const std::string &SERVER_ID, const std::string &NYM_ID) |
static EXPORT std::string | GetNym_InboxHash (const std::string &ACCOUNT_ID, const std::string &NYM_ID) |
static EXPORT std::string | GetNym_OutboxHash (const std::string &ACCOUNT_ID, const std::string &NYM_ID) |
static EXPORT bool | IsNym_RegisteredAtServer (const std::string &NYM_ID, const std::string &SERVER_ID) |
static EXPORT int32_t | GetNym_MailCount (const std::string &NYM_ID) |
static EXPORT std::string | GetNym_MailContentsByIndex (const std::string &NYM_ID, const int32_t &nIndex) |
static EXPORT std::string | GetNym_MailSenderIDByIndex (const std::string &NYM_ID, const int32_t &nIndex) |
static EXPORT std::string | GetNym_MailServerIDByIndex (const std::string &NYM_ID, const int32_t &nIndex) |
static EXPORT bool | Nym_RemoveMailByIndex (const std::string &NYM_ID, const int32_t &nIndex) |
static EXPORT bool | Nym_VerifyMailByIndex (const std::string &NYM_ID, const int32_t &nIndex) |
static EXPORT int32_t | GetNym_OutmailCount (const std::string &NYM_ID) |
static EXPORT std::string | GetNym_OutmailContentsByIndex (const std::string &NYM_ID, const int32_t &nIndex) |
static EXPORT std::string | GetNym_OutmailRecipientIDByIndex (const std::string &NYM_ID, const int32_t &nIndex) |
static EXPORT std::string | GetNym_OutmailServerIDByIndex (const std::string &NYM_ID, const int32_t &nIndex) |
static EXPORT bool | Nym_RemoveOutmailByIndex (const std::string &NYM_ID, const int32_t &nIndex) |
static EXPORT bool | Nym_VerifyOutmailByIndex (const std::string &NYM_ID, const int32_t &nIndex) |
static EXPORT int32_t | GetNym_OutpaymentsCount (const std::string &NYM_ID) |
static EXPORT std::string | GetNym_OutpaymentsContentsByIndex (const std::string &NYM_ID, const int32_t &nIndex) |
static EXPORT std::string | GetNym_OutpaymentsRecipientIDByIndex (const std::string &NYM_ID, const int32_t &nIndex) |
static EXPORT std::string | GetNym_OutpaymentsServerIDByIndex (const std::string &NYM_ID, const int32_t &nIndex) |
static EXPORT bool | Nym_RemoveOutpaymentsByIndex (const std::string &NYM_ID, const int32_t &nIndex) |
static EXPORT bool | Nym_VerifyOutpaymentsByIndex (const std::string &NYM_ID, const int32_t &nIndex) |
static EXPORT bool | Wallet_CanRemoveServer (const std::string &SERVER_ID) |
static EXPORT bool | Wallet_RemoveServer (const std::string &SERVER_ID) |
static EXPORT bool | Wallet_CanRemoveAssetType (const std::string &ASSET_ID) |
static EXPORT bool | Wallet_RemoveAssetType (const std::string &ASSET_ID) |
static EXPORT bool | Wallet_CanRemoveNym (const std::string &NYM_ID) |
static EXPORT bool | Wallet_RemoveNym (const std::string &NYM_ID) |
static EXPORT bool | Wallet_CanRemoveAccount (const std::string &ACCOUNT_ID) |
static EXPORT bool | Wallet_ChangePassphrase () |
static EXPORT std::string | Wallet_ExportNym (const std::string &NYM_ID) |
Returns the exported Nym, if success. (Else nullptr.) More... | |
static EXPORT std::string | Wallet_ImportNym (const std::string &FILE_CONTENTS) |
returns NymID if success, else nullptr. More... | |
static EXPORT std::string | Wallet_ImportCert (const std::string &DISPLAY_NAME, const std::string &FILE_CONTENTS) |
Returns the imported cert's NymID, if successful. Else nullptr. More... | |
static EXPORT std::string | Wallet_ExportCert (const std::string &NYM_ID) |
Returns the exported cert, if successful. Else nullptr. More... | |
static EXPORT std::string | Wallet_GetNymIDFromPartial (const std::string &PARTIAL_ID) |
Attempts to find a full ID in the wallet, based on a partial of the same. More... | |
static EXPORT std::string | Wallet_GetServerIDFromPartial (const std::string &PARTIAL_ID) |
static EXPORT std::string | Wallet_GetAssetIDFromPartial (const std::string &PARTIAL_ID) |
static EXPORT std::string | Wallet_GetAccountIDFromPartial (const std::string &PARTIAL_ID) |
static EXPORT bool | SetNym_Name (const std::string &NYM_ID, const std::string &SIGNER_NYM_ID, const std::string &NYM_NEW_NAME) |
static EXPORT bool | SetAccountWallet_Name (const std::string &ACCT_ID, const std::string &SIGNER_NYM_ID, const std::string &ACCT_NEW_NAME) |
static EXPORT bool | SetAssetType_Name (const std::string &ASSET_ID, const std::string &STR_NEW_NAME) |
static EXPORT bool | SetServer_Name (const std::string &SERVER_ID, const std::string &STR_NEW_NAME) |
static EXPORT std::string | WriteCheque (const std::string &SERVER_ID, const int64_t &CHEQUE_AMOUNT, const time64_t &VALID_FROM, const time64_t &VALID_TO, const std::string &SENDER_ACCT_ID, const std::string &SENDER_USER_ID, const std::string &CHEQUE_MEMO, const std::string &RECIPIENT_USER_ID) |
static EXPORT bool | DiscardCheque (const std::string &SERVER_ID, const std::string &USER_ID, const std::string &ACCT_ID, const std::string &THE_CHEQUE) |
static EXPORT std::string | ProposePaymentPlan (const std::string &SERVER_ID, const time64_t &VALID_FROM, const time64_t &VALID_TO, const std::string &SENDER_ACCT_ID, const std::string &SENDER_USER_ID, const std::string &PLAN_CONSIDERATION, const std::string &RECIPIENT_ACCT_ID, const std::string &RECIPIENT_USER_ID, const int64_t &INITIAL_PAYMENT_AMOUNT, const time64_t &INITIAL_PAYMENT_DELAY, const int64_t &PAYMENT_PLAN_AMOUNT, const time64_t &PAYMENT_PLAN_DELAY, const time64_t &PAYMENT_PLAN_PERIOD, const time64_t &PAYMENT_PLAN_LENGTH, const int32_t &PAYMENT_PLAN_MAX_PAYMENTS) |
static EXPORT std::string | EasyProposePlan (const std::string &SERVER_ID, const std::string &DATE_RANGE, const std::string &SENDER_ACCT_ID, const std::string &SENDER_USER_ID, const std::string &PLAN_CONSIDERATION, const std::string &RECIPIENT_ACCT_ID, const std::string &RECIPIENT_USER_ID, const std::string &INITIAL_PAYMENT, const std::string &PAYMENT_PLAN, const std::string &PLAN_EXPIRY) |
static EXPORT 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) |
static EXPORT std::string | Create_SmartContract (const std::string &SIGNER_NYM_ID, const time64_t &VALID_FROM, const time64_t &VALID_TO) |
static EXPORT std::string | SmartContract_AddBylaw (const std::string &THE_CONTRACT, const std::string &SIGNER_NYM_ID, const std::string &BYLAW_NAME) |
static EXPORT std::string | SmartContract_AddClause (const std::string &THE_CONTRACT, const std::string &SIGNER_NYM_ID, const std::string &BYLAW_NAME, const std::string &CLAUSE_NAME, const std::string &SOURCE_CODE) |
static EXPORT std::string | SmartContract_AddVariable (const std::string &THE_CONTRACT, const std::string &SIGNER_NYM_ID, const std::string &BYLAW_NAME, const std::string &VAR_NAME, const std::string &VAR_ACCESS, const std::string &VAR_TYPE, const std::string &VAR_VALUE) |
static EXPORT std::string | SmartContract_AddCallback (const std::string &THE_CONTRACT, const std::string &SIGNER_NYM_ID, const std::string &BYLAW_NAME, const std::string &CALLBACK_NAME, const std::string &CLAUSE_NAME) |
static EXPORT std::string | SmartContract_AddHook (const std::string &THE_CONTRACT, const std::string &SIGNER_NYM_ID, const std::string &BYLAW_NAME, const std::string &HOOK_NAME, const std::string &CLAUSE_NAME) |
static EXPORT std::string | SmartContract_AddParty (const std::string &THE_CONTRACT, const std::string &SIGNER_NYM_ID, const std::string &PARTY_NAME, const std::string &AGENT_NAME) |
static EXPORT std::string | SmartContract_AddAccount (const std::string &THE_CONTRACT, const std::string &SIGNER_NYM_ID, const std::string &PARTY_NAME, const std::string &ACCT_NAME, const std::string &ASSET_TYPE_ID) |
static EXPORT int32_t | SmartContract_CountNumsNeeded (const std::string &THE_CONTRACT, const std::string &AGENT_NAME) |
static EXPORT std::string | SmartContract_ConfirmAccount (const std::string &THE_CONTRACT, const std::string &SIGNER_NYM_ID, const std::string &PARTY_NAME, const std::string &ACCT_NAME, const std::string &AGENT_NAME, const std::string &ACCT_ID) |
static EXPORT std::string | SmartContract_ConfirmParty (const std::string &THE_CONTRACT, const std::string &PARTY_NAME, const std::string &NYM_ID) |
static EXPORT bool | Smart_AreAllPartiesConfirmed (const std::string &THE_CONTRACT) |
static EXPORT int32_t | Smart_GetBylawCount (const std::string &THE_CONTRACT) |
static EXPORT std::string | Smart_GetBylawByIndex (const std::string &THE_CONTRACT, const int32_t &nIndex) |
static EXPORT std::string | Bylaw_GetLanguage (const std::string &THE_CONTRACT, const std::string &BYLAW_NAME) |
static EXPORT int32_t | Bylaw_GetClauseCount (const std::string &THE_CONTRACT, const std::string &BYLAW_NAME) |
static EXPORT std::string | Clause_GetNameByIndex (const std::string &THE_CONTRACT, const std::string &BYLAW_NAME, const int32_t &nIndex) |
static EXPORT std::string | Clause_GetContents (const std::string &THE_CONTRACT, const std::string &BYLAW_NAME, const std::string &CLAUSE_NAME) |
static EXPORT int32_t | Bylaw_GetVariableCount (const std::string &THE_CONTRACT, const std::string &BYLAW_NAME) |
static EXPORT std::string | Variable_GetNameByIndex (const std::string &THE_CONTRACT, const std::string &BYLAW_NAME, const int32_t &nIndex) |
static EXPORT std::string | Variable_GetType (const std::string &THE_CONTRACT, const std::string &BYLAW_NAME, const std::string &VARIABLE_NAME) |
static EXPORT std::string | Variable_GetAccess (const std::string &THE_CONTRACT, const std::string &BYLAW_NAME, const std::string &VARIABLE_NAME) |
static EXPORT std::string | Variable_GetContents (const std::string &THE_CONTRACT, const std::string &BYLAW_NAME, const std::string &VARIABLE_NAME) |
static EXPORT int32_t | Bylaw_GetHookCount (const std::string &THE_CONTRACT, const std::string &BYLAW_NAME) |
static EXPORT std::string | Hook_GetNameByIndex (const std::string &THE_CONTRACT, const std::string &BYLAW_NAME, const int32_t &nIndex) |
static EXPORT int32_t | Hook_GetClauseCount (const std::string &THE_CONTRACT, const std::string &BYLAW_NAME, const std::string &HOOK_NAME) |
static EXPORT std::string | Hook_GetClauseAtIndex (const std::string &THE_CONTRACT, const std::string &BYLAW_NAME, const std::string &HOOK_NAME, const int32_t &nIndex) |
static EXPORT int32_t | Bylaw_GetCallbackCount (const std::string &THE_CONTRACT, const std::string &BYLAW_NAME) |
static EXPORT std::string | Callback_GetNameByIndex (const std::string &THE_CONTRACT, const std::string &BYLAW_NAME, const int32_t &nIndex) |
static EXPORT std::string | Callback_GetClause (const std::string &THE_CONTRACT, const std::string &BYLAW_NAME, const std::string &CALLBACK_NAME) |
static EXPORT int32_t | Smart_GetPartyCount (const std::string &THE_CONTRACT) |
static EXPORT std::string | Smart_GetPartyByIndex (const std::string &THE_CONTRACT, const int32_t &nIndex) |
static EXPORT bool | Smart_IsPartyConfirmed (const std::string &THE_CONTRACT, const std::string &PARTY_NAME) |
static EXPORT std::string | Party_GetID (const std::string &THE_CONTRACT, const std::string &PARTY_NAME) |
static EXPORT int32_t | Party_GetAcctCount (const std::string &THE_CONTRACT, const std::string &PARTY_NAME) |
static EXPORT std::string | Party_GetAcctNameByIndex (const std::string &THE_CONTRACT, const std::string &PARTY_NAME, const int32_t &nIndex) |
static EXPORT std::string | Party_GetAcctID (const std::string &THE_CONTRACT, const std::string &PARTY_NAME, const std::string &ACCT_NAME) |
static EXPORT std::string | Party_GetAcctAssetID (const std::string &THE_CONTRACT, const std::string &PARTY_NAME, const std::string &ACCT_NAME) |
static EXPORT std::string | Party_GetAcctAgentName (const std::string &THE_CONTRACT, const std::string &PARTY_NAME, const std::string &ACCT_NAME) |
static EXPORT int32_t | Party_GetAgentCount (const std::string &THE_CONTRACT, const std::string &PARTY_NAME) |
static EXPORT std::string | Party_GetAgentNameByIndex (const std::string &THE_CONTRACT, const std::string &PARTY_NAME, const int32_t &nIndex) |
static EXPORT std::string | Party_GetAgentID (const std::string &THE_CONTRACT, const std::string &PARTY_NAME, const std::string &AGENT_NAME) |
static EXPORT int32_t | activateSmartContract (const std::string &SERVER_ID, const std::string &USER_ID, const std::string &THE_SMART_CONTRACT) |
static EXPORT int32_t | triggerClause (const std::string &SERVER_ID, const std::string &USER_ID, const int64_t &TRANSACTION_NUMBER, const std::string &CLAUSE_NAME, const std::string &STR_PARAM) |
static EXPORT bool | Msg_HarvestTransactionNumbers (const std::string &THE_MESSAGE, const std::string &USER_ID, const bool &bHarvestingForRetry, const bool &bReplyWasSuccess, const bool &bReplyWasFailure, const bool &bTransactionWasSuccess, const bool &bTransactionWasFailure) |
static EXPORT std::string | LoadUserPubkey_Encryption (const std::string &USER_ID) |
static EXPORT std::string | LoadUserPubkey_Signing (const std::string &USER_ID) |
static EXPORT std::string | LoadPubkey_Encryption (const std::string &USER_ID) |
static EXPORT std::string | LoadPubkey_Signing (const std::string &USER_ID) |
static EXPORT bool | VerifyUserPrivateKey (const std::string &USER_ID) |
static EXPORT std::string | LoadPurse (const std::string &SERVER_ID, const std::string &ASSET_TYPE_ID, const std::string &USER_ID) |
static EXPORT std::string | LoadMint (const std::string &SERVER_ID, const std::string &ASSET_TYPE_ID) |
static EXPORT std::string | LoadAssetContract (const std::string &ASSET_TYPE_ID) |
static EXPORT std::string | LoadServerContract (const std::string &SERVER_ID) |
static EXPORT bool | Mint_IsStillGood (const std::string &SERVER_ID, const std::string &ASSET_TYPE_ID) |
static EXPORT bool | IsBasketCurrency (const std::string &ASSET_TYPE_ID) |
static EXPORT int32_t | Basket_GetMemberCount (const std::string &BASKET_ASSET_TYPE_ID) |
static EXPORT std::string | Basket_GetMemberType (const std::string &BASKET_ASSET_TYPE_ID, const int32_t &nIndex) |
static EXPORT int64_t | Basket_GetMinimumTransferAmount (const std::string &BASKET_ASSET_TYPE_ID) |
static EXPORT int64_t | Basket_GetMemberMinimumTransferAmount (const std::string &BASKET_ASSET_TYPE_ID, const int32_t &nIndex) |
static EXPORT std::string | LoadAssetAccount (const std::string &SERVER_ID, const std::string &USER_ID, const std::string &ACCOUNT_ID) |
static EXPORT std::string | LoadInbox (const std::string &SERVER_ID, const std::string &USER_ID, const std::string &ACCOUNT_ID) |
static EXPORT std::string | LoadOutbox (const std::string &SERVER_ID, const std::string &USER_ID, const std::string &ACCOUNT_ID) |
static EXPORT std::string | LoadInboxNoVerify (const std::string &SERVER_ID, const std::string &USER_ID, const std::string &ACCOUNT_ID) |
These versions don't verify the ledger, they just load it up. More... | |
static EXPORT std::string | LoadOutboxNoVerify (const std::string &SERVER_ID, const std::string &USER_ID, const std::string &ACCOUNT_ID) |
static EXPORT std::string | LoadPaymentInbox (const std::string &SERVER_ID, const std::string &USER_ID) |
static EXPORT std::string | LoadPaymentInboxNoVerify (const std::string &SERVER_ID, const std::string &USER_ID) |
static EXPORT std::string | LoadRecordBox (const std::string &SERVER_ID, const std::string &USER_ID, const std::string &ACCOUNT_ID) |
NOTE: Sometimes the user ID is also passed in the "account ID" field,. More... | |
static EXPORT std::string | LoadRecordBoxNoVerify (const std::string &SERVER_ID, const std::string &USER_ID, const std::string &ACCOUNT_ID) |
static EXPORT bool | ClearRecord (const std::string &SERVER_ID, const std::string &USER_ID, const std::string &ACCOUNT_ID, const int32_t &nIndex, const bool &bClearAll) |
static EXPORT std::string | LoadExpiredBox (const std::string &SERVER_ID, const std::string &USER_ID) |
static EXPORT std::string | LoadExpiredBoxNoVerify (const std::string &SERVER_ID, const std::string &USER_ID) |
static EXPORT bool | ClearExpired (const std::string &SERVER_ID, const std::string &USER_ID, const int32_t &nIndex, const bool &bClearAll) |
static EXPORT int32_t | Ledger_GetCount (const std::string &SERVER_ID, const std::string &USER_ID, const std::string &ACCOUNT_ID, const std::string &THE_LEDGER) |
Find out how many pending transactions (and receipts) are in this inbox. More... | |
static EXPORT std::string | Ledger_CreateResponse (const std::string &SERVER_ID, const std::string &USER_ID, const std::string &ACCOUNT_ID, const std::string &ORIGINAL_LEDGER) |
Creates a new 'response' ledger, set up with the right Server ID, etc,. More... | |
static EXPORT std::string | Ledger_GetTransactionByIndex (const std::string &SERVER_ID, const std::string &USER_ID, const std::string &ACCOUNT_ID, const std::string &THE_LEDGER, const int32_t &nIndex) |
static EXPORT std::string | Ledger_GetTransactionByID (const std::string &SERVER_ID, const std::string &USER_ID, const std::string &ACCOUNT_ID, const std::string &THE_LEDGER, const int64_t &TRANSACTION_NUMBER) |
static EXPORT int64_t | Ledger_GetTransactionIDByIndex (const std::string &SERVER_ID, const std::string &USER_ID, const std::string &ACCOUNT_ID, const std::string &THE_LEDGER, const int32_t &nIndex) |
static EXPORT std::string | Ledger_AddTransaction (const std::string &SERVER_ID, const std::string &USER_ID, const std::string &ACCOUNT_ID, const std::string &THE_LEDGER, const std::string &THE_TRANSACTION) |
Add a transaction to a ledger. More... | |
static EXPORT std::string | Transaction_CreateResponse (const std::string &SERVER_ID, const std::string &USER_ID, const std::string &ACCOUNT_ID, const std::string &RESPONSE_LEDGER, const std::string &ORIGINAL_TRANSACTION, const bool &BOOL_DO_I_ACCEPT) |
static EXPORT std::string | Ledger_FinalizeResponse (const std::string &SERVER_ID, const std::string &USER_ID, const std::string &ACCOUNT_ID, const std::string &THE_LEDGER) |
static EXPORT std::string | Ledger_GetInstrument (const std::string &SERVER_ID, const std::string &USER_ID, const std::string &ACCOUNT_ID, const std::string &THE_LEDGER, const int32_t &nIndex) |
static EXPORT bool | RecordPayment (const std::string &SERVER_ID, const std::string &USER_ID, const bool &bIsInbox, const int32_t &nIndex, const bool &bSaveCopy) |
static EXPORT std::string | Transaction_GetType (const std::string &SERVER_ID, const std::string &USER_ID, const std::string &ACCOUNT_ID, const std::string &THE_TRANSACTION) |
Get Transaction Type (internally uses GetTransactionTypeString().) More... | |
static EXPORT int64_t | ReplyNotice_GetRequestNum (const std::string &SERVER_ID, const std::string &USER_ID, const std::string &THE_TRANSACTION) |
Transactions do not have request numbers. However, if you have a. More... | |
static EXPORT std::string | Transaction_GetVoucher (const std::string &SERVER_ID, const std::string &USER_ID, const std::string &ACCOUNT_ID, const std::string &THE_TRANSACTION) |
static EXPORT int32_t | Transaction_GetSuccess (const std::string &SERVER_ID, const std::string &USER_ID, const std::string &ACCOUNT_ID, const std::string &THE_TRANSACTION) |
static EXPORT int32_t | Transaction_IsCanceled (const std::string &SERVER_ID, const std::string &USER_ID, const std::string &ACCOUNT_ID, const std::string &THE_TRANSACTION) |
static EXPORT int32_t | Transaction_GetBalanceAgreementSuccess (const std::string &SERVER_ID, const std::string &USER_ID, const std::string &ACCOUNT_ID, const std::string &THE_TRANSACTION) |
static EXPORT time64_t | Transaction_GetDateSigned (const std::string &SERVER_ID, const std::string &USER_ID, const std::string &ACCOUNT_ID, const std::string &THE_TRANSACTION) |
static EXPORT int64_t | Transaction_GetAmount (const std::string &SERVER_ID, const std::string &USER_ID, const std::string &ACCOUNT_ID, const std::string &THE_TRANSACTION) |
static EXPORT std::string | Pending_GetNote (const std::string &SERVER_ID, const std::string &USER_ID, const std::string &ACCOUNT_ID, const std::string &THE_TRANSACTION) |
static EXPORT std::string | Transaction_GetSenderUserID (const std::string &SERVER_ID, const std::string &USER_ID, const std::string &ACCOUNT_ID, const std::string &THE_TRANSACTION) |
static EXPORT std::string | Transaction_GetSenderAcctID (const std::string &SERVER_ID, const std::string &USER_ID, const std::string &ACCOUNT_ID, const std::string &THE_TRANSACTION) |
static EXPORT std::string | Transaction_GetRecipientUserID (const std::string &SERVER_ID, const std::string &USER_ID, const std::string &ACCOUNT_ID, const std::string &THE_TRANSACTION) |
static EXPORT std::string | Transaction_GetRecipientAcctID (const std::string &SERVER_ID, const std::string &USER_ID, const std::string &ACCOUNT_ID, const std::string &THE_TRANSACTION) |
static EXPORT int64_t | Transaction_GetDisplayReferenceToNum (const std::string &SERVER_ID, const std::string &USER_ID, const std::string &ACCOUNT_ID, const std::string &THE_TRANSACTION) |
static EXPORT bool | SavePurse (const std::string &SERVER_ID, const std::string &ASSET_TYPE_ID, const std::string &USER_ID, const std::string &THE_PURSE) |
static EXPORT std::string | CreatePurse (const std::string &SERVER_ID, const std::string &ASSET_TYPE_ID, const std::string &OWNER_ID, const std::string &SIGNER_ID) |
static EXPORT std::string | CreatePurse_Passphrase (const std::string &SERVER_ID, const std::string &ASSET_TYPE_ID, const std::string &SIGNER_ID) |
static EXPORT int64_t | Purse_GetTotalValue (const std::string &SERVER_ID, const std::string &ASSET_TYPE_ID, const std::string &THE_PURSE) |
Get Purse Total Value (internally uses GetTotalValue().) More... | |
static EXPORT int32_t | Purse_Count (const std::string &SERVER_ID, const std::string &ASSET_TYPE_ID, const std::string &THE_PURSE) |
returns a count of the number of cash tokens inside this purse. More... | |
static EXPORT bool | Purse_HasPassword (const std::string &SERVER_ID, const std::string &THE_PURSE) |
static EXPORT std::string | Purse_Peek (const std::string &SERVER_ID, const std::string &ASSET_TYPE_ID, const std::string &OWNER_ID, const std::string &THE_PURSE) |
static EXPORT std::string | Purse_Pop (const std::string &SERVER_ID, const std::string &ASSET_TYPE_ID, const std::string &OWNER_OR_SIGNER_ID, const std::string &THE_PURSE) |
static EXPORT std::string | Purse_Push (const std::string &SERVER_ID, const std::string &ASSET_TYPE_ID, const std::string &SIGNER_ID, const std::string &OWNER_ID, const std::string &THE_PURSE, const std::string &THE_TOKEN) |
static EXPORT std::string | Purse_Empty (const std::string &SERVER_ID, const std::string &ASSET_TYPE_ID, const std::string &SIGNER_ID, const std::string &THE_PURSE) |
static EXPORT bool | Wallet_ImportPurse (const std::string &SERVER_ID, const std::string &ASSET_TYPE_ID, const std::string &USER_ID, const std::string &THE_PURSE) |
Should handle duplicates. Should load, merge, and save. More... | |
static EXPORT int32_t | exchangePurse (const std::string &SERVER_ID, const std::string &ASSET_TYPE_ID, const std::string &USER_ID, const std::string &THE_PURSE) |
static EXPORT std::string | Token_ChangeOwner (const std::string &SERVER_ID, const std::string &ASSET_TYPE_ID, const std::string &THE_TOKEN, const std::string &SIGNER_NYM_ID, const std::string &OLD_OWNER, const std::string &NEW_OWNER) |
static EXPORT std::string | Token_GetID (const std::string &SERVER_ID, const std::string &ASSET_TYPE_ID, const std::string &THE_TOKEN) |
static EXPORT int64_t | Token_GetDenomination (const std::string &SERVER_ID, const std::string &ASSET_TYPE_ID, const std::string &THE_TOKEN) |
The actual cash value of the token. Returns a int64_t. More... | |
static EXPORT int32_t | Token_GetSeries (const std::string &SERVER_ID, const std::string &ASSET_TYPE_ID, const std::string &THE_TOKEN) |
static EXPORT time64_t | Token_GetValidFrom (const std::string &SERVER_ID, const std::string &ASSET_TYPE_ID, const std::string &THE_TOKEN) |
the date is seconds since Jan 1970. More... | |
static EXPORT time64_t | Token_GetValidTo (const std::string &SERVER_ID, const std::string &ASSET_TYPE_ID, const std::string &THE_TOKEN) |
static EXPORT std::string | Token_GetAssetID (const std::string &THE_TOKEN) |
static EXPORT std::string | Token_GetServerID (const std::string &THE_TOKEN) |
static EXPORT int64_t | Instrmnt_GetAmount (const std::string &THE_INSTRUMENT) |
static EXPORT int64_t | Instrmnt_GetTransNum (const std::string &THE_INSTRUMENT) |
static EXPORT time64_t | Instrmnt_GetValidFrom (const std::string &THE_INSTRUMENT) |
static EXPORT time64_t | Instrmnt_GetValidTo (const std::string &THE_INSTRUMENT) |
static EXPORT std::string | Instrmnt_GetMemo (const std::string &THE_INSTRUMENT) |
static EXPORT std::string | Instrmnt_GetType (const std::string &THE_INSTRUMENT) |
static EXPORT std::string | Instrmnt_GetServerID (const std::string &THE_INSTRUMENT) |
static EXPORT std::string | Instrmnt_GetAssetID (const std::string &THE_INSTRUMENT) |
static EXPORT std::string | Instrmnt_GetSenderUserID (const std::string &THE_INSTRUMENT) |
static EXPORT std::string | Instrmnt_GetSenderAcctID (const std::string &THE_INSTRUMENT) |
static EXPORT std::string | Instrmnt_GetRemitterUserID (const std::string &THE_INSTRUMENT) |
static EXPORT std::string | Instrmnt_GetRemitterAcctID (const std::string &THE_INSTRUMENT) |
static EXPORT std::string | Instrmnt_GetRecipientUserID (const std::string &THE_INSTRUMENT) |
static EXPORT std::string | Instrmnt_GetRecipientAcctID (const std::string &THE_INSTRUMENT) |
static EXPORT int32_t | checkServerID (const std::string &SERVER_ID, const std::string &USER_ID) |
static EXPORT int32_t | createUserAccount (const std::string &SERVER_ID, const std::string &USER_ID) |
static EXPORT int32_t | deleteUserAccount (const std::string &SERVER_ID, const std::string &USER_ID) |
static EXPORT int32_t | deleteAssetAccount (const std::string &SERVER_ID, const std::string &USER_ID, const std::string &ACCOUNT_ID) |
static EXPORT int32_t | usageCredits (const std::string &SERVER_ID, const std::string &USER_ID, const std::string &USER_ID_CHECK, const int64_t &ADJUSTMENT) |
static EXPORT int64_t | Message_GetUsageCredits (const std::string &THE_MESSAGE) |
static EXPORT int32_t | checkUser (const std::string &SERVER_ID, const std::string &USER_ID, const std::string &USER_ID_CHECK) |
static EXPORT int32_t | sendUserMessage (const std::string &SERVER_ID, const std::string &USER_ID, const std::string &USER_ID_RECIPIENT, const std::string &RECIPIENT_PUBKEY, const std::string &THE_MESSAGE) |
static EXPORT int32_t | sendUserInstrument (const std::string &SERVER_ID, const std::string &USER_ID, const std::string &USER_ID_RECIPIENT, const std::string &RECIPIENT_PUBKEY, const std::string &THE_INSTRUMENT, const std::string &INSTRUMENT_FOR_SENDER) |
static EXPORT int32_t | getRequest (const std::string &SERVER_ID, const std::string &USER_ID) |
static EXPORT int32_t | getTransactionNumber (const std::string &SERVER_ID, const std::string &USER_ID) |
static EXPORT int32_t | issueAssetType (const std::string &SERVER_ID, const std::string &USER_ID, const std::string &THE_CONTRACT) |
static EXPORT int32_t | getContract (const std::string &SERVER_ID, const std::string &USER_ID, const std::string &ASSET_ID) |
static EXPORT int32_t | getMint (const std::string &SERVER_ID, const std::string &USER_ID, const std::string &ASSET_ID) |
static EXPORT int32_t | createAssetAccount (const std::string &SERVER_ID, const std::string &USER_ID, const std::string &ASSET_ID) |
static EXPORT int32_t | getAccount (const std::string &SERVER_ID, const std::string &USER_ID, const std::string &ACCT_ID) |
static EXPORT int32_t | getAccountFiles (const std::string &SERVER_ID, const std::string &USER_ID, const std::string &ACCT_ID) |
static EXPORT std::string | GenerateBasketCreation (const std::string &USER_ID, const int64_t &MINIMUM_TRANSFER) |
static EXPORT std::string | AddBasketCreationItem (const std::string &USER_ID, const std::string &THE_BASKET, const std::string &ASSET_TYPE_ID, const int64_t &MINIMUM_TRANSFER) |
static EXPORT int32_t | issueBasket (const std::string &SERVER_ID, const std::string &USER_ID, const std::string &THE_BASKET) |
static EXPORT std::string | GenerateBasketExchange (const std::string &SERVER_ID, const std::string &USER_ID, const std::string &BASKET_ASSET_TYPE_ID, const std::string &BASKET_ASSET_ACCT_ID, const int32_t &TRANSFER_MULTIPLE) |
static EXPORT std::string | AddBasketExchangeItem (const std::string &SERVER_ID, const std::string &USER_ID, const std::string &THE_BASKET, const std::string &ASSET_TYPE_ID, const std::string &ASSET_ACCT_ID) |
static EXPORT int32_t | exchangeBasket (const std::string &SERVER_ID, const std::string &USER_ID, const std::string &BASKET_ASSET_ID, const std::string &THE_BASKET, const bool &BOOL_EXCHANGE_IN_OR_OUT) |
static EXPORT int32_t | notarizeWithdrawal (const std::string &SERVER_ID, const std::string &USER_ID, const std::string &ACCT_ID, const int64_t &AMOUNT) |
static EXPORT int32_t | notarizeDeposit (const std::string &SERVER_ID, const std::string &USER_ID, const std::string &ACCT_ID, const std::string &THE_PURSE) |
static EXPORT int32_t | notarizeTransfer (const std::string &SERVER_ID, const std::string &USER_ID, const std::string &ACCT_FROM, const std::string &ACCT_TO, const int64_t &AMOUNT, const std::string &NOTE) |
static EXPORT int32_t | getInbox (const std::string &SERVER_ID, const std::string &USER_ID, const std::string &ACCT_ID) |
static EXPORT int32_t | getOutbox (const std::string &SERVER_ID, const std::string &USER_ID, const std::string &ACCT_ID) |
static EXPORT int32_t | getNymbox (const std::string &SERVER_ID, const std::string &USER_ID) |
static EXPORT std::string | LoadNymbox (const std::string &SERVER_ID, const std::string &USER_ID) |
static EXPORT std::string | LoadNymboxNoVerify (const std::string &SERVER_ID, const std::string &USER_ID) |
static EXPORT std::string | Nymbox_GetReplyNotice (const std::string &SERVER_ID, const std::string &USER_ID, const int64_t &REQUEST_NUMBER) |
static EXPORT bool | HaveAlreadySeenReply (const std::string &SERVER_ID, const std::string &USER_ID, const int64_t &REQUEST_NUMBER) |
static EXPORT int32_t | getBoxReceipt (const std::string &SERVER_ID, const std::string &USER_ID, const std::string &ACCOUNT_ID, const int32_t &nBoxType, const int64_t &TRANSACTION_NUMBER) |
static EXPORT bool | DoesBoxReceiptExist (const std::string &SERVER_ID, const std::string &USER_ID, const std::string &ACCOUNT_ID, const int32_t &nBoxType, const int64_t &TRANSACTION_NUMBER) |
static EXPORT int32_t | processInbox (const std::string &SERVER_ID, const std::string &USER_ID, const std::string &ACCT_ID, const std::string &ACCT_LEDGER) |
static EXPORT int32_t | processNymbox (const std::string &SERVER_ID, const std::string &USER_ID) |
static EXPORT int32_t | withdrawVoucher (const std::string &SERVER_ID, const std::string &USER_ID, const std::string &ACCT_ID, const std::string &RECIPIENT_USER_ID, const std::string &CHEQUE_MEMO, const int64_t &AMOUNT) |
static EXPORT int32_t | payDividend (const std::string &SERVER_ID, const std::string &ISSUER_USER_ID, const std::string &DIVIDEND_FROM_ACCT_ID, const std::string &SHARES_ASSET_TYPE_ID, const std::string &DIVIDEND_MEMO, const int64_t &AMOUNT_PER_SHARE) |
PAY DIVIDEND – to shareholders. More... | |
static EXPORT int32_t | depositCheque (const std::string &SERVER_ID, const std::string &USER_ID, const std::string &ACCT_ID, const std::string &THE_CHEQUE) |
static EXPORT int32_t | depositPaymentPlan (const std::string &SERVER_ID, const std::string &USER_ID, const std::string &THE_PAYMENT_PLAN) |
static EXPORT int32_t | issueMarketOffer (const std::string &ASSET_ACCT_ID, const std::string &CURRENCY_ACCT_ID, const int64_t &MARKET_SCALE, const int64_t &MINIMUM_INCREMENT, const int64_t &TOTAL_ASSETS_ON_OFFER, const int64_t &PRICE_LIMIT, const bool &bBuyingOrSelling, const time64_t &LIFESPAN_IN_SECONDS, const std::string &STOP_SIGN, const int64_t &ACTIVATION_PRICE) |
static EXPORT int32_t | getMarketList (const std::string &SERVER_ID, const std::string &USER_ID) |
Retrieves details for each market. More... | |
static EXPORT int32_t | getMarketOffers (const std::string &SERVER_ID, const std::string &USER_ID, const std::string &MARKET_ID, const int64_t &MAX_DEPTH) |
Gets all offers for a specific market and their details (up until. More... | |
static EXPORT int32_t | getMarketRecentTrades (const std::string &SERVER_ID, const std::string &USER_ID, const std::string &MARKET_ID) |
Gets all recent trades (up until maximum depth) More... | |
static EXPORT int32_t | getNym_MarketOffers (const std::string &SERVER_ID, const std::string &USER_ID) |
This "Market Offer" data is a lot more detailed than the. More... | |
static EXPORT int32_t | killMarketOffer (const std::string &SERVER_ID, const std::string &USER_ID, const std::string &ASSET_ACCT_ID, const int64_t &TRANSACTION_NUMBER) |
static EXPORT int32_t | killPaymentPlan (const std::string &SERVER_ID, const std::string &USER_ID, const std::string &FROM_ACCT_ID, const int64_t &TRANSACTION_NUMBER) |
static EXPORT std::string | PopMessageBuffer (const int64_t &REQUEST_NUMBER, const std::string &SERVER_ID, const std::string &USER_ID) |
static EXPORT void | FlushMessageBuffer () |
static EXPORT std::string | GetSentMessage (const int64_t &REQUEST_NUMBER, const std::string &SERVER_ID, const std::string &USER_ID) |
static EXPORT bool | RemoveSentMessage (const int64_t &REQUEST_NUMBER, const std::string &SERVER_ID, const std::string &USER_ID) |
static EXPORT void | FlushSentMessages (const bool &bHarvestingForRetry, const std::string &SERVER_ID, const std::string &USER_ID, const std::string &THE_NYMBOX) |
static EXPORT void | Sleep (const int64_t &MILLISECONDS) |
static EXPORT bool | ResyncNymWithServer (const std::string &SERVER_ID, const std::string &USER_ID, const std::string &THE_MESSAGE) |
static EXPORT std::string | Message_GetCommand (const std::string &THE_MESSAGE) |
static EXPORT int32_t | Message_GetSuccess (const std::string &THE_MESSAGE) |
static EXPORT int32_t | queryAssetTypes (const std::string &SERVER_ID, const std::string &USER_ID, const std::string &ENCODED_MAP) |
static EXPORT std::string | Message_GetPayload (const std::string &THE_MESSAGE) |
static EXPORT int32_t | Message_GetDepth (const std::string &THE_MESSAGE) |
static EXPORT int32_t | Message_GetTransactionSuccess (const std::string &SERVER_ID, const std::string &USER_ID, const std::string &ACCOUNT_ID, const std::string &THE_MESSAGE) |
static EXPORT int32_t | Message_IsTransactionCanceled (const std::string &SERVER_ID, const std::string &USER_ID, const std::string &ACCOUNT_ID, const std::string &THE_MESSAGE) |
static EXPORT int32_t | Message_GetBalanceAgreementSuccess (const std::string &SERVER_ID, const std::string &USER_ID, const std::string &ACCOUNT_ID, const std::string &THE_MESSAGE) |
static EXPORT std::string | Message_GetLedger (const std::string &THE_MESSAGE) |
static EXPORT std::string | Message_GetNewAssetTypeID (const std::string &THE_MESSAGE) |
static EXPORT std::string | Message_GetNewIssuerAcctID (const std::string &THE_MESSAGE) |
static EXPORT std::string | Message_GetNewAcctID (const std::string &THE_MESSAGE) |
static EXPORT std::string | Message_GetNymboxHash (const std::string &THE_MESSAGE) |
|
static |
--------------------------------------------------
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 1416 of file OTAPI.cpp.
|
static |
--------------------------------------------------
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 506 of file OTAPI.cpp.
|
static |
----------------------------------------------------
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 2123 of file OTAPI.cpp.
|
static |
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 2149 of file OTAPI.cpp.
|
static |
--------------------------------------------------
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 501 of file OTAPI.cpp.
|
static |
OT-Sign a CONTRACT. (Add a signature)
EXPORT static 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.
Definition at line 1000 of file OTAPI.cpp.
|
static |
Definition at line 441 of file OTAPI.cpp.
|
static |
|
static |
|
static |
--------------------------------------------------------------------
Get Basket Count (of backing asset types.)
Returns the number of asset types that make up this basket. (Or zero.)
Definition at line 1985 of file OTAPI.cpp.
|
static |
----------------------------------------------------
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 2002 of file OTAPI.cpp.
|
static |
--------------------------------------------------------------------
Get Asset Type of a basket's member currency, by index.
(Returns a string containing Asset Type ID, or nullptr).
Definition at line 1990 of file OTAPI.cpp.
|
static |
----------------------------------------------------
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 1996 of file OTAPI.cpp.
|
static |
Definition at line 1270 of file OTAPI.cpp.
|
static |
Definition at line 1252 of file OTAPI.cpp.
|
static |
Definition at line 1264 of file OTAPI.cpp.
|
static |
Definition at line 1246 of file OTAPI.cpp.
|
static |
Definition at line 1258 of file OTAPI.cpp.
|
static |
Definition at line 455 of file OTAPI.cpp.
|
static |
Definition at line 461 of file OTAPI.cpp.
|
static |
Definition at line 1349 of file OTAPI.cpp.
|
static |
Definition at line 1342 of file OTAPI.cpp.
|
static |
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 2009 of file OTAPI.cpp.
|
static |
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 2040 of file OTAPI.cpp.
|
static |
Definition at line 1283 of file OTAPI.cpp.
|
static |
Definition at line 1276 of file OTAPI.cpp.
|
static |
Definition at line 1608 of file OTAPI.cpp.
|
static |
Definition at line 1599 of file OTAPI.cpp.
|
static |
Definition at line 1108 of file OTAPI.cpp.
|
static |
Definition at line 1118 of file OTAPI.cpp.
|
static |
---------------------------------------------------------------------------
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 2096 of file OTAPI.cpp.
|
static |
Definition at line 473 of file OTAPI.cpp.
|
static |
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 358 of file OTAPI.cpp.
|
static |
Definition at line 1856 of file OTAPI.cpp.
|
static |
Definition at line 1864 of file OTAPI.cpp.
|
static |
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 467 of file OTAPI.cpp.
|
static |
Definition at line 970 of file OTAPI.cpp.
|
static |
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 2015 of file OTAPI.cpp.
|
static |
Decode an OT-encoded string (back to plainext.)
EXPORT static 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.
Definition at line 952 of file OTAPI.cpp.
|
static |
OT-DECRYPT an OT-encrypted string back to plainext. (ASYMMETRIC)
EXPORT static 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(); } }
Definition at line 964 of file OTAPI.cpp.
|
static |
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 586 of file OTAPI.cpp.
|
static |
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 2021 of file OTAPI.cpp.
|
static |
--------------------------------------------------------------------------
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 2259 of file OTAPI.cpp.
|
static |
--------------------------------------------------
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 2267 of file OTAPI.cpp.
|
static |
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 1068 of file OTAPI.cpp.
|
static |
Definition at line 566 of file OTAPI.cpp.
|
static |
Definition at line 1095 of file OTAPI.cpp.
|
static |
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.
Definition at line 946 of file OTAPI.cpp.
|
static |
OT-ENCRYPT a plainext string. (ASYMMETRIC)
EXPORT static 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(); }
Definition at line 958 of file OTAPI.cpp.
|
static |
--------------------------------------------------------------------------
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 2159 of file OTAPI.cpp.
|
static |
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 1916 of file OTAPI.cpp.
|
static |
|
static |
Definition at line 993 of file OTAPI.cpp.
|
static |
Definition at line 2339 of file OTAPI.cpp.
|
static |
-----------------------------------------------------------
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 2358 of file OTAPI.cpp.
|
static |
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 490 of file OTAPI.cpp.
|
static |
----------------------------------------------------
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 2117 of file OTAPI.cpp.
|
static |
----------------------------------------------------
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 2139 of file OTAPI.cpp.
|
static |
--------------------------------------------------------------------------
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 2103 of file OTAPI.cpp.
|
static |
Definition at line 526 of file OTAPI.cpp.
|
static |
Definition at line 2110 of file OTAPI.cpp.
|
static |
Definition at line 1042 of file OTAPI.cpp.
|
static |
Definition at line 1032 of file OTAPI.cpp.
|
static |
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 919 of file OTAPI.cpp.
|
static |
Definition at line 929 of file OTAPI.cpp.
|
static |
Definition at line 924 of file OTAPI.cpp.
|
static |
Definition at line 1052 of file OTAPI.cpp.
|
static |
Definition at line 935 of file OTAPI.cpp.
|
static |
Definition at line 1047 of file OTAPI.cpp.
|
static |
Definition at line 1037 of file OTAPI.cpp.
|
static |
Definition at line 370 of file OTAPI.cpp.
|
static |
Definition at line 496 of file OTAPI.cpp.
|
static |
Definition at line 904 of file OTAPI.cpp.
|
static |
Definition at line 909 of file OTAPI.cpp.
|
static |
Definition at line 914 of file OTAPI.cpp.
|
static |
Definition at line 521 of file OTAPI.cpp.
|
static |
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 576 of file OTAPI.cpp.
|
static |
--------------------------------------------------------------------
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 2082 of file OTAPI.cpp.
|
static |
--------------------------------------------------------------------------
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 2202 of file OTAPI.cpp.
|
static |
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 2305 of file OTAPI.cpp.
|
static |
Gets all offers for a specific market and their details (up until.
Definition at line 2311 of file OTAPI.cpp.
|
static |
Gets all recent trades (up until maximum depth)
Definition at line 2319 of file OTAPI.cpp.
|
static |
Definition at line 304 of file OTAPI.cpp.
|
static |
The below functions are for retrieving log data programatically.
Definition at line 299 of file OTAPI.cpp.
|
static |
--------------------------------------------------------------------------
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 2089 of file OTAPI.cpp.
|
static |
Definition at line 365 of file OTAPI.cpp.
|
static |
Definition at line 381 of file OTAPI.cpp.
|
static |
Definition at line 397 of file OTAPI.cpp.
|
static |
Definition at line 386 of file OTAPI.cpp.
|
static |
Definition at line 391 of file OTAPI.cpp.
|
static |
Definition at line 643 of file OTAPI.cpp.
|
static |
Definition at line 676 of file OTAPI.cpp.
|
static |
Definition at line 693 of file OTAPI.cpp.
|
static |
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 688 of file OTAPI.cpp.
|
static |
Definition at line 699 of file OTAPI.cpp.
|
static |
Definition at line 705 of file OTAPI.cpp.
|
static |
This "Market Offer" data is a lot more detailed than the.
Definition at line 2326 of file OTAPI.cpp.
|
static |
Definition at line 648 of file OTAPI.cpp.
|
static |
Definition at line 664 of file OTAPI.cpp.
|
static |
Definition at line 682 of file OTAPI.cpp.
|
static |
Definition at line 728 of file OTAPI.cpp.
|
static |
Definition at line 723 of file OTAPI.cpp.
|
static |
Definition at line 734 of file OTAPI.cpp.
|
static |
Definition at line 740 of file OTAPI.cpp.
|
static |
Definition at line 763 of file OTAPI.cpp.
|
static |
Definition at line 758 of file OTAPI.cpp.
|
static |
Definition at line 769 of file OTAPI.cpp.
|
static |
Definition at line 775 of file OTAPI.cpp.
|
static |
Definition at line 670 of file OTAPI.cpp.
|
static |
Definition at line 414 of file OTAPI.cpp.
|
static |
Definition at line 403 of file OTAPI.cpp.
|
static |
Definition at line 408 of file OTAPI.cpp.
|
static |
Definition at line 376 of file OTAPI.cpp.
|
static |
Definition at line 659 of file OTAPI.cpp.
|
static |
Definition at line 433 of file OTAPI.cpp.
|
static |
Definition at line 420 of file OTAPI.cpp.
|
static |
Definition at line 426 of file OTAPI.cpp.
|
static |
----------------------------------------------------------
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 888 of file OTAPI.cpp.
|
static |
Definition at line 2209 of file OTAPI.cpp.
|
static |
Definition at line 2215 of file OTAPI.cpp.
|
static |
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 2069 of file OTAPI.cpp.
|
static |
Definition at line 2344 of file OTAPI.cpp.
|
static |
Definition at line 479 of file OTAPI.cpp.
|
static |
Definition at line 894 of file OTAPI.cpp.
|
static |
Definition at line 899 of file OTAPI.cpp.
|
static |
--------------------------------------------------
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 516 of file OTAPI.cpp.
|
static |
|
static |
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 2169 of file OTAPI.cpp.
|
static |
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 1506 of file OTAPI.cpp.
|
static |
Definition at line 1333 of file OTAPI.cpp.
|
static |
Definition at line 1326 of file OTAPI.cpp.
|
static |
Definition at line 1319 of file OTAPI.cpp.
|
static |
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 793 of file OTAPI.cpp.
|
static |
Definition at line 828 of file OTAPI.cpp.
|
static |
Definition at line 818 of file OTAPI.cpp.
|
static |
Definition at line 863 of file OTAPI.cpp.
|
static |
Definition at line 857 of file OTAPI.cpp.
|
static |
Definition at line 839 of file OTAPI.cpp.
|
static |
Definition at line 833 of file OTAPI.cpp.
|
static |
Definition at line 851 of file OTAPI.cpp.
|
static |
Definition at line 845 of file OTAPI.cpp.
|
static |
Definition at line 823 of file OTAPI.cpp.
|
static |
Definition at line 798 of file OTAPI.cpp.
|
static |
Definition at line 813 of file OTAPI.cpp.
|
static |
Definition at line 803 of file OTAPI.cpp.
|
static |
Definition at line 808 of file OTAPI.cpp.
|
static |
--------------------------------------------------------------
IS BASKET CURRENCY ?
Tells you whether or not a given asset type is actually a basket currency.
Definition at line 1980 of file OTAPI.cpp.
|
static |
Definition at line 653 of file OTAPI.cpp.
|
static |
--------------------------------------------------------------------
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 2075 of file OTAPI.cpp.
|
static |
--------------------------------------------------------------------------
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 2132 of file OTAPI.cpp.
|
static |
--------------------------------------------------
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 2292 of file OTAPI.cpp.
|
static |
|
static |
Definition at line 2274 of file OTAPI.cpp.
|
static |
Definition at line 2283 of file OTAPI.cpp.
|
static |
Add a transaction to a ledger.
Definition at line 1668 of file OTAPI.cpp.
|
static |
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 1623 of file OTAPI.cpp.
|
static |
-------------------------------------------------------------------------
(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 1687 of file OTAPI.cpp.
|
static |
Find out how many pending transactions (and receipts) are in this inbox.
Definition at line 1615 of file OTAPI.cpp.
|
static |
-------------------------------------------------------------------------
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 1649 of file OTAPI.cpp.
|
static |
Definition at line 1640 of file OTAPI.cpp.
|
static |
Lookup a transaction or its ID (from within a ledger) based on index or transaction number.
Definition at line 1631 of file OTAPI.cpp.
|
static |
Definition at line 1659 of file OTAPI.cpp.
|
static |
--------------------------------------------------------------
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 1492 of file OTAPI.cpp.
|
static |
Definition at line 1482 of file OTAPI.cpp.
|
static |
Definition at line 1579 of file OTAPI.cpp.
|
static |
Definition at line 1585 of file OTAPI.cpp.
|
static |
Definition at line 1525 of file OTAPI.cpp.
|
static |
These versions don't verify the ledger, they just load it up.
Definition at line 1532 of file OTAPI.cpp.
|
static |
Definition at line 1476 of file OTAPI.cpp.
|
static |
Definition at line 1513 of file OTAPI.cpp.
|
static |
Definition at line 1519 of file OTAPI.cpp.
|
static |
Definition at line 1539 of file OTAPI.cpp.
|
static |
Definition at line 1546 of file OTAPI.cpp.
|
static |
Definition at line 1553 of file OTAPI.cpp.
|
static |
Definition at line 1559 of file OTAPI.cpp.
|
static |
-----------------------------------------------------------------
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 1445 of file OTAPI.cpp.
|
static |
Definition at line 1450 of file OTAPI.cpp.
|
static |
--------------------------------------------------------------
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 1829 of file OTAPI.cpp.
|
static |
NOTE: Sometimes the user ID is also passed in the "account ID" field,.
on what kind of record box it is.
Definition at line 1565 of file OTAPI.cpp.
|
static |
Definition at line 1572 of file OTAPI.cpp.
|
static |
Definition at line 1487 of file OTAPI.cpp.
|
static |
-----------------------------------------------------------------
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 1455 of file OTAPI.cpp.
|
static |
Definition at line 1460 of file OTAPI.cpp.
|
static |
|
static |
Definition at line 259 of file OTAPI.cpp.
|
static |
-----------------------------------------------------------
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 1813 of file OTAPI.cpp.
|
static |
-----------------------------------------------------------
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 2391 of file OTAPI.cpp.
|
static |
-----------------------------------------------------------
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 2428 of file OTAPI.cpp.
|
static |
-----------------------------------------------------------
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 2396 of file OTAPI.cpp.
|
static |
-----------------------------------------------------------
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 2413 of file OTAPI.cpp.
|
static |
-----------------------------------------------------------
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 2401 of file OTAPI.cpp.
|
static |
-----------------------------------------------------------
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 2407 of file OTAPI.cpp.
|
static |
-----------------------------------------------------------
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 2418 of file OTAPI.cpp.
|
static |
-----------------------------------------------------------
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 2386 of file OTAPI.cpp.
|
static |
-----------------------------------------------------------
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 2423 of file OTAPI.cpp.
|
static |
-----------------------------------------------------------
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 2441 of file OTAPI.cpp.
|
static |
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 2027 of file OTAPI.cpp.
|
static |
Definition at line 2433 of file OTAPI.cpp.
|
static |
Returns OT_TRUE if the mint is still usable. Returns OT_FALSE if expired or other error.
Definition at line 1470 of file OTAPI.cpp.
|
static |
Definition at line 1434 of file OTAPI.cpp.
|
static |
--------------------------------------------------------------------------
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 2183 of file OTAPI.cpp.
|
static |
--------------------------------------------------------------------------
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 2191 of file OTAPI.cpp.
|
static |
--------------------------------------------------------------------------
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 2175 of file OTAPI.cpp.
|
static |
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 329 of file OTAPI.cpp.
|
static |
Definition at line 353 of file OTAPI.cpp.
|
static |
Definition at line 335 of file OTAPI.cpp.
|
static |
Definition at line 347 of file OTAPI.cpp.
|
static |
Definition at line 341 of file OTAPI.cpp.
|
static |
Definition at line 711 of file OTAPI.cpp.
|
static |
Definition at line 746 of file OTAPI.cpp.
|
static |
Definition at line 781 of file OTAPI.cpp.
|
static |
Definition at line 717 of file OTAPI.cpp.
|
static |
Definition at line 752 of file OTAPI.cpp.
|
static |
Definition at line 787 of file OTAPI.cpp.
|
static |
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 1499 of file OTAPI.cpp.
|
static |
|
static |
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 274 of file OTAPI.cpp.
|
static |
Definition at line 1395 of file OTAPI.cpp.
|
static |
Definition at line 1388 of file OTAPI.cpp.
|
static |
Definition at line 1356 of file OTAPI.cpp.
|
static |
Definition at line 1381 of file OTAPI.cpp.
|
static |
Definition at line 1374 of file OTAPI.cpp.
|
static |
Definition at line 1362 of file OTAPI.cpp.
|
static |
Definition at line 1409 of file OTAPI.cpp.
|
static |
Definition at line 1402 of file OTAPI.cpp.
|
static |
Definition at line 1368 of file OTAPI.cpp.
|
static |
PAY DIVIDEND – to shareholders.
Definition at line 2247 of file OTAPI.cpp.
|
static |
Definition at line 314 of file OTAPI.cpp.
|
static |
Definition at line 309 of file OTAPI.cpp.
|
static |
--------------------------------------------------
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 1736 of file OTAPI.cpp.
|
static |
Definition at line 319 of file OTAPI.cpp.
|
static |
-----------------------------------------------------------
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 2332 of file OTAPI.cpp.
|
static |
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 2222 of file OTAPI.cpp.
|
static |
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 2230 of file OTAPI.cpp.
|
static |
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 1076 of file OTAPI.cpp.
|
static |
returns a count of the number of cash tokens inside this purse.
Definition at line 1843 of file OTAPI.cpp.
|
static |
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 1888 of file OTAPI.cpp.
|
static |
Get Purse Total Value (internally uses GetTotalValue().)
Returns the purported sum of all the tokens within.
Definition at line 1836 of file OTAPI.cpp.
|
static |
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 1850 of file OTAPI.cpp.
|
static |
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 1871 of file OTAPI.cpp.
|
static |
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 1879 of file OTAPI.cpp.
|
static |
Pushes a token onto the stack (of the purse.) Returns the updated purse (now including the token.)
Definition at line 1896 of file OTAPI.cpp.
|
static |
-----------------------------------------------------------
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 2379 of file OTAPI.cpp.
|
static |
Definition at line 1591 of file OTAPI.cpp.
|
static |
Definition at line 2351 of file OTAPI.cpp.
|
static |
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 1771 of file OTAPI.cpp.
|
static |
Definition at line 2372 of file OTAPI.cpp.
|
static |
Definition at line 448 of file OTAPI.cpp.
|
static |
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 static 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 1821 of file OTAPI.cpp.
|
static |
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 2057 of file OTAPI.cpp.
|
static |
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 2047 of file OTAPI.cpp.
|
static |
Returns OT_TRUE (1) or OT_FALSE (0) The asset account's name is merely a client-side label.
Definition at line 1025 of file OTAPI.cpp.
|
static |
Definition at line 210 of file OTAPI.cpp.
|
static |
Definition at line 882 of file OTAPI.cpp.
|
static |
|
static |
Definition at line 234 of file OTAPI.cpp.
|
static |
-----------------------------------
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 869 of file OTAPI.cpp.
|
static |
Definition at line 876 of file OTAPI.cpp.
|
static |
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 static 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 279 of file OTAPI.cpp.
|
static |
OT-Sign a CONTRACT. (First signature)
EXPORT static 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.
Definition at line 987 of file OTAPI.cpp.
|
static |
SLEEP
If you want to go to sleep for one second, then pass "1000" to this function.
Definition at line 2367 of file OTAPI.cpp.
|
static |
Definition at line 1213 of file OTAPI.cpp.
|
static |
Definition at line 1240 of file OTAPI.cpp.
|
static |
Definition at line 1229 of file OTAPI.cpp.
|
static |
Definition at line 1234 of file OTAPI.cpp.
|
static |
Definition at line 1224 of file OTAPI.cpp.
|
static |
Definition at line 1218 of file OTAPI.cpp.
|
static |
Definition at line 1181 of file OTAPI.cpp.
|
static |
Definition at line 1125 of file OTAPI.cpp.
|
static |
Definition at line 1153 of file OTAPI.cpp.
|
static |
Definition at line 1133 of file OTAPI.cpp.
|
static |
Definition at line 1162 of file OTAPI.cpp.
|
static |
Definition at line 1172 of file OTAPI.cpp.
|
static |
Definition at line 1142 of file OTAPI.cpp.
|
static |
----------------------------------------
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 1196 of file OTAPI.cpp.
|
static |
----------------------------------------
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 1206 of file OTAPI.cpp.
|
static |
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 1190 of file OTAPI.cpp.
|
static |
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 484 of file OTAPI.cpp.
|
static |
Definition at line 254 of file OTAPI.cpp.
|
static |
Definition at line 264 of file OTAPI.cpp.
|
static |
|
static |
Definition at line 981 of file OTAPI.cpp.
|
static |
Definition at line 975 of file OTAPI.cpp.
|
static |
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 1924 of file OTAPI.cpp.
|
static |
Definition at line 1970 of file OTAPI.cpp.
|
static |
The actual cash value of the token. Returns a int64_t.
Definition at line 1942 of file OTAPI.cpp.
|
static |
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 1935 of file OTAPI.cpp.
|
static |
Definition at line 1949 of file OTAPI.cpp.
|
static |
Definition at line 1975 of file OTAPI.cpp.
|
static |
the date is seconds since Jan 1970.
Definition at line 1956 of file OTAPI.cpp.
|
static |
Definition at line 1963 of file OTAPI.cpp.
|
static |
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 1677 of file OTAPI.cpp.
|
static |
Definition at line 1745 of file OTAPI.cpp.
|
static |
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 1805 of file OTAPI.cpp.
|
static |
--------------------------------------------------
Get Transaction Date Signed (internally uses OTTransaction::GetDateSigned().)
Definition at line 1779 of file OTAPI.cpp.
|
static |
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 1754 of file OTAPI.cpp.
|
static |
Definition at line 1728 of file OTAPI.cpp.
|
static |
Definition at line 1712 of file OTAPI.cpp.
|
static |
Definition at line 1720 of file OTAPI.cpp.
|
static |
Definition at line 1704 of file OTAPI.cpp.
|
static |
--------------------------------------------------
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 1787 of file OTAPI.cpp.
|
static |
Get Transaction Type (internally uses GetTransactionTypeString().)
Definition at line 1762 of file OTAPI.cpp.
|
static |
--------------------------------------------------------------------
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 1696 of file OTAPI.cpp.
|
static |
Definition at line 1796 of file OTAPI.cpp.
|
static |
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 1424 of file OTAPI.cpp.
|
static |
Definition at line 269 of file OTAPI.cpp.
|
static |
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 2032 of file OTAPI.cpp.
|
static |
Definition at line 1304 of file OTAPI.cpp.
|
static |
Definition at line 1311 of file OTAPI.cpp.
|
static |
Definition at line 1290 of file OTAPI.cpp.
|
static |
Definition at line 1297 of file OTAPI.cpp.
|
static |
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 1018 of file OTAPI.cpp.
|
static |
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 1012 of file OTAPI.cpp.
|
static |
OT-Verify the signature on a CONTRACT.
Returns OT_BOOL – OT_TRUE (1) or OT_FALSE (0)
Definition at line 1006 of file OTAPI.cpp.
|
static |
------------------------------------------------------------------------
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 1465 of file OTAPI.cpp.
|
static |
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 561 of file OTAPI.cpp.
|
static |
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 541 of file OTAPI.cpp.
|
static |
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 551 of file OTAPI.cpp.
|
static |
--------------------------------------------------------- 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 531 of file OTAPI.cpp.
|
static |
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 614 of file OTAPI.cpp.
|
static |
Returns the exported cert, if successful. Else nullptr.
Definition at line 598 of file OTAPI.cpp.
|
static |
Returns the exported Nym, if success. (Else nullptr.)
Definition at line 593 of file OTAPI.cpp.
|
static |
Definition at line 637 of file OTAPI.cpp.
|
static |
Definition at line 631 of file OTAPI.cpp.
|
static |
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 619 of file OTAPI.cpp.
|
static |
Definition at line 625 of file OTAPI.cpp.
|
static |
Returns the imported cert's NymID, if successful. Else nullptr.
Definition at line 608 of file OTAPI.cpp.
|
static |
returns NymID if success, else nullptr.
Definition at line 603 of file OTAPI.cpp.
|
static |
Should handle duplicates. Should load, merge, and save.
Definition at line 1907 of file OTAPI.cpp.
|
static |
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 546 of file OTAPI.cpp.
|
static |
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 556 of file OTAPI.cpp.
|
static |
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 536 of file OTAPI.cpp.
|
static |
|
static |
--------------------------------------------------------------------------
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 2236 of file OTAPI.cpp.
|
static |
(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 1057 of file OTAPI.cpp.