Skip to content

Commit

Permalink
cmd+example: update with Status server access
Browse files Browse the repository at this point in the history
  • Loading branch information
ellemouton committed Jul 10, 2023
1 parent a4a8bd6 commit cd8c42d
Show file tree
Hide file tree
Showing 3 changed files with 12 additions and 2 deletions.
2 changes: 2 additions & 0 deletions cmd/wasm-client/go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -191,4 +191,6 @@ replace github.com/lightninglabs/lightning-node-connect => ../../

replace github.com/lightninglabs/lightning-node-connect/hashmailrpc => ../../hashmailrpc

replace github.com/lightninglabs/lightning-terminal => github.com/ellemouton/lightning-terminal f34139c610015d632754d1bd00f341e0b7bb2dad

go 1.19
2 changes: 0 additions & 2 deletions cmd/wasm-client/go.sum
Original file line number Diff line number Diff line change
Expand Up @@ -466,8 +466,6 @@ github.com/lightninglabs/faraday v0.2.11-alpha h1:c6oa8p+QUiQ1SeYhx6jZ2jo+lmjk9f
github.com/lightninglabs/faraday v0.2.11-alpha/go.mod h1:O+SNG4Op0vPwDzpM7yhNKOd8Z0MhbVzuq0VzIy2HekM=
github.com/lightninglabs/gozmq v0.0.0-20191113021534-d20a764486bf h1:HZKvJUHlcXI/f/O0Avg7t8sqkPo78HFzjmeYFl6DPnc=
github.com/lightninglabs/gozmq v0.0.0-20191113021534-d20a764486bf/go.mod h1:vxmQPeIQxPf6Jf9rM8R+B4rKBqLA2AjttNxkFBL2Plk=
github.com/lightninglabs/lightning-terminal v0.10.1-alpha.0.20230612093826-ee04747e4a34 h1:bTn1s3zTIGs2tgU24+fMZBTpXKtu1l7HPOoG0ijQn8I=
github.com/lightninglabs/lightning-terminal v0.10.1-alpha.0.20230612093826-ee04747e4a34/go.mod h1:wYu5xQ/ubiPSwMDSXI2j5AQClxxh4n8fSq0bvfgvHh4=
github.com/lightninglabs/loop v0.24.1-beta h1:SkcN5c79hWM1RBlgilwJK61hPNiBDP3IoaBLqBzb0sk=
github.com/lightninglabs/loop v0.24.1-beta/go.mod h1:rh5c7KZMNV/GOJ79n3x5qrO9h6FZT7ZZ54b6/FPIhQI=
github.com/lightninglabs/loop/swapserverrpc v1.0.4 h1:cEX+mt7xmQlEbmuQ52vOBT7l+a471v94ofdJbB6MmXs=
Expand Down
10 changes: 10 additions & 0 deletions example/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -147,6 +147,10 @@
window[namespace].wasmClientInvokeRPC('lnrpc.Lightning.' + rpcName, req, setResult);
}

async function callWASMStatus(rpcName, req) {
window[namespace].wasmClientInvokeRPC('litrpc.Status.' + rpcName, req, setResult);
}

async function callWASMLoop(rpcName, req) {
window[namespace].wasmClientInvokeRPC('looprpc.SwapClient.' + rpcName, req, setResult);
}
Expand Down Expand Up @@ -265,6 +269,9 @@
if (window[namespace].wasmClientHasPerms("wtclientrpc.WatchtowerClient.ListTowers")) {
document.getElementById('wtclientrpc').disabled = false;
}
if (window[namespace].wasmClientHasPerms("litrpc.Status.SubServerStatus")) {
document.getElementById('getstatus').disabled = false;
}
if (window[namespace].wasmClientHasPerms("looprpc.SwapClient.LoopOutTerms")) {
document.getElementById('loopoutterms').disabled = false;
}
Expand Down Expand Up @@ -352,6 +359,9 @@ <h2>LND</h2>
<button id="watchtowerrpc" onClick="callWASMDirect('watchtowerrpc.Watchtower.GetInfo', '{}');" disabled>GetInfo</button>
<button id="wtclientrpc" onClick="callWASMDirect('wtclientrpc.WatchtowerClient.ListTowers', '{}');" disabled>ListTowers</button>

<h2>Status</h2>
<button id="getstatus" onClick="callWASMStatus('SubServerStatus', '{}');" disabled>SubServerStatus</button>

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

Expand Down

0 comments on commit cd8c42d

Please sign in to comment.