1678 int32_t nReturnVal = 0;
1692 const OTString strNodeName(xml->getNodeName());
1694 OTString strSuccess;
1701 const char* pElementExpected;
1704 OTString strTransactionNum;
1706 if (strNodeName.Compare(
"ackReplies")) {
1708 otErr <<
"Error in OTMessage::ProcessXMLNode: ackReplies field "
1719 else if (strNodeName.Compare(
"acknowledgedReplies")) {
1720 otErr <<
"OTMessage::ProcessXMLNode: SKIPPING DEPRECATED FIELD: "
1721 "acknowledgedReplies\n";
1723 while (xml->getNodeType() != irr::io::EXN_ELEMENT_END) {
1729 else if (strNodeName.Compare(
"OTmessage")) {
1732 OTString strDateSigned = xml->getAttributeValue(
"dateSigned");
1734 if (strDateSigned.Exists())
m_lTime = atol(strDateSigned.Get());
1736 otInfo <<
"\n===> Loading XML for Message into memory structures...\n";
1740 else if (strNodeName.Compare(
"getMarketList")) {
1742 m_strNymID = xml->getAttributeValue(
"nymID");
1752 else if (strNodeName.Compare(
"@getMarketList")) {
1755 strSuccess = xml->getAttributeValue(
"success");
1756 if (strSuccess.Compare(
"true"))
1763 m_strNymID = xml->getAttributeValue(
"nymID");
1766 strDepth = xml->getAttributeValue(
"depth");
1768 if (strDepth.GetLength() > 0)
m_lDepth = atol(strDepth.Get());
1770 const char* pElementExpected =
nullptr;
1772 pElementExpected =
"messagePayload";
1774 pElementExpected =
"inReferenceTo";
1776 if (
nullptr != pElementExpected) {
1777 OTASCIIArmor ascTextExpected;
1780 pElementExpected)) {
1781 otErr <<
"Error in OTMessage::ProcessXMLNode: "
1782 "Expected " << pElementExpected
1795 otWarn <<
"\nCommand: " << m_strCommand <<
" "
1801 otWarn <<
"\nCommand: " << m_strCommand <<
" "
1809 else if (strNodeName.Compare(
"getMarketOffers")) {
1810 m_strCommand = xml->getNodeName();
1811 m_strNymID = xml->getAttributeValue(
"nymID");
1816 strDepth = xml->getAttributeValue(
"depth");
1818 if (strDepth.GetLength() > 0)
m_lDepth = atol(strDepth.Get());
1827 else if (strNodeName.Compare(
"@getMarketOffers")) {
1828 strSuccess = xml->getAttributeValue(
"success");
1829 if (strSuccess.Compare(
"true"))
1834 m_strCommand = xml->getNodeName();
1836 m_strNymID = xml->getAttributeValue(
"nymID");
1840 strDepth = xml->getAttributeValue(
"depth");
1842 if (strDepth.GetLength() > 0)
m_lDepth = atol(strDepth.Get());
1844 const char* pElementExpected =
nullptr;
1846 pElementExpected =
"messagePayload";
1848 pElementExpected =
"inReferenceTo";
1850 if (
nullptr != pElementExpected) {
1851 OTASCIIArmor ascTextExpected;
1854 pElementExpected)) {
1855 otErr <<
"Error in OTMessage::ProcessXMLNode: "
1856 "Expected " << pElementExpected
1857 <<
" element with text field, for " << m_strCommand
1869 otWarn <<
"\nCommand: " << m_strCommand <<
" "
1876 otWarn <<
"\nCommand: " << m_strCommand <<
" "
1885 else if (strNodeName.Compare(
"getMarketRecentTrades")) {
1886 m_strCommand = xml->getNodeName();
1887 m_strNymID = xml->getAttributeValue(
"nymID");
1899 else if (strNodeName.Compare(
"@getMarketRecentTrades")) {
1900 strSuccess = xml->getAttributeValue(
"success");
1901 if (strSuccess.Compare(
"true"))
1906 m_strCommand = xml->getNodeName();
1908 m_strNymID = xml->getAttributeValue(
"nymID");
1912 strDepth = xml->getAttributeValue(
"depth");
1914 if (strDepth.GetLength() > 0)
m_lDepth = atol(strDepth.Get());
1916 const char* pElementExpected =
nullptr;
1918 pElementExpected =
"messagePayload";
1920 pElementExpected =
"inReferenceTo";
1922 if (
nullptr != pElementExpected) {
1923 OTASCIIArmor ascTextExpected;
1926 pElementExpected)) {
1927 otErr <<
"Error in OTMessage::ProcessXMLNode: "
1928 "Expected " << pElementExpected
1929 <<
" element with text field, for " << m_strCommand
1941 otWarn <<
"\nCommand: " << m_strCommand <<
" "
1948 otWarn <<
"\nCommand: " << m_strCommand <<
" "
1957 else if (strNodeName.Compare(
"getNym_MarketOffers")) {
1958 m_strCommand = xml->getNodeName();
1959 m_strNymID = xml->getAttributeValue(
"nymID");
1969 else if (strNodeName.Compare(
"@getNym_MarketOffers")) {
1970 strSuccess = xml->getAttributeValue(
"success");
1971 if (strSuccess.Compare(
"true"))
1976 m_strCommand = xml->getNodeName();
1978 m_strNymID = xml->getAttributeValue(
"nymID");
1981 strDepth = xml->getAttributeValue(
"depth");
1983 if (strDepth.GetLength() > 0)
m_lDepth = atol(strDepth.Get());
1985 const char* pElementExpected =
nullptr;
1987 pElementExpected =
"messagePayload";
1989 pElementExpected =
"inReferenceTo";
1991 if (
nullptr != pElementExpected) {
1992 OTASCIIArmor ascTextExpected;
1995 pElementExpected)) {
1996 otErr <<
"Error in OTMessage::ProcessXMLNode: "
1997 "Expected " << pElementExpected
1998 <<
" element with text field, for " << m_strCommand
2010 otWarn <<
"\nCommand: " << m_strCommand <<
" "
2016 otWarn <<
"\nCommand: " << m_strCommand <<
" "
2024 else if (strNodeName.Compare(
"checkServerID")) {
2025 m_strCommand = xml->getNodeName();
2027 m_strNymID = xml->getAttributeValue(
"nymID");
2030 pElementExpected =
"publicAuthentKey";
2031 OTASCIIArmor ascTextExpected;
2034 pElementExpected)) {
2035 otErr <<
"Error in OTMessage::ProcessXMLNode: "
2036 "Expected " << pElementExpected
2037 <<
" element with text field, for " << m_strCommand <<
".\n";
2043 pElementExpected =
"publicEncryptionKey";
2044 ascTextExpected.Release();
2047 pElementExpected)) {
2048 otErr <<
"Error in OTMessage::ProcessXMLNode: "
2049 "Expected " << pElementExpected
2050 <<
" element with text field, for " << m_strCommand <<
".\n";
2059 <<
"\nPublic encryption key:\n" <<
m_strNymID2 <<
"\n";
2063 else if (strNodeName.Compare(
"@checkServerID")) {
2064 strSuccess = xml->getAttributeValue(
"success");
2065 if (strSuccess.Compare(
"true"))
2070 m_strCommand = xml->getNodeName();
2072 m_strNymID = xml->getAttributeValue(
"nymID");
2075 otWarn <<
"\nCommand: " << m_strCommand <<
"\nSuccess: " << strSuccess
2082 else if (strNodeName.Compare(
"createUserAccount")) {
2083 m_strCommand = xml->getNodeName();
2085 m_strNymID = xml->getAttributeValue(
"nymID");
2088 pElementExpected =
"credentialList";
2091 pElementExpected)) {
2092 otErr <<
"Error in OTMessage::ProcessXMLNode: "
2093 "Expected " << pElementExpected
2094 <<
" element with text field, for " << m_strCommand <<
".\n";
2098 pElementExpected =
"credentials";
2101 pElementExpected)) {
2102 otErr <<
"Error in OTMessage::ProcessXMLNode: "
2103 "Expected " << pElementExpected
2104 <<
" element with text field, for " << m_strCommand <<
".\n";
2113 else if (strNodeName.Compare(
"@createUserAccount")) {
2114 strSuccess = xml->getAttributeValue(
"success");
2115 if (strSuccess.Compare(
"true"))
2120 m_strCommand = xml->getNodeName();
2122 m_strNymID = xml->getAttributeValue(
"nymID");
2126 pElementExpected =
"nymfile";
2130 pElementExpected)) {
2131 otErr <<
"Error in OTMessage::ProcessXMLNode: "
2132 "Expected " << pElementExpected
2133 <<
" element with text field, for " << m_strCommand
2139 pElementExpected =
"inReferenceTo";
2143 pElementExpected)) {
2144 otErr <<
"Error in OTMessage::ProcessXMLNode: "
2145 "Expected " << pElementExpected
2146 <<
" element with text field, for " << m_strCommand <<
".\n";
2150 otWarn <<
"\nCommand: " << m_strCommand <<
" "
2157 else if (strNodeName.Compare(
"deleteUserAccount")) {
2158 m_strCommand = xml->getNodeName();
2159 m_strNymID = xml->getAttributeValue(
"nymID");
2168 else if (strNodeName.Compare(
"@deleteUserAccount")) {
2169 strSuccess = xml->getAttributeValue(
"success");
2170 if (strSuccess.Compare(
"true"))
2175 m_strCommand = xml->getNodeName();
2177 m_strNymID = xml->getAttributeValue(
"nymID");
2180 pElementExpected =
"inReferenceTo";
2184 pElementExpected)) {
2185 otErr <<
"Error in OTMessage::ProcessXMLNode: "
2186 "Expected " << pElementExpected
2187 <<
" element with text field, for " << m_strCommand <<
".\n";
2191 otWarn <<
"\nCommand: " << m_strCommand <<
" "
2198 else if (strNodeName.Compare(
"getRequest")) {
2199 m_strCommand = xml->getNodeName();
2201 m_strNymID = xml->getAttributeValue(
"nymID");
2209 else if (strNodeName.Compare(
"@getRequest")) {
2210 strSuccess = xml->getAttributeValue(
"success");
2211 if (strSuccess.Compare(
"true"))
2216 m_strCommand = xml->getNodeName();
2218 m_strNymID = xml->getAttributeValue(
"nymID");
2222 const OTString strNewRequestNum =
2223 xml->getAttributeValue(
"newRequestNum");
2225 strNewRequestNum.Exists() ? atol(strNewRequestNum.Get()) : 0;
2227 otWarn <<
"\nCommand: " << m_strCommand <<
" "
2236 else if (strNodeName.Compare(
"outmailMessage") ||
2237 strNodeName.Compare(
"outpaymentsMessage")) {
2238 m_strCommand = xml->getNodeName();
2239 m_strNymID = xml->getAttributeValue(
"nymID");
2244 pElementExpected =
"messagePayload";
2248 pElementExpected)) {
2249 otErr <<
"Error in OTMessage::ProcessXMLNode: "
2250 "Expected " << pElementExpected
2251 <<
" element with text field, for " << m_strCommand <<
".\n";
2262 else if (strNodeName.Compare(
"sendUserMessage")) {
2263 m_strCommand = xml->getNodeName();
2264 m_strNymID = xml->getAttributeValue(
"nymID");
2269 pElementExpected =
"messagePayload";
2273 pElementExpected)) {
2274 otErr <<
"Error in OTMessage::ProcessXMLNode: "
2275 "Expected " << pElementExpected
2276 <<
" element with text field, for " << m_strCommand <<
".\n";
2287 else if (strNodeName.Compare(
"@sendUserMessage")) {
2288 strSuccess = xml->getAttributeValue(
"success");
2289 if (strSuccess.Compare(
"true"))
2294 m_strCommand = xml->getNodeName();
2296 m_strNymID = xml->getAttributeValue(
"nymID");
2300 otWarn <<
"\nCommand: " << m_strCommand <<
" "
2308 else if (strNodeName.Compare(
"sendUserInstrument") ||
2309 strNodeName.Compare(
"payDividend"))
2313 m_strCommand = xml->getNodeName();
2314 m_strNymID = xml->getAttributeValue(
"nymID");
2319 pElementExpected =
"messagePayload";
2323 pElementExpected)) {
2324 otErr <<
"Error in OTMessage::ProcessXMLNode: "
2325 "Expected " << pElementExpected
2326 <<
" element with text field, for " << m_strCommand <<
".\n";
2337 else if (strNodeName.Compare(
"@sendUserInstrument")) {
2338 strSuccess = xml->getAttributeValue(
"success");
2339 if (strSuccess.Compare(
"true"))
2344 m_strCommand = xml->getNodeName();
2346 m_strNymID = xml->getAttributeValue(
"nymID");
2350 otWarn <<
"\nCommand: " << m_strCommand <<
" "
2358 else if (strNodeName.Compare(
"usageCredits")) {
2359 m_strCommand = xml->getNodeName();
2360 m_strNymID = xml->getAttributeValue(
"nymID");
2365 OTString strAdjustment = xml->getAttributeValue(
"adjustment");
2367 if (strAdjustment.GetLength() > 0)
m_lDepth = atol(strAdjustment.Get());
2373 <<
"\nAdjustment: " <<
m_lDepth <<
"\n";
2377 else if (strNodeName.Compare(
"@usageCredits")) {
2378 strSuccess = xml->getAttributeValue(
"success");
2379 if (strSuccess.Compare(
"true"))
2384 m_strCommand = xml->getNodeName();
2386 m_strNymID = xml->getAttributeValue(
"nymID");
2390 OTString strTotalCredits = xml->getAttributeValue(
"totalCredits");
2392 if (strTotalCredits.GetLength() > 0)
2393 m_lDepth = atol(strTotalCredits.Get());
2395 otWarn <<
"\nCommand: " << m_strCommand <<
" "
2400 <<
"\nTotal Credits: " <<
m_lDepth <<
" \n\n";
2403 else if (strNodeName.Compare(
"checkUser")) {
2404 m_strCommand = xml->getNodeName();
2405 m_strNymID = xml->getAttributeValue(
"nymID");
2417 else if (strNodeName.Compare(
"@checkUser")) {
2418 strSuccess = xml->getAttributeValue(
"success");
2419 if (strSuccess.Compare(
"true"))
2424 m_strCommand = xml->getNodeName();
2426 m_strNymID = xml->getAttributeValue(
"nymID");
2430 const OTString strHasCredentials(
2431 xml->getAttributeValue(
"hasCredentials"));
2432 const bool bHasCredentials = strHasCredentials.Compare(
"true");
2434 const char* pElementExpected =
nullptr;
2436 pElementExpected =
"nymPublicKey";
2438 pElementExpected =
"inReferenceTo";
2440 OTASCIIArmor ascTextExpected;
2442 pElementExpected)) {
2443 otErr <<
"Error in OTMessage::ProcessXMLNode: "
2444 "Expected " << pElementExpected
2445 <<
" element with text field, for " << m_strCommand <<
".\n";
2453 if (bHasCredentials) {
2454 pElementExpected =
"credentialList";
2458 pElementExpected)) {
2459 otErr <<
"Error in OTMessage::ProcessXMLNode: "
2460 "Expected " << pElementExpected
2461 <<
" element with text field, for " << m_strCommand
2467 pElementExpected =
"credentials";
2471 pElementExpected)) {
2472 otErr <<
"Error in OTMessage::ProcessXMLNode: "
2473 "Expected " << pElementExpected
2474 <<
" element with text field, for " << m_strCommand
2482 otWarn <<
"\nCommand: " << m_strCommand <<
" "
2490 otWarn <<
"\nCommand: " << m_strCommand <<
" "
2500 else if (strNodeName.Compare(
"issueAssetType")) {
2501 m_strCommand = xml->getNodeName();
2502 m_strNymID = xml->getAttributeValue(
"nymID");
2507 pElementExpected =
"assetContract";
2511 pElementExpected)) {
2512 otErr <<
"Error in OTMessage::ProcessXMLNode: "
2513 "Expected " << pElementExpected
2514 <<
" element with text field, for " << m_strCommand <<
".\n";
2526 else if (strNodeName.Compare(
"@issueAssetType")) {
2527 strSuccess = xml->getAttributeValue(
"success");
2528 if (strSuccess.Compare(
"true"))
2533 m_strCommand = xml->getNodeName();
2534 m_strNymID = xml->getAttributeValue(
"nymID");
2538 m_strAcctID = xml->getAttributeValue(
"accountID");
2546 pElementExpected =
"inReferenceTo";
2550 pElementExpected)) {
2551 otErr <<
"Error in OTMessage::ProcessXMLNode: "
2552 "Expected " << pElementExpected
2553 <<
" element with text field, for " << m_strCommand
2560 pElementExpected =
"issuerAccount";
2564 pElementExpected)) {
2565 otErr <<
"Error in OTMessage::ProcessXMLNode: "
2566 "Expected " << pElementExpected
2567 <<
" element with text field, for " << m_strCommand
2578 otErr <<
"Error in OTMessage::ProcessXMLNode:\n"
2579 "Expected issuerAccount and/or inReferenceTo elements "
2580 "with text fields in "
2581 "@issueAssetType reply\n";
2586 otWarn <<
"\nCommand: " << m_strCommand <<
" "
2598 else if (strNodeName.Compare(
"queryAssetTypes")) {
2599 m_strCommand = xml->getNodeName();
2600 m_strNymID = xml->getAttributeValue(
"nymID");
2604 pElementExpected =
"stringMap";
2608 pElementExpected)) {
2609 otErr <<
"Error in OTMessage::ProcessXMLNode: "
2610 "Expected " << pElementExpected
2611 <<
" element with text field, for " << m_strCommand <<
".\n";
2622 else if (strNodeName.Compare(
"@queryAssetTypes")) {
2623 strSuccess = xml->getAttributeValue(
"success");
2624 if (strSuccess.Compare(
"true"))
2629 m_strCommand = xml->getNodeName();
2630 m_strNymID = xml->getAttributeValue(
"nymID");
2640 pElementExpected =
"inReferenceTo";
2644 pElementExpected)) {
2645 otErr <<
"Error in OTMessage::ProcessXMLNode: "
2646 "Expected " << pElementExpected
2647 <<
" element with text field, for " << m_strCommand
2654 pElementExpected =
"stringMap";
2658 pElementExpected)) {
2659 otErr <<
"Error in OTMessage::ProcessXMLNode: "
2660 "Expected " << pElementExpected
2661 <<
" element with text field, for " << m_strCommand
2672 otErr <<
"Error in OTMessage::ProcessXMLNode:\n"
2673 "Expected stringMap and/or inReferenceTo elements with "
2675 "@queryAssetTypes reply\n";
2679 otWarn <<
"\n Command: " << m_strCommand <<
" "
2686 else if (strNodeName.Compare(
"createAccount")) {
2687 m_strCommand = xml->getNodeName();
2688 m_strNymID = xml->getAttributeValue(
"nymID");
2701 else if (strNodeName.Compare(
"@createAccount")) {
2702 strSuccess = xml->getAttributeValue(
"success");
2703 if (strSuccess.Compare(
"true"))
2708 m_strCommand = xml->getNodeName();
2710 m_strNymID = xml->getAttributeValue(
"nymID");
2712 m_strAcctID = xml->getAttributeValue(
"accountID");
2720 pElementExpected =
"inReferenceTo";
2724 pElementExpected)) {
2725 otErr <<
"Error in OTMessage::ProcessXMLNode: "
2726 "Expected " << pElementExpected
2727 <<
" element with text field, for " << m_strCommand
2734 pElementExpected =
"newAccount";
2738 pElementExpected)) {
2739 otErr <<
"Error in OTMessage::ProcessXMLNode: "
2740 "Expected " << pElementExpected
2741 <<
" element with text field, for " << m_strCommand
2752 otErr <<
"Error in OTMessage::ProcessXMLNode:\n"
2753 "Expected newAccount element with text field, in "
2754 "@createAccount reply\n";
2758 otWarn <<
"\nCommand: " << m_strCommand <<
" "
2769 else if (strNodeName.Compare(
"getBoxReceipt")) {
2770 m_strCommand = xml->getNodeName();
2771 m_strNymID = xml->getAttributeValue(
"nymID");
2773 m_strAcctID = xml->getAttributeValue(
"accountID");
2776 strTransactionNum = xml->getAttributeValue(
"transactionNum");
2778 strTransactionNum.Exists() ? atol(strTransactionNum.Get()) : 0;
2780 const OTString strBoxType = xml->getAttributeValue(
"boxType");
2782 if (strBoxType.Compare(
"nymbox"))
2784 else if (strBoxType.Compare(
"inbox"))
2786 else if (strBoxType.Compare(
"outbox"))
2790 otErr <<
"Error in OTMessage::ProcessXMLNode:\n"
2791 "Expected boxType to be inbox, outbox, or nymbox, in "
2796 otWarn <<
"\n Command: " << m_strCommand
2803 << ((
m_lDepth == 0) ?
"nymbox" : (m_lDepth == 1) ?
"inbox"
2809 else if (strNodeName.Compare(
"@getBoxReceipt")) {
2810 strSuccess = xml->getAttributeValue(
"success");
2811 if (strSuccess.Compare(
"true"))
2816 m_strCommand = xml->getNodeName();
2818 m_strNymID = xml->getAttributeValue(
"nymID");
2820 m_strAcctID = xml->getAttributeValue(
"accountID");
2822 strTransactionNum = xml->getAttributeValue(
"transactionNum");
2824 strTransactionNum.Exists() ? atol(strTransactionNum.Get()) : 0;
2826 const OTString strBoxType = xml->getAttributeValue(
"boxType");
2828 if (strBoxType.Compare(
"nymbox"))
2830 else if (strBoxType.Compare(
"inbox"))
2832 else if (strBoxType.Compare(
"outbox"))
2836 otErr <<
"Error in OTMessage::ProcessXMLNode:\n"
2837 "Expected boxType to be inbox, outbox, or nymbox, in "
2838 "@getBoxReceipt reply\n";
2846 pElementExpected =
"inReferenceTo";
2850 pElementExpected)) {
2851 otErr <<
"Error in OTMessage::ProcessXMLNode: "
2852 "Expected " << pElementExpected
2853 <<
" element with text field, for " << m_strCommand
2860 pElementExpected =
"boxReceipt";
2864 pElementExpected)) {
2865 otErr <<
"Error in OTMessage::ProcessXMLNode: "
2866 "Expected " << pElementExpected
2867 <<
" element with text field, for " << m_strCommand
2878 otErr <<
"Error in OTMessage::ProcessXMLNode:\n"
2879 "Expected boxReceipt and/or inReferenceTo elements with "
2881 "@getBoxReceipt reply\n";
2885 otWarn <<
"\nCommand: " << m_strCommand <<
" "
2894 else if (strNodeName.Compare(
"deleteAssetAccount")) {
2895 m_strCommand = xml->getNodeName();
2896 m_strNymID = xml->getAttributeValue(
"nymID");
2898 m_strAcctID = xml->getAttributeValue(
"accountID");
2901 otWarn <<
"\n Command: " << m_strCommand
2910 else if (strNodeName.Compare(
"@deleteAssetAccount")) {
2911 strSuccess = xml->getAttributeValue(
"success");
2912 if (strSuccess.Compare(
"true"))
2917 m_strCommand = xml->getNodeName();
2919 m_strNymID = xml->getAttributeValue(
"nymID");
2921 m_strAcctID = xml->getAttributeValue(
"accountID");
2927 pElementExpected =
"inReferenceTo";
2931 pElementExpected)) {
2932 otErr <<
"Error in OTMessage::ProcessXMLNode: "
2933 "Expected " << pElementExpected
2934 <<
" element with text field, for " << m_strCommand
2943 otErr <<
"Error in OTMessage::ProcessXMLNode:\n"
2944 "Expected inReferenceTo element with text fields in "
2945 "@deleteAssetAccount reply\n";
2949 otWarn <<
"\nCommand: " << m_strCommand <<
" "
2960 else if (strNodeName.Compare(
"issueBasket")) {
2961 m_strCommand = xml->getNodeName();
2962 m_strNymID = xml->getAttributeValue(
"nymID");
2967 pElementExpected =
"currencyBasket";
2971 pElementExpected)) {
2972 otErr <<
"Error in OTMessage::ProcessXMLNode: "
2973 "Expected " << pElementExpected
2974 <<
" element with text field, for " << m_strCommand
2983 otErr <<
"Error in OTMessage::ProcessXMLNode:\n"
2984 "Expected currencyBasket element with text fields in "
2985 "issueBasket message\n";
2996 else if (strNodeName.Compare(
"@issueBasket")) {
2997 strSuccess = xml->getAttributeValue(
"success");
2998 if (strSuccess.Compare(
"true"))
3003 m_strCommand = xml->getNodeName();
3005 m_strNymID = xml->getAttributeValue(
"nymID");
3008 m_strAcctID = xml->getAttributeValue(
"accountID");
3011 pElementExpected =
"inReferenceTo";
3015 pElementExpected)) {
3016 otErr <<
"Error in OTMessage::ProcessXMLNode: "
3017 "Expected " << pElementExpected
3018 <<
" element with text field, for " << m_strCommand
3028 otErr <<
"Error in OTMessage::ProcessXMLNode:\n"
3029 "Expected inReferenceTo element with text fields in "
3030 "@issueBasket reply\n";
3034 otWarn <<
"\nCommand: " << m_strCommand <<
" "
3043 else if (strNodeName.Compare(
"getTransactionNum")) {
3044 m_strCommand = xml->getNodeName();
3045 m_strNymID = xml->getAttributeValue(
"nymID");
3050 otWarn <<
"\n Command: " << m_strCommand
3058 else if (strNodeName.Compare(
"@getTransactionNum")) {
3059 strSuccess = xml->getAttributeValue(
"success");
3060 if (strSuccess.Compare(
"true"))
3065 m_strCommand = xml->getNodeName();
3067 m_strNymID = xml->getAttributeValue(
"nymID");
3071 otWarn <<
"\n Command: " << m_strCommand <<
" "
3079 else if (strNodeName.Compare(
"notarizeTransactions")) {
3080 m_strCommand = xml->getNodeName();
3081 m_strNymID = xml->getAttributeValue(
"nymID");
3084 m_strAcctID = xml->getAttributeValue(
"accountID");
3088 pElementExpected =
"accountLedger";
3092 pElementExpected)) {
3093 otErr <<
"Error in OTMessage::ProcessXMLNode: "
3094 "Expected " << pElementExpected
3095 <<
" element with text field, for " << m_strCommand
3101 otWarn <<
"\n Command: " << m_strCommand
3110 else if (strNodeName.Compare(
"@notarizeTransactions")) {
3111 strSuccess = xml->getAttributeValue(
"success");
3112 if (strSuccess.Compare(
"true"))
3117 m_strCommand = xml->getNodeName();
3119 m_strNymID = xml->getAttributeValue(
"nymID");
3121 m_strAcctID = xml->getAttributeValue(
"accountID");
3128 pElementExpected =
"inReferenceTo";
3132 pElementExpected)) {
3133 otErr <<
"Error in OTMessage::ProcessXMLNode: "
3134 "Expected " << pElementExpected
3135 <<
" element with text field, for " << m_strCommand
3142 pElementExpected =
"responseLedger";
3146 pElementExpected)) {
3147 otErr <<
"Error in OTMessage::ProcessXMLNode: "
3148 "Expected " << pElementExpected
3149 <<
" element with text field, for " << m_strCommand
3159 otErr <<
"Error in OTMessage::ProcessXMLNode:\n"
3160 "Expected responseLedger and/or inReferenceTo elements "
3161 "with text fields in "
3162 "@notarizeTransactions reply\n";
3167 otWarn <<
"\n Command: " << m_strCommand <<
" "
3178 else if (strNodeName.Compare(
"getInbox")) {
3179 m_strCommand = xml->getNodeName();
3180 m_strNymID = xml->getAttributeValue(
"nymID");
3182 m_strAcctID = xml->getAttributeValue(
"accountID");
3192 else if (strNodeName.Compare(
"getNymbox")) {
3193 m_strCommand = xml->getNodeName();
3194 m_strNymID = xml->getAttributeValue(
"nymID");
3204 else if (strNodeName.Compare(
"@getInbox")) {
3205 strSuccess = xml->getAttributeValue(
"success");
3206 if (strSuccess.Compare(
"true"))
3211 m_strCommand = xml->getNodeName();
3213 m_strNymID = xml->getAttributeValue(
"nymID");
3215 m_strAcctID = xml->getAttributeValue(
"accountID");
3218 const char* pElementExpected;
3220 pElementExpected =
"inboxLedger";
3222 pElementExpected =
"inReferenceTo";
3224 OTASCIIArmor ascTextExpected;
3227 pElementExpected)) {
3228 otErr <<
"Error in OTMessage::ProcessXMLNode: "
3229 "Expected " << pElementExpected
3230 <<
" element with text field, for " << m_strCommand <<
".\n";
3239 otWarn <<
"\nCommand: " << m_strCommand <<
" "
3248 else if (strNodeName.Compare(
"@getNymbox")) {
3249 strSuccess = xml->getAttributeValue(
"success");
3250 if (strSuccess.Compare(
"true"))
3255 m_strCommand = xml->getNodeName();
3257 m_strNymID = xml->getAttributeValue(
"nymID");
3261 const char* pElementExpected;
3263 pElementExpected =
"nymboxLedger";
3265 pElementExpected =
"inReferenceTo";
3267 OTASCIIArmor ascTextExpected;
3270 pElementExpected)) {
3271 otErr <<
"Error in OTMessage::ProcessXMLNode: "
3272 "Expected " << pElementExpected
3273 <<
" element with text field, for " << m_strCommand <<
".\n";
3282 otWarn <<
"\nCommand: " << m_strCommand <<
" "
3290 else if (strNodeName.Compare(
"getOutbox")) {
3291 m_strCommand = xml->getNodeName();
3292 m_strNymID = xml->getAttributeValue(
"nymID");
3294 m_strAcctID = xml->getAttributeValue(
"accountID");
3304 else if (strNodeName.Compare(
"@getOutbox")) {
3305 strSuccess = xml->getAttributeValue(
"success");
3306 if (strSuccess.Compare(
"true"))
3311 m_strCommand = xml->getNodeName();
3313 m_strNymID = xml->getAttributeValue(
"nymID");
3315 m_strAcctID = xml->getAttributeValue(
"accountID");
3318 const char* pElementExpected;
3320 pElementExpected =
"outboxLedger";
3322 pElementExpected =
"inReferenceTo";
3324 OTASCIIArmor ascTextExpected;
3327 pElementExpected)) {
3328 otErr <<
"Error in OTMessage::ProcessXMLNode: "
3329 "Expected " << pElementExpected
3330 <<
" element with text field, for " << m_strCommand <<
".\n";
3339 otWarn <<
"\nCommand: " << m_strCommand <<
" "
3348 else if (strNodeName.Compare(
"getAccount")) {
3349 m_strCommand = xml->getNodeName();
3350 m_strNymID = xml->getAttributeValue(
"nymID");
3352 m_strAcctID = xml->getAttributeValue(
"accountID");
3362 else if (strNodeName.Compare(
"@getAccount")) {
3363 strSuccess = xml->getAttributeValue(
"success");
3364 if (strSuccess.Compare(
"true"))
3369 m_strCommand = xml->getNodeName();
3371 m_strNymID = xml->getAttributeValue(
"nymID");
3373 m_strAcctID = xml->getAttributeValue(
"accountID");
3375 const char* pElementExpected;
3377 pElementExpected =
"assetAccount";
3379 pElementExpected =
"inReferenceTo";
3381 OTASCIIArmor ascTextExpected;
3384 pElementExpected)) {
3385 otErr <<
"Error in OTMessage::ProcessXMLNode: "
3386 "Expected " << pElementExpected
3387 <<
" element with text field, for " << m_strCommand <<
".\n";
3396 otWarn <<
"\nCommand: " << m_strCommand <<
" "
3405 else if (strNodeName.Compare(
"getAccountFiles")) {
3406 m_strCommand = xml->getNodeName();
3407 m_strNymID = xml->getAttributeValue(
"nymID");
3409 m_strAcctID = xml->getAttributeValue(
"accountID");
3419 else if (strNodeName.Compare(
"@getAccountFiles")) {
3420 strSuccess = xml->getAttributeValue(
"success");
3421 if (strSuccess.Compare(
"true"))
3426 m_strCommand = xml->getNodeName();
3428 m_strNymID = xml->getAttributeValue(
"nymID");
3430 m_strAcctID = xml->getAttributeValue(
"accountID");
3434 const char* pElementExpected;
3436 pElementExpected =
"acctFiles";
3438 pElementExpected =
"inReferenceTo";
3440 OTASCIIArmor ascTextExpected;
3443 pElementExpected)) {
3444 otErr <<
"Error in OTMessage::ProcessXMLNode: "
3445 "Expected " << pElementExpected
3446 <<
" element with text field, for " << m_strCommand <<
".\n";
3455 otWarn <<
"\nCommand: " << m_strCommand <<
" "
3464 else if (strNodeName.Compare(
"getContract")) {
3465 m_strCommand = xml->getNodeName();
3466 m_strNymID = xml->getAttributeValue(
"nymID");
3478 else if (strNodeName.Compare(
"@getContract")) {
3479 strSuccess = xml->getAttributeValue(
"success");
3480 if (strSuccess.Compare(
"true"))
3485 m_strCommand = xml->getNodeName();
3487 m_strNymID = xml->getAttributeValue(
"nymID");
3491 const char* pElementExpected;
3493 pElementExpected =
"assetContract";
3495 pElementExpected =
"inReferenceTo";
3497 OTASCIIArmor ascTextExpected;
3500 pElementExpected)) {
3501 otErr <<
"Error in OTMessage::ProcessXMLNode: "
3502 "Expected " << pElementExpected
3503 <<
" element with text field, for " << m_strCommand <<
".\n";
3512 otWarn <<
"\nCommand: " << m_strCommand <<
" "
3521 else if (strNodeName.Compare(
"getMint")) {
3522 m_strCommand = xml->getNodeName();
3523 m_strNymID = xml->getAttributeValue(
"nymID");
3537 else if (strNodeName.Compare(
"@getMint")) {
3538 strSuccess = xml->getAttributeValue(
"success");
3539 if (strSuccess.Compare(
"true"))
3544 m_strCommand = xml->getNodeName();
3546 m_strNymID = xml->getAttributeValue(
"nymID");
3550 const char* pElementExpected;
3552 pElementExpected =
"mint";
3554 pElementExpected =
"inReferenceTo";
3556 OTASCIIArmor ascTextExpected;
3559 pElementExpected)) {
3560 otErr <<
"Error in OTMessage::ProcessXMLNode: "
3561 "Expected " << pElementExpected
3562 <<
" element with text field, for " << m_strCommand <<
".\n";
3571 otWarn <<
"\nCommand: " << m_strCommand <<
" "
3580 else if (strNodeName.Compare(
"triggerClause")) {
3581 m_strCommand = xml->getNodeName();
3582 m_strNymID = xml->getAttributeValue(
"nymID");
3585 m_strNymID2 = xml->getAttributeValue(
"clauseName");
3587 const OTString strHasParam = xml->getAttributeValue(
"hasParam");
3589 strTransactionNum = xml->getAttributeValue(
"smartContractID");
3590 if (strTransactionNum.Exists())
3593 if (strHasParam.Compare(
"true")) {
3594 pElementExpected =
"parameter";
3595 OTASCIIArmor ascTextExpected;
3598 pElementExpected)) {
3599 otErr <<
"Error in OTMessage::ProcessXMLNode: "
3600 "Expected " << pElementExpected
3601 <<
" element with text field, for " << m_strCommand
3618 else if (strNodeName.Compare(
"@triggerClause")) {
3619 strSuccess = xml->getAttributeValue(
"success");
3620 if (strSuccess.Compare(
"true"))
3625 m_strCommand = xml->getNodeName();
3627 m_strNymID = xml->getAttributeValue(
"nymID");
3630 const char* pElementExpected =
"inReferenceTo";
3632 OTASCIIArmor ascTextExpected;
3635 pElementExpected)) {
3636 otErr <<
"Error in OTMessage::ProcessXMLNode: "
3637 "Expected " << pElementExpected
3638 <<
" element with text field, for " << m_strCommand <<
".\n";
3644 otWarn <<
"\nCommand: " << m_strCommand <<
" "
3651 else if (strNodeName.Compare(
"processInbox")) {
3652 m_strCommand = xml->getNodeName();
3653 m_strNymID = xml->getAttributeValue(
"nymID");
3656 m_strAcctID = xml->getAttributeValue(
"accountID");
3660 pElementExpected =
"processLedger";
3664 pElementExpected)) {
3665 otErr <<
"Error in OTMessage::ProcessXMLNode: "
3666 "Expected " << pElementExpected
3667 <<
" element with text field, for " << m_strCommand
3673 otWarn <<
"\n Command: " << m_strCommand
3682 else if (strNodeName.Compare(
"processNymbox")) {
3683 m_strCommand = xml->getNodeName();
3684 m_strNymID = xml->getAttributeValue(
"nymID");
3690 pElementExpected =
"processLedger";
3694 pElementExpected)) {
3695 otErr <<
"Error in OTMessage::ProcessXMLNode: "
3696 "Expected " << pElementExpected
3697 <<
" element with text field, for " << m_strCommand
3703 otWarn <<
"\n Command: " << m_strCommand
3711 else if (strNodeName.Compare(
"@processInbox")) {
3712 strSuccess = xml->getAttributeValue(
"success");
3713 if (strSuccess.Compare(
"true"))
3718 m_strCommand = xml->getNodeName();
3720 m_strNymID = xml->getAttributeValue(
"nymID");
3722 m_strAcctID = xml->getAttributeValue(
"accountID");
3729 pElementExpected =
"inReferenceTo";
3733 pElementExpected)) {
3734 otErr <<
"Error in OTMessage::ProcessXMLNode: "
3735 "Expected " << pElementExpected
3736 <<
" element with text field, for " << m_strCommand
3743 pElementExpected =
"responseLedger";
3747 pElementExpected)) {
3748 otErr <<
"Error in OTMessage::ProcessXMLNode: "
3749 "Expected " << pElementExpected
3750 <<
" element with text field, for " << m_strCommand
3760 otErr <<
"Error in OTMessage::ProcessXMLNode:\n"
3761 "Expected responseLedger and/or inReferenceTo elements "
3762 "with text fields in "
3763 "@processInbox reply\n";
3767 otWarn <<
"\n Command: " << m_strCommand <<
" "
3776 else if (strNodeName.Compare(
"@processNymbox")) {
3777 strSuccess = xml->getAttributeValue(
"success");
3778 if (strSuccess.Compare(
"true"))
3783 m_strCommand = xml->getNodeName();
3785 m_strNymID = xml->getAttributeValue(
"nymID");
3793 pElementExpected =
"inReferenceTo";
3797 pElementExpected)) {
3798 otErr <<
"Error in OTMessage::ProcessXMLNode: "
3799 "Expected " << pElementExpected
3800 <<
" element with text field, for " << m_strCommand
3807 pElementExpected =
"responseLedger";
3811 pElementExpected)) {
3812 otErr <<
"Error in OTMessage::ProcessXMLNode: "
3813 "Expected " << pElementExpected
3814 <<
" element with text field, for " << m_strCommand
3824 otErr <<
"Error in OTMessage::ProcessXMLNode:\n"
3825 "Expected responseLedger and/or inReferenceTo elements "
3826 "with text fields in "
3827 "@processNymbox reply\n";
3831 otWarn <<
"\n Command: " << m_strCommand <<
" "
OTASCIIArmor m_ascPayload2
int64_t m_lTransactionNum
EXPORT uint32_t GetLength() const
OTNumList m_AcknowledgedReplies
EXPORT void Set(const char *data, uint32_t enforcedMaxLength=0)
static EXPORT bool LoadEncodedTextField(irr::io::IrrXMLReader *&xml, OTASCIIArmor &ascOutput)
OTLOG_IMPORT OTLogStream otInfo
OTASCIIArmor m_ascInReferenceTo
OTLOG_IMPORT OTLogStream otWarn
OTLOG_IMPORT OTLogStream otErr
OTASCIIArmor m_ascPayload
OTString m_strNymPublicKey
virtual EXPORT void Release()
static bool LoadEncodedTextFieldByName(irr::io::IrrXMLReader *&xml, OTASCIIArmor &ascOutput, const char *&szName, OTString::Map *pmapExtraVars=nullptr)