Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
822 changes: 822 additions & 0 deletions backends/LNSocket.ts
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@a-khushal , Can we add an isConnected method as well?

Large diffs are not rendered by default.

1 change: 1 addition & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -95,6 +95,7 @@
"js-lnurl": "0.5.1",
"js-sha256": "0.9.0",
"lodash": "4.17.23",
"lnmessage": "^0.2.7",
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

nit: lock the version

"long": "5.2.3",
"lottie-react-native": "7.3.4",
"message-port-polyfill": "0.2.0",
Expand Down
7 changes: 6 additions & 1 deletion stores/SettingsStore.ts
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,7 @@ export interface Node {
nickname?: string;
dismissCustodialWarning: boolean;
photo?: string;
pubkey?: string;
// LNC
pairingPhrase?: string;
mailboxServer?: string;
Expand Down Expand Up @@ -362,6 +363,7 @@ export const INTERFACE_KEYS: {
{ key: 'LND (REST)', value: 'lnd' },
{ key: 'LND (Lightning Node Connect)', value: 'lightning-node-connect' },
{ key: 'Core Lightning (CLNRest)', value: 'cln-rest' },
{ key: 'Core Lightning (LNSocket)', value: 'lnsocket' },
{ key: 'Nostr Wallet Connect', value: 'nostr-wallet-connect' },
{ key: 'LNDHub', value: 'lndhub' }
];
Expand All @@ -372,7 +374,8 @@ export type Implementations =
| 'lightning-node-connect'
| 'cln-rest'
| 'lndhub'
| 'nostr-wallet-connect';
| 'nostr-wallet-connect'
| 'lnsocket';

export const EMBEDDED_NODE_NETWORK_KEYS = [
{ key: 'Mainnet', translateKey: 'network.mainnet', value: 'mainnet' },
Expand Down Expand Up @@ -1523,6 +1526,7 @@ export default class SettingsStore {
@observable public customMailboxServer: string;
@observable public error = false;
@observable public errorMsg: string;
@observable public pubkey: string;
// Embedded lnd
@observable public seedPhrase: Array<string>;
@observable public walletPassword: string;
Expand Down Expand Up @@ -1684,6 +1688,7 @@ export default class SettingsStore {
this.implementation = node.implementation || 'lnd';
this.certVerification = node.certVerification || false;
this.enableTor = node.enableTor;
this.pubkey = node.pubkey;
// LNC
this.pairingPhrase = node.pairingPhrase;
this.mailboxServer = node.mailboxServer;
Expand Down
9 changes: 9 additions & 0 deletions utils/BackendUtils.ts
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,8 @@ import LightningNodeConnect from '../backends/LightningNodeConnect';
import EmbeddedLND from '../backends/EmbeddedLND';
// Core Lightning
import CLNRest from '../backends/CLNRest';
// LNSocket Commando Node
import LNSocket from '../backends/LNSocket';
// Custodial
import LndHub from '../backends/LndHub';
import NostrWalletConnect from '../backends/NostrWalletConnect';
Expand All @@ -14,13 +16,15 @@ class BackendUtils {
lightningNodeConnect: LightningNodeConnect;
embeddedLND: EmbeddedLND;
clnRest: CLNRest;
lnSocket: LNSocket;
lndHub: LndHub;
nostrWalletConnect: NostrWalletConnect;
constructor() {
this.lnd = new LND();
this.lightningNodeConnect = new LightningNodeConnect();
this.embeddedLND = new EmbeddedLND();
this.clnRest = new CLNRest();
this.lnSocket = new LNSocket();
this.lndHub = new LndHub();
this.nostrWalletConnect = new NostrWalletConnect();
}
Expand All @@ -36,6 +40,8 @@ class BackendUtils {
return this.embeddedLND;
case 'cln-rest':
return this.clnRest;
case 'lnsocket':
return this.lnSocket;
case 'lndhub':
return this.lndHub;
case 'nostr-wallet-connect':
Expand Down Expand Up @@ -242,6 +248,9 @@ class BackendUtils {
waitSendPay = (...args: any[]) => this.call('waitSendPay', args);

clearCachedCalls = (...args: any[]) => this.call('clearCachedCalls', args);

// Commando
init = (...args: any[]) => this.call('init', args);
}

const backendUtils = new BackendUtils();
Expand Down
Loading