errors.js
1 /*! 2 * lib/error.js 3 * Copyright © 2019 – Katana Cryptographic Ltd. All Rights Reserved. 4 */ 5 6 7 /** 8 * Dictionary of error codes 9 */ 10 export default { 11 get: { 12 UNKNXPUB: 'Unknown xpub. Create with POST /xpub', 13 DISALLOWED: 'GET not allowed. Use POST', 14 }, 15 body: { 16 NODATA: 'No body data', 17 NOXPUB: 'Missing body parameter "xpub"', 18 NOTYPE: 'Missing body parameter "type"', 19 NOADDR: 'Missing body parameter "address"', 20 NOMSG: 'Missing body parameter "message"', 21 NOSIG: 'Missing body parameter "signature"', 22 NOSCRIPT: 'Missing body parameter "script"', 23 SCRIPTSIZE: 'Too many entries in the script', 24 NOTX: 'Missing body parameter "tx"', 25 INVTYPE: 'Invalid value for parameter "type"', 26 INVDATA: 'Invalid request arguments' 27 }, 28 sig: { 29 INVSIG: 'Invalid bitcoin signature', 30 INVMSG: 'Invalid message content', 31 INVADDR: 'Incorrect bitcoin address used for signature', 32 }, 33 tx: { 34 PARSE: 'Unable to parse transaction hex', 35 SEND: 'Unable to broadcast transaction', 36 TXID: 'Malformed txid', 37 }, 38 address: { 39 INVALID: 'Invalid address', 40 }, 41 xpub: { 42 INVALID: 'Invalid xpub', 43 CHAIN: 'Invalid chain', 44 PRIVKEY: 'No private keys', 45 CREATE: 'Unable to create new HD account', 46 RESTORE: 'Unable to restore HD account', 47 OVERLAP: 'Import in progress', 48 SEGWIT: 'Invalid value for SegWit support type', 49 LOCKED: 'Unable to complete operation (locked xpub)' 50 }, 51 txout: { 52 VOUT: 'Invalid vout', 53 NOTFOUND: 'Unspent output not found', 54 }, 55 multiaddr: { 56 NOACT: 'Missing parameter "active"', 57 INVALID: 'No valid active entries', 58 AMBIG: 'Ambiguous "new" parameter: pass only one xpub', 59 NO_IMPORTER: 'Cannot use bitcoind as an importer' 60 }, 61 generic: { 62 GEN: 'Error', 63 DB: 'Database Error', 64 }, 65 auth: { 66 INVALID_CONF: 'Missing configuration parameter', 67 INVALID_JWT: 'Invalid JSON Web Token', 68 INVALID_PRF: 'Your current access rights do not allow this operation', 69 MISSING_JWT: 'Missing JSON Web Token', 70 TECH_ISSUE: 'A technical problem was encountered. Unable to authenticate the user', 71 INVALID_API_KEY: 'Invalid API key', 72 }, 73 db: { 74 ERROR_NO_ADDRESS: 'ERROR_NO_ADDRESS', 75 ERROR_NO_HD_ACCOUNT: 'ERROR_NO_HD_ACCOUNT' 76 }, 77 pushtx: { 78 NLOCK_MISMATCH: 'nLockTime in script does not match nLockTime in transaction', 79 SCHEDULED_TOO_FAR: 'nLockTime is set to far in the future', 80 SCHEDULED_BAD_ORDER: 'Order of hop and nLockTime values must be consistent', 81 VIOLATION_STRICT_MODE_VOUTS: 'VIOLATION_STRICT_MODE_VOUTS' 82 }, 83 estimator: { 84 NOT_AVAILABLE: 'FeeEstimator not available' 85 } 86 }