Skip to content

Commit

Permalink
Merge pull request #35 from ln-markets/v1.2.0
Browse files Browse the repository at this point in the history
v1.2.0
  • Loading branch information
kibotrel authored Apr 21, 2022
2 parents d9e38dc + cfd13ba commit 7095fa4
Show file tree
Hide file tree
Showing 59 changed files with 1,979 additions and 1,171 deletions.
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@

As a regular user you must use the official integrated application through [Umbrel](https://github.com/getumbrel/umbrel). This way you could switch between mainnet and testnet network.

![Umbrel](https://user-images.githubusercontent.com/45034541/140373859-66b7fa6d-5eeb-4fc5-8608-d139e8677267.png)
![Umbrel](https://user-images.githubusercontent.com/45034541/163248849-69ba8bde-4654-4145-838f-9cdb4d04a4d5.png)

You can find the information about how to build an app for Umbrel [here](https://github.com/getumbrel/umbrel/tree/b768bcf9e90e51cb6cc13ddb8a8a2a905ac2017b/apps)

Expand Down
125 changes: 125 additions & 0 deletions apps/api/.eslintrc.cjs
Original file line number Diff line number Diff line change
@@ -0,0 +1,125 @@
module.exports = {
root: true,
env: {
es6: true,
node: true,
},
globals: {
require: true,
module: true,
},
parserOptions: {
ecmaVersion: 'latest',
sourceType: 'module',
},
ignorePatterns: ['node_modules/**'],
plugins: ['no-autofix', 'prefer-arrow'],
extends: [
'eslint:recommended',
'plugin:prettier/recommended',
'plugin:import/recommended',
'plugin:promise/recommended',
'plugin:sonarjs/recommended',
'plugin:eslint-comments/recommended',
],
rules: {
'space-before-function-paren': 'off',
'no-empty': ['error', { allowEmptyCatch: true }],
camelcase: 'off',
'prefer-destructuring': [
'error',
{
VariableDeclarator: {
array: false,
object: true,
},
AssignmentExpression: {
array: true,
object: false,
},
},
{
enforceForRenamedProperties: false,
},
],
'require-await': 'error',
'no-return-await': 'error',
'no-return-assign': 'error',
eqeqeq: 'error',
'no-var': 'error',
'prefer-const': 'error',
'prefer-arrow-callback': 'error',

'eslint-comments/disable-enable-pair': ['error', { allowWholeFile: true }],

'sonarjs/no-duplicate-string': 'off',
'sonarjs/cognitive-complexity': 'off',
'sonarjs/no-identical-functions': 'off',

'import/first': 'error',
'import/newline-after-import': 'error',
'import/no-duplicates': 'error',
'import/order': [
'error',
{
groups: ['builtin', 'external', 'internal', 'parent', 'sibling', 'index'],
alphabetize: {
order: 'asc',
caseInsensitive: true,
},
'newlines-between': 'always',
pathGroups: [
{
pattern: '@ln-markets/**',
group: 'internal',
},
{
pattern: '#src/**',
group: 'internal',
},
],
},
],

'no-autofix/jsdoc/require-jsdoc': 'off',

'prefer-arrow/prefer-arrow-functions': [
'error',
{
disallowPrototype: true,
singleReturnOnly: false,
classPropertiesAllowed: false,
},
],
},
settings: {
'import/core-modules': [
'node:process',
'node:async_hooks',
'node:console',
'node:os',
'node:net',
'node:crypto',
'node:buffer',
'node:timers',
'node:querystring',
'node:url',
'node:http',
'node:path',
'node:fs',
'node:fs/promises',
'node:https',
'node:v8',
'node:worker_threads',
'zx/globals',
],
'import/resolver': {
alias: {
map: [
['#src', './src'],
],
extensions: ['.js', '.json'],
},
},
},
}
62 changes: 0 additions & 62 deletions apps/api/.eslintrc.js

This file was deleted.

4 changes: 2 additions & 2 deletions apps/api/jsconfig.json
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
{
"compilerOptions": {
"module": "commonjs",
"module": "CommonJS",
"target": "es2020",
"baseUrl": ".",
"paths": {
"@/*": [
"#src/*": [
"src/*"
],
}
Expand Down
25 changes: 14 additions & 11 deletions apps/api/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
"license": "MIT",
"private": true,
"engines": {
"node": ">=14"
"node": ">=16"
},
"scripts": {
"eslint": "eslint --fix",
Expand All @@ -16,27 +16,30 @@
"format": "prettier --write 'src/**/*.js'",
"dev": "nodemon"
},
"type": "module",
"imports": {
"#src/*": "./src/*"
},
"dependencies": {
"@ln-markets/api": "^1.4.2",
"@ln-markets/api": "^1.7.0",
"@ln-markets/maths": "^1.0.1",
"bech32": "^2.0.0",
"bip32": "^3.0.1",
"bip39": "^3.0.4",
"body-parser": "^1.19.0",
"body-parser": "^1.20.0",
"cors": "^2.8.5",
"cuid": "^2.1.8",
"express": "^4.17.1",
"express": "^4.17.3",
"express-session": "^1.17.2",
"express-winston": "^4.2.0",
"helmet": "^4.6.0",
"ln-service": "53.0.1",
"module-alias": "^2.2.2",
"secp256k1": "^4.0.2",
"tiny-secp256k1": "^2.1.2",
"winston": "^3.3.3",
"ws": "^8.3.0"
},
"_moduleAliases": {
"@": "src/"
"node-fetch": "^3.2.3",
"secp256k1": "^4.0.3",
"tiny-secp256k1": "^2.2.1",
"winston": "^3.7.2",
"ws": "^8.5.0"
},
"nodemonConfig": {
"exec": "node src/index.js",
Expand Down
12 changes: 7 additions & 5 deletions apps/api/src/classes/lnd.js
Original file line number Diff line number Diff line change
@@ -1,14 +1,16 @@
const fs = require('fs')
const net = require('net')
import { Buffer } from 'node:buffer'
import fs from 'node:fs'
import net from 'node:net'
import process from 'node:process'

const {
import {
authenticatedLndGrpc,
getWalletInfo,
diffieHellmanComputeSecret,
decodePaymentRequest,
pay,
createInvoice,
} = require('ln-service')
} from 'ln-service'

const isPortOpen = async (opt = {}) => {
const { host, port } = opt
Expand Down Expand Up @@ -105,4 +107,4 @@ class LND {
}
}

module.exports = new LND()
export default new LND()
Loading

0 comments on commit 7095fa4

Please sign in to comment.