This repository has been archived by the owner on Apr 2, 2024. It is now read-only.
generated from mrz1836/go-template
-
-
Notifications
You must be signed in to change notification settings - Fork 6
/
errors.go
194 lines (130 loc) · 9.11 KB
/
errors.go
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
package bux
import (
"errors"
)
// ErrCannotConvertToIDs is the error when the conversion fails from interface into type IDs
var ErrCannotConvertToIDs = errors.New("cannot convert value to type IDs")
// ErrMissingDestination is an error when a destination could not be found
var ErrMissingDestination = errors.New("destination could not be found")
// ErrMissingTransaction is an error when a transaction could not be found
var ErrMissingTransaction = errors.New("transaction could not be found")
// ErrMissingUtxo is an error when a given utxo could not be found
var ErrMissingUtxo = errors.New("utxo could not be found")
// ErrMissingFieldID is an error when missing the id field
var ErrMissingFieldID = errors.New("missing required field: id")
// ErrMissingFieldHex is an error when missing the hex field of a transaction
var ErrMissingFieldHex = errors.New("missing required field: hex")
// ErrMissingFieldHash is an error when missing the hex field of a transaction
var ErrMissingFieldHash = errors.New("missing required field: hash")
// ErrMissingFieldScriptPubKey is when the field is required but missing
var ErrMissingFieldScriptPubKey = errors.New("missing required field: script_pub_key")
// ErrMissingFieldSatoshis is when the field is required but missing
var ErrMissingFieldSatoshis = errors.New("missing required field: satoshis")
// ErrMissingFieldTransactionID is when the field is required but missing
var ErrMissingFieldTransactionID = errors.New("missing required field: transaction_id")
// ErrMissingFieldXpubID is when the field is required but missing
var ErrMissingFieldXpubID = errors.New("missing required field: xpub_id")
// ErrXpubIDMisMatch is when the xPubID does not match
var ErrXpubIDMisMatch = errors.New("xpub_id mismatch")
// ErrMissingXpub is when the field is required but missing
var ErrMissingXpub = errors.New("could not find xpub")
// ErrMissingLockingScript is when the field is required but missing
var ErrMissingLockingScript = errors.New("could not find locking script")
// ErrUnknownLockingScript is when the field is unknown
var ErrUnknownLockingScript = errors.New("could not recognize locking script")
// ErrMissingRequiredXpub is when the xpub should exist but was not found
var ErrMissingRequiredXpub = errors.New("xpub was not found but was expected")
// ErrDatastoreRequired is when a datastore function is called without a datastore present
var ErrDatastoreRequired = errors.New("datastore is required")
// ErrMissingTransactionOutputs is when the draft transaction has not outputs
var ErrMissingTransactionOutputs = errors.New("draft transaction configuration has no outputs")
// ErrNotEnoughUtxos is when a draft transaction cannot be created because of lack of utxos
var ErrNotEnoughUtxos = errors.New("could not select enough outputs to satisfy transaction")
// ErrInvalidLockingScript is when a locking script cannot be decoded
var ErrInvalidLockingScript = errors.New("invalid locking script")
// ErrInvalidOpReturnOutput is when a locking script is not a valid op_return
var ErrInvalidOpReturnOutput = errors.New("invalid op_return output")
// ErrInvalidScriptOutput is when a locking script is not a valid bitcoin script
var ErrInvalidScriptOutput = errors.New("invalid script output")
// ErrInvalidTransactionID is when a transaction id cannot be decoded
var ErrInvalidTransactionID = errors.New("invalid transaction id")
// ErrOutputValueNotRecognized is when there is an invalid output value given, or missing value
var ErrOutputValueNotRecognized = errors.New("output value is unrecognized")
// ErrOutputValueTooLow is when the satoshis output is too low on a transaction
var ErrOutputValueTooLow = errors.New("output value is too low")
// ErrOutputValueTooHigh is when the satoshis output is too high on a transaction
var ErrOutputValueTooHigh = errors.New("output value is too high")
// ErrTransactionFeeInvalid is when the fee on the transaction is not the difference between inputs and outputs
var ErrTransactionFeeInvalid = errors.New("transaction fee is invalid")
// ErrMissingUTXOsSpendable is when there are no utxos found from the "spendable utxos"
var ErrMissingUTXOsSpendable = errors.New("no utxos found using spendable")
// ErrDuplicateUTXOs is when a transaction is created using the same utxo more than once
var ErrDuplicateUTXOs = errors.New("duplicate utxos found")
// ErrPaymailAddressIsInvalid is when the paymail address is NOT alias@domain.com
var ErrPaymailAddressIsInvalid = errors.New("paymail address is invalid")
// ErrUtxoNotReserved is when the utxo is not reserved, but a transaction tries to spend it
var ErrUtxoNotReserved = errors.New("transaction utxo has not been reserved for spending")
// ErrDraftIDMismatch is when the reference ID does not match the reservation id
var ErrDraftIDMismatch = errors.New("transaction draft id does not match utxo draft reservation id")
// ErrMissingTxHex is when the hex is missing or invalid and creates an empty id
var ErrMissingTxHex = errors.New("transaction hex is empty or id is missing")
// ErrMissingBlockHeaderHash is when the hash is missing or invalid and creates an empty id
var ErrMissingBlockHeaderHash = errors.New("block header hash is empty or id is missing")
// ErrUtxoAlreadySpent is when the utxo is already spent, but is trying to be used
var ErrUtxoAlreadySpent = errors.New("utxo has already been spent")
// ErrDraftNotFound is when the requested draft transaction was not found
var ErrDraftNotFound = errors.New("corresponding draft transaction not found")
// ErrTaskManagerNotLoaded is when the taskmanager was not loaded
var ErrTaskManagerNotLoaded = errors.New("taskmanager must be loaded")
// ErrTransactionNotParsed is when the transaction is not parsed but was expected
var ErrTransactionNotParsed = errors.New("transaction is not parsed")
// ErrNoMatchingOutputs is when the transaction does not match any known destinations
var ErrNoMatchingOutputs = errors.New("transaction outputs do not match any known destinations")
// ErrResolutionFailed is when the paymail resolution failed unexpectedly
var ErrResolutionFailed = errors.New("failed to return a resolution for paymail address")
// ErrMissingAddressResolutionURL is when the paymail resolution url is missing from capabilities
var ErrMissingAddressResolutionURL = errors.New("missing address resolution url from capabilities")
// ErrChangeStrategyNotImplemented is a temporary error until the feature is supported
var ErrChangeStrategyNotImplemented = errors.New("change strategy nominations not implemented yet")
// ErrUnsupportedDestinationType is a destination type that is not currently supported
var ErrUnsupportedDestinationType = errors.New("unsupported destination type")
// ErrMissingAuthHeader is when the authentication header is missing from the request
var ErrMissingAuthHeader = errors.New("missing authentication header")
// ErrMissingSignature is when the signature is missing from the request
var ErrMissingSignature = errors.New("signature missing")
// ErrAuhHashMismatch is when the auth hash does not match the body hash
var ErrAuhHashMismatch = errors.New("auth hash and body hash do not match")
// ErrAuthAccessKeyNotFound is when the auth access key could not be found in the database
var ErrAuthAccessKeyNotFound = errors.New("auth access key could not be found")
// ErrSignatureExpired is when the signature TTL expired
var ErrSignatureExpired = errors.New("signature has expired")
// ErrNotAdminKey is when the xpub being used is not considered an admin key
var ErrNotAdminKey = errors.New("xpub provided is not an admin key")
// ErrMissingXPriv is when the xPriv is missing
var ErrMissingXPriv = errors.New("missing xPriv key")
// ErrMissingAccessKey is when the access key is missing
var ErrMissingAccessKey = errors.New("missing access key")
// ErrMissingBody is when the body is missing
var ErrMissingBody = errors.New("missing body")
// ErrSignatureInvalid is when the signature failed to be valid
var ErrSignatureInvalid = errors.New("signature invalid")
// ErrUnknownAccessKey is when the access key is unknown or not found
var ErrUnknownAccessKey = errors.New("unknown access key")
// ErrAccessKeyRevoked is when the access key has been revoked
var ErrAccessKeyRevoked = errors.New("access key has been revoked")
// ErrMissingPaymail missing paymail
var ErrMissingPaymail = errors.New("missing paymail")
// ErrMissingPaymailID missing id in paymail
var ErrMissingPaymailID = errors.New("missing id in paymail")
// ErrMissingPaymailAddress missing alias in paymail
var ErrMissingPaymailAddress = errors.New("missing alias in paymail")
// ErrMissingPaymailDomain missing domain in paymail
var ErrMissingPaymailDomain = errors.New("missing domain in paymail")
// ErrMissingPaymailExternalXPub missing external xPub in paymail
var ErrMissingPaymailExternalXPub = errors.New("missing external xPub in paymail")
// ErrMissingPaymailIdentityXPub missing identity xPub in paymail
// var ErrMissingPaymailIdentityXPub = errors.New("missing identity xPub in paymail")
// ErrMissingPaymailXPubID missing xpub_id in paymail
var ErrMissingPaymailXPubID = errors.New("missing xpub_id in paymail")
// ErrMissingClient missing client from model
var ErrMissingClient = errors.New("client is missing from model, cannot save")