mirror of
https://github.com/aljazceru/cyphernode.git
synced 2025-12-26 17:15:08 +01:00
added lightning end points
This commit is contained in:
@@ -27,9 +27,11 @@ tags:
|
||||
- name: "block"
|
||||
- name: "transaction"
|
||||
- name: "spending wallet"
|
||||
- name: "core features"
|
||||
- name: "addresses"
|
||||
- name: "lightning"
|
||||
- name: "open timestamps client"
|
||||
- name: "core features"
|
||||
- name: "optional features"
|
||||
paths:
|
||||
/watch:
|
||||
post:
|
||||
@@ -383,6 +385,354 @@ paths:
|
||||
application/json:
|
||||
schema:
|
||||
$ref: '#/components/schemas/ApiResponseTemporarilyUnavailable'
|
||||
/addtobatch:
|
||||
post:
|
||||
tags:
|
||||
- "spending wallet"
|
||||
- "core features"
|
||||
summary: "Adds spending of some amount to some address to the next batch"
|
||||
description: "Inserts output information in the DB. Used when batchspend is called later."
|
||||
operationId: "spendInNextBatch"
|
||||
requestBody:
|
||||
description: "Address and amount"
|
||||
required: true
|
||||
content:
|
||||
application/json:
|
||||
schema:
|
||||
type: "object"
|
||||
required:
|
||||
- "address"
|
||||
- "amount"
|
||||
properties:
|
||||
address:
|
||||
$ref: '#/components/schemas/TypeAddressString'
|
||||
amount:
|
||||
type: "number"
|
||||
responses:
|
||||
200:
|
||||
description: "operation successful"
|
||||
401:
|
||||
$ref: '#/components/schemas/ApiResponseNotAllowed'
|
||||
405:
|
||||
$ref: '#/components/schemas/ApiResponseInvalidInput'
|
||||
503:
|
||||
description: "Resource temporarily unavailable"
|
||||
content:
|
||||
application/json:
|
||||
schema:
|
||||
$ref: '#/components/schemas/ApiResponseTemporarilyUnavailable'
|
||||
/batchspend:
|
||||
get:
|
||||
tags:
|
||||
- "spending wallet"
|
||||
- "core features"
|
||||
summary: "Spend some amount to some address"
|
||||
description: "Calls sendtoaddress RPC on the spending wallet with supplied info."
|
||||
operationId: "batchSpend"
|
||||
responses:
|
||||
200:
|
||||
description: "operation successful"
|
||||
content:
|
||||
application/json:
|
||||
schema:
|
||||
type: "object"
|
||||
required:
|
||||
- "status"
|
||||
- "hash"
|
||||
properties:
|
||||
status:
|
||||
type: "string"
|
||||
hash:
|
||||
$ref: '#/components/schemas/TypeHashString'
|
||||
401:
|
||||
$ref: '#/components/schemas/ApiResponseNotAllowed'
|
||||
405:
|
||||
$ref: '#/components/schemas/ApiResponseInvalidInput'
|
||||
503:
|
||||
description: "Resource temporarily unavailable"
|
||||
content:
|
||||
application/json:
|
||||
schema:
|
||||
$ref: '#/components/schemas/ApiResponseTemporarilyUnavailable'
|
||||
/deriveindex/{indexSpecifier}:
|
||||
get:
|
||||
parameters:
|
||||
- in: "path"
|
||||
name: "indexSpecifier"
|
||||
description: "Index specifier. Either an integer or a range in the form n-m"
|
||||
required: true
|
||||
schema:
|
||||
type: "string"
|
||||
tags:
|
||||
- "addresses"
|
||||
- "core features"
|
||||
summary: "Derive address from configured xpub key and derivation path"
|
||||
description: "Derives addresses for supplied index. Must be used with derivation.pub32 and derivation.path properties in config.properties."
|
||||
operationId: "deriveIndex"
|
||||
responses:
|
||||
200:
|
||||
description: "successful operation"
|
||||
content:
|
||||
application:json:
|
||||
schema:
|
||||
type: "object"
|
||||
properties:
|
||||
addresses:
|
||||
type: "array"
|
||||
items:
|
||||
type: "object"
|
||||
required:
|
||||
- "address"
|
||||
properties:
|
||||
address:
|
||||
$ref: '#/components/schemas/TypeAddressString'
|
||||
401:
|
||||
$ref: '#/components/schemas/ApiResponseNotAllowed'
|
||||
503:
|
||||
description: "Resource temporarily unavailable"
|
||||
content:
|
||||
application/json:
|
||||
schema:
|
||||
$ref: '#/components/schemas/ApiResponseTemporarilyUnavailable'
|
||||
/derivepubpath:
|
||||
post:
|
||||
tags:
|
||||
- "addresses"
|
||||
- "core features"
|
||||
summary: "Derive and address from a xpub key and a derivation path"
|
||||
description: "Derives addresses for supplied pub32 and path. config.properties' derivation.pub32 and derivation.path are not used."
|
||||
operationId: "derivePubPath"
|
||||
requestBody:
|
||||
required: true
|
||||
content:
|
||||
application/json:
|
||||
schema:
|
||||
type: "object"
|
||||
required:
|
||||
- "pub32"
|
||||
- "path"
|
||||
properties:
|
||||
pub32:
|
||||
type: "string"
|
||||
path:
|
||||
type: "string"
|
||||
responses:
|
||||
200:
|
||||
description: "successful operation"
|
||||
content:
|
||||
application:json:
|
||||
schema:
|
||||
type: "object"
|
||||
properties:
|
||||
addresses:
|
||||
type: "array"
|
||||
items:
|
||||
type: "object"
|
||||
required:
|
||||
- "address"
|
||||
properties:
|
||||
address:
|
||||
$ref: '#/components/schemas/TypeAddressString'
|
||||
401:
|
||||
$ref: '#/components/schemas/ApiResponseNotAllowed'
|
||||
405:
|
||||
$ref: '#/components/schemas/ApiResponseInvalidInput'
|
||||
503:
|
||||
description: "Resource temporarily unavailable"
|
||||
content:
|
||||
application/json:
|
||||
schema:
|
||||
$ref: '#/components/schemas/ApiResponseTemporarilyUnavailable'
|
||||
/ln_getinfo:
|
||||
get:
|
||||
tags:
|
||||
- "lightning"
|
||||
- "optional features"
|
||||
summary: "Get lightning node info"
|
||||
description: "Calls getinfo from lightningd.Useful to let your users know where to connect to."
|
||||
operationId: "lightningGetNodeInfo"
|
||||
responses:
|
||||
200:
|
||||
description: "successful operation"
|
||||
content:
|
||||
application/json:
|
||||
schema:
|
||||
type: "object"
|
||||
properties:
|
||||
id:
|
||||
type: "string"
|
||||
alias:
|
||||
type: "string"
|
||||
color:
|
||||
$ref: '#/components/schemas/TypeInt32HexString'
|
||||
version:
|
||||
type: "string"
|
||||
blockheight:
|
||||
type: "integer"
|
||||
network:
|
||||
type: "string"
|
||||
401:
|
||||
$ref: '#/components/schemas/ApiResponseNotAllowed'
|
||||
503:
|
||||
description: "Resource temporarily unavailable"
|
||||
content:
|
||||
application/json:
|
||||
schema:
|
||||
$ref: '#/components/schemas/ApiResponseTemporarilyUnavailable'
|
||||
/ln_create_invoice:
|
||||
post:
|
||||
tags:
|
||||
- "lightning"
|
||||
- "optional features"
|
||||
summary: "Create lightning invoice"
|
||||
description: "Returns a LN invoice. Label must be unique. Description will be used by your user for payment. Expiry is in seconds."
|
||||
operationId: "lightningCreateInvoice"
|
||||
requestBody:
|
||||
description: "Information to create invoice"
|
||||
required: true
|
||||
content:
|
||||
application/json:
|
||||
schema:
|
||||
type: "object"
|
||||
required:
|
||||
- "msatoshi"
|
||||
- "label"
|
||||
- "description"
|
||||
properties:
|
||||
msatoshi:
|
||||
type: "integer"
|
||||
label:
|
||||
type: "string"
|
||||
description:
|
||||
type: "string"
|
||||
responses:
|
||||
200:
|
||||
description: "successful operation"
|
||||
content:
|
||||
application/json:
|
||||
schema:
|
||||
type: "object"
|
||||
properties:
|
||||
payment_hash:
|
||||
$ref: '#/components/schemas/TypeHashString'
|
||||
expires_at:
|
||||
type: "integer"
|
||||
bolt11:
|
||||
type: "string"
|
||||
401:
|
||||
$ref: '#/components/schemas/ApiResponseNotAllowed'
|
||||
503:
|
||||
description: "Resource temporarily unavailable"
|
||||
content:
|
||||
application/json:
|
||||
schema:
|
||||
$ref: '#/components/schemas/ApiResponseTemporarilyUnavailable'
|
||||
/ln_pay:
|
||||
post:
|
||||
tags:
|
||||
- "lightning"
|
||||
- "optional features"
|
||||
summary: "Pay lightning invoice"
|
||||
description: "Make a LN payment. expected_msatoshi and expected_description are respectively the amount and description you gave your user for her to create the invoice; they must match the given bolt11 invoice supplied by your user."
|
||||
operationId: "lightningPayInvoice"
|
||||
requestBody:
|
||||
description: "Information to pay invoice"
|
||||
required: true
|
||||
content:
|
||||
application/json:
|
||||
schema:
|
||||
type: "object"
|
||||
required:
|
||||
- "bolt11"
|
||||
- "expected_msatoshi"
|
||||
- "expected_description"
|
||||
properties:
|
||||
bolt11:
|
||||
type: "string"
|
||||
expected_msatoshi:
|
||||
type: "integer"
|
||||
expected_description:
|
||||
type: "string"
|
||||
responses:
|
||||
200:
|
||||
description: "successful operation"
|
||||
content:
|
||||
application/json:
|
||||
schema:
|
||||
type: "object"
|
||||
properties:
|
||||
id:
|
||||
type: "integer"
|
||||
payment_hash:
|
||||
$ref: '#/components/schemas/TypeHashString'
|
||||
msatoshi:
|
||||
type: "integer"
|
||||
msatoshi_sent:
|
||||
type: "integer"
|
||||
created_at:
|
||||
type: "integer"
|
||||
status:
|
||||
type: "string"
|
||||
payment_preimage:
|
||||
$ref: '#/components/schemas/TypeHashString'
|
||||
description:
|
||||
type: "string"
|
||||
getroute_tries:
|
||||
type: "integer"
|
||||
sendpay_tries:
|
||||
type: "integer"
|
||||
route:
|
||||
type: "array"
|
||||
items:
|
||||
type: "object"
|
||||
properties:
|
||||
id:
|
||||
type: "string"
|
||||
channel:
|
||||
type: "string"
|
||||
msatoshi:
|
||||
type: "integer"
|
||||
delay:
|
||||
type: "integer"
|
||||
failures:
|
||||
type: "array"
|
||||
items:
|
||||
type: "object"
|
||||
|
||||
401:
|
||||
$ref: '#/components/schemas/ApiResponseNotAllowed'
|
||||
503:
|
||||
description: "Resource temporarily unavailable"
|
||||
content:
|
||||
application/json:
|
||||
schema:
|
||||
$ref: '#/components/schemas/ApiResponseTemporarilyUnavailable'
|
||||
/ln_newaddr:
|
||||
get:
|
||||
tags:
|
||||
- "lightning"
|
||||
- "optional features"
|
||||
summary: "Generates new address from the lightning node"
|
||||
description: "Returns a Bitcoin bech32 address to fund your LN wallet."
|
||||
operationId: "lightningGetNewAddress"
|
||||
responses:
|
||||
200:
|
||||
description: "successful operation"
|
||||
content:
|
||||
application/json:
|
||||
schema:
|
||||
type: "object"
|
||||
properties:
|
||||
address:
|
||||
type: "string"
|
||||
401:
|
||||
$ref: '#/components/schemas/ApiResponseNotAllowed'
|
||||
503:
|
||||
description: "Resource temporarily unavailable"
|
||||
content:
|
||||
application/json:
|
||||
schema:
|
||||
$ref: '#/components/schemas/ApiResponseTemporarilyUnavailable'
|
||||
components:
|
||||
schemas:
|
||||
WatchedAddress:
|
||||
@@ -554,7 +904,7 @@ components:
|
||||
TypeInt32HexString:
|
||||
description: "8 character hex string"
|
||||
type: "string"
|
||||
pattern: "^[a-fA-F0-9]{8}$"
|
||||
pattern: "^([a-fA-F0-9][a-fA-F0-9]){1,4}$"
|
||||
ApiResponseTemporarilyUnavailable:
|
||||
type: "object"
|
||||
properties:
|
||||
|
||||
Reference in New Issue
Block a user