Documentation
¶
Index ¶
- Variables
- func AbortWithErrorResponse(c *gin.Context, err error, log *zerolog.Logger)
- func ErrorResponse(c *gin.Context, err error, log *zerolog.Logger)
- func Newf(message string, args ...interface{}) error
- func UnfoldError(err error) string
- func Wrapf(err error, format string, args ...interface{}) error
Constants ¶
This section is empty.
Variables ¶
var ErrAcceptContact = models.SPVError{Message: "accepting contact failed", StatusCode: 500, Code: "error-contact-accepting-contact-failed"}
ErrAcceptContact is when accepting contact failed
var ErrAccessKeyRevoked = models.SPVError{Message: "access key has been revoked", StatusCode: 400, Code: "error-access-key-revoked"}
ErrAccessKeyRevoked is when the access key has been revoked
var ErrAddingContactRequest = models.SPVError{Message: "adding contact request failed", StatusCode: 500, Code: "error-contact-request-failed"}
ErrAddingContactRequest is when error occurred while adding contact
var ErrAdminAuthOnUserEndpoint = models.SPVError{Message: "cannot call user's endpoints with admin authorization", StatusCode: 401, Code: "error-admin-auth-on-user-endpoint"}
ErrAdminAuthOnUserEndpoint is when admin authorization is used on user's endpoint
var ErrAskingForFeeUnit = models.SPVError{Message: "error during asking for fee unit", StatusCode: 500, Code: "error-asking-for-fee-unit"}
ErrAskingForFeeUnit is when error occurred during asking for fee unit
var ErrAuthorization = models.SPVError{Message: "unauthorized", StatusCode: 401, Code: "error-unauthorized"}
ErrAuthorization is basic auth error
var ErrBroadcast = models.SPVError{Message: "broadcast error", StatusCode: 500, Code: "error-broadcast"}
ErrBroadcast is when broadcast error occurred
var ErrCannotBindRequest = models.SPVError{Message: "cannot bind request body", StatusCode: 400, Code: "error-bind-body-invalid"}
ErrCannotBindRequest is when request body cannot be bind into struct
var ErrCannotMapFromEngine = models.SPVError{Message: "error during preparing response", StatusCode: 500, Code: "error-response-write"}
ErrCannotMapFromEngine is when engine model cannot be mapped into response model.
var ErrCannotMapFromModel = models.SPVError{Message: "error during reading request body", StatusCode: 500, Code: "error-request-read"}
ErrCannotMapFromModel is when request body model cannot be mapped into domain model.
var ErrCannotParseQueryParams = models.SPVError{Message: "cannot parse request query params", StatusCode: 400, Code: "error-query-params-invalid"}
ErrCannotParseQueryParams is when query params cannot be parsed into expected struct.
var ErrCapabilitiesPikeUnsupported = models.SPVError{Message: "server doesn't support PIKE", StatusCode: 400, Code: "error-capabilities-pike-unsupported"}
ErrCapabilitiesPikeUnsupported is when PIKE is not supported for given paymail domain
var ErrCapabilitiesPkiUnsupported = models.SPVError{Message: "server doesn't support PKI", StatusCode: 400, Code: "error-capabilities-pki-unsupported"}
ErrCapabilitiesPkiUnsupported is when PKI is not supported for given paymail domain
var ErrChangeStrategyNotImplemented = models.SPVError{Message: "change strategy nominations not implemented yet", StatusCode: 501, Code: "error-utxo-change-strategy-not-implemented"}
ErrChangeStrategyNotImplemented is a temporary error until the feature is supported
var ErrConfirmContact = models.SPVError{Message: "confirming contact failed", StatusCode: 500, Code: "error-contact-confirming-contacts-failed"}
ErrConfirmContact is when confirming contact failed
var ErrContactAlreadyExists = models.SPVError{Message: "contact already exists", StatusCode: 409, Code: "error-contact-already-exists"}
ErrContactAlreadyExists is when contact already exists
var ErrContactIncorrectStatus = models.SPVError{Message: "contact is in incorrect status to proceed", StatusCode: 400, Code: "error-contact-status-incorrect"}
ErrContactIncorrectStatus is when contact is in incorrect status to make a change
var ErrContactNotFound = models.SPVError{Message: "contact not found", StatusCode: 404, Code: "error-contact-not-found"}
ErrContactNotFound is when contact cannot be found
var ErrContactsNotFound = models.SPVError{Message: "contacts not found", StatusCode: 404, Code: "error-contacts-not-found"}
ErrContactsNotFound is when contacts cannot be found
var ErrCouldNotCountContacts = models.SPVError{Message: "failed to count contacts", StatusCode: 500, Code: "error-contacts-count-failed"}
ErrCouldNotCountContacts is when contacts cannot be counted
var ErrCouldNotCountTransactions = models.SPVError{Message: "failed transactions count", StatusCode: 500, Code: "error-transactions-count-failed"}
ErrCouldNotCountTransactions is when a transaction count fails
var ErrCouldNotCountXpubs = models.SPVError{Message: "failed xpubs count", StatusCode: 500, Code: "error-xpubs-count-failed"}
ErrCouldNotCountXpubs is when could not count xpubs
var ErrCouldNotFindAccessKey = models.SPVError{Message: "access key not found", StatusCode: 404, Code: "error-access-key-not-found"}
ErrCouldNotFindAccessKey is when could not find xpub
var ErrCouldNotFindDestination = models.SPVError{Message: "destination not found", StatusCode: 404, Code: "error-destination-not-found"}
ErrCouldNotFindDestination is an error when a destination could not be found
var ErrCouldNotFindDraftTx = models.SPVError{Message: "draft tx not found", StatusCode: 404, Code: "error-transaction-draft-tx-not-found"}
ErrCouldNotFindDraftTx is an error when a given draft tx could not be found
var ErrCouldNotFindPaymail = models.SPVError{Message: "paymail not found", StatusCode: 404, Code: "error-paymail-not-found"}
ErrCouldNotFindPaymail is when paymail could not be found
var ErrCouldNotFindTransaction = models.SPVError{Message: "transaction not found", StatusCode: 404, Code: "error-transaction-not-found"}
ErrCouldNotFindTransaction is an error when a transaction could not be found
var ErrCouldNotFindUtxo = models.SPVError{Message: "utxo could not be found", StatusCode: 404, Code: "error-utxo-not-found"}
ErrCouldNotFindUtxo is an error when a given utxo could not be found
var ErrCouldNotFindXpub = models.SPVError{Message: "xpub not found", StatusCode: 404, Code: "error-xpub-not-found"}
ErrCouldNotFindXpub is when could not find xpub
var ErrCreateOutgoingTxFailed = models.SPVError{Message: "creation of outgoing tx failed", StatusCode: 500, Code: "error-transaction-create-outgoing-tx-failed"}
ErrCreateOutgoingTxFailed is when error occurred during creation of outgoing tx
var ErrCtxInterrupted = models.SPVError{Message: "context interrupted", StatusCode: 500, Code: "error-ctx-interrupted"}
ErrCtxInterrupted is when context is interrupted (canceled or deadline exceeded)
var ErrDatastoreRequired = models.SPVError{Message: "datastore is required", StatusCode: 500, Code: "error-datastore-required"}
ErrDatastoreRequired is when a datastore function is called without a datastore present
var ErrDeleteContact = models.SPVError{Message: "deleting contact failed", StatusCode: 500, Code: "error-contact-deleting-contact-failed"}
ErrDeleteContact is when deleting contact failed
var ErrDeletePaymailAddress = models.SPVError{Message: "deleting paymail address failed", StatusCode: 400, Code: "error-deleting-paymail-address-failed"}
ErrDeletePaymailAddress is when the paymail address could not be deleted
var ErrDeriveChildKey = models.SPVError{Message: "error deriving child key", StatusCode: 401, Code: "error-unauthorized-derive-child-key"}
ErrDeriveChildKey is when error occurred during deriving child key
var ErrDraftIDMismatch = models.SPVError{Message: "transaction draft id does not match utxo draft reservation id", StatusCode: 400, Code: "error-transaction-draft-id-mismatch"}
ErrDraftIDMismatch is when the reference ID does not match the reservation id
var ErrDraftTxHasNoOutputs = models.SPVError{Message: "corresponding draft transaction has no outputs", StatusCode: 400, Code: "error-transaction-draft-has-no-outputs"}
ErrDraftTxHasNoOutputs is when draft transaction has no outputs
var ErrDuplicateUTXOs = models.SPVError{Message: "duplicate utxos found", StatusCode: 400, Code: "error-utxo-duplicate"}
ErrDuplicateUTXOs is when a transaction is created using the same utxo more than once
var ErrDuringSaveTx = models.SPVError{Message: "error during saving tx", StatusCode: 500, Code: "error-transaction-save-failed"}
ErrDuringSaveTx is when error occurred during save tx
var ErrEmptyRelatedDraftID = models.SPVError{Message: "empty RelatedDraftID", StatusCode: 400, Code: "error-transaction-related-draft-id-empty"}
ErrEmptyRelatedDraftID is when related draft id is empty
var ErrEmptyTx = models.SPVError{Message: "empty tx", StatusCode: 400, Code: "error-transaction-empty"}
ErrEmptyTx is when tx is empty
var ErrEmptyXpubKey = models.SPVError{Message: "empty xPubKey", StatusCode: 400, Code: "error-transaction-xpub-key-empty"}
ErrEmptyXpubKey is when xpub key is empty
var ErrFailedToCreateUTXO = models.SPVError{Message: "failed to create UTXO", StatusCode: 400, Code: "error-transaction-failed-to-create-utxo"}
ErrFailedToCreateUTXO is when sdk method fails to create UTXO with provided data
var ErrFetchTransactions = models.SPVError{Message: "failed to fetch transactions", StatusCode: 500, Code: "error-fetch-transactions"}
ErrFetchTransactions is when a transaction fetch fails
var ErrForTypeConversion = models.SPVError{Message: "error during type conversion", StatusCode: 500, Code: "error-type-conversion"}
ErrForTypeConversion is when error occurred during type conversion
var ErrGetCapabilities = models.SPVError{Message: "failed to get paymail capabilities", StatusCode: 400, Code: "error-capabilities-failed-to-get"}
ErrGetCapabilities is when getting capabilities failed
var ErrGetContact = models.SPVError{Message: "getting contact failed", StatusCode: 500, Code: "error-contact-getting-contact-failed"}
ErrGetContact is when getting contact failed
var ErrGettingAddressFromHdKey = models.SPVError{Message: "error getting address from hd key", StatusCode: 401, Code: "error-unauthorized-address-failed-to-get-from-hd-key"}
ErrGettingAddressFromHdKey is when error occurred during getting address from hd key
var ErrGettingPKIFailed = models.SPVError{Message: "getting PKI for contact failed", StatusCode: 400, Code: "error-contact-getting-pki-failed"}
ErrGettingPKIFailed is when getting PKI for contact paymail failed
var ErrInternal = models.SPVError{Message: "internal server error", StatusCode: 500, Code: "error-internal-server-error"}
ErrInternal is a generic error that something weird went wrong
var ErrInvalidConditions = models.SPVError{Message: "invalid conditions", StatusCode: 400, Code: "error-bind-conditions-invalid"}
ErrInvalidConditions is when request has invalid conditions
var ErrInvalidContactPaymail = models.SPVError{Message: "invalid paymail in contact", StatusCode: 400, Code: "error-contact-paymail-invalid"}
ErrInvalidContactPaymail is when paymail is missing in contact
var ErrInvalidHex = models.SPVError{Message: "invalid hex", StatusCode: 400, Code: "error-transaction-hex-invalid"}
ErrInvalidHex is when cannot create tx from hex
var ErrInvalidInt = models.SPVError{Message: "invalid int value", StatusCode: 500, Code: "error-invalid-int-value"}
ErrInvalidInt is when uint value is invalid
var ErrInvalidInt64 = models.SPVError{Message: "invalid int64 value", StatusCode: 500, Code: "error-invalid-int64"}
ErrInvalidInt64 is when int64 value is invalid
var ErrInvalidLockingScript = models.SPVError{Message: "invalid locking script", StatusCode: 400, Code: "error-transaction-locking-script-invalid"}
ErrInvalidLockingScript is when a locking script cannot be decoded
var ErrInvalidOpReturnOutput = models.SPVError{Message: "invalid op_return output", StatusCode: 400, Code: "error-transaction-invalid-op-return-output"}
ErrInvalidOpReturnOutput is when a locking script is not a valid op_return
var ErrInvalidOrMissingToken = models.SPVError{Message: "invalid or missing bearer token", StatusCode: 401, Code: "error-unauthorized-token-invalid-or-missing"}
ErrInvalidOrMissingToken is when callback token from headers is invalid or missing
var ErrInvalidRequesterXpub = models.SPVError{Message: "invalid requester xpub", StatusCode: 400, Code: "error-contact-invalid-requester-xpub"}
ErrInvalidRequesterXpub is when requester xpub is not connected with given paymail
var ErrInvalidRequirements = models.SPVError{Message: "requirements are invalid or missing", StatusCode: 400, Code: "error-transaction-requirements-invalid"}
ErrInvalidRequirements is when an invalid requirement was given
var ErrInvalidScriptOutput = models.SPVError{Message: "invalid script output", StatusCode: 400, Code: "error-transaction-script-output-invalid"}
ErrInvalidScriptOutput is when a locking script is not a valid bitcoin script
var ErrInvalidSignature = models.SPVError{Message: "invalid signature", StatusCode: 401, Code: "error-unauthorized-signature-invalid"}
ErrInvalidSignature is when signature is invalid
var ErrInvalidToken = models.SPVError{Message: "invalid authorization token", StatusCode: 401, Code: "error-unauthorized-token-invalid"}
ErrInvalidToken is when callback token from headers is invalid
var ErrInvalidTransactionID = models.SPVError{Message: "invalid transaction id", StatusCode: 400, Code: "error-transaction-id-invalid"}
ErrInvalidTransactionID is when a transaction id cannot be decoded
var ErrInvalidUint = models.SPVError{Message: "invalid uint value", StatusCode: 500, Code: "error-invalid-uint-value"}
ErrInvalidUint is when uint value is invalid
var ErrInvalidUint32 = models.SPVError{Message: "invalid uint32 value", StatusCode: 500, Code: "error-invalid-uint32"}
ErrInvalidUint32 is when uint32 value is invalid
var ErrInvalidUint64 = models.SPVError{Message: "invalid uint64 value", StatusCode: 500, Code: "error-invalid-uint64"}
ErrInvalidUint64 is when uint64 value is invalid
var ErrMissingAccessKey = models.SPVError{Message: "missing required field: access key", StatusCode: 400, Code: "error-missing-field-access-key"}
ErrMissingAccessKey is when the access key field is required but missing
var ErrMissingAddress = models.SPVError{Message: "missing required field: address", StatusCode: 400, Code: "error-missing-field-address"}
ErrMissingAddress is when the address field address is required but missing
var ErrMissingAuthHeader = models.SPVError{Message: "missing auth header", StatusCode: 401, Code: "error-unauthorized-auth-header-missing"}
ErrMissingAuthHeader is when request does not have auth header
var ErrMissingClient = models.SPVError{Message: "client is missing from model, cannot save", StatusCode: 400, Code: "error-client-missing"}
ErrMissingClient is when client is missing from model, cannot save
var ErrMissingContactCreatorPaymail = models.SPVError{Message: "missing creator paymail in contact", StatusCode: 400, Code: "error-contact-creator-paymail-missing"}
ErrMissingContactCreatorPaymail is when creator paymail is missing in contact
var ErrMissingContactFullName = models.SPVError{Message: "missing full name in contact", StatusCode: 400, Code: "error-contact-full-name-missing"}
ErrMissingContactFullName is when full name is missing in contact
var ErrMissingContactID = models.SPVError{Message: "missing id in contact", StatusCode: 400, Code: "error-contact-id-missing"}
ErrMissingContactID is when id is missing in contact
var ErrMissingContactOwnerXPubID = models.SPVError{Message: "contact must have owner", StatusCode: 400, Code: "error-contact-owner-xpub-id-missing"}
ErrMissingContactOwnerXPubID is when owner XPubID is missing in contact
var ErrMissingContactPaymailParam = models.SPVError{Message: "missing paymail parameter in request", StatusCode: 400, Code: "error-contact-paymail-missing"}
ErrMissingContactPaymailParam is when paymail is missing in contact
var ErrMissingContactStatus = models.SPVError{Message: "status is required", StatusCode: 400, Code: "error-contact-status-missing"}
ErrMissingContactStatus is when status is missing in contact
var ErrMissingContactXPubKey = models.SPVError{Message: "missing pubKey in contact", StatusCode: 400, Code: "error-contact-xpub-missing"}
ErrMissingContactXPubKey is when XPubKey is missing in contact
var ErrMissingFieldID = models.SPVError{Message: "missing required field: id", StatusCode: 400, Code: "error-missing-field-id"}
ErrMissingFieldID is when the id field is required but missing
var ErrMissingFieldSatoshis = models.SPVError{Message: "missing required field: satoshis", StatusCode: 400, Code: "error-missing-field-satoshis"}
ErrMissingFieldSatoshis is when the field satoshis is required but missing
var ErrMissingFieldScriptPubKey = models.SPVError{Message: "missing required field: script_pub_key", StatusCode: 400, Code: "error-missing-field-script-pub-key"}
ErrMissingFieldScriptPubKey is when the field is required but missing
var ErrMissingFieldTransactionID = models.SPVError{Message: "missing required field: transaction_id", StatusCode: 400, Code: "error-missing-field-transaction-id"}
ErrMissingFieldTransactionID is when the field transaction id is required but missing
var ErrMissingFieldXpub = models.SPVError{Message: "missing required field: xpub", StatusCode: 400, Code: "error-missing-field-xpub"}
ErrMissingFieldXpub is when the xpub field is required but missing
var ErrMissingFieldXpubID = models.SPVError{Message: "missing required field: xpub_id", StatusCode: 400, Code: "error-missing-field-xpub-id"}
ErrMissingFieldXpubID is when the xpub_id field is required but missing
var ErrMissingLockingScript = models.SPVError{Message: "missing required field: locking script", StatusCode: 400, Code: "error-missing-field-locking-script"}
ErrMissingLockingScript is when the field locking script is required but missing
var ErrMissingPaymailAddress = models.SPVError{Message: "missing alias in paymail", StatusCode: 400, Code: "error-paymail-address-missing"}
ErrMissingPaymailAddress is when alias is missing in paymail
var ErrMissingPaymailDomain = models.SPVError{Message: "missing domain in paymail", StatusCode: 400, Code: "error-paymail-domain-missing"}
ErrMissingPaymailDomain is when domain is missing in paymail
var ErrMissingPaymailExternalXPub = models.SPVError{Message: "missing external xPub in paymail", StatusCode: 400, Code: "error-paymail-external-xpub-missing"}
ErrMissingPaymailExternalXPub is when external xPub is missing in paymail
var ErrMissingPaymailID = models.SPVError{Message: "missing id in paymail", StatusCode: 400, Code: "error-paymail-id-missing"}
ErrMissingPaymailID is when id is missing in paymail
var ErrMissingPaymailXPubID = models.SPVError{Message: "missing xpub_id in paymail", StatusCode: 400, Code: "error-paymail-xpub-id-missing"}
ErrMissingPaymailXPubID is when xpub_id is missing in paymail
var ErrMissingSignature = models.SPVError{Message: "missing signature", StatusCode: 401, Code: "error-unauthorized-signature-missing"}
ErrMissingSignature is when signature is missing in authorization process
var ErrMissingTransactionOutputs = models.SPVError{Message: "draft transaction configuration has no outputs", StatusCode: 400, Code: "error-transaction-outputs-missing"}
ErrMissingTransactionOutputs is when the draft transaction has no outputs
var ErrMissingTxHex = models.SPVError{Message: "transaction hex is empty or id is missing", StatusCode: 400, Code: "error-transaction-hex-missing"}
ErrMissingTxHex is when the hex is missing or invalid and creates an empty id
var ErrMissingUTXOsSpendable = models.SPVError{Message: "no utxos found using spendable", StatusCode: 404, Code: "error-utxo-spendable-missing"}
ErrMissingUTXOsSpendable is when there are no utxos found from the "spendable utxos"
var ErrMissingXPubID = models.SPVError{Message: "missing xpub_id", StatusCode: 400, Code: "error-missing-xpub-id"}
ErrMissingXPubID is when xpub_id is missing
var ErrMoreThanOnePaymailRegistered = models.SPVError{Message: "there are more than one paymail assigned to the xpub", StatusCode: 400, Code: "error-contact-more-than-one-paymail-registered"}
ErrMoreThanOnePaymailRegistered is when user who want to add contact has more than one paymail address
var ErrNoMatchingOutputs = models.SPVError{Message: "transaction outputs do not match any known destinations", StatusCode: 400, Code: "error-transaction-outputs-no-matching"}
ErrNoMatchingOutputs is when the transaction does not match any known destinations
var ErrNotAnAdminKey = models.SPVError{Message: "xpub provided is not an admin key", StatusCode: 401, Code: "error-unauthorized-xpub-not-an-admin-key"}
ErrNotAnAdminKey is when xpub from auth header is not an admin key
var ErrNotEnoughUtxos = models.SPVError{Message: "could not select enough outputs to satisfy transaction", StatusCode: 400, Code: "error-utxo-not-enough"}
ErrNotEnoughUtxos is when a draft transaction cannot be created because of lack of utxos
var ErrNotificationsDisabled = models.SPVError{Message: "notifications are disabled", StatusCode: 404, Code: "error-notifications-disabled"}
ErrNotificationsDisabled happens when the notifications are not enabled in the config
var ErrOneOfTheFieldsIsRequired = models.SPVError{Message: "missing all of the fields, one of them is required", StatusCode: 400, Code: "error-missing-field-all-required"}
ErrOneOfTheFieldsIsRequired is when all of required fields are missing
var ErrOutputValueNotRecognized = models.SPVError{Message: "output value is unrecognized", StatusCode: 400, Code: "error-transaction-output-value-unrecognized"}
ErrOutputValueNotRecognized is when there is an invalid output value given, or missing value
var ErrOutputValueTooHigh = models.SPVError{Message: "output value is too high", StatusCode: 400, Code: "error-transaction-output-value-too-high"}
ErrOutputValueTooHigh is when the satoshis output is too high on a transaction
var ErrOutputValueTooLow = models.SPVError{Message: "output value is too low", StatusCode: 400, Code: "error-transaction-output-value-too-low"}
ErrOutputValueTooLow is when the satoshis output is too low on a transaction
var ErrParseTransactionFromHex = models.SPVError{Message: "error parsing transaction from hex", StatusCode: 500, Code: "error-transaction-parse-from-hex"}
ErrParseTransactionFromHex is when error occurred during parsing transaction from hex
var ErrPaymailAddressIsInvalid = models.SPVError{Message: "paymail address is invalid", StatusCode: 400, Code: "error-paymail-address-invalid"}
ErrPaymailAddressIsInvalid is when the paymail address is NOT alias@domain.com
var ErrPaymailAlreadyExists = models.SPVError{Message: "paymail already exists", StatusCode: 409, Code: "error-paymail-already-exists"}
ErrPaymailAlreadyExists is when paymail with given data already exists in db
var ErrPaymailInvalidMerkleRoots = models.SPVError{Message: "invalid merkle roots", StatusCode: 400, Code: "error-paymail-invalid-merkle-roots"}
ErrPaymailInvalidMerkleRoots is when merkle roots verification by BHS returns status: INVALID
var ErrPaymailMerkleRootVerificationFailed = models.SPVError{Message: "merkle root verification could not be processed", StatusCode: 400, Code: "error-paymail-merkle-root-verification-failed"}
ErrPaymailMerkleRootVerificationFailed is when merkle root verification could not be processed
var ErrProcessP2PTx = models.SPVError{Message: "error during processing p2p transaction", StatusCode: 500, Code: "error-transaction-process-p2p"}
ErrProcessP2PTx is when error occurred during processing p2p tx
var ErrRejectContact = models.SPVError{Message: "rejecting contact failed", StatusCode: 500, Code: "error-contact-rejecting-contact-failed"}
ErrRejectContact is when rejecting contact failed
var ErrRequestedContactInvalid = models.SPVError{Message: "requested contact paymail is invalid", StatusCode: 400, Code: "error-contact-requested-contact-invalid"}
ErrRequestedContactInvalid is when the requested contact is invalid
var ErrRetrivePaymailInfo = models.SPVError{Message: "error during retrieving paymail info", StatusCode: 500, Code: "error-paymail-retrieve-info"}
ErrRetrivePaymailInfo is when error occurred during retrieving paymail info
var ErrRouteMethodNotAllowed = models.SPVError{Message: "method not allowed", StatusCode: 405, Code: "error-route-method-not-allowed"}
ErrRouteMethodNotAllowed is when route method is not allowed
var ErrRouteNotFound = models.SPVError{Message: "route not found", StatusCode: 404, Code: "error-route-not-found"}
ErrRouteNotFound is when route is not found
var ErrSaveContact = models.SPVError{Message: "adding contact failed", StatusCode: 400, Code: "error-contact-adding-contact-failed"}
ErrSaveContact is when saving new contact failed
var ErrSignatureExpired = models.SPVError{Message: "signature has expired", StatusCode: 401, Code: "error-unauthorized-signature-expired"}
ErrSignatureExpired is when given signature is expired
var ErrTransactionFeeInvalid = models.SPVError{Message: "transaction fee is invalid", StatusCode: 400, Code: "error-utxo-transaction-fee-invalid"}
ErrTransactionFeeInvalid is when the fee on the transaction is not the difference between inputs and outputs
var ErrTransactionIDMismatch = models.SPVError{Message: "result tx id did not match provided tx id", StatusCode: 400, Code: "error-transaction-id-mismatch"}
ErrTransactionIDMismatch is when the returned tx does not match the expected given tx id
var ErrTransactionRejectedByP2PProvider = models.SPVError{Message: "transaction rejected by P2P provider", StatusCode: 400, Code: "error-transaction-rejected"}
ErrTransactionRejectedByP2PProvider is an error when a tx was rejected by P2P Provider
var ErrTxRevertCouldNotFindDraftTx = models.SPVError{Message: "could not find the draft transaction for this transaction, cannot revert", StatusCode: 400, Code: "error-transaction-revert-draft-tx-not-found"}
ErrTxRevertCouldNotFindDraftTx is when draft tx could not be found
var ErrTxRevertEmptyDraftID = models.SPVError{Message: "not a spv wallet engine originating transaction, cannot revert", StatusCode: 400, Code: "error-transaction-revert-draft-id-empty"}
ErrTxRevertEmptyDraftID is when draft id is empty this means that tx is not from spv-wallet
var ErrTxRevertFoundOnChain = models.SPVError{Message: "transaction was found on-chain, cannot revert", StatusCode: 400, Code: "error-transaction-revert-not-found-on-chain"}
ErrTxRevertFoundOnChain is when tx was not found on chain
var ErrTxRevertUtxoAlreadySpent = models.SPVError{Message: "utxo of this transaction has been spent, cannot revert", StatusCode: 400, Code: "error-transaction-revert-utxo-already-spent"}
ErrTxRevertUtxoAlreadySpent is when utxo from tx was already spent
var ErrUnknownLockingScript = models.SPVError{Message: "could not recognize locking script", StatusCode: 400, Code: "error-destination-unknown-locking-script"}
ErrUnknownLockingScript is when the field is unknown
var ErrUnsupportedDestinationType = models.SPVError{Message: "unsupported destination type", StatusCode: 400, Code: "error-destination-unsupported-type"}
ErrUnsupportedDestinationType is a destination type that is not currently supported
var ErrUnsupportedTypeForConversion = models.SPVError{Message: "unsupported type for conversion", StatusCode: 500, Code: "error-unsupported-type-for-conversion"}
ErrUnsupportedTypeForConversion is when unsupported type for conversion
var ErrUpdateContact = models.SPVError{Message: "updating contact failed", StatusCode: 500, Code: "error-contact-updating-contact-failed"}
ErrUpdateContact is when updating contact failed
var ErrUtxoAlreadySpent = models.SPVError{Message: "utxo has already been spent", StatusCode: 400, Code: "error-utxo-already-spent"}
ErrUtxoAlreadySpent is when the utxo is already spent, but is trying to be used
var ErrUtxoNotReserved = models.SPVError{Message: "transaction utxo has not been reserved for spending", StatusCode: 400, Code: "error-utxo-not-reserved"}
ErrUtxoNotReserved is when the utxo is not reserved, but a transaction tries to spend it
var ErrValidateXPub = models.SPVError{Message: "error validation xpub", StatusCode: 401, Code: "error-unauthorized-xpub-invalid"}
ErrValidateXPub is when validation xpub
var ErrWebhookGetAll = models.SPVError{Message: "cannot get all the stored webhooks", StatusCode: 500, Code: "error-webhook-get-all"}
ErrWebhookGetAll is when cannot get all the stored webhooks
var ErrWebhookSubscriptionFailed = models.SPVError{Message: "webhook subscription failed", StatusCode: 500, Code: "error-webhook-subscription-failed"}
ErrWebhookSubscriptionFailed is when webhook subscription failed
var ErrWebhookSubscriptionNotFound = models.SPVError{Message: "webhook subscription not found", StatusCode: 404, Code: "error-webhook-subscription-not-found"}
ErrWebhookSubscriptionNotFound is when cannot find webhook to unsubscribe
var ErrWebhookUnsubscriptionFailed = models.SPVError{Message: "webhook unsubscription failed", StatusCode: 500, Code: "error-webhook-unsubscription-failed"}
ErrWebhookUnsubscriptionFailed is when webhook unsubscription failed
var ErrXPubAlreadyExists = models.SPVError{Message: "xpub already exists", StatusCode: 409, Code: "error-xpub-already-exists"}
ErrXPubAlreadyExists is when xpub already exists
var ErrXPubAuthRequired = models.SPVError{Message: "xpub authorization required", StatusCode: 401, Code: "error-xpub-authorization-required"}
ErrXPubAuthRequired is when xpub authorization is required
var ErrXpubIDMisMatch = models.SPVError{Message: "xpub_id mismatch", StatusCode: 400, Code: "error-xpub-id-mismatch"}
ErrXpubIDMisMatch is when the xPubID does not match
var ErrXpubInvalidLength = models.SPVError{Message: "xpub is an invalid length", StatusCode: 400, Code: "error-xpub-length-invalid"}
ErrXpubInvalidLength is when the length of the xpub does not match the desired length
var ErrXpubNoMatch = models.SPVError{Message: "xpub key does not match raw key", StatusCode: 400, Code: "error-xpub-key-no-match"}
ErrXpubNoMatch is when the derived xpub key does not match the key given
Functions ¶
func AbortWithErrorResponse ¶
AbortWithErrorResponse is searching for error and abort with error set
func ErrorResponse ¶
ErrorResponse is searching for error and setting it up in gin context
func UnfoldError ¶
UnfoldError unfolds the error chain into a single string example:
[errType1] outer error message -> [errType2] inner error message -> [errTypeN] innermost error message
if error is a joined error, it will be unfolded as:
[type] ([errType1] joined error1 AND [errType2] joined error2)
for SPVError, it will print the status code in parentheses:
[models.SPVError(404)] error message
Types ¶
This section is empty.