From b82084fe444b78e4cb324d9841e5358be4b9ace1 Mon Sep 17 00:00:00 2001 From: Jay Graber Date: Tue, 15 Nov 2016 11:49:32 -0800 Subject: [PATCH] Change format of z_sendmany error code documentation. --- doc/payment-api.md | 75 ++++++++++++++++++++++++++++++++++++++++------ 1 file changed, 66 insertions(+), 9 deletions(-) diff --git a/doc/payment-api.md b/doc/payment-api.md index 16939f993..7435acf81 100644 --- a/doc/payment-api.md +++ b/doc/payment-api.md @@ -99,13 +99,70 @@ z_getoperationresult
| [operationids] | Return OperationStatus JSON objects z_getoperationstatus
| [operationids] | Return OperationStatus JSON objects for all operations the node is currently aware of.

Operationids is an optional array to filter which operations you want to receive status objects for.

Output is a list of operation status objects.
[
{“operationid”: “opid-12ee…”,
“status”: “queued”},
{“operationid”: “opd-098a…”, “status”: ”executing”},
{“operationid”: “opid-9876”, “status”: ”failed”}
]

When the operation succeeds, the status object will also include the result.

{“operationid”: “opid-0e0e”,
“status”:”success”,
“execution_time”:”25”,
“result”: {“txid”:”af3887654…”,...}
} z_listoperationids
| [state] | Return a list of operationids for all operations which the node is currently aware of.

State is an optional string parameter to filter the operations you want listed by their state. Acceptable parameter values are ‘queued’, ‘executing’, ‘success’, ‘failed’, ‘cancelled’.

[“opid-0e0e…”, “opid-1af4…”, … ] -### Asynchronous RPC call Error Codes +## Asynchronous RPC call Error Codes -Command | Code | Messages - --- | --- | --- -z_sendmany
| -8 | RPC_INVALID_PARAMETER, (Invalid, missing or duplicate parameter)

- "Minconf cannot be negative"
- "From address parameter missing"
- "No recipients"
- "Memo must be in hexadecimal format"
- "Memo size of __ is too big, maximum allowed is __ "
- "From address does not belong to this node, zaddr spending key not found."
- "Invalid parameter, expected object"
- "Invalid parameter, unknown key: __"
- "expected valid size"
- "expected object"
- "expected hex txid"
- "vout must be positive"
- "duplicated address"
- "amounts array is empty"
- "unknown key"
- "unknown address format"
- "size of memo"
- "amount must be positive"
- "too many zaddr outputs"
- "expected memo data in hexadecimal format"
- "size of memo is larger than maximum allowed __ "
- "Minimum number of confirmations cannot be less than 0" -z_sendmany
| -5 | RPC_INVALID_ADDRESS_OR_KEY, (Invalid address or key)

-"Invalid from address, no spending key found for zaddr"
- "Invalid output address, not a valid taddr."
- "Invalid from address, should be a taddr or zaddr."
- "From address does not belong to this node, zaddr spending key not found." -z_sendmany
| -6 | RPC_WALLET_INSUFFICIENT_FUNDS, (Not enough funds in wallet or account)

- "Insufficient funds, no UTXOs found for taddr from address."
- "Could not find any non-coinbase UTXOs to spend. Coinbase UTXOs can only be sent to a single zaddr recipient."
- "Could not find any non-coinbase UTXOs to spend."
- "Insufficient funds, no unspent notes found for zaddr from address."
- "Insufficient transparent funds, have __, need __ plus fee __"
- "Insufficient protected funds, have __, need __ plus fee __" -z_sendmany
| -4 | RPC_WALLET_ERROR, (unspecified problem with wallet)

- "Could not find previous JoinSplit anchor"
- "Error decrypting output note of previous JoinSplit: __"
- "Could not find witness for note commitment"
- "Witness for note commitment is null"
- "Witness for spendable note does not have same anchor as change input"
- "Not enough funds to pay miners fee"
- "Missing hex data for raw transaction"
- "Missing hex data for signed transaction"
- "Send raw transaction did not return an error or a txid." -z_sendmany
| -16 | RPC_WALLET_ENCRYPTION_FAILED, (Failed to encrypt the wallet)

- "Failed to sign transaction" -z_sendmany
| -12 | RPC_WALLET_KEYPOOL_RAN_OUT, (Keypool ran out, call keypoolrefill first)

- "Could not generate a taddr to use as a change address" +Zcash error codes are defined in https://github.com/zcash/zcash/blob/master/src/rpcprotocol.h + +### z_sendmany error codes + +RPC_INVALID_PARAMETER (-8) | _Invalid, missing or duplicate parameter_ +---------------------------| ------------------------------------------------- +"Minconf cannot be negative" | Cannot accept negative minimum confirmation number. +"Minimum number of confirmations cannot be less than 0" | Cannot accept negative minimum confirmation number. +"From address parameter missing" | Missing an address to send funds from. +"No recipients" | Missing recipient addresses. +"Memo must be in hexadecimal format" | Encrypted memo field data must be in hexadecimal format. +"Memo size of __ is too big, maximum allowed is __ " | Encrypted memo field data exceeds maximum size of 512 bytes. +"From address does not belong to this node, zaddr spending key not found." | Sender address spending key not found. +"Invalid parameter, expected object" | Expected object. +"Invalid parameter, unknown key: __" | Unknown key. +"Invalid parameter, expected valid size" | Invalid size. +"Invalid parameter, expected hex txid" | Invalid txid. +"Invalid parameter, vout must be positive" | Invalid vout. +"Invalid parameter, duplicated address" | Address is duplicated. +"Invalid parameter, amounts array is empty" | Amounts array is empty. +"Invalid parameter, unknown key" | Key not found. +"Invalid parameter, unknown address format" | Unknown address format. +"Invalid parameter, size of memo" | Invalid memo field size. +"Invalid parameter, amount must be positive" | Invalid or negative amount. +"Invalid parameter, too many zaddr outputs" | z_address outputs exceed maximum allowed. +"Invalid parameter, expected memo data in hexadecimal format" | Encrypted memo field is not in hexadecimal format. +"Invalid parameter, size of memo is larger than maximum allowed __ " | Encrypted memo field data exceeds maximum size of 512 bytes. + + +RPC_INVALID_ADDRESS_OR_KEY (-5) | _Invalid address or key_ +--------------------------------| --------------------------- +"Invalid from address, no spending key found for zaddr" | z_address spending key not found. +"Invalid output address, not a valid taddr." | Transparent output address is invalid. +"Invalid from address, should be a taddr or zaddr." | Sender address is invalid. +"From address does not belong to this node, zaddr spending key not found." | Sender address spending key not found. + + +RPC_WALLET_INSUFFICIENT_FUNDS (-6) | _Not enough funds in wallet or account_ +-----------------------------------| ------------------------------------------ +"Insufficient funds, no UTXOs found for taddr from address." | Insufficient funds for sending address. +"Could not find any non-coinbase UTXOs to spend. Coinbase UTXOs can only be sent to a single zaddr recipient." | Must send Coinbase UTXO to a single z_address. +"Could not find any non-coinbase UTXOs to spend." | No available non-coinbase UTXOs. +"Insufficient funds, no unspent notes found for zaddr from address." | Insufficient funds for sending address. +"Insufficient transparent funds, have __, need __ plus fee __" | Insufficient funds from transparent address. +"Insufficient protected funds, have __, need __ plus fee __" | Insufficient funds from shielded address. + +RPC_WALLET_ERROR (-4) | _Unspecified problem with wallet_ +----------------------| ------------------------------------- +"Could not find previous JoinSplit anchor" | Try restarting node with `-reindex`. +"Error decrypting output note of previous JoinSplit: __" | +"Could not find witness for note commitment" | Try restarting node with `-reindex`. +"Witness for note commitment is null" | Missing witness for note commitement. +"Witness for spendable note does not have same anchor as change input" | Invalid anchor for spendable note witness. +"Not enough funds to pay miners fee" | Retry with sufficient funds. +"Missing hex data for raw transaction" | Raw transaction data is null. +"Missing hex data for signed transaction" | Hex value for signed transaction is null. +"Send raw transaction did not return an error or a txid." | + +RPC_WALLET_ENCRYPTION_FAILED (-16) | _Failed to encrypt the wallet_ +-------------------------------------------------------------------------| ------------------------------------- +"Failed to sign transaction" | Transaction was not signed, sign transaction and retry. + +RPC_WALLET_KEYPOOL_RAN_OUT (-12) | _Keypool ran out, call keypoolrefill first_ +-------------------------------------------------------------------------| ----------------------------------------------- +"Could not generate a taddr to use as a change address" | Call keypoolrefill and retry.