20 #include <ripple/protocol/TER.h>
21 #include <boost/range/adaptor/transformed.hpp>
37 {
tecCLAIM, {
"tecCLAIM",
"Fee claimed. Sequence used. No action."}},
38 {
tecDIR_FULL, {
"tecDIR_FULL",
"Can not add entry to full directory."}},
40 {
"tecFAILED_PROCESSING",
"Failed to correctly process transaction."}},
42 {
"tecINSUF_RESERVE_LINE",
"Insufficient reserve to add trust line."}},
44 {
"tecINSUF_RESERVE_OFFER",
"Insufficient reserve to create offer."}},
46 {
"tecNO_DST",
"Destination does not exist. Send XRP to create it."}},
48 {
"tecNO_DST_INSUF_XRP",
49 "Destination does not exist. Too little XRP sent to create it."}},
51 {
"tecNO_LINE_INSUF_RESERVE",
52 "No such line. Too little reserve to create it."}},
54 {
"tecNO_LINE_REDUNDANT",
"Can't set non-existent line to default."}},
55 {
tecPATH_DRY, {
"tecPATH_DRY",
"Path could not send partial amount."}},
57 {
"tecPATH_PARTIAL",
"Path could not send full amount."}},
59 {
"tecNO_ALTERNATIVE_KEY",
60 "The operation would remove the ability to sign transactions with "
63 {
tecOVERSIZE, {
"tecOVERSIZE",
"Object exceeded serialization limits."}},
65 {
"tecUNFUNDED",
"One of _ADD, _OFFER, or _SEND. Deprecated."}},
67 {
"tecUNFUNDED_ADD",
"Insufficient XRP balance for WalletAdd."}},
69 {
"tecUNFUNDED_OFFER",
"Insufficient balance to fund created offer."}},
71 {
"tecUNFUNDED_PAYMENT",
"Insufficient XRP balance to send."}},
72 {
tecOWNERS, {
"tecOWNERS",
"Non-zero owner count."}},
73 {
tecNO_ISSUER, {
"tecNO_ISSUER",
"Issuer account does not exist."}},
74 {
tecNO_AUTH, {
"tecNO_AUTH",
"Not authorized to hold asset."}},
76 {
tecINSUFF_FEE, {
"tecINSUFF_FEE",
"Insufficient balance to pay fee."}},
77 {
tecFROZEN, {
"tecFROZEN",
"Asset is frozen."}},
78 {
tecNO_TARGET, {
"tecNO_TARGET",
"Target account does not exist."}},
80 {
"tecNO_PERMISSION",
"No permission to perform requested operation."}},
81 {
tecNO_ENTRY, {
"tecNO_ENTRY",
"No matching entry found."}},
83 {
"tecINSUFFICIENT_RESERVE",
84 "Insufficient reserve to complete requested operation."}},
86 {
"tecNEED_MASTER_KEY",
87 "The operation requires the use of the Master Key."}},
89 {
"tecDST_TAG_NEEDED",
"A destination tag is required."}},
91 {
"tecINTERNAL",
"An internal error has occurred during processing."}},
93 {
"tecCRYPTOCONDITION_ERROR",
94 "Malformed, invalid, or mismatched conditional or fulfillment."}},
96 {
"tecINVARIANT_FAILED",
97 "One or more invariants for the transaction were not satisfied."}},
98 {
tecEXPIRED, {
"tecEXPIRED",
"Expiration time is passed."}},
99 {
tecDUPLICATE, {
"tecDUPLICATE",
"Ledger object already exists."}},
100 {
tecKILLED, {
"tecKILLED",
"FillOrKill offer killed."}},
102 {
"tecHAS_OBLIGATIONS",
103 "The account cannot be deleted since it has obligations."}},
106 "It is too early to attempt the requested operation. Please wait."}},
109 {
"tefALREADY",
"The exact transaction was already in this ledger."}},
111 {
"tefBAD_ADD_AUTH",
"Not authorized to add account."}},
113 {
"tefBAD_AUTH",
"Transaction's public key is not authorized."}},
114 {
tefBAD_LEDGER, {
"tefBAD_LEDGER",
"Ledger in unexpected state."}},
116 {
"tefBAD_QUORUM",
"Signatures provided do not meet the quorum."}},
118 {
"tefBAD_SIGNATURE",
"A signature is provided for a non-signer."}},
119 {
tefCREATED, {
"tefCREATED",
"Can't add an already created account."}},
120 {
tefEXCEPTION, {
"tefEXCEPTION",
"Unexpected program state."}},
121 {
tefFAILURE, {
"tefFAILURE",
"Failed to apply."}},
124 {
tefMAX_LEDGER, {
"tefMAX_LEDGER",
"Ledger sequence too high."}},
127 {
"tefNOT_MULTI_SIGNING",
128 "Account has no appropriate list of multi-signers."}},
130 {
"tefPAST_SEQ",
"This sequence number has already passed."}},
132 {
"tefWRONG_PRIOR",
"This previous transaction does not match."}},
134 {
"tefBAD_AUTH_MASTER",
135 "Auth for unclaimed account needs correct master key."}},
137 {
"tefINVARIANT_FAILED",
138 "Fee claim violated invariants for the transaction."}},
139 {
tefTOO_BIG, {
"tefTOO_BIG",
"Transaction affects too many items."}},
144 {
"telBAD_PATH_COUNT",
"Malformed: Too many paths."}},
147 {
"telFAILED_PROCESSING",
"Failed to correctly process transaction."}},
150 {
"telNO_DST_PARTIAL",
151 "Partial payment to create account not allowed."}},
154 {
"telCAN_NOT_QUEUE_BALANCE",
155 "Can not queue at this time: insufficient balance to pay all queued "
158 {
"telCAN_NOT_QUEUE_BLOCKS",
159 "Can not queue at this time: would block later queued "
162 {
"telCAN_NOT_QUEUE_BLOCKED",
163 "Can not queue at this time: blocking transaction in queue."}},
165 {
"telCAN_NOT_QUEUE_FEE",
166 "Can not queue at this time: fee insufficient to replace queued "
169 {
"telCAN_NOT_QUEUE_FULL",
170 "Can not queue at this time: queue is full."}},
172 {
temMALFORMED, {
"temMALFORMED",
"Malformed transaction."}},
173 {
temBAD_AMOUNT, {
"temBAD_AMOUNT",
"Can only send positive amounts."}},
176 {
"temBAD_EXPIRATION",
"Malformed: Bad expiration."}},
177 {
temBAD_FEE, {
"temBAD_FEE",
"Invalid fee, negative or not XRP."}},
178 {
temBAD_ISSUER, {
"temBAD_ISSUER",
"Malformed: Bad issuer."}},
179 {
temBAD_LIMIT, {
"temBAD_LIMIT",
"Limits must be non-negative."}},
180 {
temBAD_OFFER, {
"temBAD_OFFER",
"Malformed: Bad offer."}},
181 {
temBAD_PATH, {
"temBAD_PATH",
"Malformed: Bad path."}},
183 {
temBAD_QUORUM, {
"temBAD_QUORUM",
"Malformed: Quorum is unreachable."}},
186 "Malformed: Regular key cannot be same as master key."}},
188 {
"temBAD_SEND_XRP_LIMIT",
189 "Malformed: Limit quality is not allowed for XRP to XRP."}},
191 {
"temBAD_SEND_XRP_MAX",
192 "Malformed: Send max is not allowed for XRP to XRP."}},
194 {
"temBAD_SEND_XRP_NO_DIRECT",
195 "Malformed: No Ripple direct is not allowed for XRP to XRP."}},
197 {
"temBAD_SEND_XRP_PARTIAL",
198 "Malformed: Partial payment is not allowed for XRP to XRP."}},
200 {
"temBAD_SEND_XRP_PATHS",
201 "Malformed: Paths are not allowed for XRP to XRP."}},
203 {
"temBAD_SEQUENCE",
"Malformed: Sequence is not in the past."}},
207 "Malformed: No signer may duplicate account or other signers."}},
209 {
"temBAD_SRC_ACCOUNT",
"Malformed: Bad source account."}},
211 {
"temBAD_TRANSFER_RATE",
212 "Malformed: Transfer rate must be >= 1.0 and <= 2.0"}},
214 {
"temBAD_WEIGHT",
"Malformed: Weight must be a positive value."}},
215 {
temDST_IS_SRC, {
"temDST_IS_SRC",
"Destination may not be source."}},
216 {
temDST_NEEDED, {
"temDST_NEEDED",
"Destination not specified."}},
217 {
temINVALID, {
"temINVALID",
"The transaction is ill-formed."}},
219 {
"temINVALID_FLAG",
"The transaction has an invalid flag."}},
220 {
temREDUNDANT, {
"temREDUNDANT",
"Sends same currency to self."}},
223 {
"temUNCERTAIN",
"In process of determining result. Never returned."}},
226 "The transaction requires logic that is not implemented yet."}},
229 "The transaction requires logic that is currently disabled."}},
231 {
"temBAD_TICK_SIZE",
"Malformed: Tick size out of range."}},
233 {
"temINVALID_ACCOUNT_ID",
234 "Malformed: A field contains an invalid account ID."}},
236 {
"temCANNOT_PREAUTH_SELF",
237 "Malformed: An account may not preauthorize itself."}},
239 {
terRETRY, {
"terRETRY",
"Retry transaction."}},
242 "Can't set password, password set funds already spent."}},
243 {
terINSUF_FEE_B, {
"terINSUF_FEE_B",
"Account balance can't pay fee."}},
244 {
terLAST, {
"terLAST",
"Process last."}},
245 {
terNO_RIPPLE, {
"terNO_RIPPLE",
"Path does not permit rippling."}},
247 {
"terNO_ACCOUNT",
"The source account does not exist."}},
248 {
terNO_AUTH, {
"terNO_AUTH",
"Not authorized to hold IOUs."}},
249 {
terNO_LINE, {
"terNO_LINE",
"No such line."}},
250 {
terPRE_SEQ, {
"terPRE_SEQ",
"Missing/inapplicable prior transaction."}},
251 {
terOWNERS, {
"terOWNERS",
"Non-zero owner count."}},
252 {
terQUEUED, {
"terQUEUED",
"Held until escalated fee drops."}},
256 "The transaction was applied. Only final in a validated ledger."}},
268 auto const r = results.find(
TERtoInt(code));
270 if (r == results.end())
273 token = r->second.first;
274 text = r->second.second;
299 static auto const results = [] {
301 auto range = boost::make_iterator_range(byTer.begin(), byTer.end());
302 auto tRange = boost::adaptors::transform(
range, [](
auto const& r) {
306 tRange.begin(), tRange.end());
310 auto const r = results.find(token);
312 if (r == results.end())
std::string transToken(TER code)
constexpr TERUnderlyingType TERtoInt(TELcodes v)
static std::unordered_map< TERUnderlyingType, std::pair< char const *const, char const *const > > const & transResults()
@ temBAD_SEND_XRP_PARTIAL
@ temBAD_SEND_XRP_NO_DIRECT
ClosedInterval< T > range(T low, T high)
Create a closed range interval.
@ telCAN_NOT_QUEUE_BLOCKS
std::string transHuman(TER code)
Use hash_* containers for keys that do not need a cryptographically secure hashing algorithm.
bool transResultInfo(TER code, std::string &token, std::string &text)
@ tecNO_LINE_INSUF_RESERVE
boost::optional< TER > transCode(std::string const &token)
static constexpr TERSubset fromInt(int from)
@ tecINSUFFICIENT_RESERVE
@ telCAN_NOT_QUEUE_BALANCE
@ telCAN_NOT_QUEUE_BLOCKED
@ tecCRYPTOCONDITION_ERROR