@@ -47,55 +47,54 @@ export const lndWalletBalance: LND.WalletBalanceResponse.AsObject = {
4747 unconfirmedBalance : 0 ,
4848} ;
4949
50- export const lndListChannelsOne : LND . ListChannelsResponse . AsObject = {
51- channelsList : [
50+ const txId = '6ee4e45870ac6191e25173f29804851e9f4bcf10f65f8b63100f488989e1e7a8' ;
51+ const outIndex = 0 ;
52+ export const lndChannel : LND . Channel . AsObject = {
53+ active : true ,
54+ remotePubkey : '037136742c67e24681f36542f7c8916aa6f6fdf665c1dca2a107425503cff94501' ,
55+ channelPoint : `${ txId } :${ outIndex } ` ,
56+ chanId : '124244814004224' ,
57+ capacity : 15000000 ,
58+ localBalance : 9988660 ,
59+ remoteBalance : 4501409 ,
60+ commitFee : 11201 ,
61+ commitWeight : 896 ,
62+ feePerKw : 12500 ,
63+ unsettledBalance : 498730 ,
64+ totalSatoshisSent : 1338 ,
65+ totalSatoshisReceived : 499929 ,
66+ numUpdates : 6 ,
67+ pendingHtlcsList : [
5268 {
53- active : true ,
54- remotePubkey : '037136742c67e24681f36542f7c8916aa6f6fdf665c1dca2a107425503cff94501' ,
55- channelPoint : '0ef6a4ae3d8f800f4eb736f0776f5d3a72571615a1b7218ab17c9a43f85d8949:0' ,
56- chanId : '124244814004224' ,
57- capacity : 15000000 ,
58- localBalance : 9988660 ,
59- remoteBalance : 4501409 ,
60- commitFee : 11201 ,
61- commitWeight : 896 ,
62- feePerKw : 12500 ,
63- unsettledBalance : 498730 ,
64- totalSatoshisSent : 1338 ,
65- totalSatoshisReceived : 499929 ,
66- numUpdates : 6 ,
67- pendingHtlcsList : [
68- {
69- incoming : false ,
70- amount : 498730 ,
71- hashLock : 'pl8fmsyoSqEQFQCw6Zu9e1aIlFnMz5H+hW2mmh3kRlI=' ,
72- expirationHeight : 285 ,
73- } ,
74- ] ,
75- csvDelay : 1802 ,
76- pb_private : false ,
77- initiator : true ,
78- chanStatusFlags : 'ChanStatusDefault' ,
79- localChanReserveSat : 150000 ,
80- remoteChanReserveSat : 150000 ,
81- staticRemoteKey : true ,
82- lifetime : 21802 ,
83- uptime : 21802 ,
84- closeAddress : '' ,
69+ incoming : false ,
70+ amount : 498730 ,
71+ hashLock : 'pl8fmsyoSqEQFQCw6Zu9e1aIlFnMz5H+hW2mmh3kRlI=' ,
72+ expirationHeight : 285 ,
8573 } ,
8674 ] ,
75+ csvDelay : 1802 ,
76+ pb_private : false ,
77+ initiator : true ,
78+ chanStatusFlags : 'ChanStatusDefault' ,
79+ localChanReserveSat : 150000 ,
80+ remoteChanReserveSat : 150000 ,
81+ staticRemoteKey : true ,
82+ lifetime : 21802 ,
83+ uptime : 21802 ,
84+ closeAddress : '' ,
8785} ;
8886
8987export const lndListChannels : LND . ListChannelsResponse . AsObject = {
9088 channelsList : [ ...Array ( 500 ) ] . map ( ( _ , i ) => {
91- const c = lndListChannelsOne . channelsList [ 0 ] ;
89+ const c = lndChannel ;
9290 // pick a random capacity between 0.5 and 1 BTC
9391 const cap = Math . floor ( Math . random ( ) * 50000000 ) + 50000000 ;
9492 // pick a local balance that is at least 100K sats
9593 const local = Math . max ( 100000 , Math . floor ( Math . random ( ) * cap - 100000 ) ) ;
9694 return {
9795 ...c ,
98- chanId : `${ i } ${ c . chanId } ` ,
96+ chanId : `${ i || '' } ${ c . chanId } ` ,
97+ channelPoint : `${ c . channelPoint . substring ( 0 , c . channelPoint . length - 2 ) } :${ i } ` ,
9998 remotePubkey : `${ i } ${ c . remotePubkey } ` ,
10099 localBalance : local ,
101100 remoteBalance : cap - local ,
@@ -105,6 +104,50 @@ export const lndListChannels: LND.ListChannelsResponse.AsObject = {
105104 } ) ,
106105} ;
107106
107+ const txIdBytes = Buffer . from ( txId , 'hex' ) . reverse ( ) . toString ( 'base64' ) ;
108+ export const lndChannelEvent : Required < LND . ChannelEventUpdate . AsObject > = {
109+ type : LND . ChannelEventUpdate . UpdateType . OPEN_CHANNEL ,
110+ openChannel : lndChannel ,
111+ closedChannel : {
112+ capacity : 15000000 ,
113+ chainHash : '0f9188f13cb7b2c71f2a335e3a4fc328bf5beb436012afca590b1a11466e2206' ,
114+ chanId : lndChannel . chanId ,
115+ channelPoint : lndChannel . channelPoint ,
116+ closeHeight : 191 ,
117+ closeType : 0 ,
118+ closingTxHash : '1f765f45f2a6d33837a203e3fc911915c891e9b86f9c9d91a1931b92efdedf5b' ,
119+ remotePubkey : '030e98fdacf2464bdfb027b866a018d6cdc5108514208988873abea7eff59afd91' ,
120+ settledBalance : 12990950 ,
121+ timeLockedBalance : 0 ,
122+ } ,
123+ activeChannel : {
124+ fundingTxidBytes : txIdBytes ,
125+ fundingTxidStr : '' ,
126+ outputIndex : outIndex ,
127+ } ,
128+ inactiveChannel : {
129+ fundingTxidBytes : txIdBytes ,
130+ fundingTxidStr : '' ,
131+ outputIndex : outIndex ,
132+ } ,
133+ } ;
134+
135+ export const lndTransaction : LND . Transaction . AsObject = {
136+ amount : 12990950 ,
137+ blockHash : '' ,
138+ blockHeight : 0 ,
139+ destAddressesList : [
140+ 'bcrt1qgrvqm263gra5t02cvvkxmp9520rkann0cedzz8' ,
141+ 'bcrt1qkggx6pzd768hn6psc5tmwuvv4c2nzvpd3ax9a9' ,
142+ ] ,
143+ numConfirmations : 0 ,
144+ rawTxHex :
145+ '02000000000101a8e7e18989480f10638b5ff610cf4b9f1e850498f27351e29161ac7058e4e46e0000000000ffffffff0280841e000000000016001440d80dab5140fb45bd58632c6d84b453c76ece6fe639c60000000000160014b2106d044df68f79e830c517b7718cae1531302d040047304402207e17f9938f04a2379300a5c0f37305c902855fa000726bb7f0ad78d084acfcee02206d3da5edd73624d6ecfa27ae61e994e75bd0ad8cca6c9b7dda087bcf34b2bbbc0148304502210086d0b7e77b1d81f210d55bc13f9eef975774ac1509a22ff649bd2baac85b3fd702203bb272d6372450159b89ca41d97efbf6bdac076bc271696a1bd556efc31b5cda01475221028d084ada5554c83421bfac35bc78332f3c1f6ae980dea1e0eb3220411b7b83972103c60b39c8558f280fe2f0dfa7cb6a04f016470c4670e631458b400774a667610052ae00000000' ,
146+ timeStamp : 1591226124 ,
147+ totalFees : 0 ,
148+ txHash : '1f765f45f2a6d33837a203e3fc911915c891e9b86f9c9d91a1931b92efdedf5b' ,
149+ } ;
150+
108151//
109152// Loop API Responses
110153//
0 commit comments