-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathmodels.go
232 lines (205 loc) · 8.46 KB
/
models.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
package bitvora
type WithdrawRequest struct {
Amount float64 `json:"amount"`
Currency string `json:"currency"`
Destination string `json:"destination"`
Metadata map[string]string `json:"metadata"`
}
type WithdrawResponse struct {
Status int `json:"status"`
Message string `json:"message"`
Data WithdrawData `json:"data"`
}
type WithdrawData struct {
ID string `json:"id"`
AmountSats uint64 `json:"amount_sats"`
Recipient string `json:"recipient"`
FeeSats float64 `json:"fee_sats"`
NetworkType string `json:"network_type"`
RailType string `json:"rail_type"`
Status string `json:"status"`
LightningPayment *LNDTrackPaymentResponse `json:"lightning_payment,omitempty"`
ChainTxID *string `json:"chain_tx_id,omitempty"`
Metadata *map[string]string `json:"metadata,omitempty"`
CreatedAt string `json:"created_at"`
}
type LNDTrackPaymentResponse struct {
PaymentHash string `json:"payment_hash"`
Value string `json:"value"`
CreationDate string `json:"creation_date"`
Fee string `json:"fee"`
PaymentPreimage string `json:"payment_preimage"`
ValueSat string `json:"value_sat"`
ValueMsat string `json:"value_msat"`
PaymentRequest string `json:"payment_request"`
Status string `json:"status"`
FeeSat string `json:"fee_sat"`
FeeMsat string `json:"fee_msat"`
CreationTimeNS string `json:"creation_time_ns"`
HTLCs []LNDHTLCAttempt `json:"htlcs"`
PaymentIndex string `json:"payment_index"`
FailureReason string `json:"failure_reason"`
}
type LNDHTLCAttempt struct {
AttemptID string `json:"attempt_id"`
Status string `json:"status"`
Route LNDPaymentRoute `json:"route"`
AttemptTimeNS string `json:"attempt_time_ns"`
ResolveTimeNS string `json:"resolve_time_ns"`
Failure LNDPaymentFailure `json:"failure"`
Preimage string `json:"preimage"`
}
type LNDPaymentRoute struct {
TotalTimeLock int `json:"total_time_lock"`
TotalFees string `json:"total_fees"`
TotalFeesMsat string `json:"total_fees_msat"`
TotalAmt string `json:"total_amt"`
Hops []LNDHop `json:"hops"`
}
type LNDHop struct {
ChanID string `json:"chan_id"`
ChanCapacity string `json:"chan_capacity"`
AmtToForward string `json:"amt_to_forward"`
Expiry int `json:"expiry"`
}
type LNDPaymentFailure struct {
Code string `json:"code"`
ChannelUpdate LNDChannelUpdate `json:"channel_update"`
HTLCMsat string `json:"htlc_msat"`
OnionSHA256 string `json:"onion_sha_256"`
CLTVExpiry int `json:"cltv_expiry"`
Flags int `json:"flags"`
FailureSourceIndex int `json:"failure_source_index"`
Height int `json:"height"`
}
type LNDChannelUpdate struct {
Signature string `json:"signature"`
ChainHash string `json:"chain_hash"`
ChanID string `json:"chan_id"`
Timestamp int `json:"timestamp"`
MessageFlags int `json:"message_flags"`
ChannelFlags int `json:"channel_flags"`
TimeLockDelta int `json:"time_lock_delta"`
HTLCMinimumMsat string `json:"htlc_minimum_msat"`
BaseFee int `json:"base_fee"`
FeeRate int `json:"fee_rate"`
HTLCMaximumMsat string `json:"htlc_maximum_msat"`
ExtraOpaqueData string `json:"extra_opaque_data"`
}
type EstimateWithdrawalRequest struct {
Amount float64 `json:"amount"`
Currency string `json:"currency"`
Destination string `json:"destination"`
}
type EstimateWithdrawalResponse struct {
Status int `json:"status"`
Message string `json:"message"`
Data EstimateWithdrawalData `json:"data"`
}
type EstimateWithdrawalData struct {
Recipient string `json:"recipient"`
RecipientType string `json:"recipient_type"`
AmountSats uint64 `json:"amount_sats"`
BitvoraFeeSats float64 `json:"bitvora_fee_sats"`
SuccessProbability float64 `json:"success_probability"`
}
type CreateLightningInvoiceRequest struct {
Amount float64 `json:"amount"`
Currency string `json:"currency"`
Description string `json:"description"`
ExpirySeconds uint64 `json:"expiry_seconds"`
Metadata map[string]string `json:"metadata,omitempty"`
}
type CreateLightningInvoiceResponse struct {
Status int `json:"status"`
Message string `json:"message"`
Data CreateLightningInvoiceData `json:"data"`
}
type CreateLightningInvoiceData struct {
ID string `json:"id"`
NodeID string `json:"node_id"`
Memo string `json:"memo"`
RPreimage string `json:"r_preimage"`
RHash string `json:"r_hash"`
AmountSats uint64 `json:"amount_sats"`
Settled bool `json:"settled"`
PaymentRequest string `json:"payment_request"`
Metadata map[string]string `json:"metadata,omitempty"`
}
type CreateLightningAddressRequest struct {
Handle string `json:"handle"`
Domain string `json:"domain"`
Metadata map[string]string `json:"metadata,omitempty"`
}
type CreateLightningAddressResponse struct {
Status int `json:"status"`
Message string `json:"message"`
Data CreateLightningAddressData `json:"data"`
}
type CreateLightningAddressData struct {
ID string `json:"id"`
Handle string `json:"handle"`
Domain string `json:"domain"`
Address string `json:"address"`
Metadata map[string]string `json:"metadata,omitempty"`
CreatedAt string `json:"created_at"`
LastUsedAt *string `json:"last_used_at,omitempty"`
DeletedAt *string `json:"deleted_at,omitempty"`
}
type CreateOnChainAddressRequest struct {
Metadata map[string]string `json:"metadata,omitempty"`
}
type CreateOnChainAddressResponse struct {
Status int `json:"status"`
Message string `json:"message"`
Data CreateOnChainAddressData `json:"data"`
}
type CreateOnChainAddressData struct {
ID string `json:"id"`
Address string `json:"address"`
Metadata map[string]string `json:"metadata,omitempty"`
CreatedAt string `json:"created_at"`
}
type GetBalanceResponse struct {
Status int `json:"status"`
Message string `json:"message"`
Data GetBalanceData `json:"data"`
}
type GetBalanceData struct {
Balance uint32 `json:"balance"`
}
type GetTransactionsResponse struct {
Status int `json:"status"`
Message string `json:"message"`
Data []Transaction `json:"data"`
}
type Transaction struct {
ID string `json:"id"`
CompanyID string `json:"company_id"`
AmountSats uint64 `json:"amount_sats"`
Recipient string `json:"recipient"`
RailType string `json:"rail_type"`
Type string `json:"type"`
FeeMicrosats uint64 `json:"fee_microsats"`
Status string `json:"status"`
CreatedAt string `json:"created_at"`
}
type GetDepositResponse struct {
Status int `json:"status"`
Message string `json:"message"`
Data GetDepositData `json:"data"`
}
type GetDepositData struct {
ID string `json:"id"`
LedgerTxID string `json:"ledger_tx_id"`
Recipient string `json:"recipient"`
AmountSats uint64 `json:"amount_sats"`
FeeSats float64 `json:"fee_sats"`
ChainTxID *string `json:"chain_tx_id,omitempty"`
RailType string `json:"rail_type"`
NetworkType string `json:"network_type"`
Status string `json:"status"`
Metadata *map[string]string `json:"metadata,omitempty"`
LightningInvoiceID *string `json:"lightning_invoice_id,omitempty"`
CreatedAt string `json:"created_at"`
}