diff options
| author | Adam Soltys <[email protected]> | 2021-05-27 11:30:07 -0700 |
|---|---|---|
| committer | Adam Soltys <[email protected]> | 2021-06-09 16:06:06 -0700 |
| commit | 57414b3d332e986af6b1ef48136e0d0ef918a95b (patch) | |
| tree | 291f4c7cf5e60683ee6d4af7d41468cb1d3e3e07 /lib | |
| parent | 6bf4bf019f70435bcea1e4bb586f91fec6ddcee5 (diff) | |
| download | coinos-server-57414b3d332e986af6b1ef48136e0d0ef918a95b.tar.gz coinos-server-57414b3d332e986af6b1ef48136e0d0ef918a95b.zip | |
deps cleanup
Diffstat (limited to 'lib')
| -rw-r--r-- | lib/buildliquidtx.js | 2 | ||||
| -rw-r--r-- | lib/lnd.js | 36 |
2 files changed, 1 insertions, 37 deletions
diff --git a/lib/buildliquidtx.js b/lib/buildliquidtx.js index 4dd3a16c..7bebb548 100644 --- a/lib/buildliquidtx.js +++ b/lib/buildliquidtx.js @@ -1,5 +1,5 @@ const axios = require("axios"); -const liquid = require("liquidjs-lib"); +const liquid = require("@asoltys/liquidjs-lib"); const coinselect = require("coinselect"); const split = require("coinselect/split"); const api = prod diff --git a/lib/lnd.js b/lib/lnd.js deleted file mode 100644 index 8bb2df48..00000000 --- a/lib/lnd.js +++ /dev/null @@ -1,36 +0,0 @@ -const fs = require('fs'); -const path = require('path'); -const grpc = require('grpc'); -const protoLoader = require('@grpc/proto-loader'); -const { promisify } = require('util'); - - -module.exports = ({ tls, macaroon, server }) => { - const packageDefinition = protoLoader.loadSync('config/rpc.proto', { - keepCase: true, - longs: String, - enums: String, - defaults: true, - oneofs: true - }); - const lnrpc = grpc.loadPackageDefinition(packageDefinition).lnrpc; - process.env.GRPC_SSL_CIPHER_SUITES = 'HIGH+ECDSA' - const lndCert = fs.readFileSync(tls); - const sslCreds = grpc.credentials.createSsl(lndCert); - const macaroonCreds = grpc.credentials.createFromMetadataGenerator(function(args, callback) { - const macaroonFile = fs.readFileSync(macaroon).toString('hex'); - const metadata = new grpc.Metadata() - metadata.add('macaroon', macaroonFile); - callback(null, metadata); - }); - const creds = grpc.credentials.combineChannelCredentials(sslCreds, macaroonCreds); - const lnd = new lnrpc.Lightning(server, creds); - - return new Proxy(lnd, { - get(target, key) { - const method = target[key]; - if (typeof method === 'function' && !key.startsWith('sub')) return promisify(method); - return target[key]; - }, - }); -} |
