-
Notifications
You must be signed in to change notification settings - Fork 3
/
btcpay_types.go
352 lines (305 loc) · 14.4 KB
/
btcpay_types.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
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
package btcpay
import "net/http"
type APIKey string
type Client struct {
URL string
APIKey APIKey
Username string
Password string
Http *http.Client
Store *Store
Invoice *Invoice
PaymentRequest *PaymentRequest
Notification *Notification
PullPayment *PullPayment
Payout *Payout
}
type APIKeyRequest struct {
Label string `json:"label,omitempty"`
Permissions []BTCPayPermission `json:"permissions,omitempty"`
}
type APIKeyResponse struct {
APIKey APIKey `json:"apiKey"`
Label string `json:"label"`
Permissions []BTCPayPermission `json:"permissions"`
}
type AuthorizationRequest struct {
Permissions []BTCPayPermission `json:"permissions,omitempty"`
ApplicationName string `json:"applicationName,omitempty"`
Strict bool `json:"strict,omitempty"`
SelectiveStores bool `json:"selectiveStores,omitempty"`
Redirect string `json:"redirect,omitempty"`
ApplicationIdentifier string `json:"applicationIdentifier,omitempty"`
}
type HealthResponse struct {
Synchronized bool `json:"synchronized"`
}
type InvoiceID string
type Invoice struct {
Store *Store
Client *Client
ID InvoiceID
}
type InvoiceResponse struct {
Amount string `json:"amount,omitempty"`
Currency string `json:"currency,omitempty"`
Metadata InvoiceMetadata `json:"metadata,omitempty"`
Checkout InvoiceCheckout `json:"checkout,omitempty"`
ID InvoiceID `json:"id"`
CheckoutLink string `json:"checkoutLink"`
CreatedTime int64 `json:"createdTime"`
ExpirationTime int64 `json:"expirationTime"`
MonitoringTime int64 `json:"monitoringTime"`
Status BTCPayInvoiceStatus `json:"status"`
AdditionalStatus BTCPayInvoiceAdditionalStatus `json:"additionalStatus"`
}
type InvoiceMetadata map[string]interface{}
type InvoiceCheckout struct {
SpeedPolicy BTCPaySpeedPolicy `json:"speedPolicy,omitempty"`
PaymentMethods []string `json:"paymentMethods,omitempty"`
ExpirationMinutes int `json:"expirationMinutes,omitempty"`
MonitoringMinutes int `json:"monitoringMinutes,omitempty"`
PaymentTolerance float64 `json:"paymentTolerance,omitempty"`
RedirectURL string `json:"redirectURL,omitempty"`
DefaultLanguage string `json:"defaultLanguage,omitempty"`
}
type InvoiceRequest struct {
Amount string `json:"amount"`
Currency string `json:"currency,omitempty"`
Metadata InvoiceMetadata `json:"metadata,omitempty"`
InvoiceCheckout InvoiceCheckout `json:"checkout,omitempty"`
}
type InvoiceUpdate struct {
Metadata InvoiceMetadata `json:"metadata,omitempty"`
}
type PaymentID string
type Payment struct {
ID PaymentID `json:"id"`
ReceivedDate int64 `json:"receivedDate"`
Value string `json:"value"`
Fee string `json:"fee"`
Status BTCPayPaymentStatus `json:"status"`
Destination string `json:"destination"`
}
type InvoicePaymentMethodResponse struct {
PaymentMethod string `json:"paymentMethod"`
Destination string `json:"destination"`
PaymentLink string `json:"paymentLink,omitempty"`
Rate string `json:"rate"`
PaymentMethodPaid string `json:"paymentMethodPaid"`
TotalPaid string `json:"totalPaid"`
Due string `json:"due"`
Amount string `json:"amount"`
NetworkFee string `json:"networkFee"`
Payments []Payment `json:"payments"`
}
type MarkInvoiceStatusRequest struct {
Status BTCPayInvoiceStatusMark `json:"status"`
}
type LanguageCodesRespose struct {
Code string `json:"code"`
CurrentLanguage string `json:"currentLanguage"`
}
type InvoiceCheckoutPage struct {
Page []byte
}
type Notification struct {
ID NotificationID
Client *Client
}
type NotificationID string
type NotificationResponse struct {
ID NotificationID `json:"id"`
Body string `json:"body"`
Link string `json:"link"`
CreatedTime int64 `json:"createdTime"`
Seen bool `json:"seen"`
}
type UpdateNotification struct {
Seen bool `json:"seen"`
}
type PaymentRequestID string
type PaymentRequest struct {
Store *Store
Client *Client
ID PaymentRequestID
}
type PaymentRequestRequest struct {
Amount float64 `json:"amount"`
Title string `json:"title"`
Currency string `json:"currency"`
Email string `json:"email,omitempty"`
Description string `json:"description,omitempty"`
ExpiryDate int64 `json:"expiryDate,omitempty"`
EmbeddedCSS string `json:"embeddedCSS,omitempty"`
CustomCSSLink string `json:"customCSSLink,omitempty"`
AllowCustomPaymentAmounts bool `json:"allowCustomPaymentAmounts,omitempty"`
}
type PaymentRequestResponse struct {
ID PaymentRequestID `json:"id"`
Status BTCPayPaymentRequestStatus `json:"status"`
Created string `json:"created"`
Archived bool `json:"archived"`
PaymentRequestRequest
}
type PullPaymentID string
type PullPayment struct {
Store *Store
Client *Client
ID PullPaymentID
}
type PullPaymentResponse struct {
ID PullPaymentID `json:"id"`
Name string `json:"name"`
Currency string `json:"currency"`
Amount string `json:"amount"`
Period int64 `json:"period,omitempty"`
Archived bool `json:"archived"`
ViewLink string `json:"viewLink"`
}
type PayoutID string
type Payout struct {
Store *Store
Client *Client
ID PayoutID
}
type PullPaymentRequest struct {
Name string `json:"name,omitempty"`
Amount string `json:"amount"`
Currency string `json:"currency"`
Period int64 `json:"period,omitempty"`
StartsAt int64 `json:"startsAt,omitempty"`
ExpiresAt int64 `json:"expiresAt,omitempty"`
PaymentMethods []string `json:"paymentMethods"`
}
type PayoutResponse struct {
ID PayoutID `json:"id"`
Revision int64 `json:"revision"`
PullPaymentID PullPaymentID `json:"pullPaymentId"`
Date string `json:"date"`
Destination string `json:"destination"`
Amount string `json:"amount"`
PaymentMethod string `json:"paymentMethod"`
PaymentMethodAmount string `json:"paymentMethodAmount"`
State BTCPayPayoutStatus `json:"state"`
}
type PayoutApproveRequest struct {
Revision int64 `json:"revision"`
RateRule string `json:"rateRule,omitempty"`
}
type PayoutRequest struct {
Destination string `json:"destination"`
Amount string `json:"amount"`
PaymentMethod string `json:"paymentMethod"`
}
type ServerInfoResponse struct {
Version string `json:"version"`
Onion string `json:"onion"`
SupportedPaymentMethods []string `json:"supportedPaymentMethods"`
FullySynched bool `json:"fullySynched"`
SyncStatus []ServerSyncStatus `json:"syncStatus"`
}
type ServerSyncStatus struct {
CryptoCode string `json:"cryptoCode"`
NodeInformation ServerNodeInformation `json:"nodeInformation,omitempty"`
ChainHeight int64 `json:"chainHeight"`
SyncHeight int64 `json:"syncHeight,omitempty"`
}
type ServerNodeInformation struct {
Headers int64 `json:"headers"`
Blocks int64 `json:"blocks"`
VerificationProgress float64 `json:"verificationProgress"`
}
type StoreID string
type Store struct {
ID StoreID
Client *Client
}
type StoreResponse struct {
Name string `json:"name"`
Website string `json:"website"`
InvoiceExpiration int64 `json:"invoiceExpiration"`
MonitoringExpiration int64 `json:"monitoringExpiration"`
SpeedPolicy BTCPaySpeedPolicy `json:"speedPolicy"`
LightningDescriptionTemplate string `json:"lightningDescriptionTemplate,omitempty"`
PaymentTolerance float64 `json:"paymentTolerance"`
AnyoneCanCreateInvoice bool `json:"anyoneCanCreateInvoice"`
RequiresRefundEmail bool `json:"requiresRefundEmail"`
LightningAmountInSatoshi bool `json:"lightningAmountInSatoshi"`
LightningPrivateRouteHints bool `json:"lightningPrivateRouteHints"`
OnChainWithLnInvoiceFallback bool `json:"onChainWithLnInvoiceFallback"`
RedirectAutomatically bool `json:"redirectAutomatically"`
ShowRecommendedFee bool `json:"showRecommendedFee"`
RecommendedFeeBlockTarget int32 `json:"recommendedFeeBlockTarget"`
DefaultLang string `json:"defaultLang"`
CustomLogo string `json:"customLogo,omitempty"`
CustomCSS string `json:"customCSS,omitempty"`
HtmlTitle string `json:"htmlTitle,omitempty"`
NetworkFeeMode BTCPayNetworkFeeMode `json:"networkFeeMode"`
PayJoinEnabled bool `json:"payJoinEnabled"`
DefaultPaymentMethod string `json:"defaultPaymentMethod"`
ID StoreID `json:"id"`
}
type StoreRequest struct {
Name string `json:"name"`
Website string `json:"website,omitempty"`
InvoiceExpiration int64 `json:"invoiceExpiration,omitempty"`
MonitoringExpiration int64 `json:"monitoringExpiration,omitempty"`
SpeedPolicy BTCPaySpeedPolicy `json:"speedPolicy,omitempty"`
LightningDescriptionTemplate string `json:"lightningDescriptionTemplate,omitempty"`
PaymentTolerance float64 `json:"paymentTolerance,omitempty"`
AnyoneCanCreateInvoice bool `json:"anyoneCanCreateInvoice,omitempty"`
RequiresRefundEmail bool `json:"requiresRefundEmail,omitempty"`
LightningAmountInSatoshi bool `json:"lightningAmountInSatoshi,omitempty"`
LightningPrivateRouteHints bool `json:"lightningPrivateRouteHints,omitempty"`
OnChainWithLnInvoiceFallback bool `json:"onChainWithLnInvoiceFallback,omitempty"`
RedirectAutomatically bool `json:"redirectAutomatically,omitempty"`
ShowRecommendedFee bool `json:"showRecommendedFee,omitempty"`
RecommendedFeeBlockTarget int32 `json:"recommendedFeeBlockTarget,omitempty"`
DefaultLang string `json:"defaultLang,omitempty"`
CustomLogo string `json:"customLogo,omitempty"`
CustomCSS string `json:"customCSS,omitempty"`
HtmlTitle string `json:"htmlTitle,omitempty"`
NetworkFeeMode BTCPayNetworkFeeMode `json:"networkFeeMode,omitempty"`
PayJoinEnabled bool `json:"payJoinEnabled,omitempty"`
DefaultPaymentMethod string `json:"defaultPaymentMethod,omitempty"`
}
type StoreUpdate struct {
Name string `json:"name,omitempty"`
Website string `json:"website,omitempty"`
InvoiceExpiration int64 `json:"invoiceExpiration,omitempty"`
MonitoringExpiration int64 `json:"monitoringExpiration,omitempty"`
SpeedPolicy BTCPaySpeedPolicy `json:"speedPolicy,omitempty"`
LightningDescriptionTemplate string `json:"lightningDescriptionTemplate,omitempty"`
PaymentTolerance float64 `json:"paymentTolerance,omitempty"`
AnyoneCanCreateInvoice bool `json:"anyoneCanCreateInvoice,omitempty"`
RequiresRefundEmail bool `json:"requiresRefundEmail,omitempty"`
LightningAmountInSatoshi bool `json:"lightningAmountInSatoshi,omitempty"`
LightningPrivateRouteHints bool `json:"lightningPrivateRouteHints,omitempty"`
OnChainWithLnInvoiceFallback bool `json:"onChainWithLnInvoiceFallback,omitempty"`
RedirectAutomatically bool `json:"redirectAutomatically,omitempty"`
ShowRecommendedFee bool `json:"showRecommendedFee,omitempty"`
RecommendedFeeBlockTarget int32 `json:"recommendedFeeBlockTarget,omitempty"`
DefaultLang string `json:"defaultLang,omitempty"`
CustomLogo string `json:"customLogo,omitempty"`
CustomCSS string `json:"customCSS,omitempty"`
HtmlTitle string `json:"htmlTitle,omitempty"`
NetworkFeeMode BTCPayNetworkFeeMode `json:"networkFeeMode,omitempty"`
PayJoinEnabled bool `json:"payJoinEnabled,omitempty"`
DefaultPaymentMethod string `json:"defaultPaymentMethod,omitempty"`
ID StoreID `json:"id,omitempty"`
}
type UserID string
type UserResponse struct {
ID UserID `json:"id"`
Email string `json:"email"`
EmailConfirmed bool `json:"emailConfirmed"`
RequiresEmailConfirmation bool `json:"requiresEmailConfirmation"`
Created int64 `json:"created,omitempty"`
Roles []string `json:"roles"`
}
type UserRequest struct {
Email string `json:"email"`
Password string `json:"password"`
IsAdministrator bool `json:"isAdministrator"`
}