Browse Source

WIP: lightning

localNotifications
Overtorment 6 years ago
parent
commit
d1f7b4912b
  1. 12
      LightningCustodianWallet.test.js
  2. 1
      class/index.js
  3. 43
      class/lightning-custodian-wallet.js

12
LightningCustodianWallet.test.js

@ -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');
});

1
class/index.js

@ -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';

43
class/lightning-custodian-wallet.js

@ -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() {}
}
Loading…
Cancel
Save