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 11, 2023
1 parent a4a8bd6 commit 5d666a8
Show file tree
Hide file tree
Showing 3 changed files with 14 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 v0.6.1-alpha.0.20230710092045-f34139c61001

go 1.19
4 changes: 2 additions & 2 deletions cmd/wasm-client/go.sum
Original file line number Diff line number Diff line change
Expand Up @@ -179,6 +179,8 @@ github.com/dsnet/compress v0.0.1/go.mod h1:Aw8dCMJ7RioblQeTqt88akK31OvO8Dhf5Jflh
github.com/dsnet/golib v0.0.0-20171103203638-1ea166775780/go.mod h1:Lj+Z9rebOhdfkVLjJ8T6VcRQv3SXugXy999NBtR9aFY=
github.com/dustin/go-humanize v1.0.0 h1:VSnTsYCnlFHaM2/igO1h6X3HA71jcobQuxemgkq4zYo=
github.com/dustin/go-humanize v1.0.0/go.mod h1:HtrtbFcZ19U5GC7JDqmcUSB87Iq5E25KnS6fMYU6eOk=
github.com/ellemouton/lightning-terminal v0.6.1-alpha.0.20230710092045-f34139c61001 h1:/PD6I8RKtq0vSJeHf6FmM01UiQ8kInW3RqPMYu5Rjxw=
github.com/ellemouton/lightning-terminal v0.6.1-alpha.0.20230710092045-f34139c61001/go.mod h1:IcbXojNWnw0kQvnNThYXd8Rkx3qDL6HBSwifGZwfx2s=
github.com/envoyproxy/go-control-plane v0.9.0/go.mod h1:YTl/9mNaCwkRvm6d1a2C3ymFceY/DCBVvsKhRF0iEA4=
github.com/envoyproxy/go-control-plane v0.9.1-0.20191026205805-5f8ba28d4473/go.mod h1:YTl/9mNaCwkRvm6d1a2C3ymFceY/DCBVvsKhRF0iEA4=
github.com/envoyproxy/go-control-plane v0.9.4/go.mod h1:6rpuAdCZL397s3pYoYcLgu1mIlRU8Am5FuJP05cCM98=
Expand Down Expand Up @@ -466,8 +468,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 5d666a8

Please sign in to comment.