-
Notifications
You must be signed in to change notification settings - Fork 5
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
0 parents
commit 040bf63
Showing
15 changed files
with
6,992 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,16 @@ | ||
{ | ||
"env": { | ||
"development": { | ||
"sourceMaps": "inline", | ||
"plugins": ["source-map-support"] | ||
} | ||
}, | ||
"presets": [ | ||
["env", { | ||
"targets": { | ||
"node": "6.0" | ||
} | ||
}] | ||
], | ||
"plugins": ["add-module-exports"] | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
# Editor configuration, see http://editorconfig.org | ||
root = true | ||
|
||
[*] | ||
charset = utf-8 | ||
indent_style = space | ||
indent_size = 2 | ||
insert_final_newline = true | ||
trim_trailing_whitespace = true | ||
|
||
[*.md] | ||
max_line_length = off | ||
trim_trailing_whitespace = false |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
package.json | ||
package-lock.json | ||
.git | ||
node_modules | ||
coverage |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
{ | ||
"extends": ["prettier"], | ||
"parserOptions": { | ||
"ecmaVersion": 2017, | ||
"sourceType": "module" | ||
}, | ||
"env": { | ||
"es6": true, | ||
"node": true | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,73 @@ | ||
# Logs | ||
logs | ||
*.log | ||
npm-debug.log* | ||
yarn-debug.log* | ||
yarn-error.log* | ||
|
||
# Runtime data | ||
pids | ||
*.pid | ||
*.seed | ||
*.pid.lock | ||
|
||
# Directory for instrumented libs generated by jscoverage/JSCover | ||
lib-cov | ||
|
||
# Coverage directory used by tools like istanbul | ||
coverage | ||
|
||
# nyc test coverage | ||
.nyc_output | ||
|
||
# Grunt intermediate storage (http://gruntjs.com/creating-plugins#storing-task-files) | ||
.grunt | ||
|
||
# Bower dependency directory (https://bower.io/) | ||
bower_components | ||
|
||
# node-waf configuration | ||
.lock-wscript | ||
|
||
# Compiled binary addons (https://nodejs.org/api/addons.html) | ||
build/Release | ||
|
||
# Dependency directories | ||
node_modules/ | ||
jspm_packages/ | ||
|
||
# TypeScript v1 declaration files | ||
typings/ | ||
|
||
# Optional npm cache directory | ||
.npm | ||
|
||
# Optional eslint cache | ||
.eslintcache | ||
|
||
# Optional REPL history | ||
.node_repl_history | ||
|
||
# Output of 'npm pack' | ||
*.tgz | ||
|
||
# Yarn Integrity file | ||
.yarn-integrity | ||
|
||
# dotenv environment variables file | ||
.env | ||
|
||
# next.js build output | ||
.next | ||
|
||
# vuepress build output | ||
.vuepress/dist | ||
|
||
# Serverless directories | ||
.serverless | ||
|
||
# Vendor binaries | ||
/vendor | ||
|
||
# Transpiled code | ||
/dist |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
package.json | ||
package-lock.json | ||
.git | ||
.eslintrc | ||
.babelrc | ||
node_modules | ||
coverage |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,15 @@ | ||
{ | ||
"bracketSpacing": true, | ||
"printWidth": 120, | ||
"semi": false, | ||
"singleQuote": true, | ||
"trailingComma": "all", | ||
"overrides": [ | ||
{ | ||
"files": [".prettierrc"], | ||
"options": { | ||
"parser": "json" | ||
} | ||
} | ||
] | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
language: node_js | ||
node_js: | ||
- node | ||
- lts/* | ||
os: | ||
- linux | ||
- osx |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,88 @@ | ||
# lndconnect | ||
|
||
[](https://github.com/lightningnetwork/lnd) | ||
[](https://github.com/RichardLitt/standard-readme) | ||
[](https://david-dm.org/LN-Zap/lndconnect) | ||
[](https://travis-ci.org/LN-Zap/lndconnect) | ||
|
||
> Generate and parse lndconnect uris https://github.com/LN-Zap/lndconnect ⚡️ | ||
This package provides utilities for generating and parsing lndconnect uris. | ||
|
||
For more information take a look at the [specification of the uri format](https://github.com/LN-Zap/lndconnect/blob/master/lnd_connect_uri.md). | ||
|
||
## Table of Contents | ||
|
||
- [Install](#install) | ||
- [Usage](#usage) | ||
- [Maintainers](#maintainers) | ||
- [Contribute](#contribute) | ||
- [License](#license) | ||
|
||
## Install | ||
|
||
``` | ||
npm install lndconnect --save | ||
``` | ||
|
||
## Usage | ||
|
||
**encodeCert(certPath<string>):** | ||
|
||
```javascript | ||
const certPath = path.join(__dirname, 'tls.cert') | ||
const cert = await encodeCert(certPath) | ||
expect(cert).toEqual('MIICuDCCAl...') | ||
``` | ||
|
||
**encodeMacaroon(macaroonPath<string>):** | ||
|
||
```javascript | ||
const macaroonPath = path.join(__dirname, 'admin.macaroon') | ||
const macaroon = await encodeMacaroon(macaroonPath) | ||
expect(macaroon).toEqual('macaroon=AgEDbG5kAr...') | ||
``` | ||
|
||
**encode({ host<string>, cert<string>, macaroon<string> }):** | ||
|
||
```javascript | ||
const connectionString = encode({ | ||
host: '1.2.3.4:10009', | ||
cert: 'MIICuDCCAl...', | ||
macaroon: 'AgEDbG5kAr...', | ||
}) | ||
|
||
expect(connectionString).toEqual('lndconnect://1.2.3.4:10009?cert=MIICuDCCAl...&macaroon=AgEDbG5kAr...') | ||
``` | ||
|
||
**decode({ host<string>, cert<string>, macaroon<string> }):** | ||
|
||
```javascript | ||
const { host, cert, macaroon } decode('lndconnect://1.2.3.4:10009?cert=MIICuDCCAl...&macaroon=AgEDbG5kAr...') | ||
|
||
expect(host).toEqual('1.2.3.4:10009') | ||
expect(cert).toEqual('cert=MIICuDCCAl...') | ||
expect(macaroon).toEqual('macaroon=AgEDbG5kAr...') | ||
``` | ||
|
||
### Testing | ||
|
||
Run the tests suite: | ||
|
||
```bash | ||
npm test | ||
``` | ||
|
||
## Maintainers | ||
|
||
[@Tom Kirkpatrick (mrfelton)](https://github.com/mrfelton). | ||
|
||
## Contribute | ||
|
||
Feel free to dive in! [Open an issue](https://github.com/LN-Zap/lndconnect/issues/new) or submit PRs. | ||
|
||
lndconnect follows the [Contributor Covenant](http://contributor-covenant.org/version/1/3/0/) Code of Conduct. | ||
|
||
## License | ||
|
||
[MIT](LICENSE) © Tom Kirkpatrick |
Oops, something went wrong.