WIP: lightning

This commit is contained in:
Overtorment 2018-07-15 20:56:28 +01:00
parent 9f218d5c3f
commit d1f7b4912b
3 changed files with 56 additions and 0 deletions

View File

@ -0,0 +1,12 @@
/* global it */
import { LightningCustodianWallet } from './class';
let assert = require('assert');
it('can generate auth secret', () => {
let l1 = new LightningCustodianWallet();
let l2 = new LightningCustodianWallet();
l1.generate();
l2.generate();
assert.ok(l1.getSecret() !== l2.getSecret(), 'generated credentials should be the same');
});

View File

@ -8,3 +8,4 @@ export * from './hd-segwit-p2sh-wallet';
export * from './hd-legacy-breadwallet-wallet';
export * from './hd-legacy-p2pkh-wallet';
export * from './watch-only-wallet';
export * from './lightning-custodian-wallet';

View File

@ -0,0 +1,43 @@
import { LegacyWallet } from './legacy-wallet';
import Frisbee from 'frisbee';
export class LightningCustodianWallet extends LegacyWallet {
constructor() {
super();
this.type = 'lightningCustodianWallet';
this.pendingTransactions = [];
this.token = false;
this.tokenRefreshedOn = 0;
this._api = new Frisbee({
baseURI: 'https://api.blockcypher.com/v1/btc/main/addrs/',
});
}
async createAccount() {}
async authorize() {}
async getToken() {}
async getBtcAddress() {}
async newBtcAddress() {}
async getPendngBalance() {}
async decodeInvoice() {}
async checkRoute() {}
async payInvoice() {}
async sendCoins() {}
async getTransactions() {}
async getTransaction() {}
async getBalance() {}
async getInfo() {}
}