Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
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 ErrAuthorization = models.SPVError{Message: "unauthorized", StatusCode: 401, Code: "error-unauthorized"}
ErrAuthorization is basic auth error
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 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 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 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 ErrCouldNotFindSyncTx = models.SPVError{Message: "sync tx not found", StatusCode: 404, Code: "error-transaction-sync-tx-not-found"}
ErrCouldNotFindSyncTx is an error when a given utxo 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 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 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 ErrGetCapabilities = models.SPVError{Message: "failed to get paymail capabilities", StatusCode: 400, Code: "error-capabilities-failed-to-get"}
ErrGetCapabilities is when getting capabilities 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 ErrGettingAddressFromPublicKey = models.SPVError{Message: "error getting address from public key", StatusCode: 401, Code: "error-unauthorized-address-failed-to-get-from-public-key"}
ErrGettingAddressFromPublicKey is when error occurred during getting address from public key
var ErrGettingHdKeyFromXpub = models.SPVError{Message: "error getting hd key from xpub", StatusCode: 401, Code: "error-unauthorized-xpub-failed-to-get-from-hd-key"}
ErrGettingHdKeyFromXpub is when error occurred during getting hd key from xpub
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 ErrHashesDoNotMatch = models.SPVError{Message: "auth hash and body hash do not match", StatusCode: 401, Code: "error-unauthorized-hashes-do-not-match"}
ErrHashesDoNotMatch is when two hashes do not match
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 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 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 ErrMissingBody = models.SPVError{Message: "missing body", StatusCode: 401, Code: "error-unauthorized-body-missing"}
ErrMissingBody is when request is missing body
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 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 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 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 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 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 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 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 ErrTxRevertNotFoundOnChain = models.SPVError{Message: "transaction was found on-chain, cannot revert", StatusCode: 400, Code: "error-transaction-revert-not-found-on-chain"}
ErrTxRevertNotFoundOnChain 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 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 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 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
Types ¶
This section is empty.