Skip to content

Commit

Permalink
init
Browse files Browse the repository at this point in the history
  • Loading branch information
Overtorment committed Jul 12, 2020
0 parents commit 6e32b61
Show file tree
Hide file tree
Showing 16 changed files with 2,144 additions and 0 deletions.
7 changes: 7 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
.idea/
.vscode/
node_modules/
build/
tmp/
temp/
.env
12 changes: 12 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
# Ground Control


```shell script
npm install -g dtsgenerator
dtsgen openapi.yaml > src/openapi/api.ts
npm i
npm start
```



137 changes: 137 additions & 0 deletions openapi.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,137 @@
openapi: 3.0.0
info:
title: GroundControl push server API
description: Push notifications server for BlueWallet
version: 0.0.3
servers:
- url: http://localhost:3001
paths:

/lightningInvoiceGotSettled:
post:
requestBody:
required: true
content:
application/json:
schema:
$ref: '#/components/schemas/LightningInvoiceSettledNotification'
responses:
'200':
description: OK

/majorTomToGroundControl:
post:
summary: "Associate bitcoin addressess / ln preimage hashes that you wish to be notified about to specific push token. Token serves as unique identifier of a device/user. Also, OS of the token"
requestBody:
required: true
content:
application/json:
schema:
type: object
properties:
addresses:
type: array
items:
type: string
hashes:
type: array
items:
type: string
token:
type: string
os:
type: string
responses:
'201':
description: Created

/ping:
get:
responses:
'200':
description: OK
content:
application/json:
schema:
$ref: '#/components/schemas/ServerInfo'
components:
schemas:

ServerInfo:
type: "object"
properties:
name:
type: "string"
description:
type: "string"
version:
type: "string"
uptime:
type: "number"

LightningInvoiceSettledNotification:
description: object thats posted to GroundControl to notify end-user that his specific invoice was paid by someone
type: "object"
properties:
memo:
type: "string"
description: "text that was embedded in invoice paid"
preimage:
type: "string"
description: "hex string preimage"
hash:
type: "string"
description: "hex string preimage hash"
amt_paid_sat:
type: "number"
description: "exactly how much satoshis was paid to make this invoice settked (>= invoice amount)"


PushNotification:
description: payload for push notification delivered to phone
type: object
required:
- type
- os
- token
properties:
"type":
type: "integer"
enum:
- 1
- 2
"token":
type: "string"
"os":
type: "string"
enum:
- "android"
description: >
type:
* `1` - Your lightning invoice was paid
* `2` - New transaction to one of your addresses
badge:
type: "integer"


PushNotificationLightningInvoicePaid:
allOf: # Combines PushNotification and the inline model
- $ref: '#/components/schemas/PushNotification'
- type: object
required:
- sat
- hash
- memo
properties:
type:
type: "integer"
enum: [1]
sat:
type: "integer"
description: amount of satoshis
hash:
type: "string"
description: hash of specific ln invoice preimage
memo:
type: "string"
description: text attached to bolt11
Loading

0 comments on commit 6e32b61

Please sign in to comment.