add typedocs

This commit is contained in:
woodser 2022-05-01 14:12:28 -04:00
parent 2e9a350e53
commit 449d0dc750
22 changed files with 2774 additions and 12 deletions

1
docs/.nojekyll Normal file
View File

@ -0,0 +1 @@
TypeDoc added this file to prevent GitHub Pages from using Jekyll. You can turn off this behavior by setting the `githubPages` option to false.

106
docs/assets/highlight.css Normal file
View File

@ -0,0 +1,106 @@
:root {
--light-hl-0: #001080;
--dark-hl-0: #9CDCFE;
--light-hl-1: #000000;
--dark-hl-1: #D4D4D4;
--light-hl-2: #008000;
--dark-hl-2: #6A9955;
--light-hl-3: #0000FF;
--dark-hl-3: #569CD6;
--light-hl-4: #000000;
--dark-hl-4: #C8C8C8;
--light-hl-5: #267F99;
--dark-hl-5: #4EC9B0;
--light-hl-6: #0070C1;
--dark-hl-6: #4FC1FF;
--light-hl-7: #795E26;
--dark-hl-7: #DCDCAA;
--light-hl-8: #098658;
--dark-hl-8: #B5CEA8;
--light-hl-9: #AF00DB;
--dark-hl-9: #C586C0;
--light-hl-10: #A31515;
--dark-hl-10: #CE9178;
--light-hl-11: #CD3131;
--dark-hl-11: #F44747;
--light-code-background: #F5F5F5;
--dark-code-background: #1E1E1E;
}
@media (prefers-color-scheme: light) { :root {
--hl-0: var(--light-hl-0);
--hl-1: var(--light-hl-1);
--hl-2: var(--light-hl-2);
--hl-3: var(--light-hl-3);
--hl-4: var(--light-hl-4);
--hl-5: var(--light-hl-5);
--hl-6: var(--light-hl-6);
--hl-7: var(--light-hl-7);
--hl-8: var(--light-hl-8);
--hl-9: var(--light-hl-9);
--hl-10: var(--light-hl-10);
--hl-11: var(--light-hl-11);
--code-background: var(--light-code-background);
} }
@media (prefers-color-scheme: dark) { :root {
--hl-0: var(--dark-hl-0);
--hl-1: var(--dark-hl-1);
--hl-2: var(--dark-hl-2);
--hl-3: var(--dark-hl-3);
--hl-4: var(--dark-hl-4);
--hl-5: var(--dark-hl-5);
--hl-6: var(--dark-hl-6);
--hl-7: var(--dark-hl-7);
--hl-8: var(--dark-hl-8);
--hl-9: var(--dark-hl-9);
--hl-10: var(--dark-hl-10);
--hl-11: var(--dark-hl-11);
--code-background: var(--dark-code-background);
} }
body.light {
--hl-0: var(--light-hl-0);
--hl-1: var(--light-hl-1);
--hl-2: var(--light-hl-2);
--hl-3: var(--light-hl-3);
--hl-4: var(--light-hl-4);
--hl-5: var(--light-hl-5);
--hl-6: var(--light-hl-6);
--hl-7: var(--light-hl-7);
--hl-8: var(--light-hl-8);
--hl-9: var(--light-hl-9);
--hl-10: var(--light-hl-10);
--hl-11: var(--light-hl-11);
--code-background: var(--light-code-background);
}
body.dark {
--hl-0: var(--dark-hl-0);
--hl-1: var(--dark-hl-1);
--hl-2: var(--dark-hl-2);
--hl-3: var(--dark-hl-3);
--hl-4: var(--dark-hl-4);
--hl-5: var(--dark-hl-5);
--hl-6: var(--dark-hl-6);
--hl-7: var(--dark-hl-7);
--hl-8: var(--dark-hl-8);
--hl-9: var(--dark-hl-9);
--hl-10: var(--dark-hl-10);
--hl-11: var(--dark-hl-11);
--code-background: var(--dark-code-background);
}
.hl-0 { color: var(--hl-0); }
.hl-1 { color: var(--hl-1); }
.hl-2 { color: var(--hl-2); }
.hl-3 { color: var(--hl-3); }
.hl-4 { color: var(--hl-4); }
.hl-5 { color: var(--hl-5); }
.hl-6 { color: var(--hl-6); }
.hl-7 { color: var(--hl-7); }
.hl-8 { color: var(--hl-8); }
.hl-9 { color: var(--hl-9); }
.hl-10 { color: var(--hl-10); }
.hl-11 { color: var(--hl-11); }
pre, code { background: var(--code-background); }

1043
docs/assets/icons.css Normal file

File diff suppressed because it is too large Load Diff

BIN
docs/assets/icons.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 9.4 KiB

BIN
docs/assets/icons@2x.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 28 KiB

52
docs/assets/main.js Normal file

File diff suppressed because one or more lines are too long

1
docs/assets/search.js Normal file

File diff suppressed because one or more lines are too long

1414
docs/assets/style.css Normal file

File diff suppressed because it is too large Load Diff

BIN
docs/assets/widgets.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 480 B

BIN
docs/assets/widgets@2x.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 855 B

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

49
docs/index.html Normal file
View File

@ -0,0 +1,49 @@
<!DOCTYPE html><html class="default"><head><meta charSet="utf-8"/><meta http-equiv="x-ua-compatible" content="IE=edge"/><title>haveno-ui-poc</title><meta name="description" content="Documentation for haveno-ui-poc"/><meta name="viewport" content="width=device-width, initial-scale=1"/><link rel="stylesheet" href="assets/style.css"/><link rel="stylesheet" href="assets/highlight.css"/><script async src="assets/search.js" id="search-script"></script></head><body><script>document.body.classList.add(localStorage.getItem("tsd-theme") || "os")</script><header><div class="tsd-page-toolbar"><div class="container"><div class="table-wrap"><div class="table-cell" id="tsd-search" data-base="."><div class="field"><label for="tsd-search-field" class="tsd-widget search no-caption">Search</label><input type="text" id="tsd-search-field"/></div><ul class="results"><li class="state loading">Preparing search index...</li><li class="state failure">The search index is not available</li></ul><a href="index.html" class="title">haveno-ui-poc</a></div><div class="table-cell" id="tsd-widgets"><div id="tsd-filter"><a href="#" class="tsd-widget options no-caption" data-toggle="options">Options</a><div class="tsd-filter-group"><div class="tsd-select" id="tsd-filter-visibility"><span class="tsd-select-label">All</span><ul class="tsd-select-list"><li data-value="public">Public</li><li data-value="protected">Public/Protected</li><li data-value="private" class="selected">All</li></ul></div> <input type="checkbox" id="tsd-filter-inherited" checked/><label class="tsd-widget" for="tsd-filter-inherited">Inherited</label><input type="checkbox" id="tsd-filter-externals" checked/><label class="tsd-widget" for="tsd-filter-externals">Externals</label></div></div><a href="#" class="tsd-widget menu no-caption" data-toggle="menu">Menu</a></div></div></div></div><div class="tsd-page-title"><div class="container"><h1> haveno-ui-poc </h1></div></div></header><div class="container container-main"><div class="row"><div class="col-8 col-content"><div class="tsd-panel tsd-typography">
<a href="#haveno-ui-proof-of-concept" id="haveno-ui-proof-of-concept" style="color: inherit; text-decoration: none;">
<h1>Haveno UI Proof of Concept</h1>
</a>
<p>A proof of concept to fetch and render data from Haveno&#39;s daemon in ReactJS.</p>
<p>This application is a lightly modified <a href="https://github.com/facebook/create-react-app">create-react-app</a> with typescript using <a href="https://www.envoyproxy.io/">envoy proxy</a> and <a href="https://github.com/grpc/grpc-web">grpc-web</a> to use Haveno&#39;s gRPC API.</p>
<a href="#run-in-a-browser" id="run-in-a-browser" style="color: inherit; text-decoration: none;">
<h2>Run in a Browser</h2>
</a>
<ol>
<li><a href="https://github.com/haveno-dex/haveno/blob/master/docs/installing.md">Run a local Haveno test network</a>, running Alice as a daemon with <code>make alice-daemon</code>.</li>
<li>Clone this project to the same parent directory as the haveno project: <code>git clone https://github.com/haveno-dex/haveno-ui-poc</code></li>
<li>In a new terminal, start envoy with the config in haveno-ui-poc/config/envoy.yaml (change absolute path for your system): <code>docker run --rm --add-host host.docker.internal:host-gateway -it -v ~/git/haveno-ui-poc/config/envoy.yaml:/envoy.yaml -p 8080:8080 envoyproxy/envoy-dev:8a2143613d43d17d1eb35a24b4a4a4c432215606 -c /envoy.yaml</code></li>
<li>Install protobuf compiler v3.19.1 or later for your system:<br>
mac: <code>brew install protobuf</code><br>
linux: <code>apt install protobuf-compiler</code>
NOTE: You may need to upgrade to v3.19.1 manually if your package manager installs an older version.</li>
<li>Download <code>protoc-gen-grpc-web</code> plugin and make executable as <a href="https://github.com/grpc/grpc-web#code-generator-plugin">shown here</a>.</li>
<li><code>cd haveno-ui-poc</code></li>
<li><code>npm install</code></li>
<li><code>npm start</code> to open <a href="http://localhost:3000">http://localhost:3000</a> in a browser</li>
<li>Confirm that the Haveno daemon version is displayed (1.6.2).</li>
</ol>
<p align="center">
<img src="haveno-ui-poc.png" width="500"/><br>
</p>
<a href="#run-tests" id="run-tests" style="color: inherit; text-decoration: none;">
<h2>Run Tests</h2>
</a>
<p>Running the <a href="./src/haveno.test.ts">API tests</a> is the best way to develop and test Haveno end-to-end.</p>
<p><a href="./src/haveno.ts"><code>haveno.ts</code></a> provides the interface to Haveno&#39;s backend daemon.</p>
<ol>
<li><a href="https://github.com/haveno-dex/haveno/blob/master/docs/installing.md">Run a local Haveno test network</a> and then shut down the arbitrator, Alice, and Bob or run them as daemons, e.g. <code>make alice-daemon</code>. You may omit the arbitrator registration steps since it is done automatically in the tests.</li>
<li>Clone this project to the same parent directory as the haveno project: <code>git clone https://github.com/haveno-dex/haveno-ui-poc</code></li>
<li>In a new terminal, start envoy with the config in haveno-ui-poc/config/envoy.test.yaml (change absolute path for your system): <code>docker run --rm --add-host host.docker.internal:host-gateway -it -v ~/git/haveno-ui-poc/config/envoy.test.yaml:/envoy.test.yaml -p 8079:8079 -p 8080:8080 -p 8081:8081 -p 8082:8082 -p 8083:8083 -p 8084:8084 -p 8085:8085 -p 8086:8086 envoyproxy/envoy-dev:8a2143613d43d17d1eb35a24b4a4a4c432215606 -c /envoy.test.yaml</code></li>
<li>In a new terminal, start the funding wallet. This wallet will be automatically funded in order to fund Alice and Bob during the tests.<br>For example: <code>cd ~/git/haveno &amp;&amp; make funding-wallet</code>.</li>
<li>Install protobuf compiler v3.19.1 or later for your system:<br>
mac: <code>brew install protobuf</code><br>
linux: <code>apt install protobuf-compiler</code>
NOTE: You may need to upgrade to v3.19.1 manually if your package manager installs an older version.</li>
<li>Download <code>protoc-gen-grpc-web</code> plugin and make executable as <a href="https://github.com/grpc/grpc-web#code-generator-plugin">shown here</a>.</li>
<li><code>cd haveno-ui-poc</code></li>
<li><code>npm install</code></li>
<li><code>npm test</code> to run all tests or <code>npm run test -- -t &#39;my test&#39;</code> to run tests by name.</li>
</ol>
</div></div><div class="col-4 col-menu menu-sticky-wrap menu-highlight"><nav class="tsd-navigation primary"><ul><li class="current"><a href="modules.html">Modules</a></li><li class=" tsd-kind-module"><a href="modules/App.html">App</a></li><li class=" tsd-kind-module"><a href="modules/haveno.html">haveno</a></li><li class=" tsd-kind-module"><a href="modules/haveno.html">haveno</a></li><li class=" tsd-kind-module"><a href="modules/protobuf_GrpcServiceClientPb.html">protobuf/<wbr/>Grpc<wbr/>Service<wbr/>Client<wbr/>Pb</a></li><li class=" tsd-kind-module"><a href="modules/protobuf_grpc_pb.html">protobuf/grpc_<wbr/>pb</a></li><li class=" tsd-kind-module"><a href="modules/protobuf_pb_pb.html">protobuf/pb_<wbr/>pb</a></li><li class=" tsd-kind-module"><a href="modules/reportWebVitals.html">report<wbr/>Web<wbr/>Vitals</a></li><li class=" tsd-kind-module"><a href="modules/utils_HavenoUtils.html">utils/<wbr/>Haveno<wbr/>Utils</a></li><li class=" tsd-kind-module"><a href="modules/utils_TaskLooper.html">utils/<wbr/>Task<wbr/>Looper</a></li></ul></nav></div></div></div><footer class="with-border-bottom"><div class="container"><h2>Legend</h2><div class="tsd-legend-group"><ul class="tsd-legend"><li class="tsd-kind-namespace"><span class="tsd-kind-icon">Namespace</span></li><li class="tsd-kind-function"><span class="tsd-kind-icon">Function</span></li></ul><ul class="tsd-legend"><li class="tsd-kind-enum"><span class="tsd-kind-icon">Enumeration</span></li></ul><ul class="tsd-legend"><li class="tsd-kind-class"><span class="tsd-kind-icon">Class</span></li></ul></div><h2>Settings</h2><p>Theme <select id="theme"><option value="os">OS</option><option value="light">Light</option><option value="dark">Dark</option></select></p></div></footer><div class="container tsd-generator"><p>Generated using <a href="https://typedoc.org/" target="_blank">TypeDoc</a></p></div><div class="overlay"></div><script src="assets/main.js"></script></body></html>

1
docs/modules.html Normal file

File diff suppressed because one or more lines are too long

1
docs/modules/haveno.html Normal file

File diff suppressed because one or more lines are too long

View File

@ -0,0 +1 @@
<!DOCTYPE html><html class="default"><head><meta charSet="utf-8"/><meta http-equiv="x-ua-compatible" content="IE=edge"/><title>utils/HavenoUtils | haveno-ui-poc</title><meta name="description" content="Documentation for haveno-ui-poc"/><meta name="viewport" content="width=device-width, initial-scale=1"/><link rel="stylesheet" href="../assets/style.css"/><link rel="stylesheet" href="../assets/highlight.css"/><script async src="../assets/search.js" id="search-script"></script></head><body><script>document.body.classList.add(localStorage.getItem("tsd-theme") || "os")</script><header><div class="tsd-page-toolbar"><div class="container"><div class="table-wrap"><div class="table-cell" id="tsd-search" data-base=".."><div class="field"><label for="tsd-search-field" class="tsd-widget search no-caption">Search</label><input type="text" id="tsd-search-field"/></div><ul class="results"><li class="state loading">Preparing search index...</li><li class="state failure">The search index is not available</li></ul><a href="../index.html" class="title">haveno-ui-poc</a></div><div class="table-cell" id="tsd-widgets"><div id="tsd-filter"><a href="#" class="tsd-widget options no-caption" data-toggle="options">Options</a><div class="tsd-filter-group"><div class="tsd-select" id="tsd-filter-visibility"><span class="tsd-select-label">All</span><ul class="tsd-select-list"><li data-value="public">Public</li><li data-value="protected">Public/Protected</li><li data-value="private" class="selected">All</li></ul></div> <input type="checkbox" id="tsd-filter-inherited" checked/><label class="tsd-widget" for="tsd-filter-inherited">Inherited</label><input type="checkbox" id="tsd-filter-externals" checked/><label class="tsd-widget" for="tsd-filter-externals">Externals</label></div></div><a href="#" class="tsd-widget menu no-caption" data-toggle="menu">Menu</a></div></div></div></div><div class="tsd-page-title"><div class="container"><ul class="tsd-breadcrumb"><li><a href="../modules.html">haveno-ui-poc</a></li><li><a href="utils_HavenoUtils.html">utils/HavenoUtils</a></li></ul><h1>Module utils/HavenoUtils </h1></div></div></header><div class="container container-main"><div class="row"><div class="col-8 col-content"><section class="tsd-panel-group tsd-index-group"><h2>Index</h2><section class="tsd-panel tsd-index-panel"><div class="tsd-index-content"><section class="tsd-index-section "><h3>Classes</h3><ul class="tsd-index-list"><li class="tsd-kind-class tsd-parent-kind-module"><a href="../classes/utils_HavenoUtils.HavenoUtils.html" class="tsd-kind-icon">Haveno<wbr/>Utils</a></li></ul></section></div></section></section></div><div class="col-4 col-menu menu-sticky-wrap menu-highlight"><nav class="tsd-navigation primary"><ul><li class=""><a href="../modules.html">Modules</a></li><li class=" tsd-kind-module"><a href="App.html">App</a></li><li class=" tsd-kind-module"><a href="haveno.html">haveno</a></li><li class=" tsd-kind-module"><a href="haveno.html">haveno</a></li><li class=" tsd-kind-module"><a href="protobuf_GrpcServiceClientPb.html">protobuf/<wbr/>Grpc<wbr/>Service<wbr/>Client<wbr/>Pb</a></li><li class=" tsd-kind-module"><a href="protobuf_grpc_pb.html">protobuf/grpc_<wbr/>pb</a></li><li class=" tsd-kind-module"><a href="protobuf_pb_pb.html">protobuf/pb_<wbr/>pb</a></li><li class=" tsd-kind-module"><a href="reportWebVitals.html">report<wbr/>Web<wbr/>Vitals</a></li><li class="current tsd-kind-module"><a href="utils_HavenoUtils.html">utils/<wbr/>Haveno<wbr/>Utils</a></li><li class=" tsd-kind-module"><a href="utils_TaskLooper.html">utils/<wbr/>Task<wbr/>Looper</a></li></ul></nav><nav class="tsd-navigation secondary menu-sticky"><ul><li class="tsd-kind-class tsd-parent-kind-module"><a href="../classes/utils_HavenoUtils.HavenoUtils.html" class="tsd-kind-icon">Haveno<wbr/>Utils</a></li></ul></nav></div></div></div><footer class="with-border-bottom"><div class="container"><h2>Legend</h2><div class="tsd-legend-group"><ul class="tsd-legend"><li class="tsd-kind-namespace"><span class="tsd-kind-icon">Namespace</span></li><li class="tsd-kind-function"><span class="tsd-kind-icon">Function</span></li></ul><ul class="tsd-legend"><li class="tsd-kind-enum"><span class="tsd-kind-icon">Enumeration</span></li></ul><ul class="tsd-legend"><li class="tsd-kind-class"><span class="tsd-kind-icon">Class</span></li></ul></div><h2>Settings</h2><p>Theme <select id="theme"><option value="os">OS</option><option value="light">Light</option><option value="dark">Dark</option></select></p></div></footer><div class="container tsd-generator"><p>Generated using <a href="https://typedoc.org/" target="_blank">TypeDoc</a></p></div><div class="overlay"></div><script src="../assets/main.js"></script></body></html>

View File

@ -0,0 +1 @@
<!DOCTYPE html><html class="default"><head><meta charSet="utf-8"/><meta http-equiv="x-ua-compatible" content="IE=edge"/><title>utils/TaskLooper | haveno-ui-poc</title><meta name="description" content="Documentation for haveno-ui-poc"/><meta name="viewport" content="width=device-width, initial-scale=1"/><link rel="stylesheet" href="../assets/style.css"/><link rel="stylesheet" href="../assets/highlight.css"/><script async src="../assets/search.js" id="search-script"></script></head><body><script>document.body.classList.add(localStorage.getItem("tsd-theme") || "os")</script><header><div class="tsd-page-toolbar"><div class="container"><div class="table-wrap"><div class="table-cell" id="tsd-search" data-base=".."><div class="field"><label for="tsd-search-field" class="tsd-widget search no-caption">Search</label><input type="text" id="tsd-search-field"/></div><ul class="results"><li class="state loading">Preparing search index...</li><li class="state failure">The search index is not available</li></ul><a href="../index.html" class="title">haveno-ui-poc</a></div><div class="table-cell" id="tsd-widgets"><div id="tsd-filter"><a href="#" class="tsd-widget options no-caption" data-toggle="options">Options</a><div class="tsd-filter-group"><div class="tsd-select" id="tsd-filter-visibility"><span class="tsd-select-label">All</span><ul class="tsd-select-list"><li data-value="public">Public</li><li data-value="protected">Public/Protected</li><li data-value="private" class="selected">All</li></ul></div> <input type="checkbox" id="tsd-filter-inherited" checked/><label class="tsd-widget" for="tsd-filter-inherited">Inherited</label><input type="checkbox" id="tsd-filter-externals" checked/><label class="tsd-widget" for="tsd-filter-externals">Externals</label></div></div><a href="#" class="tsd-widget menu no-caption" data-toggle="menu">Menu</a></div></div></div></div><div class="tsd-page-title"><div class="container"><ul class="tsd-breadcrumb"><li><a href="../modules.html">haveno-ui-poc</a></li><li><a href="utils_TaskLooper.html">utils/TaskLooper</a></li></ul><h1>Module utils/TaskLooper </h1></div></div></header><div class="container container-main"><div class="row"><div class="col-8 col-content"><section class="tsd-panel-group tsd-index-group"><h2>Index</h2><section class="tsd-panel tsd-index-panel"><div class="tsd-index-content"><section class="tsd-index-section "><h3>Classes</h3><ul class="tsd-index-list"><li class="tsd-kind-class tsd-parent-kind-module"><a href="../classes/utils_TaskLooper.TaskLooper.html" class="tsd-kind-icon">Task<wbr/>Looper</a></li></ul></section></div></section></section></div><div class="col-4 col-menu menu-sticky-wrap menu-highlight"><nav class="tsd-navigation primary"><ul><li class=""><a href="../modules.html">Modules</a></li><li class=" tsd-kind-module"><a href="App.html">App</a></li><li class=" tsd-kind-module"><a href="haveno.html">haveno</a></li><li class=" tsd-kind-module"><a href="haveno.html">haveno</a></li><li class=" tsd-kind-module"><a href="protobuf_GrpcServiceClientPb.html">protobuf/<wbr/>Grpc<wbr/>Service<wbr/>Client<wbr/>Pb</a></li><li class=" tsd-kind-module"><a href="protobuf_grpc_pb.html">protobuf/grpc_<wbr/>pb</a></li><li class=" tsd-kind-module"><a href="protobuf_pb_pb.html">protobuf/pb_<wbr/>pb</a></li><li class=" tsd-kind-module"><a href="reportWebVitals.html">report<wbr/>Web<wbr/>Vitals</a></li><li class=" tsd-kind-module"><a href="utils_HavenoUtils.html">utils/<wbr/>Haveno<wbr/>Utils</a></li><li class="current tsd-kind-module"><a href="utils_TaskLooper.html">utils/<wbr/>Task<wbr/>Looper</a></li></ul></nav><nav class="tsd-navigation secondary menu-sticky"><ul><li class="tsd-kind-class tsd-parent-kind-module"><a href="../classes/utils_TaskLooper.TaskLooper.html" class="tsd-kind-icon">Task<wbr/>Looper</a></li></ul></nav></div></div></div><footer class="with-border-bottom"><div class="container"><h2>Legend</h2><div class="tsd-legend-group"><ul class="tsd-legend"><li class="tsd-kind-namespace"><span class="tsd-kind-icon">Namespace</span></li><li class="tsd-kind-function"><span class="tsd-kind-icon">Function</span></li></ul><ul class="tsd-legend"><li class="tsd-kind-enum"><span class="tsd-kind-icon">Enumeration</span></li></ul><ul class="tsd-legend"><li class="tsd-kind-class"><span class="tsd-kind-icon">Class</span></li></ul></div><h2>Settings</h2><p>Theme <select id="theme"><option value="os">OS</option><option value="light">Light</option><option value="dark">Dark</option></select></p></div></footer><div class="container tsd-generator"><p>Generated using <a href="https://typedoc.org/" target="_blank">TypeDoc</a></p></div><div class="overlay"></div><script src="../assets/main.js"></script></body></html>

36
package-lock.json generated
View File

@ -33,7 +33,9 @@
"eslint-plugin-import": "^2.26.0",
"eslint-plugin-jsx-a11y": "^6.5.1",
"monero-javascript": "^0.6.4",
"typedoc": "^0.22.15"
"typedoc": "^0.22.15",
"typedoc-plugin-missing-exports": "^0.22.6",
"typedoc-plugin-rename-defaults": "^0.5.1"
}
},
"node_modules/@ampproject/remapping": {
@ -19006,6 +19008,24 @@
"typescript": "4.0.x || 4.1.x || 4.2.x || 4.3.x || 4.4.x || 4.5.x || 4.6.x"
}
},
"node_modules/typedoc-plugin-missing-exports": {
"version": "0.22.6",
"resolved": "https://registry.npmjs.org/typedoc-plugin-missing-exports/-/typedoc-plugin-missing-exports-0.22.6.tgz",
"integrity": "sha512-1uguGQqa+c5f33nWS3v1mm0uAx4Ii1lw4Kx2zQksmYFKNEWTmrmMXbMNBoBg4wu0p4dFCNC7JIWPoRzpNS6pFA==",
"dev": true,
"peerDependencies": {
"typedoc": "0.22.x"
}
},
"node_modules/typedoc-plugin-rename-defaults": {
"version": "0.5.1",
"resolved": "https://registry.npmjs.org/typedoc-plugin-rename-defaults/-/typedoc-plugin-rename-defaults-0.5.1.tgz",
"integrity": "sha512-1YMk56/LrYV61c3oWYZuua/y5W0Zy/u6gaXZ1iWwxiUXEg9UG/Z83HuFrPT5rMcjlQSxwcVTayWbLStPTz9Aog==",
"dev": true,
"peerDependencies": {
"typedoc": "0.22.x"
}
},
"node_modules/typedoc/node_modules/brace-expansion": {
"version": "2.0.1",
"resolved": "https://registry.npmjs.org/brace-expansion/-/brace-expansion-2.0.1.tgz",
@ -35837,6 +35857,20 @@
}
}
},
"typedoc-plugin-missing-exports": {
"version": "0.22.6",
"resolved": "https://registry.npmjs.org/typedoc-plugin-missing-exports/-/typedoc-plugin-missing-exports-0.22.6.tgz",
"integrity": "sha512-1uguGQqa+c5f33nWS3v1mm0uAx4Ii1lw4Kx2zQksmYFKNEWTmrmMXbMNBoBg4wu0p4dFCNC7JIWPoRzpNS6pFA==",
"dev": true,
"requires": {}
},
"typedoc-plugin-rename-defaults": {
"version": "0.5.1",
"resolved": "https://registry.npmjs.org/typedoc-plugin-rename-defaults/-/typedoc-plugin-rename-defaults-0.5.1.tgz",
"integrity": "sha512-1YMk56/LrYV61c3oWYZuua/y5W0Zy/u6gaXZ1iWwxiUXEg9UG/Z83HuFrPT5rMcjlQSxwcVTayWbLStPTz9Aog==",
"dev": true,
"requires": {}
},
"typescript": {
"version": "4.6.4",
"resolved": "https://registry.npmjs.org/typescript/-/typescript-4.6.4.tgz",

View File

@ -26,9 +26,9 @@
"eject": "react-scripts eject",
"prepare": "bin/build_protobuf.sh",
"pretest": "bin/build_protobuf.sh",
"lint": "eslint .",
"eslint": "eslint .",
"eslintfix": "eslint src/* --fix",
"typedoc": "typedoc ./src/haveno.ts --exclude **/*.test.ts --excludeNotDocumented"
"typedoc": "typedoc ./src/haveno.ts --entryPointStrategy expand src/ --exclude **/*.test.ts"
},
"browserslist": {
"production": [
@ -51,6 +51,8 @@
"eslint-plugin-import": "^2.26.0",
"eslint-plugin-jsx-a11y": "^6.5.1",
"monero-javascript": "^0.6.4",
"typedoc": "^0.22.15"
"typedoc": "^0.22.15",
"typedoc-plugin-missing-exports": "^0.22.6",
"typedoc-plugin-rename-defaults": "^0.5.1"
}
}

View File

@ -1,7 +1,7 @@
import React from 'react';
import logo from './logo.png';
import './App.css';
import HavenoClient from './haveno';
import { HavenoClient } from './haveno';
const HAVENO_DAEMON_URL = "http://localhost:8080";
const HAVENO_DAEMON_PASSWORD = "apitest";

View File

@ -1,7 +1,7 @@
// --------------------------------- IMPORTS ----------------------------------
// import haveno types
import HavenoClient from "./haveno";
import { HavenoClient } from "./haveno";
import HavenoUtils from "./utils/HavenoUtils";
import * as grpcWeb from "grpc-web";
import { MarketPriceInfo, NotificationMessage, OfferInfo, TradeInfo, UrlConnection, XmrBalanceInfo } from "./protobuf/grpc_pb"; // TODO (woodser): better names; haveno_grpc_pb, haveno_pb

View File

@ -9,7 +9,7 @@ import { PaymentMethod, PaymentAccount, AvailabilityResult, Attachment, DisputeR
/**
* Haveno daemon client using gRPC.
*/
export default class HavenoClient {
class HavenoClient {
// grpc clients
_appName: string | undefined;
@ -1197,6 +1197,8 @@ export default class HavenoClient {
* Ideally when the application starts, the system checks the Haveno network connection, supporting
* havenod.isHavenoConnectionInitialized() and havenod.awaitHavenoConnectionInitialized().
* Independently, gRPC createAccount() and openAccount() return after all account setup and reading from disk.
*
* @hidden
*/
async _awaitAppInitialized(): Promise<void> {
// eslint-disable-next-line no-async-promise-executor
@ -1216,6 +1218,7 @@ export default class HavenoClient {
});
}
// @hidden
async _isAppInitialized(): Promise<boolean> {
return new Promise((resolve, reject) => {
this._accountClient.isAppInitialized(new IsAppInitializedRequest(), {password: this._password}, function(err: grpcWeb.RpcError, response: IsAppInitializedReply) {
@ -1230,6 +1233,8 @@ export default class HavenoClient {
* Register a listener to receive notifications.
* Due to the nature of grpc streaming, this method returns a promise
* which may be resolved before the listener is actually registered.
*
* @hidden
*/
async _registerNotificationListenerOnce(): Promise<void> {
if (this._registerNotificationListenerCalled) return;
@ -1264,6 +1269,7 @@ export default class HavenoClient {
/**
* Send a notification.
*
* @hidden
* @param {NotificationMessage} notification - notification to send
*/
async _sendNotification(notification: NotificationMessage): Promise<void> {
@ -1277,6 +1283,8 @@ export default class HavenoClient {
/**
* Restore an account chunk from zip bytes.
*
* @hidden
*/
async _restoreAccountChunk(zipBytes: Uint8Array, offset: number, totalLength: number, hasMore: boolean): Promise<void> {
const request = new RestoreAccountRequest()
@ -1292,3 +1300,5 @@ export default class HavenoClient {
});
}
}
export { HavenoClient };