Skip to content

Commit a1568d4

Browse files
committed
example: add buttons for LND RPC sub-servers
1 parent c072f70 commit a1568d4

File tree

1 file changed

+41
-0
lines changed

1 file changed

+41
-0
lines changed

example/index.html

Lines changed: 41 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -151,6 +151,10 @@
151151
async function callWASMFaraday(rpcName, req) {
152152
window[namespace].wasmClientInvokeRPC('frdrpc.FaradayServer.' + rpcName, req, setResult);
153153
}
154+
155+
async function callWASMDirect(rpcName, req) {
156+
window[namespace].wasmClientInvokeRPC(rpcName, req, setResult);
157+
}
154158

155159
function setResult(result) {
156160
$('#output').text(result);
@@ -212,6 +216,33 @@
212216
if (window[namespace].wasmClientHasPerms("lnrpc.Lightning.SubscribeTransactions")) {
213217
document.getElementById('subscribetx').disabled = false;
214218
}
219+
if (window[namespace].wasmClientHasPerms("autopilotrpc.Autopilot.Status")) {
220+
document.getElementById('autopilotrpc').disabled = false;
221+
}
222+
if (window[namespace].wasmClientHasPerms("chainrpc.ChainNotifier.RegisterBlockEpochNtfn")) {
223+
document.getElementById('chainrpc').disabled = false;
224+
}
225+
if (window[namespace].wasmClientHasPerms("invoicesrpc.Invoices.AddHoldInvoice")) {
226+
document.getElementById('invoicesrpc').disabled = false;
227+
}
228+
if (window[namespace].wasmClientHasPerms("routerrpc.Router.GetMissionControlConfig")) {
229+
document.getElementById('routerrpc').disabled = false;
230+
}
231+
if (window[namespace].wasmClientHasPerms("signrpc.Signer.SignMessage")) {
232+
document.getElementById('signrpc').disabled = false;
233+
}
234+
if (window[namespace].wasmClientHasPerms("lnrpc.State.GetState")) {
235+
document.getElementById('lnrpc').disabled = false;
236+
}
237+
if (window[namespace].wasmClientHasPerms("walletrpc.WalletKit.ListUnspent")) {
238+
document.getElementById('walletrpc').disabled = false;
239+
}
240+
if (window[namespace].wasmClientHasPerms("watchtowerrpc.Watchtower.GetInfo")) {
241+
document.getElementById('watchtowerrpc').disabled = false;
242+
}
243+
if (window[namespace].wasmClientHasPerms("wtclientrpc.WatchtowerClient.ListTowers")) {
244+
document.getElementById('wtclientrpc').disabled = false;
245+
}
215246
if (window[namespace].wasmClientHasPerms("looprpc.SwapClient.LoopOutTerms")) {
216247
document.getElementById('loopoutterms').disabled = false;
217248
}
@@ -276,6 +307,16 @@ <h2>LND</h2>
276307
<button id="subscribetx" onClick="callWASM('SubscribeTransactions', '{}');" disabled>
277308
SubscribeTransactions
278309
</button>
310+
<p>Sub-servers</p>
311+
<button id="autopilotrpc" onClick="callWASMDirect('autopilotrpc.Autopilot.Status', '{}');" disabled>Status</button>
312+
<button id="chainrpc" onClick="callWASMDirect('chainrpc.ChainNotifier.RegisterBlockEpochNtfn', '{}');" disabled>RegisterBlockEpochNtfn</button>
313+
<button id="invoicesrpc" onClick="callWASMDirect('invoicesrpc.Invoices.AddHoldInvoice', '{}');" disabled>AddHoldInvoice</button>
314+
<button id="routerrpc" onClick="callWASMDirect('routerrpc.Router.GetMissionControlConfig', '{}');" disabled>GetMissionControlConfig</button>
315+
<button id="signrpc" onClick="callWASMDirect('signrpc.Signer.SignMessage', '{}');" disabled>SignMessage</button>
316+
<button id="lnrpc" onClick="callWASMDirect('lnrpc.State.GetState', '{}');" disabled>GetState</button>
317+
<button id="walletrpc" onClick="callWASMDirect('walletrpc.WalletKit.ListUnspent', '{}');" disabled>ListUnspent</button>
318+
<button id="watchtowerrpc" onClick="callWASMDirect('watchtowerrpc.Watchtower.GetInfo', '{}');" disabled>GetInfo</button>
319+
<button id="wtclientrpc" onClick="callWASMDirect('wtclientrpc.WatchtowerClient.ListTowers', '{}');" disabled>ListTowers</button>
279320

280321
<h2>Loop</h2>
281322
<button id="loopoutterms" onClick="callWASMLoop('LoopOutTerms', '{}');" disabled>LoopOutTerms</button>

0 commit comments

Comments
 (0)