forked from synonymdev/lsp-server-old
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathswagger.yaml
311 lines (309 loc) · 7.83 KB
/
swagger.yaml
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
swagger: "2.0"
info:
description: "Blocktank is a Lightning Network service provider (LSP)"
version: "1.0.0"
title: "Blocktank"
# termsOfService: ""
# contact:
# email: ""
host: "blocktank.synonym.to"
basePath: "/api/v1"
tags:
- name: "Channels"
description: "All endpoints related to buying lightning channels"
- name: LNURL
description: "LNURL endpoitns"
schemes:
- "https"
x-readme:
explorer-enabled: true
samples-enabled: true
samples-languages:
- curl
paths:
/node/info:
get:
tags:
- "Channels"
summary: "Service Info"
description: "Returns information about Blocktank Lightning node and services on offer."
operationId: "nodeInfo"
consumes:
- "application/json"
produces:
- "application/json"
responses:
"200":
description: "Node and service info"
/channel/buy:
post:
tags:
- "Channels"
summary: "Request a channel to purchase."
description: "Request a channel to purchase."
operationId: "buyChannel"
produces:
- "application/json"
parameters:
- in: body
name: Channel request
description: Channel to purchase.
schema:
type: object
required:
- product_id
- remote_balance
- local_balance
- channel_expiry
properties:
product_id:
type: string
remote_balance:
type: number
default: 1000000
local_balance:
type: number
default: 2000000
channel_expiry:
type: number
default: 1
responses:
"200":
description: "Channel quote"
schema:
$ref: "#/definitions/ChannelQuote"
/channel/manual_finalise:
post:
tags:
- "Channels"
summary: "Finalise a purchased channel"
description: "Set the node that Blocktank will open a channel to after paying for your channel."
operationId: "finaliseChannel"
produces:
- "application/json"
parameters:
- in: body
name: Channel request
description: Channel to purchase.
schema:
type: object
required:
- product_id
- order_id
- node_uri
- private
properties:
product_id:
type: string
order_id:
type: string
node_uri:
type: string
private:
type: boolean
responses:
"200":
description: "Channel claimed"
/channel/order:
get:
tags:
- "Channels"
summary: "Get an order"
description: "Get all information regarding a channel order"
operationId: "getOrder"
produces:
- "application/json"
parameters:
- in: query
type: string
name: order_id
description: Order id.
responses:
"200":
description: "Channel quote"
schema:
$ref: "#/definitions/ChannelOrder"
/lnurl/channel:
get:
tags:
- LNURL
summary: "LN URL connect to node"
description: "LNURL Connect"
operationId: "lnurlConnect"
produces:
- "application/json"
parameters:
- in: query
type: string
name: order_id
description: Required for LNURL connect
- in: query
type: string
name: k1
description: Required for LNURL callback
- in: query
type: string
name: remote_id
description: Required for LNURL callback. Remote node address of form node_key@ip_address:port_number. IP address and port number is optional
responses:
"200":
description: "LNURL connect "
schema:
$ref: "#/definitions/LNURLConnect"
definitions:
LNURLConnect:
type: object
properties:
k1:
type: string
description: order id
tag:
type: string
default: channelRequest
callback:
type: string
description: A second-level URL which would initiate an OpenChannel message from target LN node
uri:
type: string
description: Blocktank node info
status:
type: string
description: Response status
enum: ["OK", "ERROR"]
reason:
type: string
description: Error reason
ChannelQuote:
type: "object"
properties:
order_id:
type: string
ln_invoice:
type: string
total_amount:
type: integer
btc_address:
type: string
lnurl_channel:
type: string
ChannelOrder:
type: "object"
properties:
_id:
description: Order id
type: string
local_balance:
type: integer
remote_balance:
type: integer
channel_expiry:
type: integer
description: Channel expiry is in weeks.
channel_expiry_ts:
type: integer
description: Blocktank has the righ to close the channel after this time
order_expiry:
type: integer
description: order is valid until this time
total_amount:
type: integer
description: total amount payable by customer
btc_address:
type: string
description: Destination address for on chain payments
created_at:
type: integer
description: Time that the order was created
amount_received:
type: number
description: how much satoshi orders has recieved
remote_node:
type: object
properties:
err:
type: boolean
port:
type: number
ip:
type: string
addr:
type: string
public_key:
type: string
channel_open_tx:
type: object
properties:
transaction_id:
type: string
transaction_vout:
type: string
purchase_invoice:
type: string
lnurl:
type: object
description: LNUrl channel object
properties:
uri:
type: string
callback:
type: string
k1:
type: string
tag:
default: "channelRequest"
state:
$ref: "#/definitions/OrderStates"
onchain_payments:
type: array
items:
type: object
properties:
height:
type: integer
hash:
type: string
to:
type: string
amount_base:
type: integer
zero_conf:
type: boolean
description: if payment was accepted as zero conf
xml:
name: "Category"
OrderStates:
type: "object"
description: Order state can be one of the following
properties:
CREATED:
type: number
description: Order has been created
default: 0
PAID:
type: number
description: Order has been paid
default: 100
URI_SET:
type: number
description: Order has been paid and node uri is set
default: 200
OPENING:
type: number
description: Lightning channel is opening
default: 300
CLOSING:
type: number
description: Lightning channel is closing
default: 350
GIVE_UP:
type: number
description: Gave up opening channel
default: 400
CLOSED:
type: number
description: Lightning channel has been closed
default: 450
OPEN:
type: number
description: Lightning channel is open
default: 500