This repository was archived by the owner on Oct 24, 2022. It is now read-only.
File tree Expand file tree Collapse file tree 2 files changed +12
-8
lines changed Expand file tree Collapse file tree 2 files changed +12
-8
lines changed Original file line number Diff line number Diff line change @@ -45,7 +45,7 @@ yarn android
45
45
import lnd, {
46
46
ENetworks ,
47
47
LndConf ,
48
- TCurrentLndState ,
48
+ ss_lnrpc
49
49
} from ' @synonymdev/react-native-lightning' ;
50
50
51
51
const lndConf = new LndConf (ENetworks .regtest );
@@ -59,11 +59,16 @@ if (res.isErr()) {
59
59
}
60
60
61
61
// LND state changes
62
- lnd .subscribeToCurrentState (({lndRunning, walletUnlocked, grpcReady}) => {
63
- console .log (` lndRunning: ${ lndRunning} ` );
64
- console .log (` walletUnlocked: ${ walletUnlocked} ` );
65
- console .log (` grpcReady: ${ grpcReady} ` );
66
- });
62
+ lnd .stateService .subscribeToStateChanges (
63
+ (res : Result < ss_lnrpc .WalletState > ) => {
64
+ if (res .isOk ()) {
65
+ setLndState (res .value );
66
+ }
67
+ },
68
+ () => {
69
+ // Subscription has ended
70
+ },
71
+ );
67
72
68
73
69
74
// Subscribe to LND logs
Original file line number Diff line number Diff line change 1
1
import GrpcAction from '../grpc' ;
2
2
import { err , ok , Result } from '../utils/result' ;
3
- import { EGrpcStreamMethods , EGrpcSyncMethods } from '../utils/types' ;
3
+ import { EGrpcSyncMethods } from '../utils/types' ;
4
4
import { lnrpc , wu_lnrpc } from '../' ;
5
5
import { hexStringToBytes , stringToBytes } from '../utils/helpers' ;
6
- import base64 from 'base64-js' ;
7
6
8
7
class WalletUnlocker {
9
8
private readonly grpc : GrpcAction ;
You can’t perform that action at this time.
0 commit comments